@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.
Files changed (65) hide show
  1. package/dist/cjs/{DataBinder-aff1dcc7.js → DataBinder-3b083480.js} +1 -1
  2. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
  5. package/dist/cjs/ez-form.cjs.entry.js +2 -1
  6. package/dist/cjs/ez-grid.cjs.entry.js +14425 -70514
  7. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-text-input.cjs.entry.js +41 -4
  9. package/dist/cjs/ezui.cjs.js +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
  12. package/dist/collection/components/ez-form/ez-form.js +1 -0
  13. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
  14. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +28 -11
  15. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +5 -0
  16. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +1 -1
  17. package/dist/collection/components/ez-grid/ez-grid.js +7 -2
  18. package/dist/collection/components/ez-modal/ez-modal.css +0 -4
  19. package/dist/collection/components/ez-modal/ez-modal.js +2 -2
  20. package/dist/collection/components/ez-text-input/ez-text-input.js +59 -4
  21. package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
  22. package/dist/custom-elements/index.js +12597 -68648
  23. package/dist/esm/{DataBinder-bd240826.js → DataBinder-02fa9bb9.js} +1 -1
  24. package/dist/esm/ez-chart.entry.js +1 -1
  25. package/dist/esm/ez-dialog.entry.js +1 -1
  26. package/dist/esm/ez-form-view.entry.js +2 -2
  27. package/dist/esm/ez-form.entry.js +2 -1
  28. package/dist/esm/ez-grid.entry.js +14425 -70514
  29. package/dist/esm/ez-modal.entry.js +1 -1
  30. package/dist/esm/ez-text-input.entry.js +41 -4
  31. package/dist/esm/ezui.js +1 -1
  32. package/dist/esm/loader.js +1 -1
  33. package/dist/ezui/ezui.esm.js +1 -1
  34. package/dist/ezui/p-2aa8e4b2.entry.js +1 -0
  35. package/dist/ezui/p-8d0f02c7.entry.js +309 -0
  36. package/dist/ezui/{p-7bfae0fc.entry.js → p-91266ddd.entry.js} +1 -1
  37. package/dist/ezui/p-a5b91a77.entry.js +1 -0
  38. package/dist/ezui/p-abce5219.entry.js +1 -0
  39. package/dist/ezui/p-c27b2e17.entry.js +1 -0
  40. package/dist/ezui/p-cd2e78f0.entry.js +1 -0
  41. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
  42. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +2 -0
  43. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -2
  44. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
  45. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -1
  46. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -1
  47. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
  48. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  49. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
  50. package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
  51. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
  52. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
  53. package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
  54. package/dist/types/components/ez-grid/ez-grid.d.ts +1 -1
  55. package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
  56. package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
  57. package/dist/types/components.d.ts +10 -2
  58. package/package.json +11 -4
  59. package/dist/ezui/p-03a2c7d1.entry.js +0 -1
  60. package/dist/ezui/p-5b205c80.entry.js +0 -1
  61. package/dist/ezui/p-9ceefe4d.entry.js +0 -1
  62. package/dist/ezui/p-b0a5c2cd.entry.js +0 -304
  63. package/dist/ezui/p-cdc472cc.entry.js +0 -1
  64. package/dist/ezui/p-fec696ab.entry.js +0 -1
  65. /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
- this._inputElem.value = this._maskFormatter.format(value);
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.value = this._inputElem.value;
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
- this.value = this._maskFormatter.format(this.value);
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,
@@ -16,6 +16,6 @@ export const buildFieldMetadata = (descriptor, config) => {
16
16
  name, label, group,
17
17
  readOnly, required,
18
18
  props,
19
- userInterface: userInterface || UserInterface.SHORTTEXT
19
+ userInterface: userInterface || UserInterface.SHORTTEXT,
20
20
  };
21
21
  };