@hh.ru/magritte-ui-input 9.4.51 → 9.4.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseInput.d.ts +2 -2
- package/BaseInput.js +235 -124
- package/BaseInput.js.map +1 -1
- package/DateTimeInput.d.ts +4 -4
- package/DateTimeInput.js +49 -43
- package/DateTimeInput.js.map +1 -1
- package/Input.d.ts +2 -2
- package/Input.js +2 -3
- package/Input.js.map +1 -1
- package/NumberInput.d.ts +2 -2
- package/NumberInput.js +22 -13
- package/NumberInput.js.map +1 -1
- package/PasswordInput.d.ts +2 -2
- package/PasswordInput.js +29 -16
- package/PasswordInput.js.map +1 -1
- package/SearchInput.d.ts +2 -2
- package/SearchInput.js +11 -2
- package/SearchInput.js.map +1 -1
- package/UncontrolledDateTimeInput.d.ts +4 -4
- package/UncontrolledDateTimeInput.js +4 -4
- package/UncontrolledDateTimeInput.js.map +1 -1
- package/UncontrolledInput.d.ts +2 -2
- package/UncontrolledInput.js +3 -3
- package/UncontrolledInput.js.map +1 -1
- package/UncontrolledNumberInput.d.ts +2 -2
- package/UncontrolledNumberInput.js +3 -3
- package/UncontrolledNumberInput.js.map +1 -1
- package/UncontrolledPasswordInput.d.ts +2 -2
- package/UncontrolledPasswordInput.js +3 -3
- package/UncontrolledPasswordInput.js.map +1 -1
- package/UncontrolledSearchInput.d.ts +2 -2
- package/UncontrolledSearchInput.js +3 -3
- package/UncontrolledSearchInput.js.map +1 -1
- package/index.css +266 -266
- package/index.d.ts +13 -13
- package/{index.esm-BVoBfbo-.js → index.esm-t97x9DTo.js} +1 -1
- package/{index.esm-BVoBfbo-.js.map → index.esm-t97x9DTo.js.map} +1 -1
- package/index.js +1 -1
- package/index.mock.d.ts +1 -1
- package/index.mock.js +55 -27
- package/index.mock.js.map +1 -1
- package/maskito-exports.js +1 -1
- package/numberFormatter.d.ts +1 -1
- package/numberFormatter.js +42 -42
- package/numberFormatter.js.map +1 -1
- package/package.json +7 -7
- package/useDateTimeMask.d.ts +1 -1
- package/useDateTimeMask.js +107 -133
- package/useDateTimeMask.js.map +1 -1
- package/useFocus.js +22 -13
- package/useFocus.js.map +1 -1
- package/useInputAriaProps.js +16 -10
- package/useInputAriaProps.js.map +1 -1
- package/useUncontrolledInput.js +9 -6
- package/useUncontrolledInput.js.map +1 -1
package/index.js
CHANGED
|
@@ -27,6 +27,6 @@ import './useFocus.js';
|
|
|
27
27
|
import '@hh.ru/magritte-ui-typography';
|
|
28
28
|
import '@hh.ru/magritte-common-number-formatter';
|
|
29
29
|
import './useDateTimeMask.js';
|
|
30
|
-
import './index.esm-
|
|
30
|
+
import './index.esm-t97x9DTo.js';
|
|
31
31
|
import './useUncontrolledInput.js';
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
package/index.mock.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent } from 'react';
|
|
2
|
-
export { type InputSize } from '
|
|
2
|
+
export { type InputSize } from './types';
|
|
3
3
|
export declare const Input: ForwardRefExoticComponent<Record<string, unknown>>;
|
|
4
4
|
export declare const PasswordInput: ForwardRefExoticComponent<Record<string, unknown>>;
|
|
5
5
|
export declare const NumberInput: ForwardRefExoticComponent<Record<string, unknown>>;
|
package/index.mock.js
CHANGED
|
@@ -1,36 +1,64 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
|
|
3
3
|
|
|
4
|
-
const Input = mockComponent(
|
|
5
|
-
|
|
4
|
+
const Input = mockComponent("Input", void 0, {
|
|
5
|
+
withChildren: false
|
|
6
6
|
});
|
|
7
|
-
const PasswordInput = mockComponent(
|
|
8
|
-
|
|
7
|
+
const PasswordInput = mockComponent(
|
|
8
|
+
"PasswordInput",
|
|
9
|
+
void 0,
|
|
10
|
+
{
|
|
11
|
+
withChildren: false
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
const NumberInput = mockComponent("NumberInput", void 0, {
|
|
15
|
+
withChildren: false
|
|
9
16
|
});
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
const SearchInput = mockComponent('SearchInput', undefined, {
|
|
14
|
-
withChildren: false,
|
|
15
|
-
});
|
|
16
|
-
const DateTimeInput = mockComponent('DateTimeInput', undefined, {
|
|
17
|
-
withChildren: false,
|
|
18
|
-
});
|
|
19
|
-
const UncontrolledInput = mockComponent('UncontrolledInput', undefined, {
|
|
20
|
-
withChildren: false,
|
|
21
|
-
});
|
|
22
|
-
const UncontrolledPasswordInput = mockComponent('UncontrolledPasswordInput', undefined, {
|
|
23
|
-
withChildren: false,
|
|
24
|
-
});
|
|
25
|
-
const UncontrolledNumberInput = mockComponent('UncontrolledNumberInput', undefined, {
|
|
26
|
-
withChildren: false,
|
|
27
|
-
});
|
|
28
|
-
const UncontrolledSearchInput = mockComponent('UncontrolledSearchInput', undefined, {
|
|
29
|
-
withChildren: false,
|
|
30
|
-
});
|
|
31
|
-
const UncontrolledDateTimeInput = mockComponent('UncontrolledDateTimeInput', undefined, {
|
|
32
|
-
withChildren: false,
|
|
17
|
+
const SearchInput = mockComponent("SearchInput", void 0, {
|
|
18
|
+
withChildren: false
|
|
33
19
|
});
|
|
20
|
+
const DateTimeInput = mockComponent(
|
|
21
|
+
"DateTimeInput",
|
|
22
|
+
void 0,
|
|
23
|
+
{
|
|
24
|
+
withChildren: false
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const UncontrolledInput = mockComponent(
|
|
28
|
+
"UncontrolledInput",
|
|
29
|
+
void 0,
|
|
30
|
+
{
|
|
31
|
+
withChildren: false
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
const UncontrolledPasswordInput = mockComponent(
|
|
35
|
+
"UncontrolledPasswordInput",
|
|
36
|
+
void 0,
|
|
37
|
+
{
|
|
38
|
+
withChildren: false
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
const UncontrolledNumberInput = mockComponent(
|
|
42
|
+
"UncontrolledNumberInput",
|
|
43
|
+
void 0,
|
|
44
|
+
{
|
|
45
|
+
withChildren: false
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
const UncontrolledSearchInput = mockComponent(
|
|
49
|
+
"UncontrolledSearchInput",
|
|
50
|
+
void 0,
|
|
51
|
+
{
|
|
52
|
+
withChildren: false
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
const UncontrolledDateTimeInput = mockComponent(
|
|
56
|
+
"UncontrolledDateTimeInput",
|
|
57
|
+
void 0,
|
|
58
|
+
{
|
|
59
|
+
withChildren: false
|
|
60
|
+
}
|
|
61
|
+
);
|
|
34
62
|
|
|
35
63
|
export { DateTimeInput, Input, NumberInput, PasswordInput, SearchInput, UncontrolledDateTimeInput, UncontrolledInput, UncontrolledNumberInput, UncontrolledPasswordInput, UncontrolledSearchInput };
|
|
36
64
|
//# sourceMappingURL=index.mock.js.map
|
package/index.mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type InputSize } from '@hh.ru/magritte-ui-input/types';\n\nexport const Input: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('Input', undefined, {\n withChildren: false,\n});\n\nexport const PasswordInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'PasswordInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const NumberInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('NumberInput', undefined, {\n withChildren: false,\n});\n\nexport const SearchInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('SearchInput', undefined, {\n withChildren: false,\n});\n\nexport const DateTimeInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'DateTimeInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledPasswordInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledPasswordInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledNumberInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledNumberInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledSearchInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledSearchInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledDateTimeInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledDateTimeInput',\n undefined,\n {\n withChildren: false,\n }\n);\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type InputSize } from '@hh.ru/magritte-ui-input/types';\n\nexport const Input: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('Input', undefined, {\n withChildren: false,\n});\n\nexport const PasswordInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'PasswordInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const NumberInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('NumberInput', undefined, {\n withChildren: false,\n});\n\nexport const SearchInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('SearchInput', undefined, {\n withChildren: false,\n});\n\nexport const DateTimeInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'DateTimeInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledPasswordInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledPasswordInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledNumberInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledNumberInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledSearchInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledSearchInput',\n undefined,\n {\n withChildren: false,\n }\n);\n\nexport const UncontrolledDateTimeInput: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'UncontrolledDateTimeInput',\n undefined,\n {\n withChildren: false,\n }\n);\n"],"names":[],"mappings":";;AAMa,MAAA,KAAA,GAA4D,aAAc,CAAA,OAAA,EAAS,KAAW,CAAA,EAAA;AAAA,EACvG,YAAc,EAAA,KAAA;AAClB,CAAC,EAAA;AAEM,MAAM,aAAoE,GAAA,aAAA;AAAA,EAC7E,eAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ,EAAA;AAEa,MAAA,WAAA,GAAkE,aAAc,CAAA,aAAA,EAAe,KAAW,CAAA,EAAA;AAAA,EACnH,YAAc,EAAA,KAAA;AAClB,CAAC,EAAA;AAEY,MAAA,WAAA,GAAkE,aAAc,CAAA,aAAA,EAAe,KAAW,CAAA,EAAA;AAAA,EACnH,YAAc,EAAA,KAAA;AAClB,CAAC,EAAA;AAEM,MAAM,aAAoE,GAAA,aAAA;AAAA,EAC7E,eAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ,EAAA;AAEO,MAAM,iBAAwE,GAAA,aAAA;AAAA,EACjF,mBAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ,EAAA;AAEO,MAAM,yBAAgF,GAAA,aAAA;AAAA,EACzF,2BAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ,EAAA;AAEO,MAAM,uBAA8E,GAAA,aAAA;AAAA,EACvF,yBAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ,EAAA;AAEO,MAAM,uBAA8E,GAAA,aAAA;AAAA,EACvF,yBAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ,EAAA;AAEO,MAAM,yBAAgF,GAAA,aAAA;AAAA,EACzF,2BAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,KAAA;AAAA,GAClB;AACJ;;;;"}
|
package/maskito-exports.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
export { M as MASKITO_DEFAULT_OPTIONS, m as maskitoDateOptionsGenerator, a as maskitoDateRangeOptionsGenerator, b as maskitoDateTimeOptionsGenerator, c as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-
|
|
2
|
+
export { M as MASKITO_DEFAULT_OPTIONS, m as maskitoDateOptionsGenerator, a as maskitoDateRangeOptionsGenerator, b as maskitoDateTimeOptionsGenerator, c as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-t97x9DTo.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
//# sourceMappingURL=maskito-exports.js.map
|
package/numberFormatter.d.ts
CHANGED
package/numberFormatter.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { defaults, format } from '@hh.ru/magritte-common-number-formatter';
|
|
3
3
|
|
|
4
|
-
const calculateDelimiters = (rawText, formatted, groupSeparator, caretPosition) => formatted.substring(0, caretPosition).split(groupSeparator).length -
|
|
5
|
-
rawText.trim().substring(0, caretPosition).split(groupSeparator).length;
|
|
4
|
+
const calculateDelimiters = (rawText, formatted, groupSeparator, caretPosition) => formatted.substring(0, caretPosition).split(groupSeparator).length - rawText.trim().substring(0, caretPosition).split(groupSeparator).length;
|
|
6
5
|
const numberFormatterFactory = (passedParams = {}) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
const filteredParams = Object.keys(passedParams).reduce(
|
|
7
|
+
(acc, key) => passedParams[key] === void 0 ? acc : {
|
|
8
|
+
...acc,
|
|
9
|
+
[key]: passedParams[key]
|
|
10
|
+
},
|
|
11
|
+
{}
|
|
12
|
+
);
|
|
13
|
+
const params = { ...defaults, ...filteredParams };
|
|
14
|
+
const ouputFormatParams = {
|
|
15
|
+
groupSeparator: "",
|
|
16
|
+
decimalMark: [".", ...params.decimalMark],
|
|
17
|
+
allowNegative: params.allowNegative,
|
|
18
|
+
decimalLength: params.decimalLength
|
|
19
|
+
};
|
|
20
|
+
const decimalDelimitersRegExp = new RegExp(`[${params.decimalMark?.join("")}]`, "g");
|
|
21
|
+
const allowedChars = [...params.decimalMark];
|
|
22
|
+
if (params.allowNegative) {
|
|
23
|
+
allowedChars.push("-");
|
|
24
|
+
}
|
|
25
|
+
const disallowedCharsRegExp = new RegExp(`[^\\d${allowedChars.join("")}]`, "g");
|
|
26
|
+
return (prevValue, value, caretPosition) => {
|
|
27
|
+
const val = params.maxLength ? value.replace(disallowedCharsRegExp, "").substring(0, params.maxLength) : value;
|
|
28
|
+
const decimalDelimitersCount = val.match(decimalDelimitersRegExp)?.length || 0;
|
|
29
|
+
if (decimalDelimitersCount > 1) {
|
|
30
|
+
const lastChar2 = prevValue.charAt(val.length - 1);
|
|
31
|
+
const formattedValue2 = format(prevValue, params) + (params.decimalMark.includes(lastChar2) ? lastChar2 : "");
|
|
32
|
+
const decimalDelimitersPosition = formattedValue2.search(decimalDelimitersRegExp);
|
|
33
|
+
return {
|
|
34
|
+
formattedValue: formattedValue2,
|
|
35
|
+
outputValue: format(prevValue, ouputFormatParams) + (params.decimalMark.includes(lastChar2) ? lastChar2 : ""),
|
|
36
|
+
caretPosition: decimalDelimitersPosition + 1
|
|
37
|
+
};
|
|
24
38
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
formattedValue,
|
|
35
|
-
outputValue: format(prevValue, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : ''),
|
|
36
|
-
caretPosition: decimalDelimitersPosition + 1,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const lastChar = val.charAt(val.length - 1);
|
|
40
|
-
const formattedValue = format(val, params) + (params.decimalMark.includes(lastChar) ? lastChar : '');
|
|
41
|
-
const outputValue = format(val, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : '');
|
|
42
|
-
const caret = caretPosition + calculateDelimiters(value, formattedValue, params.groupSeparator, caretPosition);
|
|
43
|
-
return {
|
|
44
|
-
formattedValue,
|
|
45
|
-
outputValue,
|
|
46
|
-
caretPosition: caret,
|
|
47
|
-
};
|
|
39
|
+
const lastChar = val.charAt(val.length - 1);
|
|
40
|
+
const formattedValue = format(val, params) + (params.decimalMark.includes(lastChar) ? lastChar : "");
|
|
41
|
+
const outputValue = format(val, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : "");
|
|
42
|
+
const caret = caretPosition + calculateDelimiters(value, formattedValue, params.groupSeparator, caretPosition);
|
|
43
|
+
return {
|
|
44
|
+
formattedValue,
|
|
45
|
+
outputValue,
|
|
46
|
+
caretPosition: caret
|
|
48
47
|
};
|
|
48
|
+
};
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
export { numberFormatterFactory };
|
package/numberFormatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberFormatter.js","sources":["src/numberFormatter.ts"],"sourcesContent":["import { format, type FormatParams, defaults } from '@hh.ru/magritte-common-number-formatter';\nimport { InputFormatter } from '@hh.ru/magritte-ui-input/types';\n\nconst calculateDelimiters = (\n rawText: string,\n formatted: string,\n groupSeparator: string,\n caretPosition: number\n): number =>\n formatted.substring(0, caretPosition).split(groupSeparator).length -\n rawText.trim().substring(0, caretPosition).split(groupSeparator).length;\n\ntype Params = FormatParams & { maxLength?: number };\n\nexport const numberFormatterFactory: (params?: Params) => InputFormatter = (passedParams = {}) => {\n const filteredParams = (Object.keys(passedParams) as Array<keyof typeof passedParams>).reduce<Params>(\n (acc, key) =>\n passedParams[key] === undefined\n ? acc\n : {\n ...acc,\n [key]: passedParams[key],\n },\n {}\n );\n const params = { ...defaults, ...filteredParams };\n const ouputFormatParams = {\n groupSeparator: '',\n decimalMark: ['.', ...params.decimalMark],\n allowNegative: params.allowNegative,\n decimalLength: params.decimalLength,\n };\n const decimalDelimitersRegExp = new RegExp(`[${params.decimalMark?.join('')}]`, 'g');\n const allowedChars = [...params.decimalMark];\n if (params.allowNegative) {\n allowedChars.push('-');\n }\n const disallowedCharsRegExp = new RegExp(`[^\\\\d${allowedChars.join('')}]`, 'g');\n\n return (prevValue: string, value: string, caretPosition: number) => {\n const val = params.maxLength ? value.replace(disallowedCharsRegExp, '').substring(0, params.maxLength) : value;\n const decimalDelimitersCount = val.match(decimalDelimitersRegExp)?.length || 0;\n if (decimalDelimitersCount > 1) {\n const lastChar = prevValue.charAt(val.length - 1);\n const formattedValue = format(prevValue, params) + (params.decimalMark.includes(lastChar) ? lastChar : '');\n const decimalDelimitersPosition = formattedValue.search(decimalDelimitersRegExp);\n return {\n formattedValue,\n outputValue:\n format(prevValue, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : ''),\n caretPosition: decimalDelimitersPosition + 1,\n };\n }\n const lastChar = val.charAt(val.length - 1);\n const formattedValue = format(val, params) + (params.decimalMark.includes(lastChar) ? lastChar : '');\n const outputValue = format(val, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : '');\n const caret = caretPosition + calculateDelimiters(value, formattedValue, params.groupSeparator, caretPosition);\n\n return {\n formattedValue,\n outputValue,\n caretPosition: caret,\n };\n };\n};\n"],"names":[],"mappings":";;AAGA,MAAM,
|
|
1
|
+
{"version":3,"file":"numberFormatter.js","sources":["src/numberFormatter.ts"],"sourcesContent":["import { format, type FormatParams, defaults } from '@hh.ru/magritte-common-number-formatter';\nimport { InputFormatter } from '@hh.ru/magritte-ui-input/types';\n\nconst calculateDelimiters = (\n rawText: string,\n formatted: string,\n groupSeparator: string,\n caretPosition: number\n): number =>\n formatted.substring(0, caretPosition).split(groupSeparator).length -\n rawText.trim().substring(0, caretPosition).split(groupSeparator).length;\n\ntype Params = FormatParams & { maxLength?: number };\n\nexport const numberFormatterFactory: (params?: Params) => InputFormatter = (passedParams = {}) => {\n const filteredParams = (Object.keys(passedParams) as Array<keyof typeof passedParams>).reduce<Params>(\n (acc, key) =>\n passedParams[key] === undefined\n ? acc\n : {\n ...acc,\n [key]: passedParams[key],\n },\n {}\n );\n const params = { ...defaults, ...filteredParams };\n const ouputFormatParams = {\n groupSeparator: '',\n decimalMark: ['.', ...params.decimalMark],\n allowNegative: params.allowNegative,\n decimalLength: params.decimalLength,\n };\n const decimalDelimitersRegExp = new RegExp(`[${params.decimalMark?.join('')}]`, 'g');\n const allowedChars = [...params.decimalMark];\n if (params.allowNegative) {\n allowedChars.push('-');\n }\n const disallowedCharsRegExp = new RegExp(`[^\\\\d${allowedChars.join('')}]`, 'g');\n\n return (prevValue: string, value: string, caretPosition: number) => {\n const val = params.maxLength ? value.replace(disallowedCharsRegExp, '').substring(0, params.maxLength) : value;\n const decimalDelimitersCount = val.match(decimalDelimitersRegExp)?.length || 0;\n if (decimalDelimitersCount > 1) {\n const lastChar = prevValue.charAt(val.length - 1);\n const formattedValue = format(prevValue, params) + (params.decimalMark.includes(lastChar) ? lastChar : '');\n const decimalDelimitersPosition = formattedValue.search(decimalDelimitersRegExp);\n return {\n formattedValue,\n outputValue:\n format(prevValue, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : ''),\n caretPosition: decimalDelimitersPosition + 1,\n };\n }\n const lastChar = val.charAt(val.length - 1);\n const formattedValue = format(val, params) + (params.decimalMark.includes(lastChar) ? lastChar : '');\n const outputValue = format(val, ouputFormatParams) + (params.decimalMark.includes(lastChar) ? lastChar : '');\n const caret = caretPosition + calculateDelimiters(value, formattedValue, params.groupSeparator, caretPosition);\n\n return {\n formattedValue,\n outputValue,\n caretPosition: caret,\n };\n };\n};\n"],"names":["lastChar","formattedValue"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-input",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.52",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"@hh.ru/magritte-common-focus-visible": "0.1.11",
|
|
31
31
|
"@hh.ru/magritte-common-mouse": "1.2.1",
|
|
32
32
|
"@hh.ru/magritte-common-number-formatter": "1.0.11",
|
|
33
|
-
"@hh.ru/magritte-common-text-selection": "0.1.
|
|
33
|
+
"@hh.ru/magritte-common-text-selection": "0.1.10",
|
|
34
34
|
"@hh.ru/magritte-common-use-disabled": "1.0.16",
|
|
35
35
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.12",
|
|
36
36
|
"@hh.ru/magritte-common-use-translation": "3.6.1",
|
|
37
|
-
"@hh.ru/magritte-design-tokens": "26.0.
|
|
37
|
+
"@hh.ru/magritte-design-tokens": "26.0.1",
|
|
38
38
|
"@hh.ru/magritte-ui-breakpoint": "6.1.2",
|
|
39
|
-
"@hh.ru/magritte-ui-form-helper": "2.1.
|
|
40
|
-
"@hh.ru/magritte-ui-icon": "15.1.
|
|
39
|
+
"@hh.ru/magritte-ui-form-helper": "2.1.25",
|
|
40
|
+
"@hh.ru/magritte-ui-icon": "15.1.5",
|
|
41
41
|
"@hh.ru/magritte-ui-mock-component": "1.1.8",
|
|
42
|
-
"@hh.ru/magritte-ui-typography": "5.3.
|
|
42
|
+
"@hh.ru/magritte-ui-typography": "5.3.16"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@maskito/core": "2.4.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "f6539d7a0e7cd42dd851458db1de04a748bbee03"
|
|
53
53
|
}
|
package/useDateTimeMask.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RefCallback } from 'react';
|
|
2
|
-
import { type TimeInputRounding, type DateInputMask } from '
|
|
2
|
+
import { type TimeInputRounding, type DateInputMask } from './types';
|
|
3
3
|
export declare const useDateTimeMask: (dateMask?: DateInputMask, timeMask?: boolean, timeRounding?: TimeInputRounding, range?: boolean) => RefCallback<HTMLElement>;
|
package/useDateTimeMask.js
CHANGED
|
@@ -1,151 +1,125 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { M as MASKITO_DEFAULT_OPTIONS, b as maskitoDateTimeOptionsGenerator, a as maskitoDateRangeOptionsGenerator, m as maskitoDateOptionsGenerator, c as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-
|
|
3
|
+
import { M as MASKITO_DEFAULT_OPTIONS, b as maskitoDateTimeOptionsGenerator, a as maskitoDateRangeOptionsGenerator, m as maskitoDateOptionsGenerator, c as maskitoTimeOptionsGenerator, u as useMaskito } from './index.esm-t97x9DTo.js';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Округление времени (в формате 00:00) до ближайшего заданного шага
|
|
7
|
-
*
|
|
8
|
-
* @param dateTime {String} Строка с постфиксом HH:MM, где H - часы, M - минуты
|
|
9
|
-
* @param roundValue {Number} Шаг для округления
|
|
10
|
-
* @returns {String}
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* roundTime('20.12.2023 15:19', 15); // '20.12.2023 15:15'
|
|
14
|
-
* @example
|
|
15
|
-
* roundTime('15:31', 60); // '16:00'
|
|
16
|
-
*/
|
|
17
5
|
const roundTime = (dateTime, roundValue) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
const regexp = /(\d{2}):(\d{2})$/;
|
|
7
|
+
const match = dateTime.match(regexp);
|
|
8
|
+
const time = match?.[0];
|
|
9
|
+
if (time) {
|
|
10
|
+
const [hours, minutes] = time.split(":").map(Number);
|
|
11
|
+
const totalMinutes = hours * 60 + minutes;
|
|
12
|
+
const roundedMinutes = Math.round(totalMinutes / roundValue) * roundValue;
|
|
13
|
+
const roundedHours = Math.floor(roundedMinutes / 60) % 24;
|
|
14
|
+
const formattedHours = String(roundedHours).padStart(2, "0");
|
|
15
|
+
const formattedMinutes = String(roundedMinutes % 60).padStart(2, "0");
|
|
16
|
+
return dateTime.replace(regexp, `${formattedHours}:${formattedMinutes}`);
|
|
17
|
+
}
|
|
18
|
+
return dateTime;
|
|
31
19
|
};
|
|
32
|
-
/** Постпроцессор для округления времени до заданного шага */
|
|
33
20
|
const roundTimePostprocessor = (enabled, rounding) => (state) => enabled && rounding ? { ...state, value: roundTime(state.value, rounding) } : state;
|
|
34
|
-
/** Препроцессор для автоматического добавления разделителей из маски */
|
|
35
21
|
const autoSeparatorsPreprocessor = (mask) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
let lastActionIsInsert = false;
|
|
23
|
+
return (state, actionType) => {
|
|
24
|
+
if (actionType === "insert") {
|
|
25
|
+
lastActionIsInsert = true;
|
|
26
|
+
return state;
|
|
27
|
+
}
|
|
28
|
+
const canAddSeparator = actionType === "validation" && lastActionIsInsert;
|
|
29
|
+
lastActionIsInsert = false;
|
|
30
|
+
if (canAddSeparator) {
|
|
31
|
+
const { value, selection } = state.elementState;
|
|
32
|
+
const [from, to] = selection;
|
|
33
|
+
let newValue = "";
|
|
34
|
+
const dateArray = value.split("");
|
|
35
|
+
for (let i = 0; i < mask.length; i++) {
|
|
36
|
+
if (i < dateArray.length) {
|
|
37
|
+
newValue += dateArray[i];
|
|
38
|
+
} else if (typeof mask[i] === "string") {
|
|
39
|
+
newValue += mask[i];
|
|
40
|
+
} else {
|
|
41
|
+
break;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
for (let i = 0; i < mask.length; i++) {
|
|
50
|
-
if (i < dateArray.length) {
|
|
51
|
-
newValue += dateArray[i];
|
|
52
|
-
}
|
|
53
|
-
else if (typeof mask[i] === 'string') {
|
|
54
|
-
newValue += mask[i];
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const addedCharacters = newValue.length - value.length;
|
|
61
|
-
return {
|
|
62
|
-
...state,
|
|
63
|
-
elementState: {
|
|
64
|
-
value: newValue,
|
|
65
|
-
selection: [from + addedCharacters, to + addedCharacters],
|
|
66
|
-
},
|
|
67
|
-
};
|
|
43
|
+
}
|
|
44
|
+
const addedCharacters = newValue.length - value.length;
|
|
45
|
+
return {
|
|
46
|
+
...state,
|
|
47
|
+
elementState: {
|
|
48
|
+
value: newValue,
|
|
49
|
+
selection: [from + addedCharacters, to + addedCharacters]
|
|
68
50
|
}
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
/** Препроцессор для замены разделителей "., :;/_" на точку */
|
|
73
|
-
const replaceSeparatorsPreprocessor = (state, actionType) => {
|
|
74
|
-
if (actionType === 'insert') {
|
|
75
|
-
return {
|
|
76
|
-
...state,
|
|
77
|
-
data: state.data
|
|
78
|
-
.replace(/[^0-9., :;/_]/g, '')
|
|
79
|
-
.replace(/[., :;/_]/g, '.')
|
|
80
|
-
.replace(/([^0-9])\1+/g, '$1'),
|
|
81
|
-
};
|
|
51
|
+
};
|
|
82
52
|
}
|
|
83
53
|
return state;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const replaceSeparatorsPreprocessor = (state, actionType) => {
|
|
57
|
+
if (actionType === "insert") {
|
|
58
|
+
return {
|
|
59
|
+
...state,
|
|
60
|
+
data: state.data.replace(/[^0-9., :;/_]/g, "").replace(/[., :;/_]/g, ".").replace(/([^0-9])\1+/g, "$1")
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return state;
|
|
84
64
|
};
|
|
85
|
-
/** Постпроцессор для преобразования 4 -> 04 при вводе с маской dd */
|
|
86
65
|
const formatDDMaskPostprocessor = (state) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
66
|
+
if (state.value.length === 1 && Number(state.value) > 3) {
|
|
67
|
+
const [from, to] = state.selection;
|
|
68
|
+
return {
|
|
69
|
+
...state,
|
|
70
|
+
value: state.value.padStart(2, "0"),
|
|
71
|
+
selection: [from + 1, to + 1]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return state;
|
|
96
75
|
};
|
|
97
76
|
const useDateTimeMask = (dateMask, timeMask, timeRounding, range) => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
roundTimePostprocessor(Boolean(timeRounding && timeMode), timeRounding),
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
}, [dateMask, timeMask, timeRounding, range]);
|
|
148
|
-
return useMaskito({ options });
|
|
77
|
+
const options = useMemo(() => {
|
|
78
|
+
if (dateMask === "dd") {
|
|
79
|
+
return {
|
|
80
|
+
mask: /^([0-9]|0\d|1\d|2[0-9]|3[01])$/,
|
|
81
|
+
postprocessors: [formatDDMaskPostprocessor]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const dateSeparator = ".";
|
|
85
|
+
const dateMode = dateMask?.replace(/\./g, "/");
|
|
86
|
+
const rangeSeparator = " \u2013 ";
|
|
87
|
+
const timeMode = "HH:MM";
|
|
88
|
+
let options2 = { ...MASKITO_DEFAULT_OPTIONS };
|
|
89
|
+
if (dateMask && timeMask) {
|
|
90
|
+
options2 = maskitoDateTimeOptionsGenerator({
|
|
91
|
+
dateMode,
|
|
92
|
+
timeMode,
|
|
93
|
+
dateSeparator
|
|
94
|
+
});
|
|
95
|
+
} else if (dateMask) {
|
|
96
|
+
options2 = range ? maskitoDateRangeOptionsGenerator({
|
|
97
|
+
mode: dateMode,
|
|
98
|
+
dateSeparator,
|
|
99
|
+
rangeSeparator
|
|
100
|
+
}) : maskitoDateOptionsGenerator({
|
|
101
|
+
mode: dateMode,
|
|
102
|
+
separator: dateSeparator
|
|
103
|
+
});
|
|
104
|
+
} else if (timeMask) {
|
|
105
|
+
options2 = maskitoTimeOptionsGenerator({
|
|
106
|
+
mode: timeMode
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
...options2,
|
|
111
|
+
preprocessors: [
|
|
112
|
+
replaceSeparatorsPreprocessor,
|
|
113
|
+
...options2.preprocessors || [],
|
|
114
|
+
autoSeparatorsPreprocessor(options2.mask)
|
|
115
|
+
],
|
|
116
|
+
postprocessors: [
|
|
117
|
+
...options2.postprocessors || [],
|
|
118
|
+
roundTimePostprocessor(Boolean(timeRounding && timeMode), timeRounding)
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
}, [dateMask, timeMask, timeRounding, range]);
|
|
122
|
+
return useMaskito({ options });
|
|
149
123
|
};
|
|
150
124
|
|
|
151
125
|
export { useDateTimeMask };
|