@globalpayments/vega 2.57.0 → 2.58.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/card-config-2ee5505e.js +65 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-92ab034f.js → string-input-formatter-slimmer-dc1747ad.js} +20 -1
- package/dist/cjs/vega-calendar_3.cjs.entry.js +197 -114
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +28 -4
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +20 -116
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +1 -1
- package/dist/cjs/vega-input-select.cjs.entry.js +6 -3
- package/dist/cjs/vega-input.cjs.entry.js +194 -2
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +26 -2
- package/dist/cjs/vega.cjs.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-post-operation-date-controller.js +48 -0
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.js +8 -2
- package/dist/collection/components/vega-calendar/vega-calendar.js +42 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +27 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.css +6 -0
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.js +25 -2
- package/dist/collection/components/vega-input/vega-input.js +1 -1
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +13 -52
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.css +4 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -2
- package/dist/collection/components/vega-input-select/vega-input-select.css +0 -3
- package/dist/collection/components/vega-selection-tile/slimmers/controllers/vega-selection-tile-state-controller.js +7 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +37 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.css +12 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +7 -2
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table.js +1 -1
- package/dist/collection/constants/card-config.js +4 -4
- package/dist/collection/helpers/calendar/calendar-period/month-period.js +15 -1
- package/dist/collection/helpers/calendar/calendar-period/week-period.js +6 -7
- package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +12 -4
- package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +2 -2
- package/dist/collection/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.js +74 -0
- package/dist/collection/helpers/formatter/string-formatter/credit-card-input-mask-strategy.js +34 -0
- package/dist/collection/helpers/formatter/string-formatter/credit-card-mask-strategy.abstract.js +63 -0
- package/dist/collection/helpers/formatter/string-formatter/string-format-strategy.abstract.js +4 -1
- package/dist/collection/helpers/formatter/string-formatter/string-mask-strategy.js +8 -0
- package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +8 -0
- package/dist/esm/{app-globals-366415b3.js → app-globals-ee6a1250.js} +3 -3
- package/dist/esm/card-config-d2ad484e.js +63 -0
- package/dist/esm/{code-block-73869a3c.js → code-block-7bd4cb87.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-dfe89c93.js → component-value-history-controller-slimmer.abstract-41c58caf.js} +2 -2
- package/dist/esm/{content-state-953906e8.js → content-state-a43e703e.js} +1 -1
- package/dist/esm/{design-token-28a0a2e6.js → design-token-23522f5c.js} +1 -1
- package/dist/esm/{element-appender-slimmer-7b9f4a8e.js → element-appender-slimmer-042df95a.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-707a6da2.js → form-field-controller-slimmer-f0982f11.js} +2 -2
- package/dist/esm/{image-annotation-action-5bfda07c.js → image-annotation-action-1e88f5a0.js} +1 -1
- package/dist/esm/{index-3e551cbe.js → index-fb3b74bd.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{public-rules-c5d2c1e1.js → public-rules-287d4d77.js} +4 -4
- package/dist/esm/{responsive-format-facade-60731164.js → responsive-format-facade-d2632288.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-4429066e.js → rich-text-editor-required-rule-69d5f035.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-6ab5cad6.js → string-input-formatter-slimmer-09478e0d.js} +23 -4
- package/dist/esm/{style-formatter-57fc600a.js → style-formatter-f7951677.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-1c4d1e78.js → sub-state-notify-slimmer-0a6c3cbb.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-1e9af9ec.js → sub-state-observer-slimmer-53eec5fb.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +5 -5
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-calendar_3.entry.js +200 -117
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +4 -4
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +3 -3
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +9 -9
- package/dist/esm/vega-dialog_2.entry.js +5 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +35 -11
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +4 -4
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +6 -6
- package/dist/esm/vega-input-credit-card.entry.js +21 -117
- package/dist/esm/vega-input-numeric.entry.js +4 -4
- package/dist/esm/vega-input-phone-number.entry.js +6 -6
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +12 -9
- package/dist/esm/vega-input.entry.js +198 -6
- package/dist/esm/{vega-internal-event-id-f0ea2bab.js → vega-internal-event-id-4072659b.js} +1 -1
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +5 -5
- package/dist/esm/vega-radio_2.entry.js +3 -3
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +10 -10
- package/dist/esm/vega-selection-chip_2.entry.js +7 -7
- package/dist/esm/vega-selection-tile_2.entry.js +30 -6
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +3 -3
- package/dist/esm/vega-table_8.entry.js +6 -6
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +7 -7
- package/dist/esm/vega-toggle-switch.entry.js +3 -3
- package/dist/esm/vega-tooltip_2.entry.js +5 -5
- package/dist/esm/vega.js +6 -6
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-post-operation-date-controller.d.ts +23 -0
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.d.ts +2 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +15 -1
- package/dist/types/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.d.ts +4 -0
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +7 -0
- package/dist/types/components/vega-input/types.d.ts +10 -1
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +1 -13
- package/dist/types/components/vega-selection-tile/slimmers/controllers/vega-selection-tile-state-controller.d.ts +1 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.d.ts +8 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +4 -0
- package/dist/types/components/vega-table/interface.d.ts +18 -11
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table.d.ts +1 -1
- package/dist/types/components.d.ts +24 -4
- package/dist/types/helpers/calendar/calendar-period/calendar-period.abstract.d.ts +3 -3
- package/dist/types/helpers/calendar/calendar-period/month-period.d.ts +7 -1
- package/dist/types/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.d.ts +28 -0
- package/dist/types/helpers/formatter/string-formatter/credit-card-input-mask-strategy.d.ts +21 -0
- package/dist/types/helpers/formatter/string-formatter/credit-card-mask-strategy.abstract.d.ts +36 -0
- package/dist/types/helpers/formatter/string-formatter/string-format-strategy.abstract.d.ts +1 -1
- package/dist/types/helpers/formatter/string-formatter/string-mask-strategy.d.ts +9 -3
- package/dist/types/helpers/slimmers/string-input-formatter-slimmer.d.ts +4 -0
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-6acf0a51.entry.js → p-083af15f.entry.js} +1 -1
- package/dist/vega/{p-75ff12da.entry.js → p-091ab617.entry.js} +1 -1
- package/dist/vega/{p-47e89c0e.entry.js → p-0b5330e1.entry.js} +1 -1
- package/dist/vega/{p-f4a7acff.entry.js → p-1a4f77de.entry.js} +1 -1
- package/dist/vega/{p-21a7530c.entry.js → p-1a6dacc7.entry.js} +1 -1
- package/dist/vega/{p-2ebef70f.entry.js → p-1db2ba98.entry.js} +1 -1
- package/dist/vega/{p-e277ea73.entry.js → p-1f9a735a.entry.js} +1 -1
- package/dist/vega/{p-44880bdf.entry.js → p-24042f0c.entry.js} +1 -1
- package/dist/vega/{p-e28fcf04.entry.js → p-27a9ad35.entry.js} +1 -1
- package/dist/vega/{p-0496f1cb.entry.js → p-27ec0c07.entry.js} +1 -1
- package/dist/vega/{p-27dca371.entry.js → p-317920e6.entry.js} +1 -1
- package/dist/vega/{p-a2ef3429.entry.js → p-376b3ec7.entry.js} +1 -1
- package/dist/vega/{p-dc16e6ba.entry.js → p-394594e9.entry.js} +1 -1
- package/dist/vega/{p-8fb5bcb0.entry.js → p-42ec43ef.entry.js} +1 -1
- package/dist/vega/{p-6e1b5949.js → p-43263510.js} +1 -1
- package/dist/vega/{p-29f4cbed.entry.js → p-435451be.entry.js} +1 -1
- package/dist/vega/p-472108bd.entry.js +1 -0
- package/dist/vega/{p-6131f229.entry.js → p-48ae6f02.entry.js} +1 -1
- package/dist/vega/{p-1c4d05de.entry.js → p-48b24fd3.entry.js} +1 -1
- package/dist/vega/{p-fb8c99c5.js → p-4a237308.js} +1 -1
- package/dist/vega/{p-5dec9bd9.entry.js → p-4ab67150.entry.js} +1 -1
- package/dist/vega/{p-d82ceacf.entry.js → p-4c4ac1a5.entry.js} +1 -1
- package/dist/vega/p-4fb159d5.js +1 -0
- package/dist/vega/p-5bd3487e.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-39049341.entry.js → p-5fe47fe8.entry.js} +1 -1
- package/dist/vega/{p-d5ab867e.entry.js → p-61ea2d75.entry.js} +1 -1
- package/dist/vega/{p-e32efc2e.entry.js → p-63adca7b.entry.js} +1 -1
- package/dist/vega/{p-7c0004dc.entry.js → p-699032fc.entry.js} +1 -1
- package/dist/vega/{p-0b77c6c9.entry.js → p-710da484.entry.js} +1 -1
- package/dist/vega/{p-007bf7df.js → p-71c65f7e.js} +1 -1
- package/dist/vega/{p-a92a8172.entry.js → p-81279fea.entry.js} +1 -1
- package/dist/vega/{p-ecd032fc.js → p-8782abeb.js} +1 -1
- package/dist/vega/p-88e08a33.js +1 -0
- package/dist/vega/{p-4f5eb8d5.js → p-8c4f893b.js} +1 -1
- package/dist/vega/p-8e2b1dae.entry.js +1 -0
- package/dist/vega/{p-2873b600.entry.js → p-8f8de5ab.entry.js} +1 -1
- package/dist/vega/p-92355996.entry.js +1 -0
- package/dist/vega/p-9540e3ed.entry.js +1 -0
- package/dist/vega/p-997a2064.entry.js +1 -0
- package/dist/vega/{p-ce14af16.js → p-9a956a00.js} +1 -1
- package/dist/vega/{p-fcb04960.js → p-9afdcf65.js} +1 -1
- package/dist/vega/p-9b08ed46.entry.js +1 -0
- package/dist/vega/{p-b44ebc84.entry.js → p-9ce0bd82.entry.js} +1 -1
- package/dist/vega/{p-f8f8e7d2.entry.js → p-a04491cc.entry.js} +1 -1
- package/dist/vega/{p-99c4559e.entry.js → p-a1056063.entry.js} +1 -1
- package/dist/vega/{p-b449fe9a.entry.js → p-a4a0fcfd.entry.js} +1 -1
- package/dist/vega/{p-f79c82c7.entry.js → p-a7042a5a.entry.js} +1 -1
- package/dist/vega/p-acf7667e.entry.js +1 -0
- package/dist/vega/{p-8ba8a7cc.entry.js → p-b21b128c.entry.js} +1 -1
- package/dist/vega/{p-766ed063.entry.js → p-b75a8edb.entry.js} +1 -1
- package/dist/vega/{p-1e3f4007.entry.js → p-c21295cf.entry.js} +1 -1
- package/dist/vega/{p-5130bb06.entry.js → p-c69a6547.entry.js} +1 -1
- package/dist/vega/{p-79c2282c.entry.js → p-c9740710.entry.js} +1 -1
- package/dist/vega/{p-f4546425.entry.js → p-ce5a3589.entry.js} +1 -1
- package/dist/vega/{p-cd3d468c.js → p-d1355307.js} +1 -1
- package/dist/vega/{p-07927476.entry.js → p-d661a5aa.entry.js} +1 -1
- package/dist/vega/{p-8246f8ae.js → p-d7e0c57a.js} +1 -1
- package/dist/vega/p-e1ed78db.js +1 -0
- package/dist/vega/{p-34643550.entry.js → p-ef84dc90.entry.js} +1 -1
- package/dist/vega/{p-2458ad97.js → p-f229d6d1.js} +1 -1
- package/dist/vega/{p-fd2f699b.js → p-f25570f5.js} +1 -1
- package/dist/vega/{p-888dc143.entry.js → p-f27fcc7c.entry.js} +1 -1
- package/dist/vega/{p-f3f7d059.entry.js → p-f543e911.entry.js} +1 -1
- package/dist/vega/{p-65d8c2bc.js → p-f5ac60f5.js} +1 -1
- package/dist/vega/{p-bdaf1143.entry.js → p-f7b5833d.entry.js} +1 -1
- package/dist/vega/p-fc02a67a.js +1 -0
- package/dist/vega/{p-a33c6652.entry.js → p-fcb5b40f.entry.js} +1 -1
- package/dist/vega/{p-aed3320d.js → p-fda6f8bc.js} +1 -1
- package/dist/vega/{p-e5196440.entry.js → p-fe1512f9.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-0604563a.entry.js +0 -1
- package/dist/vega/p-3a7e897b.entry.js +0 -1
- package/dist/vega/p-51297b96.js +0 -1
- package/dist/vega/p-51a4dc20.entry.js +0 -1
- package/dist/vega/p-53e9595f.js +0 -1
- package/dist/vega/p-6ec338b0.entry.js +0 -1
- package/dist/vega/p-76818196.entry.js +0 -1
- package/dist/vega/p-79a0a06c.js +0 -1
- package/dist/vega/p-9481c073.entry.js +0 -1
- package/dist/vega/p-b8d7d4a9.js +0 -1
- package/dist/vega/p-f8e0e4f0.entry.js +0 -1
|
@@ -20,7 +20,7 @@ const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
|
|
|
20
20
|
const vegaSkeletonLoaderController = require('./vega-skeleton-loader-controller-d534f5a1.js');
|
|
21
21
|
const staticSubjectTitle = require('./static-subject-title-7e7d791a.js');
|
|
22
22
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
23
|
-
const stringInputFormatterSlimmer = require('./string-input-formatter-slimmer-
|
|
23
|
+
const stringInputFormatterSlimmer = require('./string-input-formatter-slimmer-dc1747ad.js');
|
|
24
24
|
const elementAppenderSlimmer = require('./element-appender-slimmer-7f98d16b.js');
|
|
25
25
|
require('./vega-env-manager-23b8b23c.js');
|
|
26
26
|
const featureFlagController = require('./feature-flag-controller-ce2162c8.js');
|
|
@@ -2227,6 +2227,14 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
2227
2227
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2228
2228
|
};
|
|
2229
2229
|
class VegaDropdownItemRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
2230
|
+
constructor() {
|
|
2231
|
+
super(...arguments);
|
|
2232
|
+
this.setLabelRef = (ref) => {
|
|
2233
|
+
if (ref) {
|
|
2234
|
+
this.labelRef = ref;
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
}
|
|
2230
2238
|
render() {
|
|
2231
2239
|
return (index.h("li", { key: this.label, role: "menuitem", "aria-label": this.label, class: {
|
|
2232
2240
|
'vega-dropdown-item-selected': this.selected,
|
|
@@ -2242,7 +2250,7 @@ class VegaDropdownItemRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
2242
2250
|
} },
|
|
2243
2251
|
this.renderSelectIcon(),
|
|
2244
2252
|
this.renderPrefixIcon(),
|
|
2245
|
-
this.renderLabel(),
|
|
2253
|
+
this.itemDisplayRule === 'ellipsis' ? this.renderLabelWithTooltip() : this.renderLabel(),
|
|
2246
2254
|
this.renderCounter()));
|
|
2247
2255
|
}
|
|
2248
2256
|
renderSelectIcon() {
|
|
@@ -2266,12 +2274,12 @@ class VegaDropdownItemRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
2266
2274
|
// We prioritize slots, and when both slots and labels are defined, we can collect label information for component display,
|
|
2267
2275
|
// such as input select selected item display
|
|
2268
2276
|
if (this.host.childElementCount > 0 || this.host.textContent.trim() !== '') {
|
|
2269
|
-
return (index.h("span", { class: "vega-dropdown-item-label" },
|
|
2277
|
+
return (index.h("span", { class: "vega-dropdown-item-label", ref: this.setLabelRef },
|
|
2270
2278
|
index.h("slot", null)));
|
|
2271
2279
|
}
|
|
2272
2280
|
else {
|
|
2273
2281
|
return (index.h(index.Fragment, null,
|
|
2274
|
-
index.h("span", { innerHTML: this.label, class: "vega-dropdown-item-label" }),
|
|
2282
|
+
index.h("span", { innerHTML: this.label, class: "vega-dropdown-item-label", ref: this.setLabelRef }),
|
|
2275
2283
|
index.h("span", { class: "v-hidden" },
|
|
2276
2284
|
index.h("slot", null))));
|
|
2277
2285
|
}
|
|
@@ -2283,6 +2291,22 @@ class VegaDropdownItemRenderer extends globalSlimmerRegistry.VegaSlimmer {
|
|
|
2283
2291
|
onSelect(e) {
|
|
2284
2292
|
this.vegaDropdownItemClickController.handleClick(e);
|
|
2285
2293
|
}
|
|
2294
|
+
renderLabelWithTooltip() {
|
|
2295
|
+
if (!this.label) {
|
|
2296
|
+
return this.renderLabel();
|
|
2297
|
+
}
|
|
2298
|
+
return (index.h("vega-tooltip", { ref: (ref) => {
|
|
2299
|
+
if (ref) {
|
|
2300
|
+
this.tooltipRef = ref;
|
|
2301
|
+
}
|
|
2302
|
+
}, text: this.label.replace(/<b>(.*?)<\/b>/g, '$1'), trigger: "none", placement: ['bottom', 'top'], alignment: "center",
|
|
2303
|
+
/* eslint-disable-next-line react/jsx-no-bind */
|
|
2304
|
+
onMouseEnter: (e) => {
|
|
2305
|
+
e.preventDefault();
|
|
2306
|
+
const isTextTruncated = this.labelRef.scrollWidth > this.labelRef.clientWidth;
|
|
2307
|
+
this.tooltipRef.trigger = isTextTruncated ? 'hover' : 'none';
|
|
2308
|
+
} }, this.renderLabel()));
|
|
2309
|
+
}
|
|
2286
2310
|
}
|
|
2287
2311
|
__decorate$9([
|
|
2288
2312
|
globalSlimmerRegistry.MapToComponentField()
|
|
@@ -2434,7 +2458,7 @@ __decorate$7([
|
|
|
2434
2458
|
globalSlimmerRegistry.MapToComponentField()
|
|
2435
2459
|
], VegaDropdownItemClickController.prototype, "clickEventEmitter", void 0);
|
|
2436
2460
|
|
|
2437
|
-
const vegaDropdownItemCss = ":host{display:block}:host li{padding-top:8px;padding-bottom:8px;padding-left:16px;padding-right:16px;margin-left:4px;margin-right:4px;cursor:pointer;display:flex;align-items:center;gap:8px}:host li:focus{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));outline:0}:host li,:host li a{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;text-decoration:none}@media screen and (min-width: 768px) and (max-width: 1023px){:host li,:host li a{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host li,:host li a{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host li,:host li a{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host li:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}:host li:focus{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}:host li.vega-dropdown-item-disabled{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));pointer-events:none}:host li.vega-dropdown-item-disabled .item-prefix,:host li.vega-dropdown-item-disabled .selected-prefix{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host li.danger .item-prefix,:host li.danger .vega-dropdown-item-label{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1))}:host li .item-prefix{display:flex;width:16px;height:16px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));flex-shrink:1}:host li .selected-prefix{color:rgba(var(--v-text-link, 19, 98, 226, 1));width:16px;height:16px;display:flex;align-items:center;min-width:16px}:host li .item-counter{width:20px;height:20px}:host .vega-dropdown-item-label{flex-grow:1}:host .vega-dropdown-item-display-newline .vega-dropdown-item-label{overflow-wrap:break-word}:host .vega-dropdown-item-display-ellipsis .vega-dropdown-item-label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .v-hidden{display:none}";
|
|
2461
|
+
const vegaDropdownItemCss = ":host{display:block}:host li{padding-top:8px;padding-bottom:8px;padding-left:16px;padding-right:16px;margin-left:4px;margin-right:4px;cursor:pointer;display:flex;align-items:center;gap:8px}:host li:focus{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));outline:0}:host li,:host li a{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;text-decoration:none}@media screen and (min-width: 768px) and (max-width: 1023px){:host li,:host li a{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host li,:host li a{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host li,:host li a{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host li:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}:host li:focus{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}:host li.vega-dropdown-item-disabled{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));pointer-events:none}:host li.vega-dropdown-item-disabled .item-prefix,:host li.vega-dropdown-item-disabled .selected-prefix{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host li.danger .item-prefix,:host li.danger .vega-dropdown-item-label{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1))}:host li .item-prefix{display:flex;width:16px;height:16px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));flex-shrink:1}:host li .selected-prefix{color:rgba(var(--v-text-link, 19, 98, 226, 1));width:16px;height:16px;display:flex;align-items:center;min-width:16px}:host li .item-counter{width:20px;height:20px}:host .vega-dropdown-item-label{flex-grow:1}:host .vega-dropdown-item-display-newline .vega-dropdown-item-label{overflow-wrap:break-word}:host .vega-dropdown-item-display-ellipsis .vega-dropdown-item-label{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}:host .vega-dropdown-item-display-ellipsis vega-tooltip{flex-grow:1;display:block;overflow:hidden}:host .v-hidden{display:none}";
|
|
2438
2462
|
|
|
2439
2463
|
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2440
2464
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -11,9 +11,9 @@ exports.FrameworkEnum = void 0;
|
|
|
11
11
|
/** The VegaEnvManager class manages vega environment parameters. */
|
|
12
12
|
class VegaEnvManager {
|
|
13
13
|
constructor() {
|
|
14
|
-
// The `2.
|
|
14
|
+
// The `2.58.0` will be replaced to a version string when running publish script.
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
16
|
-
this.vegaVersion = '2.
|
|
16
|
+
this.vegaVersion = '2.58.0';
|
|
17
17
|
this.framework = exports.FrameworkEnum.VanillaJs;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-7700600c.js');
|
|
6
|
-
const
|
|
7
|
-
const regex = require('./regex-c1f70fd4.js');
|
|
6
|
+
const cardConfig = require('./card-config-2ee5505e.js');
|
|
8
7
|
const requiredFieldRule = require('./required-field-rule-d73c1d8c.js');
|
|
9
8
|
const validCreditCardNumberRule = require('./valid-credit-card-number-rule-4a1b00b8.js');
|
|
10
9
|
const component = require('./component-1e352960.js');
|
|
@@ -18,9 +17,8 @@ const childNodesEventPreventSlimmer = require('./child-nodes-event-prevent-slimm
|
|
|
18
17
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-5aa4cc83.js');
|
|
19
18
|
const domNodeSubjectFactory = require('./dom-node-subject-factory-769dd00f.js');
|
|
20
19
|
const internalIconManager = require('./internal-icon-manager-f8677abb.js');
|
|
21
|
-
const
|
|
22
|
-
require('./
|
|
23
|
-
require('./_commonjsHelpers-537d719a.js');
|
|
20
|
+
const featureFlagController = require('./feature-flag-controller-ce2162c8.js');
|
|
21
|
+
require('./regex-c1f70fd4.js');
|
|
24
22
|
require('./internal-form-field-validation-rule.abstract-07cdff46.js');
|
|
25
23
|
require('./number-4816603d.js');
|
|
26
24
|
require('./string-21427167.js');
|
|
@@ -28,6 +26,7 @@ require('./observer-f49483e8.js');
|
|
|
28
26
|
require('./ui-6c069604.js');
|
|
29
27
|
require('./create-public-api-runtime-metrics-slimmer-e2e274e1.js');
|
|
30
28
|
require('./dynamic-slimmer-f31fdfd7.js');
|
|
29
|
+
require('./vega-internal-event-id-bda08efa.js');
|
|
31
30
|
require('./translation-de7e351e.js');
|
|
32
31
|
require('./page-resize-observer-slimmer-11937d6f.js');
|
|
33
32
|
require('./ui-32e69595.js');
|
|
@@ -40,65 +39,8 @@ require('./sub-state-observer-slimmer-93d0a609.js');
|
|
|
40
39
|
require('./internal-vega-event-manager-e98944ac.js');
|
|
41
40
|
require('./vega-env-manager-23b8b23c.js');
|
|
42
41
|
require('./icon-manager-9072356d.js');
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
type: 'visa',
|
|
47
|
-
iconName: 'visa',
|
|
48
|
-
pattern: regex.VisaRegex,
|
|
49
|
-
maskConfig: {
|
|
50
|
-
type: 'custom',
|
|
51
|
-
options: {
|
|
52
|
-
mask: '9999 9999 9999 9999 999',
|
|
53
|
-
slot: '9',
|
|
54
|
-
accept: /\d/,
|
|
55
|
-
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
type: 'mastercard',
|
|
61
|
-
iconName: 'mastercard',
|
|
62
|
-
pattern: regex.MasterCardRegex,
|
|
63
|
-
maskConfig: {
|
|
64
|
-
type: 'custom',
|
|
65
|
-
options: {
|
|
66
|
-
mask: '9999 9999 9999 9999',
|
|
67
|
-
slot: '9',
|
|
68
|
-
accept: /\d/,
|
|
69
|
-
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
type: 'amex',
|
|
75
|
-
iconName: 'amex',
|
|
76
|
-
pattern: regex.AmexRegex,
|
|
77
|
-
maskConfig: {
|
|
78
|
-
type: 'custom',
|
|
79
|
-
options: {
|
|
80
|
-
mask: '9999 999999 99999',
|
|
81
|
-
slot: '9',
|
|
82
|
-
accept: /\d/,
|
|
83
|
-
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: 'discover',
|
|
89
|
-
iconName: 'discover',
|
|
90
|
-
pattern: regex.DiscoverRegex,
|
|
91
|
-
maskConfig: {
|
|
92
|
-
type: 'custom',
|
|
93
|
-
options: {
|
|
94
|
-
mask: '9999 9999 9999 9999',
|
|
95
|
-
slot: '9',
|
|
96
|
-
accept: /\d/,
|
|
97
|
-
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
];
|
|
42
|
+
require('./index-4d7bce1a.js');
|
|
43
|
+
require('./_commonjsHelpers-537d719a.js');
|
|
102
44
|
|
|
103
45
|
const Icons = {
|
|
104
46
|
'visa': {
|
|
@@ -194,17 +136,6 @@ const VegaInputCreditCard = class {
|
|
|
194
136
|
this.focusEventEmitter = eventEmitSlimmer.createEventEmitSlimmer(VegaInputCreditCard, domNodeSubjectFactory.VegaFocus);
|
|
195
137
|
this.inputCreditCardEventPrevent = new childNodesEventPreventSlimmer.ChildNodesEventPreventSlimmer([domNodeSubjectFactory.VegaChange, domNodeSubjectFactory.VegaFocus, domNodeSubjectFactory.VegaBlur], () => this.host, true);
|
|
196
138
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new componentUsageRuntimeMetrics.VegaComponentUsageRuntimeMetricsSlimmer(VegaInputCreditCardRuntimeMetricsPayloadDefinition);
|
|
197
|
-
this.maskConfig = {
|
|
198
|
-
type: 'custom',
|
|
199
|
-
options: {
|
|
200
|
-
mask: '',
|
|
201
|
-
slot: '9',
|
|
202
|
-
accept: /[\d\s]/,
|
|
203
|
-
insertMode: false,
|
|
204
|
-
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
205
|
-
},
|
|
206
|
-
trigger: 'blur',
|
|
207
|
-
};
|
|
208
139
|
/**
|
|
209
140
|
* Specifies whether a card number must be entered for
|
|
210
141
|
* this component to pass form validation.
|
|
@@ -292,7 +223,7 @@ const VegaInputCreditCard = class {
|
|
|
292
223
|
this.renderInputContainer = () => {
|
|
293
224
|
var _a;
|
|
294
225
|
const iconName = ((_a = this.getCreditCardType(this.value)) === null || _a === void 0 ? void 0 : _a.iconName) || 'regular-credit-card';
|
|
295
|
-
return (index.h("vega-input", { label: this.label, type: "number", prefixIcon: internalIconManager.VegaInternalIconManager.getIconKey(iconName), maskConfig: this.getMaskConfig(
|
|
226
|
+
return (index.h("vega-input", { label: this.label, type: "number", prefixIcon: internalIconManager.VegaInternalIconManager.getIconKey(iconName), maskConfig: this.getMaskConfig(), placeholder: this.placeholder, disabled: this.disabled, size: this.size, value: this.value, hint: this.hint, required: this.required, showClearIcon: false, ref: (ref) => {
|
|
296
227
|
this.inputRef = ref;
|
|
297
228
|
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, domNodeSubjectFactory.VegaChange, (input) => {
|
|
298
229
|
this.handleVegaChange(input);
|
|
@@ -303,10 +234,6 @@ const VegaInputCreditCard = class {
|
|
|
303
234
|
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, domNodeSubjectFactory.VegaFocus, () => {
|
|
304
235
|
this.handleVegaFocus();
|
|
305
236
|
});
|
|
306
|
-
domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(ref, vegaInternalEventId.VegaInternalPasteEvent, (event) => {
|
|
307
|
-
const pastedValue = event.clipboardData.getData('text');
|
|
308
|
-
this.inputRef.maskConfig = this.getMaskConfig(pastedValue); // The mask should be updated before the value changed.
|
|
309
|
-
});
|
|
310
237
|
} }));
|
|
311
238
|
};
|
|
312
239
|
this.handleVegaChange = (e) => {
|
|
@@ -347,43 +274,20 @@ const VegaInputCreditCard = class {
|
|
|
347
274
|
return component.sanitizeVegaComponent(index.h(index.Host, null, this.renderInputContainer()), this.host);
|
|
348
275
|
}
|
|
349
276
|
getCreditCardType(value) {
|
|
350
|
-
return CARDS_INFO.filter((card) => card.pattern.test(value))[0];
|
|
351
|
-
}
|
|
352
|
-
getMaskConfig(value) {
|
|
353
|
-
const maskConfig = [];
|
|
354
|
-
const creditCardType = this.getCreditCardType(value);
|
|
355
|
-
if (creditCardType) {
|
|
356
|
-
maskConfig.push(creditCardType.maskConfig);
|
|
357
|
-
if (this.hideCardNumberOnBlur && value.trim().includes(' ')) {
|
|
358
|
-
this.maskConfig.options.mask = this.generateDynamicMask();
|
|
359
|
-
maskConfig.push(this.maskConfig);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
return maskConfig;
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* The below method is e2e-test covered in
|
|
366
|
-
* @see{module:vega-input-credit-card-dynamic-mask-e2e}
|
|
367
|
-
*/
|
|
368
|
-
/* istanbul ignore next */
|
|
369
|
-
/** Transform the input card number with dynamic card number mask, for example: '4111 2222 3333 44' will be transformed to 'XXXX XXXX XXXX 99' */
|
|
370
|
-
generateDynamicMask() {
|
|
371
|
-
const cardNumberSplit = this.value.trim().split(' ');
|
|
372
|
-
const cardNumberMask = this.maskCardNumber(cardNumberSplit).join(' ');
|
|
373
|
-
return cardNumberMask;
|
|
277
|
+
return cardConfig.CARDS_INFO.filter((card) => card.pattern.test(value))[0];
|
|
374
278
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
279
|
+
getMaskConfig() {
|
|
280
|
+
return [
|
|
281
|
+
{
|
|
282
|
+
type: 'credit-card',
|
|
283
|
+
trigger: 'input',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
type: 'credit-card',
|
|
287
|
+
trigger: 'blur',
|
|
288
|
+
hideCardNumberOnBlur: this.hideCardNumberOnBlur,
|
|
289
|
+
},
|
|
290
|
+
];
|
|
387
291
|
}
|
|
388
292
|
get host() { return index.getElement(this); }
|
|
389
293
|
static get watchers() { return {
|
|
@@ -6660,7 +6660,7 @@ class ValidPhoneNumberRule extends internalFormFieldValidationRule_abstract.Inte
|
|
|
6660
6660
|
}
|
|
6661
6661
|
}
|
|
6662
6662
|
|
|
6663
|
-
const vegaInputPhoneNumberCss = ":host{display:inline-block;width:100%}:host .vega-input-phone-number-hint{display:inline-block;padding-top:12px;padding-left:8px;padding-right:8px}:host .vega-input-phone-number-container.error vega-input::part(input-container){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-input-phone-number-container.error vega-input::part(input-container):hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-input-phone-number-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));box-shadow:0 0 0}:host vega-field-label{margin-bottom:8px}:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}.vega-input-phone-number-dropdown-item{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}.vega-input-phone-number-dropdown-icon{text-align:center;font-size:0px}";
|
|
6663
|
+
const vegaInputPhoneNumberCss = ":host{display:inline-block;width:100%}:host .vega-input-phone-number-hint{display:inline-block;padding-top:12px;padding-left:8px;padding-right:8px}.vega-input-phone-number-container vega-input-select{white-space:nowrap}:host .vega-input-phone-number-container.error vega-input::part(input-container){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-input-phone-number-container.error vega-input::part(input-container):hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-input-phone-number-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1));box-shadow:0 0 0}:host vega-field-label{margin-bottom:8px}:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}.vega-input-phone-number-dropdown-item{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}.vega-input-phone-number-dropdown-icon{text-align:center;font-size:0px}";
|
|
6664
6664
|
|
|
6665
6665
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
6666
6666
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -327,7 +327,9 @@ class VegaInputSelectDropdownRenderer extends globalSlimmerRegistry.VegaSlimmer
|
|
|
327
327
|
};
|
|
328
328
|
this.renderMultipleSelected = () => {
|
|
329
329
|
if (this.value.length > 0) {
|
|
330
|
-
|
|
330
|
+
const selectedLabelStr = this.selectedLabel(this.value);
|
|
331
|
+
return (index.h("span", { class: "vega-input-select-selected" },
|
|
332
|
+
index.h("vega-text", { overflow: "ellipsis", tooltip: { placement: 'bottom' }, key: selectedLabelStr }, selectedLabelStr)));
|
|
331
333
|
}
|
|
332
334
|
else {
|
|
333
335
|
return (index.h("div", { class: "vega-input-select-placeholder" }, this.translationSlimmer.t(this.placeholder)));
|
|
@@ -336,7 +338,8 @@ class VegaInputSelectDropdownRenderer extends globalSlimmerRegistry.VegaSlimmer
|
|
|
336
338
|
this.renderSingleSelected = () => {
|
|
337
339
|
const item = this.sourceController.getItem(this.value);
|
|
338
340
|
if (item) {
|
|
339
|
-
return (index.h("span", { class: "vega-input-select-selected", part: "selected-box" },
|
|
341
|
+
return (index.h("span", { class: "vega-input-select-selected", part: "selected-box" },
|
|
342
|
+
index.h("vega-text", { overflow: "ellipsis", tooltip: { placement: 'bottom' }, key: item.displayName }, item.displayName)));
|
|
340
343
|
}
|
|
341
344
|
else {
|
|
342
345
|
return (index.h("div", { class: "vega-input-select-placeholder", part: "placeholder" }, this.translationSlimmer.t(this.placeholder)));
|
|
@@ -708,7 +711,7 @@ __decorate$1([
|
|
|
708
711
|
globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
|
|
709
712
|
], VegaInputSelectPrefixIconRenderer.prototype, "connectedCallback", null);
|
|
710
713
|
|
|
711
|
-
const vegaInputSelectCss = ":host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}:host(.default) .vega-input-select-container{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px}:host(.small) .vega-input-select-container{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));padding-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-input-select-label .vega-input-select-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}:host .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;gap:8px;display:block;display:flex;align-items:center;cursor:pointer}:host .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .error .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .error .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .error .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host(.vega-input-select-disabled) .vega-input-select-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}:host(.vega-input-select-disabled) vega-dropdown{pointer-events:none}:host(.vega-input-select-disabled) .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-input-select-disabled) .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-input-select-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-input-select-select-container{flex-grow:1;min-width:0px}:host .vega-input-select-selected{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));
|
|
714
|
+
const vegaInputSelectCss = ":host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}:host(.default) .vega-input-select-container{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px}:host(.small) .vega-input-select-container{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));padding-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-label{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-input-select-label .vega-input-select-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}:host .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;gap:8px;display:block;display:flex;align-items:center;cursor:pointer}:host .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .error .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .error .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .error .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host(.vega-input-select-disabled) .vega-input-select-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}:host(.vega-input-select-disabled) vega-dropdown{pointer-events:none}:host(.vega-input-select-disabled) .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-input-select-disabled) .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-input-select-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-input-select-select-container{flex-grow:1;min-width:0px}:host .vega-input-select-selected{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));display:block;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-selected{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-selected{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-selected{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.vega-input-select-disabled) .vega-input-select-selected{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .vega-input-select-placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-placeholder{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-select-prefix-icon{text-align:center;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-size:0px}:host .vega-input-select-toggle-icon{width:16px;height:16px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}:host .vega-input-select-hint{padding-left:8px;padding-right:8px;padding-top:12px;font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-hint{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-hint{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-hint{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host vega-dropdown{display:block}";
|
|
712
715
|
|
|
713
716
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
714
717
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -18,8 +18,10 @@ const eventEmitSlimmer = require('./event-emit-slimmer-6154c759.js');
|
|
|
18
18
|
const domNodeSubjectFactory = require('./dom-node-subject-factory-769dd00f.js');
|
|
19
19
|
const staticSubjectTitle = require('./static-subject-title-7e7d791a.js');
|
|
20
20
|
const changeManager = require('./change-manager-a297e4d2.js');
|
|
21
|
-
const stringInputFormatterSlimmer = require('./string-input-formatter-slimmer-
|
|
21
|
+
const stringInputFormatterSlimmer = require('./string-input-formatter-slimmer-dc1747ad.js');
|
|
22
22
|
const typeGuard = require('./type-guard-aa8fdeaf.js');
|
|
23
|
+
const featureFlagController = require('./feature-flag-controller-ce2162c8.js');
|
|
24
|
+
const cardConfig = require('./card-config-2ee5505e.js');
|
|
23
25
|
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-5aa4cc83.js');
|
|
24
26
|
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-11937d6f.js');
|
|
25
27
|
const subStateObserverSlimmer = require('./sub-state-observer-slimmer-93d0a609.js');
|
|
@@ -43,6 +45,8 @@ require('./breakpoints-ebde4837.js');
|
|
|
43
45
|
require('./ui-32e69595.js');
|
|
44
46
|
require('./regex-c1f70fd4.js');
|
|
45
47
|
require('./typography-4560e7f1.js');
|
|
48
|
+
require('./index-4d7bce1a.js');
|
|
49
|
+
require('./_commonjsHelpers-537d719a.js');
|
|
46
50
|
|
|
47
51
|
/**
|
|
48
52
|
* This email regex from https://stackoverflow.com/a/201378
|
|
@@ -465,6 +469,173 @@ class NumberThousandCommaStrategy extends NumberMaskStrategy {
|
|
|
465
469
|
}
|
|
466
470
|
}
|
|
467
471
|
|
|
472
|
+
/**
|
|
473
|
+
* Credit card mask strategy abstract class
|
|
474
|
+
*/
|
|
475
|
+
class CreditCardMaskStrategy extends stringInputFormatterSlimmer.StringMaskStrategy {
|
|
476
|
+
/* istanbul ignore next */
|
|
477
|
+
/**
|
|
478
|
+
* Get the position of caret
|
|
479
|
+
*
|
|
480
|
+
* @param {string} input - The input string
|
|
481
|
+
* @param {number} caretPosition - The current position of caret
|
|
482
|
+
* @returns {Nullable<number>} The new position of caret
|
|
483
|
+
*/
|
|
484
|
+
calculateCaretPosition(input, caretPosition) {
|
|
485
|
+
if (!typeGuard.isNonNullable(caretPosition))
|
|
486
|
+
return null;
|
|
487
|
+
const maskConfigType = this.getCreditCardMaskConfig(input);
|
|
488
|
+
if (maskConfigType) {
|
|
489
|
+
if (input.length > this.getLengthLimit()) {
|
|
490
|
+
const exceededLength = input.length - this.getLengthLimit();
|
|
491
|
+
return caretPosition - exceededLength;
|
|
492
|
+
}
|
|
493
|
+
const startValue = input.substring(0, caretPosition);
|
|
494
|
+
const maskedStartValue = this.format(startValue);
|
|
495
|
+
return caretPosition + (maskedStartValue.length - startValue.length);
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
return caretPosition;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
/* istanbul ignore next */
|
|
502
|
+
/**
|
|
503
|
+
* @inheritDoc
|
|
504
|
+
*/
|
|
505
|
+
format(input, inputStatus) {
|
|
506
|
+
const maskConfigType = this.getCreditCardMaskConfig(input);
|
|
507
|
+
if (maskConfigType) {
|
|
508
|
+
this.setMaskConfig(maskConfigType.options);
|
|
509
|
+
const caretPosition = inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.caretPosition;
|
|
510
|
+
if (input.length > this.getLengthLimit() && typeGuard.isNonNullable(caretPosition)) {
|
|
511
|
+
const rawValueArr = [...input];
|
|
512
|
+
const exceededLength = input.length - this.getLengthLimit();
|
|
513
|
+
rawValueArr.splice(caretPosition - exceededLength, exceededLength);
|
|
514
|
+
return rawValueArr.join('');
|
|
515
|
+
}
|
|
516
|
+
return this.replaceMaskWithMatchedInputSlots(input, this.getMatchedInputSlotValue(input));
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
return input;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* get credit card type
|
|
524
|
+
*
|
|
525
|
+
* @param {string} value - card number string
|
|
526
|
+
* @returns {CardConfigType} - card type config
|
|
527
|
+
*/
|
|
528
|
+
getCreditCardType(value) {
|
|
529
|
+
return cardConfig.CARDS_INFO.filter((card) => card.pattern.test(value))[0];
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* A class for formatting string with the given mask format
|
|
535
|
+
*
|
|
536
|
+
* @augments StringFormatStrategy
|
|
537
|
+
*/
|
|
538
|
+
class CreditCardInputMaskStrategy extends CreditCardMaskStrategy {
|
|
539
|
+
/**
|
|
540
|
+
* It creates a new instance of the Mask class.
|
|
541
|
+
*/
|
|
542
|
+
constructor() {
|
|
543
|
+
super({
|
|
544
|
+
mask: '',
|
|
545
|
+
slot: '9',
|
|
546
|
+
accept: /\d/,
|
|
547
|
+
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* get credit card mask config
|
|
552
|
+
*
|
|
553
|
+
* @param {string} value - card number string
|
|
554
|
+
* @returns {Nullable<MaskConfigType>} - mask config type
|
|
555
|
+
*/
|
|
556
|
+
getCreditCardMaskConfig(value) {
|
|
557
|
+
let maskConfig;
|
|
558
|
+
const creditCardType = this.getCreditCardType(value);
|
|
559
|
+
if (creditCardType) {
|
|
560
|
+
maskConfig = creditCardType.maskConfig;
|
|
561
|
+
}
|
|
562
|
+
return maskConfig;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* A class for formatting string with the given mask format
|
|
568
|
+
*
|
|
569
|
+
* @augments StringFormatStrategy
|
|
570
|
+
*/
|
|
571
|
+
class CreditCardBlurMaskStrategy extends CreditCardMaskStrategy {
|
|
572
|
+
/**
|
|
573
|
+
* It creates a new instance of the Mask class.
|
|
574
|
+
*
|
|
575
|
+
* @param {boolean} hideCardNumberOnBlur - boolean
|
|
576
|
+
*/
|
|
577
|
+
constructor(hideCardNumberOnBlur) {
|
|
578
|
+
super({
|
|
579
|
+
mask: '',
|
|
580
|
+
slot: '9',
|
|
581
|
+
accept: /[\d\s]/,
|
|
582
|
+
insertMode: false,
|
|
583
|
+
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
584
|
+
});
|
|
585
|
+
this.hideCardNumberOnBlur = hideCardNumberOnBlur;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* @inheritDoc
|
|
589
|
+
*/
|
|
590
|
+
getCreditCardMaskConfig(value) {
|
|
591
|
+
let maskConfig;
|
|
592
|
+
const creditCardType = this.getCreditCardType(value);
|
|
593
|
+
if (creditCardType) {
|
|
594
|
+
if (this.hideCardNumberOnBlur && value.trim().includes(' ')) {
|
|
595
|
+
maskConfig = this.generateDynamicMask(value);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
return maskConfig;
|
|
599
|
+
}
|
|
600
|
+
/*
|
|
601
|
+
* The below method is e2e-test covered in
|
|
602
|
+
*
|
|
603
|
+
* @see{module:vega-input-credit-card-dynamic-mask-e2e}
|
|
604
|
+
*/
|
|
605
|
+
/* istanbul ignore next */
|
|
606
|
+
/**
|
|
607
|
+
* Transform the input card number with dynamic card number mask, for example: '4111 2222 3333 44' will be transformed to 'XXXX XXXX XXXX 99'
|
|
608
|
+
*
|
|
609
|
+
* @param {string} value - card number string
|
|
610
|
+
* @returns {MaskConfigType} - mask config type
|
|
611
|
+
*/
|
|
612
|
+
generateDynamicMask(value) {
|
|
613
|
+
const maskConfig = {
|
|
614
|
+
type: 'credit-card',
|
|
615
|
+
options: {
|
|
616
|
+
mask: '',
|
|
617
|
+
slot: '9',
|
|
618
|
+
accept: /[\d\s]/,
|
|
619
|
+
insertMode: false,
|
|
620
|
+
triggerAtInit: featureFlagController.FeatureFlag.isEnabled('VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD'),
|
|
621
|
+
},
|
|
622
|
+
trigger: 'blur',
|
|
623
|
+
};
|
|
624
|
+
const cardNumberSplit = value.trim().split(' ');
|
|
625
|
+
const cardNumberMask =
|
|
626
|
+
// Map through the array and replace each character with 'X' or '9' depending on the index
|
|
627
|
+
cardNumberSplit
|
|
628
|
+
.map((element, index) => {
|
|
629
|
+
// Replace each character in the string with 'X' except the last element, which uses '9'
|
|
630
|
+
const replacementChar = index === cardNumberSplit.length - 1 ? '9' : 'X';
|
|
631
|
+
return replacementChar.repeat(element.length);
|
|
632
|
+
})
|
|
633
|
+
.join(' ');
|
|
634
|
+
maskConfig.options.mask = cardNumberMask;
|
|
635
|
+
return maskConfig;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
468
639
|
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
469
640
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
470
641
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -500,6 +671,17 @@ class VegaInputMaskConfigController extends stringInputFormatterSlimmer.StringIn
|
|
|
500
671
|
return this.generateMaskStrategy('blur');
|
|
501
672
|
};
|
|
502
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* Detect value change and initialize mask formatting
|
|
676
|
+
*
|
|
677
|
+
* @param {string} newValue The new value
|
|
678
|
+
* @param {string} oldValue The new value
|
|
679
|
+
*/
|
|
680
|
+
watchValue(newValue, oldValue) {
|
|
681
|
+
if (newValue !== oldValue) {
|
|
682
|
+
this.formatValueAfterValueChange();
|
|
683
|
+
}
|
|
684
|
+
}
|
|
503
685
|
/**
|
|
504
686
|
* The function `setupStringFormatter` sets up a string formatter for an input element based on provided mask configurations.
|
|
505
687
|
*
|
|
@@ -555,6 +737,12 @@ class VegaInputMaskConfigController extends stringInputFormatterSlimmer.StringIn
|
|
|
555
737
|
case 'number':
|
|
556
738
|
stringFormatStrategy = this.getNumberTypeMaskStrategy(maskConfig.options);
|
|
557
739
|
break;
|
|
740
|
+
case 'credit-card':
|
|
741
|
+
stringFormatStrategy =
|
|
742
|
+
maskTrigger === 'input'
|
|
743
|
+
? new CreditCardInputMaskStrategy()
|
|
744
|
+
: new CreditCardBlurMaskStrategy(maskConfig.hideCardNumberOnBlur);
|
|
745
|
+
break;
|
|
558
746
|
case 'custom':
|
|
559
747
|
stringFormatStrategy = new stringInputFormatterSlimmer.StringMaskStrategy(maskConfig.options);
|
|
560
748
|
break;
|
|
@@ -589,7 +777,8 @@ class VegaInputMaskConfigController extends stringInputFormatterSlimmer.StringIn
|
|
|
589
777
|
* 'custom' and a trigger of 'blur'.
|
|
590
778
|
*/
|
|
591
779
|
isBlurModeMaskConfig(maskConfig) {
|
|
592
|
-
return maskConfig.type === 'custom'
|
|
780
|
+
return ((maskConfig.type === 'custom' || maskConfig.type === 'credit-card') &&
|
|
781
|
+
maskConfig.trigger === 'blur');
|
|
593
782
|
}
|
|
594
783
|
}
|
|
595
784
|
__decorate$3([
|
|
@@ -601,6 +790,9 @@ __decorate$3([
|
|
|
601
790
|
__decorate$3([
|
|
602
791
|
globalSlimmerRegistry.MapToComponentField()
|
|
603
792
|
], VegaInputMaskConfigController.prototype, "type", void 0);
|
|
793
|
+
__decorate$3([
|
|
794
|
+
globalSlimmerRegistry.MapToComponentMethod('watchValue')
|
|
795
|
+
], VegaInputMaskConfigController.prototype, "watchValue", null);
|
|
604
796
|
|
|
605
797
|
const VegaInputRuntimeMetricsPayloadDefinition = [
|
|
606
798
|
{
|