@sankhyalabs/ezui 2.12.0 → 2.14.0-develop.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 (106) hide show
  1. package/dist/cjs/{ez-tree.cjs.entry.js → ez-filter-input_3.cjs.entry.js} +103 -16
  2. package/dist/cjs/ez-form.cjs.entry.js +325 -184
  3. package/dist/cjs/ez-guide-navigator.cjs.entry.js +339 -0
  4. package/dist/cjs/ezui.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -1
  7. package/dist/collection/components/ez-form/ez-form.css +1 -1
  8. package/dist/collection/components/ez-form/ez-form.js +20 -16
  9. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +48 -0
  10. package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/CheckBox.tpl.js +4 -4
  11. package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/ComboBox.tpl.js +2 -2
  12. package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/DateInput.tpl.js +1 -1
  13. package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/NumberInput.tpl.js +3 -3
  14. package/dist/collection/components/ez-form/structure/FormItem.js +11 -0
  15. package/dist/collection/components/ez-form/{FormMetadata.js → structure/FormMetadata.js} +53 -38
  16. package/dist/collection/components/ez-form/structure/FormSheet.js +6 -0
  17. package/dist/collection/components/ez-guide-navigator/Guide.js +200 -0
  18. package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css +53 -0
  19. package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js +230 -0
  20. package/dist/collection/components/ez-tree/ez-tree.js +5 -5
  21. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +1 -1
  22. package/dist/collection/components/ez-tree/types/Tree.js +0 -11
  23. package/dist/custom-elements/index.d.ts +6 -6
  24. package/dist/custom-elements/index.js +667 -337
  25. package/dist/esm/{ez-tree.entry.js → ez-filter-input_3.entry.js} +103 -18
  26. package/dist/esm/ez-form.entry.js +327 -186
  27. package/dist/esm/ez-guide-navigator.entry.js +335 -0
  28. package/dist/esm/ezui.js +1 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/ezui/ezui.esm.js +1 -1
  31. package/dist/ezui/p-6500a260.entry.js +1 -0
  32. package/dist/ezui/p-6c45dc64.entry.js +1 -0
  33. package/dist/ezui/p-fa2f4ea5.entry.js +1 -0
  34. package/dist/types/components/ez-form/DataBinder.d.ts +1 -1
  35. package/dist/types/components/ez-form/ez-form.d.ts +3 -4
  36. package/dist/types/components/ez-form/fieldbuilder/FieldBuilder.d.ts +2 -0
  37. package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -0
  38. package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +6 -0
  39. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +15 -0
  40. package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +5 -0
  41. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +7 -0
  42. package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +6 -0
  43. package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +5 -0
  44. package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +5 -0
  45. package/dist/types/components/ez-form/store/form.slice.d.ts +2 -2
  46. package/dist/types/components/ez-form/structure/FormItem.d.ts +9 -0
  47. package/dist/types/components/ez-form/{FormMetadata.d.ts → structure/FormMetadata.d.ts} +5 -2
  48. package/dist/types/components/ez-form/structure/FormSheet.d.ts +10 -0
  49. package/dist/types/components/ez-guide-navigator/Guide.d.ts +69 -0
  50. package/dist/types/components/ez-tree/types/Tree.d.ts +0 -1
  51. package/dist/types/components.d.ts +41 -26
  52. package/dist/types/interfaces/ez-form/IFieldMetadata.d.ts +6 -0
  53. package/dist/types/interfaces/ez-form/IFieldSetMetadata.d.ts +5 -0
  54. package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IFormSheetMetadata.d.ts +3 -2
  55. package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IRecordValidator.d.ts +1 -1
  56. package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/index.d.ts +2 -0
  57. package/package.json +2 -2
  58. package/react/components.d.ts +1 -1
  59. package/react/components.js +1 -1
  60. package/react/components.js.map +1 -1
  61. package/dist/cjs/ez-filter-input.cjs.entry.js +0 -81
  62. package/dist/cjs/ez-form-view.cjs.entry.js +0 -140
  63. package/dist/cjs/ez-sidebar-button.cjs.entry.js +0 -31
  64. package/dist/collection/components/ez-form-view/ez-form-view.css +0 -6
  65. package/dist/collection/components/ez-form-view/ez-form-view.js +0 -71
  66. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +0 -26
  67. package/dist/esm/ez-filter-input.entry.js +0 -77
  68. package/dist/esm/ez-form-view.entry.js +0 -136
  69. package/dist/esm/ez-sidebar-button.entry.js +0 -27
  70. package/dist/ezui/p-36ed5c45.entry.js +0 -1
  71. package/dist/ezui/p-7799666d.entry.js +0 -1
  72. package/dist/ezui/p-81897c04.entry.js +0 -1
  73. package/dist/ezui/p-97d2d2f6.entry.js +0 -1
  74. package/dist/ezui/p-ba03ac61.entry.js +0 -1
  75. package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +0 -2
  76. package/dist/types/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.d.ts +0 -3
  77. package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +0 -2
  78. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +0 -4
  79. package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +0 -2
  80. package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +0 -3
  81. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +0 -2
  82. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +0 -2
  83. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +0 -2
  84. package/dist/types/components/ez-form-view/interfaces/IFormViewField.d.ts +0 -10
  85. package/dist/types/components/ez-form-view/interfaces/index.d.ts +0 -1
  86. /package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/FileInput.tpl.js +0 -0
  87. /package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/SearchInput.tpl.js +0 -0
  88. /package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/TextArea.tpl.js +0 -0
  89. /package/dist/collection/components/{ez-form-view/fieldbuilder/templates → ez-form/fieldbuilder/tpl}/TextInput.tpl.js +0 -0
  90. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IDefaultConfig.js +0 -0
  91. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IFieldConfig.js +0 -0
  92. /package/dist/collection/{components/ez-form-view/interfaces/IFormViewField.js → interfaces/ez-form/IFieldMetadata.js} +0 -0
  93. /package/dist/collection/{components/ez-form-view/interfaces/index.js → interfaces/ez-form/IFieldSetMetadata.js} +0 -0
  94. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IFormConfig.js +0 -0
  95. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IFormSheetMetadata.js +0 -0
  96. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IInvalidField.js +0 -0
  97. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IRecordValidator.js +0 -0
  98. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/ITabConfig.js +0 -0
  99. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/IValidationResult.js +0 -0
  100. /package/dist/collection/{components/ez-form/interfaces → interfaces/ez-form}/index.js +0 -0
  101. /package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IDefaultConfig.d.ts +0 -0
  102. /package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IFieldConfig.d.ts +0 -0
  103. /package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IFormConfig.d.ts +0 -0
  104. /package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IInvalidField.d.ts +0 -0
  105. /package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/ITabConfig.d.ts +0 -0
  106. /package/dist/types/{components/ez-form/interfaces → interfaces/ez-form}/IValidationResult.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { HTMLElement as HTMLElement$1, createEvent, h, Host, forceUpdate, proxyCustomElement } from '@stencil/core/internal/client';
2
2
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
3
- import { FloatingManager, ElementIDUtils, StringUtils as StringUtils$1, DateUtils as DateUtils$1, TimeFormatter, ObjectUtils as ObjectUtils$1, Action, WaitingChangeException, ApplicationContext, UserInterface, DataUnitAction, DataUnit, NumberUtils as NumberUtils$1, DataType, SortMode, JSUtils, MaskFormatter } from '@sankhyalabs/core';
3
+ import { FloatingManager, ElementIDUtils, StringUtils as StringUtils$1, DateUtils as DateUtils$1, TimeFormatter, ObjectUtils as ObjectUtils$1, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, NumberUtils as NumberUtils$1, DataType, SortMode, JSUtils, MaskFormatter } from '@sankhyalabs/core';
4
4
 
5
5
  var DialogType;
6
6
  (function (DialogType) {
@@ -2714,6 +2714,284 @@ let EzFilterInput$1 = class extends HTMLElement$1 {
2714
2714
  static get style() { return ezFilterInputCss; }
2715
2715
  };
2716
2716
 
2717
+ class FormMetadata {
2718
+ constructor() {
2719
+ this._sheets = new Map();
2720
+ this._requiredFields = [];
2721
+ this._cleanOnCopyFields = [];
2722
+ this._defaultValues = {};
2723
+ }
2724
+ getSheet(name) {
2725
+ return this._sheets.get(name);
2726
+ }
2727
+ getAllSheets() {
2728
+ return this._sheets;
2729
+ }
2730
+ addSheet(sheet) {
2731
+ this._sheets.set(sheet.name, sheet);
2732
+ this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
2733
+ this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
2734
+ this._defaultValues = sheet.defaultValues;
2735
+ }
2736
+ getRequiredFields() {
2737
+ return this._requiredFields;
2738
+ }
2739
+ getCleanOnCopyFields() {
2740
+ return this._cleanOnCopyFields;
2741
+ }
2742
+ getDefaultValues() {
2743
+ return this._defaultValues;
2744
+ }
2745
+ }
2746
+ const isRequiredField = (descriptor, config) => {
2747
+ if (descriptor.required) {
2748
+ //Se for required pelo descritor não olha pra configuração.
2749
+ return true;
2750
+ }
2751
+ return config === null || config === void 0 ? void 0 : config.required;
2752
+ };
2753
+ const isReadOnlyField = (descriptor, config) => {
2754
+ if (descriptor.readOnly) {
2755
+ //Se for readOnly pelo descritor não olha pra configuração.
2756
+ return true;
2757
+ }
2758
+ return config === null || config === void 0 ? void 0 : config.readOnly;
2759
+ };
2760
+ const buildFromDataUnit = (dataUnit) => {
2761
+ var _a, _b;
2762
+ const unitMD = dataUnit.metadata;
2763
+ const metadata = new FormMetadata();
2764
+ if (unitMD) {
2765
+ const visibleFields = (_a = unitMD.fields) === null || _a === void 0 ? void 0 : _a.filter(descriptor => descriptor.visible !== false);
2766
+ const items = new Map();
2767
+ (_b = unitMD === null || unitMD === void 0 ? void 0 : unitMD.fields) === null || _b === void 0 ? void 0 : _b.forEach((descriptor) => {
2768
+ if (descriptor.visible !== false) {
2769
+ resolveFieldGroup(items, null, descriptor);
2770
+ }
2771
+ });
2772
+ let defaultValues = {};
2773
+ visibleFields
2774
+ .filter(descriptor => descriptor.defaultValue)
2775
+ .forEach((descriptor) => defaultValues[descriptor.name] = descriptor.defaultValue);
2776
+ metadata.addSheet({
2777
+ label: unitMD.label,
2778
+ name: unitMD.name,
2779
+ items: Array.from(items.values()),
2780
+ requiredFields: visibleFields
2781
+ .filter(descriptor => descriptor.required)
2782
+ .map(descriptor => descriptor.name),
2783
+ cleanOnCopyFields: visibleFields
2784
+ .filter(descriptor => { var _a, _b; return ((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum); })
2785
+ .map(descriptor => descriptor.name),
2786
+ defaultValues
2787
+ });
2788
+ }
2789
+ return metadata;
2790
+ };
2791
+ function getTabConfig(tab, sheets) {
2792
+ const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
2793
+ return tabConfig || { label: tab, visible: true };
2794
+ }
2795
+ function sortTabs(a, b) {
2796
+ return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
2797
+ }
2798
+ function resolveFieldGroup(items, field, descriptor) {
2799
+ const fieldMD = { config: field, descriptor: descriptor };
2800
+ let group = (field === null || field === void 0 ? void 0 : field.group) || descriptor.group;
2801
+ if (group) {
2802
+ const key = `group::${group}`;
2803
+ if (!items.has(key)) {
2804
+ items.set(key, { label: group, items: [fieldMD] });
2805
+ }
2806
+ else {
2807
+ items.get(key).items.push(fieldMD);
2808
+ }
2809
+ }
2810
+ else {
2811
+ items.set((field === null || field === void 0 ? void 0 : field.name) || descriptor.name, fieldMD);
2812
+ }
2813
+ }
2814
+ const buildFromConfig = (config, dataUnit) => {
2815
+ var _a, _b;
2816
+ const sheets = new Map();
2817
+ const hiddenTabs = new Map();
2818
+ const requiredFields = [];
2819
+ const cleanOnCopyFields = [];
2820
+ const defaultValues = {};
2821
+ (_a = config === null || config === void 0 ? void 0 : config.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
2822
+ if (!hiddenTabs.has(tab.label) && tab.visible === false) {
2823
+ hiddenTabs.set(tab.label, tab);
2824
+ }
2825
+ });
2826
+ (_b = config === null || config === void 0 ? void 0 : config.fields) === null || _b === void 0 ? void 0 : _b.forEach((field) => {
2827
+ var _a, _b, _c, _d;
2828
+ if (field.visible !== false) {
2829
+ const tabConfig = getTabConfig(field.tab || "__main", sheets);
2830
+ if (hiddenTabs.has(tabConfig.label)) {
2831
+ return;
2832
+ }
2833
+ const descriptor = dataUnit.getField(field.name);
2834
+ if (descriptor && tabConfig.visible) {
2835
+ if (!sheets.has(tabConfig)) {
2836
+ sheets.set(tabConfig, new Map());
2837
+ }
2838
+ const tabItens = sheets.get(tabConfig);
2839
+ if (isRequiredField(descriptor, field)) {
2840
+ requiredFields.push(field.name);
2841
+ }
2842
+ const cleanOnCopy = field.cleanOnCopy == undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : field.cleanOnCopy;
2843
+ if (cleanOnCopy || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum) || ((_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.cleanOnCopy)) {
2844
+ cleanOnCopyFields.push(field.name);
2845
+ }
2846
+ const defaultValue = field.defaultValue == undefined ? (_d = descriptor.properties) === null || _d === void 0 ? void 0 : _d.defaultValue : field.defaultValue;
2847
+ if (defaultValue) {
2848
+ defaultValues[field.name] = field.defaultValue;
2849
+ }
2850
+ resolveFieldGroup(tabItens, field, descriptor);
2851
+ }
2852
+ }
2853
+ });
2854
+ const metadata = new FormMetadata();
2855
+ Array.from(sheets.entries())
2856
+ .sort(sortTabs)
2857
+ .forEach(([key, value]) => {
2858
+ metadata.addSheet({
2859
+ label: (key.label === "__main") ? "Principal" : key.label,
2860
+ name: key.label,
2861
+ items: Array.from(value.values()),
2862
+ requiredFields,
2863
+ cleanOnCopyFields,
2864
+ defaultValues
2865
+ });
2866
+ });
2867
+ return metadata;
2868
+ };
2869
+
2870
+ const buildTextArea = ({ name, label, readOnly }) => {
2871
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
2872
+ h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
2873
+ };
2874
+
2875
+ const buildTextInput = ({ name, label, readOnly }) => {
2876
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2877
+ h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
2878
+ };
2879
+
2880
+ const buildSwitch = (fieldConfig) => {
2881
+ return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
2882
+ };
2883
+ const buildCheckBox = (fieldConfig) => {
2884
+ return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
2885
+ };
2886
+ function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
2887
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
2888
+ h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
2889
+ }
2890
+
2891
+ const buildComboBox = ({ name, label, readOnly, required }, properties) => {
2892
+ const prop = properties === null || properties === void 0 ? void 0 : properties.options;
2893
+ let options;
2894
+ if (typeof prop === "string") {
2895
+ const parsed = JSON.parse(prop);
2896
+ options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
2897
+ }
2898
+ else {
2899
+ options = prop;
2900
+ }
2901
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2902
+ h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
2903
+ };
2904
+
2905
+ const buildSearch = ({ name, label, readOnly, required }) => {
2906
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2907
+ h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
2908
+ };
2909
+
2910
+ const buildFile = ({ name, label, readOnly }) => {
2911
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
2912
+ h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2913
+ };
2914
+
2915
+ const buildDate = ({ name, label, readOnly }) => {
2916
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2917
+ h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2918
+ };
2919
+ const buildTime = ({ name, label, readOnly }) => {
2920
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2921
+ h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2922
+ };
2923
+ const buildTimeDate = ({ name, label, readOnly }) => {
2924
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2925
+ h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2926
+ };
2927
+
2928
+ const buildDecimal = ({ name, label, readOnly }, properties) => {
2929
+ const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
2930
+ const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
2931
+ return buildNumeric(name, label, readOnly, precision, prettyPrecision);
2932
+ };
2933
+ const buildInteger = ({ name, label, readOnly }) => {
2934
+ return buildNumeric(name, label, readOnly, 0, 0);
2935
+ };
2936
+ function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
2937
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2938
+ h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
2939
+ }
2940
+
2941
+ const uiBuilders = new Map();
2942
+ uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
2943
+ uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
2944
+ uiBuilders.set(UserInterface.SWITCH, buildSwitch);
2945
+ uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
2946
+ uiBuilders.set(UserInterface.SEARCH, buildSearch);
2947
+ uiBuilders.set(UserInterface.FILE, buildFile);
2948
+ uiBuilders.set(UserInterface.DATE, buildDate);
2949
+ uiBuilders.set(UserInterface.TIME, buildTime);
2950
+ uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
2951
+ uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
2952
+ uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
2953
+ const buildField = (field) => {
2954
+ const descriptor = field.descriptor;
2955
+ const config = Object.assign({}, field.config);
2956
+ let builder;
2957
+ let props;
2958
+ if (descriptor) {
2959
+ if (!config.label) {
2960
+ config.label = descriptor.label;
2961
+ }
2962
+ if (!config.name) {
2963
+ config.name = descriptor.name;
2964
+ }
2965
+ // Forçamos uma avaliação priorizando o descriptor.
2966
+ config.required = isRequiredField(descriptor, config);
2967
+ config.readOnly = isReadOnlyField(descriptor, config);
2968
+ props = descriptor.properties;
2969
+ builder = uiBuilders.get(descriptor.userInterface);
2970
+ }
2971
+ if (config.required) {
2972
+ config.label = `${config.label} (obrigatório) *`;
2973
+ }
2974
+ if (!builder) {
2975
+ builder = buildTextInput;
2976
+ }
2977
+ return builder(config, props);
2978
+ };
2979
+
2980
+ const FormItem = ({ source }) => {
2981
+ if ("items" in source) {
2982
+ const fieldSet = source;
2983
+ return h("ez-collapsible-box", { label: source.label, "header-size": "large", key: source.label }, fieldSet.items.map(fi => buildField(fi)));
2984
+ }
2985
+ else {
2986
+ return buildField(source);
2987
+ }
2988
+ };
2989
+
2990
+ const FormSheet = ({ store, source, dataElementId }) => {
2991
+ return (h("div", { class: "dynamic-content ez-box__container", "data-element-id": dataElementId },
2992
+ h("div", { class: "ez-row ez-padding-vertical--small" }, source.items.map(item => h(FormItem, { store: store, source: item })))));
2993
+ };
2994
+
2717
2995
  /**
2718
2996
  * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
2719
2997
  *
@@ -3037,6 +3315,49 @@ function createStore(reducer, preloadedState, enhancer) {
3037
3315
  }, _ref2[$$observable] = observable, _ref2;
3038
3316
  }
3039
3317
 
3318
+ const inicialState = {};
3319
+ /////////////////////////////// REDUCERS ///////////////////////////////
3320
+ function formReducer(state = inicialState, action) {
3321
+ switch (action.type) {
3322
+ case FormActions.METADATA_LOADED:
3323
+ return Object.assign(Object.assign({}, state), { formMetadata: action.payload, currentSheet: undefined });
3324
+ case FormActions.CHANGE_TAB:
3325
+ return Object.assign(Object.assign({}, state), { currentSheet: action.payload });
3326
+ default:
3327
+ return state;
3328
+ }
3329
+ }
3330
+ /////////////////////////////// ACTION CREATORS ///////////////////////////////
3331
+ function loadMetadata(formMetadata) {
3332
+ return {
3333
+ type: FormActions.METADATA_LOADED,
3334
+ payload: formMetadata
3335
+ };
3336
+ }
3337
+ function changeTab(currentSheet) {
3338
+ return {
3339
+ type: FormActions.CHANGE_TAB,
3340
+ payload: typeof currentSheet === "string" ? currentSheet : currentSheet.tabKey
3341
+ };
3342
+ }
3343
+ /////////////////////////////// SELECTORS ///////////////////////////////
3344
+ function selectFormMetadata(state) {
3345
+ return state.formMetadata;
3346
+ }
3347
+ function selectCurrentSheetId(state) {
3348
+ return state.currentSheet;
3349
+ }
3350
+ function selectCurrentSheet(state) {
3351
+ const currentSheetId = selectCurrentSheetId(state);
3352
+ return currentSheetId ? state.formMetadata.getSheet(currentSheetId) : Array.from(state.formMetadata.getAllSheets().values())[0];
3353
+ }
3354
+ /////////////////////////////// TYPES ///////////////////////////////
3355
+ var FormActions;
3356
+ (function (FormActions) {
3357
+ FormActions["METADATA_LOADED"] = "FORM/METADATA_LOADED";
3358
+ FormActions["CHANGE_TAB"] = "FORM/CHANGE_TAB";
3359
+ })(FormActions || (FormActions = {}));
3360
+
3040
3361
  class DataBinder {
3041
3362
  constructor(dataUnit) {
3042
3363
  this._invalidFields = new Map();
@@ -3243,187 +3564,7 @@ class Bind {
3243
3564
  }
3244
3565
  }
3245
3566
 
3246
- const inicialState = {};
3247
- /////////////////////////////// REDUCERS ///////////////////////////////
3248
- function formReducer(state = inicialState, action) {
3249
- switch (action.type) {
3250
- case FormActions.METADATA_LOADED:
3251
- return Object.assign(Object.assign({}, state), { formMetadata: action.payload, currentSheet: undefined });
3252
- case FormActions.CHANGE_TAB:
3253
- return Object.assign(Object.assign({}, state), { currentSheet: action.payload });
3254
- default:
3255
- return state;
3256
- }
3257
- }
3258
- /////////////////////////////// ACTION CREATORS ///////////////////////////////
3259
- function loadMetadata(formMetadata) {
3260
- return {
3261
- type: FormActions.METADATA_LOADED,
3262
- payload: formMetadata
3263
- };
3264
- }
3265
- function changeTab(currentSheet) {
3266
- return {
3267
- type: FormActions.CHANGE_TAB,
3268
- payload: typeof currentSheet === "string" ? currentSheet : currentSheet.tabKey
3269
- };
3270
- }
3271
- /////////////////////////////// SELECTORS ///////////////////////////////
3272
- function selectFormMetadata(state) {
3273
- return state.formMetadata;
3274
- }
3275
- function selectCurrentSheetId(state) {
3276
- return state.currentSheet;
3277
- }
3278
- function selectCurrentSheet(state) {
3279
- const currentSheetId = selectCurrentSheetId(state);
3280
- return currentSheetId ? state.formMetadata.getSheet(currentSheetId) : Array.from(state.formMetadata.getAllSheets().values())[0];
3281
- }
3282
- /////////////////////////////// TYPES ///////////////////////////////
3283
- var FormActions;
3284
- (function (FormActions) {
3285
- FormActions["METADATA_LOADED"] = "FORM/METADATA_LOADED";
3286
- FormActions["CHANGE_TAB"] = "FORM/CHANGE_TAB";
3287
- })(FormActions || (FormActions = {}));
3288
-
3289
- class FormMetadata {
3290
- constructor() {
3291
- this._sheets = new Map();
3292
- this._requiredFields = [];
3293
- this._cleanOnCopyFields = [];
3294
- this._defaultValues = {};
3295
- }
3296
- getSheet(name) {
3297
- return this._sheets.get(name);
3298
- }
3299
- getAllSheets() {
3300
- return this._sheets;
3301
- }
3302
- addSheet(sheet) {
3303
- this._sheets.set(sheet.name, sheet);
3304
- this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
3305
- this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
3306
- this._defaultValues = sheet.defaultValues;
3307
- }
3308
- getRequiredFields() {
3309
- return this._requiredFields;
3310
- }
3311
- getCleanOnCopyFields() {
3312
- return this._cleanOnCopyFields;
3313
- }
3314
- getDefaultValues() {
3315
- return this._defaultValues;
3316
- }
3317
- }
3318
- const buildFromDataUnit = (dataUnit) => {
3319
- const unitMD = dataUnit.metadata;
3320
- const metadata = new FormMetadata();
3321
- if (unitMD) {
3322
- const visibleFields = (unitMD.fields || []).filter(descriptor => descriptor.visible !== false);
3323
- const fields = visibleFields.map(descriptor => buildFormField(descriptor));
3324
- let defaultValues = {};
3325
- visibleFields
3326
- .filter(descriptor => descriptor.defaultValue)
3327
- .forEach((descriptor) => defaultValues[descriptor.name] = descriptor.defaultValue);
3328
- metadata.addSheet({
3329
- name: unitMD.name,
3330
- label: unitMD.label,
3331
- fields,
3332
- requiredFields: visibleFields
3333
- .filter(descriptor => descriptor.required)
3334
- .map(descriptor => descriptor.name),
3335
- cleanOnCopyFields: visibleFields
3336
- .filter(descriptor => { var _a, _b; return ((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum); })
3337
- .map(descriptor => descriptor.name),
3338
- defaultValues
3339
- });
3340
- }
3341
- return metadata;
3342
- };
3343
- const buildFromConfig = (config, dataUnit) => {
3344
- var _a, _b;
3345
- const sheets = new Map();
3346
- const hiddenTabs = new Map();
3347
- const requiredFields = [];
3348
- const cleanOnCopyFields = [];
3349
- const defaultValues = {};
3350
- (_a = config === null || config === void 0 ? void 0 : config.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
3351
- if (!hiddenTabs.has(tab.label) && tab.visible === false) {
3352
- hiddenTabs.set(tab.label, tab);
3353
- }
3354
- });
3355
- (_b = config === null || config === void 0 ? void 0 : config.fields) === null || _b === void 0 ? void 0 : _b.forEach((field) => {
3356
- var _a, _b, _c, _d;
3357
- if (field.visible !== false) {
3358
- const tabConfig = getTabConfig(field.tab || "__main", sheets);
3359
- if (hiddenTabs.has(tabConfig.label)) {
3360
- return;
3361
- }
3362
- const descriptor = dataUnit.getField(field.name);
3363
- if (descriptor && tabConfig.visible) {
3364
- if (!sheets.has(tabConfig)) {
3365
- sheets.set(tabConfig, []);
3366
- }
3367
- const formField = buildFormField(descriptor, field);
3368
- sheets.get(tabConfig).push(formField);
3369
- if (formField.required) {
3370
- requiredFields.push(field.name);
3371
- }
3372
- const cleanOnCopy = field.cleanOnCopy == undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : field.cleanOnCopy;
3373
- if (cleanOnCopy || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum) || ((_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.cleanOnCopy)) {
3374
- cleanOnCopyFields.push(field.name);
3375
- }
3376
- const defaultValue = field.defaultValue == undefined ? (_d = descriptor.properties) === null || _d === void 0 ? void 0 : _d.defaultValue : field.defaultValue;
3377
- if (defaultValue) {
3378
- defaultValues[field.name] = field.defaultValue;
3379
- }
3380
- }
3381
- }
3382
- });
3383
- const metadata = new FormMetadata();
3384
- Array.from(sheets.entries())
3385
- .sort(sortTabs)
3386
- .forEach(([key, fields]) => {
3387
- metadata.addSheet({
3388
- label: (key.label === "__main") ? "Principal" : key.label,
3389
- name: key.label,
3390
- fields,
3391
- requiredFields,
3392
- cleanOnCopyFields,
3393
- defaultValues
3394
- });
3395
- });
3396
- return metadata;
3397
- };
3398
- const buildFormField = (descriptor, config) => {
3399
- let { name, label, group } = Object.assign({}, config);
3400
- let { readOnly, required } = Object.assign({}, config);
3401
- let props;
3402
- let userInterface;
3403
- if (descriptor) {
3404
- label = label || descriptor.label;
3405
- name = name || descriptor.name;
3406
- required = descriptor.required || (config === null || config === void 0 ? void 0 : config.required);
3407
- readOnly = descriptor.readOnly || (config === null || config === void 0 ? void 0 : config.readOnly);
3408
- props = descriptor.properties;
3409
- userInterface = descriptor.userInterface;
3410
- }
3411
- return {
3412
- name, label, group,
3413
- readOnly, required,
3414
- props,
3415
- userInterface: userInterface || UserInterface.SHORTTEXT
3416
- };
3417
- };
3418
- const getTabConfig = (tab, sheets) => {
3419
- const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
3420
- return tabConfig || { label: tab, visible: true };
3421
- };
3422
- const sortTabs = (a, b) => {
3423
- return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
3424
- };
3425
-
3426
- const ezFormCss = ".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}.multi-level__container.sc-ez-form{display:grid;grid-template-columns:minmax(20%, 300px) auto;width:100%}";
3567
+ const ezFormCss = "ez-form.sc-ez-form{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}.multi-level__container.sc-ez-form{display:grid;grid-template-columns:minmax(20%, 300px) auto;width:100%}";
3427
3568
 
3428
3569
  let EzForm$1 = class extends HTMLElement$1 {
3429
3570
  constructor() {
@@ -3552,9 +3693,8 @@ let EzForm$1 = class extends HTMLElement$1 {
3552
3693
  return result;
3553
3694
  }
3554
3695
  buildFormContent(sheetId, currentSheet) {
3555
- const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
3556
3696
  if (this.contentBuilder != undefined) {
3557
- const customContent = this.contentBuilder(sheetId, fields);
3697
+ const customContent = this.contentBuilder(sheetId, currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.items, buildField);
3558
3698
  if (customContent != undefined) {
3559
3699
  return h("div", { "innerHTML": customContent });
3560
3700
  }
@@ -3563,7 +3703,7 @@ let EzForm$1 = class extends HTMLElement$1 {
3563
3703
  return;
3564
3704
  }
3565
3705
  const idFormSheet = `${StringUtils$1.replaceAccentuatedChars(StringUtils$1.toCamelCase(currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.label), false)}_selectorContainer`;
3566
- return (h("div", { class: "dynamic-content ez-box__container", "data-element-id": idFormSheet }, h("ez-form-view", { class: "ez-row ez-padding-vertical--small", fields: fields })));
3706
+ return h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet });
3567
3707
  }
3568
3708
  processMetadata() {
3569
3709
  if (!this.isStatic() && this.dataUnit && this._store) {
@@ -3661,138 +3801,6 @@ let EzForm$1 = class extends HTMLElement$1 {
3661
3801
  static get style() { return ezFormCss; }
3662
3802
  };
3663
3803
 
3664
- const buildSwitch = (field) => {
3665
- return buildField(field.name, field.label, field.readOnly, true);
3666
- };
3667
- const buildCheckBox = (field) => {
3668
- return buildField(field.name, field.label, field.readOnly, false);
3669
- };
3670
- function buildField(fieldName, fieldLabel, readOnly, switchMode = false) {
3671
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
3672
- h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
3673
- }
3674
-
3675
- const buildComboBox = ({ name, label, readOnly, required, props }) => {
3676
- const prop = props === null || props === void 0 ? void 0 : props.options;
3677
- let options;
3678
- if (typeof prop === "string") {
3679
- const parsed = JSON.parse(prop);
3680
- options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
3681
- }
3682
- else {
3683
- options = prop;
3684
- }
3685
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3686
- h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
3687
- };
3688
-
3689
- const buildDate = ({ name, label, readOnly }) => {
3690
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3691
- h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
3692
- };
3693
- const buildTime = ({ name, label, readOnly }) => {
3694
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3695
- h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
3696
- };
3697
- const buildDateTime = ({ name, label, readOnly }) => {
3698
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3699
- h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
3700
- };
3701
-
3702
- const buildFile = ({ name, label, readOnly }) => {
3703
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
3704
- h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
3705
- };
3706
-
3707
- const buildDecimal = ({ name, label, readOnly, props }) => {
3708
- const precision = Number((props === null || props === void 0 ? void 0 : props.precision) || 2);
3709
- const prettyPrecision = Number((props === null || props === void 0 ? void 0 : props.prettyPrecision) || precision);
3710
- return buildNumeric(name, label, readOnly, precision, prettyPrecision);
3711
- };
3712
- const buildInteger = ({ name, label, readOnly }) => {
3713
- return buildNumeric(name, label, readOnly, 0, 0);
3714
- };
3715
- function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
3716
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3717
- h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
3718
- }
3719
-
3720
- const buildSearch = ({ name, label, readOnly, required }) => {
3721
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3722
- h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
3723
- };
3724
-
3725
- const buildTextArea = ({ name, label, readOnly }) => {
3726
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
3727
- h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
3728
- };
3729
-
3730
- const buildTextInput = ({ name, label, readOnly }) => {
3731
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
3732
- h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
3733
- };
3734
-
3735
- const uiBuilders = new Map();
3736
- uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
3737
- uiBuilders.set(UserInterface.SWITCH, buildSwitch);
3738
- uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
3739
- uiBuilders.set(UserInterface.DATE, buildDate);
3740
- uiBuilders.set(UserInterface.TIME, buildTime);
3741
- uiBuilders.set(UserInterface.DATETIME, buildDateTime);
3742
- uiBuilders.set(UserInterface.FILE, buildFile);
3743
- uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
3744
- uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
3745
- uiBuilders.set(UserInterface.SEARCH, buildSearch);
3746
- uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
3747
- const fieldBuilder = (field) => {
3748
- const builder = uiBuilders.get(field.userInterface) || buildTextInput;
3749
- const label = field.required ? `${field.label} (obrigatório) *` : field.label;
3750
- return builder(Object.assign(Object.assign({}, field), { label }));
3751
- };
3752
-
3753
- const ezFormViewCss = ".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";
3754
-
3755
- let EzFormView$1 = class extends HTMLElement$1 {
3756
- constructor() {
3757
- super();
3758
- this.__registerHost();
3759
- }
3760
- groupFields(fields) {
3761
- const result = new Map();
3762
- fields.forEach(item => {
3763
- const groupLabel = item.group;
3764
- if (groupLabel) {
3765
- let groupFields = result.get(groupLabel);
3766
- if (groupFields == undefined) {
3767
- groupFields = [];
3768
- result.set(groupLabel, groupFields);
3769
- }
3770
- groupFields.push(item);
3771
- }
3772
- else {
3773
- result.set(item.name, item);
3774
- }
3775
- });
3776
- return result;
3777
- }
3778
- render() {
3779
- ElementIDUtils.addIDInfoIfNotExists(this._element, 'ezFormView');
3780
- if (this.fields == undefined) {
3781
- return;
3782
- }
3783
- return (h(Host, null, Array.from(this.groupFields(this.fields).entries()).map(([label, value]) => {
3784
- if (Array.isArray(value)) {
3785
- return (h("ez-collapsible-box", { id: `group-${label}`, label: label, "header-size": "large", key: label }, value.map(fi => fieldBuilder(fi))));
3786
- }
3787
- else {
3788
- return fieldBuilder(value);
3789
- }
3790
- })));
3791
- }
3792
- get _element() { return this; }
3793
- static get style() { return ezFormViewCss; }
3794
- };
3795
-
3796
3804
  /**
3797
3805
  * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.1.1
3798
3806
  * @link https://www.ag-grid.com/
@@ -119262,6 +119270,339 @@ let EzGrid$1 = class extends HTMLElement$1 {
119262
119270
  static get style() { return ezGridCss; }
119263
119271
  };
119264
119272
 
119273
+ const HIERARCHY_SEPARATOR = '>>';
119274
+ class Guide {
119275
+ constructor(list) {
119276
+ this.originalList = [];
119277
+ this.guideMap = new Map();
119278
+ this.hierarchiesAlreadyLoaded = new Set();
119279
+ if (list === null || list === void 0 ? void 0 : list.length)
119280
+ this.setList(list);
119281
+ }
119282
+ /**
119283
+ * Converte uma lista de objetos IGuideItem em um objeto IGuideMap com sua hierarquia.
119284
+ * @param list Uma lista de objetos IGuideItem representando a lista de itens.
119285
+ * @param hierarquiaList Uma lista opcional de strings que representa a hierarquia dos itens pai.
119286
+ * @param indexReferences Uma lista opcional de números que representa as referências de índice da lista original.
119287
+ * @returns Uma Promise que resolve para um objeto IGuideMap com os itens e sua hierarquia.
119288
+ */
119289
+ convertArrayToMap(list, hierarchyList = [], indexReferences = []) {
119290
+ return new Promise(resolve => {
119291
+ list.forEach(async (item, index) => {
119292
+ const updatedHierarchyList = [...hierarchyList, item.id];
119293
+ const key = updatedHierarchyList.join(HIERARCHY_SEPARATOR);
119294
+ const currentIndexReferences = [...indexReferences, index];
119295
+ const children = Array.isArray(item.children) ? item.children : [];
119296
+ item = Object.assign(Object.assign({}, item), { parentId: hierarchyList[hierarchyList.length - 1], indexReferences: currentIndexReferences, hierarchy: updatedHierarchyList, hierarchyId: key });
119297
+ delete item.children;
119298
+ this.guideMap.set(key, item);
119299
+ if (children.length)
119300
+ await this.convertArrayToMap(children, updatedHierarchyList, currentIndexReferences);
119301
+ });
119302
+ resolve(this.guideMap);
119303
+ });
119304
+ }
119305
+ /**
119306
+ * Converte um objeto IGuideMap em uma lista de objetos IGuideItem com sua hierarquia.
119307
+ * @param map Um objeto IGuideMap opcional que representa o mapa de itens com sua hierarquia.
119308
+ * @returns Uma Promise que resolve para uma lista de objetos IGuideItem com sua hierarquia.
119309
+ */
119310
+ convertMapToArray(map = this.guideMap) {
119311
+ return new Promise(resolve => {
119312
+ const array = [];
119313
+ const itemsById = {};
119314
+ map.forEach(value => {
119315
+ var _a;
119316
+ const item = Object.assign({}, value);
119317
+ if (((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) === 0) {
119318
+ delete item.children;
119319
+ }
119320
+ itemsById[item.id] = item;
119321
+ });
119322
+ Object.values(itemsById).forEach(item => {
119323
+ if (item.parentId) {
119324
+ const parent = itemsById[item.parentId];
119325
+ if (Array.isArray(parent.children)) {
119326
+ parent.children.push(item);
119327
+ }
119328
+ else {
119329
+ parent.children = [item];
119330
+ }
119331
+ }
119332
+ else {
119333
+ array.push(item);
119334
+ }
119335
+ });
119336
+ resolve(array);
119337
+ });
119338
+ }
119339
+ /**
119340
+ * Obtém a lista selecionada de itens com base na lista original e na lista de índice selecionada.
119341
+ * @param originalList Uma lista de objetos IGuideItem representando a lista original de itens.
119342
+ * @param selectedIndexList Uma matriz representando a lista de índices selecionada.
119343
+ * @returns Uma lista de objetos IGuideItem representando a lista selecionada de itens.
119344
+ */
119345
+ getSelectedList(originalList, selectedIndexList) {
119346
+ const selectedList = [];
119347
+ selectedIndexList.forEach(selectedIndex => {
119348
+ if (!selectedIndex.length)
119349
+ return;
119350
+ const [parentIndex, childIndex] = selectedIndex;
119351
+ if (childIndex === undefined) {
119352
+ selectedList.push(originalList[parentIndex]);
119353
+ }
119354
+ else {
119355
+ const parent = originalList[parentIndex];
119356
+ const child = parent.children[childIndex];
119357
+ const selectedParent = selectedList.find(item => item.id === parent.id);
119358
+ if (selectedParent) {
119359
+ selectedParent.children.push(child);
119360
+ }
119361
+ else {
119362
+ selectedList.push(Object.assign(Object.assign({}, parent), { children: [child] }));
119363
+ }
119364
+ }
119365
+ });
119366
+ return selectedList;
119367
+ }
119368
+ /**
119369
+ * Define a lista de itens para o Map guideMap.
119370
+ * @param list Uma lista de objetos IGuideItem representando a lista de itens.
119371
+ * @returns Uma Promise que resolve quando a lista é convertida para o Map.
119372
+ */
119373
+ setList(list) {
119374
+ return new Promise(async (resolve) => {
119375
+ this.guideMap.clear();
119376
+ if (!this.originalList.length) {
119377
+ this.originalList = ObjectUtils$1.copy(list);
119378
+ }
119379
+ await this.convertArrayToMap(list);
119380
+ resolve();
119381
+ });
119382
+ }
119383
+ /**
119384
+ * Obtém a lista de itens com sua hierarquia.
119385
+ * @returns Uma Promise que resolve para uma lista de objetos IGuideItem com sua hierarquia.
119386
+ */
119387
+ getList() {
119388
+ return this.convertMapToArray();
119389
+ }
119390
+ /**
119391
+ * Adiciona filhos a um item pai no guia.
119392
+ * @param parent Um objeto IGuideItem que representa o item pai.
119393
+ * @param children Uma lista de objetos IGuideItem representando os itens filhos.
119394
+ * @returns Uma Promise que resolve para uma lista de objetos IGuideItem com sua hierarquia.
119395
+ */
119396
+ addChildren(parent, children) {
119397
+ return new Promise(async (resolve, reject) => {
119398
+ if (parent.disabled)
119399
+ return reject('Parent is disabled');
119400
+ if (!parent.hierarchy || !parent.hierarchyId)
119401
+ return reject('Hierarchy not found');
119402
+ if (this.hierarchiesAlreadyLoaded.has(parent.hierarchyId))
119403
+ return resolve([]);
119404
+ await this.convertArrayToMap(children, parent.hierarchy);
119405
+ const list = await this.getList();
119406
+ this.originalList = ObjectUtils$1.copy(list);
119407
+ this.hierarchiesAlreadyLoaded.add(parent.hierarchyId);
119408
+ resolve(list);
119409
+ });
119410
+ }
119411
+ /**
119412
+ * Obtém os itens a partir de um campo corresponde à string de consulta.
119413
+ * @param query Uma string que representa a consulta para corresponder ao rótulo.
119414
+ * @param fieldName Uma string opcional que representa o nome do campo para corresponder à consulta.
119415
+ * @returns Uma Promise que resolve para um objeto com o primeiro item encontrado e uma matriz de itens correspondentes com sua hierarquia.
119416
+ */
119417
+ getItemsByLabel(query, fieldName = 'label', selectedItem) {
119418
+ return new Promise(async (resolve) => {
119419
+ var _a;
119420
+ const mapResults = [];
119421
+ let firstOcorrence;
119422
+ const itemFromMap = this.guideMap.get(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.hierarchyId);
119423
+ if (itemFromMap)
119424
+ itemFromMap.expanded = true;
119425
+ for (const item of this.guideMap.values()) {
119426
+ const label = ((_a = item === null || item === void 0 ? void 0 : item[fieldName]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
119427
+ if (label.includes(query.toLowerCase())) {
119428
+ if (!firstOcorrence)
119429
+ firstOcorrence = item;
119430
+ mapResults.push(item.indexReferences);
119431
+ }
119432
+ }
119433
+ const updatedList = this.getSelectedList(this.originalList, mapResults);
119434
+ resolve({
119435
+ first: firstOcorrence,
119436
+ list: updatedList,
119437
+ });
119438
+ });
119439
+ }
119440
+ /**
119441
+ * Habilita todos os objetos IGuideItem.
119442
+ * @returns Uma Promise que resolve com o array atualizado de objetos IGuideItem.
119443
+ */
119444
+ enableAllItems() {
119445
+ return new Promise(async (resolve) => {
119446
+ for (const item of this.guideMap.values())
119447
+ item.disabled = false;
119448
+ const list = await this.getList();
119449
+ this.originalList = ObjectUtils$1.copy(list);
119450
+ resolve(list);
119451
+ });
119452
+ }
119453
+ /**
119454
+ * Ativa somente objetos IGuideItem com base em uma matriz de IDs.
119455
+ * @param ids Um array de IDs para habilitar.
119456
+ * @param customTooltip Uma string para definir o tooltip de itens desabilitados.
119457
+ * @returns Uma Promise que resolve com o array atualizado de objetos IGuideItem.
119458
+ */
119459
+ enableItemsById(ids = [], customTooltip = '') {
119460
+ return new Promise(async (resolve) => {
119461
+ for (const item of this.guideMap.values()) {
119462
+ const isEnabled = ids.includes(item.id);
119463
+ item.disabled = !isEnabled;
119464
+ item.tooltip = isEnabled ? item.tooltip : customTooltip;
119465
+ }
119466
+ const list = await this.getList();
119467
+ this.originalList = ObjectUtils$1.copy(list);
119468
+ resolve(list);
119469
+ });
119470
+ }
119471
+ }
119472
+
119473
+ const ezGuideNavigatorCss = ":host{--ez-guide-navigator--padding:0 var(--space--large);--ez-guide-navigator--box-shadow:var(--shadow, 0px 0px 24px 0px #000);--ez-guide-navigator--background-color:var(--color--inverted);--ez-guide-navigator--border-radius:0px var(--border--radius-medium) var(--border--radius-medium) 0px;--ez-guide-navigator--actions-gap:var(--space--medium);--ez-guide-navigator--actions-margin:var(--space--medium) 0 var(--space--medium)}.inverted{transform:rotate(180deg)}.ez-guide-navigator{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:var(--ez-guide-navigator--padding);background-color:var(--ez-guide-navigator--background-color);-webkit-box-shadow:var(--ez-guide-navigator--box-shadow);box-shadow:var(--ez-guide-navigator--box-shadow);border-radius:var(--ez-guide-navigator--border-radius)}.ez-guide-navigator__actions{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--ez-guide-navigator--actions-gap);margin:var(--ez-guide-navigator--actions-margin)}";
119474
+
119475
+ const ENTER_KEY = 'Enter';
119476
+ let EzGuideNavigator$1 = class extends HTMLElement$1 {
119477
+ constructor() {
119478
+ super();
119479
+ this.__registerHost();
119480
+ this.__attachShadow();
119481
+ //TODO: Quando a filtragem for feita dentro da árvore, não será mais necessário
119482
+ this.guide = new Guide();
119483
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119484
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119485
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119486
+ /**
119487
+ * Provedor de dados para o guide navigator.
119488
+ */
119489
+ this.binder = null;
119490
+ /**
119491
+ * Define se o menu de navegação está aberto.
119492
+ */
119493
+ this.open = true;
119494
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119495
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119496
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119497
+ /**
119498
+ * Lista de itens do menu de navegação.
119499
+ */
119500
+ this.items = [];
119501
+ /**
119502
+ * Valor do campo de pesquisa usado na filtragem de guias.
119503
+ */
119504
+ this.filterText = '';
119505
+ }
119506
+ /**
119507
+ * Habilita itens específicos a partir de uma lista de ID's.
119508
+ */
119509
+ async enableOnly(id, customTooltip) {
119510
+ //TODO: Levar para a árvore
119511
+ this._tree.items = await this.guide.enableItemsById(id, customTooltip);
119512
+ }
119513
+ /**
119514
+ * Habilita todos os itens do menu de navegação.
119515
+ */
119516
+ async enableAll() {
119517
+ //TODO: Levar para a árvore
119518
+ this._tree.items = await this.guide.enableAllItems();
119519
+ }
119520
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119521
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119522
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119523
+ handleBinderChange(newBinder, oldBinder) {
119524
+ if (newBinder != oldBinder) {
119525
+ this.initTree();
119526
+ }
119527
+ }
119528
+ async handleToggleSidebar() {
119529
+ this.open = !this.open;
119530
+ if (this.open) {
119531
+ await this.initTree();
119532
+ this.filterItems();
119533
+ }
119534
+ }
119535
+ handleSelectTreeItem({ detail: parent }) {
119536
+ if (!parent.expanded)
119537
+ return;
119538
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119539
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119540
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119541
+ this.binder.fetchItems(parent.id).then(async (children) => {
119542
+ if (!(children === null || children === void 0 ? void 0 : children.length))
119543
+ return;
119544
+ await this.guide.addChildren(parent, children);
119545
+ const { list } = await this.guide.getItemsByLabel(this.filterText, 'label', parent);
119546
+ this._tree.items = list;
119547
+ this._tree.openItem(parent.hierarchyId || parent.id);
119548
+ });
119549
+ this.binder.onSelectItem(parent);
119550
+ }
119551
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119552
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119553
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119554
+ handleFilterTree(event) {
119555
+ if (event.key === ENTER_KEY)
119556
+ this.filterItems();
119557
+ }
119558
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119559
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119560
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119561
+ async setTreeIems(list, first) {
119562
+ var _a;
119563
+ this._tree.items = list;
119564
+ if (first && !(first === null || first === void 0 ? void 0 : first.disabled)) {
119565
+ const parentHierarchyId = ((_a = first.hierarchy) === null || _a === void 0 ? void 0 : _a.slice(0, -1).join(HIERARCHY_SEPARATOR)) || first.id;
119566
+ await this._tree.openItem(parentHierarchyId);
119567
+ await this._tree.selectItem(first.id);
119568
+ }
119569
+ else {
119570
+ this._tree.selectItem(null);
119571
+ }
119572
+ }
119573
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119574
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119575
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119576
+ filterItems() {
119577
+ this.guide.getItemsByLabel(this.filterText).then(async ({ list, first }) => {
119578
+ this.setTreeIems(list, first);
119579
+ });
119580
+ }
119581
+ //TODO: Destituir esse binder. Rediscutida a arquitetura desse componente
119582
+ //vimos que o binder só dificulta a vida de quem vai usar... assim teremos
119583
+ //apenas uma lista de IGuideItems e o resto fica como a própria árvore...
119584
+ async initTree() {
119585
+ if (!this.binder)
119586
+ return;
119587
+ const binderItems = await this.binder.fetchItems();
119588
+ await this.guide.setList(binderItems);
119589
+ const guideItems = await this.guide.getList();
119590
+ this.setTreeIems(guideItems);
119591
+ }
119592
+ componentDidLoad() {
119593
+ ElementIDUtils.addIDInfoIfNotExists(this._element);
119594
+ this.initTree();
119595
+ }
119596
+ render() {
119597
+ return (h(Host, null, this.open ? (h("aside", { tabIndex: -1, id: "navigator", class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-guide-navigator", "data-element-id": ElementIDUtils.getInternalIDInfo("sidebar") }, h("div", { role: "search", class: "ez-guide-navigator__actions" }, h("ez-filter-input", { mode: "slim", value: this.filterText, onEzChange: (event) => (this.filterText = event.detail), label: "Buscar guia", "aria-placeholder": "Buscar guia", onKeyUp: this.handleFilterTree.bind(this), "data-element-id": ElementIDUtils.getInternalIDInfo("textinput") }), h("ez-button", { onClick: this.handleToggleSidebar.bind(this), class: "inverted", mode: "icon", size: "small", iconName: "show_menu", title: "Ocultar menu", "aria-label": "Ocultar menu", "aria-controls": "navigator", "data-element-id": ElementIDUtils.getInternalIDInfo("closeButton") })), h("ez-tree", { ref: element => (this._tree = element), onEzChange: evt => this.handleSelectTreeItem(evt), "data-element-id": ElementIDUtils.getInternalIDInfo("tree") }))) : (h("ez-sidebar-button", { onEzClick: this.handleToggleSidebar.bind(this), "aria-controls": "navigator", "aria-expanded": this.open, "data-element-id": ElementIDUtils.getInternalIDInfo("openButton") }))));
119598
+ }
119599
+ get _element() { return this; }
119600
+ static get watchers() { return {
119601
+ "binder": ["handleBinderChange"]
119602
+ }; }
119603
+ static get style() { return ezGuideNavigatorCss; }
119604
+ };
119605
+
119265
119606
  const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-2chevron-down:before{content:\"\\ea01\"}.ez-icon-2chevron-up:before{content:\"\\ea02\"}.ez-icon-account-outline:before{content:\"\\ea03\"}.ez-icon-account:before{content:\"\\ea04\"}.ez-icon-actions-sprite-v1:before{content:\"\\ea05\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea06\"}.ez-icon-alert-circle:before{content:\"\\ea07\"}.ez-icon-alert-mail:before{content:\"\\ea08\"}.ez-icon-alert-popup:before{content:\"\\ea09\"}.ez-icon-anexo:before{content:\"\\ea0a\"}.ez-icon-antecipação:before{content:\"\\ea0b\"}.ez-icon-apps:before{content:\"\\ea0c\"}.ez-icon-arrow_back:before{content:\"\\ea0d\"}.ez-icon-arrow_downward:before{content:\"\\ea0e\"}.ez-icon-baixa:before{content:\"\\ea0f\"}.ez-icon-balance:before{content:\"\\ea10\"}.ez-icon-bell-inverted:before{content:\"\\ea11\"}.ez-icon-bell:before{content:\"\\ea12\"}.ez-icon-boleto:before{content:\"\\ea13\"}.ez-icon-business-center:before{content:\"\\ea14\"}.ez-icon-calendar-clock:before{content:\"\\ea15\"}.ez-icon-calendar:before{content:\"\\ea16\"}.ez-icon-cash-remove:before{content:\"\\ea17\"}.ez-icon-check-circle-inverted:before{content:\"\\ea18\"}.ez-icon-check-circle:before{content:\"\\ea19\"}.ez-icon-check:before{content:\"\\ea1a\"}.ez-icon-chevron-down:before{content:\"\\ea1b\"}.ez-icon-chevron-left:before{content:\"\\ea1c\"}.ez-icon-chevron-right:before{content:\"\\ea1d\"}.ez-icon-chevron-up:before{content:\"\\ea1e\"}.ez-icon-circle--medium:before{content:\"\\ea1f\"}.ez-icon-circle:before{content:\"\\ea20\"}.ez-icon-cleaning:before{content:\"\\ea21\"}.ez-icon-clipboard:before{content:\"\\ea22\"}.ez-icon-close:before{content:\"\\ea23\"}.ez-icon-cobrar:before{content:\"\\ea24\"}.ez-icon-code:before{content:\"\\ea25\"}.ez-icon-configuration:before{content:\"\\ea26\"}.ez-icon-copy:before{content:\"\\ea27\"}.ez-icon-credit_card:before{content:\"\\ea28\"}.ez-icon-crop:before{content:\"\\ea29\"}.ez-icon-custom:before{content:\"\\ea2a\"}.ez-icon-delete:before{content:\"\\ea2b\"}.ez-icon-description:before{content:\"\\ea2c\"}.ez-icon-dividir:before{content:\"\\ea2d\"}.ez-icon-docx:before{content:\"\\ea2e\"}.ez-icon-dot-notification:before{content:\"\\ea2f\"}.ez-icon-dots-horizontal:before{content:\"\\ea30\"}.ez-icon-dots-vertical:before{content:\"\\ea31\"}.ez-icon-drag-indicator:before{content:\"\\ea32\"}.ez-icon-dual-chevron-down:before{content:\"\\ea33\"}.ez-icon-dual-chevron-up:before{content:\"\\ea34\"}.ez-icon-edit-file:before{content:\"\\ea35\"}.ez-icon-edit-table:before{content:\"\\ea36\"}.ez-icon-edit-time:before{content:\"\\ea37\"}.ez-icon-edit:before{content:\"\\ea38\"}.ez-icon-email:before{content:\"\\ea39\"}.ez-icon-estorno:before{content:\"\\ea3a\"}.ez-icon-exe:before{content:\"\\ea3b\"}.ez-icon-expand:before{content:\"\\ea3c\"}.ez-icon-expandir_card:before{content:\"\\ea3d\"}.ez-icon-extrato:before{content:\"\\ea3e\"}.ez-icon-eye-off:before{content:\"\\ea3f\"}.ez-icon-eye:before{content:\"\\ea40\"}.ez-icon-favorite:before{content:\"\\ea41\"}.ez-icon-figma:before{content:\"\\ea42\"}.ez-icon-file-download:before{content:\"\\ea43\"}.ez-icon-file-upload:before{content:\"\\ea44\"}.ez-icon-filter:before{content:\"\\ea45\"}.ez-icon-find-file:before{content:\"\\ea46\"}.ez-icon-find-page:before{content:\"\\ea47\"}.ez-icon-format-color-fill:before{content:\"\\ea48\"}.ez-icon-generic:before{content:\"\\ea49\"}.ez-icon-gif:before{content:\"\\ea4a\"}.ez-icon-graph_bar:before{content:\"\\ea4b\"}.ez-icon-handshake:before{content:\"\\ea4c\"}.ez-icon-help-inverted:before{content:\"\\ea4d\"}.ez-icon-help:before{content:\"\\ea4e\"}.ez-icon-hide_menu:before{content:\"\\ea4f\"}.ez-icon-home:before{content:\"\\ea50\"}.ez-icon-icons104:before{content:\"\\ea51\"}.ez-icon-language:before{content:\"\\ea52\"}.ez-icon-launch:before{content:\"\\ea53\"}.ez-icon-lightbulb:before{content:\"\\ea54\"}.ez-icon-list:before{content:\"\\ea55\"}.ez-icon-location:before{content:\"\\ea56\"}.ez-icon-lock-outline:before{content:\"\\ea57\"}.ez-icon-lock:before{content:\"\\ea58\"}.ez-icon-menu:before{content:\"\\ea59\"}.ez-icon-mid:before{content:\"\\ea5a\"}.ez-icon-minus:before{content:\"\\ea5b\"}.ez-icon-money-off:before{content:\"\\ea5c\"}.ez-icon-money:before{content:\"\\ea5d\"}.ez-icon-more:before{content:\"\\ea5e\"}.ez-icon-mp3:before{content:\"\\ea5f\"}.ez-icon-mp4:before{content:\"\\ea60\"}.ez-icon-north-west:before{content:\"\\ea61\"}.ez-icon-number:before{content:\"\\ea62\"}.ez-icon-ordem-ascendente:before{content:\"\\ea63\"}.ez-icon-ordem-descendente:before{content:\"\\ea64\"}.ez-icon-parcelar:before{content:\"\\ea65\"}.ez-icon-pause:before{content:\"\\ea66\"}.ez-icon-payments:before{content:\"\\ea67\"}.ez-icon-pdf:before{content:\"\\ea68\"}.ez-icon-play:before{content:\"\\ea69\"}.ez-icon-plus:before{content:\"\\ea6a\"}.ez-icon-png:before{content:\"\\ea6b\"}.ez-icon-power:before{content:\"\\ea6c\"}.ez-icon-pptx:before{content:\"\\ea6d\"}.ez-icon-print:before{content:\"\\ea6e\"}.ez-icon-push-pin:before{content:\"\\ea6f\"}.ez-icon-rateio:before{content:\"\\ea70\"}.ez-icon-receipt:before{content:\"\\ea71\"}.ez-icon-recolher_card:before{content:\"\\ea72\"}.ez-icon-restore:before{content:\"\\ea73\"}.ez-icon-return:before{content:\"\\ea74\"}.ez-icon-save:before{content:\"\\ea75\"}.ez-icon-search:before{content:\"\\ea76\"}.ez-icon-settings-inverted:before{content:\"\\ea77\"}.ez-icon-settings:before{content:\"\\ea78\"}.ez-icon-share:before{content:\"\\ea79\"}.ez-icon-shield:before{content:\"\\ea7a\"}.ez-icon-show_menu:before{content:\"\\ea7b\"}.ez-icon-south-east:before{content:\"\\ea7c\"}.ez-icon-sync:before{content:\"\\ea7d\"}.ez-icon-table:before{content:\"\\ea7e\"}.ez-icon-tag_code:before{content:\"\\ea7f\"}.ez-icon-text:before{content:\"\\ea80\"}.ez-icon-timeline:before{content:\"\\ea81\"}.ez-icon-timer-outline:before{content:\"\\ea82\"}.ez-icon-tune:before{content:\"\\ea83\"}.ez-icon-txt:before{content:\"\\ea84\"}.ez-icon-un-pin:before{content:\"\\ea85\"}.ez-icon-unfold_less:before{content:\"\\ea86\"}.ez-icon-unfold_more:before{content:\"\\ea87\"}.ez-icon-user-circle:before{content:\"\\ea88\"}.ez-icon-warning-outline:before{content:\"\\ea89\"}.ez-icon-warning_triangle:before{content:\"\\ea8a\"}.ez-icon-whatshot:before{content:\"\\ea8b\"}.ez-icon-xlsx:before{content:\"\\ea8c\"}.ez-icon-zip:before{content:\"\\ea8d\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
119266
119607
 
119267
119608
  let EzIcon$1 = class extends HTMLElement$1 {
@@ -121685,7 +122026,7 @@ const TreeItem = (props) => {
121685
122026
  }),
121686
122027
  h("div", { class: "item-icon-box" }, expandable &&
121687
122028
  h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: () => available && iconClick(treeItem) })),
121688
- h("label", { class: "item-label" }, treeItem.label)),
122029
+ h("label", { class: "item-label", title: treeItem.disabled ? (treeItem.tooltip || treeItem.label) : treeItem.label }, treeItem.label)),
121689
122030
  expanded
121690
122031
  && node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList }))));
121691
122032
  };
@@ -121823,17 +122164,6 @@ class Tree extends Node$1 {
121823
122164
  }
121824
122165
  });
121825
122166
  }
121826
- updateItem(item) {
121827
- if (item == undefined) {
121828
- return;
121829
- }
121830
- const node = this.getNode(item.id);
121831
- if (node == undefined) {
121832
- return;
121833
- }
121834
- Object.keys(item).forEach(attrib => node.item[attrib] = item[attrib]);
121835
- this._changeCallback();
121836
- }
121837
122167
  async open(path) {
121838
122168
  return new Promise(async (resolve) => {
121839
122169
  await this.walk(this, path, node => node.item.expanded = true);
@@ -121961,7 +122291,7 @@ let EzTree$1 = class extends HTMLElement$1 {
121961
122291
  }
121962
122292
  }
121963
122293
  observeItems() {
121964
- this._tree.load(this.items);
122294
+ return this._tree.load(this.items || []);
121965
122295
  }
121966
122296
  observeValue() {
121967
122297
  var _a;
@@ -122009,7 +122339,7 @@ let EzTree$1 = class extends HTMLElement$1 {
122009
122339
  if (expanded) {
122010
122340
  this.ezOpenItem.emit(item);
122011
122341
  }
122012
- this._tree.updateItem(item);
122342
+ forceUpdate(this);
122013
122343
  }
122014
122344
  previousLevel() {
122015
122345
  var _a;
@@ -122018,7 +122348,7 @@ let EzTree$1 = class extends HTMLElement$1 {
122018
122348
  }
122019
122349
  if (this.value.expanded) {
122020
122350
  this.value.expanded = false;
122021
- this._tree.updateItem(this.value);
122351
+ forceUpdate(this);
122022
122352
  }
122023
122353
  else {
122024
122354
  const node = this._tree.getNode(this.value.id);
@@ -122041,7 +122371,7 @@ let EzTree$1 = class extends HTMLElement$1 {
122041
122371
  }
122042
122372
  else {
122043
122373
  this.value.expanded = true;
122044
- this._tree.updateItem(this.value);
122374
+ forceUpdate(this);
122045
122375
  }
122046
122376
  }
122047
122377
  indexOf(id) {
@@ -122584,8 +122914,8 @@ const EzDropdown = /*@__PURE__*/proxyCustomElement(EzDropdown$1, [1,"ez-dropdown
122584
122914
  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]}]);
122585
122915
  const EzFilterInput = /*@__PURE__*/proxyCustomElement(EzFilterInput$1, [1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513]}]);
122586
122916
  const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"multiLevel":[4,"multi-level"],"levelResolver":[16],"contentBuilder":[16]}]);
122587
- const EzFormView = /*@__PURE__*/proxyCustomElement(EzFormView$1, [2,"ez-form-view",{"fields":[16]}]);
122588
122917
  const EzGrid = /*@__PURE__*/proxyCustomElement(EzGrid$1, [6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32]},[[0,"ezSelectionChange","onSelectionChange"]]]);
122918
+ const EzGuideNavigator = /*@__PURE__*/proxyCustomElement(EzGuideNavigator$1, [1,"ez-guide-navigator",{"binder":[16],"open":[1540],"items":[32],"filterText":[32]}]);
122589
122919
  const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]);
122590
122920
  const EzList = /*@__PURE__*/proxyCustomElement(EzList$1, [1,"ez-list",{"dataSource":[1040],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"_listItems":[32],"_listGroupItems":[32]}]);
122591
122921
  const EzLoadingBar = /*@__PURE__*/proxyCustomElement(EzLoadingBar$1, [1,"ez-loading-bar",{"_showLoading":[32]}]);
@@ -122604,7 +122934,7 @@ const EzTextEdit = /*@__PURE__*/proxyCustomElement(EzTextEdit$1, [1,"ez-text-edi
122604
122934
  const EzTextInput = /*@__PURE__*/proxyCustomElement(EzTextInput$1, [1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"]}]);
122605
122935
  const EzTimeInput = /*@__PURE__*/proxyCustomElement(EzTimeInput$1, [1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513]}]);
122606
122936
  const EzToast = /*@__PURE__*/proxyCustomElement(EzToast$1, [1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"]}]);
122607
- const EzTree = /*@__PURE__*/proxyCustomElement(EzTree$1, [1,"ez-tree",{"items":[16],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_waintingForLoad":[32]},[[2,"keydown","onKeyDownListener"]]]);
122937
+ const EzTree = /*@__PURE__*/proxyCustomElement(EzTree$1, [1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_waintingForLoad":[32]},[[2,"keydown","onKeyDownListener"]]]);
122608
122938
  const EzUpload = /*@__PURE__*/proxyCustomElement(EzUpload$1, [1,"ez-upload",{"label":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040]}]);
122609
122939
  const EzViewStack = /*@__PURE__*/proxyCustomElement(EzViewStack$1, [0,"ez-view-stack"]);
122610
122940
  const defineCustomElements = (opts) => {
@@ -122628,8 +122958,8 @@ const defineCustomElements = (opts) => {
122628
122958
  EzFileItem,
122629
122959
  EzFilterInput,
122630
122960
  EzForm,
122631
- EzFormView,
122632
122961
  EzGrid,
122962
+ EzGuideNavigator,
122633
122963
  EzIcon,
122634
122964
  EzList,
122635
122965
  EzLoadingBar,
@@ -122659,4 +122989,4 @@ const defineCustomElements = (opts) => {
122659
122989
  }
122660
122990
  };
122661
122991
 
122662
- export { EzActionsButton, EzAlert, EzApplication, EzBreadcrumb, EzButton, EzCalendar, EzCardItem, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzDropdown, EzFileItem, EzFilterInput, EzForm, EzFormView, EzGrid, EzIcon, EzList, EzLoadingBar, EzModal, EzModalContainer, EzNumberInput, EzPopover, EzPopup, EzRadioButton, EzScroller, EzSearch, EzSidebarButton, EzTabselector, EzTextArea, EzTextEdit, EzTextInput, EzTimeInput, EzToast, EzTree, EzUpload, EzViewStack, defineCustomElements };
122992
+ export { EzActionsButton, EzAlert, EzApplication, EzBreadcrumb, EzButton, EzCalendar, EzCardItem, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzDropdown, EzFileItem, EzFilterInput, EzForm, EzGrid, EzGuideNavigator, EzIcon, EzList, EzLoadingBar, EzModal, EzModalContainer, EzNumberInput, EzPopover, EzPopup, EzRadioButton, EzScroller, EzSearch, EzSidebarButton, EzTabselector, EzTextArea, EzTextEdit, EzTextInput, EzTimeInput, EzToast, EzTree, EzUpload, EzViewStack, defineCustomElements };