@alfalab/core-components-number-input 2.1.2 → 2.2.0
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/Component.responsive.js +0 -10
- package/components/number-input/Component.js +3 -6
- package/components/number-input/default.css +4 -4
- package/components/number-input/index.css +3 -3
- package/components/number-input/index.js +0 -12
- package/components/number-input/inverted.css +4 -4
- package/components/steppers/Component.js +3 -3
- package/components/steppers/default.css +2 -2
- package/components/steppers/index.css +4 -4
- package/components/steppers/index.js +0 -6
- package/components/steppers/inverted.css +2 -2
- package/cssm/Component.responsive.js +0 -16
- package/cssm/components/number-input/Component.js +0 -6
- package/cssm/components/number-input/index.js +0 -18
- package/cssm/components/steppers/index.js +0 -9
- package/cssm/desktop/Component.desktop.js +0 -16
- package/cssm/desktop/index.js +0 -20
- package/cssm/index.js +0 -21
- package/cssm/mobile/Component.mobile.js +0 -16
- package/cssm/mobile/index.js +0 -20
- package/cssm/shared/index.d.ts +1 -0
- package/cssm/shared/index.js +9 -0
- package/cssm/utils.d.ts +12 -1
- package/cssm/utils.js +14 -0
- package/desktop/Component.desktop.js +0 -10
- package/desktop/index.js +0 -14
- package/esm/Component.responsive.js +0 -10
- package/esm/components/number-input/Component.js +3 -6
- package/esm/components/number-input/default.css +4 -4
- package/esm/components/number-input/index.css +3 -3
- package/esm/components/number-input/index.js +0 -12
- package/esm/components/number-input/inverted.css +4 -4
- package/esm/components/steppers/Component.js +3 -3
- package/esm/components/steppers/default.css +2 -2
- package/esm/components/steppers/index.css +4 -4
- package/esm/components/steppers/index.js +0 -6
- package/esm/components/steppers/inverted.css +2 -2
- package/esm/desktop/Component.desktop.js +0 -10
- package/esm/desktop/index.js +0 -14
- package/esm/index.js +0 -15
- package/esm/mobile/Component.mobile.js +0 -10
- package/esm/mobile/index.js +0 -14
- package/esm/shared/index.d.ts +1 -0
- package/esm/shared/index.js +1 -0
- package/esm/utils.d.ts +12 -1
- package/esm/utils.js +15 -2
- package/index.js +0 -15
- package/mobile/Component.mobile.js +0 -10
- package/mobile/index.js +0 -14
- package/modern/Component.responsive.js +0 -10
- package/modern/components/number-input/Component.js +3 -6
- package/modern/components/number-input/default.css +4 -4
- package/modern/components/number-input/index.css +3 -3
- package/modern/components/number-input/index.js +0 -11
- package/modern/components/number-input/inverted.css +4 -4
- package/modern/components/steppers/Component.js +3 -3
- package/modern/components/steppers/default.css +2 -2
- package/modern/components/steppers/index.css +4 -4
- package/modern/components/steppers/index.js +0 -6
- package/modern/components/steppers/inverted.css +2 -2
- package/modern/desktop/Component.desktop.js +0 -10
- package/modern/desktop/index.js +0 -13
- package/modern/index.js +0 -14
- package/modern/mobile/Component.mobile.js +0 -10
- package/modern/mobile/index.js +0 -13
- package/modern/shared/index.d.ts +1 -0
- package/modern/shared/index.js +1 -0
- package/modern/utils.d.ts +12 -1
- package/modern/utils.js +15 -2
- package/package.json +3 -3
- package/shared/index.d.ts +1 -0
- package/shared/index.js +9 -0
- package/shared/package.json +3 -0
- package/src/shared/index.ts +1 -0
- package/src/shared/package.json +3 -0
- package/src/utils.ts +15 -1
- package/utils.d.ts +12 -1
- package/utils.js +14 -0
package/modern/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { maskitoTransform } from '@maskito/core';
|
|
2
|
-
import { fnUtils } from '@alfalab/core-components-shared/modern';
|
|
2
|
+
import { getDataTestId, fnUtils } from '@alfalab/core-components-shared/modern';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable no-param-reassign */
|
|
5
5
|
const MINUS_SIGN = '-';
|
|
@@ -229,5 +229,18 @@ function createNotEmptyPartsPlugin(separator) {
|
|
|
229
229
|
return () => element.removeEventListener('blur', listener, evListenerOptions);
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
+
function getNumberInputTestIds(dataTestId) {
|
|
233
|
+
return {
|
|
234
|
+
input: dataTestId,
|
|
235
|
+
inputWrapper: getDataTestId(dataTestId, 'form-control'),
|
|
236
|
+
inputWrapperInner: getDataTestId(dataTestId, 'form-control-inner'),
|
|
237
|
+
leftAddons: getDataTestId(dataTestId, 'form-control-left-addons'),
|
|
238
|
+
rightAddons: getDataTestId(dataTestId, 'form-control-right-addons'),
|
|
239
|
+
error: getDataTestId(dataTestId, 'form-control-error-message'),
|
|
240
|
+
hint: getDataTestId(dataTestId, 'form-control-hint'),
|
|
241
|
+
decrementButton: getDataTestId(dataTestId, 'decrement-button'),
|
|
242
|
+
incrementButton: getDataTestId(dataTestId, 'increment-button'),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
232
245
|
|
|
233
|
-
export { MAX_DIGITS, MAX_SAFE_INTEGER, MINUS_SIGN, MIN_SAFE_INTEGER, SEPARATORS, createMaskOptions, createMinMaxPlugin, createNotEmptyPartsPlugin, parseNumber, stringifyNumberWithoutExp };
|
|
246
|
+
export { MAX_DIGITS, MAX_SAFE_INTEGER, MINUS_SIGN, MIN_SAFE_INTEGER, SEPARATORS, createMaskOptions, createMinMaxPlugin, createNotEmptyPartsPlugin, getNumberInputTestIds, parseNumber, stringifyNumberWithoutExp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-number-input",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alfalab/core-components-input": "^14.
|
|
17
|
+
"@alfalab/core-components-input": "^14.2.0",
|
|
18
18
|
"@alfalab/core-components-mq": "^4.2.0",
|
|
19
|
-
"@alfalab/core-components-icon-button": "^6.5.
|
|
19
|
+
"@alfalab/core-components-icon-button": "^6.5.2",
|
|
20
20
|
"@alfalab/core-components-shared": "^0.9.1",
|
|
21
21
|
"@alfalab/icons-glyph": "^2.139.0",
|
|
22
22
|
"@maskito/core": "^1.7.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getNumberInputTestIds } from "../utils";
|
package/shared/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getNumberInputTestIds } from '../utils';
|
package/src/utils.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
maskitoTransform,
|
|
8
8
|
} from '@maskito/core';
|
|
9
9
|
|
|
10
|
-
import { fnUtils } from '@alfalab/core-components-shared';
|
|
10
|
+
import { fnUtils, getDataTestId } from '@alfalab/core-components-shared';
|
|
11
11
|
|
|
12
12
|
export const MINUS_SIGN = '-';
|
|
13
13
|
export const SEPARATORS = [',', '.'];
|
|
@@ -322,3 +322,17 @@ export function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin {
|
|
|
322
322
|
return () => element.removeEventListener('blur', listener, evListenerOptions);
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
|
+
|
|
326
|
+
export function getNumberInputTestIds(dataTestId: string) {
|
|
327
|
+
return {
|
|
328
|
+
input: dataTestId,
|
|
329
|
+
inputWrapper: getDataTestId(dataTestId, 'form-control'),
|
|
330
|
+
inputWrapperInner: getDataTestId(dataTestId, 'form-control-inner'),
|
|
331
|
+
leftAddons: getDataTestId(dataTestId, 'form-control-left-addons'),
|
|
332
|
+
rightAddons: getDataTestId(dataTestId, 'form-control-right-addons'),
|
|
333
|
+
error: getDataTestId(dataTestId, 'form-control-error-message'),
|
|
334
|
+
hint: getDataTestId(dataTestId, 'form-control-hint'),
|
|
335
|
+
decrementButton: getDataTestId(dataTestId, 'decrement-button'),
|
|
336
|
+
incrementButton: getDataTestId(dataTestId, 'increment-button'),
|
|
337
|
+
};
|
|
338
|
+
}
|
package/utils.d.ts
CHANGED
|
@@ -20,4 +20,15 @@ declare function createMinMaxPlugin({ min, max }: {
|
|
|
20
20
|
max: number;
|
|
21
21
|
}): MaskitoPlugin;
|
|
22
22
|
declare function createNotEmptyPartsPlugin(separator: string): MaskitoPlugin;
|
|
23
|
-
|
|
23
|
+
declare function getNumberInputTestIds(dataTestId: string): {
|
|
24
|
+
input: string;
|
|
25
|
+
inputWrapper: string;
|
|
26
|
+
inputWrapperInner: string;
|
|
27
|
+
leftAddons: string;
|
|
28
|
+
rightAddons: string;
|
|
29
|
+
error: string;
|
|
30
|
+
hint: string;
|
|
31
|
+
decrementButton: string;
|
|
32
|
+
incrementButton: string;
|
|
33
|
+
};
|
|
34
|
+
export { MINUS_SIGN, SEPARATORS, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, MAX_DIGITS, parseNumber, stringifyNumberWithoutExp, createMaskOptions, createMinMaxPlugin, createNotEmptyPartsPlugin, getNumberInputTestIds };
|
package/utils.js
CHANGED
|
@@ -246,6 +246,19 @@ function createNotEmptyPartsPlugin(separator) {
|
|
|
246
246
|
return function () { return element.removeEventListener('blur', listener, evListenerOptions); };
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
+
function getNumberInputTestIds(dataTestId) {
|
|
250
|
+
return {
|
|
251
|
+
input: dataTestId,
|
|
252
|
+
inputWrapper: coreComponentsShared.getDataTestId(dataTestId, 'form-control'),
|
|
253
|
+
inputWrapperInner: coreComponentsShared.getDataTestId(dataTestId, 'form-control-inner'),
|
|
254
|
+
leftAddons: coreComponentsShared.getDataTestId(dataTestId, 'form-control-left-addons'),
|
|
255
|
+
rightAddons: coreComponentsShared.getDataTestId(dataTestId, 'form-control-right-addons'),
|
|
256
|
+
error: coreComponentsShared.getDataTestId(dataTestId, 'form-control-error-message'),
|
|
257
|
+
hint: coreComponentsShared.getDataTestId(dataTestId, 'form-control-hint'),
|
|
258
|
+
decrementButton: coreComponentsShared.getDataTestId(dataTestId, 'decrement-button'),
|
|
259
|
+
incrementButton: coreComponentsShared.getDataTestId(dataTestId, 'increment-button'),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
249
262
|
|
|
250
263
|
exports.MAX_DIGITS = MAX_DIGITS;
|
|
251
264
|
exports.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;
|
|
@@ -255,5 +268,6 @@ exports.SEPARATORS = SEPARATORS;
|
|
|
255
268
|
exports.createMaskOptions = createMaskOptions;
|
|
256
269
|
exports.createMinMaxPlugin = createMinMaxPlugin;
|
|
257
270
|
exports.createNotEmptyPartsPlugin = createNotEmptyPartsPlugin;
|
|
271
|
+
exports.getNumberInputTestIds = getNumberInputTestIds;
|
|
258
272
|
exports.parseNumber = parseNumber;
|
|
259
273
|
exports.stringifyNumberWithoutExp = stringifyNumberWithoutExp;
|