@sankhyalabs/ezui 1.1.141 → 1.1.144

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 (91) hide show
  1. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-card-item.cjs.entry.js +44 -0
  3. package/dist/cjs/ez-collapsible-box.cjs.entry.js +3 -2
  4. package/dist/cjs/ez-combo-box.cjs.entry.js +41 -20
  5. package/dist/cjs/ez-date-input.cjs.entry.js +16 -5
  6. package/dist/cjs/ez-date-time-input.cjs.entry.js +7 -1
  7. package/dist/cjs/ez-form.cjs.entry.js +74 -21
  8. package/dist/cjs/ez-grid.cjs.entry.js +2 -0
  9. package/dist/cjs/ez-number-input.cjs.entry.js +8 -1
  10. package/dist/cjs/ez-text-area.cjs.entry.js +35 -22
  11. package/dist/cjs/ez-text-input.cjs.entry.js +11 -9
  12. package/dist/cjs/ez-time-input.cjs.entry.js +5 -0
  13. package/dist/cjs/ez-upload.cjs.entry.js +28 -9
  14. package/dist/cjs/ezui.cjs.js +1 -1
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/collection/collection-manifest.json +1 -0
  17. package/dist/collection/components/ez-button/ez-button.css +6 -0
  18. package/dist/collection/components/ez-card-item/ez-card-item.css +115 -0
  19. package/dist/collection/components/ez-card-item/ez-card-item.js +86 -0
  20. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +4 -0
  21. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +2 -1
  22. package/dist/collection/components/ez-combo-box/ez-combo-box.js +43 -21
  23. package/dist/collection/components/ez-date-input/ez-date-input.js +49 -5
  24. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +40 -1
  25. package/dist/collection/components/ez-form/DataBinder.js +54 -8
  26. package/dist/collection/components/ez-form/ez-form.js +14 -7
  27. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +7 -7
  28. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +2 -0
  29. package/dist/collection/components/ez-number-input/ez-number-input.js +41 -1
  30. package/dist/collection/components/ez-text-area/ez-text-area.js +35 -22
  31. package/dist/collection/components/ez-text-input/ez-text-input.js +11 -9
  32. package/dist/collection/components/ez-time-input/ez-time-input.js +38 -0
  33. package/dist/collection/components/ez-upload/RemoteFile.js +6 -1
  34. package/dist/collection/components/ez-upload/ez-upload.js +36 -8
  35. package/dist/custom-elements/index.d.ts +6 -0
  36. package/dist/custom-elements/index.js +275 -94
  37. package/dist/esm/ez-button.entry.js +1 -1
  38. package/dist/esm/ez-card-item.entry.js +40 -0
  39. package/dist/esm/ez-collapsible-box.entry.js +3 -2
  40. package/dist/esm/ez-combo-box.entry.js +41 -20
  41. package/dist/esm/ez-date-input.entry.js +16 -5
  42. package/dist/esm/ez-date-time-input.entry.js +7 -1
  43. package/dist/esm/ez-form.entry.js +75 -22
  44. package/dist/esm/ez-grid.entry.js +2 -0
  45. package/dist/esm/ez-number-input.entry.js +8 -1
  46. package/dist/esm/ez-text-area.entry.js +35 -22
  47. package/dist/esm/ez-text-input.entry.js +11 -9
  48. package/dist/esm/ez-time-input.entry.js +5 -0
  49. package/dist/esm/ez-upload.entry.js +28 -9
  50. package/dist/esm/ezui.js +1 -1
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/ezui/ezui.esm.js +1 -1
  53. package/dist/ezui/p-024df41e.entry.js +1 -0
  54. package/dist/ezui/p-140f7085.entry.js +1 -0
  55. package/dist/ezui/p-24e98dc1.entry.js +1 -0
  56. package/dist/ezui/p-49fdfa4b.entry.js +1 -0
  57. package/dist/ezui/p-4fdceb7d.entry.js +1 -0
  58. package/dist/ezui/p-5a05f1ea.entry.js +1 -0
  59. package/dist/ezui/p-6395ed55.entry.js +1 -0
  60. package/dist/ezui/{p-1b2bf15d.entry.js → p-6816c9ee.entry.js} +1 -1
  61. package/dist/ezui/p-7746460e.entry.js +1 -0
  62. package/dist/ezui/p-b524dfca.entry.js +1 -0
  63. package/dist/ezui/{p-8cb2c629.entry.js → p-c15d4d6f.entry.js} +1 -1
  64. package/dist/ezui/p-c77c0022.entry.js +1 -0
  65. package/dist/ezui/p-ec21ecce.entry.js +1 -0
  66. package/dist/types/components/ez-card-item/ez-card-item.d.ts +23 -0
  67. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +5 -1
  68. package/dist/types/components/ez-date-input/ez-date-input.d.ts +12 -1
  69. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +11 -0
  70. package/dist/types/components/ez-form/DataBinder.d.ts +1 -0
  71. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
  72. package/dist/types/components/ez-number-input/ez-number-input.d.ts +11 -0
  73. package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -3
  74. package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
  75. package/dist/types/components/ez-time-input/ez-time-input.d.ts +10 -0
  76. package/dist/types/components/ez-upload/ez-upload.d.ts +5 -0
  77. package/dist/types/components.d.ts +53 -0
  78. package/package.json +2 -2
  79. package/react/components.d.ts +1 -0
  80. package/react/components.js +1 -0
  81. package/react/components.js.map +1 -1
  82. package/dist/ezui/p-248361f5.entry.js +0 -1
  83. package/dist/ezui/p-347b145b.entry.js +0 -1
  84. package/dist/ezui/p-9b82c2fe.entry.js +0 -1
  85. package/dist/ezui/p-b8d64970.entry.js +0 -1
  86. package/dist/ezui/p-c620258b.entry.js +0 -1
  87. package/dist/ezui/p-cabe3671.entry.js +0 -1
  88. package/dist/ezui/p-cb73bee7.entry.js +0 -1
  89. package/dist/ezui/p-db0981c1.entry.js +0 -1
  90. package/dist/ezui/p-dd6f4872.entry.js +0 -1
  91. package/dist/ezui/p-ec8419f1.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h } from './index-b21f0a10.js';
2
2
 
3
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
3
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover-color:var(--color--primary-600);--ez-button--hover--background-color:var(--background--medium, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--xlarge, 4px solid) var(--color--primary-300);--ez-button--focus--box-shadow:none;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:focus{outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:focus{outline:none;outline:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
4
4
 
5
5
  let EzButton = class {
6
6
  constructor(hostRef) {
@@ -0,0 +1,40 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-b21f0a10.js';
2
+
3
+ const ezCardItemCss = ":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";
4
+
5
+ let EzCardItem = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.ezClick = createEvent(this, "ezClick", 7);
9
+ }
10
+ componentWillRender() {
11
+ this.createDetailList();
12
+ }
13
+ createDetailList() {
14
+ var _a, _b, _c;
15
+ this._details = { detailsLeft: [], detailsRight: [] };
16
+ let cont = 0;
17
+ if ((_a = this.item) === null || _a === void 0 ? void 0 : _a.details) {
18
+ for (const attribute in this.item.details) {
19
+ cont < 3 ?
20
+ this._details.detailsLeft.push({ label: attribute, value: (_b = this.item.details[attribute]) === null || _b === void 0 ? void 0 : _b.toString() }) :
21
+ this._details.detailsRight.push({ label: attribute, value: (_c = this.item.details[attribute]) === null || _c === void 0 ? void 0 : _c.toString() });
22
+ cont++;
23
+ }
24
+ }
25
+ }
26
+ buildDetailContent(detail) {
27
+ return h("div", { class: "card-item__detail" }, h("label", { class: "card-item__detail-label" }, detail.label), ": ", h("label", { class: "card-item__detail-value", innerHTML: detail.value }));
28
+ }
29
+ render() {
30
+ return (h(Host, null, this.item &&
31
+ h("div", { class: "card-item", onClick: () => { this.ezClick.emit(this.item); } }, h("label", { class: "card-item__title", innerHTML: this.item.key + ' - ' + this.item.title }), h("div", { class: "card-item__details" }, h("div", { class: "card-item__details-left" }, this._details.detailsLeft.map(detail => {
32
+ return this.buildDetailContent(detail);
33
+ })), h("div", { class: "card-item__details-right" }, this._details.detailsRight.map(detail => {
34
+ return this.buildDetailContent(detail);
35
+ }))))));
36
+ }
37
+ };
38
+ EzCardItem.style = ezCardItemCss;
39
+
40
+ export { EzCardItem as ez_card_item };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-b21f0a10.js';
2
2
 
3
- const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
3
+ const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
4
4
 
5
5
  let EzCollapsibleBox = class {
6
6
  constructor(hostRef) {
@@ -45,7 +45,8 @@ let EzCollapsibleBox = class {
45
45
  render() {
46
46
  return (h("div", { class: "collapsible-box" }, h("div", { class: "collapsible-box__header" }, h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
47
47
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
48
- (this.stretchTitle ? " collapsible-box__title--stretched" : "") }, h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, h("slot", null))));
48
+ (this.stretchTitle ? " collapsible-box__title--stretched" : "") +
49
+ (this.value ? " collapsible-box__title--no-margin" : "") }, h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }), h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))), h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") }, h("slot", null))));
49
50
  }
50
51
  static get watchers() { return {
51
52
  "value": ["observeCollapsedValue"]
@@ -8,6 +8,9 @@ let EzComboBox = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
10
  this.ezChange = createEvent(this, "ezChange", 7);
11
+ this._limitCharsToSearch = 3;
12
+ this._deboucingTime = 300;
13
+ this._startLoading = false;
11
14
  /**
12
15
  * Deixa o campo disponível ou não para interação com usuário.
13
16
  */
@@ -144,19 +147,8 @@ let EzComboBox = class {
144
147
  this._preSelection = undefined;
145
148
  }
146
149
  }
147
- selectOption(opt) {
148
- const currentOpt = this.getSelectedOption();
149
- if (currentOpt !== opt) {
150
- const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
151
- this.value = adjustedOpt;
152
- this.errorMessage = "";
153
- this.ezChange.emit(adjustedOpt);
154
- }
155
- else {
156
- this.observeValue();
157
- }
158
- }
159
150
  updateSource(source) {
151
+ this._startLoading = false;
160
152
  if (source instanceof Promise) {
161
153
  source.then(result => this.updateSource(result));
162
154
  this.updateVisibleOptions();
@@ -167,12 +159,26 @@ let EzComboBox = class {
167
159
  this.updateVisibleOptions();
168
160
  }
169
161
  else {
170
- this.value = source;
162
+ this.selectOption(source);
171
163
  }
172
164
  }
173
165
  }
166
+ selectOption(newOption) {
167
+ var _a, _b;
168
+ const currentOpt = this.getSelectedOption();
169
+ if (((_a = currentOpt === null || currentOpt === void 0 ? void 0 : currentOpt.value) === null || _a === void 0 ? void 0 : _a.toString()) !== ((_b = newOption === null || newOption === void 0 ? void 0 : newOption.value) === null || _b === void 0 ? void 0 : _b.toString())) {
170
+ const adjustedOpt = !(newOption === null || newOption === void 0 ? void 0 : newOption.value) ? undefined : newOption;
171
+ this.value = adjustedOpt;
172
+ this.errorMessage = "";
173
+ this.ezChange.emit(this.value);
174
+ }
175
+ else {
176
+ this.observeValue();
177
+ }
178
+ }
174
179
  loadOptions(mode, argument = "") {
175
180
  this._criteria = argument;
181
+ this._startLoading = true;
176
182
  if (this.optionLoader) {
177
183
  this.updateSource(this.optionLoader({ mode, argument }));
178
184
  }
@@ -229,25 +235,40 @@ let EzComboBox = class {
229
235
  this.searchMode ? this.loadOptions("ADVANCED") : this.showOptions();
230
236
  }
231
237
  onTextInputChangeHandler(event) {
238
+ var _a;
239
+ this.clearDeboucingTimeout();
240
+ if (this._startLoading) {
241
+ this._changeDeboucingTimeout = window.setTimeout(() => {
242
+ this.onTextInputChangeHandler(event);
243
+ }, this._deboucingTime);
244
+ return;
245
+ }
232
246
  if (!this._criteria) {
233
247
  this._inputElement.value = event.data;
234
248
  }
235
- const argument = event.target.value;
249
+ const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
250
+ const argumentNumber = Number(argument || undefined);
236
251
  this._criteria = argument;
237
- if (this._criteria) {
252
+ if (argument && (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch)) {
238
253
  if (this.searchMode) {
239
- if (this._changeDeboucingTimeout) {
240
- window.clearTimeout(this._changeDeboucingTimeout);
241
- }
242
254
  this._changeDeboucingTimeout = window.setTimeout(() => {
243
- this.loadOptions("PREDICTIVE", argument);
244
- }, 200);
255
+ this.loadOptions("PREDICTIVE", isNaN(argumentNumber) ? argument : argumentNumber.toString());
256
+ }, this._deboucingTime);
245
257
  }
246
258
  else {
247
259
  this.updateVisibleOptions();
248
260
  }
249
261
  this.showOptions();
250
262
  }
263
+ else {
264
+ this.hideOptions();
265
+ }
266
+ }
267
+ clearDeboucingTimeout() {
268
+ if (this._changeDeboucingTimeout) {
269
+ window.clearTimeout(this._changeDeboucingTimeout);
270
+ this._changeDeboucingTimeout = undefined;
271
+ }
251
272
  }
252
273
  onTextInputClickHandler() {
253
274
  if (!this.searchMode) {
@@ -8,6 +8,8 @@ let EzDateInput = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
10
  this.ezChange = createEvent(this, "ezChange", 7);
11
+ this.ezStartChange = createEvent(this, "ezStartChange", 7);
12
+ this.ezCancelWaitingChange = createEvent(this, "ezCancelWaitingChange", 7);
11
13
  /**
12
14
  * Deixa o campo disponível ou não para uso.
13
15
  */
@@ -21,11 +23,16 @@ let EzDateInput = class {
21
23
  this._textInput.label = this.label;
22
24
  }
23
25
  observeErrorMessage() {
24
- this._textInput.errorMessage = this.errorMessage;
25
- }
26
- observeValue() {
27
26
  if (this._textInput) {
28
- this._textInput.value = this.getTextValue(this.value);
27
+ this._textInput.errorMessage = this.errorMessage;
28
+ }
29
+ }
30
+ observeValue(newValue, oldValue) {
31
+ if (newValue != oldValue) {
32
+ if (this._textInput) {
33
+ this.errorMessage = "";
34
+ this._textInput.value = this.getTextValue(this.value);
35
+ }
29
36
  }
30
37
  }
31
38
  /**
@@ -75,12 +82,16 @@ let EzDateInput = class {
75
82
  }
76
83
  }
77
84
  else {
85
+ this.ezCancelWaitingChange.emit();
78
86
  this._textInput.errorMessage = "O valor digitado não é uma data válida";
79
87
  }
80
88
  }
81
89
  getTextValue(d) {
82
90
  return d ? new Intl.DateTimeFormat("pt-BR").format(d) : undefined;
83
91
  }
92
+ startChange() {
93
+ this.ezStartChange.emit({ waitmessage: "", blocking: false });
94
+ }
84
95
  componentDidLoad() {
85
96
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
86
97
  }
@@ -88,7 +99,7 @@ let EzDateInput = class {
88
99
  return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
89
100
  if (event.key === "H" || event.key === "h")
90
101
  this.changeValue(new Date());
91
- }, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
102
+ }, label: this.label, value: this.getTextValue(this.value), onInput: () => this.startChange(), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
92
103
  }
93
104
  get _elem() { return getElement(this); }
94
105
  static get watchers() { return {
@@ -8,6 +8,8 @@ let EzDateTimeInput = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
10
  this.ezChange = createEvent(this, "ezChange", 7);
11
+ this.ezStartChange = createEvent(this, "ezStartChange", 7);
12
+ this.ezCancelWaitingChange = createEvent(this, "ezCancelWaitingChange", 7);
11
13
  /**
12
14
  * Deixa o campo disponível ou não para uso.
13
15
  */
@@ -113,6 +115,7 @@ let EzDateTimeInput = class {
113
115
  }
114
116
  }
115
117
  else {
118
+ this.ezCancelWaitingChange.emit();
116
119
  this._textInput.errorMessage = "O valor digitado não é uma data válida";
117
120
  }
118
121
  }
@@ -127,11 +130,14 @@ let EzDateTimeInput = class {
127
130
  };
128
131
  return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : undefined;
129
132
  }
133
+ startChange() {
134
+ this.ezStartChange.emit({ waitmessage: "", blocking: false });
135
+ }
130
136
  componentDidLoad() {
131
137
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
132
138
  }
133
139
  render() {
134
- return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onFocus: () => this.onFocused(), onClick: () => this.onClicked(), slaveMode: true }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
140
+ return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onInput: () => this.startChange(), onFocus: () => this.onFocused(), onClick: () => this.onClicked(), slaveMode: true }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
135
141
  }
136
142
  get _elem() { return getElement(this); }
137
143
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { h, r as registerInstance, c as createEvent, f as forceUpdate, H as Host, g as getElement } from './index-b21f0a10.js';
2
- import { UserInterface, Action, ApplicationContext, DataUnitAction, DataUnit } from '@sankhyalabs/core';
2
+ import { UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit } from '@sankhyalabs/core';
3
3
  import { A as ApplicationUtils } from './ApplicationUtils-35350d20.js';
4
4
 
5
5
  const buildTextArea = ({ name, label, readOnly }) => {
@@ -177,7 +177,7 @@ const buildFromDataUnit = (dataUnit) => {
177
177
  .filter(descriptor => descriptor.required)
178
178
  .map(descriptor => descriptor.name),
179
179
  cleanOnCopyFields: visibleFields
180
- .filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
180
+ .filter(descriptor => { var _a, _b; return ((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum); })
181
181
  .map(descriptor => descriptor.name),
182
182
  defaultValues
183
183
  });
@@ -189,7 +189,7 @@ function getTabConfig(tab, sheets) {
189
189
  return tabConfig || { label: tab, visible: true };
190
190
  }
191
191
  function sortTabs(a, b) {
192
- return a[0].label == 'Geral' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
192
+ return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
193
193
  }
194
194
  const buildFromConfig = (fields, dataUnit) => {
195
195
  const sheets = new Map();
@@ -197,9 +197,9 @@ const buildFromConfig = (fields, dataUnit) => {
197
197
  const cleanOnCopyFields = [];
198
198
  const defaultValues = {};
199
199
  fields.forEach(config => {
200
- var _a, _b;
200
+ var _a, _b, _c;
201
201
  if (config.visible !== false) {
202
- const tabConfig = getTabConfig(config.tab || "Geral", sheets);
202
+ const tabConfig = getTabConfig(config.tab || "__main", sheets);
203
203
  const descriptor = dataUnit.getField(config.name);
204
204
  if (descriptor && tabConfig.visible) {
205
205
  if (!sheets.has(tabConfig)) {
@@ -210,11 +210,11 @@ const buildFromConfig = (fields, dataUnit) => {
210
210
  if (isRequired) {
211
211
  requiredFields.push(config.name);
212
212
  }
213
- const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
213
+ const clearOnCopy = config.cleanOnCopy === undefined ? (((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum)) : config.cleanOnCopy;
214
214
  if (clearOnCopy) {
215
215
  cleanOnCopyFields.push(config.name);
216
216
  }
217
- const defaultValue = config.defaultValue === undefined ? (_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.defaultValue : config.defaultValue;
217
+ const defaultValue = config.defaultValue === undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : config.defaultValue;
218
218
  if (defaultValue) {
219
219
  defaultValues[config.name] = config.defaultValue;
220
220
  }
@@ -240,7 +240,7 @@ const buildFromConfig = (fields, dataUnit) => {
240
240
  .sort(sortTabs)
241
241
  .forEach(([key, value]) => {
242
242
  metadata.addSheet({
243
- label: key.label,
243
+ label: (key.label === "__main") ? "Principal" : key.label,
244
244
  name: key.label,
245
245
  items: Array.from(value.values()),
246
246
  requiredFields,
@@ -650,11 +650,7 @@ class DataBinder {
650
650
  this._dataUnit.unsubscribe(this.onDataUnitEvent);
651
651
  }
652
652
  updateValue(fieldName, field) {
653
- const oldValue = field["value"];
654
- const newValue = this._dataUnit.getFieldValue(fieldName);
655
- if (oldValue != newValue) {
656
- field["value"] = newValue;
657
- }
653
+ field["value"] = this._dataUnit.getFieldValue(fieldName);
658
654
  }
659
655
  updateBind(fieldName, field) {
660
656
  const oldBind = this._fields.get(fieldName);
@@ -662,21 +658,53 @@ class DataBinder {
662
658
  oldBind.destroy();
663
659
  }
664
660
  field["value"] = this._dataUnit.getFieldValue(fieldName);
665
- this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
661
+ this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName) => this.cancelWaitingChange(fieldName), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
666
662
  this.bindSearchOptionsLoader(fieldName, field);
667
663
  this.applyEzUploadContext(fieldName, field);
668
664
  }
669
665
  changeStarted(fieldName, waitingChange) {
666
+ /**
667
+ * se o waitingChange não é blocante, add um event listener pra
668
+ * fazer o accept da promise
669
+ *
670
+ * se não tiver promise no waitingChange, eu crio uma e resolvo no bind
671
+ *
672
+ *
673
+ */
670
674
  if (this._dataUnit.records.length === 0) {
671
675
  this._dataUnit.addRecord();
672
676
  }
677
+ if (!waitingChange.blocking && waitingChange.promise == undefined) {
678
+ const bind = this._fields.get(fieldName);
679
+ if (bind) {
680
+ waitingChange.promise = new Promise((resolve, reject) => {
681
+ bind.waitingChangePromiseResolve = resolve;
682
+ bind.waitingChangePromiseReject = reject;
683
+ });
684
+ }
685
+ }
673
686
  this._dataUnit.startChange(fieldName, waitingChange);
674
687
  }
688
+ cancelWaitingChange(fieldName) {
689
+ if (this._dataUnit.waitingForChange(fieldName)) {
690
+ this._dataUnit.cancelWaitingChange(fieldName);
691
+ const bind = this._fields.get(fieldName);
692
+ if (bind) {
693
+ bind.rejectWaitingChange(new WaitingChangeException("Change canceled", fieldName));
694
+ }
695
+ }
696
+ }
675
697
  setFieldValue(fieldName, newValue) {
676
698
  if (this._dataUnit.records.length === 0) {
677
699
  this._dataUnit.addRecord();
678
700
  }
679
701
  this._dataUnit.setFieldValue(fieldName, newValue);
702
+ if (this._dataUnit.waitingForChange(fieldName)) {
703
+ const bind = this._fields.get(fieldName);
704
+ if (bind) {
705
+ bind.acceptWaitingChange();
706
+ }
707
+ }
680
708
  }
681
709
  bindSearchOptionsLoader(fieldName, field) {
682
710
  if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] == undefined) {
@@ -705,18 +733,36 @@ class DataBinder {
705
733
  class Bind {
706
734
  constructor() {
707
735
  this.startChangeEventName = "ezStartChange";
736
+ this.cancelWaitingChangeEventName = "ezCancelWaitingChange";
708
737
  this.changeEventName = "ezChange";
709
738
  }
710
739
  destroy() {
711
740
  this.field.removeEventListener(this.startChangeEventName, this.startChangeListener);
741
+ this.field.removeEventListener(this.cancelWaitingChangeEventName, this.cancelWaitingChangeListener);
712
742
  this.field.removeEventListener(this.changeEventName, this.changeListener);
713
743
  }
714
- static create(fieldName, field, startChangeCallback, changeCallback) {
744
+ acceptWaitingChange() {
745
+ if (this.waitingChangePromiseResolve) {
746
+ this.waitingChangePromiseResolve();
747
+ this.waitingChangePromiseReject = undefined;
748
+ this.waitingChangePromiseResolve = undefined;
749
+ }
750
+ }
751
+ rejectWaitingChange(reason) {
752
+ if (this.waitingChangePromiseReject) {
753
+ this.waitingChangePromiseReject(reason);
754
+ this.waitingChangePromiseReject = undefined;
755
+ this.waitingChangePromiseResolve = undefined;
756
+ }
757
+ }
758
+ static create(fieldName, field, startChangeCallback, cancelWaitingChangeCallback, changeCallback) {
715
759
  const b = new Bind();
716
760
  b.field = field;
717
761
  b.fieldName = fieldName;
718
762
  b.startChangeListener = (evt) => { startChangeCallback(fieldName, evt.detail); };
719
763
  b.field.addEventListener(b.startChangeEventName, b.startChangeListener);
764
+ b.cancelWaitingChangeListener = () => { cancelWaitingChangeCallback(fieldName); };
765
+ b.field.addEventListener(b.cancelWaitingChangeEventName, b.cancelWaitingChangeListener);
720
766
  b.changeListener = (evt) => { changeCallback(fieldName, evt.detail); };
721
767
  b.field.addEventListener(b.changeEventName, b.changeListener);
722
768
  return b;
@@ -766,12 +812,20 @@ let EzForm = class {
766
812
  requiredFields.forEach(field => {
767
813
  const value = record[field];
768
814
  const fieldElem = this._element.querySelector(`[data-field-name=${field}]`);
769
- if (value === null || value === undefined || value === "") {
770
- invalidFields.push(field);
771
- fieldElem["errorMessage"] = "Essa informação é obrigatória";
772
- }
773
- else {
774
- fieldElem["errorMessage"] = "";
815
+ /**
816
+ * TODO: fieldElem vai ser vazio quando o campo está em uma aba que
817
+ * está escondida.
818
+ * Temos que tratar esse caso para apresentar a mensagem de erro
819
+ * na aba, isso será tratado no card: https://sankhya.atlassian.net/browse/SKA-44182
820
+ */
821
+ if (fieldElem) {
822
+ if (value === null || value === undefined || value === "") {
823
+ invalidFields.push(field);
824
+ fieldElem["errorMessage"] = "Essa informação é obrigatória";
825
+ }
826
+ else {
827
+ fieldElem["errorMessage"] = "";
828
+ }
775
829
  }
776
830
  });
777
831
  const isValid = invalidFields.length === 0;
@@ -821,7 +875,6 @@ let EzForm = class {
821
875
  }
822
876
  }
823
877
  if (action.type === Action.RECORDS_ADDED) {
824
- debugger;
825
878
  const metadata = selectFormMetadata(this._store.getState());
826
879
  const defaultValues = metadata.getDefaultValues();
827
880
  if (defaultValues) {
@@ -110062,6 +110062,7 @@ class AgGridController {
110062
110062
  this.DEFAULT_ROW_HEIGHT = 25;
110063
110063
  this.CHECK_BOX_COL_ID = "checkBoxColumn";
110064
110064
  this.RECORD_ARCHIVE_COL_ID = "__RECORD_ARCHIVE__";
110065
+ this.BLOCK_LOAD_DEBOUNCE = 400;
110065
110066
  this._menuItems = [];
110066
110067
  this._idAttribName = "__record__id__";
110067
110068
  this._isFirstRecordOfPage = true;
@@ -110105,6 +110106,7 @@ class AgGridController {
110105
110106
  rowSelection: this._multipleSelection ? "multiple" : "single",
110106
110107
  serverSideDatasource: this._dataSource,
110107
110108
  sortingOrder: ['desc', 'asc', null],
110109
+ blockLoadDebounceMillis: this.BLOCK_LOAD_DEBOUNCE,
110108
110110
  getRowNodeId: this._dataUnit ? (params) => typeof params === "string" ? params : params[this._idAttribName] : undefined,
110109
110111
  getMainMenuItems: (params) => {
110110
110112
  const column = params.column;
@@ -8,6 +8,8 @@ let EzNumberInput = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
10
  this.ezChange = createEvent(this, "ezChange", 7);
11
+ this.ezStartChange = createEvent(this, "ezStartChange", 7);
12
+ this.ezCancelWaitingChange = createEvent(this, "ezCancelWaitingChange", 7);
11
13
  /**
12
14
  * Deixa o campo disponível ou não para uso.
13
15
  */
@@ -57,6 +59,7 @@ let EzNumberInput = class {
57
59
  parseNumber() {
58
60
  const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : undefined;
59
61
  if (parsedNumber !== undefined && isNaN(parsedNumber)) {
62
+ this.ezCancelWaitingChange.emit();
60
63
  this.errorMessage = "O valor digitado não é um número válido";
61
64
  }
62
65
  else {
@@ -64,6 +67,7 @@ let EzNumberInput = class {
64
67
  this.changeValue(parsedNumber);
65
68
  }
66
69
  catch (e) {
70
+ this.ezCancelWaitingChange.emit();
67
71
  this.errorMessage = e.message;
68
72
  return;
69
73
  }
@@ -75,11 +79,14 @@ let EzNumberInput = class {
75
79
  }
76
80
  return undefined;
77
81
  }
82
+ startChange() {
83
+ this.ezStartChange.emit({ waitmessage: "", blocking: false });
84
+ }
78
85
  componentDidLoad() {
79
86
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
80
87
  }
81
88
  render() {
82
- return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }));
89
+ return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onInput: () => this.startChange(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }));
83
90
  }
84
91
  get _elem() { return getElement(this); }
85
92
  static get watchers() { return {
@@ -35,11 +35,17 @@ let EzTextArea = class {
35
35
  (_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove('hasError');
36
36
  }
37
37
  }
38
- observeValue() {
39
- this._inputElem.value = this.value == undefined ? "" : this.value;
40
- this.handleChange();
41
- this.adjustFloatingLabel();
42
- this.ezChange.emit(this.value);
38
+ observeValue(newValue, oldValue) {
39
+ if (this._inputElem) {
40
+ if (newValue != oldValue) {
41
+ if (this.canChangeValue()) {
42
+ this._inputElem.value = this.value || "";
43
+ }
44
+ this.adjustFloatingLabel();
45
+ this.errorMessage = "";
46
+ this.ezChange.emit(this.value);
47
+ }
48
+ }
43
49
  }
44
50
  observeMode() {
45
51
  if (this._initialRows == undefined) {
@@ -57,6 +63,27 @@ let EzTextArea = class {
57
63
  this._initialRows = rows;
58
64
  }
59
65
  }
66
+ //---------------------------------------------
67
+ // Public methods
68
+ //---------------------------------------------
69
+ /**
70
+ * Faz o foco no componente de input
71
+ */
72
+ async setFocus() {
73
+ this._inputElem.focus();
74
+ }
75
+ /**
76
+ * Remove o foco no componente de input
77
+ */
78
+ async setBlur() {
79
+ this._inputElem.blur();
80
+ }
81
+ //---------------------------------------------
82
+ // Private methods
83
+ //---------------------------------------------
84
+ canChangeValue() {
85
+ return this._inputElem && (this.value || "") !== this._inputElem.value;
86
+ }
60
87
  adjustFloatingLabel() {
61
88
  if (this.label && this._labelElem) {
62
89
  const hasValue = this.value && this.value.toString().length > 0;
@@ -77,21 +104,6 @@ let EzTextArea = class {
77
104
  return this._hostElement.shadowRoot.activeElement !== null;
78
105
  }
79
106
  //---------------------------------------------
80
- // Public methods
81
- //---------------------------------------------
82
- /**
83
- * Faz o foco no componente de input
84
- */
85
- async setFocus() {
86
- this._inputElem.focus();
87
- }
88
- /**
89
- * Remove o foco no componente de input
90
- */
91
- async setBlur() {
92
- this._inputElem.blur();
93
- }
94
- //---------------------------------------------
95
107
  // Event handlers
96
108
  //---------------------------------------------
97
109
  handleFocusout() {
@@ -101,8 +113,9 @@ let EzTextArea = class {
101
113
  }
102
114
  }
103
115
  handleChange() {
104
- this.errorMessage = "";
105
- this.value = this._inputElem.value;
116
+ if (this.canChangeValue()) {
117
+ this.value = this._inputElem.value;
118
+ }
106
119
  }
107
120
  handleFocus() {
108
121
  if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {