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

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 +106 -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 +22 -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 +207 -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 +106 -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-30775e7f.entry.js +1 -0
  48. package/dist/ezui/{p-2a1a0e04.entry.js → p-3a21618b.entry.js} +1 -1
  49. package/dist/ezui/p-7c770f14.entry.js +1 -0
  50. package/dist/ezui/{p-db77a984.entry.js → p-836cdfdf.entry.js} +1 -1
  51. package/dist/ezui/p-99f46950.entry.js +1 -0
  52. package/dist/ezui/p-d9401ea0.entry.js +1 -0
  53. package/dist/ezui/p-f3c526cc.entry.js +1 -0
  54. package/dist/ezui/{p-384247cd.entry.js → p-fff3d6bf.entry.js} +1 -1
  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
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-baa5e267.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
- 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)}";
4
+ 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}";
5
5
 
6
6
  const EzButton = class {
7
7
  constructor(hostRef) {
@@ -70,7 +70,7 @@ const EzButton = class {
70
70
  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)));
71
71
  }
72
72
  else if (this.mode == "link") {
73
- 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); } })));
73
+ 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); } })));
74
74
  }
75
75
  else {
76
76
  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); } })));
@@ -150,6 +150,19 @@ const EzFormView = class {
150
150
  async showUp() {
151
151
  this._element.scrollIntoView({ behavior: "smooth", block: "start" });
152
152
  }
153
+ /**
154
+ * Altera/adiciona uma propriedade nos metados do campo.
155
+ */
156
+ async setFieldProp(fieldName, propName, value) {
157
+ const fields = this.fields.map(field => {
158
+ if (field.name === fieldName) {
159
+ field.props = field.props || {};
160
+ field.props[propName] = value;
161
+ }
162
+ return field;
163
+ });
164
+ this.fields = [...fields];
165
+ }
153
166
  groupFields(fields) {
154
167
  const result = new Map();
155
168
  fields.forEach(item => {
@@ -850,10 +850,12 @@ const EzForm = class {
850
850
  this.processMetadata();
851
851
  }
852
852
  };
853
+ this._fieldsProps = new Map();
853
854
  this.dataUnit = undefined;
854
855
  this.config = undefined;
855
856
  this.recordsValidator = undefined;
856
857
  this.fieldToFocus = undefined;
858
+ this.onlyStaticFields = false;
857
859
  }
858
860
  /**
859
861
  * Realiza validação no conteúdo de todos os campos.
@@ -864,6 +866,15 @@ const EzForm = class {
864
866
  observeConfig() {
865
867
  this.processMetadata();
866
868
  }
869
+ /**
870
+ * Altera/adiciona uma propriedade nos metadados do campo.
871
+ */
872
+ async setFieldProp(fieldName, propName, value) {
873
+ const newCustomFieldProps = new Map(this._fieldsProps);
874
+ const currentProps = this._fieldsProps.get(fieldName);
875
+ newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
876
+ this._fieldsProps = newCustomFieldProps;
877
+ }
867
878
  getDynamicContent() {
868
879
  var _a;
869
880
  const formMD = selectFormMetadata(this._store.getState());
@@ -890,10 +901,10 @@ const EzForm = class {
890
901
  }
891
902
  this.ezFormSetFields.emit(fields);
892
903
  const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
893
- return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
904
+ 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 })));
894
905
  }
895
906
  processMetadata() {
896
- if (!this.isStatic() && this.dataUnit && this._store) {
907
+ if (this.bindFields() && this.dataUnit && this._store) {
897
908
  const metadata = buildFormMetadata(this.config, this.dataUnit);
898
909
  this._store.dispatch(loadMetadata(metadata));
899
910
  }
@@ -902,6 +913,9 @@ const EzForm = class {
902
913
  var _a;
903
914
  return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
904
915
  }
916
+ bindFields() {
917
+ return !this.isStatic() || this.onlyStaticFields === false;
918
+ }
905
919
  componentWillLoad() {
906
920
  if (this.dataUnit === undefined) {
907
921
  this.dataUnit = new DataUnit("ez-form");
@@ -921,6 +935,7 @@ const EzForm = class {
921
935
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
922
936
  this.ezReady.emit();
923
937
  this.handleFieldToFocus();
938
+ this.setFieldsProps();
924
939
  }
925
940
  handleFieldToFocus() {
926
941
  var _a;
@@ -937,6 +952,17 @@ const EzForm = class {
937
952
  this.ezFormRequestClearFieldToFocus.emit();
938
953
  });
939
954
  }
955
+ setFieldsProps() {
956
+ if (!this._formView) {
957
+ return;
958
+ }
959
+ for (const [fieldName, props] of this._fieldsProps) {
960
+ for (const prop in props) {
961
+ this._formView.setFieldProp(fieldName, prop, props[prop]);
962
+ }
963
+ this._fieldsProps.delete(fieldName);
964
+ }
965
+ }
940
966
  disconnectedCallback() {
941
967
  this.dataUnit.unsubscribe(this.onDataUnitAction);
942
968
  this._dataBinder.onDisconnectedCallback();
@@ -119699,6 +119699,7 @@ class AgGridController {
119699
119699
  this._gridConfig = [];
119700
119700
  this._filteredColumns = new Map();
119701
119701
  this._filterColumnleftPosition = 0;
119702
+ this._customFormatters = new Map();
119702
119703
  this._enterprise = enterprise;
119703
119704
  }
119704
119705
  getGridConfig() {
@@ -119814,6 +119815,13 @@ class AgGridController {
119814
119815
  headerCheckStatusGetter: () => this.getSelectionHeaderStatus(),
119815
119816
  headerCheckStatusSetter: (selectAll) => this.updateSelectionForAll(selectAll),
119816
119817
  },
119818
+ processCellForClipboard: this.processFormatterCellCallback,
119819
+ defaultExcelExportParams: {
119820
+ processCellCallback: this.processFormatterCellCallback
119821
+ },
119822
+ defaultCsvExportParams: {
119823
+ processCellCallback: this.processFormatterCellCallback
119824
+ }
119817
119825
  };
119818
119826
  this.defineRowModelType(this._gridOptions, options);
119819
119827
  this.setOptionsEvents(this._gridOptions);
@@ -119837,7 +119845,25 @@ class AgGridController {
119837
119845
  this.selectRows((selection === null || selection === void 0 ? void 0 : selection.recordIds) || [], true);
119838
119846
  }
119839
119847
  this._gridOptions.api.setHeaderHeight(this.getHeaderRowHeight());
119848
+ this._customFormatters = options.customFormatters;
119849
+ }
119850
+ }
119851
+ processFormatterCellCallback(params) {
119852
+ const column = params.column.getColDef();
119853
+ if (typeof column.valueFormatter === 'function') {
119854
+ const valueParams = {
119855
+ value: params.value,
119856
+ data: params.node.data,
119857
+ node: params.node,
119858
+ colDef: column,
119859
+ column: params.column,
119860
+ api: params.api,
119861
+ columnApi: params.columnApi,
119862
+ context: params.context,
119863
+ };
119864
+ return column.valueFormatter(valueParams);
119840
119865
  }
119866
+ return params.value;
119841
119867
  }
119842
119868
  setFilterColumnLeftPosition({ type, ePopup }) {
119843
119869
  if (type === 'columnMenu') {
@@ -120187,7 +120213,7 @@ class AgGridController {
120187
120213
  //Como vamos reordenar, precisamos considerar o deslocamento provocado por elas.
120188
120214
  const columnsOffset = colDef.length - columns.length;
120189
120215
  let sort = [];
120190
- state.forEach((cfgColumn, index) => {
120216
+ state === null || state === void 0 ? void 0 : state.forEach((cfgColumn, index) => {
120191
120217
  const colWidth = this.getColumnWidth(cfgColumn);
120192
120218
  this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + columnsOffset);
120193
120219
  this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, colWidth);
@@ -120290,6 +120316,13 @@ class AgGridController {
120290
120316
  if (params.value instanceof Promise) {
120291
120317
  return "Carregando...";
120292
120318
  }
120319
+ const customFormatter = this._customFormatters.get(source.name);
120320
+ if (customFormatter) {
120321
+ const formattedValue = customFormatter.format(params.value, source, params.data.__record__id__);
120322
+ if (formattedValue) {
120323
+ return formattedValue;
120324
+ }
120325
+ }
120293
120326
  if (this._dataUnit) {
120294
120327
  return this._dataUnit.getFormattedValue(source.name, params.value);
120295
120328
  }
@@ -120298,6 +120331,13 @@ class AgGridController {
120298
120331
  cellStyle: this.getStyleByColumn(source),
120299
120332
  });
120300
120333
  }
120334
+ setCustomFormatters(customFormatters) {
120335
+ this._customFormatters = customFormatters;
120336
+ }
120337
+ refreshSelectedRows() {
120338
+ const selectedNodes = this._gridOptions.api.getSelectedNodes();
120339
+ this._gridOptions.api.redrawRows({ rowNodes: selectedNodes });
120340
+ }
120301
120341
  getInitCellStyle() {
120302
120342
  return {
120303
120343
  'line-height': this.getRowHeight() - 1 + 'px',
@@ -120475,9 +120515,32 @@ class AgGridController {
120475
120515
  }
120476
120516
  }
120477
120517
 
120518
+ function enableSelectAll(total) {
120519
+ return total !== undefined;
120520
+ }
120521
+ function buildSelectAllLabel(allRecordSelected, count, total) {
120522
+ if (allRecordSelected)
120523
+ return 'Selecionar apenas a página atual';
120524
+ if (total === undefined)
120525
+ return `Carregando todos os ${count} registros`;
120526
+ return `Selecionar todos os ${total} registros`;
120527
+ }
120528
+ function buildSelectAllTitle(total) {
120529
+ if (enableSelectAll(total))
120530
+ return '';
120531
+ return 'Aguarde o carregamento para selecionar o registro de todas as páginas';
120532
+ }
120533
+ function getText(selectionCount, allSelectedRecords) {
120534
+ if (allSelectedRecords) {
120535
+ return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
120536
+ }
120537
+ const pluralCharacter = selectionCount > 1 ? "s" : "";
120538
+ return `Há <strong>${selectionCount} registro${pluralCharacter}</strong> selecionado${pluralCharacter} na grade.`;
120539
+ }
120540
+
120478
120541
  const SelectionCounter = (props) => {
120479
120542
  const { selectionCount, currentPageSelected, allRecordSelected, paginationInfo, canSelectAll, onSelectAll, onSelectPage, onClearAll, onClose } = props;
120480
- const { total, hasMore } = paginationInfo || {};
120543
+ const { total, hasMore, count } = paginationInfo || {};
120481
120544
  const shouldRenderSelectionButton = () => {
120482
120545
  if ((!allRecordSelected && selectionCount === total) || (allRecordSelected && !hasMore))
120483
120546
  return false;
@@ -120491,20 +120554,11 @@ const SelectionCounter = (props) => {
120491
120554
  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"))),
120492
120555
  h("div", { class: "ez-flex ez-margin-right--medium" },
120493
120556
  shouldRenderSelectionButton() &&
120494
- 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"}`))),
120495
- h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
120557
+ 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"}`))),
120558
+ h("ez-button", Object.assign({ class: "grid__btn-clear", label: "Limpar Sele\u00E7\u00E3o", mode: "link", onClick: onClearAll }, getElementID("ezGridSelectionCounter_clearAll"))))),
120496
120559
  h("button", Object.assign({ class: "grid__btn-close", title: "Fechar", onClick: onClose }, getElementID("ezGridSelectionCounter_close")),
120497
120560
  h("ez-icon", { iconName: "close" })))));
120498
120561
  };
120499
- function getText(selectionCount, allSelectedRecords) {
120500
- if (allSelectedRecords) {
120501
- return `Todos os <strong>${selectionCount} registros</strong> da grade estão selecionados.`;
120502
- }
120503
- else {
120504
- const pluralChar = selectionCount > 1 ? "s" : "";
120505
- return `Há <strong>${selectionCount} registro${pluralChar}</strong> selecionado${pluralChar}.`;
120506
- }
120507
- }
120508
120562
  function getElementID(sufix) {
120509
120563
  return {
120510
120564
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
@@ -120691,6 +120745,7 @@ const EzGrid = class {
120691
120745
  this._currentPageSelected = undefined;
120692
120746
  this._selectionCount = undefined;
120693
120747
  this._hasLeftButtons = false;
120748
+ this._customFormatters = new Map();
120694
120749
  this.multipleSelection = undefined;
120695
120750
  this.config = undefined;
120696
120751
  this.selectionToastConfig = undefined;
@@ -120762,6 +120817,42 @@ const EzGrid = class {
120762
120817
  async filterColumns(search) {
120763
120818
  return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
120764
120819
  }
120820
+ /**
120821
+ * Registra um formatador de valores para uma coluna da grid.
120822
+ */
120823
+ async addCustomValueFormatter(columnName, customFormatter) {
120824
+ if (!columnName || !customFormatter) {
120825
+ return;
120826
+ }
120827
+ const newCustomFormatters = new Map(this._customFormatters);
120828
+ newCustomFormatters.set(columnName, customFormatter);
120829
+ this._customFormatters = newCustomFormatters;
120830
+ this._gridController.setCustomFormatters(newCustomFormatters);
120831
+ }
120832
+ /**
120833
+ * Remove o formatador de valores de uma coluna da grid.
120834
+ */
120835
+ async removeCustomValueFormatter(columnName) {
120836
+ if (!columnName) {
120837
+ return;
120838
+ }
120839
+ const newCustomFormatters = new Map(this._customFormatters);
120840
+ newCustomFormatters.delete(columnName);
120841
+ this._customFormatters = newCustomFormatters;
120842
+ this._gridController.setCustomFormatters(newCustomFormatters);
120843
+ }
120844
+ /**
120845
+ * Atualiza linhas da grade.
120846
+ */
120847
+ async refreshSelectedRows() {
120848
+ this._gridController.refreshSelectedRows();
120849
+ }
120850
+ /**
120851
+ * Retorna o formatador customizado da coluna caso exista.
120852
+ */
120853
+ async getCustomValueFormatter(columnName) {
120854
+ return this._customFormatters.get(columnName);
120855
+ }
120765
120856
  observeConfig(config) {
120766
120857
  this._gridController.setColumnsState(config === null || config === void 0 ? void 0 : config.columns);
120767
120858
  }
@@ -120963,7 +121054,8 @@ const EzGrid = class {
120963
121054
  statusResolver: this.statusResolver,
120964
121055
  useEnterLikeTab: this.useEnterLikeTab,
120965
121056
  recordsValidator: this.recordsValidator,
120966
- editionIsDisabled: () => !this.canEdit
121057
+ editionIsDisabled: () => !this.canEdit,
121058
+ customFormatters: this._customFormatters
120967
121059
  });
120968
121060
  if (this.config) {
120969
121061
  this.observeConfig(this.config);
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
2
  import { KeyboardManager } from '@sankhyalabs/core';
3
3
 
4
4
  var ModalAction;
@@ -18,7 +18,7 @@ var ModalButtonStatus;
18
18
  })(ModalButtonStatus || (ModalButtonStatus = {}));
19
19
  const ModalButtonStatus$1 = ModalButtonStatus;
20
20
 
21
- 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}";
21
+ 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}";
22
22
 
23
23
  const EzModalContainer = class {
24
24
  constructor(hostRef) {
@@ -32,6 +32,12 @@ const EzModalContainer = class {
32
32
  this.cancelButtonStatus = undefined;
33
33
  this.okButtonStatus = undefined;
34
34
  }
35
+ async handleEzModalAction(event) {
36
+ var _a;
37
+ 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)) {
38
+ this.closeModal();
39
+ }
40
+ }
35
41
  cancelIsVisible() {
36
42
  return (this.cancelButtonStatus !== ModalButtonStatus$1.HIDDEN && this.cancelButtonLabel != undefined);
37
43
  }
@@ -41,11 +47,15 @@ const EzModalContainer = class {
41
47
  componentDidLoad() {
42
48
  window.requestAnimationFrame(() => {
43
49
  this.ezModalAction.emit(ModalAction$1.LOAD);
50
+ this._modalRef.focus();
44
51
  });
45
52
  new KeyboardManager({ propagate: false, element: this._element })
46
53
  .bind("Enter", this.ezModalAction.emit.bind(ModalAction$1.OK))
47
- .bind("Escape", this.ezModalAction.emit.bind(ModalAction$1.CANCEL))
48
- .bind("Esc", this.ezModalAction.emit.bind(ModalAction$1.CANCEL));
54
+ .bind("Escape", () => this.closeModal())
55
+ .bind("Esc", () => this.closeModal());
56
+ }
57
+ closeModal() {
58
+ this.ezModalAction.emit("CLOSE");
49
59
  }
50
60
  focusLast() {
51
61
  if (this._okButton == undefined) {
@@ -57,8 +67,9 @@ const EzModalContainer = class {
57
67
  this._closeButton.focus();
58
68
  }
59
69
  render() {
60
- 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() })));
70
+ 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() })));
61
71
  }
72
+ get _element() { return getElement(this); }
62
73
  };
63
74
  EzModalContainer.style = ezModalContainerCss;
64
75
 
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-baa5e267.js';
2
- import { FloatingManager } from '@sankhyalabs/core';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-baa5e267.js';
2
+ import { FloatingManager, KeyboardManager } from '@sankhyalabs/core';
3
3
 
4
4
  const ezModalCss = ":host{--ez-modal-z-index:var(--elevation--12, 12);--ez-modal-vertical-padding:var(--space--large, 24px);--ez-modal-content-padding:24px;display:block}.modal{position:fixed;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh}.modal__screen-light{background:rgba(0, 4, 12, 0.1)}.modal__screen-medium{backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.modal__vertical-padding{padding:var(--ez-modal-vertical-padding) 0}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:var(--ez-modal-content-padding);box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
5
5
 
@@ -8,11 +8,7 @@ const EzModal = class {
8
8
  registerInstance(this, hostRef);
9
9
  this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
10
10
  this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
11
- this.handleKeyboardEvent = (ev) => {
12
- if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
13
- this.closeModal();
14
- }
15
- };
11
+ this.ezModalAction = createEvent(this, "ezModalAction", 7);
16
12
  this.modalSize = undefined;
17
13
  this.align = undefined;
18
14
  this.heightMode = "regular";
@@ -24,11 +20,9 @@ const EzModal = class {
24
20
  observeOpened() {
25
21
  if (this.opened) {
26
22
  this._overlayId = FloatingManager.subscribeOverlayControl(this._modalRef);
27
- document.addEventListener("keydown", this.handleKeyboardEvent);
28
23
  }
29
24
  else {
30
25
  FloatingManager.unsubscribeOverlayControl(this._modalRef || this._overlayId);
31
- document.removeEventListener("keydown", this.handleKeyboardEvent);
32
26
  }
33
27
  }
34
28
  closeModal() {
@@ -37,6 +31,10 @@ const EzModal = class {
37
31
  }
38
32
  componentDidLoad() {
39
33
  this.observeOpened();
34
+ new KeyboardManager({ propagate: false, element: this._element })
35
+ .bind("Enter", this.ezModalAction.emit.bind("OK"))
36
+ .bind("Escape", () => this.closeModal())
37
+ .bind("Esc", () => this.closeModal());
40
38
  }
41
39
  componentDidRender() {
42
40
  if (this.opened) {
@@ -55,10 +53,11 @@ const EzModal = class {
55
53
  const scrimType = `modal__screen-${this.scrim}`;
56
54
  return (h(Host, null, this.opened
57
55
  ?
58
- 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))))
56
+ 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))))
59
57
  :
60
58
  undefined));
61
59
  }
60
+ get _element() { return getElement(this); }
62
61
  static get watchers() { return {
63
62
  "opened": ["observeOpened"]
64
63
  }; }
@@ -89,6 +89,11 @@ const EzNumberInput = class {
89
89
  }
90
90
  this._changePending = false;
91
91
  }
92
+ observePrecision() {
93
+ if (this._textInput) {
94
+ this.setInputValue();
95
+ }
96
+ }
92
97
  validateValue(value) {
93
98
  return isNaN(value) || value === undefined ? null : value;
94
99
  }
@@ -172,7 +177,9 @@ const EzNumberInput = class {
172
177
  static get watchers() { return {
173
178
  "label": ["observeLabel"],
174
179
  "errorMessage": ["observeErrorMessage"],
175
- "value": ["observeValue"]
180
+ "value": ["observeValue"],
181
+ "precision": ["observePrecision"],
182
+ "prettyPrecision": ["observePrecision"]
176
183
  }; }
177
184
  };
178
185
  EzNumberInput.style = ezNumberInputCss;
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-baa5e267.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-baa5e267.js';
2
2
  import { KeyboardManager, FloatingManager } from '@sankhyalabs/core';
3
3
 
4
4
  const ezPopupCss = ":host{display:flex;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, \"Roboto\");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__container--auto{height:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;height:calc(100% - 44px)}.popup__header{width:100%;display:flex}.popup__header--padding{padding-bottom:var(--ez-popup__header--padding-bottom)}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
@@ -26,10 +26,18 @@ const EzPopup = class {
26
26
  this.manageOverflow();
27
27
  }
28
28
  componentDidLoad() {
29
+ if (this.opened && this._popupRef) {
30
+ this._popupRef.focus();
31
+ }
29
32
  new KeyboardManager({ propagate: false, element: this._element })
30
33
  .bind("Enter", this.ezPopupAction.emit.bind("OK"))
31
- .bind("Escape", () => this.opened = false)
32
- .bind("Esc", () => this.opened = false);
34
+ .bind("Escape", () => this.closePopup())
35
+ .bind("Esc", () => this.closePopup());
36
+ }
37
+ closePopup() {
38
+ this.opened = false;
39
+ this.manageOverflow();
40
+ this.ezClosePopup.emit();
33
41
  }
34
42
  manageOverflow() {
35
43
  if (this.opened) {
@@ -41,25 +49,23 @@ const EzPopup = class {
41
49
  }
42
50
  manageOverlay() {
43
51
  if (this.opened) {
44
- this._overlayId = FloatingManager.subscribeOverlayControl(this._modalRef);
52
+ this._overlayId = FloatingManager.subscribeOverlayControl(this._popupRef);
45
53
  }
46
54
  else {
47
- FloatingManager.unsubscribeOverlayControl(this._modalRef || this._overlayId);
55
+ FloatingManager.unsubscribeOverlayControl(this._popupRef || this._overlayId);
48
56
  }
49
57
  }
50
58
  getGridSize() {
51
59
  return this._sizeClasses[this.size] || this._sizeClasses["medium"];
52
60
  }
53
61
  componentDidRender() {
54
- if (this._container) {
55
- this._container.focus();
56
- }
57
62
  this.manageOverlay();
58
63
  }
59
64
  render() {
60
- 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 &&
65
+ 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 &&
61
66
  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));
62
67
  }
68
+ get _element() { return getElement(this); }
63
69
  static get watchers() { return {
64
70
  "opened": ["observeConfig"]
65
71
  }; }
@@ -315,9 +315,12 @@ const EzSearch = class {
315
315
  }
316
316
  scrollToOption(opt) {
317
317
  window.requestAnimationFrame(() => {
318
- 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;
319
- if (liElem)
318
+ const liElem = (opt === null || opt === void 0 ? void 0 : opt.value)
319
+ ? this._optionsList.querySelector(`div#item_${opt.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g, '\\$1')}`)
320
+ : undefined;
321
+ if (liElem) {
320
322
  liElem.scrollIntoView({ behavior: "smooth", block: "nearest" });
323
+ }
321
324
  });
322
325
  }
323
326
  selectCurrentOption() {