@globalpayments/vega 2.37.1 → 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-e10d1859.js → app-globals-7087f121.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-072b75a0.js → string-input-formatter-slimmer-f45931fd.js} +111 -32
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-input.cjs.entry.js +6 -4
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +54 -1
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +1 -1
- package/dist/cjs/{vega-skeleton-loader-controller-ef43cfc1.js → vega-skeleton-loader-controller-00dbdf29.js} +11 -3
- package/dist/cjs/vega.cjs.js +2 -2
- 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/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-c1f2bea9.js → app-globals-4cca4a96.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{string-input-formatter-slimmer-930f1125.js → string-input-formatter-slimmer-d4132497.js} +111 -33
- package/dist/esm/vega-date-picker_2.entry.js +2 -2
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-input.entry.js +6 -4
- package/dist/esm/vega-loader-wrapper_2.entry.js +55 -2
- package/dist/esm/vega-rich-text-editor_4.entry.js +1 -1
- package/dist/esm/{vega-skeleton-loader-controller-0044d77f.js → vega-skeleton-loader-controller-5aea7aeb.js} +11 -3
- package/dist/esm/vega.js +2 -2
- package/dist/types/components/vega-date-picker/slimmers/controllers/vega-date-picker-format-controller.d.ts +1 -1
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +1 -1
- 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/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/vega/index.esm.js +1 -1
- package/dist/vega/{p-6100e1aa.js → p-1d93b3a9.js} +1 -1
- package/dist/vega/p-20326c64.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-76a8ccbb.js +1 -0
- package/dist/vega/{p-da66dad5.entry.js → p-9728d571.entry.js} +1 -1
- package/dist/vega/{p-9eb90ee8.entry.js → p-a2a34239.entry.js} +1 -1
- package/dist/vega/p-e4ce559d.entry.js +1 -0
- package/dist/vega/p-ecaf4cfa.entry.js +1 -0
- 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-4c18ff36.js +0 -1
- package/dist/vega/p-84a7c18a.entry.js +0 -1
- package/dist/vega/p-a98475a2.entry.js +0 -1
- package/dist/vega/p-b2d47bdd.js +0 -1
|
@@ -14,10 +14,10 @@ import { c as createCommonjsModule } from './_commonjsHelpers-9943807e.js';
|
|
|
14
14
|
import { I as InternalVegaZIndexManager } from './internal-vega-z-index-manager-7d2b54c3.js';
|
|
15
15
|
import { b as FORM_ELEMENT_VALUE_CHANGE } from './static-subject-title-8268945e.js';
|
|
16
16
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
17
|
-
import {
|
|
17
|
+
import { a as StringInputFormatterSlimmer, b as StringMaskStrategy } from './string-input-formatter-slimmer-d4132497.js';
|
|
18
18
|
import { E as ElementAppenderSlimmer } from './element-appender-slimmer-f5e703f3.js';
|
|
19
19
|
import './vega-env-manager-8f8dc473.js';
|
|
20
|
-
import './vega-skeleton-loader-controller-
|
|
20
|
+
import './vega-skeleton-loader-controller-5aea7aeb.js';
|
|
21
21
|
import { F as FeatureFlag } from './feature-flag-controller-4b3fe6f8.js';
|
|
22
22
|
import './node-annotation.abstract-b2e36bc4.js';
|
|
23
23
|
import './vega-dialog-controller-34eb8967.js';
|
|
@@ -9,9 +9,9 @@ var FrameworkEnum;
|
|
|
9
9
|
/** The VegaEnvManager class manages vega environment parameters. */
|
|
10
10
|
class VegaEnvManager {
|
|
11
11
|
constructor() {
|
|
12
|
-
// The `2.37.
|
|
12
|
+
// The `2.37.2` will be replaced to a version string when running publish script.
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
14
|
-
this.vegaVersion = '2.37.
|
|
14
|
+
this.vegaVersion = '2.37.2';
|
|
15
15
|
this.framework = FrameworkEnum.VanillaJs;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -13,7 +13,7 @@ import { c as createEventEmitSlimmer } from './event-emit-slimmer-36cf4e39.js';
|
|
|
13
13
|
import { f as VegaChange, z as VegaFocus, A as VegaBlur, q as VegaLabelButtonClick } from './dom-node-subject-factory-97deb349.js';
|
|
14
14
|
import { b as FORM_ELEMENT_VALUE_CHANGE } from './static-subject-title-8268945e.js';
|
|
15
15
|
import { C as ChangeManager } from './change-manager-6a7eb88c.js';
|
|
16
|
-
import { S as
|
|
16
|
+
import { S as StringFormatStrategy, a as StringInputFormatterSlimmer, b as StringMaskStrategy } from './string-input-formatter-slimmer-d4132497.js';
|
|
17
17
|
import { i as isNonNullable } from './type-guard-158f6d7a.js';
|
|
18
18
|
import { D as DomNodeSubjectObserverFactory } from './dom-node-subject-observer-factory-857c65fa.js';
|
|
19
19
|
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-beb7b0bd.js';
|
|
@@ -184,7 +184,7 @@ __decorate$4([
|
|
|
184
184
|
*
|
|
185
185
|
* @augments StringFormatStrategy
|
|
186
186
|
*/
|
|
187
|
-
class ThousandCommaStrategy {
|
|
187
|
+
class ThousandCommaStrategy extends StringFormatStrategy {
|
|
188
188
|
/**
|
|
189
189
|
* If the input is a number, format it as a string
|
|
190
190
|
*
|
|
@@ -220,13 +220,14 @@ class ThousandCommaStrategy {
|
|
|
220
220
|
/**
|
|
221
221
|
* A class for formatting number with the given mask format
|
|
222
222
|
*/
|
|
223
|
-
class NumberMaskStrategy {
|
|
223
|
+
class NumberMaskStrategy extends StringFormatStrategy {
|
|
224
224
|
/**
|
|
225
225
|
* It creates a new instance of the Mask class.
|
|
226
226
|
*
|
|
227
227
|
* @param {NumberMaskConfig} maskConfig - MaskConfig
|
|
228
228
|
*/
|
|
229
229
|
constructor(maskConfig) {
|
|
230
|
+
super();
|
|
230
231
|
this.maskConfig = { allowNegative: true };
|
|
231
232
|
/**
|
|
232
233
|
* if allow negative, will skip '-', e.g. when input '-' -> '-1.2'
|
|
@@ -329,7 +330,7 @@ class NumberMaskStrategy {
|
|
|
329
330
|
/**
|
|
330
331
|
* Used to format a string using a custom formatter.
|
|
331
332
|
*/
|
|
332
|
-
class CustomFormatterStrategy {
|
|
333
|
+
class CustomFormatterStrategy extends StringFormatStrategy {
|
|
333
334
|
/**
|
|
334
335
|
* The constructor function takes a CustomStringFormatter parameter and assigns it to the formatter
|
|
335
336
|
* property of the class.
|
|
@@ -341,6 +342,7 @@ class CustomFormatterStrategy {
|
|
|
341
342
|
* @param {boolean} resetCaretPosition - The caret position should update to the last or keep the current position after format
|
|
342
343
|
*/
|
|
343
344
|
constructor(formatter, resetCaretPosition = false) {
|
|
345
|
+
super();
|
|
344
346
|
this.resetCaretPositionFlag = false;
|
|
345
347
|
this.formatter = formatter;
|
|
346
348
|
this.resetCaretPositionFlag = resetCaretPosition;
|
|
@@ -1,19 +1,68 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-187f71d1.js';
|
|
2
|
-
import { I as InjectVegaSlimmer } from './global-slimmer-registry-17c4efd4.js';
|
|
2
|
+
import { c as MapToComponentField, M as MapToComponentMethod, V as VegaSlimmer, I as InjectVegaSlimmer } from './global-slimmer-registry-17c4efd4.js';
|
|
3
3
|
import { V as VegaComponentUsageRuntimeMetricsSlimmer, I as InjectVegaGlobalSlimmer } from './component-usage-runtime-metrics-385c7124.js';
|
|
4
|
+
import { I as InternalVegaZIndexManager } from './internal-vega-z-index-manager-7d2b54c3.js';
|
|
4
5
|
import { s as sanitizeVegaComponent } from './component-cae24190.js';
|
|
5
6
|
import { a as arrayToClassString } from './ui-62e4be97.js';
|
|
6
7
|
import { R as ResponsiveFormatFacade } from './responsive-format-facade-661193d7.js';
|
|
7
8
|
import { g as getCurrentBreakpoint } from './breakpoints-91116111.js';
|
|
8
9
|
import { P as PageResizeObserverSlimmer } from './page-resize-observer-slimmer-beb7b0bd.js';
|
|
10
|
+
import './number-4398f2e1.js';
|
|
9
11
|
import './type-guard-158f6d7a.js';
|
|
10
12
|
import './breakpoints-d9faf11c.js';
|
|
11
13
|
import './ui-8424715a.js';
|
|
12
14
|
import './regex-dfe11abf.js';
|
|
13
15
|
import './typography-396de03f.js';
|
|
14
|
-
import './number-4398f2e1.js';
|
|
15
16
|
import './pixel-f32c07ce.js';
|
|
16
17
|
|
|
18
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
/** The ManageVegaLoaderWrapperZIndex class manages z-index of the vega-loader-wrapper. */
|
|
25
|
+
class ManageVegaLoaderWrapperZIndexController extends VegaSlimmer {
|
|
26
|
+
/**
|
|
27
|
+
* When vega loader wrapper is connected
|
|
28
|
+
*/
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
this.setIndex();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* When vega loader wrapper is disconnected
|
|
34
|
+
*/
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
this.removeIndex();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Sets the z-index level for the vega-loader-wrapper based on the target container.
|
|
40
|
+
*/
|
|
41
|
+
setIndex() {
|
|
42
|
+
const containerElement = document.querySelector(this.host.dataset.container);
|
|
43
|
+
if (containerElement) {
|
|
44
|
+
if (containerElement.tagName === 'BODY') {
|
|
45
|
+
InternalVegaZIndexManager.setZIndex(this.host, 'base');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Removes the z-index of the vega-loader-wrapper by resetting it.
|
|
51
|
+
*/
|
|
52
|
+
removeIndex() {
|
|
53
|
+
InternalVegaZIndexManager.removeZIndex(this.host, 'base');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
__decorate$2([
|
|
57
|
+
MapToComponentField()
|
|
58
|
+
], ManageVegaLoaderWrapperZIndexController.prototype, "host", void 0);
|
|
59
|
+
__decorate$2([
|
|
60
|
+
MapToComponentMethod('connectedCallback')
|
|
61
|
+
], ManageVegaLoaderWrapperZIndexController.prototype, "connectedCallback", null);
|
|
62
|
+
__decorate$2([
|
|
63
|
+
MapToComponentMethod('disconnectedCallback')
|
|
64
|
+
], ManageVegaLoaderWrapperZIndexController.prototype, "disconnectedCallback", null);
|
|
65
|
+
|
|
17
66
|
const vegaLoaderWrapperCss = ":host{display:block;display:inline-flex;align-items:center;justify-content:center;top:0px;right:0px;bottom:0px;left:0px;background-color:rgba(var(--v-bg-backdrop-loading, 255, 255, 255, 0.5))}:host(.absolute-wrapper){position:absolute}:host(.fixed-wrapper){width:100%;height:100%;position:fixed}";
|
|
18
67
|
|
|
19
68
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -30,6 +79,7 @@ const VegaLoaderWrapper = class {
|
|
|
30
79
|
constructor(hostRef) {
|
|
31
80
|
registerInstance(this, hostRef);
|
|
32
81
|
this.globalSlimmers = {};
|
|
82
|
+
this.manageVegaLoaderWrapperZIndexController = new ManageVegaLoaderWrapperZIndexController();
|
|
33
83
|
this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
|
|
34
84
|
}
|
|
35
85
|
render() {
|
|
@@ -40,6 +90,9 @@ const VegaLoaderWrapper = class {
|
|
|
40
90
|
__decorate$1([
|
|
41
91
|
InjectVegaGlobalSlimmer()
|
|
42
92
|
], VegaLoaderWrapper.prototype, "globalSlimmers", void 0);
|
|
93
|
+
__decorate$1([
|
|
94
|
+
InjectVegaSlimmer()
|
|
95
|
+
], VegaLoaderWrapper.prototype, "manageVegaLoaderWrapperZIndexController", void 0);
|
|
43
96
|
__decorate$1([
|
|
44
97
|
InjectVegaSlimmer()
|
|
45
98
|
], VegaLoaderWrapper.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
|
|
@@ -22,7 +22,7 @@ import { O as Observer } from './observer-3959f9dd.js';
|
|
|
22
22
|
import { f as findParent, r as rgbToHex } from './ui-62e4be97.js';
|
|
23
23
|
import { b as FORM_ELEMENT_VALUE_CHANGE, D as DARK_MODE_CHANGE } from './static-subject-title-8268945e.js';
|
|
24
24
|
import './vega-env-manager-8f8dc473.js';
|
|
25
|
-
import './vega-skeleton-loader-controller-
|
|
25
|
+
import './vega-skeleton-loader-controller-5aea7aeb.js';
|
|
26
26
|
import './feature-flag-controller-4b3fe6f8.js';
|
|
27
27
|
import './vega-dialog-controller-34eb8967.js';
|
|
28
28
|
import './icon-manager-b889176b.js';
|
|
@@ -70,8 +70,13 @@ class VegaLoaderController {
|
|
|
70
70
|
* @vegaVersion 1.16.0
|
|
71
71
|
*/
|
|
72
72
|
load(options = {}) {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
let containerSelector = options.containerSelector || 'body';
|
|
74
|
+
let containerElement = document.querySelector(containerSelector);
|
|
75
|
+
if (containerElement &&
|
|
76
|
+
VegaLoaderController.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY.includes(containerElement.tagName)) {
|
|
77
|
+
containerSelector = 'body';
|
|
78
|
+
containerElement = document.querySelector('body');
|
|
79
|
+
}
|
|
75
80
|
if (!containerElement) {
|
|
76
81
|
LogUtility.error('Container is not found by selector: ', containerSelector);
|
|
77
82
|
return null;
|
|
@@ -93,7 +98,9 @@ class VegaLoaderController {
|
|
|
93
98
|
if (loader.dataset.container) {
|
|
94
99
|
const container = document.querySelector(loader.dataset.container);
|
|
95
100
|
if (container) {
|
|
96
|
-
|
|
101
|
+
if (container.dataset['vegaLoaderOriginPosition']) {
|
|
102
|
+
container.style.position = container.dataset['vegaLoaderOriginPosition'];
|
|
103
|
+
}
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
loader.remove();
|
|
@@ -163,6 +170,7 @@ class VegaLoaderController {
|
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
}
|
|
173
|
+
VegaLoaderController.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY = ['VEGA-MODAL'];
|
|
166
174
|
__decorate$4([
|
|
167
175
|
InjectVegaTelemetrySlimmer()
|
|
168
176
|
], VegaLoaderController.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
|
package/dist/esm/vega.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';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VegaDatePicker } from '../../vega-date-picker';
|
|
2
2
|
import { Nullable } from '../../../../types/general';
|
|
3
3
|
import { StringInputFormatterSlimmer } from '../../../../helpers/slimmers/string-input-formatter-slimmer';
|
|
4
|
-
import { StringFormatStrategy } from '../../../../helpers/formatter/string-formatter/string-format-strategy';
|
|
4
|
+
import { StringFormatStrategy } from '../../../../helpers/formatter/string-formatter/string-format-strategy.abstract';
|
|
5
5
|
declare type InputType = 'single' | 'rangeStart' | 'rangeEnd';
|
|
6
6
|
/** The date picker format controller slimmer */
|
|
7
7
|
export declare class VegaDatePickerFormatController extends StringInputFormatterSlimmer {
|
package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VegaInput } from '../../vega-input';
|
|
2
2
|
import { Nullable } from '../../../../types/general';
|
|
3
|
-
import { StringFormatStrategy } from '../../../../helpers/formatter/string-formatter/string-format-strategy';
|
|
3
|
+
import { StringFormatStrategy } from '../../../../helpers/formatter/string-formatter/string-format-strategy.abstract';
|
|
4
4
|
import { StringInputFormatterSlimmer } from '../../../../helpers/slimmers/string-input-formatter-slimmer';
|
|
5
5
|
/** The `VegaInputMaskConfigController` class in TypeScript manages input mask configuration and string formatting for an input element within a component's shadow root. */
|
|
6
6
|
export declare class VegaInputMaskConfigController extends StringInputFormatterSlimmer {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VegaSlimmer } from '../../../../vega-slimmer/vega-slimmer-core';
|
|
2
|
+
/** The ManageVegaLoaderWrapperZIndex class manages z-index of the vega-loader-wrapper. */
|
|
3
|
+
export declare class ManageVegaLoaderWrapperZIndexController extends VegaSlimmer {
|
|
4
|
+
private host;
|
|
5
|
+
/**
|
|
6
|
+
* When vega loader wrapper is connected
|
|
7
|
+
*/
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
/**
|
|
10
|
+
* When vega loader wrapper is disconnected
|
|
11
|
+
*/
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the z-index level for the vega-loader-wrapper based on the target container.
|
|
15
|
+
*/
|
|
16
|
+
private setIndex;
|
|
17
|
+
/**
|
|
18
|
+
* Removes the z-index of the vega-loader-wrapper by resetting it.
|
|
19
|
+
*/
|
|
20
|
+
private removeIndex;
|
|
21
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { GlobalSlimmers } from '../../vega-slimmer/vega-slimmer-core';
|
|
2
2
|
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
|
|
3
|
+
import { ManageVegaLoaderWrapperZIndexController } from './slimmers/controllers/manage-vega-loader-wrapper-z-index-controller';
|
|
3
4
|
/**
|
|
4
5
|
* @vegaVersion 2.0.0
|
|
5
6
|
*/
|
|
6
7
|
export declare class VegaLoaderWrapper {
|
|
7
8
|
protected readonly globalSlimmers: GlobalSlimmers;
|
|
9
|
+
protected manageVegaLoaderWrapperZIndexController: ManageVegaLoaderWrapperZIndexController;
|
|
8
10
|
protected vegaComponentUsageRuntimeMetricsSlimmer: VegaComponentUsageRuntimeMetricsSlimmer<HTMLVegaLoaderWrapperElement>;
|
|
9
11
|
host: HTMLVegaLoaderWrapperElement;
|
|
10
12
|
render(): VegaLoaderWrapper;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StringFormatStrategy } from './string-format-strategy';
|
|
1
|
+
import { StringFormatStrategy } from './string-format-strategy.abstract';
|
|
2
2
|
import { Nullable } from '../../../types/general';
|
|
3
3
|
export declare type CustomStringFormatter = (rawValue: string) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Used to format a string using a custom formatter.
|
|
6
6
|
*/
|
|
7
|
-
export declare class CustomFormatterStrategy
|
|
7
|
+
export declare class CustomFormatterStrategy extends StringFormatStrategy {
|
|
8
8
|
private readonly formatter;
|
|
9
9
|
private resetCaretPositionFlag;
|
|
10
10
|
/**
|
|
@@ -43,5 +43,5 @@ export declare class CustomFormatterStrategy implements StringFormatStrategy {
|
|
|
43
43
|
*
|
|
44
44
|
* @returns {boolean} true or false
|
|
45
45
|
*/
|
|
46
|
-
shouldTriggerAtInit(): boolean;
|
|
46
|
+
protected shouldTriggerAtInit(): boolean;
|
|
47
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from '../../../types/general';
|
|
2
|
-
import { StringFormatStrategy } from './string-format-strategy';
|
|
2
|
+
import { StringFormatStrategy } from './string-format-strategy.abstract';
|
|
3
3
|
export declare type NumberMaskConfig = {
|
|
4
4
|
/**
|
|
5
5
|
* 0 - will only allow integer
|
|
@@ -17,7 +17,7 @@ export declare type NumberMaskConfig = {
|
|
|
17
17
|
/**
|
|
18
18
|
* A class for formatting number with the given mask format
|
|
19
19
|
*/
|
|
20
|
-
export declare class NumberMaskStrategy
|
|
20
|
+
export declare class NumberMaskStrategy extends StringFormatStrategy {
|
|
21
21
|
protected readonly maskConfig: NumberMaskConfig;
|
|
22
22
|
protected mask: RegExp;
|
|
23
23
|
/**
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Nullable } from '../../../types/general';
|
|
2
|
+
export declare type FormatTrigger = 'blur' | 'input' | 'init';
|
|
3
|
+
export declare type FormatTarget = 'component' | 'native-input';
|
|
4
|
+
export declare type InputStatus = {
|
|
5
|
+
isBlurred?: boolean;
|
|
6
|
+
caretPosition?: Nullable<number>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* String format strategy abstract class
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class StringFormatStrategy {
|
|
12
|
+
/**
|
|
13
|
+
* Check if the {@link format} should be applied
|
|
14
|
+
*
|
|
15
|
+
* @param {FormatTrigger} triggeredBy - The trigger of the format
|
|
16
|
+
* @param {FormatTarget} target - The target of the format
|
|
17
|
+
* @param {InputStatus} inputStatus - The status of the input
|
|
18
|
+
* @returns {boolean} - Whether the format should be applied
|
|
19
|
+
*/
|
|
20
|
+
canFormat(triggeredBy: FormatTrigger, target: FormatTarget, inputStatus?: InputStatus): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Calculates the new caret position in a formatted input string if needed.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} input - The input string
|
|
25
|
+
* @param {number} caretPosition - The current position of caret
|
|
26
|
+
* @returns {number} The new position of caret
|
|
27
|
+
*/
|
|
28
|
+
calculateCaretPosition?(input: string, caretPosition: Nullable<number>): Nullable<number>;
|
|
29
|
+
/**
|
|
30
|
+
* Determines whether a component value should be overridden based on the mask configuration.
|
|
31
|
+
*
|
|
32
|
+
* @returns {boolean} - Whether the component value should be overridden.
|
|
33
|
+
*/
|
|
34
|
+
protected shouldOverrideComponentValueAfterBlur(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Determines whether the format should be triggered at init.
|
|
37
|
+
*
|
|
38
|
+
* @returns {boolean} - Whether the format should be triggered at init.
|
|
39
|
+
*/
|
|
40
|
+
protected shouldTriggerAtInit(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Format the input string
|
|
43
|
+
*
|
|
44
|
+
* @param {string} input - The input string
|
|
45
|
+
* @param {InputStatus} inputStatus - The timing status of the format
|
|
46
|
+
*/
|
|
47
|
+
abstract format(input: string, inputStatus?: InputStatus): string;
|
|
48
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from '../../../types/general';
|
|
2
|
-
import { StringFormatStrategy } from './string-format-strategy';
|
|
2
|
+
import { InputStatus, StringFormatStrategy } from './string-format-strategy.abstract';
|
|
3
3
|
export declare type MaskConfig = {
|
|
4
4
|
mask: string;
|
|
5
5
|
slot: string | RegExp;
|
|
@@ -13,7 +13,7 @@ export declare type MaskConfig = {
|
|
|
13
13
|
*
|
|
14
14
|
* @augments StringFormatStrategy
|
|
15
15
|
*/
|
|
16
|
-
export declare class StringMaskStrategy
|
|
16
|
+
export declare class StringMaskStrategy extends StringFormatStrategy {
|
|
17
17
|
static PHONE_MASK: StringMaskStrategy;
|
|
18
18
|
static ZIPCODE_MASK: StringMaskStrategy;
|
|
19
19
|
static TAX_ID_MASK: StringMaskStrategy;
|
|
@@ -39,13 +39,9 @@ export declare class StringMaskStrategy implements StringFormatStrategy {
|
|
|
39
39
|
*/
|
|
40
40
|
constructor(maskConfig: MaskConfig);
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @param {string} input - The input string that needs to be formatted.
|
|
45
|
-
* @param {number} caretPosition - The current position of caret
|
|
46
|
-
* @returns {string} The formatted string.
|
|
42
|
+
* @inheritDoc
|
|
47
43
|
*/
|
|
48
|
-
format(input: string,
|
|
44
|
+
format(input: string, inputStatus?: InputStatus): string;
|
|
49
45
|
/**
|
|
50
46
|
* Get the position of
|
|
51
47
|
*
|
|
@@ -60,7 +56,7 @@ export declare class StringMaskStrategy implements StringFormatStrategy {
|
|
|
60
56
|
* @returns {boolean} The result overrideValue controls whether the component value same as the internal input value after the input blur
|
|
61
57
|
* return false if property overrideValue is not exist or set to true, return false if maskConfig is not exist
|
|
62
58
|
*/
|
|
63
|
-
shouldOverrideComponentValueAfterBlur(): boolean;
|
|
59
|
+
protected shouldOverrideComponentValueAfterBlur(): boolean;
|
|
64
60
|
/**
|
|
65
61
|
* The function shouldTriggerAtInit returns true if the maskConfig is defined and its triggerAtInit
|
|
66
62
|
* property is set to true, otherwise it returns false.
|
|
@@ -69,7 +65,7 @@ export declare class StringMaskStrategy implements StringFormatStrategy {
|
|
|
69
65
|
* (this.maskConfig is truthy and this.maskConfig.triggerAtInit is true), it returns true. Otherwise,
|
|
70
66
|
* it returns false.
|
|
71
67
|
*/
|
|
72
|
-
shouldTriggerAtInit(): boolean;
|
|
68
|
+
protected shouldTriggerAtInit(): boolean;
|
|
73
69
|
/**
|
|
74
70
|
* Get the length limit by mask
|
|
75
71
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StringFormatStrategy } from './string-format-strategy';
|
|
1
|
+
import { StringFormatStrategy } from './string-format-strategy.abstract';
|
|
2
2
|
/**
|
|
3
3
|
* A class for formatting string with the "," as the thousand separator
|
|
4
4
|
*
|
|
5
5
|
* @augments StringFormatStrategy
|
|
6
6
|
*/
|
|
7
|
-
export declare class ThousandCommaStrategy
|
|
7
|
+
export declare class ThousandCommaStrategy extends StringFormatStrategy {
|
|
8
8
|
/**
|
|
9
9
|
* If the input is a number, format it as a string
|
|
10
10
|
*
|
|
@@ -5,6 +5,7 @@ import { VegaPublicAPIRuntimeMetricsSlimmerBase } from '../slimmers/runtime-metr
|
|
|
5
5
|
* Vega loader controller to control the loading indicator
|
|
6
6
|
*/
|
|
7
7
|
declare class VegaLoaderController {
|
|
8
|
+
private static readonly SPECIAL_ELEMENT_TO_WRAP_FULL_BODY;
|
|
8
9
|
protected vegaPublicAPIRuntimeMetricsSlimmer: VegaPublicAPIRuntimeMetricsSlimmerBase;
|
|
9
10
|
/**
|
|
10
11
|
* Create a loading indicator and append it to the container
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VegaSlimmer } from '../../vega-slimmer/vega-slimmer-core';
|
|
2
|
-
import { StringFormatStrategy } from '../formatter/string-formatter/string-format-strategy';
|
|
2
|
+
import { StringFormatStrategy } from '../formatter/string-formatter/string-format-strategy.abstract';
|
|
3
3
|
import { Nullable } from '../../types/general';
|
|
4
4
|
/** The `StringInputFormatterSlimmer` class in TypeScript is used to format input values based on specified strategies and handle events like keydown, blur, and focus. */
|
|
5
5
|
export declare abstract class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
@@ -34,7 +34,7 @@ export declare abstract class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
34
34
|
*/
|
|
35
35
|
private onFocus;
|
|
36
36
|
/**
|
|
37
|
-
* A function
|
|
37
|
+
* A function updates the value of the input element by inputFormatStrategy output.
|
|
38
38
|
*
|
|
39
39
|
* @param {InputEvent} e - blur event
|
|
40
40
|
*/
|
|
@@ -49,7 +49,7 @@ export declare abstract class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
49
49
|
*/
|
|
50
50
|
private isOnFocus;
|
|
51
51
|
/**
|
|
52
|
-
* A function
|
|
52
|
+
* A function updates the value of the input element by inputFormatStrategy output.
|
|
53
53
|
*
|
|
54
54
|
* @param {InputEvent} e - input event
|
|
55
55
|
*/
|
|
@@ -66,7 +66,14 @@ export declare abstract class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
66
66
|
* @param {string} rawValue - the original value
|
|
67
67
|
* @param {string} maskedValue - masked value
|
|
68
68
|
*/
|
|
69
|
-
private
|
|
69
|
+
private updateNativeInputValue;
|
|
70
|
+
/**
|
|
71
|
+
* Update the host value
|
|
72
|
+
*
|
|
73
|
+
* @param {string} rawValue - the original value
|
|
74
|
+
* @param {string} maskedValue - the masked value
|
|
75
|
+
*/
|
|
76
|
+
private updateComponentValue;
|
|
70
77
|
/**
|
|
71
78
|
* Updated the input caret position after the mask format
|
|
72
79
|
*
|
|
@@ -74,4 +81,13 @@ export declare abstract class StringInputFormatterSlimmer extends VegaSlimmer {
|
|
|
74
81
|
* @param {Nullable<number>} caretPosition - The current input caret position
|
|
75
82
|
*/
|
|
76
83
|
private updateInputCaretPosition;
|
|
84
|
+
/**
|
|
85
|
+
* Format the value based on the input and blur format strategies.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} rawValue - The original input value
|
|
88
|
+
* @param {FormatTrigger} triggeredBy - The trigger of the format
|
|
89
|
+
* @param {{ caretPosition?: number }} options - The options for the format
|
|
90
|
+
* @param {number} options.caretPosition - The current input caret position
|
|
91
|
+
*/
|
|
92
|
+
private formatValue;
|
|
77
93
|
}
|
package/dist/vega/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getCurrentBreakpoint}from"./p-4bcd6612.js";export{L as LogUtility,s as setVegaLogLevel}from"./p-6e1ab235.js";export{d as formatAndValidBackgroundColor,e as formatAndValidBorderColor,g as formatAndValidBorderRadius,c as formatAndValidBreakpointSize,a as formatAndValidGap,h as formatAndValidPadding,f as formatAndValidResponsiveToken,b as formatAndValidShadow,i as formatAndValidTextColor}from"./p-666cd80f.js";export{c as camelToDashCase}from"./p-0bb29d98.js";export{d as BackgroundColorMap,a as BackgroundColors,e as BorderColorMap,b as BorderColors,B as BorderRadius,C as Colors,F as FillBackgroundColors,g as ShadowMap,f as Shadows,h as Spacing,S as StrokeBackgroundColors,c as TextColorMap,T as TextColors}from"./p-b1f65b13.js";export{B as Breakpoints}from"./p-ed45b3b6.js";export{I as Icons,g as getIconFromToken}from"./p-16493e5b.js";export{b as Typography,a as TypographyKeys,T as TypographyUrls}from"./p-d884c644.js";export{e as BoxDisplay,B as BreakpointKeys,C as CssStates,F as FlexDirections}from"./p-74168615.js";export{F as FrameworkEnum,v as VegaEnvManager}from"./p-5f377954.js";export{b as VegaEventManager,V as VegaLoader,a as VegaNotify,d as VegaSkeletonLoader,c as VegaZIndexManager}from"./p-
|
|
1
|
+
export{g as getCurrentBreakpoint}from"./p-4bcd6612.js";export{L as LogUtility,s as setVegaLogLevel}from"./p-6e1ab235.js";export{d as formatAndValidBackgroundColor,e as formatAndValidBorderColor,g as formatAndValidBorderRadius,c as formatAndValidBreakpointSize,a as formatAndValidGap,h as formatAndValidPadding,f as formatAndValidResponsiveToken,b as formatAndValidShadow,i as formatAndValidTextColor}from"./p-666cd80f.js";export{c as camelToDashCase}from"./p-0bb29d98.js";export{d as BackgroundColorMap,a as BackgroundColors,e as BorderColorMap,b as BorderColors,B as BorderRadius,C as Colors,F as FillBackgroundColors,g as ShadowMap,f as Shadows,h as Spacing,S as StrokeBackgroundColors,c as TextColorMap,T as TextColors}from"./p-b1f65b13.js";export{B as Breakpoints}from"./p-ed45b3b6.js";export{I as Icons,g as getIconFromToken}from"./p-16493e5b.js";export{b as Typography,a as TypographyKeys,T as TypographyUrls}from"./p-d884c644.js";export{e as BoxDisplay,B as BreakpointKeys,C as CssStates,F as FlexDirections}from"./p-74168615.js";export{F as FrameworkEnum,v as VegaEnvManager}from"./p-5f377954.js";export{b as VegaEventManager,V as VegaLoader,a as VegaNotify,d as VegaSkeletonLoader,c as VegaZIndexManager}from"./p-76a8ccbb.js";export{F as FeatureFlag}from"./p-ff4bafa3.js";export{M as ModifyContentAction,R as RTENode,V as VegaThemeManager}from"./p-0461e318.js";export{V as VegaDialog}from"./p-149d2801.js";export{B as VegaJQueryDelegatedEventStrategy}from"./p-1b860f90.js";export{V as VegaIconManager}from"./p-032df16f.js";export{V as ValidCreditCardNumberRule}from"./p-74958b1a.js";export{w as waitForVega}from"./p-f86ec91b.js";export{a as VegaTranslation,s as VegaTranslationResourceEN}from"./p-483c483a.js";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"./p-52a8a4f8.js";export{G as GridColumns,a as GridRows}from"./p-7f2441d6.js";import"./p-2205ee4c.js";import"./p-3a0a4d15.js";import"./p-33b62194.js";import"./p-6a334573.js";import"./p-79ec5d69.js";import"./p-781fd6e0.js";import"./p-262ec334.js";import"./p-5f589974.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-5dce8dfe.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-7c37e5bb.js";import"./p-348e95ba.js";import"./p-0c667d6a.js";const o=["ring-input-focus","dark-ring-input-focus","ring-input-danger-focus","dark-ring-input-danger-focus","ring-action-focus","dark-ring-action-focus","ring-action-danger-focus","dark-ring-action-danger-focus"];export{o as Rings}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as s}from"./p-ff4bafa3.js";import{V as o,a as t,b as a,c as l,d as i}from"./p-
|
|
1
|
+
import{F as s}from"./p-ff4bafa3.js";import{V as o,a as t,b as a,c as l,d as i}from"./p-76a8ccbb.js";import{V as c}from"./p-0461e318.js";import{M as e,V as n,s as r,G as f}from"./p-6e1ab235.js";import{V as p}from"./p-149d2801.js";import{v as b}from"./p-5f377954.js";import{V as h}from"./p-032df16f.js";import{w as m}from"./p-f86ec91b.js";import"./p-79ec5d69.js";import{V as d,a as T,s as u}from"./p-483c483a.js";import{T as j}from"./p-d884c644.js";import{V as g}from"./p-74958b1a.js";import{V as C}from"./p-52a8a4f8.js";import{U as O}from"./p-5dce8dfe.js";import{C as E}from"./p-2d0d575f.js";import{O as _}from"./p-331a62d5.js";import{f as R}from"./p-1c298d5a.js";var V=function(s,o,t,a){var l,i=arguments.length,c=i<3?o:null===a?a=Object.getOwnPropertyDescriptor(o,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(s,o,t,a);else for(var e=s.length-1;e>=0;e--)(l=s[e])&&(c=(i<3?l(c):i>3?l(o,t,c):l(o,t))||c);return i>3&&c&&Object.defineProperty(o,t,c),c};class A extends n{constructor(o){super(),this.originalWatchers=new Map,this.hasDisconnected=!1,this.isEnabled=s.isEnabled("VEGA_REACT.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD")&&s.isEnabled("VEGA_FRAMEWORK.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD"),this.component=o.component}connectedCallback(){if(!this.isEnabled)return;if(this.hasDisconnected)return;const s=this.component.constructor.watchers;for(const o in s)s[o].forEach((s=>{this.originalWatchers.has(s)||(this.originalWatchers.set(s,this.component[s]),this.component[s]=function(){})}))}disconnectedCallback(){this.isEnabled&&(this.hasDisconnected=!0)}componentDidLoad(){this.isEnabled&&this.originalWatchers.forEach(((s,o)=>{const t=s;this.component[o]=function(...s){return t.apply(this,s)}}))}}V([e("connectedCallback")],A.prototype,"connectedCallback",null),V([e("disconnectedCallback")],A.prototype,"disconnectedCallback",null),V([e("componentDidLoad")],A.prototype,"componentDidLoad",null);class k extends n{constructor(s){super(),this.component=s.component}connectedCallback(){const s=new _(this.isAcceptable.bind(this),(()=>{R(this.component)}));E.register(O,s)}isAcceptable(){var s;const o=this.component.host;return null===(s=d.getConnectedComponents().get(o.tagName))||void 0===s?void 0:s.has(o)}}!function(s,o,t,a){var l,i=arguments.length,c=i<3?o:null===a?a=Object.getOwnPropertyDescriptor(o,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(s,o,t,a);else for(var e=s.length-1;e>=0;e--)(l=s[e])&&(c=(i<3?l(c):i>3?l(o,t,c):l(o,t))||c);i>3&&c&&Object.defineProperty(o,t,c)}([e("connectedCallback")],k.prototype,"connectedCallback",null);const v=function(){globalThis.VegaDisabledFeatureKeys&&s.disable(...globalThis.VegaDisabledFeatureKeys),globalThis.VegaEnabledFeatureKeys&&s.enable(...globalThis.VegaEnabledFeatureKeys),globalThis.VegaLoader=o,globalThis.VegaNotify=t,globalThis.VegaThemeManager=c,globalThis.setVegaLogLevel=r,globalThis.VegaDialog=p,f.register([A,k]),globalThis.VegaEventManager=a,Object.keys(j).forEach((s=>{const{url:o}=j[s],t="vega-typography-"+s;if(!document.querySelector("#"+t)){const s=document.createElement("link");s.id=t,s.href=o,s.rel="stylesheet",document.head.append(s)}})),globalThis.VegaIconManager=h,globalThis.VegaZIndexManager=l,globalThis.ValidCreditCardNumberRule=g,globalThis.VegaEnvInfo=b.getVegaEnv(),import("./p-7a40e033.js").then((o=>{o.default.init(s)})),globalThis.waitForVega=m,globalThis.VegaSkeletonLoader=i,globalThis.VegaTranslation=T,globalThis.VegaTranslationResourceEN=u,globalThis.VegaRTEContent=C};export{v as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t}from"./p-b1f65b13.js";import{c as i,M as s,V as e}from"./p-6e1ab235.js";import{C as n}from"./p-2d0d575f.js";import{d as r}from"./p-7c37e5bb.js";import{a as h}from"./p-348e95ba.js";import{a as o}from"./p-f86ec91b.js";class u{canFormat(i,s,e){if("init"===i){if("component"===s&&t(null==e?void 0:e.isBlurred))return!1;if(this.shouldTriggerAtInit())return!0}if("input"===i&&"native-input"===s)return!0;if("blur"===i&&(null==e?void 0:e.isBlurred)){if("component"===s&&this.shouldOverrideComponentValueAfterBlur())return!0;if("native-input"===s)return!0}return!1}shouldOverrideComponentValueAfterBlur(){return!1}shouldTriggerAtInit(){return!1}}class a extends u{constructor(t){super(),this.insertMode=!0,this.maskConfig=t,this.slotRegex=new RegExp(t.slot),this.acceptRegex=new RegExp(t.accept,"g"),this.insertMode=!1!==t.insertMode}format(i,s){const e=null==s?void 0:s.caretPosition;if(i.length>this.getLengthLimit()&&t(e)){const t=[...i],s=i.length-this.getLengthLimit();return t.splice(e-s,s),t.join("")}return this.replaceMaskWithMatchedInputSlots(i,this.getMatchedInputSlotValue(i))}calculateCaretPosition(i,s){if(!t(s))return null;if(i.length>this.getLengthLimit())return s-(i.length-this.getLengthLimit());const e=i.substring(0,s);return s+(this.format(e).length-e.length)}shouldOverrideComponentValueAfterBlur(){return!(!this.maskConfig||!0!==this.maskConfig.overrideValue)}shouldTriggerAtInit(){return!(!this.maskConfig||!0!==this.maskConfig.triggerAtInit)}getLengthLimit(){return this.maskConfig.mask.length}getMatchedInputSlotValue(t){return t.match(this.acceptRegex)||[]}replaceMaskWithMatchedInputSlots(t,i){const s=[];let e=-1;for(let n=0;n<this.maskConfig.mask.length;n++){const r=this.maskConfig.mask.charAt(n);if(this.slotRegex.test(r)&&i.length){const t=i.shift();t&&(s.push(t),e=n)}else this.insertMode||i.shift(),t.charAt(n)===r&&(e=n),s.push(r)}const n=this.insertMode?e+1:t.length;return s.join("").slice(0,n)}}a.PHONE_MASK=new a({mask:"(999) 999-9999",slot:"9",accept:/\d/g}),a.ZIPCODE_MASK=new a({mask:"99999",slot:"9",accept:/\d/g}),a.TAX_ID_MASK=new a({mask:"99-9999999",slot:"9",accept:/\d/g});var c=function(t,i,s,e){var n,r=arguments.length,h=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,i,s,e);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(h=(r<3?n(h):r>3?n(i,s,h):n(i,s))||h);return r>3&&h&&Object.defineProperty(i,s,h),h};class p extends e{constructor(){super(...arguments),this.onFocus=t=>{if(this.host&&this.host.value){const i=this.host.value;t.target.value!==i&&(this.inputElement.value=i)}},this.onBlur=t=>{this.blurFormatStrategy&&this.formatValue(t.target.value,"blur")},this.onKeyDown=t=>{const i=t.target,s=i.value,e=i.selectionStart;this.inputFormatStrategy&&(this.formatValue(s.replace(/\s/g,""),"input",{caretPosition:"insertFromPaste"===t.inputType?void 0:e}),this.updateInputCaretPosition(s,e))},this.onPaste=t=>{this.disableCopyPaste&&t.preventDefault()}}componentDidRender(){n.notify(r.getSubject(this.host,h),{})}setup(){this.destroy();const t=this.getInputElementRef();t&&(this.inputElement=t,this.inputFormatStrategy=this.getInputModeStrategy(),this.blurFormatStrategy=this.getBlurModeStrategy(),this.formatValueAfterSetup(),this.inputFormatStrategy&&(this.inputElement.addEventListener("input",this.onKeyDown,{capture:!0}),this.inputElement.addEventListener("paste",this.onPaste,{capture:!0})),this.blurFormatStrategy&&(this.inputElement.addEventListener("blur",this.onBlur,{capture:!0}),this.inputElement.addEventListener("focus",this.onFocus,{capture:!0})))}destroy(){this.inputElement&&(this.inputFormatStrategy&&(this.inputElement.removeEventListener("input",this.onKeyDown,{capture:!0}),this.inputElement.removeEventListener("paste",this.onPaste,{capture:!0})),this.blurFormatStrategy&&(this.inputElement.removeEventListener("blur",this.onBlur,{capture:!0}),this.inputElement.removeEventListener("focus",this.onFocus,{capture:!0})))}formatValueAfterSetup(){o(this.host).then((()=>{this.formatValue(this.inputElement.value,"init")}))}isOnFocus(){return this.inputElement.matches(":focus")}updateNativeInputValue(t,i){i!==t&&(this.inputElement.value=i)}updateComponentValue(t,i){i!==t&&(this.host.value=i)}updateInputCaretPosition(i,s){var e,n,r;const h=null!==(r=null===(n=(e=this.inputFormatStrategy).calculateCaretPosition)||void 0===n?void 0:n.call(e,i,s))&&void 0!==r?r:s;t(h)&&this.inputElement.setSelectionRange(h,h)}formatValue(t,i,s){const e=!this.isOnFocus(),n=null==s?void 0:s.caretPosition;if(this.inputFormatStrategy){if(this.inputFormatStrategy.canFormat(i,"component")){const i=this.inputFormatStrategy.format(t);this.updateComponentValue(t,i)}if(this.inputFormatStrategy.canFormat(i,"native-input")){const i=this.inputFormatStrategy.format(t,{caretPosition:n});this.updateNativeInputValue(t,i)}}if(this.blurFormatStrategy&&e){if(this.blurFormatStrategy.canFormat(i,"component",{isBlurred:e})){const i=this.blurFormatStrategy.format(t);this.updateComponentValue(t,i)}if(this.blurFormatStrategy.canFormat(i,"native-input",{isBlurred:e})){const i=this.blurFormatStrategy.format(t);this.updateNativeInputValue(t,i)}}}}c([i()],p.prototype,"host",void 0),c([s("componentDidRender")],p.prototype,"componentDidRender",null);export{u as S,p as a,a as b}
|
package/dist/vega/p-5f377954.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.37.
|
|
1
|
+
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.37.2",this.framework=t.VanillaJs}getVegaEnv(){return{version:this.vegaVersion,framework:this.framework}}setVegaFramework(t){this.framework=t}};export{t as F,s as v}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e,c as t,g as a}from"./p-33b62194.js";import{a as o,g as n,D as i}from"./p-79ec5d69.js";import{L as c,I as l}from"./p-6e1ab235.js";import{I as s}from"./p-781fd6e0.js";import{c as r}from"./p-6a334573.js";import{P as d}from"./p-5f589974.js";import{i as p}from"./p-1b860f90.js";const u=[{payloadKey:"IS_LOAD_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaLoaderController is called",canAccept:(e,t)=>"VegaLoaderController"===e&&"load"===t,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaLoaderController is called",canAccept:(e,t)=>"VegaLoaderController"===e&&"close"===t,payloadValue:()=>!0}];class y{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=t(y,["load","close"],u)}load(e={}){let t=e.containerSelector||"body",a=document.querySelector(t);if(a&&y.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY.includes(a.tagName)&&(t="body",a=document.querySelector("body")),!a)return c.error("Container is not found by selector: ",t),null;const o=this.createLoadingIndicator(e.indicatorOptions),n=this.createLoader(t);return n.append(o),this.appendLoader(n,a)}close(e){const t=this.findLoader(e);if(t){if(t.dataset.container){const e=document.querySelector(t.dataset.container);e&&e.dataset.vegaLoaderOriginPosition&&(e.style.position=e.dataset.vegaLoaderOriginPosition)}t.remove()}}findLoader(e){var t,a;let o;if(e.includes(">>>")){const[n,i]=e.split(">>>");o=null===(a=null===(t=document.querySelector(n))||void 0===t?void 0:t.shadowRoot)||void 0===a?void 0:a.getElementById(i)}else o=document.getElementById(e);return o}createLoader(e){const t=document.createElement("vega-loader-wrapper");return t.className=o(["body"===e?"fixed-wrapper":"absolute-wrapper"]),t.dataset.container=e,t.id=`vega-loader-${a()}`,t}createLoadingIndicator(e={}){const t=document.createElement("vega-loading-indicator");return Object.assign(t,e),t}appendLoader(e,t){return t.dataset.vegaLoaderOriginPosition=t.style.position,t.style.position="relative",t.shadowRoot?(t.shadowRoot.append(e),`${e.dataset.container}>>>${e.id}`):(t.append(e),e.id)}}y.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY=["VEGA-MODAL"],function(e,t,a,o){var n,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,a,o);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(c=(i<3?n(c):i>3?n(t,a,c):n(t,a))||c);i>3&&c&&Object.defineProperty(t,a,c)}([e()],y.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const f=new y,g=[{payloadKey:"IS_OPEN_METHOD_CALLED",payloadDescription:"Indicate if the method open of public API VegaNotifyController is called",canAccept:(e,t)=>"VegaNotifyController"===e&&"open"===t,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaNotifyController is called",canAccept:(e,t)=>"VegaNotifyController"===e&&"close"===t,payloadValue:()=>!0},{payloadKey:"IS_CLOSEALL_METHOD_CALLED",payloadDescription:"Indicate if the method closeAll of public API VegaNotifyController is called",canAccept:(e,t)=>"VegaNotifyController"===e&&"closeAll"===t,payloadValue:()=>!0}];var v=function(e,t,a,o){var n,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,a,o);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(c=(i<3?n(c):i>3?n(t,a,c):n(t,a))||c);return i>3&&c&&Object.defineProperty(t,a,c),c};class h{constructor(){this.resizeObserverSlimmer=r(h,d,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:e=>{var t;!(e[0].contentRect.height>0)&&(null===(t=this.container)||void 0===t?void 0:t.classList.contains("hydrated"))&&(s.removeZIndex(this.container,"top"),this.container.remove(),this.container=null)},target:()=>this.container}]),this.vegaPublicAPIRuntimeMetricsSlimmer=t(h,["open","close","closeAll"],g)}async open(e){const t=this.createPageNotification(e);return this.getContainer().append(t),t.id}async closeAll(){this.container&&Array.from(this.container.children).forEach((e=>{e.close()}))}async close(e){await document.getElementById(e).close()}connectResizeObserver(){}createPageNotification(e){const t=document.createElement("vega-page-notification");return Object.keys(e).forEach((a=>{void 0!==e[a]&&(t[a]=e[a])})),t.style.marginBottom=n()===i.MOBILE?"12px":"16px",t.id=`vega-page-notification-${a()}`,t}getContainer(){return this.container||(this.container=document.createElement("vega-page-notification-list"),s.setZIndex(this.container,"top"),n()===i.MOBILE?this.container.classList.add("vega-page-notification-list-bottom"):this.container.classList.add("vega-page-notification-list-topRight"),document.body.append(this.container),this.connectResizeObserver()),this.container}}v([l()],h.prototype,"resizeObserverSlimmer",void 0),v([e()],h.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const m=new h,I=[{payloadKey:"IS_SETSEMANTICS_METHOD_CALLED",payloadDescription:"Indicate if the method setSemantics of public API VegaEventManager is called",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:()=>!0},{payloadKey:"IS_GETSEMANTICS_METHOD_CALLED",payloadDescription:"Indicate if the method getSemantics of public API VegaEventManager is called",canAccept:(e,t)=>"VegaEventManager"===e&&"getSemantics"===t,payloadValue:()=>!0},{payloadKey:"IS_GETENABLEDEVENTIDSBYCOMPONENT_METHOD_CALLED",payloadDescription:"Indicate if the method getEnabledEventIdsByComponent of public API VegaEventManager is called",canAccept:(e,t)=>"VegaEventManager"===e&&"getEnabledEventIdsByComponent"===t,payloadValue:()=>!0},{payloadKey:"globalEventIsNative",payloadDescription:"Indicate if the vega components will emit events without the vega prefix",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:e=>!(!e.global||"native"!==e.global.namespace)},{payloadKey:"eventOfSpecificComponentsIsNative",payloadDescription:"Indicate if the vega components will emit events with the vega prefix, but special components will emit events without vega prefix",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:e=>{const t=e;if(t.components){const e=Object.keys(t.components);return!!(e.length>0&&"native"===t.components[e[0]].namespace)}return!1}},{payloadKey:"eventOfSpecificComponentsIsVega",payloadDescription:"Indicate if the vega components will emit events without the vega prefix, but special components will emit events with vega prefix",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:e=>{const t=e;if(t.global&&t.components){const e=Object.keys(t.components);return!!("native"===t.global.namespace&&e.length>0&&"vega"===t.components[e[0]].namespace)}return!1}},{payloadKey:"globalJqueryDelegatedEventIsTrue",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:e=>!(!e.global||!0!==e.global.jqueryDelegatedEvent)},{payloadKey:"jqueryDelegatedEventIsCustomStrategy",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:e=>{const t=e;return!!(t.global&&Array.isArray(t.global.jqueryDelegatedEvent)&&t.global.jqueryDelegatedEvent.length>0)}},{payloadKey:"jqueryDelegatedEventOfSpecialComponentsIsTrue",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(e,t)=>"VegaEventManager"===e&&"setSemantics"===t,payloadValue:e=>{const t=e;if(t.components){const e=Object.keys(t.components);return!!(e.length>0&&!0===t.components[e[0]].jqueryDelegatedEvent)}return!1}}];class A{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=t(A,["setSemantics","getSemantics","getEnabledEventIdsByComponent"],I)}setSemantics(e){p.setSemantics(e)}getSemantics(e){return p.getSemantics(e)}getEnabledEventIdsByComponent(e){return p.getEnabledEventIdsByComponent(e)}}!function(e,t,a,o){var n,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,a,o);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(c=(i<3?n(c):i>3?n(t,a,c):n(t,a))||c);i>3&&c&&Object.defineProperty(t,a,c)}([e()],A.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const E=new A,b=[{payloadKey:"IS_OVERRIDEZINDEXBASICVALUES_METHOD_CALLED",payloadDescription:"Indicate if the method overrideZIndexBasicValues of public API ZIndexManager is called",canAccept:(e,t)=>"VegaZIndexManager"===e&&"overrideZIndexBasicValues"===t,payloadValue:()=>!0},{payloadKey:"zIndexBasicValuesGreatThanTenThousand",payloadDescription:"Indicate if the basic z-index value is great than ten thousand",canAccept:(e,t)=>"VegaZIndexManager"===e&&"overrideZIndexBasicValues"===t,payloadValue:e=>e.base>1e4}];class L{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=t(L,["overrideZIndexBasicValues"],b)}overrideZIndexBasicValues(e){s.overrideZIndexBasicValues(e)}}!function(e,t,a,o){var n,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,a,o);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(c=(i<3?n(c):i>3?n(t,a,c):n(t,a))||c);i>3&&c&&Object.defineProperty(t,a,c)}([e()],L.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const V=new L,D=[{payloadKey:"IS_LOAD_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaSkeletonLoaderController is called",canAccept:(e,t)=>"VegaSkeletonLoaderController"===e&&"load"===t,payloadValue:()=>!0},{payloadKey:"IS_UNLOAD_METHOD_CALLED",payloadDescription:"Indicate if the method unLoad of public API VegaSkeletonLoaderController is called",canAccept:(e,t)=>"VegaSkeletonLoaderController"===e&&"unLoad"===t,payloadValue:()=>!0},{payloadKey:"IS_UNLOADALL_METHOD_CALLED",payloadDescription:"Indicate if the method unLoadAll of public API VegaSkeletonLoaderController is called",canAccept:(e,t)=>"VegaSkeletonLoaderController"===e&&"unLoadAll"===t,payloadValue:()=>!0}];class S{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=t(S,["load","unLoad","unLoadAll"],D),this.loaderMap=new Map}load({target:e,type:t="text",width:o,height:n,items:i,layout:c}){const l=Array.from(document.body.querySelectorAll(e)),s=`vega-skeleton-loader-${a()}`,r=[];return l.forEach((e=>{const a=i?i.map(this.createSkeleton):[this.createSkeleton({type:t,width:o,height:n})],l=(c?[this.wrapLayout(a,c)]:a).map((e=>(e.dataset[S.LOADER_DATA_SET_KEY]=s,e)));r.push(...l),e.append(...l)})),this.loaderMap.set(s,r),s}unLoad(e){this.loaderMap.has(e)&&(this.loaderMap.get(e).forEach((e=>e.remove())),this.loaderMap.delete(e))}unLoadAll(){for(const e of this.loaderMap.values())e.forEach((e=>e.remove()));this.loaderMap.clear()}createSkeleton(e){const{type:t,width:a,height:o}=e,n=document.createElement("vega-skeleton");return Object.assign(n,{animated:!0,type:t,width:a,height:o}),n}wrapLayout(e,t){const a=document.createElement("vega-flex");return Object.assign(a,Object.assign({className:"vega-skeleton-loader-template-container"},t.props)),Object.assign(a.style,t.style),a.append(...e),a}}S.LOADER_DATA_SET_KEY="vegaSkeletonLoaderKey",function(e,t,a,o){var n,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,a,o);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(c=(i<3?n(c):i>3?n(t,a,c):n(t,a))||c);i>3&&c&&Object.defineProperty(t,a,c)}([e()],S.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const O=new S;export{f as V,m as a,E as b,V as c,O as d}
|