@globalpayments/vega 2.59.1 → 2.60.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/{app-globals-64aff1a9.js → app-globals-8a3536ba.js} +3 -3
- package/dist/cjs/{code-block-4bfae76d.js → code-block-7d901dfc.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-34f4577a.js → component-value-history-controller-slimmer.abstract-d61e5129.js} +2 -2
- package/dist/cjs/{content-state-b82b74de.js → content-state-2096aa5a.js} +2 -2
- package/dist/cjs/{design-token-0b1315f2.js → design-token-52f9da81.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f14737af.js → element-appender-slimmer-2a3e1e51.js} +2 -2
- package/dist/cjs/{image-annotation-action-a3146135.js → image-annotation-action-8c1ecc99.js} +2 -2
- package/dist/cjs/index.cjs.js +8 -9
- package/dist/cjs/{inject-keyboard-manager-70382bae.js → inject-keyboard-manager-ad865c95.js} +1 -1
- package/dist/cjs/{keyboard-manager-6858915b.js → keyboard-manager-7f4e1f43.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-faca2038.js → keyboard-manager-slimmer-138a90e5.js} +1 -1
- package/dist/cjs/loader.cjs.js +6 -7
- package/dist/cjs/{public-rules-26467413.js → public-rules-c711fae3.js} +4 -5
- package/dist/cjs/{responsive-format-facade-d2e03695.js → responsive-format-facade-3ab3b18c.js} +2 -2
- package/dist/cjs/{rich-text-editor-required-rule-026c8c3f.js → rich-text-editor-required-rule-4d92437f.js} +1 -1
- package/dist/cjs/{state-background-color-formatter-c57409ea.js → state-background-color-formatter-aa5570f6.js} +1 -1
- package/dist/cjs/string-format-strategy.abstract-07a95352.js +60 -0
- package/dist/cjs/{string-input-formatter-slimmer-1b757bad.js → string-input-formatter-slimmer-941eaec2.js} +1 -224
- package/dist/cjs/string-mask-strategy-6bdad95e.js +172 -0
- package/dist/cjs/{style-formatter-effb0730.js → style-formatter-dcb443fb.js} +2 -2
- package/dist/cjs/{type-guard-aa8fdeaf.js → type-guard-f12b5bae.js} +13 -3
- package/dist/cjs/{valid-credit-card-number-rule-4a1b00b8.js → valid-credit-card-number-rule-ce5c9147.js} +9 -9
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -7
- package/dist/cjs/vega-app-header-button.cjs.entry.js +6 -7
- package/dist/cjs/vega-box.cjs.entry.js +7 -8
- package/dist/cjs/vega-button-circle.cjs.entry.js +6 -7
- package/dist/cjs/vega-button.cjs.entry.js +4 -5
- package/dist/cjs/vega-calendar_4.cjs.entry.js +14 -4
- package/dist/cjs/vega-card.cjs.entry.js +6 -7
- package/dist/cjs/vega-carousel.cjs.entry.js +4 -5
- package/dist/cjs/vega-chip.cjs.entry.js +6 -7
- package/dist/cjs/vega-code-block.cjs.entry.js +5 -6
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -4
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +36 -11
- package/dist/cjs/vega-dialog_2.cjs.entry.js +6 -7
- package/dist/cjs/vega-divider.cjs.entry.js +6 -7
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -8
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +6 -7
- package/dist/cjs/vega-flex.cjs.entry.js +7 -8
- package/dist/cjs/vega-font.cjs.entry.js +6 -7
- package/dist/cjs/vega-grid.cjs.entry.js +6 -7
- package/dist/cjs/vega-icon.cjs.entry.js +6 -7
- package/dist/cjs/vega-image-uploader.cjs.entry.js +4 -5
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +241 -12
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +110 -21
- package/dist/cjs/vega-input-select.cjs.entry.js +4 -5
- package/dist/cjs/vega-input.cjs.entry.js +16 -191
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +6 -7
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +4 -5
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -5
- package/dist/cjs/vega-popover_2.cjs.entry.js +9 -10
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -4
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +4 -5
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +8 -9
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -5
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +4 -5
- package/dist/cjs/vega-signature-capture.cjs.entry.js +6 -7
- package/dist/cjs/vega-table_8.cjs.entry.js +4 -5
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +7 -8
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +7 -8
- package/dist/cjs/vega.cjs.js +6 -7
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +12 -1
- package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +11 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +4 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker.js +43 -0
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.js +4 -11
- package/dist/collection/components/vega-input/vega-input.js +1 -1
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +6 -3
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +3 -16
- package/dist/collection/constants/card-config.js +4 -4
- package/dist/collection/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.js +1 -1
- package/dist/collection/helpers/formatter/string-formatter/vega-phone-number-input-strategy.js +104 -0
- package/dist/collection/helpers/formatter/test/string-formatter/vega-phone-number-input-strategy.test.js +43 -0
- package/dist/esm/{app-globals-05dbca3e.js → app-globals-c7699395.js} +3 -3
- package/dist/esm/{code-block-3d519665.js → code-block-055cae13.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-8b5be007.js → component-value-history-controller-slimmer.abstract-7a64c05a.js} +2 -2
- package/dist/esm/{content-state-73900a67.js → content-state-460f6254.js} +2 -2
- package/dist/esm/{design-token-dbc8c235.js → design-token-e1821e4a.js} +3 -3
- package/dist/esm/{element-appender-slimmer-6ad38a9b.js → element-appender-slimmer-4260c020.js} +2 -2
- package/dist/esm/{image-annotation-action-4ebed11f.js → image-annotation-action-95cc9118.js} +2 -2
- package/dist/esm/index.js +8 -9
- package/dist/esm/{inject-keyboard-manager-a28dfee4.js → inject-keyboard-manager-109817bf.js} +1 -1
- package/dist/esm/{keyboard-manager-fa6355cb.js → keyboard-manager-ab521d22.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-818050ee.js → keyboard-manager-slimmer-cae3a002.js} +1 -1
- package/dist/esm/loader.js +6 -7
- package/dist/esm/{public-rules-f28aca10.js → public-rules-71e1883d.js} +4 -5
- package/dist/esm/{responsive-format-facade-81b72f39.js → responsive-format-facade-dbeffcd6.js} +2 -2
- package/dist/esm/{rich-text-editor-required-rule-c4ba68b8.js → rich-text-editor-required-rule-6cfdcaaf.js} +1 -1
- package/dist/esm/{state-background-color-formatter-da5e76e8.js → state-background-color-formatter-0f01d27a.js} +1 -1
- package/dist/esm/string-format-strategy.abstract-452f4398.js +58 -0
- package/dist/esm/{string-input-formatter-slimmer-b144e8d7.js → string-input-formatter-slimmer-6d99bb4f.js} +2 -223
- package/dist/esm/string-mask-strategy-6232a1c1.js +170 -0
- package/dist/esm/{style-formatter-7d817448.js → style-formatter-41ca4df2.js} +2 -2
- package/dist/esm/{type-guard-84b1f192.js → type-guard-12f7654b.js} +8 -2
- package/dist/esm/{valid-credit-card-number-rule-cc497bec.js → valid-credit-card-number-rule-81443274.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -7
- package/dist/esm/vega-app-header-button.entry.js +6 -7
- package/dist/esm/vega-box.entry.js +7 -8
- package/dist/esm/vega-button-circle.entry.js +6 -7
- package/dist/esm/vega-button.entry.js +4 -5
- package/dist/esm/vega-calendar_4.entry.js +14 -4
- package/dist/esm/vega-card.entry.js +6 -7
- package/dist/esm/vega-carousel.entry.js +4 -5
- package/dist/esm/vega-chip.entry.js +6 -7
- package/dist/esm/vega-code-block.entry.js +5 -6
- package/dist/esm/vega-combo-box.entry.js +3 -4
- package/dist/esm/vega-date-picker_2.entry.js +35 -10
- package/dist/esm/vega-dialog_2.entry.js +6 -7
- package/dist/esm/vega-divider.entry.js +6 -7
- package/dist/esm/vega-dropdown_5.entry.js +7 -8
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +6 -7
- package/dist/esm/vega-flex.entry.js +7 -8
- package/dist/esm/vega-font.entry.js +6 -7
- package/dist/esm/vega-grid.entry.js +6 -7
- package/dist/esm/vega-icon.entry.js +6 -7
- package/dist/esm/vega-image-uploader.entry.js +4 -5
- package/dist/esm/vega-input-credit-card.entry.js +240 -11
- package/dist/esm/vega-input-numeric.entry.js +3 -4
- package/dist/esm/vega-input-phone-number.entry.js +110 -21
- package/dist/esm/vega-input-select.entry.js +4 -5
- package/dist/esm/vega-input.entry.js +10 -185
- package/dist/esm/vega-left-nav_5.entry.js +6 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -5
- package/dist/esm/vega-pagination.entry.js +4 -5
- package/dist/esm/vega-popover_2.entry.js +9 -10
- package/dist/esm/vega-radio_2.entry.js +3 -4
- package/dist/esm/vega-rich-text-content.entry.js +4 -5
- package/dist/esm/vega-rich-text-editor_4.entry.js +8 -9
- package/dist/esm/vega-selection-chip_2.entry.js +4 -5
- package/dist/esm/vega-sidenav_3.entry.js +4 -5
- package/dist/esm/vega-signature-capture.entry.js +6 -7
- package/dist/esm/vega-table_8.entry.js +4 -5
- package/dist/esm/vega-time-picker_2.entry.js +7 -8
- package/dist/esm/vega-tooltip_2.entry.js +7 -8
- package/dist/esm/vega.js +6 -7
- package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +1 -0
- package/dist/types/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.d.ts +1 -0
- package/dist/types/components/vega-date-picker/vega-date-picker.d.ts +14 -0
- package/dist/types/components/vega-input/types.d.ts +3 -10
- package/dist/types/components.d.ts +14 -0
- package/dist/types/helpers/formatter/string-formatter/vega-phone-number-input-strategy.d.ts +49 -0
- package/dist/types/helpers/formatter/test/string-formatter/vega-phone-number-input-strategy.test.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-0dcec258.js +1 -0
- package/dist/vega/p-10063072.entry.js +1 -0
- package/dist/vega/p-1152850b.entry.js +1 -0
- package/dist/vega/p-165054fb.entry.js +1 -0
- package/dist/vega/p-1652cfc6.entry.js +1 -0
- package/dist/vega/p-16c6c22f.entry.js +1 -0
- package/dist/vega/p-1852ca80.entry.js +1 -0
- package/dist/vega/p-1b222c94.entry.js +1 -0
- package/dist/vega/{p-ca30b996.js → p-1b91a882.js} +1 -1
- package/dist/vega/{p-86f17433.js → p-1cabeb33.js} +1 -1
- package/dist/vega/p-1f8c46c4.entry.js +1 -0
- package/dist/vega/p-1fdf0f74.entry.js +1 -0
- package/dist/vega/{p-63c9eb58.js → p-200ba358.js} +1 -1
- package/dist/vega/p-20b8b626.entry.js +1 -0
- package/dist/vega/{p-8baacfc5.js → p-21873037.js} +1 -1
- package/dist/vega/{p-b40adb9e.js → p-2608b9fe.js} +1 -1
- package/dist/vega/{p-0f0baac3.js → p-27dfa896.js} +1 -1
- package/dist/vega/p-2e4bc8aa.entry.js +1 -0
- package/dist/vega/p-334e31a3.entry.js +1 -0
- package/dist/vega/p-394dfa02.entry.js +1 -0
- package/dist/vega/p-433ea113.entry.js +1 -0
- package/dist/vega/p-460bbd22.entry.js +1 -0
- package/dist/vega/p-46973cf9.entry.js +1 -0
- package/dist/vega/p-52c1dde9.entry.js +1 -0
- package/dist/vega/p-594ecdab.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-62898294.entry.js +1 -0
- package/dist/vega/p-636f7b17.entry.js +1 -0
- package/dist/vega/p-68eae19d.entry.js +1 -0
- package/dist/vega/p-69119f58.entry.js +1 -0
- package/dist/vega/p-6b71d5d1.entry.js +1 -0
- package/dist/vega/p-71f9c4d4.js +1 -0
- package/dist/vega/{p-59e990c7.entry.js → p-741a8b61.entry.js} +1 -1
- package/dist/vega/{p-436f7e27.js → p-743c5baf.js} +1 -1
- package/dist/vega/{p-1a195e28.js → p-7e4fdccb.js} +1 -1
- package/dist/vega/p-824a06ba.js +1 -0
- package/dist/vega/{p-42033e59.js → p-8539e05e.js} +1 -1
- package/dist/vega/p-867a4970.js +1 -0
- package/dist/vega/{p-bdce4143.js → p-95ac7c7e.js} +1 -1
- package/dist/vega/p-95c30aed.entry.js +1 -0
- package/dist/vega/{p-6f90d444.js → p-9ce249a9.js} +1 -1
- package/dist/vega/{p-f6d25220.js → p-a433fef4.js} +1 -1
- package/dist/vega/p-af2de012.entry.js +1 -0
- package/dist/vega/p-b1faebe0.js +1 -0
- package/dist/vega/p-b56e2c89.entry.js +1 -0
- package/dist/vega/p-b8f50c69.entry.js +1 -0
- package/dist/vega/p-b9821a7f.entry.js +1 -0
- package/dist/vega/p-c883bce1.entry.js +1 -0
- package/dist/vega/p-cc2ceaa8.entry.js +1 -0
- package/dist/vega/{p-7f087c8b.js → p-d1ebec08.js} +1 -1
- package/dist/vega/{p-fc8badd3.entry.js → p-d35243c8.entry.js} +1 -1
- package/dist/vega/p-dbe5daa7.js +1 -0
- package/dist/vega/p-dd6a4ea6.entry.js +1 -0
- package/dist/vega/p-e3bb1cce.entry.js +13 -0
- package/dist/vega/p-e45f8a67.entry.js +1 -0
- package/dist/vega/p-e4fbd2b7.entry.js +1 -0
- package/dist/vega/p-eaa43f31.entry.js +1 -0
- package/dist/vega/p-ed50233f.entry.js +1 -0
- package/dist/vega/p-f1a2658b.entry.js +1 -0
- package/dist/vega/p-fc4c5265.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +4 -3
- package/dist/cjs/card-config-2ee5505e.js +0 -65
- package/dist/cjs/regex-c1f70fd4.js +0 -15
- package/dist/esm/card-config-d2ad484e.js +0 -63
- package/dist/esm/regex-dfe11abf.js +0 -8
- package/dist/vega/p-12ed3141.entry.js +0 -1
- package/dist/vega/p-13eca7f3.entry.js +0 -1
- package/dist/vega/p-1ff1deaf.entry.js +0 -1
- package/dist/vega/p-2004317b.entry.js +0 -1
- package/dist/vega/p-29e0d4c8.entry.js +0 -1
- package/dist/vega/p-369f38ed.entry.js +0 -1
- package/dist/vega/p-36ed226a.js +0 -1
- package/dist/vega/p-3a0a4d15.js +0 -1
- package/dist/vega/p-4452e085.js +0 -1
- package/dist/vega/p-490f5e3f.entry.js +0 -1
- package/dist/vega/p-4996b853.entry.js +0 -1
- package/dist/vega/p-49fd1009.js +0 -1
- package/dist/vega/p-4fb159d5.js +0 -1
- package/dist/vega/p-51cce3f9.entry.js +0 -1
- package/dist/vega/p-53d67971.entry.js +0 -1
- package/dist/vega/p-555804a0.entry.js +0 -1
- package/dist/vega/p-5e2c9e69.js +0 -1
- package/dist/vega/p-675b9501.entry.js +0 -1
- package/dist/vega/p-707bb905.entry.js +0 -1
- package/dist/vega/p-7183bd72.entry.js +0 -1
- package/dist/vega/p-73b487b0.entry.js +0 -1
- package/dist/vega/p-76de6b00.entry.js +0 -1
- package/dist/vega/p-7b1bb372.entry.js +0 -1
- package/dist/vega/p-8a317208.entry.js +0 -1
- package/dist/vega/p-9479866e.entry.js +0 -1
- package/dist/vega/p-9f453b90.entry.js +0 -1
- package/dist/vega/p-a204a2b2.js +0 -1
- package/dist/vega/p-a328d448.entry.js +0 -1
- package/dist/vega/p-ad1b22b4.entry.js +0 -1
- package/dist/vega/p-ae415e7e.entry.js +0 -1
- package/dist/vega/p-be8bbaa5.entry.js +0 -1
- package/dist/vega/p-bf6187f7.entry.js +0 -1
- package/dist/vega/p-c5c5509c.entry.js +0 -13
- package/dist/vega/p-c9c2c8c6.entry.js +0 -1
- package/dist/vega/p-cc20f01f.entry.js +0 -1
- package/dist/vega/p-d3bcaa82.entry.js +0 -1
- package/dist/vega/p-dbb06804.entry.js +0 -1
- package/dist/vega/p-df647e48.entry.js +0 -1
- package/dist/vega/p-e989ce94.entry.js +0 -1
- package/dist/vega/p-e9d2e0dc.entry.js +0 -1
- package/dist/vega/p-f6b11a21.entry.js +0 -1
- package/dist/vega/p-f8e62e5e.entry.js +0 -1
- package/dist/vega/p-fd6f90fd.entry.js +0 -1
- package/dist/vega/p-ffaee583.entry.js +0 -1
|
@@ -1,233 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const typeGuard = require('./type-guard-aa8fdeaf.js');
|
|
4
3
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
4
|
+
const typeGuard = require('./type-guard-f12b5bae.js');
|
|
5
5
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
6
6
|
const domNodeSubjectFactory = require('./dom-node-subject-factory-bad99695.js');
|
|
7
7
|
const vegaInternalEventId = require('./vega-internal-event-id-ae6e2c13.js');
|
|
8
8
|
const index = require('./index-10199ee8.js');
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* String format strategy abstract class
|
|
12
|
-
*/
|
|
13
|
-
class StringFormatStrategy {
|
|
14
|
-
/**
|
|
15
|
-
* Check if the {@link format} should be applied
|
|
16
|
-
*
|
|
17
|
-
* @param {FormatTrigger} triggeredBy - The trigger of the format
|
|
18
|
-
* @param {FormatTarget} target - The target of the format
|
|
19
|
-
* @param {InputStatus} inputStatus - The status of the input
|
|
20
|
-
* @returns {boolean} - Whether the format should be applied
|
|
21
|
-
*/
|
|
22
|
-
canFormat(triggeredBy, target, inputStatus) {
|
|
23
|
-
if (triggeredBy === 'init' || triggeredBy === 'change') {
|
|
24
|
-
if (target === 'component' && typeGuard.isNonNullable(inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.isBlurred)) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (this.shouldTriggerAtInit()) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (triggeredBy === 'input' && target === 'native-input') {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
if (triggeredBy === 'change' && (target === 'component' || target === 'native-input')) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
if (triggeredBy === 'blur' && (inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.isBlurred)) {
|
|
38
|
-
if (target === 'component' && this.shouldOverrideComponentValueAfterBlur()) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (target === 'native-input') {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Determines whether a component value should be overridden based on the mask configuration.
|
|
49
|
-
*
|
|
50
|
-
* @returns {boolean} - Whether the component value should be overridden.
|
|
51
|
-
*/
|
|
52
|
-
shouldOverrideComponentValueAfterBlur() {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Determines whether the format should be triggered at init.
|
|
57
|
-
*
|
|
58
|
-
* @returns {boolean} - Whether the format should be triggered at init.
|
|
59
|
-
*/
|
|
60
|
-
shouldTriggerAtInit() {
|
|
61
|
-
return false; // TODO: trigger at init feature is not implemented to all strategies. To keep the same behavior as before so set false here as default.
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* A class for formatting string with the given mask format
|
|
67
|
-
*
|
|
68
|
-
* @augments StringFormatStrategy
|
|
69
|
-
*/
|
|
70
|
-
class StringMaskStrategy extends StringFormatStrategy {
|
|
71
|
-
/**
|
|
72
|
-
* It creates a new instance of the Mask class.
|
|
73
|
-
*
|
|
74
|
-
* @param {MaskConfig} maskConfig - MaskConfig
|
|
75
|
-
*/
|
|
76
|
-
constructor(maskConfig) {
|
|
77
|
-
super();
|
|
78
|
-
/**
|
|
79
|
-
* The insert mode means adding some special character in the input string, will replace part of input string if insertMode set to false.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* mask: ****9999
|
|
83
|
-
* slot: 9
|
|
84
|
-
* value = 12345678
|
|
85
|
-
*
|
|
86
|
-
* insertMode=true The mask value should be ****1234
|
|
87
|
-
* insertMode=false The mask value should be ****5678
|
|
88
|
-
*/
|
|
89
|
-
this.insertMode = true;
|
|
90
|
-
this.maskConfig = maskConfig;
|
|
91
|
-
this.slotRegex = new RegExp(maskConfig.slot);
|
|
92
|
-
this.acceptRegex = new RegExp(maskConfig.accept, 'g');
|
|
93
|
-
this.insertMode = maskConfig.insertMode === false ? false : true;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Set the mask config
|
|
97
|
-
*
|
|
98
|
-
* @param {MaskConfig} maskConfig - MaskConfig
|
|
99
|
-
*/
|
|
100
|
-
setMaskConfig(maskConfig) {
|
|
101
|
-
this.maskConfig = maskConfig;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* @inheritDoc
|
|
105
|
-
*/
|
|
106
|
-
format(input, inputStatus) {
|
|
107
|
-
const caretPosition = inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.caretPosition;
|
|
108
|
-
if (input.length > this.getLengthLimit() && typeGuard.isNonNullable(caretPosition)) {
|
|
109
|
-
const rawValueArr = [...input];
|
|
110
|
-
const exceededLength = input.length - this.getLengthLimit();
|
|
111
|
-
rawValueArr.splice(caretPosition - exceededLength, exceededLength);
|
|
112
|
-
return rawValueArr.join('');
|
|
113
|
-
}
|
|
114
|
-
return this.replaceMaskWithMatchedInputSlots(input, this.getMatchedInputSlotValue(input));
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Get the position of
|
|
118
|
-
*
|
|
119
|
-
* @param {string} input - The input string
|
|
120
|
-
* @param {number} caretPosition - The current position of caret
|
|
121
|
-
* @returns {Nullable<number>} The new position of caret
|
|
122
|
-
*/
|
|
123
|
-
calculateCaretPosition(input, caretPosition) {
|
|
124
|
-
if (!typeGuard.isNonNullable(caretPosition))
|
|
125
|
-
return null;
|
|
126
|
-
if (input.length > this.getLengthLimit()) {
|
|
127
|
-
const exceededLength = input.length - this.getLengthLimit();
|
|
128
|
-
return caretPosition - exceededLength;
|
|
129
|
-
}
|
|
130
|
-
const startValue = input.substring(0, caretPosition);
|
|
131
|
-
const maskedStartValue = this.format(startValue);
|
|
132
|
-
return caretPosition + (maskedStartValue.length - startValue.length);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* This TypeScript function determines whether a component value should be overridden based on the mask configuration.
|
|
136
|
-
*
|
|
137
|
-
* @returns {boolean} The result overrideValue controls whether the component value same as the internal input value after the input blur
|
|
138
|
-
* return false if property overrideValue is not exist or set to true, return false if maskConfig is not exist
|
|
139
|
-
*/
|
|
140
|
-
shouldOverrideComponentValueAfterBlur() {
|
|
141
|
-
if (!this.maskConfig || this.maskConfig.overrideValue !== true) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* The function shouldTriggerAtInit returns true if the maskConfig is defined and its triggerAtInit
|
|
150
|
-
* property is set to true, otherwise it returns false.
|
|
151
|
-
*
|
|
152
|
-
* @returns {boolean} The function shouldTriggerAtInit() returns a boolean value. If the condition is met
|
|
153
|
-
* (this.maskConfig is truthy and this.maskConfig.triggerAtInit is true), it returns true. Otherwise,
|
|
154
|
-
* it returns false.
|
|
155
|
-
*/
|
|
156
|
-
shouldTriggerAtInit() {
|
|
157
|
-
if (!this.maskConfig || this.maskConfig.triggerAtInit !== true) {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Get the length limit by mask
|
|
166
|
-
*
|
|
167
|
-
* @returns {number} the max limit length
|
|
168
|
-
*/
|
|
169
|
-
getLengthLimit() {
|
|
170
|
-
return this.maskConfig.mask.length;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Given a string, return an array of all the digits in that string
|
|
174
|
-
*
|
|
175
|
-
* @param {string} input - The input string to be parsed.
|
|
176
|
-
* @returns {string[]} - An array of strings.
|
|
177
|
-
*/
|
|
178
|
-
getMatchedInputSlotValue(input) {
|
|
179
|
-
return input.match(this.acceptRegex) || [];
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Replace the mask with the matched input slots
|
|
183
|
-
*
|
|
184
|
-
* @param {string} input - The input string that is being typed by the user.
|
|
185
|
-
* @param {string[]} matchedInputSlot - an array of the input slots that were matched by the mask.
|
|
186
|
-
* @returns {string} The result string builder.
|
|
187
|
-
*/
|
|
188
|
-
replaceMaskWithMatchedInputSlots(input, matchedInputSlot) {
|
|
189
|
-
const resultStringBuilder = [];
|
|
190
|
-
let resultStringBuilderCursor = -1;
|
|
191
|
-
for (let i = 0; i < this.maskConfig.mask.length; i++) {
|
|
192
|
-
const maskChar = this.maskConfig.mask.charAt(i);
|
|
193
|
-
if (this.slotRegex.test(maskChar) && matchedInputSlot.length) {
|
|
194
|
-
const inputSlot = matchedInputSlot.shift();
|
|
195
|
-
if (inputSlot) {
|
|
196
|
-
resultStringBuilder.push(inputSlot);
|
|
197
|
-
resultStringBuilderCursor = i;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
if (!this.insertMode) {
|
|
202
|
-
matchedInputSlot.shift();
|
|
203
|
-
}
|
|
204
|
-
if (input.charAt(i) === maskChar) {
|
|
205
|
-
resultStringBuilderCursor = i;
|
|
206
|
-
}
|
|
207
|
-
resultStringBuilder.push(maskChar);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
//The replaceMode result length should be the origin input length
|
|
211
|
-
const resultLength = this.insertMode ? resultStringBuilderCursor + 1 : input.length;
|
|
212
|
-
return resultStringBuilder.join('').slice(0, resultLength);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
StringMaskStrategy.PHONE_MASK = new StringMaskStrategy({
|
|
216
|
-
mask: '(999) 999-9999',
|
|
217
|
-
slot: '9',
|
|
218
|
-
accept: /\d/g,
|
|
219
|
-
});
|
|
220
|
-
StringMaskStrategy.ZIPCODE_MASK = new StringMaskStrategy({
|
|
221
|
-
mask: '99999',
|
|
222
|
-
slot: '9',
|
|
223
|
-
accept: /\d/g,
|
|
224
|
-
});
|
|
225
|
-
StringMaskStrategy.TAX_ID_MASK = new StringMaskStrategy({
|
|
226
|
-
mask: '99-9999999',
|
|
227
|
-
slot: '9',
|
|
228
|
-
accept: /\d/g,
|
|
229
|
-
});
|
|
230
|
-
|
|
231
10
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
232
11
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
233
12
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -448,6 +227,4 @@ __decorate([
|
|
|
448
227
|
globalSlimmerRegistry.MapToComponentMethod('componentDidRender')
|
|
449
228
|
], StringInputFormatterSlimmer.prototype, "componentDidRender", null);
|
|
450
229
|
|
|
451
|
-
exports.StringFormatStrategy = StringFormatStrategy;
|
|
452
230
|
exports.StringInputFormatterSlimmer = StringInputFormatterSlimmer;
|
|
453
|
-
exports.StringMaskStrategy = StringMaskStrategy;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const stringFormatStrategy_abstract = require('./string-format-strategy.abstract-07a95352.js');
|
|
4
|
+
const typeGuard = require('./type-guard-f12b5bae.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A class for formatting string with the given mask format
|
|
8
|
+
*
|
|
9
|
+
* @augments StringFormatStrategy
|
|
10
|
+
*/
|
|
11
|
+
class StringMaskStrategy extends stringFormatStrategy_abstract.StringFormatStrategy {
|
|
12
|
+
/**
|
|
13
|
+
* It creates a new instance of the Mask class.
|
|
14
|
+
*
|
|
15
|
+
* @param {MaskConfig} maskConfig - MaskConfig
|
|
16
|
+
*/
|
|
17
|
+
constructor(maskConfig) {
|
|
18
|
+
super();
|
|
19
|
+
/**
|
|
20
|
+
* The insert mode means adding some special character in the input string, will replace part of input string if insertMode set to false.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* mask: ****9999
|
|
24
|
+
* slot: 9
|
|
25
|
+
* value = 12345678
|
|
26
|
+
*
|
|
27
|
+
* insertMode=true The mask value should be ****1234
|
|
28
|
+
* insertMode=false The mask value should be ****5678
|
|
29
|
+
*/
|
|
30
|
+
this.insertMode = true;
|
|
31
|
+
this.maskConfig = maskConfig;
|
|
32
|
+
this.slotRegex = new RegExp(maskConfig.slot);
|
|
33
|
+
this.acceptRegex = new RegExp(maskConfig.accept, 'g');
|
|
34
|
+
this.insertMode = maskConfig.insertMode === false ? false : true;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Set the mask config
|
|
38
|
+
*
|
|
39
|
+
* @param {MaskConfig} maskConfig - MaskConfig
|
|
40
|
+
*/
|
|
41
|
+
setMaskConfig(maskConfig) {
|
|
42
|
+
this.maskConfig = maskConfig;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
format(input, inputStatus) {
|
|
48
|
+
const caretPosition = inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.caretPosition;
|
|
49
|
+
if (input.length > this.getLengthLimit() && typeGuard.isNonNullable(caretPosition)) {
|
|
50
|
+
const rawValueArr = [...input];
|
|
51
|
+
const exceededLength = input.length - this.getLengthLimit();
|
|
52
|
+
rawValueArr.splice(caretPosition - exceededLength, exceededLength);
|
|
53
|
+
return rawValueArr.join('');
|
|
54
|
+
}
|
|
55
|
+
return this.replaceMaskWithMatchedInputSlots(input, this.getMatchedInputSlotValue(input));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the position of
|
|
59
|
+
*
|
|
60
|
+
* @param {string} input - The input string
|
|
61
|
+
* @param {number} caretPosition - The current position of caret
|
|
62
|
+
* @returns {Nullable<number>} The new position of caret
|
|
63
|
+
*/
|
|
64
|
+
calculateCaretPosition(input, caretPosition) {
|
|
65
|
+
if (!typeGuard.isNonNullable(caretPosition))
|
|
66
|
+
return null;
|
|
67
|
+
if (input.length > this.getLengthLimit()) {
|
|
68
|
+
const exceededLength = input.length - this.getLengthLimit();
|
|
69
|
+
return caretPosition - exceededLength;
|
|
70
|
+
}
|
|
71
|
+
const startValue = input.substring(0, caretPosition);
|
|
72
|
+
const maskedStartValue = this.format(startValue);
|
|
73
|
+
return caretPosition + (maskedStartValue.length - startValue.length);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* This TypeScript function determines whether a component value should be overridden based on the mask configuration.
|
|
77
|
+
*
|
|
78
|
+
* @returns {boolean} The result overrideValue controls whether the component value same as the internal input value after the input blur
|
|
79
|
+
* return false if property overrideValue is not exist or set to true, return false if maskConfig is not exist
|
|
80
|
+
*/
|
|
81
|
+
shouldOverrideComponentValueAfterBlur() {
|
|
82
|
+
if (!this.maskConfig || this.maskConfig.overrideValue !== true) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The function shouldTriggerAtInit returns true if the maskConfig is defined and its triggerAtInit
|
|
91
|
+
* property is set to true, otherwise it returns false.
|
|
92
|
+
*
|
|
93
|
+
* @returns {boolean} The function shouldTriggerAtInit() returns a boolean value. If the condition is met
|
|
94
|
+
* (this.maskConfig is truthy and this.maskConfig.triggerAtInit is true), it returns true. Otherwise,
|
|
95
|
+
* it returns false.
|
|
96
|
+
*/
|
|
97
|
+
shouldTriggerAtInit() {
|
|
98
|
+
if (!this.maskConfig || this.maskConfig.triggerAtInit !== true) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get the length limit by mask
|
|
107
|
+
*
|
|
108
|
+
* @returns {number} the max limit length
|
|
109
|
+
*/
|
|
110
|
+
getLengthLimit() {
|
|
111
|
+
return this.maskConfig.mask.length;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Given a string, return an array of all the digits in that string
|
|
115
|
+
*
|
|
116
|
+
* @param {string} input - The input string to be parsed.
|
|
117
|
+
* @returns {string[]} - An array of strings.
|
|
118
|
+
*/
|
|
119
|
+
getMatchedInputSlotValue(input) {
|
|
120
|
+
return input.match(this.acceptRegex) || [];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Replace the mask with the matched input slots
|
|
124
|
+
*
|
|
125
|
+
* @param {string} input - The input string that is being typed by the user.
|
|
126
|
+
* @param {string[]} matchedInputSlot - an array of the input slots that were matched by the mask.
|
|
127
|
+
* @returns {string} The result string builder.
|
|
128
|
+
*/
|
|
129
|
+
replaceMaskWithMatchedInputSlots(input, matchedInputSlot) {
|
|
130
|
+
const resultStringBuilder = [];
|
|
131
|
+
let resultStringBuilderCursor = -1;
|
|
132
|
+
for (let i = 0; i < this.maskConfig.mask.length; i++) {
|
|
133
|
+
const maskChar = this.maskConfig.mask.charAt(i);
|
|
134
|
+
if (this.slotRegex.test(maskChar) && matchedInputSlot.length) {
|
|
135
|
+
const inputSlot = matchedInputSlot.shift();
|
|
136
|
+
if (inputSlot) {
|
|
137
|
+
resultStringBuilder.push(inputSlot);
|
|
138
|
+
resultStringBuilderCursor = i;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
if (!this.insertMode) {
|
|
143
|
+
matchedInputSlot.shift();
|
|
144
|
+
}
|
|
145
|
+
if (input.charAt(i) === maskChar) {
|
|
146
|
+
resultStringBuilderCursor = i;
|
|
147
|
+
}
|
|
148
|
+
resultStringBuilder.push(maskChar);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//The replaceMode result length should be the origin input length
|
|
152
|
+
const resultLength = this.insertMode ? resultStringBuilderCursor + 1 : input.length;
|
|
153
|
+
return resultStringBuilder.join('').slice(0, resultLength);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
StringMaskStrategy.PHONE_MASK = new StringMaskStrategy({
|
|
157
|
+
mask: '(999) 999-9999',
|
|
158
|
+
slot: '9',
|
|
159
|
+
accept: /\d/g,
|
|
160
|
+
});
|
|
161
|
+
StringMaskStrategy.ZIPCODE_MASK = new StringMaskStrategy({
|
|
162
|
+
mask: '99999',
|
|
163
|
+
slot: '9',
|
|
164
|
+
accept: /\d/g,
|
|
165
|
+
});
|
|
166
|
+
StringMaskStrategy.TAX_ID_MASK = new StringMaskStrategy({
|
|
167
|
+
mask: '99-9999999',
|
|
168
|
+
slot: '9',
|
|
169
|
+
accept: /\d/g,
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
exports.StringMaskStrategy = StringMaskStrategy;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const typeGuard = require('./type-guard-
|
|
4
|
-
const responsiveFormatFacade = require('./responsive-format-facade-
|
|
3
|
+
const typeGuard = require('./type-guard-f12b5bae.js');
|
|
4
|
+
const responsiveFormatFacade = require('./responsive-format-facade-3ab3b18c.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Fomatter flex styles.
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const breakpoints = require('./breakpoints-ebde4837.js');
|
|
4
4
|
const ui = require('./ui-32e69595.js');
|
|
5
|
-
const regex = require('./regex-c1f70fd4.js');
|
|
6
5
|
const typography = require('./typography-4560e7f1.js');
|
|
7
6
|
|
|
7
|
+
const GridRowsRegex = new RegExp(/^([1-9]|1[0-2])(-auto)?$/);
|
|
8
|
+
const GridColumnsRegex = new RegExp(/^([1-9]|1[0-2])(-auto)?$/);
|
|
9
|
+
const VisaRegex = /^4/;
|
|
10
|
+
const MasterCardRegex = /^(5[1-5]|677189)|^(222[1-9]|2[3-6]\d{2}|27[0-1]\d|2720)/;
|
|
11
|
+
const AmexRegex = /^3[47]/;
|
|
12
|
+
const DiscoverRegex = /^(6011|65|64[4-9]|622)/;
|
|
13
|
+
|
|
8
14
|
/* This file is generated by vega-design 2.0.77 */
|
|
9
15
|
/* eslint-disable */
|
|
10
16
|
/* tslint:disable */
|
|
@@ -428,7 +434,7 @@ const isShadowsTokenType = (input) => {
|
|
|
428
434
|
* @returns {boolean} indicating if the input is {@link GridColumnsType}
|
|
429
435
|
*/
|
|
430
436
|
const isGridColumnsType = (input) => {
|
|
431
|
-
return ((typeof input === 'string' || typeof input === 'number') &&
|
|
437
|
+
return ((typeof input === 'string' || typeof input === 'number') && GridColumnsRegex.test(input.toString()));
|
|
432
438
|
};
|
|
433
439
|
/**
|
|
434
440
|
* If the input is a number, it must be between 1 and 12. If the input is a string, it must be in the
|
|
@@ -438,7 +444,7 @@ const isGridColumnsType = (input) => {
|
|
|
438
444
|
* @returns {boolean} indicating if the input is {@link GridRowsType}
|
|
439
445
|
*/
|
|
440
446
|
const isGridRowsType = (input) => {
|
|
441
|
-
return (typeof input === 'string' || typeof input === 'number') &&
|
|
447
|
+
return (typeof input === 'string' || typeof input === 'number') && GridRowsRegex.test(input.toString());
|
|
442
448
|
};
|
|
443
449
|
/**
|
|
444
450
|
* If the input is a string, and that string is a key in the Breakpoints object, then the input is a GridRowType.
|
|
@@ -685,6 +691,7 @@ const isVegaTableColumnGroupingModelType = (input) => {
|
|
|
685
691
|
typeof input.label === 'string');
|
|
686
692
|
};
|
|
687
693
|
|
|
694
|
+
exports.AmexRegex = AmexRegex;
|
|
688
695
|
exports.BackgroundColorMap = BackgroundColorMap;
|
|
689
696
|
exports.BackgroundColors = BackgroundColors;
|
|
690
697
|
exports.BorderColorMap = BorderColorMap;
|
|
@@ -693,13 +700,16 @@ exports.BorderMap = BorderMap;
|
|
|
693
700
|
exports.BorderRadius = BorderRadius;
|
|
694
701
|
exports.Borders = Borders;
|
|
695
702
|
exports.Colors = Colors;
|
|
703
|
+
exports.DiscoverRegex = DiscoverRegex;
|
|
696
704
|
exports.FillBackgroundColors = FillBackgroundColors;
|
|
705
|
+
exports.MasterCardRegex = MasterCardRegex;
|
|
697
706
|
exports.ShadowMap = ShadowMap;
|
|
698
707
|
exports.Shadows = Shadows;
|
|
699
708
|
exports.Spacing = Spacing;
|
|
700
709
|
exports.StrokeBackgroundColors = StrokeBackgroundColors;
|
|
701
710
|
exports.TextColorMap = TextColorMap;
|
|
702
711
|
exports.TextColors = TextColors;
|
|
712
|
+
exports.VisaRegex = VisaRegex;
|
|
703
713
|
exports.isAccordionObserverPayload = isAccordionObserverPayload;
|
|
704
714
|
exports.isArrayOfType = isArrayOfType;
|
|
705
715
|
exports.isBackgroundColorTokenType = isBackgroundColorTokenType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const typeGuard = require('./type-guard-f12b5bae.js');
|
|
4
4
|
const number = require('./number-4816603d.js');
|
|
5
5
|
const internalFormFieldValidationRule_abstract = require('./internal-form-field-validation-rule.abstract-07cdff46.js');
|
|
6
6
|
|
|
@@ -78,7 +78,7 @@ class ValidCreditCardNumberRule extends internalFormFieldValidationRule_abstract
|
|
|
78
78
|
*/
|
|
79
79
|
isValidVisaCreditCard(cardNumber) {
|
|
80
80
|
const formattedCardNumber = this.formatCreditCardNumber(cardNumber);
|
|
81
|
-
return (
|
|
81
|
+
return (typeGuard.VisaRegex.test(formattedCardNumber) &&
|
|
82
82
|
(formattedCardNumber.length === 13 ||
|
|
83
83
|
formattedCardNumber.length === 16 ||
|
|
84
84
|
formattedCardNumber.length === 19) &&
|
|
@@ -94,7 +94,7 @@ class ValidCreditCardNumberRule extends internalFormFieldValidationRule_abstract
|
|
|
94
94
|
*/
|
|
95
95
|
isValidMasterCardCreditCard(cardNumber) {
|
|
96
96
|
const formattedCardNumber = this.formatCreditCardNumber(cardNumber);
|
|
97
|
-
return (
|
|
97
|
+
return (typeGuard.MasterCardRegex.test(formattedCardNumber) &&
|
|
98
98
|
formattedCardNumber.length === 16 &&
|
|
99
99
|
ValidCreditCardNumberRule.validateCreditCardDigits(formattedCardNumber));
|
|
100
100
|
}
|
|
@@ -109,7 +109,7 @@ class ValidCreditCardNumberRule extends internalFormFieldValidationRule_abstract
|
|
|
109
109
|
*/
|
|
110
110
|
isValidAmexCreditCard(cardNumber) {
|
|
111
111
|
const formattedCardNumber = this.formatCreditCardNumber(cardNumber);
|
|
112
|
-
return (
|
|
112
|
+
return (typeGuard.AmexRegex.test(formattedCardNumber) &&
|
|
113
113
|
formattedCardNumber.length === 15 &&
|
|
114
114
|
ValidCreditCardNumberRule.validateCreditCardDigits(formattedCardNumber));
|
|
115
115
|
}
|
|
@@ -124,7 +124,7 @@ class ValidCreditCardNumberRule extends internalFormFieldValidationRule_abstract
|
|
|
124
124
|
*/
|
|
125
125
|
isValidDiscoverCreditCard(cardNumber) {
|
|
126
126
|
const formattedCardNumber = this.formatCreditCardNumber(cardNumber);
|
|
127
|
-
return (
|
|
127
|
+
return (typeGuard.DiscoverRegex.test(formattedCardNumber) &&
|
|
128
128
|
formattedCardNumber.length === 16 &&
|
|
129
129
|
ValidCreditCardNumberRule.validateCreditCardDigits(formattedCardNumber));
|
|
130
130
|
}
|
|
@@ -163,10 +163,10 @@ class ValidCreditCardNumberRule extends internalFormFieldValidationRule_abstract
|
|
|
163
163
|
* the function will return `true`, indicating that the credit card type is supported. Otherwise, it
|
|
164
164
|
*/
|
|
165
165
|
isSupportedCreditCardType(formattedCardNumber) {
|
|
166
|
-
return (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
return (typeGuard.VisaRegex.test(formattedCardNumber) ||
|
|
167
|
+
typeGuard.MasterCardRegex.test(formattedCardNumber) ||
|
|
168
|
+
typeGuard.AmexRegex.test(formattedCardNumber) ||
|
|
169
|
+
typeGuard.DiscoverRegex.test(formattedCardNumber));
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -7,7 +7,7 @@ const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
|
7
7
|
const placeholder = require('./placeholder-cb6d37ad.js');
|
|
8
8
|
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-d10ace87.js');
|
|
9
9
|
const component = require('./component-1e352960.js');
|
|
10
|
-
const designToken = require('./design-token-
|
|
10
|
+
const designToken = require('./design-token-52f9da81.js');
|
|
11
11
|
const ui = require('./ui-4ce1fa08.js');
|
|
12
12
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-df6e6df0.js');
|
|
13
13
|
const domNodeSubjectFactory = require('./dom-node-subject-factory-bad99695.js');
|
|
@@ -17,10 +17,10 @@ const internalIconManager = require('./internal-icon-manager-f8677abb.js');
|
|
|
17
17
|
const observer = require('./observer-f49483e8.js');
|
|
18
18
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
19
19
|
const staticSubjectTitle = require('./static-subject-title-85732e0f.js');
|
|
20
|
-
const typeGuard = require('./type-guard-
|
|
20
|
+
const typeGuard = require('./type-guard-f12b5bae.js');
|
|
21
21
|
const eventEmitSlimmer = require('./event-emit-slimmer-efc70b94.js');
|
|
22
22
|
require('./breakpoints-ebde4837.js');
|
|
23
|
-
require('./responsive-format-facade-
|
|
23
|
+
require('./responsive-format-facade-3ab3b18c.js');
|
|
24
24
|
require('./page-resize-observer-slimmer-11937d6f.js');
|
|
25
25
|
require('./ui-32e69595.js');
|
|
26
26
|
require('./try-get-document-c0ebd39a.js');
|
|
@@ -39,14 +39,13 @@ require('./index-4d7bce1a.js');
|
|
|
39
39
|
require('./icon-manager-9072356d.js');
|
|
40
40
|
require('./wait-for-vega-handler-5469ff80.js');
|
|
41
41
|
require('./translation-cde4dce3.js');
|
|
42
|
-
require('./content-state-
|
|
43
|
-
require('./code-block-
|
|
42
|
+
require('./content-state-2096aa5a.js');
|
|
43
|
+
require('./code-block-7d901dfc.js');
|
|
44
44
|
require('./vega-internal-event-id-ae6e2c13.js');
|
|
45
45
|
require('./string-39438062.js');
|
|
46
46
|
require('./object-e2e28e3d.js');
|
|
47
47
|
require('./typography-4560e7f1.js');
|
|
48
|
-
require('./state-background-color-formatter-
|
|
49
|
-
require('./regex-c1f70fd4.js');
|
|
48
|
+
require('./state-background-color-formatter-aa5570f6.js');
|
|
50
49
|
|
|
51
50
|
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
52
51
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-00ba6623.js');
|
|
6
6
|
const component = require('./component-1e352960.js');
|
|
7
7
|
const ui = require('./ui-4ce1fa08.js');
|
|
8
|
-
const designToken = require('./design-token-
|
|
9
|
-
const responsiveFormatFacade = require('./responsive-format-facade-
|
|
8
|
+
const designToken = require('./design-token-52f9da81.js');
|
|
9
|
+
const responsiveFormatFacade = require('./responsive-format-facade-3ab3b18c.js');
|
|
10
10
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
11
11
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-11937d6f.js');
|
|
12
12
|
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-d10ace87.js');
|
|
@@ -17,12 +17,11 @@ const internalIconManager = require('./internal-icon-manager-f8677abb.js');
|
|
|
17
17
|
const chevronUp = require('./chevron-up-21465cf7.js');
|
|
18
18
|
const chevronDown = require('./chevron-down-9847bf78.js');
|
|
19
19
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-df6e6df0.js');
|
|
20
|
-
require('./type-guard-
|
|
20
|
+
require('./type-guard-f12b5bae.js');
|
|
21
21
|
require('./breakpoints-ebde4837.js');
|
|
22
22
|
require('./ui-32e69595.js');
|
|
23
|
-
require('./regex-c1f70fd4.js');
|
|
24
23
|
require('./typography-4560e7f1.js');
|
|
25
|
-
require('./state-background-color-formatter-
|
|
24
|
+
require('./state-background-color-formatter-aa5570f6.js');
|
|
26
25
|
require('./number-4816603d.js');
|
|
27
26
|
require('./pixel-98f2a10c.js');
|
|
28
27
|
require('./array-249289f2.js');
|
|
@@ -41,8 +40,8 @@ require('./index-4d7bce1a.js');
|
|
|
41
40
|
require('./icon-manager-9072356d.js');
|
|
42
41
|
require('./wait-for-vega-handler-5469ff80.js');
|
|
43
42
|
require('./translation-cde4dce3.js');
|
|
44
|
-
require('./content-state-
|
|
45
|
-
require('./code-block-
|
|
43
|
+
require('./content-state-2096aa5a.js');
|
|
44
|
+
require('./code-block-7d901dfc.js');
|
|
46
45
|
require('./vega-internal-event-id-ae6e2c13.js');
|
|
47
46
|
require('./string-39438062.js');
|
|
48
47
|
require('./object-e2e28e3d.js');
|
|
@@ -4,19 +4,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-00ba6623.js');
|
|
6
6
|
const component = require('./component-1e352960.js');
|
|
7
|
-
const designToken = require('./design-token-
|
|
7
|
+
const designToken = require('./design-token-52f9da81.js');
|
|
8
8
|
const ui = require('./ui-4ce1fa08.js');
|
|
9
9
|
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
|
|
10
10
|
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-d10ace87.js');
|
|
11
|
-
const responsiveFormatFacade = require('./responsive-format-facade-
|
|
11
|
+
const responsiveFormatFacade = require('./responsive-format-facade-3ab3b18c.js');
|
|
12
12
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-11937d6f.js');
|
|
13
|
-
const styleFormatter = require('./style-formatter-
|
|
14
|
-
require('./type-guard-
|
|
13
|
+
const styleFormatter = require('./style-formatter-dcb443fb.js');
|
|
14
|
+
require('./type-guard-f12b5bae.js');
|
|
15
15
|
require('./breakpoints-ebde4837.js');
|
|
16
16
|
require('./ui-32e69595.js');
|
|
17
|
-
require('./regex-c1f70fd4.js');
|
|
18
17
|
require('./typography-4560e7f1.js');
|
|
19
|
-
require('./state-background-color-formatter-
|
|
18
|
+
require('./state-background-color-formatter-aa5570f6.js');
|
|
20
19
|
require('./number-4816603d.js');
|
|
21
20
|
require('./pixel-98f2a10c.js');
|
|
22
21
|
require('./array-249289f2.js');
|
|
@@ -36,8 +35,8 @@ require('./index-4d7bce1a.js');
|
|
|
36
35
|
require('./icon-manager-9072356d.js');
|
|
37
36
|
require('./wait-for-vega-handler-5469ff80.js');
|
|
38
37
|
require('./translation-cde4dce3.js');
|
|
39
|
-
require('./content-state-
|
|
40
|
-
require('./code-block-
|
|
38
|
+
require('./content-state-2096aa5a.js');
|
|
39
|
+
require('./code-block-7d901dfc.js');
|
|
41
40
|
require('./vega-internal-event-id-ae6e2c13.js');
|
|
42
41
|
require('./string-39438062.js');
|
|
43
42
|
require('./object-e2e28e3d.js');
|