@sankhyalabs/ezui 5.21.0-dev.1 → 5.21.0-dev.10

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 (77) hide show
  1. package/dist/cjs/ez-alert-list.cjs.entry.js +6 -4
  2. package/dist/cjs/ez-button.cjs.entry.js +2 -2
  3. package/dist/cjs/ez-form-view.cjs.entry.js +13 -0
  4. package/dist/cjs/ez-form.cjs.entry.js +28 -2
  5. package/dist/cjs/ez-grid.cjs.entry.js +108 -14
  6. package/dist/cjs/ez-modal-container.cjs.entry.js +15 -4
  7. package/dist/cjs/ez-modal.cjs.entry.js +7 -8
  8. package/dist/cjs/ez-number-input.cjs.entry.js +8 -1
  9. package/dist/cjs/ez-popup.cjs.entry.js +14 -8
  10. package/dist/cjs/ez-search.cjs.entry.js +5 -2
  11. package/dist/cjs/ezui.cjs.js +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/components/ez-alert-list/ez-alert-list.js +6 -4
  14. package/dist/collection/components/ez-button/ez-button.css +7 -0
  15. package/dist/collection/components/ez-button/ez-button.js +1 -1
  16. package/dist/collection/components/ez-form/ez-form.js +76 -2
  17. package/dist/collection/components/ez-form-view/ez-form-view.js +38 -0
  18. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +42 -2
  19. package/dist/collection/components/ez-grid/ez-grid.js +125 -2
  20. package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
  21. package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
  22. package/dist/collection/components/ez-grid/subcomponents/selection-counter.js +3 -11
  23. package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js +24 -0
  24. package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
  25. package/dist/collection/components/ez-modal/ez-modal.js +22 -9
  26. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -0
  27. package/dist/collection/components/ez-modal-container/ez-modal-container.js +23 -3
  28. package/dist/collection/components/ez-number-input/ez-number-input.js +11 -0
  29. package/dist/collection/components/ez-popup/ez-popup.js +14 -8
  30. package/dist/collection/components/ez-search/ez-search.js +5 -2
  31. package/dist/custom-elements/index.js +209 -48
  32. package/dist/esm/ez-alert-list.entry.js +6 -4
  33. package/dist/esm/ez-button.entry.js +2 -2
  34. package/dist/esm/ez-form-view.entry.js +13 -0
  35. package/dist/esm/ez-form.entry.js +28 -2
  36. package/dist/esm/ez-grid.entry.js +108 -14
  37. package/dist/esm/ez-modal-container.entry.js +16 -5
  38. package/dist/esm/ez-modal.entry.js +9 -10
  39. package/dist/esm/ez-number-input.entry.js +8 -1
  40. package/dist/esm/ez-popup.entry.js +15 -9
  41. package/dist/esm/ez-search.entry.js +5 -2
  42. package/dist/esm/ezui.js +1 -1
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/ezui/ezui.esm.js +1 -1
  45. package/dist/ezui/p-09de35a2.entry.js +1 -0
  46. package/dist/ezui/p-13d2fe2d.entry.js +1 -0
  47. package/dist/ezui/{p-384247cd.entry.js → p-1db718ab.entry.js} +1 -1
  48. package/dist/ezui/p-30775e7f.entry.js +1 -0
  49. package/dist/ezui/{p-2a1a0e04.entry.js → p-3a21618b.entry.js} +1 -1
  50. package/dist/ezui/p-7c770f14.entry.js +1 -0
  51. package/dist/ezui/{p-db77a984.entry.js → p-836cdfdf.entry.js} +1 -1
  52. package/dist/ezui/p-99f46950.entry.js +1 -0
  53. package/dist/ezui/p-d9401ea0.entry.js +1 -0
  54. package/dist/ezui/p-f3c526cc.entry.js +1 -0
  55. package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +2 -2
  56. package/dist/types/components/ez-form/ez-form.d.ts +12 -0
  57. package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
  58. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +10 -0
  59. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -0
  60. package/dist/types/components/ez-grid/ez-grid.d.ts +18 -1
  61. package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
  62. package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
  63. package/dist/types/components/ez-grid/subcomponents/utils/selectionCounterUtils.d.ts +4 -0
  64. package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
  65. package/dist/types/components/ez-modal/ez-modal.d.ts +9 -1
  66. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +3 -0
  67. package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -0
  68. package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
  69. package/dist/types/components.d.ts +37 -1
  70. package/package.json +1 -1
  71. package/dist/ezui/p-5e1d036e.entry.js +0 -1
  72. package/dist/ezui/p-5ef056ce.entry.js +0 -1
  73. package/dist/ezui/p-701231f0.entry.js +0 -1
  74. package/dist/ezui/p-9aefaa52.entry.js +0 -1
  75. package/dist/ezui/p-a1ec32ef.entry.js +0 -1
  76. package/dist/ezui/p-b041333c.entry.js +0 -1
  77. package/dist/ezui/p-b567fa8c.entry.js +0 -1
@@ -1163,10 +1163,12 @@ const EzAlertList$1 = class extends HTMLElement$1 {
1163
1163
  /**
1164
1164
  * Retorna o link para o titulo do alerta a partir do id.
1165
1165
  */
1166
- getLinkTitle(item) {
1166
+ getLinkActionClick(item) {
1167
1167
  var _a;
1168
- const link = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.link;
1169
- return link !== null && link !== void 0 ? link : "#";
1168
+ const action = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.onClickLink;
1169
+ if (action)
1170
+ return action;
1171
+ return () => { };
1170
1172
  }
1171
1173
  /**
1172
1174
  * Retorna o texto do título do alerta.
@@ -1258,7 +1260,7 @@ const EzAlertList$1 = class extends HTMLElement$1 {
1258
1260
  (h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
1259
1261
  this.opened = false;
1260
1262
  }, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
1261
- return (h("a", { href: this.getLinkTitle(item), style: {
1263
+ return (h("a", { onClick: this.getLinkActionClick(item), style: {
1262
1264
  fontFamily: "var(--font-pattern, 'Roboto')",
1263
1265
  fontSize: 'var(--text--medium, 14px)',
1264
1266
  fontWeight: 'var(--text-weight--medium, 400)',
@@ -1697,7 +1699,7 @@ const EzBreadcrumb$1 = class extends HTMLElement$1 {
1697
1699
  static get style() { return ezBreadcrumbCss; }
1698
1700
  };
1699
1701
 
1700
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--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--justify-content:center;--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{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--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);justify-content:var(--ez-button--justify-content)}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)}";
1702
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--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--justify-content:center;--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-disabled-color:var(--color--disable-primary, '#e5eaf0');--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{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--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);justify-content:var(--ez-button--justify-content)}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)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
1701
1703
 
1702
1704
  const EzButton$1 = class extends HTMLElement$1 {
1703
1705
  constructor() {
@@ -1768,7 +1770,7 @@ const EzButton$1 = class extends HTMLElement$1 {
1768
1770
  return (h("div", { class: "label-icon" }, h("button", { class: "btn-icon " + ((this.getIconSize()) ? `btn-icon--${this.getIconSize()}` : ""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize() })), h("label", { title: this.label }, this.label)));
1769
1771
  }
1770
1772
  else if (this.mode == "link") {
1771
- return (h("a", { class: this.getIconSize(), ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
1773
+ return (h("a", { class: `${this.getIconSize()} ${!this.enabled ? "disabled" : ""}`, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
1772
1774
  }
1773
1775
  else {
1774
1776
  return (h("button", { class: this.getIconSize(""), type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
@@ -4618,10 +4620,12 @@ const EzForm$1 = class extends HTMLElement$1 {
4618
4620
  this.processMetadata();
4619
4621
  }
4620
4622
  };
4623
+ this._fieldsProps = new Map();
4621
4624
  this.dataUnit = undefined;
4622
4625
  this.config = undefined;
4623
4626
  this.recordsValidator = undefined;
4624
4627
  this.fieldToFocus = undefined;
4628
+ this.onlyStaticFields = false;
4625
4629
  }
4626
4630
  /**
4627
4631
  * Realiza validação no conteúdo de todos os campos.
@@ -4632,6 +4636,15 @@ const EzForm$1 = class extends HTMLElement$1 {
4632
4636
  observeConfig() {
4633
4637
  this.processMetadata();
4634
4638
  }
4639
+ /**
4640
+ * Altera/adiciona uma propriedade nos metadados do campo.
4641
+ */
4642
+ async setFieldProp(fieldName, propName, value) {
4643
+ const newCustomFieldProps = new Map(this._fieldsProps);
4644
+ const currentProps = this._fieldsProps.get(fieldName);
4645
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
4646
+ this._fieldsProps = newCustomFieldProps;
4647
+ }
4635
4648
  getDynamicContent() {
4636
4649
  var _a;
4637
4650
  const formMD = selectFormMetadata(this._store.getState());
@@ -4658,10 +4671,10 @@ const EzForm$1 = class extends HTMLElement$1 {
4658
4671
  }
4659
4672
  this.ezFormSetFields.emit(fields);
4660
4673
  const idFormSheet = `${StringUtils$1.replaceAccentuatedChars(StringUtils$1.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
4661
- return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
4674
+ return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { ref: ref => this._formView = ref, class: "ez-row ez-padding-vertical--small", fields: fields })));
4662
4675
  }
4663
4676
  processMetadata() {
4664
- if (!this.isStatic() && this.dataUnit && this._store) {
4677
+ if (this.bindFields() && this.dataUnit && this._store) {
4665
4678
  const metadata = buildFormMetadata(this.config, this.dataUnit);
4666
4679
  this._store.dispatch(loadMetadata(metadata));
4667
4680
  }
@@ -4670,6 +4683,9 @@ const EzForm$1 = class extends HTMLElement$1 {
4670
4683
  var _a;
4671
4684
  return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
4672
4685
  }
4686
+ bindFields() {
4687
+ return !this.isStatic() || this.onlyStaticFields === false;
4688
+ }
4673
4689
  componentWillLoad() {
4674
4690
  if (this.dataUnit === undefined) {
4675
4691
  this.dataUnit = new DataUnit("ez-form");
@@ -4689,6 +4705,7 @@ const EzForm$1 = class extends HTMLElement$1 {
4689
4705
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
4690
4706
  this.ezReady.emit();
4691
4707
  this.handleFieldToFocus();
4708
+ this.setFieldsProps();
4692
4709
  }
4693
4710
  handleFieldToFocus() {
4694
4711
  var _a;
@@ -4705,6 +4722,17 @@ const EzForm$1 = class extends HTMLElement$1 {
4705
4722
  this.ezFormRequestClearFieldToFocus.emit();
4706
4723
  });
4707
4724
  }
4725
+ setFieldsProps() {
4726
+ if (!this._formView) {
4727
+ return;
4728
+ }
4729
+ for (const [fieldName, props] of this._fieldsProps) {
4730
+ for (const prop in props) {
4731
+ this._formView.setFieldProp(fieldName, prop, props[prop]);
4732
+ }
4733
+ this._fieldsProps.delete(fieldName);
4734
+ }
4735
+ }
4708
4736
  disconnectedCallback() {
4709
4737
  this.dataUnit.unsubscribe(this.onDataUnitAction);
4710
4738
  this._dataBinder.onDisconnectedCallback();
@@ -4877,6 +4905,19 @@ const EzFormView$1 = class extends HTMLElement$1 {
4877
4905
  async showUp() {
4878
4906
  this._element.scrollIntoView({ behavior: "smooth", block: "start" });
4879
4907
  }
4908
+ /**
4909
+ * Altera/adiciona uma propriedade nos metados do campo.
4910
+ */
4911
+ async setFieldProp(fieldName, propName, value) {
4912
+ const fields = this.fields.map(field => {
4913
+ if (field.name === fieldName) {
4914
+ field.props = field.props || {};
4915
+ field.props[propName] = value;
4916
+ }
4917
+ return field;
4918
+ });
4919
+ this.fields = [...fields];
4920
+ }
4880
4921
  groupFields(fields) {
4881
4922
  const result = new Map();
4882
4923
  fields.forEach(item => {
@@ -124627,6 +124668,7 @@ class AgGridController {
124627
124668
  this._gridConfig = [];
124628
124669
  this._filteredColumns = new Map();
124629
124670
  this._filterColumnleftPosition = 0;
124671
+ this._customFormatters = new Map();
124630
124672
  this._enterprise = enterprise;
124631
124673
  }
124632
124674
  getGridConfig() {
@@ -124742,6 +124784,13 @@ class AgGridController {
124742
124784
  headerCheckStatusGetter: () => this.getSelectionHeaderStatus(),
124743
124785
  headerCheckStatusSetter: (selectAll) => this.updateSelectionForAll(selectAll),
124744
124786
  },
124787
+ processCellForClipboard: this.processFormatterCellCallback,
124788
+ defaultExcelExportParams: {
124789
+ processCellCallback: this.processFormatterCellCallback
124790
+ },
124791
+ defaultCsvExportParams: {
124792
+ processCellCallback: this.processFormatterCellCallback
124793
+ }
124745
124794
  };
124746
124795
  this.defineRowModelType(this._gridOptions, options);
124747
124796
  this.setOptionsEvents(this._gridOptions);
@@ -124765,7 +124814,25 @@ class AgGridController {
124765
124814
  this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
124766
124815
  }
124767
124816
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
124817
+ this._customFormatters = options.customFormatters;
124818
+ }
124819
+ }
124820
+ processFormatterCellCallback(params) {
124821
+ const column = params.column.getColDef();
124822
+ if (typeof column.valueFormatter === 'function') {
124823
+ const valueParams = {
124824
+ value: params.value,
124825
+ data: params.node.data,
124826
+ node: params.node,
124827
+ colDef: column,
124828
+ column: params.column,
124829
+ api: params.api,
124830
+ columnApi: params.columnApi,
124831
+ context: params.context,
124832
+ };
124833
+ return column.valueFormatter(valueParams);
124768
124834
  }
124835
+ return params.value;
124769
124836
  }
124770
124837
  setFilterColumnLeftPosition({ type, ePopup }) {
124771
124838
  if (type === 'columnMenu') {
@@ -125115,7 +125182,7 @@ class AgGridController {
125115
125182
  //Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
125116
125183
  const columnsOffset = colDef.length - columns.length;
125117
125184
  let sort = [];
125118
- state.forEach((cfgColumn, index) => {
125185
+ state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
125119
125186
  const colWidth = this.getColumnWidth(cfgColumn);
125120
125187
  this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
125121
125188
  this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
@@ -125218,6 +125285,13 @@ class AgGridController {
125218
125285
  if (params.value instanceof Promise) {
125219
125286
  return "Carregando...";
125220
125287
  }
125288
+ const customFormatter = this._customFormatters.get(source.name);
125289
+ if (customFormatter) {
125290
+ const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
125291
+ if (formattedValue) {
125292
+ return formattedValue;
125293
+ }
125294
+ }
125221
125295
  if (this._dataUnit) {
125222
125296
  return this._dataUnit.getFormattedValue(source.name, params.value);
125223
125297
  }
@@ -125226,6 +125300,13 @@ class AgGridController {
125226
125300
  cellStyle: this.getStyleByColumn(source),
125227
125301
  });
125228
125302
  }
125303
+ setCustomFormatters(customFormatters) {
125304
+ this._customFormatters = customFormatters;
125305
+ }
125306
+ refreshSelectedRows() {
125307
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
125308
+ this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
125309
+ }
125229
125310
  getInitCellStyle() {
125230
125311
  return {
125231
125312
  'line-height': this.getRowHeight() - 1 + 'px',
@@ -125403,9 +125484,34 @@ class AgGridController {
125403
125484
  }
125404
125485
  }
125405
125486
 
125487
+ function enableSelectAll(total) {
125488
+ return total !== undefined;
125489
+ }
125490
+ function buildSelectAllLabel(allRecordSelected, count, total) {
125491
+ if (allRecordSelected)
125492
+ return 'Selecionar apenas a página atual';
125493
+ if (total === undefined)
125494
+ return `Carregando todos os ${count} registros`;
125495
+ return `Selecionar todos os ${total} registros`;
125496
+ }
125497
+ function buildSelectAllTitle(total) {
125498
+ if (enableSelectAll(total))
125499
+ return '';
125500
+ return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
125501
+ }
125502
+ function getText(selectionCount, allSelectedRecords) {
125503
+ if (allSelectedRecords) {
125504
+ return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
125505
+ }
125506
+ if (selectionCount > 1) {
125507
+ return `Os <strong>${selectionCount} registros</strong> dessa página estão selecionados.`;
125508
+ }
125509
+ return "O único registro dessa página está selecionado";
125510
+ }
125511
+
125406
125512
  const SelectionCounter = (props) => {
125407
125513
  const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
125408
- const { total, hasMore } = paginationInfo || {};
125514
+ const { total, hasMore, count } = paginationInfo || {};
125409
125515
  const shouldRenderSelectionButton = () => {
125410
125516
  if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
125411
125517
  return false;
@@ -125419,20 +125525,11 @@ const SelectionCounter = (props) => {
125419
125525
  h("label", Object.assign({ innerHTML: getText(selectionCount, allRecordSelected), class: "ez-text ez-text--primary ez-text--medium ez-margin-right--medium ez-margin-top--medium" }, getElementID("ezGridSelectionCounter_label"))),
125420
125526
  h("div", { class: "ez-flex ez-margin-right--medium" },
125421
125527
  shouldRenderSelectionButton() &&
125422
- h("ez-button", Object.assign({ class: "ez-margin-right--medium", label: `Selecionar ${allRecordSelected ? "apenas a página atual" : `todos os ${total} registros`}`, mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
125423
- h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
125528
+ h("ez-button", Object.assign({ title: buildSelectAllTitle(total), enabled: enableSelectAll(total), class: "ez-margin-right--medium", label: buildSelectAllLabel(allRecordSelected, count, total), mode: "link", onClick: allRecordSelected ? onSelectPage : onSelectAll }, getElementID(`ezGridSelectionCounter_select${allRecordSelected ? "Page" : "All"}`))),
125529
+ h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
125424
125530
  h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
125425
125531
  h("ez-icon", { iconName: "close" })))));
125426
125532
  };
125427
- function getText(selectionCount, allSelectedRecords) {
125428
- if (allSelectedRecords) {
125429
- return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
125430
- }
125431
- else {
125432
- const pluralChar = selectionCount > 1 ? "s" : "";
125433
- return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
125434
- }
125435
- }
125436
125533
  function getElementID(sufix) {
125437
125534
  return {
125438
125535
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
@@ -125620,6 +125717,7 @@ const EzGrid$1 = class extends HTMLElement$1 {
125620
125717
  this._currentPageSelected = undefined;
125621
125718
  this._selectionCount = undefined;
125622
125719
  this._hasLeftButtons = false;
125720
+ this._customFormatters = new Map();
125623
125721
  this.multipleSelection = undefined;
125624
125722
  this.config = undefined;
125625
125723
  this.selectionToastConfig = undefined;
@@ -125691,6 +125789,42 @@ const EzGrid$1 = class extends HTMLElement$1 {
125691
125789
  async filterColumns(search) {
125692
125790
  return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
125693
125791
  }
125792
+ /**
125793
+ * Registra um formatador de valores para uma coluna da grid.
125794
+ */
125795
+ async addCustomValueFormatter(columnName, customFormatter) {
125796
+ if (!columnName || !customFormatter) {
125797
+ return;
125798
+ }
125799
+ const newCustomFormatters = new Map(this._customFormatters);
125800
+ newCustomFormatters.set(columnName, customFormatter);
125801
+ this._customFormatters = newCustomFormatters;
125802
+ this._gridController.setCustomFormatters(newCustomFormatters);
125803
+ }
125804
+ /**
125805
+ * Remove o formatador de valores de uma coluna da grid.
125806
+ */
125807
+ async removeCustomValueFormatter(columnName) {
125808
+ if (!columnName) {
125809
+ return;
125810
+ }
125811
+ const newCustomFormatters = new Map(this._customFormatters);
125812
+ newCustomFormatters.delete(columnName);
125813
+ this._customFormatters = newCustomFormatters;
125814
+ this._gridController.setCustomFormatters(newCustomFormatters);
125815
+ }
125816
+ /**
125817
+ * Atualiza linhas da grade.
125818
+ */
125819
+ async refreshSelectedRows() {
125820
+ this._gridController.refreshSelectedRows();
125821
+ }
125822
+ /**
125823
+ * Retorna o formatador customizado da coluna caso exista.
125824
+ */
125825
+ async getCustomValueFormatter(columnName) {
125826
+ return this._customFormatters.get(columnName);
125827
+ }
125694
125828
  observeConfig(config) {
125695
125829
  this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
125696
125830
  }
@@ -125892,7 +126026,8 @@ const EzGrid$1 = class extends HTMLElement$1 {
125892
126026
  statusResolver: this.statusResolver,
125893
126027
  useEnterLikeTab: this.useEnterLikeTab,
125894
126028
  recordsValidator: this.recordsValidator,
125895
- editionIsDisabled: () => !this.canEdit
126029
+ editionIsDisabled: () => !this.canEdit,
126030
+ customFormatters: this._customFormatters
125896
126031
  });
125897
126032
  if (this.config) {
125898
126033
  this.observeConfig(this.config);
@@ -126730,11 +126865,7 @@ const EzModal$1 = class extends HTMLElement$1 {
126730
126865
  this.__attachShadow();
126731
126866
  this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
126732
126867
  this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
126733
- this.handleKeyboardEvent = (ev) => {
126734
- if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
126735
- this.closeModal();
126736
- }
126737
- };
126868
+ this.ezModalAction = createEvent(this, "ezModalAction", 7);
126738
126869
  this.modalSize = undefined;
126739
126870
  this.align = undefined;
126740
126871
  this.heightMode = "regular";
@@ -126746,11 +126877,9 @@ const EzModal$1 = class extends HTMLElement$1 {
126746
126877
  observeOpened() {
126747
126878
  if (this.opened) {
126748
126879
  this._overlayId = FloatingManager.subscribeOverlayControl(this._modalRef);
126749
- document.addEventListener("keydown", this.handleKeyboardEvent);
126750
126880
  }
126751
126881
  else {
126752
126882
  FloatingManager.unsubscribeOverlayControl(this._modalRef || this._overlayId);
126753
- document.removeEventListener("keydown", this.handleKeyboardEvent);
126754
126883
  }
126755
126884
  }
126756
126885
  closeModal() {
@@ -126759,6 +126888,10 @@ const EzModal$1 = class extends HTMLElement$1 {
126759
126888
  }
126760
126889
  componentDidLoad() {
126761
126890
  this.observeOpened();
126891
+ new KeyboardManager({ propagate: false, element: this._element })
126892
+ .bind("Enter", this.ezModalAction.emit.bind("OK"))
126893
+ .bind("Escape", () => this.closeModal())
126894
+ .bind("Esc", () => this.closeModal());
126762
126895
  }
126763
126896
  componentDidRender() {
126764
126897
  if (this.opened) {
@@ -126777,10 +126910,11 @@ const EzModal$1 = class extends HTMLElement$1 {
126777
126910
  const scrimType = `modal__screen-${this.scrim}`;
126778
126911
  return (h(Host, null, this.opened
126779
126912
  ?
126780
- h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
126913
+ h("div", { ref: ref => this._modalRef = ref, class: `modal ${scrimType} ${regularVerticalPaddingClass}`, onMouseDown: evt => this.onMouseDownHandler(evt), tabIndex: -1 }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content ${modalContentHeightMode} ${this.modalSize}` }, h("slot", null))))
126781
126914
  :
126782
126915
  undefined));
126783
126916
  }
126917
+ get _element() { return this; }
126784
126918
  static get watchers() { return {
126785
126919
  "opened": ["observeOpened"]
126786
126920
  }; }
@@ -126804,7 +126938,7 @@ var ModalButtonStatus;
126804
126938
  })(ModalButtonStatus || (ModalButtonStatus = {}));
126805
126939
  const ModalButtonStatus$1 = ModalButtonStatus;
126806
126940
 
126807
- const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
126941
+ const ezModalContainerCss = ".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:clip;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x)}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
126808
126942
 
126809
126943
  const EzModalContainer$1 = class extends HTMLElement$1 {
126810
126944
  constructor() {
@@ -126819,6 +126953,12 @@ const EzModalContainer$1 = class extends HTMLElement$1 {
126819
126953
  this.cancelButtonStatus = undefined;
126820
126954
  this.okButtonStatus = undefined;
126821
126955
  }
126956
+ async handleEzModalAction(event) {
126957
+ var _a;
126958
+ if ((event === null || event === void 0 ? void 0 : event.target) && (event === null || event === void 0 ? void 0 : event.target) === ((_a = this._element) === null || _a === void 0 ? void 0 : _a.parentElement)) {
126959
+ this.closeModal();
126960
+ }
126961
+ }
126822
126962
  cancelIsVisible() {
126823
126963
  return (this.cancelButtonStatus !== ModalButtonStatus$1.HIDDEN && this.cancelButtonLabel != undefined);
126824
126964
  }
@@ -126828,11 +126968,15 @@ const EzModalContainer$1 = class extends HTMLElement$1 {
126828
126968
  componentDidLoad() {
126829
126969
  window.requestAnimationFrame(() => {
126830
126970
  this.ezModalAction.emit(ModalAction$1.LOAD);
126971
+ this._modalRef.focus();
126831
126972
  });
126832
126973
  new KeyboardManager({ propagate: false, element: this._element })
126833
126974
  .bind("Enter", this.ezModalAction.emit.bind(ModalAction$1.OK))
126834
- .bind("Escape", this.ezModalAction.emit.bind(ModalAction$1.CANCEL))
126835
- .bind("Esc", this.ezModalAction.emit.bind(ModalAction$1.CANCEL));
126975
+ .bind("Escape", () => this.closeModal())
126976
+ .bind("Esc", () => this.closeModal());
126977
+ }
126978
+ closeModal() {
126979
+ this.ezModalAction.emit("CLOSE");
126836
126980
  }
126837
126981
  focusLast() {
126838
126982
  if (this._okButton == undefined) {
@@ -126844,8 +126988,9 @@ const EzModalContainer$1 = class extends HTMLElement$1 {
126844
126988
  this._closeButton.focus();
126845
126989
  }
126846
126990
  render() {
126847
- return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", null, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
126991
+ return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--large" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction$1.CLOSE) }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" }))))), h("div", { class: "ez-modal-container__content" }, h("slot", null)), h("div", { class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel, enabled: this.cancelButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel, enabled: this.okButtonStatus !== ModalButtonStatus$1.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction$1.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
126848
126992
  }
126993
+ get _element() { return this; }
126849
126994
  static get style() { return ezModalContainerCss; }
126850
126995
  };
126851
126996
 
@@ -127117,6 +127262,11 @@ const EzNumberInput$1 = class extends HTMLElement$1 {
127117
127262
  }
127118
127263
  this._changePending = false;
127119
127264
  }
127265
+ observePrecision() {
127266
+ if (this._textInput) {
127267
+ this.setInputValue();
127268
+ }
127269
+ }
127120
127270
  validateValue(value) {
127121
127271
  return isNaN(value) || value === undefined ? null : value;
127122
127272
  }
@@ -127200,7 +127350,9 @@ const EzNumberInput$1 = class extends HTMLElement$1 {
127200
127350
  static get watchers() { return {
127201
127351
  "label": ["observeLabel"],
127202
127352
  "errorMessage": ["observeErrorMessage"],
127203
- "value": ["observeValue"]
127353
+ "value": ["observeValue"],
127354
+ "precision": ["observePrecision"],
127355
+ "prettyPrecision": ["observePrecision"]
127204
127356
  }; }
127205
127357
  static get style() { return ezNumberInputCss; }
127206
127358
  };
@@ -127382,10 +127534,18 @@ const EzPopup$1 = class extends HTMLElement$1 {
127382
127534
  this.manageOverflow();
127383
127535
  }
127384
127536
  componentDidLoad() {
127537
+ if (this.opened && this._popupRef) {
127538
+ this._popupRef.focus();
127539
+ }
127385
127540
  new KeyboardManager({ propagate: false, element: this._element })
127386
127541
  .bind("Enter", this.ezPopupAction.emit.bind("OK"))
127387
- .bind("Escape", () => this.opened = false)
127388
- .bind("Esc", () => this.opened = false);
127542
+ .bind("Escape", () => this.closePopup())
127543
+ .bind("Esc", () => this.closePopup());
127544
+ }
127545
+ closePopup() {
127546
+ this.opened = false;
127547
+ this.manageOverflow();
127548
+ this.ezClosePopup.emit();
127389
127549
  }
127390
127550
  manageOverflow() {
127391
127551
  if (this.opened) {
@@ -127397,25 +127557,23 @@ const EzPopup$1 = class extends HTMLElement$1 {
127397
127557
  }
127398
127558
  manageOverlay() {
127399
127559
  if (this.opened) {
127400
- this._overlayId = FloatingManager.subscribeOverlayControl(this._modalRef);
127560
+ this._overlayId = FloatingManager.subscribeOverlayControl(this._popupRef);
127401
127561
  }
127402
127562
  else {
127403
- FloatingManager.unsubscribeOverlayControl(this._modalRef || this._overlayId);
127563
+ FloatingManager.unsubscribeOverlayControl(this._popupRef || this._overlayId);
127404
127564
  }
127405
127565
  }
127406
127566
  getGridSize() {
127407
127567
  return this._sizeClasses[this.size] || this._sizeClasses["medium"];
127408
127568
  }
127409
127569
  componentDidRender() {
127410
- if (this._container) {
127411
- this._container.focus();
127412
- }
127413
127570
  this.manageOverlay();
127414
127571
  }
127415
127572
  render() {
127416
- return (h(Host, null, this.opened ? (h("div", { class: "overlay", ref: ref => this._modalRef = ref }, h("div", { class: "popup col " + this.getGridSize() }, h("div", { class: "popup__container " + (this.heightMode === "auto" ? "popup__container--auto" : ""), ref: elem => this._container = elem, tabIndex: -1 }, h("div", { class: "popup__content" }, h("div", { class: "popup__header " + (this.useHeader ? "popup__header--padding" : "") }, this.useHeader &&
127573
+ return (h(Host, null, this.opened ? (h("div", { class: "overlay", ref: ref => this._popupRef = ref, tabIndex: -1 }, h("div", { class: "popup col " + this.getGridSize() }, h("div", { class: "popup__container " + (this.heightMode === "auto" ? "popup__container--auto" : "") }, h("div", { class: "popup__content" }, h("div", { class: "popup__header " + (this.useHeader ? "popup__header--padding" : "") }, this.useHeader &&
127417
127574
  h(Fragment, null, !!this.ezTitle && h("div", { class: "popup__title" }, this.ezTitle), h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } }))), h("div", { class: "popup__expandable-content" }, h("slot", null))))))) : undefined));
127418
127575
  }
127576
+ get _element() { return this; }
127419
127577
  static get watchers() { return {
127420
127578
  "opened": ["observeConfig"]
127421
127579
  }; }
@@ -127966,9 +128124,12 @@ const EzSearch$1 = class extends HTMLElement$1 {
127966
128124
  }
127967
128125
  scrollToOption(opt) {
127968
128126
  window.requestAnimationFrame(() => {
127969
- const liElem = (opt === null || opt === void 0 ? void 0 : opt.value) ? this._optionsList.querySelector(`div#item_${this.replaceHighlight(opt.value).replace(/[<>\[\]#=]/g, '\\$&').replace(/:/g, '\\:')}`) : undefined;
127970
- if (liElem)
128127
+ const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
128128
+ ? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
128129
+ : undefined;
128130
+ if (liElem) {
127971
128131
  liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
128132
+ }
127972
128133
  });
127973
128134
  }
127974
128135
  selectCurrentOption() {
@@ -131669,15 +131830,15 @@ const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"co
131669
131830
  const EzDropdown = /*@__PURE__*/proxyCustomElement(EzDropdown$1, [1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]);
131670
131831
  const EzFileItem = /*@__PURE__*/proxyCustomElement(EzFileItem$1, [1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]);
131671
131832
  const EzFilterInput = /*@__PURE__*/proxyCustomElement(EzFilterInput$1, [1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"]}]);
131672
- const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"]}]);
131833
+ const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"onlyStaticFields":[4,"only-static-fields"],"_fieldsProps":[32]}]);
131673
131834
  const EzFormView = /*@__PURE__*/proxyCustomElement(EzFormView$1, [2,"ez-form-view",{"fields":[16]}]);
131674
- const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32]},[[0,"ezSelectionChange","onSelectionChange"]]]);
131835
+ const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"_customFormatters":[32]},[[0,"ezSelectionChange","onSelectionChange"]]]);
131675
131836
  const EzGuideNavigator = /*@__PURE__*/proxyCustomElement(EzGuideNavigator$1, [1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32]}]);
131676
131837
  const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]);
131677
131838
  const EzList = /*@__PURE__*/proxyCustomElement(EzList$1, [1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32]}]);
131678
131839
  const EzLoadingBar = /*@__PURE__*/proxyCustomElement(EzLoadingBar$1, [1,"ez-loading-bar",{"_showLoading":[32]}]);
131679
131840
  const EzModal = /*@__PURE__*/proxyCustomElement(EzModal$1, [1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]);
131680
- const EzModalContainer = /*@__PURE__*/proxyCustomElement(EzModalContainer$1, [6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]}]);
131841
+ const EzModalContainer = /*@__PURE__*/proxyCustomElement(EzModalContainer$1, [6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[4,"ezCloseModal","handleEzModalAction"]]]);
131681
131842
  const EzMultiSelectionList = /*@__PURE__*/proxyCustomElement(EzMuiltiSelectionList, [2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32]}]);
131682
131843
  const EzNumberInput = /*@__PURE__*/proxyCustomElement(EzNumberInput$1, [1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513]}]);
131683
131844
  const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"]}]);
@@ -36,10 +36,12 @@ const EzAlertList = class {
36
36
  /**
37
37
  * Retorna o link para o titulo do alerta a partir do id.
38
38
  */
39
- getLinkTitle(item) {
39
+ getLinkActionClick(item) {
40
40
  var _a;
41
- const link = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.link;
42
- return link !== null && link !== void 0 ? link : "#";
41
+ const action = (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === item.id)) === null || _a === void 0 ? void 0 : _a.onClickLink;
42
+ if (action)
43
+ return action;
44
+ return () => { };
43
45
  }
44
46
  /**
45
47
  * Retorna o texto do título do alerta.
@@ -131,7 +133,7 @@ const EzAlertList = class {
131
133
  (h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
132
134
  this.opened = false;
133
135
  }, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
134
- return (h("a", { href: this.getLinkTitle(item), style: {
136
+ return (h("a", { onClick: this.getLinkActionClick(item), style: {
135
137
  fontFamily: "var(--font-pattern, 'Roboto')",
136
138
  fontSize: 'var(--text--medium, 14px)',
137
139
  fontWeight: 'var(--text-weight--medium, 400)',