@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-77369.0 → 0.0.0-bugfix-dev-KB-77126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{DataBinder-aff1dcc7.js → DataBinder-3b083480.js} +1 -1
- package/dist/cjs/ez-chart.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
- package/dist/cjs/ez-form.cjs.entry.js +2 -1
- package/dist/cjs/ez-grid.cjs.entry.js +14425 -70514
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +41 -4
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +28 -11
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +5 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +1 -1
- package/dist/collection/components/ez-grid/ez-grid.js +7 -2
- package/dist/collection/components/ez-modal/ez-modal.css +0 -4
- package/dist/collection/components/ez-modal/ez-modal.js +2 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +59 -4
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
- package/dist/custom-elements/index.js +12597 -68648
- package/dist/esm/{DataBinder-bd240826.js → DataBinder-02fa9bb9.js} +1 -1
- package/dist/esm/ez-chart.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +2 -2
- package/dist/esm/ez-form.entry.js +2 -1
- package/dist/esm/ez-grid.entry.js +14425 -70514
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +41 -4
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-2aa8e4b2.entry.js +1 -0
- package/dist/ezui/p-8d0f02c7.entry.js +309 -0
- package/dist/ezui/{p-7bfae0fc.entry.js → p-91266ddd.entry.js} +1 -1
- package/dist/ezui/p-a5b91a77.entry.js +1 -0
- package/dist/ezui/p-abce5219.entry.js +1 -0
- package/dist/ezui/p-c27b2e17.entry.js +1 -0
- package/dist/ezui/p-cd2e78f0.entry.js +1 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -2
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
- package/dist/types/components.d.ts +10 -2
- package/package.json +11 -4
- package/dist/ezui/p-03a2c7d1.entry.js +0 -1
- package/dist/ezui/p-5b205c80.entry.js +0 -1
- package/dist/ezui/p-9ceefe4d.entry.js +0 -1
- package/dist/ezui/p-b0a5c2cd.entry.js +0 -304
- package/dist/ezui/p-cdc472cc.entry.js +0 -1
- package/dist/ezui/p-fec696ab.entry.js +0 -1
- /package/dist/ezui/{p-81f06699.js → p-455e737c.js} +0 -0
|
@@ -7,6 +7,7 @@ export class EzTextInput {
|
|
|
7
7
|
this.enabled = true;
|
|
8
8
|
this.errorMessage = undefined;
|
|
9
9
|
this.mask = undefined;
|
|
10
|
+
this.cleanValueMask = false;
|
|
10
11
|
this.canShowError = true;
|
|
11
12
|
this.restrict = undefined;
|
|
12
13
|
this.mode = "regular";
|
|
@@ -122,7 +123,12 @@ export class EzTextInput {
|
|
|
122
123
|
const value = this._inputElem.value;
|
|
123
124
|
if (value && this._maskFormatter) {
|
|
124
125
|
try {
|
|
125
|
-
|
|
126
|
+
if (this.cleanValueMask) {
|
|
127
|
+
this.applyMask(value);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this._inputElem.value = this._maskFormatter.format(value);
|
|
131
|
+
}
|
|
126
132
|
}
|
|
127
133
|
catch (e) {
|
|
128
134
|
this.errorMessage = e.message;
|
|
@@ -140,8 +146,34 @@ export class EzTextInput {
|
|
|
140
146
|
}
|
|
141
147
|
controlChangeValue() {
|
|
142
148
|
if (this._inputElem && (this.value || '') !== this._inputElem.value) {
|
|
143
|
-
this.
|
|
149
|
+
if (this.cleanValueMask) {
|
|
150
|
+
this.value = this._maskFormatter.removeMask(this._inputElem.value);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.value = this._inputElem.value;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
applyMask(value) {
|
|
158
|
+
if (!value || value === "")
|
|
159
|
+
return value;
|
|
160
|
+
if (this._maskFormatter) {
|
|
161
|
+
try {
|
|
162
|
+
const formattedValue = this._maskFormatter.applyMask(this._maskFormatter.removeMask(value));
|
|
163
|
+
if (this._inputElem) {
|
|
164
|
+
this._inputElem.value = formattedValue;
|
|
165
|
+
return this._inputElem.value;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.value = formattedValue;
|
|
169
|
+
return this.value;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
this.errorMessage = e.message;
|
|
174
|
+
}
|
|
144
175
|
}
|
|
176
|
+
return value;
|
|
145
177
|
}
|
|
146
178
|
handleChange() {
|
|
147
179
|
if (!this._inputElem) {
|
|
@@ -217,7 +249,12 @@ export class EzTextInput {
|
|
|
217
249
|
if (this.value) {
|
|
218
250
|
if (this._maskFormatter) {
|
|
219
251
|
try {
|
|
220
|
-
|
|
252
|
+
if (this.cleanValueMask) {
|
|
253
|
+
this.applyMask(this.value);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this.value = this._maskFormatter.format(this.value);
|
|
257
|
+
}
|
|
221
258
|
}
|
|
222
259
|
catch (e) {
|
|
223
260
|
this.errorMessage = e.message;
|
|
@@ -233,7 +270,7 @@ export class EzTextInput {
|
|
|
233
270
|
ElementIDUtils.addIDInfoIfNotExists(this._hostElement, 'input');
|
|
234
271
|
return (h(Host, { style: this._hostElement.classList.contains("grid_editor") ? { "height": "100%" } : null }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
235
272
|
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
236
|
-
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
273
|
+
: null, h("input", { "data-element-id": ElementIDUtils.getInternalIDInfo("input"), onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: this.password ? "password" : "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.mask && this.cleanValueMask ? this.applyMask(this.value) : this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
237
274
|
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage, "data-element-id": ElementIDUtils.getInternalIDInfo("message_box") }, this.errorMessage)));
|
|
238
275
|
}
|
|
239
276
|
static get is() { return "ez-text-input"; }
|
|
@@ -336,6 +373,24 @@ export class EzTextInput {
|
|
|
336
373
|
"attribute": "mask",
|
|
337
374
|
"reflect": false
|
|
338
375
|
},
|
|
376
|
+
"cleanValueMask": {
|
|
377
|
+
"type": "boolean",
|
|
378
|
+
"mutable": false,
|
|
379
|
+
"complexType": {
|
|
380
|
+
"original": "boolean",
|
|
381
|
+
"resolved": "boolean",
|
|
382
|
+
"references": {}
|
|
383
|
+
},
|
|
384
|
+
"required": false,
|
|
385
|
+
"optional": false,
|
|
386
|
+
"docs": {
|
|
387
|
+
"tags": [],
|
|
388
|
+
"text": "Para remover a m\u00E1scara quando fizer um apply no formul\u00E1rio."
|
|
389
|
+
},
|
|
390
|
+
"attribute": "clean-value-mask",
|
|
391
|
+
"reflect": false,
|
|
392
|
+
"defaultValue": "false"
|
|
393
|
+
},
|
|
339
394
|
"canShowError": {
|
|
340
395
|
"type": "boolean",
|
|
341
396
|
"mutable": false,
|