fix/remove legacy ui (#5010)
This commit is contained in:
1 parent
1cb8d328a4
commit
4be8495335
321 files changed
+24
-18605
No files matched your search
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Calculates the maximum number of digits required to display a value based on the maximum value and step size.
|
||||
* @param maxValue - The maximum value to display.
|
||||
* @param step - The step size between values.
|
||||
* @returns The maximum number of digits required to display a value.
|
||||
*/
|
||||
const getMaxDigits = (maxValue: number, step: number) => {
|
||||
if (step <= 0) {
|
||||
throw new Error('Step should be greater than zero');
|
||||
}
|
||||
|
||||
// Get the number of integer digits for maxValue
|
||||
const integerDigits = maxValue.toString().split('.')[0].length;
|
||||
const decimalDigits = step % 1 === 0 ? 0 : step.toString().split('.')[1].length;
|
||||
|
||||
return integerDigits + (decimalDigits ? decimalDigits + 1 : 0);
|
||||
};
|
||||
|
||||
export default getMaxDigits;
|
||||
@@ -1,26 +0,0 @@
|
||||
export default (element, onClickOutside) => {
|
||||
const clickOutsideHandler = event => {
|
||||
if (element.current && !element.current.contains(event.target)) {
|
||||
onClickOutside();
|
||||
if (typeof window !== 'undefined') {
|
||||
window.removeEventListener('mousedown', clickOutsideHandler);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const add = () => {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.addEventListener('mousedown', clickOutsideHandler);
|
||||
}
|
||||
};
|
||||
const remove = () => {
|
||||
if (typeof window !== 'undefined') {
|
||||
window.removeEventListener('mousedown', clickOutsideHandler);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
add,
|
||||
remove,
|
||||
};
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
const viewportLabels = [
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'G',
|
||||
'H',
|
||||
'I',
|
||||
'J',
|
||||
'K',
|
||||
'L',
|
||||
'M',
|
||||
'N',
|
||||
'O',
|
||||
'P',
|
||||
'Q',
|
||||
'R',
|
||||
'S',
|
||||
'T',
|
||||
'U',
|
||||
'V',
|
||||
'W',
|
||||
'X',
|
||||
'Y',
|
||||
'Z',
|
||||
];
|
||||
|
||||
export default viewportLabels;
|
||||
Reference in new issue
Block a user