@globalpayments/vega 2.37.0 → 2.37.2
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-7980768c.js → app-globals-7087f121.js} +4 -4
- package/dist/cjs/{content-state-9a9a4bd8.js → content-state-f97d3278.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-0303f4a7.js → form-field-controller-slimmer-48c0ad0b.js} +1 -1
- package/dist/cjs/{image-annotation-action-8e622f61.js → image-annotation-action-7d82f7e1.js} +2 -2
- package/dist/cjs/{index-7c81de06.js → index-0546e2ea.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/loader.cjs.js +6 -6
- package/dist/cjs/{node-annotation.abstract-2c8373c1.js → node-annotation.abstract-4f6df9cf.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-396b1cee.js → string-input-formatter-slimmer-f45931fd.js} +113 -34
- package/dist/cjs/{sub-state-notify-slimmer-ae490543.js → sub-state-notify-slimmer-b1f1e61a.js} +1 -1
- package/dist/cjs/{sub-state-observer-slimmer-080731bc.js → sub-state-observer-slimmer-02634647.js} +1 -1
- package/dist/cjs/vega-app-footer.cjs.entry.js +3 -0
- package/dist/cjs/vega-button-group_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-button-link.cjs.entry.js +1 -0
- package/dist/cjs/vega-calendar_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +11 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +2 -2
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -2
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +5 -2
- package/dist/cjs/vega-input-range.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-select.cjs.entry.js +2 -2
- package/dist/cjs/vega-input.cjs.entry.js +10 -8
- package/dist/cjs/{vega-internal-event-id-b12071ea.js → vega-internal-event-id-bda63e14.js} +2 -0
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -0
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +6 -4
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +54 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +681 -413
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +3 -2
- package/dist/cjs/{vega-skeleton-loader-controller-ef43cfc1.js → vega-skeleton-loader-controller-00dbdf29.js} +11 -3
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-table_8.cjs.entry.js +10 -7
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega.cjs.js +6 -6
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +12 -0
- package/dist/collection/components/vega-button-link/vega-button-link.js +4 -0
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +9 -1
- package/dist/collection/components/vega-image-uploader/vega-image-uploader.js +4 -0
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +12 -0
- package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
- package/dist/collection/components/vega-item-toggle/vega-item-toggle.js +8 -0
- package/dist/collection/components/vega-loader-wrapper/slimmers/controllers/manage-vega-loader-wrapper-z-index-controller.js +49 -0
- package/dist/collection/components/vega-loader-wrapper/vega-loader-wrapper.js +5 -0
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +7 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +190 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.js +18 -123
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +9 -11
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +8 -18
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +5 -4
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +244 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +13 -5
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.js +16 -70
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +22 -14
- package/dist/collection/components/vega-signature-capture/vega-signature-capture.js +4 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-editable-controller.js +2 -3
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-renderer.js +5 -1
- package/dist/collection/helpers/event-manager/event-id/vega-internal-event-id.js +1 -0
- package/dist/collection/helpers/formatter/string-formatter/custom-formatter-strategy.js +3 -1
- package/dist/collection/helpers/formatter/string-formatter/number-mask-strategy.js +3 -1
- package/dist/collection/helpers/formatter/string-formatter/string-format-strategy.abstract.js +52 -0
- package/dist/collection/helpers/formatter/string-formatter/string-mask-strategy.js +6 -7
- package/dist/collection/helpers/formatter/string-formatter/thousand-comma-strategy.js +2 -1
- package/dist/collection/helpers/formatter/test/string-formatter/custom-formatter-strategy.test.js +2 -1
- package/dist/collection/helpers/formatter/test/string-formatter/number-mask-strategy.test.js +9 -0
- package/dist/collection/helpers/formatter/test/string-formatter/string-mask-strategy.test.js +62 -4
- package/dist/collection/helpers/loading-indicator/tests/vega-loader-controller.test.js +29 -2
- package/dist/collection/helpers/loading-indicator/vega-loader-controller.js +11 -3
- package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +53 -25
- package/dist/collection/helpers/slimmers/test/string-input-formatter-slimmer.test.js +2 -1
- package/dist/esm/{app-globals-6912a75d.js → app-globals-4cca4a96.js} +4 -4
- package/dist/esm/{content-state-c2d29b35.js → content-state-ccf5f960.js} +3 -3
- package/dist/esm/{form-field-controller-slimmer-7136b7fa.js → form-field-controller-slimmer-3535e76a.js} +1 -1
- package/dist/esm/{image-annotation-action-84422458.js → image-annotation-action-3da42221.js} +2 -2
- package/dist/esm/{index-b2045ad0.js → index-6e05b241.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{node-annotation.abstract-a58b5a49.js → node-annotation.abstract-b2e36bc4.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-0ecbf367.js → string-input-formatter-slimmer-d4132497.js} +113 -35
- package/dist/esm/{sub-state-notify-slimmer-4a201088.js → sub-state-notify-slimmer-51151fc3.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-0d6da563.js → sub-state-observer-slimmer-d77a1c46.js} +1 -1
- package/dist/esm/vega-app-footer.entry.js +3 -0
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button-link.entry.js +1 -0
- package/dist/esm/vega-calendar_3.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +11 -4
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +2 -2
- package/dist/esm/vega-date-picker_2.entry.js +6 -6
- package/dist/esm/vega-dropdown_5.entry.js +3 -3
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +2 -2
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-image-uploader.entry.js +3 -2
- package/dist/esm/vega-input-credit-card.entry.js +2 -2
- package/dist/esm/vega-input-numeric.entry.js +3 -3
- package/dist/esm/vega-input-phone-number.entry.js +5 -2
- package/dist/esm/vega-input-range.entry.js +2 -2
- package/dist/esm/vega-input-select.entry.js +2 -2
- package/dist/esm/vega-input.entry.js +10 -8
- package/dist/esm/{vega-internal-event-id-458939b6.js → vega-internal-event-id-d0690d0d.js} +2 -1
- package/dist/esm/vega-item-toggle.entry.js +2 -0
- package/dist/esm/vega-left-nav_5.entry.js +6 -4
- package/dist/esm/vega-loader-wrapper_2.entry.js +55 -2
- package/dist/esm/vega-popover_2.entry.js +1 -1
- package/dist/esm/vega-radio_2.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +681 -413
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +3 -2
- package/dist/esm/{vega-skeleton-loader-controller-0044d77f.js → vega-skeleton-loader-controller-5aea7aeb.js} +11 -3
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-table_8.entry.js +10 -7
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +2 -2
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega.js +6 -6
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +3 -0
- package/dist/types/components/vega-button-link/vega-button-link.d.ts +1 -0
- package/dist/types/components/vega-checkbox/vega-checkbox.d.ts +2 -0
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-format-controller.d.ts +1 -1
- package/dist/types/components/vega-image-uploader/vega-image-uploader.d.ts +1 -0
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +1 -1
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +3 -0
- package/dist/types/components/vega-input-select/types.d.ts +1 -0
- package/dist/types/components/vega-item-toggle/vega-item-toggle.d.ts +2 -0
- package/dist/types/components/vega-loader-wrapper/slimmers/controllers/manage-vega-loader-wrapper-z-index-controller.d.ts +21 -0
- package/dist/types/components/vega-loader-wrapper/vega-loader-wrapper.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/vega-left-nav-link.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.d.ts +57 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/base-handler.d.ts +11 -28
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.d.ts +1 -8
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.d.ts +99 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/selection-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/user-input-controller.d.ts +2 -21
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +7 -2
- package/dist/types/components/vega-signature-capture/vega-signature-capture.d.ts +1 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-renderer.d.ts +1 -0
- package/dist/types/components.d.ts +31 -5
- package/dist/types/helpers/event-manager/event-id/vega-internal-event-id.d.ts +1 -0
- package/dist/types/helpers/formatter/string-formatter/custom-formatter-strategy.d.ts +3 -3
- package/dist/types/helpers/formatter/string-formatter/number-mask-strategy.d.ts +2 -2
- package/dist/types/helpers/formatter/string-formatter/string-format-strategy.abstract.d.ts +48 -0
- package/dist/types/helpers/formatter/string-formatter/string-mask-strategy.d.ts +6 -10
- package/dist/types/helpers/formatter/string-formatter/thousand-comma-strategy.d.ts +2 -2
- package/dist/types/helpers/loading-indicator/vega-loader-controller.d.ts +1 -0
- package/dist/types/helpers/slimmers/string-input-formatter-slimmer.d.ts +20 -4
- package/dist/types/types/components.type.d.ts +1 -5
- package/dist/types/types/public-api.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-2d36dbfe.js → p-0461e318.js} +1 -1
- package/dist/vega/{p-1f67c930.entry.js → p-12fe63c1.entry.js} +1 -1
- package/dist/vega/{p-29dd376c.entry.js → p-1b67c443.entry.js} +1 -1
- package/dist/vega/{p-5f82eb88.js → p-1d93b3a9.js} +1 -1
- package/dist/vega/p-20326c64.js +1 -0
- package/dist/vega/{p-fbb91e25.entry.js → p-23fd9401.entry.js} +1 -1
- package/dist/vega/{p-5d7d0085.entry.js → p-267cde46.entry.js} +1 -1
- package/dist/vega/{p-ca239f51.js → p-29d6ec6c.js} +1 -1
- package/dist/vega/{p-d57920df.entry.js → p-2fecbcf9.entry.js} +1 -1
- package/dist/vega/{p-fe9644a0.js → p-348e95ba.js} +1 -1
- package/dist/vega/{p-00de36e4.js → p-34bd9204.js} +1 -1
- package/dist/vega/{p-3aec260c.entry.js → p-3cb90bdf.entry.js} +1 -1
- package/dist/vega/{p-fcab2244.entry.js → p-3e8f9fcf.entry.js} +1 -1
- package/dist/vega/{p-233e6715.entry.js → p-497f2f86.entry.js} +1 -1
- package/dist/vega/p-50eabdca.entry.js +1 -0
- package/dist/vega/{p-503ff1ef.js → p-52a8a4f8.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-766a0cdd.entry.js → p-6419e13e.entry.js} +1 -1
- package/dist/vega/{p-b2b41aa4.entry.js → p-7198d675.entry.js} +1 -1
- package/dist/vega/p-76a8ccbb.js +1 -0
- package/dist/vega/{p-00f4cf6a.entry.js → p-7baa4fae.entry.js} +1 -1
- package/dist/vega/p-7edcb8d0.entry.js +1 -0
- package/dist/vega/{p-bbea0599.entry.js → p-904b489a.entry.js} +1 -1
- package/dist/vega/{p-fea15767.entry.js → p-9689ad99.entry.js} +1 -1
- package/dist/vega/p-9728d571.entry.js +1 -0
- package/dist/vega/{p-95e50f3a.entry.js → p-a2a34239.entry.js} +1 -1
- package/dist/vega/{p-b1096431.entry.js → p-a7e078ac.entry.js} +1 -1
- package/dist/vega/{p-eb798062.entry.js → p-a7f40a65.entry.js} +1 -1
- package/dist/vega/{p-7fedfba5.js → p-a8b16ff2.js} +1 -1
- package/dist/vega/{p-9625162b.entry.js → p-aed80794.entry.js} +1 -1
- package/dist/vega/{p-7da8b05f.js → p-b517ed15.js} +1 -1
- package/dist/vega/{p-b6b4e40f.entry.js → p-b809f3d7.entry.js} +1 -1
- package/dist/vega/{p-0b9480a9.entry.js → p-b9a0f136.entry.js} +1 -1
- package/dist/vega/{p-5a19bcb5.entry.js → p-ba077ca8.entry.js} +1 -1
- package/dist/vega/{p-53360bc2.entry.js → p-ba2833c0.entry.js} +1 -1
- package/dist/vega/{p-13c22d72.entry.js → p-bf4996d5.entry.js} +1 -1
- package/dist/vega/{p-570bdeb5.entry.js → p-cb4fd6e1.entry.js} +1 -1
- package/dist/vega/p-e4ce559d.entry.js +1 -0
- package/dist/vega/{p-cfd486ab.entry.js → p-e9785742.entry.js} +1 -1
- package/dist/vega/p-e9a5bd12.entry.js +1 -0
- package/dist/vega/p-ecaf4cfa.entry.js +1 -0
- package/dist/vega/{p-fb5c2cc6.entry.js → p-ee2e4bff.entry.js} +1 -1
- package/dist/vega/{p-8f8ab0d3.js → p-f86ec91b.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/types/helpers/formatter/string-formatter/string-format-strategy.d.ts +0 -12
- package/dist/vega/p-34caa637.entry.js +0 -1
- package/dist/vega/p-497db801.entry.js +0 -1
- package/dist/vega/p-4c18ff36.js +0 -1
- package/dist/vega/p-6705ce8f.entry.js +0 -1
- package/dist/vega/p-775fa5dd.entry.js +0 -1
- package/dist/vega/p-98043367.entry.js +0 -1
- package/dist/vega/p-a98475a2.entry.js +0 -1
- package/dist/vega/p-c2ded423.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isNonNullable } from '../../../types/type-guard';
|
|
2
|
+
/**
|
|
3
|
+
* String format strategy abstract class
|
|
4
|
+
*/
|
|
5
|
+
export class StringFormatStrategy {
|
|
6
|
+
/**
|
|
7
|
+
* Check if the {@link format} should be applied
|
|
8
|
+
*
|
|
9
|
+
* @param {FormatTrigger} triggeredBy - The trigger of the format
|
|
10
|
+
* @param {FormatTarget} target - The target of the format
|
|
11
|
+
* @param {InputStatus} inputStatus - The status of the input
|
|
12
|
+
* @returns {boolean} - Whether the format should be applied
|
|
13
|
+
*/
|
|
14
|
+
canFormat(triggeredBy, target, inputStatus) {
|
|
15
|
+
if (triggeredBy === 'init') {
|
|
16
|
+
if (target === 'component' && isNonNullable(inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.isBlurred)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (this.shouldTriggerAtInit()) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (triggeredBy === 'input' && target === 'native-input') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (triggeredBy === 'blur' && (inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.isBlurred)) {
|
|
27
|
+
if (target === 'component' && this.shouldOverrideComponentValueAfterBlur()) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (target === 'native-input') {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Determines whether a component value should be overridden based on the mask configuration.
|
|
38
|
+
*
|
|
39
|
+
* @returns {boolean} - Whether the component value should be overridden.
|
|
40
|
+
*/
|
|
41
|
+
shouldOverrideComponentValueAfterBlur() {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Determines whether the format should be triggered at init.
|
|
46
|
+
*
|
|
47
|
+
* @returns {boolean} - Whether the format should be triggered at init.
|
|
48
|
+
*/
|
|
49
|
+
shouldTriggerAtInit() {
|
|
50
|
+
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.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { StringFormatStrategy } from './string-format-strategy.abstract';
|
|
1
2
|
import { isNonNullable } from '../../../types/type-guard';
|
|
2
3
|
/**
|
|
3
4
|
* A class for formatting string with the given mask format
|
|
4
5
|
*
|
|
5
6
|
* @augments StringFormatStrategy
|
|
6
7
|
*/
|
|
7
|
-
export class StringMaskStrategy {
|
|
8
|
+
export class StringMaskStrategy extends StringFormatStrategy {
|
|
8
9
|
/**
|
|
9
10
|
* It creates a new instance of the Mask class.
|
|
10
11
|
*
|
|
11
12
|
* @param {MaskConfig} maskConfig - MaskConfig
|
|
12
13
|
*/
|
|
13
14
|
constructor(maskConfig) {
|
|
15
|
+
super();
|
|
14
16
|
/**
|
|
15
17
|
* The insert mode means adding some special character in the input string, will replace part of input string if insertMode set to false.
|
|
16
18
|
*
|
|
@@ -29,13 +31,10 @@ export class StringMaskStrategy {
|
|
|
29
31
|
this.insertMode = maskConfig.insertMode === false ? false : true;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param {string} input - The input string that needs to be formatted.
|
|
35
|
-
* @param {number} caretPosition - The current position of caret
|
|
36
|
-
* @returns {string} The formatted string.
|
|
34
|
+
* @inheritDoc
|
|
37
35
|
*/
|
|
38
|
-
format(input,
|
|
36
|
+
format(input, inputStatus) {
|
|
37
|
+
const caretPosition = inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.caretPosition;
|
|
39
38
|
if (input.length > this.getLengthLimit() && isNonNullable(caretPosition)) {
|
|
40
39
|
const rawValueArr = [...input];
|
|
41
40
|
const exceededLength = input.length - this.getLengthLimit();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { StringFormatStrategy } from './string-format-strategy.abstract';
|
|
1
2
|
/**
|
|
2
3
|
* A class for formatting string with the "," as the thousand separator
|
|
3
4
|
*
|
|
4
5
|
* @augments StringFormatStrategy
|
|
5
6
|
*/
|
|
6
|
-
export class ThousandCommaStrategy {
|
|
7
|
+
export class ThousandCommaStrategy extends StringFormatStrategy {
|
|
7
8
|
/**
|
|
8
9
|
* If the input is a number, format it as a string
|
|
9
10
|
*
|
package/dist/collection/helpers/formatter/test/string-formatter/custom-formatter-strategy.test.js
CHANGED
|
@@ -3,7 +3,8 @@ test('custom formatter strategy is working as expected', () => {
|
|
|
3
3
|
const customFormatterStrategy = new CustomFormatterStrategy((value) => value.toUpperCase(), true);
|
|
4
4
|
expect(customFormatterStrategy.format('test')).toBe('TEST');
|
|
5
5
|
expect(customFormatterStrategy.calculateCaretPosition('test', null)).toBe(4);
|
|
6
|
-
expect(customFormatterStrategy.
|
|
6
|
+
expect(customFormatterStrategy.canFormat('init', 'component')).toBe(true);
|
|
7
|
+
expect(customFormatterStrategy.canFormat('init', 'native-input')).toBe(true);
|
|
7
8
|
});
|
|
8
9
|
test('custom formatter strategy method calculateCaretPosition is working as expected', () => {
|
|
9
10
|
const customFormatterStrategy = new CustomFormatterStrategy((value) => value.toUpperCase());
|
package/dist/collection/helpers/formatter/test/string-formatter/number-mask-strategy.test.js
CHANGED
|
@@ -89,4 +89,13 @@ describe('numberStrategy', () => {
|
|
|
89
89
|
expect(numberStrategy.calculateCaretPosition('00.123', 6)).toBe(5);
|
|
90
90
|
expect(numberStrategy.calculateCaretPosition('00.123', undefined)).toBe(undefined);
|
|
91
91
|
});
|
|
92
|
+
it('canFormat should return as expect', () => {
|
|
93
|
+
const numberStrategy = new NumberMaskStrategy();
|
|
94
|
+
expect(numberStrategy.canFormat('init', 'component')).toBe(false);
|
|
95
|
+
expect(numberStrategy.canFormat('input', 'native-input')).toBe(true);
|
|
96
|
+
expect(numberStrategy.canFormat('blur', 'component', { isBlurred: true })).toBe(false);
|
|
97
|
+
expect(numberStrategy.canFormat('blur', 'component', { isBlurred: false })).toBe(false);
|
|
98
|
+
expect(numberStrategy.canFormat('blur', 'native-input', { isBlurred: true })).toBe(true);
|
|
99
|
+
expect(numberStrategy.canFormat('blur', 'native-input', { isBlurred: false })).toBe(false);
|
|
100
|
+
});
|
|
92
101
|
});
|
package/dist/collection/helpers/formatter/test/string-formatter/string-mask-strategy.test.js
CHANGED
|
@@ -55,7 +55,7 @@ test('should work as expected when slot and accept is regex', () => {
|
|
|
55
55
|
expect(mask5.format('456')).toBe('');
|
|
56
56
|
});
|
|
57
57
|
test('mask format with caretPosition', () => {
|
|
58
|
-
expect(StringMaskStrategy.ZIPCODE_MASK.format('123456', 3)).toBe('12456'); // |456 -> 12|456
|
|
58
|
+
expect(StringMaskStrategy.ZIPCODE_MASK.format('123456', { caretPosition: 3 })).toBe('12456'); // |456 -> 12|456
|
|
59
59
|
});
|
|
60
60
|
test('calculate caret position', () => {
|
|
61
61
|
expect(StringMaskStrategy.PHONE_MASK.calculateCaretPosition('(123) 456-7890', null)).toEqual(null);
|
|
@@ -70,11 +70,11 @@ test('shouldOverrideComponentValueAfterBlur', () => {
|
|
|
70
70
|
accept: /\d/g,
|
|
71
71
|
};
|
|
72
72
|
const mask1 = new StringMaskStrategy(maskConfig);
|
|
73
|
-
expect(mask1.
|
|
73
|
+
expect(mask1.canFormat('blur', 'component', { isBlurred: true })).toBeFalsy();
|
|
74
74
|
const mask2 = new StringMaskStrategy(Object.assign(Object.assign({}, maskConfig), { overrideValue: true }));
|
|
75
|
-
expect(mask2.
|
|
75
|
+
expect(mask2.canFormat('blur', 'component', { isBlurred: true })).toBeTruthy();
|
|
76
76
|
const mask3 = new StringMaskStrategy(Object.assign(Object.assign({}, maskConfig), { overrideValue: false }));
|
|
77
|
-
expect(mask3.
|
|
77
|
+
expect(mask3.canFormat('blur', 'component', { isBlurred: true })).toBeFalsy();
|
|
78
78
|
});
|
|
79
79
|
test('format in different insert mode', () => {
|
|
80
80
|
const maskConfig = {
|
|
@@ -87,3 +87,61 @@ test('format in different insert mode', () => {
|
|
|
87
87
|
const mask2 = new StringMaskStrategy(Object.assign(Object.assign({}, maskConfig), { insertMode: false }));
|
|
88
88
|
expect(mask2.format('123456')).toEqual('***456');
|
|
89
89
|
});
|
|
90
|
+
describe('string-mask-strategy', () => {
|
|
91
|
+
test('canFormat should work as expect when setting triggerAtInit', () => {
|
|
92
|
+
const strategyTriggerAtInit = new StringMaskStrategy({
|
|
93
|
+
mask: '(999) 999-9999',
|
|
94
|
+
slot: '9',
|
|
95
|
+
accept: /\d/g,
|
|
96
|
+
triggerAtInit: true,
|
|
97
|
+
});
|
|
98
|
+
expect(strategyTriggerAtInit.canFormat('init', 'component')).toBeTruthy();
|
|
99
|
+
expect(strategyTriggerAtInit.canFormat('init', 'native-input')).toBeTruthy();
|
|
100
|
+
expect(strategyTriggerAtInit.canFormat('input', 'native-input')).toBeTruthy();
|
|
101
|
+
expect(strategyTriggerAtInit.canFormat('blur', 'component', { isBlurred: true })).toBeFalsy();
|
|
102
|
+
expect(strategyTriggerAtInit.canFormat('blur', 'component', { isBlurred: false })).toBeFalsy();
|
|
103
|
+
expect(strategyTriggerAtInit.canFormat('blur', 'native-input', { isBlurred: true })).toBeTruthy();
|
|
104
|
+
expect(strategyTriggerAtInit.canFormat('blur', 'native-input', { isBlurred: false })).toBeFalsy();
|
|
105
|
+
const strategyNotTriggerAtInit = new StringMaskStrategy({
|
|
106
|
+
mask: '(999) 999-9999',
|
|
107
|
+
slot: '9',
|
|
108
|
+
accept: /\d/g,
|
|
109
|
+
triggerAtInit: false,
|
|
110
|
+
});
|
|
111
|
+
expect(strategyNotTriggerAtInit.canFormat('init', 'component')).toBeFalsy();
|
|
112
|
+
expect(strategyNotTriggerAtInit.canFormat('init', 'native-input')).toBeFalsy();
|
|
113
|
+
expect(strategyNotTriggerAtInit.canFormat('input', 'native-input')).toBeTruthy();
|
|
114
|
+
expect(strategyNotTriggerAtInit.canFormat('blur', 'component', { isBlurred: true })).toBeFalsy();
|
|
115
|
+
expect(strategyNotTriggerAtInit.canFormat('blur', 'component', { isBlurred: false })).toBeFalsy();
|
|
116
|
+
expect(strategyNotTriggerAtInit.canFormat('blur', 'native-input', { isBlurred: true })).toBeTruthy();
|
|
117
|
+
expect(strategyNotTriggerAtInit.canFormat('blur', 'native-input', { isBlurred: false })).toBeFalsy();
|
|
118
|
+
});
|
|
119
|
+
test('canFormat should work as expect when setting overrideValue', () => {
|
|
120
|
+
const strategyOverrideValue = new StringMaskStrategy({
|
|
121
|
+
mask: '(999) 999-9999',
|
|
122
|
+
slot: '9',
|
|
123
|
+
accept: /\d/g,
|
|
124
|
+
overrideValue: true,
|
|
125
|
+
});
|
|
126
|
+
expect(strategyOverrideValue.canFormat('init', 'component')).toBeFalsy();
|
|
127
|
+
expect(strategyOverrideValue.canFormat('init', 'native-input')).toBeFalsy();
|
|
128
|
+
expect(strategyOverrideValue.canFormat('input', 'native-input')).toBeTruthy();
|
|
129
|
+
expect(strategyOverrideValue.canFormat('blur', 'component', { isBlurred: true })).toBeTruthy();
|
|
130
|
+
expect(strategyOverrideValue.canFormat('blur', 'component', { isBlurred: false })).toBeFalsy();
|
|
131
|
+
expect(strategyOverrideValue.canFormat('blur', 'native-input', { isBlurred: true })).toBeTruthy();
|
|
132
|
+
expect(strategyOverrideValue.canFormat('blur', 'native-input', { isBlurred: false })).toBeFalsy();
|
|
133
|
+
const strategyNotOverrideValue = new StringMaskStrategy({
|
|
134
|
+
mask: '(999) 999-9999',
|
|
135
|
+
slot: '9',
|
|
136
|
+
accept: /\d/g,
|
|
137
|
+
overrideValue: false,
|
|
138
|
+
});
|
|
139
|
+
expect(strategyNotOverrideValue.canFormat('init', 'component')).toBeFalsy();
|
|
140
|
+
expect(strategyNotOverrideValue.canFormat('init', 'native-input')).toBeFalsy();
|
|
141
|
+
expect(strategyNotOverrideValue.canFormat('input', 'native-input')).toBeTruthy();
|
|
142
|
+
expect(strategyNotOverrideValue.canFormat('blur', 'component', { isBlurred: true })).toBeFalsy();
|
|
143
|
+
expect(strategyNotOverrideValue.canFormat('blur', 'component', { isBlurred: false })).toBeFalsy();
|
|
144
|
+
expect(strategyNotOverrideValue.canFormat('blur', 'native-input', { isBlurred: true })).toBeTruthy();
|
|
145
|
+
expect(strategyNotOverrideValue.canFormat('blur', 'native-input', { isBlurred: false })).toBeFalsy();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
@@ -120,7 +120,34 @@ describe('VegaLoaderController', () => {
|
|
|
120
120
|
VegaLoader.close(loader);
|
|
121
121
|
expect(document.querySelector('body')).toMatchInlineSnapshot(`
|
|
122
122
|
<body>
|
|
123
|
-
<div data-vega-loader-origin-position id="container" style="position:
|
|
123
|
+
<div data-vega-loader-origin-position id="container" style="position: relative;">
|
|
124
|
+
<mock:shadow-root></mock:shadow-root>
|
|
125
|
+
</div>
|
|
126
|
+
</body>
|
|
127
|
+
`);
|
|
128
|
+
});
|
|
129
|
+
it('should restore original display position when loader closes', () => {
|
|
130
|
+
const container = document.createElement('div');
|
|
131
|
+
container.attachShadow({ mode: 'open' });
|
|
132
|
+
container.id = 'container';
|
|
133
|
+
container.style.position = `static`;
|
|
134
|
+
document.querySelector('body').append(container);
|
|
135
|
+
const loader = VegaLoader.load({ containerSelector: '#container' });
|
|
136
|
+
expect(document.querySelector('body')).toEqualHtml(`
|
|
137
|
+
<body>
|
|
138
|
+
<div data-vega-loader-origin-position="static" id="container" style="position: relative;">
|
|
139
|
+
<mock:shadow-root>
|
|
140
|
+
<vega-loader-wrapper class="absolute-wrapper" data-container="#container" id="vega-loader-TEST_UUID">
|
|
141
|
+
<vega-loading-indicator></vega-loading-indicator>
|
|
142
|
+
</vega-loader-wrapper>
|
|
143
|
+
</mock:shadow-root>
|
|
144
|
+
</div>
|
|
145
|
+
</body>
|
|
146
|
+
`);
|
|
147
|
+
VegaLoader.close(loader);
|
|
148
|
+
expect(document.querySelector('body')).toMatchInlineSnapshot(`
|
|
149
|
+
<body>
|
|
150
|
+
<div data-vega-loader-origin-position="static" id="container" style="position: static;">
|
|
124
151
|
<mock:shadow-root></mock:shadow-root>
|
|
125
152
|
</div>
|
|
126
153
|
</body>
|
|
@@ -143,7 +170,7 @@ describe('VegaLoaderController', () => {
|
|
|
143
170
|
VegaLoader.close(loader);
|
|
144
171
|
expect(document.querySelector('body')).toMatchInlineSnapshot(`
|
|
145
172
|
<body>
|
|
146
|
-
<div data-vega-loader-origin-position id="container" style="position:
|
|
173
|
+
<div data-vega-loader-origin-position id="container" style="position: relative;"></div>
|
|
147
174
|
</body>
|
|
148
175
|
`);
|
|
149
176
|
});
|
|
@@ -25,8 +25,13 @@ class VegaLoaderController {
|
|
|
25
25
|
* @vegaVersion 1.16.0
|
|
26
26
|
*/
|
|
27
27
|
load(options = {}) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
let containerSelector = options.containerSelector || 'body';
|
|
29
|
+
let containerElement = document.querySelector(containerSelector);
|
|
30
|
+
if (containerElement &&
|
|
31
|
+
VegaLoaderController.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY.includes(containerElement.tagName)) {
|
|
32
|
+
containerSelector = 'body';
|
|
33
|
+
containerElement = document.querySelector('body');
|
|
34
|
+
}
|
|
30
35
|
if (!containerElement) {
|
|
31
36
|
LogUtility.error('Container is not found by selector: ', containerSelector);
|
|
32
37
|
return null;
|
|
@@ -48,7 +53,9 @@ class VegaLoaderController {
|
|
|
48
53
|
if (loader.dataset.container) {
|
|
49
54
|
const container = document.querySelector(loader.dataset.container);
|
|
50
55
|
if (container) {
|
|
51
|
-
|
|
56
|
+
if (container.dataset['vegaLoaderOriginPosition']) {
|
|
57
|
+
container.style.position = container.dataset['vegaLoaderOriginPosition'];
|
|
58
|
+
}
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
loader.remove();
|
|
@@ -118,6 +125,7 @@ class VegaLoaderController {
|
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
127
|
}
|
|
128
|
+
VegaLoaderController.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY = ['VEGA-MODAL'];
|
|
121
129
|
__decorate([
|
|
122
130
|
InjectVegaTelemetrySlimmer()
|
|
123
131
|
], VegaLoaderController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
|
@@ -30,7 +30,7 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* A function
|
|
33
|
+
* A function updates the value of the input element by inputFormatStrategy output.
|
|
34
34
|
*
|
|
35
35
|
* @param {InputEvent} e - blur event
|
|
36
36
|
*/
|
|
@@ -38,17 +38,11 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
38
38
|
if (this.blurFormatStrategy) {
|
|
39
39
|
const target = e.target;
|
|
40
40
|
const rawValue = target.value;
|
|
41
|
-
|
|
42
|
-
this.updateInputValue(rawValue, maskedValue);
|
|
43
|
-
if (this.host &&
|
|
44
|
-
this.blurFormatStrategy.shouldOverrideComponentValueAfterBlur &&
|
|
45
|
-
this.blurFormatStrategy.shouldOverrideComponentValueAfterBlur()) {
|
|
46
|
-
this.host['value'] = maskedValue;
|
|
47
|
-
}
|
|
41
|
+
this.formatValue(rawValue, 'blur');
|
|
48
42
|
}
|
|
49
43
|
};
|
|
50
44
|
/**
|
|
51
|
-
* A function
|
|
45
|
+
* A function updates the value of the input element by inputFormatStrategy output.
|
|
52
46
|
*
|
|
53
47
|
* @param {InputEvent} e - input event
|
|
54
48
|
*/
|
|
@@ -57,11 +51,9 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
57
51
|
const rawValue = target.value;
|
|
58
52
|
const caretPosition = target.selectionStart; // selectionStart is nullable, link https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-selectionstart
|
|
59
53
|
if (this.inputFormatStrategy) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
e.inputType === 'insertFromPaste' ? null : caretPosition);
|
|
64
|
-
this.updateInputValue(rawValue, maskedValue);
|
|
54
|
+
this.formatValue(rawValue.replace(/\s/g, ''), 'input', {
|
|
55
|
+
caretPosition: e.inputType === 'insertFromPaste' ? undefined : caretPosition,
|
|
56
|
+
});
|
|
65
57
|
this.updateInputCaretPosition(rawValue, caretPosition);
|
|
66
58
|
}
|
|
67
59
|
};
|
|
@@ -123,22 +115,13 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
123
115
|
*/
|
|
124
116
|
formatValueAfterSetup() {
|
|
125
117
|
void waitForComponentDidRender(this.host).then(() => {
|
|
126
|
-
|
|
127
|
-
const rawValue = this.inputElement.value;
|
|
128
|
-
if ((_b = (_a = this.inputFormatStrategy) === null || _a === void 0 ? void 0 : _a.shouldTriggerAtInit) === null || _b === void 0 ? void 0 : _b.call(_a)) {
|
|
129
|
-
this.host['value'] = this.inputFormatStrategy.format(rawValue);
|
|
130
|
-
}
|
|
131
|
-
if (((_d = (_c = this.blurFormatStrategy) === null || _c === void 0 ? void 0 : _c.shouldTriggerAtInit) === null || _d === void 0 ? void 0 : _d.call(_c)) && !this.isOnFocus()) {
|
|
132
|
-
const maskedValue = this.blurFormatStrategy.format(rawValue);
|
|
133
|
-
this.updateInputValue(rawValue, maskedValue);
|
|
134
|
-
}
|
|
118
|
+
this.formatValue(this.inputElement.value, 'init');
|
|
135
119
|
});
|
|
136
120
|
}
|
|
137
121
|
/*
|
|
138
122
|
* The below method is e2e-test covered in
|
|
139
123
|
* @see{module:vega-input-credit-card-dynamic-mask-e2e}
|
|
140
124
|
*/
|
|
141
|
-
/* istanbul ignore next */
|
|
142
125
|
/**
|
|
143
126
|
* The function `isOnFocus` checks if the input element is currently focused.
|
|
144
127
|
*
|
|
@@ -156,7 +139,7 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
156
139
|
* @param {string} rawValue - the original value
|
|
157
140
|
* @param {string} maskedValue - masked value
|
|
158
141
|
*/
|
|
159
|
-
|
|
142
|
+
updateNativeInputValue(rawValue, maskedValue) {
|
|
160
143
|
// link: https://stackoverflow.com/questions/52003841/why-doesnt-event-target-value-include-and-e-for-number-inputs
|
|
161
144
|
// If the input value is '123.', '123' will be got from `target.value` when the input element type is number
|
|
162
145
|
// '123.' will be formatted to '123', then `this.inputElement.value = 123`, '.' will never be filled in
|
|
@@ -164,6 +147,17 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
164
147
|
this.inputElement.value = maskedValue;
|
|
165
148
|
}
|
|
166
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Update the host value
|
|
152
|
+
*
|
|
153
|
+
* @param {string} rawValue - the original value
|
|
154
|
+
* @param {string} maskedValue - the masked value
|
|
155
|
+
*/
|
|
156
|
+
updateComponentValue(rawValue, maskedValue) {
|
|
157
|
+
if (maskedValue !== rawValue) {
|
|
158
|
+
this.host['value'] = maskedValue;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
167
161
|
/**
|
|
168
162
|
* Updated the input caret position after the mask format
|
|
169
163
|
*
|
|
@@ -177,6 +171,40 @@ export class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
177
171
|
this.inputElement.setSelectionRange(newCaretPosition, newCaretPosition);
|
|
178
172
|
}
|
|
179
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Format the value based on the input and blur format strategies.
|
|
176
|
+
*
|
|
177
|
+
* @param {string} rawValue - The original input value
|
|
178
|
+
* @param {FormatTrigger} triggeredBy - The trigger of the format
|
|
179
|
+
* @param {{ caretPosition?: number }} options - The options for the format
|
|
180
|
+
* @param {number} options.caretPosition - The current input caret position
|
|
181
|
+
*/
|
|
182
|
+
formatValue(rawValue, triggeredBy, options) {
|
|
183
|
+
const isBlurred = !this.isOnFocus();
|
|
184
|
+
const caretPosition = options === null || options === void 0 ? void 0 : options.caretPosition;
|
|
185
|
+
if (this.inputFormatStrategy) {
|
|
186
|
+
if (this.inputFormatStrategy.canFormat(triggeredBy, 'component')) {
|
|
187
|
+
const formattedComponentValue = this.inputFormatStrategy.format(rawValue);
|
|
188
|
+
this.updateComponentValue(rawValue, formattedComponentValue);
|
|
189
|
+
}
|
|
190
|
+
if (this.inputFormatStrategy.canFormat(triggeredBy, 'native-input')) {
|
|
191
|
+
const formattedNativeInputValue = this.inputFormatStrategy.format(rawValue, {
|
|
192
|
+
caretPosition: caretPosition,
|
|
193
|
+
});
|
|
194
|
+
this.updateNativeInputValue(rawValue, formattedNativeInputValue);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (this.blurFormatStrategy && isBlurred) {
|
|
198
|
+
if (this.blurFormatStrategy.canFormat(triggeredBy, 'component', { isBlurred })) {
|
|
199
|
+
const formattedComponentValue = this.blurFormatStrategy.format(rawValue);
|
|
200
|
+
this.updateComponentValue(rawValue, formattedComponentValue);
|
|
201
|
+
}
|
|
202
|
+
if (this.blurFormatStrategy.canFormat(triggeredBy, 'native-input', { isBlurred })) {
|
|
203
|
+
const formattedNativeInputValue = this.blurFormatStrategy.format(rawValue);
|
|
204
|
+
this.updateNativeInputValue(rawValue, formattedNativeInputValue);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
180
208
|
}
|
|
181
209
|
__decorate([
|
|
182
210
|
MapToComponentField()
|
|
@@ -9,6 +9,7 @@ import { InjectVegaSlimmer } from 'vega-slimmer/core';
|
|
|
9
9
|
import { StringInputFormatterSlimmer } from '../string-input-formatter-slimmer';
|
|
10
10
|
import { StringMaskStrategy } from '../../formatter/string-formatter/string-mask-strategy';
|
|
11
11
|
import { ThousandCommaStrategy } from '../../formatter/string-formatter/thousand-comma-strategy';
|
|
12
|
+
import { StringFormatStrategy } from '../../formatter/string-formatter/string-format-strategy.abstract';
|
|
12
13
|
import { dispatchPasteEvent } from '../../../utils/spec-utils';
|
|
13
14
|
const createMockedInput = () => {
|
|
14
15
|
const inputEl = document.createElement('input');
|
|
@@ -197,7 +198,7 @@ describe('StringInputFormatterSlimmer test suite', () => {
|
|
|
197
198
|
expect(inputEl.value).toEqual('(115) 902-4055');
|
|
198
199
|
});
|
|
199
200
|
test('should work proper while formatter have not implement calculateCaretPosition method', () => {
|
|
200
|
-
class FormatterSlimmer {
|
|
201
|
+
class FormatterSlimmer extends StringFormatStrategy {
|
|
201
202
|
format(input) {
|
|
202
203
|
return input;
|
|
203
204
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { F as FeatureFlag } from './feature-flag-controller-4b3fe6f8.js';
|
|
2
|
-
import { V as VegaLoader, a as VegaNotify, b as VegaEventManager, c as VegaZIndexManager, d as VegaSkeletonLoader } from './vega-skeleton-loader-controller-
|
|
3
|
-
import { V as VegaThemeManager } from './node-annotation.abstract-
|
|
2
|
+
import { V as VegaLoader, a as VegaNotify, b as VegaEventManager, c as VegaZIndexManager, d as VegaSkeletonLoader } from './vega-skeleton-loader-controller-5aea7aeb.js';
|
|
3
|
+
import { V as VegaThemeManager } from './node-annotation.abstract-b2e36bc4.js';
|
|
4
4
|
import { M as MapToComponentMethod, V as VegaSlimmer, s as setVegaLogLevel, G as GlobalSlimmersRegistry } from './global-slimmer-registry-17c4efd4.js';
|
|
5
5
|
import { V as VegaDialog } from './vega-dialog-controller-34eb8967.js';
|
|
6
6
|
import { v as vegaEnvManager } from './vega-env-manager-8f8dc473.js';
|
|
7
7
|
import { V as VegaIconManager } from './icon-manager-b889176b.js';
|
|
8
|
-
import { w as waitForVega } from './index-
|
|
8
|
+
import { w as waitForVega } from './index-6e05b241.js';
|
|
9
9
|
import './ui-62e4be97.js';
|
|
10
10
|
import { V as VegaInternalTranslation, a as VegaTranslation, s as staticTranslations } from './translation-c08f2274.js';
|
|
11
11
|
import { T as TypographyUrls } from './typography-396de03f.js';
|
|
12
12
|
import { V as ValidCreditCardNumberRule } from './valid-credit-card-number-rule-2aef3ad5.js';
|
|
13
|
-
import { V as VegaRTEContent } from './content-state-
|
|
13
|
+
import { V as VegaRTEContent } from './content-state-ccf5f960.js';
|
|
14
14
|
import { U as UPDATE_TRANSLATION } from './static-subject-title-8268945e.js';
|
|
15
15
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
16
16
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BlockAnnotation, a as BlockAnnotationTypeEnum, M as ModifyContentAction, b as ModifyContentActionType, s as stateEntityRenderingRegistry, N as NodeAnnotation, c as NodeAnnotationTypeEnum, R as RTENode, d as NodeTypeEnum, A as Annotation, I as InternalAnnotationTypeEnum, V as VegaThemeManager } from './node-annotation.abstract-
|
|
1
|
+
import { B as BlockAnnotation, a as BlockAnnotationTypeEnum, M as ModifyContentAction, b as ModifyContentActionType, s as stateEntityRenderingRegistry, N as NodeAnnotation, c as NodeAnnotationTypeEnum, R as RTENode, d as NodeTypeEnum, A as Annotation, I as InternalAnnotationTypeEnum, V as VegaThemeManager } from './node-annotation.abstract-b2e36bc4.js';
|
|
2
2
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
3
3
|
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-97deb349.js';
|
|
4
|
-
import { V as VegaInternalRichTextEditorFlushChanges, b as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-
|
|
4
|
+
import { V as VegaInternalRichTextEditorFlushChanges, b as VegaInternalRichTextEditorSelectionRangeChange } from './vega-internal-event-id-d0690d0d.js';
|
|
5
5
|
import { i as isNonNullable } from './type-guard-158f6d7a.js';
|
|
6
6
|
import './global-slimmer-registry-17c4efd4.js';
|
|
7
7
|
import { g as generateUUID } from './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
@@ -2951,4 +2951,4 @@ class VegaRTEContent extends BlockBaseOperator {
|
|
|
2951
2951
|
}
|
|
2952
2952
|
}
|
|
2953
2953
|
|
|
2954
|
-
export { AnnotationAction as A, BoldAnnotationAction as B, ClearFormattingAnnotationAction as C, HorizontalAlignmentAnnotation as H, ImageAnnotation as I, LinkAnnotationAction as L, MergeTwoBlocksNodesAction as M, RTETextBlock as R, StrikethroughAnnotation as S, TextSplittableAction as T, UnderlineAnnotation as U, VegaRTEContent as V, ZERO_WIDTH_SPACE as Z, RTEImageBlock as a, RTEListItemBlock as b, RTEListBlock as c, RTEBlock as d, RTEImageNode as e, RTETextNode as f, TextColorAnnotation as g, RTE_TEXT_COLORS as h, ItalicAnnotation as i, TextStyleAnnotationAction as j, TextStyleAnnotation as k, BoldAnnotation as l, CodeAnnotationAction as m, SelectionRangeAnnotation as n, IndentAnnotation as o,
|
|
2954
|
+
export { AnnotationAction as A, BoldAnnotationAction as B, ClearFormattingAnnotationAction as C, HorizontalAlignmentAnnotation as H, ImageAnnotation as I, LinkAnnotationAction as L, MergeTwoBlocksNodesAction as M, RTETextBlock as R, StrikethroughAnnotation as S, TextSplittableAction as T, UnderlineAnnotation as U, VegaRTEContent as V, ZERO_WIDTH_SPACE as Z, RTEImageBlock as a, RTEListItemBlock as b, RTEListBlock as c, RTEBlock as d, RTEImageNode as e, RTETextNode as f, TextColorAnnotation as g, RTE_TEXT_COLORS as h, ItalicAnnotation as i, TextStyleAnnotationAction as j, TextStyleAnnotation as k, BoldAnnotation as l, CodeAnnotationAction as m, SelectionRangeAnnotation as n, IndentAnnotation as o, AppendChildNodesAction as p, UpdateTextAction as q, SplitBlockWithNodeAction as r, RemoveChildAction as s, ReplaceChildNodesAction as t, InsertBlocksBeforeAction as u, InsertBlocksAfterAction as v };
|
|
@@ -7,7 +7,7 @@ import { f as findParent, c as isElementVisible } from './ui-62e4be97.js';
|
|
|
7
7
|
import { i as isAsyncFunction, g as generateUUID } from './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
8
8
|
import { c as createDynamicSlimmer } from './dynamic-slimmer-90b8af32.js';
|
|
9
9
|
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-97deb349.js';
|
|
10
|
-
import { c as VegaInternalFieldErrorStateChange, d as VegaInternalValid } from './vega-internal-event-id-
|
|
10
|
+
import { c as VegaInternalFieldErrorStateChange, d as VegaInternalValid } from './vega-internal-event-id-d0690d0d.js';
|
|
11
11
|
import { V as VegaInternalTranslation } from './translation-c08f2274.js';
|
|
12
12
|
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-beb7b0bd.js';
|
|
13
13
|
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-857c65fa.js';
|
package/dist/esm/{image-annotation-action-84422458.js → image-annotation-action-3da42221.js}
RENAMED
|
@@ -3,8 +3,8 @@ import { c as MapToComponentField, V as VegaSlimmer } from './global-slimmer-reg
|
|
|
3
3
|
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-857c65fa.js';
|
|
4
4
|
import { a as VegaClick, L as VegaPopoverShow, M as VegaPopoverHide, f as VegaChange } from './dom-node-subject-factory-97deb349.js';
|
|
5
5
|
import { V as VegaInternalIconManager } from './internal-icon-manager-900a5bb4.js';
|
|
6
|
-
import { T as TextSplittableAction, g as TextColorAnnotation, h as RTE_TEXT_COLORS, f as RTETextNode, A as AnnotationAction, I as ImageAnnotation } from './content-state-
|
|
7
|
-
import { e as VegaDarkModeStyleController, c as NodeAnnotationTypeEnum } from './node-annotation.abstract-
|
|
6
|
+
import { T as TextSplittableAction, g as TextColorAnnotation, h as RTE_TEXT_COLORS, f as RTETextNode, A as AnnotationAction, I as ImageAnnotation } from './content-state-ccf5f960.js';
|
|
7
|
+
import { e as VegaDarkModeStyleController, c as NodeAnnotationTypeEnum } from './node-annotation.abstract-b2e36bc4.js';
|
|
8
8
|
|
|
9
9
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10
10
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3,7 +3,7 @@ import { I as InjectVegaTelemetrySlimmer, c as createPublicAPIRuntimeMetricsSlim
|
|
|
3
3
|
import { O as Observer } from './observer-3959f9dd.js';
|
|
4
4
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
5
5
|
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-97deb349.js';
|
|
6
|
-
import { a as VegaInternalComponentDidRender } from './vega-internal-event-id-
|
|
6
|
+
import { a as VegaInternalComponentDidRender } from './vega-internal-event-id-d0690d0d.js';
|
|
7
7
|
|
|
8
8
|
const WaitForVegaPayloadDefinition = [
|
|
9
9
|
{
|
package/dist/esm/index.js
CHANGED
|
@@ -8,16 +8,16 @@ export { I as Icons, g as getIconFromToken } from './icons-8627925e.js';
|
|
|
8
8
|
export { b as Typography, a as TypographyKeys, T as TypographyUrls } from './typography-396de03f.js';
|
|
9
9
|
export { e as BoxDisplay, B as BreakpointKeys, C as CssStates, F as FlexDirections } from './ui-8424715a.js';
|
|
10
10
|
export { F as FrameworkEnum, v as VegaEnvManager } from './vega-env-manager-8f8dc473.js';
|
|
11
|
-
export { b as VegaEventManager, V as VegaLoader, a as VegaNotify, d as VegaSkeletonLoader, c as VegaZIndexManager } from './vega-skeleton-loader-controller-
|
|
11
|
+
export { b as VegaEventManager, V as VegaLoader, a as VegaNotify, d as VegaSkeletonLoader, c as VegaZIndexManager } from './vega-skeleton-loader-controller-5aea7aeb.js';
|
|
12
12
|
export { F as FeatureFlag } from './feature-flag-controller-4b3fe6f8.js';
|
|
13
|
-
export { M as ModifyContentAction, R as RTENode, V as VegaThemeManager } from './node-annotation.abstract-
|
|
13
|
+
export { M as ModifyContentAction, R as RTENode, V as VegaThemeManager } from './node-annotation.abstract-b2e36bc4.js';
|
|
14
14
|
export { V as VegaDialog } from './vega-dialog-controller-34eb8967.js';
|
|
15
15
|
export { B as VegaJQueryDelegatedEventStrategy } from './internal-vega-event-manager-0a01ba12.js';
|
|
16
16
|
export { V as VegaIconManager } from './icon-manager-b889176b.js';
|
|
17
17
|
export { V as ValidCreditCardNumberRule } from './valid-credit-card-number-rule-2aef3ad5.js';
|
|
18
|
-
export { w as waitForVega } from './index-
|
|
18
|
+
export { w as waitForVega } from './index-6e05b241.js';
|
|
19
19
|
export { a as VegaTranslation, s as VegaTranslationResourceEN } from './translation-c08f2274.js';
|
|
20
|
-
export { d as RTEBlock, a as RTEImageBlock, e as RTEImageNode, c as RTEListBlock, b as RTEListItemBlock, R as RTETextBlock, f as RTETextNode, V as VegaRTEContent } from './content-state-
|
|
20
|
+
export { d as RTEBlock, a as RTEImageBlock, e as RTEImageNode, c as RTEListBlock, b as RTEListItemBlock, R as RTETextBlock, f as RTETextNode, V as VegaRTEContent } from './content-state-ccf5f960.js';
|
|
21
21
|
export { G as GridColumns, a as GridRows } from './responsive-format-facade-661193d7.js';
|
|
22
22
|
import './state-background-color-formatter-121ae7d3.js';
|
|
23
23
|
import './regex-dfe11abf.js';
|
|
@@ -33,7 +33,7 @@ import './static-subject-title-8268945e.js';
|
|
|
33
33
|
import './change-manager-6a7eb88c.js';
|
|
34
34
|
import './observer-3959f9dd.js';
|
|
35
35
|
import './dom-node-subject-factory-97deb349.js';
|
|
36
|
-
import './vega-internal-event-id-
|
|
36
|
+
import './vega-internal-event-id-d0690d0d.js';
|
|
37
37
|
import './pixel-f32c07ce.js';
|
|
38
38
|
|
|
39
39
|
/* This file is generated by vega-design 2.0.77 */
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { p as promiseResolve, b as bootstrapLazy } from './index-187f71d1.js';
|
|
2
|
-
import { g as globalScripts } from './app-globals-
|
|
2
|
+
import { g as globalScripts } from './app-globals-4cca4a96.js';
|
|
3
3
|
import './feature-flag-controller-4b3fe6f8.js';
|
|
4
4
|
import './global-slimmer-registry-17c4efd4.js';
|
|
5
5
|
import './index-44c794b4.js';
|
|
6
6
|
import './_commonjsHelpers-9943807e.js';
|
|
7
|
-
import './vega-skeleton-loader-controller-
|
|
7
|
+
import './vega-skeleton-loader-controller-5aea7aeb.js';
|
|
8
8
|
import './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
9
9
|
import './dynamic-slimmer-90b8af32.js';
|
|
10
10
|
import './ui-62e4be97.js';
|
|
@@ -16,20 +16,20 @@ import './ui-8424715a.js';
|
|
|
16
16
|
import './breakpoints-d9faf11c.js';
|
|
17
17
|
import './internal-vega-event-manager-0a01ba12.js';
|
|
18
18
|
import './dom-node-subject-factory-97deb349.js';
|
|
19
|
-
import './node-annotation.abstract-
|
|
19
|
+
import './node-annotation.abstract-b2e36bc4.js';
|
|
20
20
|
import './static-subject-title-8268945e.js';
|
|
21
21
|
import './change-manager-6a7eb88c.js';
|
|
22
22
|
import './observer-3959f9dd.js';
|
|
23
|
-
import './vega-internal-event-id-
|
|
23
|
+
import './vega-internal-event-id-d0690d0d.js';
|
|
24
24
|
import './vega-dialog-controller-34eb8967.js';
|
|
25
25
|
import './vega-env-manager-8f8dc473.js';
|
|
26
26
|
import './icon-manager-b889176b.js';
|
|
27
|
-
import './index-
|
|
27
|
+
import './index-6e05b241.js';
|
|
28
28
|
import './translation-c08f2274.js';
|
|
29
29
|
import './typography-396de03f.js';
|
|
30
30
|
import './valid-credit-card-number-rule-2aef3ad5.js';
|
|
31
31
|
import './regex-dfe11abf.js';
|
|
32
|
-
import './content-state-
|
|
32
|
+
import './content-state-ccf5f960.js';
|
|
33
33
|
import './type-guard-158f6d7a.js';
|
|
34
34
|
|
|
35
35
|
/*
|
package/dist/esm/{node-annotation.abstract-a58b5a49.js → node-annotation.abstract-b2e36bc4.js}
RENAMED
|
@@ -5,7 +5,7 @@ import { O as Observer } from './observer-3959f9dd.js';
|
|
|
5
5
|
import './global-slimmer-registry-17c4efd4.js';
|
|
6
6
|
import { I as InjectVegaTelemetrySlimmer, c as createPublicAPIRuntimeMetricsSlimmer } from './create-public-api-runtime-metrics-slimmer-9ab05523.js';
|
|
7
7
|
import { d as domNodeSubjectFactory } from './dom-node-subject-factory-97deb349.js';
|
|
8
|
-
import { V as VegaInternalRichTextEditorFlushChanges } from './vega-internal-event-id-
|
|
8
|
+
import { V as VegaInternalRichTextEditorFlushChanges } from './vega-internal-event-id-d0690d0d.js';
|
|
9
9
|
|
|
10
10
|
var tinycolor = createCommonjsModule(function (module, exports) {
|
|
11
11
|
// This file is autogenerated. It's used to publish CJS to npm.
|