@sankhyalabs/ezui 5.16.0-rc.1 → 5.17.0-dev.1

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 (46) hide show
  1. package/dist/cjs/ez-actions-button.cjs.entry.js +53 -25
  2. package/dist/cjs/ez-combo-box.cjs.entry.js +4 -3
  3. package/dist/cjs/ez-form.cjs.entry.js +30 -0
  4. package/dist/cjs/ez-grid.cjs.entry.js +20 -0
  5. package/dist/cjs/ez-search.cjs.entry.js +2 -1
  6. package/dist/cjs/ezui.cjs.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/ez-actions-button/ez-actions-button.css +4 -0
  9. package/dist/collection/components/ez-actions-button/ez-actions-button.js +104 -26
  10. package/dist/collection/components/ez-combo-box/ez-combo-box.js +22 -3
  11. package/dist/collection/components/ez-form/ez-form.js +73 -0
  12. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +3 -0
  13. package/dist/collection/components/ez-grid/ez-grid.js +63 -1
  14. package/dist/collection/components/ez-search/ez-search.js +20 -1
  15. package/dist/collection/utils/form/DataBinder.js +10 -0
  16. package/dist/collection/utils/interfaces/IAction.js +1 -0
  17. package/dist/custom-elements/index.js +112 -32
  18. package/dist/esm/ez-actions-button.entry.js +53 -25
  19. package/dist/esm/ez-combo-box.entry.js +4 -3
  20. package/dist/esm/ez-form.entry.js +30 -0
  21. package/dist/esm/ez-grid.entry.js +20 -0
  22. package/dist/esm/ez-search.entry.js +2 -1
  23. package/dist/esm/ezui.js +1 -1
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/ezui/ezui.esm.js +1 -1
  26. package/dist/ezui/p-3e7cc8a4.entry.js +1 -0
  27. package/dist/ezui/p-8252d9b5.entry.js +1 -0
  28. package/dist/ezui/{p-00dd6f68.entry.js → p-8a7533c9.entry.js} +1 -1
  29. package/dist/ezui/p-f8653522.entry.js +1 -0
  30. package/dist/ezui/p-ffa8ec98.entry.js +1 -0
  31. package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +15 -7
  32. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +4 -1
  33. package/dist/types/components/ez-form/ez-form.d.ts +14 -1
  34. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +4 -0
  35. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
  36. package/dist/types/components/ez-grid/ez-grid.d.ts +8 -0
  37. package/dist/types/components/ez-search/ez-search.d.ts +4 -0
  38. package/dist/types/components.d.ts +54 -2
  39. package/dist/types/utils/form/DataBinder.d.ts +1 -0
  40. package/dist/types/utils/index.d.ts +1 -0
  41. package/dist/types/utils/interfaces/IAction.d.ts +7 -0
  42. package/package.json +1 -1
  43. package/dist/ezui/p-07e537da.entry.js +0 -1
  44. package/dist/ezui/p-7526f2b6.entry.js +0 -1
  45. package/dist/ezui/p-b0663be7.entry.js +0 -1
  46. package/dist/ezui/p-b806cd19.entry.js +0 -1
@@ -643,6 +643,16 @@ class DataBinder {
643
643
  this.updateErrorMessage(field.name, fieldElement, field.message);
644
644
  }
645
645
  }
646
+ setFocus(fieldName) {
647
+ if (!this._fields.has(fieldName)) {
648
+ return;
649
+ }
650
+ const fieldElement = this._fields.get(fieldName).field;
651
+ if (typeof fieldElement["setFocus"] != "function") {
652
+ return;
653
+ }
654
+ fieldElement["setFocus"]();
655
+ }
646
656
  clearInvalid(recordId) {
647
657
  this._dataUnit.clearInvalid(recordId);
648
658
  this._fields.forEach(fieldBinder => {
@@ -849,7 +859,7 @@ class Bind {
849
859
  }
850
860
  }
851
861
 
852
- const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__actions-list--z-index:var(--ez-elevation--8, 8);--ez-actions-button__actions-max-height:415px;--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;overflow-y:auto;scrollbar-width:thin;z-index:var(--ez-actions-button__actions-list--z-index);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--max-height{max-height:var(--ez-actions-button__actions-max-height)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;z-index:calc(var(--ez-actions-button__actions-list--z-index) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 2px) * -1)}.ez-actions-button__arrow--small{margin-left:6px}.ez-actions-button__arrow--medium{margin-left:11px}.ez-actions-button__arrow--large{margin-left:13px}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}";
862
+ const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__actions-list--z-index:var(--ez-elevation--8, 8);--ez-actions-button__actions-max-height:415px;--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;overflow-y:auto;scrollbar-width:thin;z-index:var(--ez-actions-button__actions-list--z-index);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--max-height{max-height:var(--ez-actions-button__actions-max-height)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;z-index:calc(var(--ez-actions-button__actions-list--z-index) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 2px) * -1)}.ez-actions-button__arrow--small{margin-left:6px}.ez-actions-button__arrow--medium{margin-left:11px}.ez-actions-button__arrow--large{margin-left:13px}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}.ez-actions-button--bottom-padding{padding-bottom:var(--space--small, 6px)}";
853
863
 
854
864
  const EzActionsButton$1 = class extends HTMLElement$1 {
855
865
  constructor() {
@@ -857,6 +867,8 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
857
867
  this.__registerHost();
858
868
  this.__attachShadow();
859
869
  this.ezAction = createEvent(this, "ezAction", 7);
870
+ this.ezPopoverOpen = createEvent(this, "ezPopoverOpen", 7);
871
+ this.ezDisconnectedActionButtons = createEvent(this, "ezDisconnectedActionButtons", 7);
860
872
  this._arrowOffset = 5;
861
873
  this.innerClickCheck = (floatingContainer, node) => {
862
874
  var _a;
@@ -870,6 +882,12 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
870
882
  return true;
871
883
  }
872
884
  }
885
+ do {
886
+ if (floatingContainer.contains(node)) {
887
+ return true;
888
+ }
889
+ node = node.offsetParent;
890
+ } while (node != undefined && node != document.getRootNode());
873
891
  }
874
892
  return false;
875
893
  };
@@ -893,6 +911,25 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
893
911
  }
894
912
  this._floatingID = undefined;
895
913
  }
914
+ /**
915
+ * Apresenta a lista de ações.
916
+ */
917
+ async showActions() {
918
+ if (!this.enabled) {
919
+ return;
920
+ }
921
+ const options = this.getFloatOptions();
922
+ this._floatingID = FloatingManager.float(this._actionsList, this._listContainer, options);
923
+ const sideLimit = this.getSideLimit();
924
+ if (sideLimit != undefined) {
925
+ options.left = sideLimit;
926
+ FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
927
+ }
928
+ window.requestAnimationFrame(() => {
929
+ this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
930
+ });
931
+ this.ezPopoverOpen.emit(this._actionsList);
932
+ }
896
933
  /**
897
934
  * Verifica se a lista de ações está aberta.
898
935
  */
@@ -905,7 +942,8 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
905
942
  innerClickTest: this.innerClickCheck,
906
943
  isFixed: true,
907
944
  top: this.getPositionTop(),
908
- left: this.getPositionLeft()
945
+ left: this.getPositionLeft(),
946
+ backClickListener: () => this._floatingID = undefined
909
947
  };
910
948
  }
911
949
  getSideLimit() {
@@ -917,21 +955,6 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
917
955
  }
918
956
  return;
919
957
  }
920
- showActions() {
921
- if (!this.enabled) {
922
- return;
923
- }
924
- const options = this.getFloatOptions();
925
- this._floatingID = FloatingManager.float(this._actionsList, this._listContainer, options);
926
- const sideLimit = this.getSideLimit();
927
- if (sideLimit != undefined) {
928
- options.left = sideLimit;
929
- FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
930
- }
931
- window.requestAnimationFrame(() => {
932
- this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
933
- });
934
- }
935
958
  updatePosition() {
936
959
  if (!this.enabled || this._floatingID == undefined) {
937
960
  return;
@@ -1014,14 +1037,18 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
1014
1037
  }
1015
1038
  }
1016
1039
  }
1040
+ disconnectedCallback() {
1041
+ this.ezDisconnectedActionButtons.emit();
1042
+ }
1017
1043
  componentDidLoad() {
1018
1044
  CSSVarsUtils.applyVarsButton(this._element, this._button);
1019
1045
  ElementIDUtils.addIDInfo(this._element);
1020
1046
  this.controlScrollPage();
1021
1047
  }
1022
1048
  componentDidRender() {
1049
+ var _a;
1023
1050
  if (this._floatingID == undefined) {
1024
- this._actionsList.remove();
1051
+ (_a = this._actionsList) === null || _a === void 0 ? void 0 : _a.remove();
1025
1052
  }
1026
1053
  if (this.hasLabelOrCheckOption()) {
1027
1054
  if (!!this.value) {
@@ -1032,6 +1059,23 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
1032
1059
  }
1033
1060
  }
1034
1061
  }
1062
+ buildActionElement(action) {
1063
+ var _a;
1064
+ if (!action) {
1065
+ return;
1066
+ }
1067
+ if (action.itemBuilder != undefined) {
1068
+ const customContent = action.itemBuilder(this._element, action);
1069
+ if (typeof customContent === "string") {
1070
+ return h("div", { class: "ez-actions-button__btn-action", innerHTML: customContent });
1071
+ }
1072
+ return customContent;
1073
+ }
1074
+ return h("ez-button", { size: "small", label: action.label, onClick: () => this.actionClick(action), enabled: action.enabled, class: "ez-actions-button__btn-action" +
1075
+ (this.checkOption || this.hasIconName() ? " ez-actions-button__btn-action--spaced" : "") }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
1076
+ h("ez-icon", { class: "ez-actions-button__icon-check", slot: "leftIcon", size: "small", iconName: "check" }), !this.checkOption && action.iconName &&
1077
+ h("ez-icon", { class: "ez-actions-button__icon-item", slot: "leftIcon", size: "small", iconName: action.iconName }));
1078
+ }
1035
1079
  render() {
1036
1080
  var _a;
1037
1081
  return (h(Host, null, h("ez-button", { ref: elem => this._button = elem, class: (this.isTransparent ? "ez-actions-button__btn-transparent" : "") +
@@ -1039,13 +1083,7 @@ const EzActionsButton$1 = class extends HTMLElement$1 {
1039
1083
  h("ez-icon", { class: "ez-actions-button__icon-right", slot: "rightIcon", iconName: this.displayIcon || "dots-vertical" })), h("section", { class: "ez-actions-button__list-container", ref: elem => this._listContainer = elem }, this.arrowActive &&
1040
1084
  h("div", { class: "ez-actions-button__arrow ez-actions-button__arrow--" + (this.size || "small") +
1041
1085
  (this.isTransparent ? " ez-actions-button__arrow--upped" : "") }), h("div", { ref: elem => this._actionsList = elem, class: "ez-actions-button__actions-list ez-actions-button__actions-list--max-height" +
1042
- (this.arrowActive && !this.isTransparent ? " ez-actions-button__actions-list--lowered" : "") }, this.actions.map(action => {
1043
- var _a;
1044
- return h("ez-button", { size: "small", label: action.label, onClick: () => this.actionClick(action), enabled: action.enabled, class: "ez-actions-button__btn-action" +
1045
- (this.checkOption || this.hasIconName() ? " ez-actions-button__btn-action--spaced" : "") }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
1046
- h("ez-icon", { class: "ez-actions-button__icon-check", slot: "leftIcon", size: "small", iconName: "check" }), !this.checkOption && action.iconName &&
1047
- h("ez-icon", { class: "ez-actions-button__icon-item", slot: "leftIcon", size: "small", iconName: action.iconName }));
1048
- })))));
1086
+ (this.arrowActive && !this.isTransparent ? " ez-actions-button__actions-list--lowered" : "") }, this.actions.map(action => this.buildActionElement(action))))));
1049
1087
  }
1050
1088
  get _element() { return this; }
1051
1089
  static get style() { return ezActionsButtonCss; }
@@ -2261,7 +2299,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2261
2299
  this.__attachShadow();
2262
2300
  this.ezChange = createEvent(this, "ezChange", 7);
2263
2301
  this._changeDeboucingTimeout = null;
2264
- this._limitCharsToSearch = 3;
2265
2302
  this._deboucingTime = 300;
2266
2303
  this._maxWidthValue = 0;
2267
2304
  this._tabPressed = false;
@@ -2273,6 +2310,7 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2273
2310
  this._startLoading = false;
2274
2311
  this._showLoading = true;
2275
2312
  this._criteria = undefined;
2313
+ this.limitCharsToSearch = 3;
2276
2314
  this.value = undefined;
2277
2315
  this.label = undefined;
2278
2316
  this.enabled = true;
@@ -2811,7 +2849,6 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2811
2849
  return;
2812
2850
  }
2813
2851
  const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
2814
- const argumentNumber = this.buildNumberArgument(argument);
2815
2852
  if (!this._criteria) {
2816
2853
  this._textInput.value = event.data || argument;
2817
2854
  }
@@ -2820,7 +2857,9 @@ const EzComboBox$1 = class extends HTMLElement$1 {
2820
2857
  if (this.searchMode) {
2821
2858
  this._showLoading = false;
2822
2859
  this.clearSource();
2823
- if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
2860
+ const enoughChars = argument.length >= this.limitCharsToSearch;
2861
+ const argumentNumber = this.buildNumberArgument(argument);
2862
+ if (enoughChars || !isNaN(argumentNumber)) {
2824
2863
  this._showLoading = true;
2825
2864
  this._changeDeboucingTimeout = window.setTimeout(() => {
2826
2865
  this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
@@ -4611,6 +4650,8 @@ const EzForm$1 = class extends HTMLElement$1 {
4611
4650
  constructor() {
4612
4651
  super();
4613
4652
  this.__registerHost();
4653
+ this.ezFormRequestClearFieldToFocus = createEvent(this, "ezFormRequestClearFieldToFocus", 7);
4654
+ this.ezFormSetFields = createEvent(this, "ezFormSetFields", 7);
4614
4655
  this.ezReady = createEvent(this, "ezReady", 7);
4615
4656
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
4616
4657
  this.onDataUnitAction = (action) => {
@@ -4621,6 +4662,7 @@ const EzForm$1 = class extends HTMLElement$1 {
4621
4662
  this.dataUnit = undefined;
4622
4663
  this.config = undefined;
4623
4664
  this.recordsValidator = undefined;
4665
+ this.fieldToFocus = undefined;
4624
4666
  }
4625
4667
  /**
4626
4668
  * Realiza validação no conteúdo de todos os campos.
@@ -4655,6 +4697,7 @@ const EzForm$1 = class extends HTMLElement$1 {
4655
4697
  if (currentSheet == undefined) {
4656
4698
  return;
4657
4699
  }
4700
+ this.ezFormSetFields.emit(fields);
4658
4701
  const idFormSheet = `${StringUtils$1.replaceAccentuatedChars(StringUtils$1.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
4659
4702
  return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
4660
4703
  }
@@ -4686,6 +4729,22 @@ const EzForm$1 = class extends HTMLElement$1 {
4686
4729
  metadata.addRequiredFields(this._staticFields.filter(f => f.dataset.required).map(f => f.dataset.fieldName));
4687
4730
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
4688
4731
  this.ezReady.emit();
4732
+ this.handleFieldToFocus();
4733
+ }
4734
+ handleFieldToFocus() {
4735
+ var _a;
4736
+ if (this.fieldToFocus == undefined) {
4737
+ return;
4738
+ }
4739
+ const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
4740
+ const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
4741
+ if (!fields.some(item => item.name === this.fieldToFocus)) {
4742
+ return;
4743
+ }
4744
+ requestAnimationFrame(() => {
4745
+ this._dataBinder.setFocus(this.fieldToFocus);
4746
+ this.ezFormRequestClearFieldToFocus.emit();
4747
+ });
4689
4748
  }
4690
4749
  disconnectedCallback() {
4691
4750
  this.dataUnit.unsubscribe(this.onDataUnitAction);
@@ -124565,6 +124624,9 @@ class AgGridController {
124565
124624
  getGridConfig() {
124566
124625
  return this._gridConfig;
124567
124626
  }
124627
+ locateColumn(columnName) {
124628
+ this._gridOptions.api.ensureColumnVisible(columnName);
124629
+ }
124568
124630
  getSort(_dataUnitName, defaultSorting) {
124569
124631
  const sortedColumns = [];
124570
124632
  this._gridOptions.columnApi
@@ -125507,6 +125569,11 @@ class InMemoryFilterColumnDataSource {
125507
125569
  const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}";
125508
125570
 
125509
125571
  const windowInstace$1 = window;
125572
+ const matches = (text, filter) => {
125573
+ const normalizedText = StringUtils$1.replaceAccentuatedCharsLower(text.toLocaleLowerCase());
125574
+ const normalizedFilter = StringUtils$1.replaceAccentuatedCharsLower(filter.toLocaleLowerCase());
125575
+ return normalizedText.includes(normalizedFilter);
125576
+ };
125510
125577
  const EzGrid$1 = class extends HTMLElement$1 {
125511
125578
  constructor() {
125512
125579
  super();
@@ -125584,6 +125651,18 @@ const EzGrid$1 = class extends HTMLElement$1 {
125584
125651
  async quickFilter(term) {
125585
125652
  this._gridController.quickFilter(term);
125586
125653
  }
125654
+ /**
125655
+ * Localiza determinada coluna tornando-a visível.
125656
+ */
125657
+ async locateColumn(columnName) {
125658
+ this._gridController.locateColumn(columnName);
125659
+ }
125660
+ /**
125661
+ * Usa um argumento para filtrar as colunas po label
125662
+ */
125663
+ async filterColumns(search) {
125664
+ return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
125665
+ }
125587
125666
  observeConfig(config) {
125588
125667
  this._gridController.setColumnsState(config.columns);
125589
125668
  }
@@ -127493,6 +127572,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
127493
127572
  this.hideErrorOnFocusOut = true;
127494
127573
  this.listOptionsPosition = undefined;
127495
127574
  this.isTextSearch = false;
127575
+ this.ignoreLimitCharsToSearch = false;
127496
127576
  }
127497
127577
  observeErrorMessage() {
127498
127578
  if (this._comboElement) {
@@ -127550,7 +127630,7 @@ const EzSearch$1 = class extends HTMLElement$1 {
127550
127630
  }
127551
127631
  render() {
127552
127632
  ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
127553
- return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, hideErrorOnFocusOut: this.hideErrorOnFocusOut, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode, canShowError: this.canShowError, listOptionsPosition: this.listOptionsPosition, isTextSearch: this.isTextSearch }));
127633
+ return (h("ez-combo-box", { "data-element-id": ElementIDUtils.getInternalIDInfo("combo"), ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, hideErrorOnFocusOut: this.hideErrorOnFocusOut, optionLoader: this.optionLoader, searchMode: true, onEzChange: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode, canShowError: this.canShowError, listOptionsPosition: this.listOptionsPosition, isTextSearch: this.isTextSearch, limitCharsToSearch: this.ignoreLimitCharsToSearch ? 0 : 3 }));
127554
127634
  }
127555
127635
  ;
127556
127636
  get _elem() { return this; }
@@ -129858,14 +129938,14 @@ const EzCardItem = /*@__PURE__*/proxyCustomElement(EzCardItem$1, [1,"ez-card-ite
129858
129938
  const EzCheck = /*@__PURE__*/proxyCustomElement(EzCheck$1, [1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4]}]);
129859
129939
  const EzChip = /*@__PURE__*/proxyCustomElement(EzChip$1, [1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"]}]);
129860
129940
  const EzCollapsibleBox = /*@__PURE__*/proxyCustomElement(EzCollapsibleBox$1, [1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32]}]);
129861
- const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
129941
+ const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"searchMode":[4,"search-mode"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32]},[[11,"scroll","scrollListener"]]]);
129862
129942
  const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"]}]);
129863
129943
  const EzDateTimeInput = /*@__PURE__*/proxyCustomElement(EzDateTimeInput$1, [1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"]}]);
129864
129944
  const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040]},[[8,"keydown","handleKeyDown"]]]);
129865
129945
  const EzDropdown = /*@__PURE__*/proxyCustomElement(EzDropdown$1, [1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]);
129866
129946
  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]}]);
129867
129947
  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"]}]);
129868
- const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16]}]);
129948
+ const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"]}]);
129869
129949
  const EzFormView = /*@__PURE__*/proxyCustomElement(EzFormView$1, [2,"ez-form-view",{"fields":[16]}]);
129870
129950
  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"]]]);
129871
129951
  const EzGuideNavigator = /*@__PURE__*/proxyCustomElement(EzGuideNavigator$1, [1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32]}]);
@@ -129880,7 +129960,7 @@ const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{
129880
129960
  const EzPopup = /*@__PURE__*/proxyCustomElement(EzPopup$1, [1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]}]);
129881
129961
  const EzRadioButton = /*@__PURE__*/proxyCustomElement(EzRadioButton$1, [1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]);
129882
129962
  const EzScroller = /*@__PURE__*/proxyCustomElement(EzScroller$1, [1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]);
129883
- const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"]}]);
129963
+ const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"]}]);
129884
129964
  const EzSidebarButton = /*@__PURE__*/proxyCustomElement(EzSidebarButton$1, [1,"ez-sidebar-button"]);
129885
129965
  const EzSkeleton = /*@__PURE__*/proxyCustomElement(EzSkeleton$1, [0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]);
129886
129966
  const EzTabselector = /*@__PURE__*/proxyCustomElement(EzTabselector$1, [1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]);
@@ -5,12 +5,14 @@ import { C as CSSVarsUtils } from './CSSVarsUtils-a97cfa29.js';
5
5
  import './DialogType-54a62731.js';
6
6
  import './CheckMode-bdb2ec19.js';
7
7
 
8
- const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__actions-list--z-index:var(--ez-elevation--8, 8);--ez-actions-button__actions-max-height:415px;--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;overflow-y:auto;scrollbar-width:thin;z-index:var(--ez-actions-button__actions-list--z-index);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--max-height{max-height:var(--ez-actions-button__actions-max-height)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;z-index:calc(var(--ez-actions-button__actions-list--z-index) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 2px) * -1)}.ez-actions-button__arrow--small{margin-left:6px}.ez-actions-button__arrow--medium{margin-left:11px}.ez-actions-button__arrow--large{margin-left:13px}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}";
8
+ const ezActionsButtonCss = ":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__actions-list--z-index:var(--ez-elevation--8, 8);--ez-actions-button__actions-max-height:415px;--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;overflow-y:auto;scrollbar-width:thin;z-index:var(--ez-actions-button__actions-list--z-index);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--max-height{max-height:var(--ez-actions-button__actions-max-height)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;z-index:calc(var(--ez-actions-button__actions-list--z-index) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 2px) * -1)}.ez-actions-button__arrow--small{margin-left:6px}.ez-actions-button__arrow--medium{margin-left:11px}.ez-actions-button__arrow--large{margin-left:13px}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}.ez-actions-button--bottom-padding{padding-bottom:var(--space--small, 6px)}";
9
9
 
10
10
  const EzActionsButton = class {
11
11
  constructor(hostRef) {
12
12
  registerInstance(this, hostRef);
13
13
  this.ezAction = createEvent(this, "ezAction", 7);
14
+ this.ezPopoverOpen = createEvent(this, "ezPopoverOpen", 7);
15
+ this.ezDisconnectedActionButtons = createEvent(this, "ezDisconnectedActionButtons", 7);
14
16
  this._arrowOffset = 5;
15
17
  this.innerClickCheck = (floatingContainer, node) => {
16
18
  var _a;
@@ -24,6 +26,12 @@ const EzActionsButton = class {
24
26
  return true;
25
27
  }
26
28
  }
29
+ do {
30
+ if (floatingContainer.contains(node)) {
31
+ return true;
32
+ }
33
+ node = node.offsetParent;
34
+ } while (node != undefined && node != document.getRootNode());
27
35
  }
28
36
  return false;
29
37
  };
@@ -47,6 +55,25 @@ const EzActionsButton = class {
47
55
  }
48
56
  this._floatingID = undefined;
49
57
  }
58
+ /**
59
+ * Apresenta a lista de ações.
60
+ */
61
+ async showActions() {
62
+ if (!this.enabled) {
63
+ return;
64
+ }
65
+ const options = this.getFloatOptions();
66
+ this._floatingID = FloatingManager.float(this._actionsList, this._listContainer, options);
67
+ const sideLimit = this.getSideLimit();
68
+ if (sideLimit != undefined) {
69
+ options.left = sideLimit;
70
+ FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
71
+ }
72
+ window.requestAnimationFrame(() => {
73
+ this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
74
+ });
75
+ this.ezPopoverOpen.emit(this._actionsList);
76
+ }
50
77
  /**
51
78
  * Verifica se a lista de ações está aberta.
52
79
  */
@@ -59,7 +86,8 @@ const EzActionsButton = class {
59
86
  innerClickTest: this.innerClickCheck,
60
87
  isFixed: true,
61
88
  top: this.getPositionTop(),
62
- left: this.getPositionLeft()
89
+ left: this.getPositionLeft(),
90
+ backClickListener: () => this._floatingID = undefined
63
91
  };
64
92
  }
65
93
  getSideLimit() {
@@ -71,21 +99,6 @@ const EzActionsButton = class {
71
99
  }
72
100
  return;
73
101
  }
74
- showActions() {
75
- if (!this.enabled) {
76
- return;
77
- }
78
- const options = this.getFloatOptions();
79
- this._floatingID = FloatingManager.float(this._actionsList, this._listContainer, options);
80
- const sideLimit = this.getSideLimit();
81
- if (sideLimit != undefined) {
82
- options.left = sideLimit;
83
- FloatingManager.updateFloatPosition(this._actionsList, this._listContainer, options);
84
- }
85
- window.requestAnimationFrame(() => {
86
- this._actionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
87
- });
88
- }
89
102
  updatePosition() {
90
103
  if (!this.enabled || this._floatingID == undefined) {
91
104
  return;
@@ -168,14 +181,18 @@ const EzActionsButton = class {
168
181
  }
169
182
  }
170
183
  }
184
+ disconnectedCallback() {
185
+ this.ezDisconnectedActionButtons.emit();
186
+ }
171
187
  componentDidLoad() {
172
188
  CSSVarsUtils.applyVarsButton(this._element, this._button);
173
189
  ElementIDUtils.addIDInfo(this._element);
174
190
  this.controlScrollPage();
175
191
  }
176
192
  componentDidRender() {
193
+ var _a;
177
194
  if (this._floatingID == undefined) {
178
- this._actionsList.remove();
195
+ (_a = this._actionsList) === null || _a === void 0 ? void 0 : _a.remove();
179
196
  }
180
197
  if (this.hasLabelOrCheckOption()) {
181
198
  if (!!this.value) {
@@ -186,6 +203,23 @@ const EzActionsButton = class {
186
203
  }
187
204
  }
188
205
  }
206
+ buildActionElement(action) {
207
+ var _a;
208
+ if (!action) {
209
+ return;
210
+ }
211
+ if (action.itemBuilder != undefined) {
212
+ const customContent = action.itemBuilder(this._element, action);
213
+ if (typeof customContent === "string") {
214
+ return h("div", { class: "ez-actions-button__btn-action", innerHTML: customContent });
215
+ }
216
+ return customContent;
217
+ }
218
+ return h("ez-button", { size: "small", label: action.label, onClick: () => this.actionClick(action), enabled: action.enabled, class: "ez-actions-button__btn-action" +
219
+ (this.checkOption || this.hasIconName() ? " ez-actions-button__btn-action--spaced" : "") }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
220
+ h("ez-icon", { class: "ez-actions-button__icon-check", slot: "leftIcon", size: "small", iconName: "check" }), !this.checkOption && action.iconName &&
221
+ h("ez-icon", { class: "ez-actions-button__icon-item", slot: "leftIcon", size: "small", iconName: action.iconName }));
222
+ }
189
223
  render() {
190
224
  var _a;
191
225
  return (h(Host, null, h("ez-button", { ref: elem => this._button = elem, class: (this.isTransparent ? "ez-actions-button__btn-transparent" : "") +
@@ -193,13 +227,7 @@ const EzActionsButton = class {
193
227
  h("ez-icon", { class: "ez-actions-button__icon-right", slot: "rightIcon", iconName: this.displayIcon || "dots-vertical" })), h("section", { class: "ez-actions-button__list-container", ref: elem => this._listContainer = elem }, this.arrowActive &&
194
228
  h("div", { class: "ez-actions-button__arrow ez-actions-button__arrow--" + (this.size || "small") +
195
229
  (this.isTransparent ? " ez-actions-button__arrow--upped" : "") }), h("div", { ref: elem => this._actionsList = elem, class: "ez-actions-button__actions-list ez-actions-button__actions-list--max-height" +
196
- (this.arrowActive && !this.isTransparent ? " ez-actions-button__actions-list--lowered" : "") }, this.actions.map(action => {
197
- var _a;
198
- return h("ez-button", { size: "small", label: action.label, onClick: () => this.actionClick(action), enabled: action.enabled, class: "ez-actions-button__btn-action" +
199
- (this.checkOption || this.hasIconName() ? " ez-actions-button__btn-action--spaced" : "") }, this.checkOption && ((_a = this._selectedAction) === null || _a === void 0 ? void 0 : _a.value) === action.value &&
200
- h("ez-icon", { class: "ez-actions-button__icon-check", slot: "leftIcon", size: "small", iconName: "check" }), !this.checkOption && action.iconName &&
201
- h("ez-icon", { class: "ez-actions-button__icon-item", slot: "leftIcon", size: "small", iconName: action.iconName }));
202
- })))));
230
+ (this.arrowActive && !this.isTransparent ? " ez-actions-button__actions-list--lowered" : "") }, this.actions.map(action => this.buildActionElement(action))))));
203
231
  }
204
232
  get _element() { return getElement(this); }
205
233
  };
@@ -13,7 +13,6 @@ const EzComboBox = class {
13
13
  registerInstance(this, hostRef);
14
14
  this.ezChange = createEvent(this, "ezChange", 7);
15
15
  this._changeDeboucingTimeout = null;
16
- this._limitCharsToSearch = 3;
17
16
  this._deboucingTime = 300;
18
17
  this._maxWidthValue = 0;
19
18
  this._tabPressed = false;
@@ -25,6 +24,7 @@ const EzComboBox = class {
25
24
  this._startLoading = false;
26
25
  this._showLoading = true;
27
26
  this._criteria = undefined;
27
+ this.limitCharsToSearch = 3;
28
28
  this.value = undefined;
29
29
  this.label = undefined;
30
30
  this.enabled = true;
@@ -563,7 +563,6 @@ const EzComboBox = class {
563
563
  return;
564
564
  }
565
565
  const argument = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.trim();
566
- const argumentNumber = this.buildNumberArgument(argument);
567
566
  if (!this._criteria) {
568
567
  this._textInput.value = event.data || argument;
569
568
  }
@@ -572,7 +571,9 @@ const EzComboBox = class {
572
571
  if (this.searchMode) {
573
572
  this._showLoading = false;
574
573
  this.clearSource();
575
- if (!isNaN(argumentNumber) || argument.length >= this._limitCharsToSearch) {
574
+ const enoughChars = argument.length >= this.limitCharsToSearch;
575
+ const argumentNumber = this.buildNumberArgument(argument);
576
+ if (enoughChars || !isNaN(argumentNumber)) {
576
577
  this._showLoading = true;
577
578
  this._changeDeboucingTimeout = window.setTimeout(() => {
578
579
  this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
@@ -254,6 +254,16 @@ class DataBinder {
254
254
  this.updateErrorMessage(field.name, fieldElement, field.message);
255
255
  }
256
256
  }
257
+ setFocus(fieldName) {
258
+ if (!this._fields.has(fieldName)) {
259
+ return;
260
+ }
261
+ const fieldElement = this._fields.get(fieldName).field;
262
+ if (typeof fieldElement["setFocus"] != "function") {
263
+ return;
264
+ }
265
+ fieldElement["setFocus"]();
266
+ }
257
267
  clearInvalid(recordId) {
258
268
  this._dataUnit.clearInvalid(recordId);
259
269
  this._fields.forEach(fieldBinder => {
@@ -831,6 +841,8 @@ const ezFormCss = ".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.
831
841
  const EzForm = class {
832
842
  constructor(hostRef) {
833
843
  registerInstance(this, hostRef);
844
+ this.ezFormRequestClearFieldToFocus = createEvent(this, "ezFormRequestClearFieldToFocus", 7);
845
+ this.ezFormSetFields = createEvent(this, "ezFormSetFields", 7);
834
846
  this.ezReady = createEvent(this, "ezReady", 7);
835
847
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
836
848
  this.onDataUnitAction = (action) => {
@@ -841,6 +853,7 @@ const EzForm = class {
841
853
  this.dataUnit = undefined;
842
854
  this.config = undefined;
843
855
  this.recordsValidator = undefined;
856
+ this.fieldToFocus = undefined;
844
857
  }
845
858
  /**
846
859
  * Realiza validação no conteúdo de todos os campos.
@@ -875,6 +888,7 @@ const EzForm = class {
875
888
  if (currentSheet == undefined) {
876
889
  return;
877
890
  }
891
+ this.ezFormSetFields.emit(fields);
878
892
  const idFormSheet = `${StringUtils.replaceAccentuatedChars(StringUtils.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
879
893
  return (h("div", { class: "dynamic-content", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
880
894
  }
@@ -906,6 +920,22 @@ const EzForm = class {
906
920
  metadata.addRequiredFields(this._staticFields.filter(f => f.dataset.required).map(f => f.dataset.fieldName));
907
921
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")), this.dataUnit.dataUnitId, metadata, this.recordsValidator);
908
922
  this.ezReady.emit();
923
+ this.handleFieldToFocus();
924
+ }
925
+ handleFieldToFocus() {
926
+ var _a;
927
+ if (this.fieldToFocus == undefined) {
928
+ return;
929
+ }
930
+ const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
931
+ const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
932
+ if (!fields.some(item => item.name === this.fieldToFocus)) {
933
+ return;
934
+ }
935
+ requestAnimationFrame(() => {
936
+ this._dataBinder.setFocus(this.fieldToFocus);
937
+ this.ezFormRequestClearFieldToFocus.emit();
938
+ });
909
939
  }
910
940
  disconnectedCallback() {
911
941
  this.dataUnit.unsubscribe(this.onDataUnitAction);
@@ -119678,6 +119678,9 @@ class AgGridController {
119678
119678
  getGridConfig() {
119679
119679
  return this._gridConfig;
119680
119680
  }
119681
+ locateColumn(columnName) {
119682
+ this._gridOptions.api.ensureColumnVisible(columnName);
119683
+ }
119681
119684
  getSort(_dataUnitName, defaultSorting) {
119682
119685
  const sortedColumns = [];
119683
119686
  this._gridOptions.columnApi
@@ -120620,6 +120623,11 @@ class InMemoryFilterColumnDataSource {
120620
120623
  const ezGridCss = ".sc-ez-grid-h{display:grid;grid-template-rows:auto 1fr auto;height:100%;width:100%;--ez-grid__header--background-color:var(--background--xlight, #FFF);--ez-grid__selection-counter--z-index:var(--visible, 1);--ez-grid__container--shadow:0 0 16px 0 rgb(0 38 111 / 12%)}.grid-header.sc-ez-grid{display:grid;justify-content:space-between;align-items:center;grid-row-start:1;grid-template-columns:1fr;background-color:var(--ez-grid__header--background-color, #FFF)}.grid__container.sc-ez-grid{padding-top:15px;margin-top:-12px;box-shadow:var(--ez-grid__container--shadow);background-color:var(--ez-grid__header--background-color)}.grid-header__popover.sc-ez-grid{position:relative;top:var(--space--sm, 16px)}.grid-header__container.sc-ez-grid{display:flex;align-items:center}.grid-header__position.sc-ez-grid{display:flex;align-items:center;justify-content:space-between}.grid__selection-counter.sc-ez-grid{position:fixed;white-space:nowrap;transform:translate(-50%, 0px);left:50%;opacity:0;bottom:-100%;transition:opacity 0.1s, bottom 0.5s}.grid__selection-counter--opened.sc-ez-grid{opacity:1;bottom:0px}.grid__btn-close.sc-ez-grid{display:flex;align-items:center;justify-content:center;padding:0;outline:none;width:20px;height:20px;border:none;background-color:unset;cursor:pointer}.grid__btn-clear.sc-ez-grid{--ez-button--link-color:var(--color--alert-warning-900, #8C6B00);--ez-button--link--hover-color:var(--color--alert-warning-900, #8C6B00)}[no-header].sc-ez-grid-h .grid-header.sc-ez-grid{height:0;padding:0}";
120621
120624
 
120622
120625
  const windowInstace = window;
120626
+ const matches = (text, filter) => {
120627
+ const normalizedText = StringUtils$1.replaceAccentuatedCharsLower(text.toLocaleLowerCase());
120628
+ const normalizedFilter = StringUtils$1.replaceAccentuatedCharsLower(filter.toLocaleLowerCase());
120629
+ return normalizedText.includes(normalizedFilter);
120630
+ };
120623
120631
  const EzGrid = class {
120624
120632
  constructor(hostRef) {
120625
120633
  registerInstance(this, hostRef);
@@ -120696,6 +120704,18 @@ const EzGrid = class {
120696
120704
  async quickFilter(term) {
120697
120705
  this._gridController.quickFilter(term);
120698
120706
  }
120707
+ /**
120708
+ * Localiza determinada coluna tornando-a visível.
120709
+ */
120710
+ async locateColumn(columnName) {
120711
+ this._gridController.locateColumn(columnName);
120712
+ }
120713
+ /**
120714
+ * Usa um argumento para filtrar as colunas po label
120715
+ */
120716
+ async filterColumns(search) {
120717
+ return Promise.resolve(this._gridController.getColumnsState().filter(col => matches(col.label, search)));
120718
+ }
120699
120719
  observeConfig(config) {
120700
120720
  this._gridController.setColumnsState(config.columns);
120701
120721
  }