q2-tecton-elements 1.13.0-alpha.0 → 1.13.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/dist/cjs/click-elsewhere.cjs.entry.js +5 -7
- package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
- package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
- package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge.cjs.entry.js +43 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
- package/dist/cjs/q2-calendar.cjs.entry.js +53 -59
- package/dist/cjs/q2-card.cjs.entry.js +127 -0
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
- package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
- package/dist/cjs/q2-checkbox.cjs.entry.js +18 -10
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
- package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
- package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
- package/dist/cjs/q2-icon.cjs.entry.js +3 -3
- package/dist/cjs/q2-input.cjs.entry.js +439 -437
- package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +5 -5
- package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
- package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
- package/dist/cjs/q2-option.cjs.entry.js +3 -11
- package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
- package/dist/cjs/q2-pill.cjs.entry.js +137 -0
- package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
- package/dist/cjs/q2-radio.cjs.entry.js +21 -4
- package/dist/cjs/q2-section.cjs.entry.js +5 -7
- package/dist/cjs/q2-select.cjs.entry.js +23 -26
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
- package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +94 -0
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
- package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
- package/dist/collection/collection-manifest.json +10 -3
- package/dist/collection/components/click-elsewhere/index.js +4 -6
- package/dist/collection/components/q2-badge/index.js +148 -0
- package/dist/collection/components/q2-badge/styles.css +134 -0
- package/dist/collection/components/q2-btn/index.js +14 -14
- package/dist/collection/components/q2-btn/styles.css +1 -1
- package/dist/collection/components/q2-calendar/helpers.js +22 -20
- package/dist/collection/components/q2-calendar/index.js +44 -37
- package/dist/collection/components/q2-calendar/validation.js +4 -2
- package/dist/collection/components/q2-card/index.js +347 -0
- package/dist/collection/components/q2-card/styles.css +177 -0
- package/dist/collection/components/q2-carousel/index.js +11 -16
- package/dist/collection/components/q2-carousel/styles.css +3 -3
- package/dist/collection/components/q2-carousel-pane/index.js +2 -2
- package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
- package/dist/collection/components/q2-checkbox/index.js +37 -12
- package/dist/collection/components/q2-checkbox-group/index.js +22 -1
- package/dist/collection/components/q2-dropdown/index.js +6 -15
- package/dist/collection/components/q2-dropdown-item/index.js +5 -5
- package/dist/collection/components/q2-editable-field/index.js +3 -6
- package/dist/collection/components/q2-icon/icons.js +393 -383
- package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
- package/dist/collection/components/q2-input/formatting/currency.js +162 -162
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/generic.js +7 -8
- package/dist/collection/components/q2-input/formatting/number.js +6 -9
- package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
- package/dist/collection/components/q2-input/formatting/phone.js +215 -215
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/index.js +81 -25
- package/dist/collection/components/q2-input/styles.css +19 -14
- package/dist/collection/components/q2-loading/index.js +4 -4
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
- package/dist/collection/components/q2-message/index.js +3 -3
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-option/index.js +19 -25
- package/dist/collection/components/q2-option/styles.css +5 -0
- package/dist/collection/components/q2-option-list/index.js +648 -0
- package/dist/collection/components/q2-option-list/styles.css +128 -0
- package/dist/collection/components/q2-pagination/index.js +275 -0
- package/dist/collection/components/q2-pagination/styles.css +120 -0
- package/dist/collection/components/q2-pill/index.js +324 -0
- package/dist/collection/components/q2-pill/styles.css +229 -0
- package/dist/collection/components/q2-radio/index.js +38 -1
- package/dist/collection/components/q2-radio-group/index.js +66 -24
- package/dist/collection/components/q2-section/index.js +5 -7
- package/dist/collection/components/q2-select/index.js +40 -25
- package/dist/collection/components/q2-stepper/index.js +8 -10
- package/dist/collection/components/q2-stepper/styles.css +5 -5
- package/dist/collection/components/q2-stepper-pane/index.js +133 -5
- package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
- package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
- package/dist/collection/components/q2-tab-container/index.js +11 -7
- package/dist/collection/components/q2-tag/index.js +200 -0
- package/dist/collection/components/q2-tag/styles.css +141 -0
- package/dist/collection/components/q2-textarea/index.js +6 -6
- package/dist/collection/components/tecton-tab-pane/index.js +3 -10
- package/dist/collection/utils/index.js +25 -13
- package/dist/esm/click-elsewhere.entry.js +5 -7
- package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
- package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
- package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge.entry.js +39 -0
- package/dist/esm/q2-btn_2.entry.js +13 -13
- package/dist/esm/q2-calendar.entry.js +53 -59
- package/dist/esm/q2-card.entry.js +123 -0
- package/dist/esm/q2-carousel-pane.entry.js +5 -5
- package/dist/esm/q2-carousel.entry.js +318 -106
- package/dist/esm/q2-checkbox-group.entry.js +6 -3
- package/dist/esm/q2-checkbox.entry.js +18 -10
- package/dist/esm/q2-dropdown-item.entry.js +7 -7
- package/dist/esm/q2-dropdown.entry.js +8 -17
- package/dist/esm/q2-editable-field.entry.js +5 -8
- package/dist/esm/q2-icon.entry.js +3 -3
- package/dist/esm/q2-input.entry.js +439 -437
- package/dist/esm/q2-loading-element.entry.js +3 -3
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +5 -5
- package/dist/esm/q2-optgroup.entry.js +3 -3
- package/dist/esm/q2-option-list.entry.js +355 -0
- package/dist/esm/q2-option.entry.js +3 -11
- package/dist/esm/q2-pagination.entry.js +112 -0
- package/dist/esm/q2-pill.entry.js +133 -0
- package/dist/esm/q2-radio-group.entry.js +43 -18
- package/dist/esm/q2-radio.entry.js +21 -4
- package/dist/esm/q2-section.entry.js +5 -7
- package/dist/esm/q2-select.entry.js +23 -26
- package/dist/esm/q2-stepper-pane.entry.js +42 -4
- package/dist/esm/q2-stepper-vertical.entry.js +274 -0
- package/dist/esm/q2-stepper.entry.js +10 -12
- package/dist/esm/q2-tab-container.entry.js +12 -8
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +90 -0
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +8 -8
- package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
- package/dist/esm/tecton-tab-pane.entry.js +2 -5
- package/dist/loader/index.d.ts +0 -1
- package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
- package/dist/q2-tecton-elements/p-123cdfb9.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
- package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
- package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
- package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-50e218c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
- package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ae4fed23.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
- package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/elements/q2-tag-test.js +151 -0
- package/dist/test/helpers.js +20 -9
- package/dist/types/components/q2-badge/index.d.ts +13 -0
- package/dist/types/components/q2-btn/index.d.ts +3 -3
- package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
- package/dist/types/components/q2-calendar/index.d.ts +2 -1
- package/dist/types/components/q2-calendar/validation.d.ts +1 -1
- package/dist/types/components/q2-card/index.d.ts +35 -0
- package/dist/types/components/q2-checkbox/index.d.ts +3 -1
- package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -1
- package/dist/types/components/q2-editable-field/index.d.ts +1 -1
- package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
- package/dist/types/components/q2-input/index.d.ts +5 -2
- package/dist/types/components/q2-option/index.d.ts +2 -3
- package/dist/types/components/q2-option-list/index.d.ts +62 -0
- package/dist/types/components/q2-pagination/index.d.ts +30 -0
- package/dist/types/components/q2-pill/index.d.ts +39 -0
- package/dist/types/components/q2-radio/index.d.ts +4 -1
- package/dist/types/components/q2-radio-group/index.d.ts +5 -1
- package/dist/types/components/q2-select/index.d.ts +2 -1
- package/dist/types/components/q2-stepper/index.d.ts +1 -1
- package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
- package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/q2-tag/index.d.ts +28 -0
- package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
- package/dist/types/components.d.ts +235 -11
- package/dist/types/global.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/util.d.ts +2 -10
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
- package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
- package/package.json +13 -13
- package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-080839ed.js +0 -1
- package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
- package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
- package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
- package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
|
@@ -19,7 +19,7 @@ const dateFormats = {
|
|
|
19
19
|
'DD-MM-YYYY': '##-##-####',
|
|
20
20
|
'D-M-YYYY': '#?-#?-####',
|
|
21
21
|
'DD-MM-YY': '##-##-##',
|
|
22
|
-
'D-M-YY': '#?-#?-##'
|
|
22
|
+
'D-M-YY': '#?-#?-##',
|
|
23
23
|
};
|
|
24
24
|
export default function formatDate(value, format = 'MM/DD/YYYY') {
|
|
25
25
|
const mask = dateFormats[format] || dateFormats['MM/DD/YYYY'];
|
|
@@ -9,7 +9,7 @@ export default function formatValue(value = '', mask = '', options) {
|
|
|
9
9
|
fullyFormattedValue,
|
|
10
10
|
prefix: prefix.trim() || suffix.trim(),
|
|
11
11
|
formattingCharacterCount: 0,
|
|
12
|
-
unformattedValue: value
|
|
12
|
+
unformattedValue: value,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
const { unformattedValue, formattedValue, formattingCharacterCount } = generateMask(value, mask);
|
|
@@ -24,7 +24,7 @@ export default function formatValue(value = '', mask = '', options) {
|
|
|
24
24
|
formattingCharacterCount,
|
|
25
25
|
maxlength,
|
|
26
26
|
minFormattedLength,
|
|
27
|
-
unformattedValue
|
|
27
|
+
unformattedValue,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
const optionalValidatingChars = ['?'];
|
|
@@ -36,8 +36,8 @@ function isKnownValidatingChar(character) {
|
|
|
36
36
|
return knownValidatingChars.includes(character);
|
|
37
37
|
}
|
|
38
38
|
function getStaticFormattingChars(mask) {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const knownChars = knownValidatingChars.join('|');
|
|
40
|
+
const formattingChars = mask.replace(new RegExp(`[${knownChars}]`, 'g'), '').split('');
|
|
41
41
|
return new Set(formattingChars);
|
|
42
42
|
}
|
|
43
43
|
function isStaticFormattingChar(character, formattingChars) {
|
|
@@ -64,7 +64,7 @@ function getValidatedChar(char, matcher) {
|
|
|
64
64
|
}
|
|
65
65
|
function generateMask(value, mask) {
|
|
66
66
|
const maskArray = mask.split('');
|
|
67
|
-
|
|
67
|
+
const formattingChars = getStaticFormattingChars(mask);
|
|
68
68
|
let currentValueIndex = 0;
|
|
69
69
|
let formattingCharacterCount = 0;
|
|
70
70
|
let unformattedValue = '';
|
|
@@ -72,8 +72,7 @@ function generateMask(value, mask) {
|
|
|
72
72
|
if (currentValueIndex >= value.length) {
|
|
73
73
|
return acc;
|
|
74
74
|
}
|
|
75
|
-
if (isOptionalValidatingChar(character) &&
|
|
76
|
-
isStaticFormattingChar(value[currentValueIndex], formattingChars)) {
|
|
75
|
+
if (isOptionalValidatingChar(character) && isStaticFormattingChar(value[currentValueIndex], formattingChars)) {
|
|
77
76
|
return acc;
|
|
78
77
|
}
|
|
79
78
|
if (isKnownValidatingChar(character)) {
|
|
@@ -101,7 +100,7 @@ function generateMask(value, mask) {
|
|
|
101
100
|
return {
|
|
102
101
|
unformattedValue,
|
|
103
102
|
formattedValue,
|
|
104
|
-
formattingCharacterCount
|
|
103
|
+
formattingCharacterCount,
|
|
105
104
|
};
|
|
106
105
|
}
|
|
107
106
|
function getNextNonFormattingCharIndex(value, currentValueIndex, formattingChars) {
|
|
@@ -5,15 +5,14 @@ export default function formatNumber(val = '', options = {
|
|
|
5
5
|
decimalSeparator: '.',
|
|
6
6
|
thousandsSeparator: '',
|
|
7
7
|
allowDecimal: false,
|
|
8
|
-
allowNegative: true
|
|
8
|
+
allowNegative: true,
|
|
9
9
|
}, explicit = false) {
|
|
10
10
|
const isNegative = val[0] === '-';
|
|
11
11
|
let value = val;
|
|
12
12
|
const allowDecimal = !!options.allowDecimal && !!options.decimals;
|
|
13
13
|
if (explicit) {
|
|
14
14
|
const parsedValue = value.replace(/[^\d.]/g, '');
|
|
15
|
-
value =
|
|
16
|
-
(parsedValue && Number(parsedValue).toFixed(allowDecimal ? options.decimals : 0)) || '';
|
|
15
|
+
value = (parsedValue && Number(parsedValue).toFixed(allowDecimal ? options.decimals : 0)) || '';
|
|
17
16
|
}
|
|
18
17
|
value = value.replace(/[^\d]/g, '');
|
|
19
18
|
let { integerString, decimalString } = splitValue(value, allowDecimal, options.decimals);
|
|
@@ -28,9 +27,7 @@ export default function formatNumber(val = '', options = {
|
|
|
28
27
|
value = `${negativeSymbol}${integerString}${decimalSeparator}${decimalString}`;
|
|
29
28
|
// format integerString
|
|
30
29
|
integerString = integerString.replace(/\B(?=(\d{3})+(?!\d))/g, options.thousandsSeparator);
|
|
31
|
-
const formattedValue = negativeSymbol || integerString
|
|
32
|
-
? `${negativeSymbol}${integerString}${decimalSeparator}${decimalString}`
|
|
33
|
-
: '';
|
|
30
|
+
const formattedValue = negativeSymbol || integerString ? `${negativeSymbol}${integerString}${decimalSeparator}${decimalString}` : '';
|
|
34
31
|
const fullyFormattedValue = negativeSymbol || integerString
|
|
35
32
|
? `${negativeSymbol}${options.prefix}${integerString}${decimalSeparator}${decimalString}${options.suffix}`
|
|
36
33
|
: '';
|
|
@@ -49,14 +46,14 @@ export default function formatNumber(val = '', options = {
|
|
|
49
46
|
suffix: '',
|
|
50
47
|
formattingCharacterCount,
|
|
51
48
|
maxlength,
|
|
52
|
-
unformattedValue
|
|
49
|
+
unformattedValue,
|
|
53
50
|
};
|
|
54
51
|
}
|
|
55
52
|
function splitValue(value, allowDecimal = false, decimals) {
|
|
56
53
|
if (!allowDecimal) {
|
|
57
54
|
return {
|
|
58
55
|
integerString: value,
|
|
59
|
-
decimalString: ''
|
|
56
|
+
decimalString: '',
|
|
60
57
|
};
|
|
61
58
|
}
|
|
62
59
|
const splitIndex = value.length - decimals;
|
|
@@ -67,6 +64,6 @@ function splitValue(value, allowDecimal = false, decimals) {
|
|
|
67
64
|
const decimalString = value.substring(splitIndex).padStart(decimals, '0');
|
|
68
65
|
return {
|
|
69
66
|
integerString,
|
|
70
|
-
decimalString
|
|
67
|
+
decimalString,
|
|
71
68
|
};
|
|
72
69
|
}
|
|
@@ -8,7 +8,7 @@ const numberFormats = {
|
|
|
8
8
|
decimalSeparator: '.',
|
|
9
9
|
thousandsSeparator: ',',
|
|
10
10
|
allowDecimal: false,
|
|
11
|
-
allowNegative: true
|
|
11
|
+
allowNegative: true,
|
|
12
12
|
},
|
|
13
13
|
integer: {
|
|
14
14
|
prefix: '',
|
|
@@ -17,7 +17,7 @@ const numberFormats = {
|
|
|
17
17
|
decimalSeparator: '.',
|
|
18
18
|
thousandsSeparator: '',
|
|
19
19
|
allowDecimal: true,
|
|
20
|
-
allowNegative: true
|
|
20
|
+
allowNegative: true,
|
|
21
21
|
},
|
|
22
22
|
dec: {
|
|
23
23
|
prefix: '',
|
|
@@ -26,8 +26,8 @@ const numberFormats = {
|
|
|
26
26
|
decimalSeparator: '.',
|
|
27
27
|
thousandsSeparator: ',',
|
|
28
28
|
allowDecimal: true,
|
|
29
|
-
allowNegative: true
|
|
30
|
-
}
|
|
29
|
+
allowNegative: true,
|
|
30
|
+
},
|
|
31
31
|
};
|
|
32
32
|
function getNumberFormat(key) {
|
|
33
33
|
let decimals;
|
|
@@ -54,7 +54,7 @@ function formatNumeric(value = '', modifier = '', explicit = false) {
|
|
|
54
54
|
return formatNumber(value, numberFormat, explicit);
|
|
55
55
|
}
|
|
56
56
|
export function formatPercentage(value = '', modifier = '', explicit = false) {
|
|
57
|
-
|
|
57
|
+
const numberFormat = getNumberFormat(modifier);
|
|
58
58
|
if (!numberFormat) {
|
|
59
59
|
const val = (value || '').replace(/[^\d.,-]/g, '');
|
|
60
60
|
return formatValue(val, undefined, { suffix: '%' });
|