@sankhyalabs/ezui 2.10.1 → 2.12.0

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 (231) hide show
  1. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
  2. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  4. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  11. package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-dropdown.cjs.entry.js +503 -0
  16. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  17. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-form-view.cjs.entry.js +140 -0
  19. package/dist/cjs/ez-form.cjs.entry.js +228 -330
  20. package/dist/cjs/ez-grid.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
  31. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-sidebar-button.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-tabselector.cjs.entry.js +6 -3
  34. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
  36. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-tree.cjs.entry.js +109 -22
  40. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  42. package/dist/cjs/ezui.cjs.js +2 -2
  43. package/dist/cjs/{index-8646c40d.js → index-5e208fa5.js} +11 -0
  44. package/dist/cjs/loader.cjs.js +2 -2
  45. package/dist/collection/collection-manifest.json +2 -0
  46. package/dist/collection/components/ez-dropdown/ez-dropdown.css +349 -0
  47. package/dist/collection/components/ez-dropdown/ez-dropdown.js +339 -0
  48. package/dist/collection/components/ez-dropdown/structure/DropdownItem.js +33 -0
  49. package/dist/collection/components/ez-dropdown/structure/SubmenuControl.js +241 -0
  50. package/dist/collection/components/ez-form/{structure/FormSheetMetadata.js → FormMetadata.js} +39 -54
  51. package/dist/collection/components/ez-form/ez-form.css +7 -1
  52. package/dist/collection/components/ez-form/ez-form.js +128 -19
  53. package/dist/collection/components/ez-form/interfaces/IDefaultConfig.js +1 -0
  54. package/dist/collection/components/ez-form/interfaces/IFieldConfig.js +1 -0
  55. package/dist/collection/components/ez-form/interfaces/IFormConfig.js +1 -0
  56. package/dist/collection/components/ez-form/interfaces/IFormSheetMetadata.js +1 -0
  57. package/dist/collection/components/ez-form/interfaces/IInvalidField.js +1 -0
  58. package/dist/collection/components/ez-form/interfaces/IRecordValidator.js +1 -0
  59. package/dist/collection/components/ez-form/interfaces/ITabConfig.js +1 -0
  60. package/dist/collection/components/ez-form/interfaces/IValidationResult.js +1 -0
  61. package/dist/collection/components/ez-form/interfaces/index.js +1 -0
  62. package/dist/collection/components/ez-form/store/form.slice.js +6 -2
  63. package/dist/collection/components/ez-form-view/ez-form-view.css +6 -0
  64. package/dist/collection/components/ez-form-view/ez-form-view.js +71 -0
  65. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +26 -0
  66. package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/CheckBox.tpl.js +4 -4
  67. package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/ComboBox.tpl.js +2 -2
  68. package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/DateInput.tpl.js +1 -1
  69. package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/NumberInput.tpl.js +3 -3
  70. package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js +1 -0
  71. package/dist/collection/components/ez-form-view/interfaces/index.js +1 -0
  72. package/dist/collection/components/ez-tabselector/ez-tabselector.js +5 -2
  73. package/dist/collection/components/ez-tree/ez-tree.css +8 -6
  74. package/dist/collection/components/ez-tree/ez-tree.js +89 -11
  75. package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js +3 -0
  76. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -4
  77. package/dist/collection/components/ez-tree/subcomponents/index.js +1 -0
  78. package/dist/collection/components/ez-tree/types/Node.js +26 -4
  79. package/dist/collection/components/ez-tree/types/Tree.js +23 -2
  80. package/dist/custom-elements/index.d.ts +12 -0
  81. package/dist/custom-elements/index.js +977 -355
  82. package/dist/esm/ez-actions-button.entry.js +1 -1
  83. package/dist/esm/ez-alert.entry.js +1 -1
  84. package/dist/esm/ez-application.entry.js +1 -1
  85. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  86. package/dist/esm/ez-button.entry.js +1 -1
  87. package/dist/esm/ez-calendar.entry.js +1 -1
  88. package/dist/esm/ez-card-item.entry.js +1 -1
  89. package/dist/esm/ez-check.entry.js +1 -1
  90. package/dist/esm/ez-chip.entry.js +1 -1
  91. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  92. package/dist/esm/ez-combo-box.entry.js +1 -1
  93. package/dist/esm/ez-date-input.entry.js +1 -1
  94. package/dist/esm/ez-date-time-input.entry.js +1 -1
  95. package/dist/esm/ez-dialog.entry.js +1 -1
  96. package/dist/esm/ez-dropdown.entry.js +499 -0
  97. package/dist/esm/ez-file-item.entry.js +1 -1
  98. package/dist/esm/ez-filter-input.entry.js +1 -1
  99. package/dist/esm/ez-form-view.entry.js +136 -0
  100. package/dist/esm/ez-form.entry.js +229 -331
  101. package/dist/esm/ez-grid.entry.js +1 -1
  102. package/dist/esm/ez-icon.entry.js +1 -1
  103. package/dist/esm/ez-list.entry.js +1 -1
  104. package/dist/esm/ez-loading-bar.entry.js +1 -1
  105. package/dist/esm/ez-modal-container.entry.js +1 -1
  106. package/dist/esm/ez-modal.entry.js +1 -1
  107. package/dist/esm/ez-number-input.entry.js +1 -1
  108. package/dist/esm/ez-popover.entry.js +1 -1
  109. package/dist/esm/ez-popup.entry.js +1 -1
  110. package/dist/esm/ez-radio-button.entry.js +1 -1
  111. package/dist/esm/ez-scroller.entry.js +1 -1
  112. package/dist/esm/ez-search.entry.js +1 -1
  113. package/dist/esm/ez-sidebar-button.entry.js +1 -1
  114. package/dist/esm/ez-tabselector.entry.js +6 -3
  115. package/dist/esm/ez-text-area.entry.js +1 -1
  116. package/dist/esm/ez-text-edit.entry.js +1 -1
  117. package/dist/esm/ez-text-input.entry.js +1 -1
  118. package/dist/esm/ez-time-input.entry.js +1 -1
  119. package/dist/esm/ez-toast.entry.js +1 -1
  120. package/dist/esm/ez-tree.entry.js +109 -22
  121. package/dist/esm/ez-upload.entry.js +1 -1
  122. package/dist/esm/ez-view-stack.entry.js +1 -1
  123. package/dist/esm/ezui.js +2 -2
  124. package/dist/esm/{index-7bc778b3.js → index-c5203f95.js} +11 -0
  125. package/dist/esm/loader.js +2 -2
  126. package/dist/ezui/ezui.esm.js +1 -1
  127. package/dist/ezui/{p-739d60d1.entry.js → p-0c3f7bf2.entry.js} +1 -1
  128. package/dist/ezui/{p-171c3236.entry.js → p-0cd0545d.entry.js} +1 -1
  129. package/dist/ezui/{p-ad5fe50b.entry.js → p-1a27bb9f.entry.js} +1 -1
  130. package/dist/ezui/{p-3cfefc57.entry.js → p-1b94b9dc.entry.js} +1 -1
  131. package/dist/ezui/{p-f18f16e0.entry.js → p-20c01161.entry.js} +1 -1
  132. package/dist/ezui/{p-1634c851.entry.js → p-24717f87.entry.js} +1 -1
  133. package/dist/ezui/{p-7e496975.entry.js → p-3320768e.entry.js} +1 -1
  134. package/dist/ezui/{p-123a2bd5.entry.js → p-36ed5c45.entry.js} +1 -1
  135. package/dist/ezui/{p-25e83e46.entry.js → p-3b2091dd.entry.js} +1 -1
  136. package/dist/ezui/p-47bcc678.entry.js +1 -0
  137. package/dist/ezui/{p-9def6fd0.entry.js → p-47ca5e09.entry.js} +1 -1
  138. package/dist/ezui/{p-04fab1e9.entry.js → p-4c444816.entry.js} +1 -1
  139. package/dist/ezui/{p-9334a724.entry.js → p-608d13e8.entry.js} +1 -1
  140. package/dist/ezui/{p-50ae478a.entry.js → p-626b8940.entry.js} +1 -1
  141. package/dist/ezui/{p-14a04845.entry.js → p-6630eca2.entry.js} +1 -1
  142. package/dist/ezui/{p-9404f22b.entry.js → p-67b9a2cb.entry.js} +1 -1
  143. package/dist/ezui/{p-93bcc628.entry.js → p-6dec5cfa.entry.js} +1 -1
  144. package/dist/ezui/{p-5dc3af60.entry.js → p-6f9aba86.entry.js} +1 -1
  145. package/dist/ezui/p-7799666d.entry.js +1 -0
  146. package/dist/ezui/p-7b80df03.js +1 -0
  147. package/dist/ezui/{p-5c9ce8a7.entry.js → p-7d42065a.entry.js} +1 -1
  148. package/dist/ezui/{p-74c7f960.entry.js → p-81897c04.entry.js} +1 -1
  149. package/dist/ezui/p-91f8c816.entry.js +1 -0
  150. package/dist/ezui/p-97d2d2f6.entry.js +1 -0
  151. package/dist/ezui/{p-32f9f83a.entry.js → p-98c448c9.entry.js} +1 -1
  152. package/dist/ezui/{p-a86d00b3.entry.js → p-99aea44b.entry.js} +1 -1
  153. package/dist/ezui/p-a4b4645d.entry.js +1 -0
  154. package/dist/ezui/{p-e613d9bf.entry.js → p-ab5eee38.entry.js} +1 -1
  155. package/dist/ezui/{p-a2e55b33.entry.js → p-ad7151e0.entry.js} +1 -1
  156. package/dist/ezui/{p-f6111077.entry.js → p-ad8b7412.entry.js} +1 -1
  157. package/dist/ezui/{p-1a89d3ff.entry.js → p-b2e861cb.entry.js} +1 -1
  158. package/dist/ezui/{p-f2627de5.entry.js → p-b2efb22c.entry.js} +1 -1
  159. package/dist/ezui/{p-04a3b457.entry.js → p-b5557d33.entry.js} +1 -1
  160. package/dist/ezui/p-ba03ac61.entry.js +1 -0
  161. package/dist/ezui/{p-6fd5e142.entry.js → p-bc324ee8.entry.js} +1 -1
  162. package/dist/ezui/{p-cfcc23e6.entry.js → p-bd9792e2.entry.js} +1 -1
  163. package/dist/ezui/{p-7c227b86.entry.js → p-bf8a633d.entry.js} +1 -1
  164. package/dist/ezui/{p-ea877274.entry.js → p-c071db26.entry.js} +1 -1
  165. package/dist/ezui/{p-46113d5a.entry.js → p-c3529df3.entry.js} +1 -1
  166. package/dist/ezui/{p-b60fbad2.entry.js → p-ca7435a6.entry.js} +1 -1
  167. package/dist/ezui/{p-37335c51.entry.js → p-e203c89f.entry.js} +1 -1
  168. package/dist/ezui/{p-f2c4e811.entry.js → p-fc97f773.entry.js} +1 -1
  169. package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +58 -0
  170. package/dist/types/components/ez-dropdown/structure/DropdownItem.d.ts +28 -0
  171. package/dist/types/components/ez-dropdown/structure/SubmenuControl.d.ts +78 -0
  172. package/dist/types/components/ez-form/DataBinder.d.ts +1 -1
  173. package/dist/types/components/ez-form/FormMetadata.d.ts +16 -0
  174. package/dist/types/components/ez-form/ez-form.d.ts +21 -43
  175. package/dist/types/components/ez-form/interfaces/IDefaultConfig.d.ts +5 -0
  176. package/dist/types/components/ez-form/interfaces/IFieldConfig.d.ts +13 -0
  177. package/dist/types/components/ez-form/interfaces/IFormConfig.d.ts +7 -0
  178. package/dist/types/components/ez-form/interfaces/IFormSheetMetadata.d.ts +9 -0
  179. package/dist/types/components/ez-form/interfaces/IInvalidField.d.ts +4 -0
  180. package/dist/types/components/ez-form/interfaces/IRecordValidator.d.ts +6 -0
  181. package/dist/types/components/ez-form/interfaces/ITabConfig.d.ts +5 -0
  182. package/dist/types/components/ez-form/interfaces/IValidationResult.d.ts +8 -0
  183. package/dist/types/components/ez-form/interfaces/index.d.ts +8 -0
  184. package/dist/types/components/ez-form/store/form.slice.d.ts +5 -3
  185. package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +2 -0
  186. package/dist/types/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.d.ts +3 -0
  187. package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +2 -0
  188. package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +4 -0
  189. package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +2 -0
  190. package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +3 -0
  191. package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +2 -0
  192. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +2 -0
  193. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +2 -0
  194. package/dist/types/components/ez-form-view/interfaces/IFormViewField.d.ts +10 -0
  195. package/dist/types/components/ez-form-view/interfaces/index.d.ts +1 -0
  196. package/dist/types/components/ez-tree/ez-tree.d.ts +13 -0
  197. package/dist/types/components/ez-tree/interfaces/ITreeItem.d.ts +1 -0
  198. package/dist/types/components/ez-tree/subcomponents/DefaultTooltipResolver.d.ts +2 -0
  199. package/dist/types/components/ez-tree/subcomponents/TreeItem.d.ts +2 -0
  200. package/dist/types/components/ez-tree/subcomponents/index.d.ts +1 -0
  201. package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
  202. package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
  203. package/dist/types/components.d.ts +111 -2
  204. package/package.json +1 -1
  205. package/react/components.d.ts +2 -0
  206. package/react/components.js +2 -0
  207. package/react/components.js.map +1 -1
  208. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +0 -48
  209. package/dist/collection/components/ez-form/structure/FormItem.js +0 -11
  210. package/dist/collection/components/ez-form/structure/FormSheet.js +0 -6
  211. package/dist/ezui/p-1cc11468.entry.js +0 -1
  212. package/dist/ezui/p-3c7ea91b.js +0 -1
  213. package/dist/ezui/p-79e409c6.entry.js +0 -1
  214. package/dist/ezui/p-941e9792.entry.js +0 -1
  215. package/dist/ezui/p-ddb1c350.entry.js +0 -1
  216. package/dist/types/components/ez-form/fieldbuilder/FieldBuilder.d.ts +0 -2
  217. package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +0 -3
  218. package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +0 -6
  219. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +0 -15
  220. package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +0 -5
  221. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +0 -7
  222. package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +0 -6
  223. package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +0 -5
  224. package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +0 -5
  225. package/dist/types/components/ez-form/structure/FormItem.d.ts +0 -9
  226. package/dist/types/components/ez-form/structure/FormSheet.d.ts +0 -10
  227. package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +0 -35
  228. /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/FileInput.tpl.js +0 -0
  229. /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/SearchInput.tpl.js +0 -0
  230. /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/TextArea.tpl.js +0 -0
  231. /package/dist/collection/components/{ez-form/fieldbuilder/tpl → ez-form-view/fieldbuilder/templates}/TextInput.tpl.js +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, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, ObjectUtils as ObjectUtils$1, 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, Action, WaitingChangeException, ApplicationContext, UserInterface, DataUnitAction, DataUnit, NumberUtils as NumberUtils$1, DataType, SortMode, JSUtils, MaskFormatter } from '@sankhyalabs/core';
4
4
 
5
5
  var DialogType;
6
6
  (function (DialogType) {
@@ -2072,6 +2072,503 @@ let EzDialog$1 = class extends HTMLElement$1 {
2072
2072
  static get style() { return ezDialogCss; }
2073
2073
  };
2074
2074
 
2075
+ const DropdownItem = ({ item, hasIcon, hasChildren, isLockedLevels, onSubActionClick }) => {
2076
+ return (h("div", { class: "ez-dropdown__item-wrapper", title: item.label },
2077
+ getContentLeft(item, hasIcon),
2078
+ h("span", { class: "ez-dropdown__item-label" }, item.label),
2079
+ getContentRight(item, hasChildren, isLockedLevels, onSubActionClick)));
2080
+ };
2081
+ const getContentLeft = (item, hasIcon) => {
2082
+ if (item == undefined || !hasIcon) {
2083
+ return;
2084
+ }
2085
+ if (item.iconName) {
2086
+ return (h("ez-icon", Object.assign({ class: "ez-dropdown__icon-left", iconName: item.iconName, size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${item.id}_ezDropdownItemIcon` })));
2087
+ }
2088
+ return (h("ez-icon", { class: "ez-dropdown__icon-left ez-dropdown__hidden", size: "medium" }));
2089
+ };
2090
+ const getContentRight = (item, hasChildren, isLockedLevels, onClick) => {
2091
+ var _a, _b;
2092
+ if (item == undefined) {
2093
+ return;
2094
+ }
2095
+ if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) && item.subAction != undefined && Object.keys(item.subAction).length > 0) {
2096
+ return (h("span", Object.assign({ onClick: () => onClick(item), title: item.subAction.label, class: `ez-dropdown__link ez-dropdown__link--${item.subAction.type || "primary"}` }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${item.subAction.id}_ezDropdownItemSubAction` }), item.subAction.label));
2097
+ }
2098
+ if (isLockedLevels || !hasChildren) {
2099
+ return;
2100
+ }
2101
+ if (((_b = item.children) === null || _b === void 0 ? void 0 : _b.length) > 0) {
2102
+ return (h("ez-icon", Object.assign({ class: "ez-dropdown__icon-right", iconName: "chevron-right", size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${item.id}_ezDropdownIconOpenChildren` })));
2103
+ }
2104
+ return (h("ez-icon", { class: "ez-dropdown__icon-right ez-dropdown__hidden", size: "medium" }));
2105
+ };
2106
+
2107
+ class SubmenuControl {
2108
+ constructor() { }
2109
+ //---------------------------------------------
2110
+ // Public methods
2111
+ //---------------------------------------------
2112
+ /**
2113
+ * Método responsável por fechar submenus abertos e abrir o submenu desejado.
2114
+ * @param menu - Item de menu selecionado para abrir o submenu.
2115
+ */
2116
+ show(menu) {
2117
+ const submenu = menu === null || menu === void 0 ? void 0 : menu.querySelector(".ez-dropdown__submenu");
2118
+ if (menu == undefined || submenu == undefined) {
2119
+ return;
2120
+ }
2121
+ submenu.classList.remove("ez-dropdown__submenu--hide");
2122
+ this.setPosition(menu);
2123
+ this.setScrollContainer(menu);
2124
+ this.setMaxHeight(submenu);
2125
+ }
2126
+ /**
2127
+ * Método responsável por fechar um determinado submenu aberto.
2128
+ * @param menu - Item de menu selecionado com o submenu aberto.
2129
+ */
2130
+ hide(menu) {
2131
+ if (menu == undefined) {
2132
+ return;
2133
+ }
2134
+ const submenuSelector = ".ez-dropdown__submenu:not(.ez-dropdown__submenu--hide)";
2135
+ const submenuElement = menu.querySelector(submenuSelector);
2136
+ this.reset(submenuElement);
2137
+ this.hideChild(submenuElement);
2138
+ }
2139
+ /**
2140
+ * Método responsável por fechar todos os submenus filhos de um determinado submenu.
2141
+ * @param submenu - Elemento HTML do submenu pai.
2142
+ */
2143
+ hideChild(submenu) {
2144
+ if (submenu == undefined) {
2145
+ return;
2146
+ }
2147
+ submenu.querySelectorAll(".ez-dropdown__submenu")
2148
+ .forEach((child) => {
2149
+ this.reset(child);
2150
+ });
2151
+ }
2152
+ /**
2153
+ * Método responsável por posicionar o submenu na tela.
2154
+ * @param menu - Item da lista selecionado para abrir o submenu.
2155
+ */
2156
+ setPosition(menu) {
2157
+ const submenu = menu === null || menu === void 0 ? void 0 : menu.querySelector(".ez-dropdown__submenu");
2158
+ const dropdown = menu === null || menu === void 0 ? void 0 : menu.closest(".ez-dropdown");
2159
+ if (submenu == undefined || dropdown == undefined) {
2160
+ return;
2161
+ }
2162
+ submenu.style.top = this.getPositionTop(menu);
2163
+ submenu.style.left = this.getPositionRight(dropdown);
2164
+ const bounding = submenu === null || submenu === void 0 ? void 0 : submenu.getBoundingClientRect();
2165
+ const docWidth = document.body.clientWidth;
2166
+ if ((bounding === null || bounding === void 0 ? void 0 : bounding.right) > docWidth) {
2167
+ this.updatePosition(dropdown, submenu);
2168
+ }
2169
+ }
2170
+ /**
2171
+ * Método responsável por controlar a altura máxima do dropdown.
2172
+ * @param element - Elemento HTML pai do dropdown que será renderizado.
2173
+ */
2174
+ setMaxHeight(element) {
2175
+ var _a;
2176
+ const parentElement = (element === null || element === void 0 ? void 0 : element.shadowRoot) || element;
2177
+ const dropdown = parentElement === null || parentElement === void 0 ? void 0 : parentElement.querySelector(".ez-dropdown");
2178
+ const docHeight = document.body.clientHeight;
2179
+ let submenu;
2180
+ let bounding;
2181
+ if ((parentElement === null || parentElement === void 0 ? void 0 : parentElement["tagName"]) != undefined) {
2182
+ submenu = parentElement;
2183
+ bounding = submenu === null || submenu === void 0 ? void 0 : submenu.getBoundingClientRect();
2184
+ }
2185
+ else {
2186
+ bounding = dropdown === null || dropdown === void 0 ? void 0 : dropdown.getBoundingClientRect();
2187
+ }
2188
+ if (dropdown == undefined || bounding == undefined) {
2189
+ return;
2190
+ }
2191
+ /**
2192
+ * Menu aberto irá ultrapassar a altura da página?
2193
+ */
2194
+ if ((bounding.y + bounding.height) > docHeight) {
2195
+ /**
2196
+ * Menu aberto é um submenu?
2197
+ * Sim: realiza o calculo com base na altura do menu pai
2198
+ * Não: recalcula a altura do menu para atualizar a barra de rolagem
2199
+ */
2200
+ if (submenu != undefined) {
2201
+ const dropdownParent = submenu.closest(".ez-dropdown");
2202
+ const boundingParent = dropdownParent === null || dropdownParent === void 0 ? void 0 : dropdownParent.getBoundingClientRect();
2203
+ const marginTop = parseFloat(((_a = getComputedStyle(submenu)) === null || _a === void 0 ? void 0 : _a.marginTop) || "0");
2204
+ if (dropdownParent == undefined || boundingParent == undefined) {
2205
+ return;
2206
+ }
2207
+ /**
2208
+ * Submenu aberto ao ser reposicionado ficará acima da altura do menu pai?
2209
+ * Sim: posiciona o submenu na altura do menu pai e recalcula a sua altura para atualizar a barra de rolagem
2210
+ * Não: posiciona o submenu entre a altura do menu pai e o rodapé da página
2211
+ */
2212
+ if ((boundingParent.y + bounding.height) > docHeight) {
2213
+ submenu.style.top = (boundingParent.y - marginTop) + "px";
2214
+ dropdown.style.maxHeight = (docHeight - boundingParent.y) + "px";
2215
+ }
2216
+ else {
2217
+ submenu.style.top = (docHeight - bounding.height - marginTop) + "px";
2218
+ }
2219
+ }
2220
+ else {
2221
+ let maxHeight = docHeight - bounding.y;
2222
+ if (maxHeight < 0) {
2223
+ maxHeight = bounding.height - docHeight;
2224
+ }
2225
+ dropdown.style.maxHeight = maxHeight + "px";
2226
+ }
2227
+ }
2228
+ this.setSpacerContainer(dropdown);
2229
+ }
2230
+ /**
2231
+ * Método responsável por atribuir a classe de espaçamento entre o conteúdo e o scroll.
2232
+ * @param dropdown - Elemento HTML pai do container que receberá a classe.
2233
+ */
2234
+ setSpacerContainer(dropdown) {
2235
+ const container = dropdown === null || dropdown === void 0 ? void 0 : dropdown.querySelector(".ez-dropdown__container");
2236
+ if (container == undefined) {
2237
+ return;
2238
+ }
2239
+ if (container.scrollHeight > container.clientHeight) {
2240
+ container.classList.add("ez-dropdown__container--spacer");
2241
+ }
2242
+ else {
2243
+ container.classList.remove("ez-dropdown__container--spacer");
2244
+ }
2245
+ }
2246
+ /**
2247
+ * Método responsável por resetar um determinado submenu aberto.
2248
+ * @param submenu - Elemento HTML do submenu que será resetado.
2249
+ */
2250
+ reset(submenu) {
2251
+ if (submenu == undefined) {
2252
+ return;
2253
+ }
2254
+ submenu.classList.add("ez-dropdown__submenu--hide");
2255
+ submenu.style.left = "";
2256
+ submenu.style.top = "";
2257
+ const dropdown = submenu.querySelector(".ez-dropdown");
2258
+ this.resetDropdown(dropdown);
2259
+ }
2260
+ /**
2261
+ * Método responsável por resetar um determinado dropdown renderizado.
2262
+ * @param dropdown - Elemento HTML do dropdown que será resetado.
2263
+ */
2264
+ resetDropdown(dropdown) {
2265
+ if (dropdown == undefined) {
2266
+ return;
2267
+ }
2268
+ dropdown.style.maxHeight = "";
2269
+ this.setSpacerContainer(dropdown);
2270
+ }
2271
+ //---------------------------------------------
2272
+ // Private methods
2273
+ //---------------------------------------------
2274
+ /**
2275
+ * Método responsável por controlar o scroll do container do submenu aberto.
2276
+ * @param menu - Item da lista selecionado para abrir o submenu.
2277
+ */
2278
+ setScrollContainer(menu) {
2279
+ const container = menu === null || menu === void 0 ? void 0 : menu.closest(".ez-dropdown__container");
2280
+ if (container == undefined) {
2281
+ return;
2282
+ }
2283
+ container.onscroll = this.onScrollContainer.bind(this);
2284
+ }
2285
+ /**
2286
+ * Método responsável por fechar os submenus filhos ao movimentar o scroll.
2287
+ * @param event - Evento de scroll disparado pelo Elemento HTML pai.
2288
+ */
2289
+ onScrollContainer(event) {
2290
+ const target = event === null || event === void 0 ? void 0 : event.target;
2291
+ this.hideChild(target);
2292
+ }
2293
+ /**
2294
+ * Método responsável por retornar a posição superior (top) de um elemento HTML na tela.
2295
+ * @param hostElement - Elemento HTML que será capturado o valor de sua posição superior (top) na tela.
2296
+ * @returns Valor da posição superior (top) de um determinado elemento HTML.
2297
+ */
2298
+ getPositionTop(hostElement) {
2299
+ const boundingHost = hostElement === null || hostElement === void 0 ? void 0 : hostElement.getBoundingClientRect();
2300
+ if (boundingHost == undefined) {
2301
+ return;
2302
+ }
2303
+ return boundingHost.y + "px";
2304
+ }
2305
+ /**
2306
+ * Método responsável por retornar a posição direita (right) de um elemento HTML na tela.
2307
+ * @param hostElement - Elemento HTML que será capturado o valor de sua posição direita (right) na tela.
2308
+ * @returns Valor da posição direita (right) de um determinado elemento HTML.
2309
+ */
2310
+ getPositionRight(hostElement) {
2311
+ const boundingHost = hostElement === null || hostElement === void 0 ? void 0 : hostElement.getBoundingClientRect();
2312
+ if (boundingHost == undefined) {
2313
+ return;
2314
+ }
2315
+ return (boundingHost.x + boundingHost.width) + "px";
2316
+ }
2317
+ /**
2318
+ * Método responsável por retornar a posição esquerda (left) de um elemento HTML desconsiderando a largura de outro elemento HTML.
2319
+ * @param hostElement - Elemento HTML que será capturado o valor de sua posição esquerda (left) na tela.
2320
+ * @param targetElement - Elemento HTML que será capturado o valor de sua largura (width).
2321
+ * @returns Valor da posição esquerda (left) de um determinado elemento HTML desconsiderando a largura de outro elemento HTML.
2322
+ */
2323
+ getPositionLeft(hostElement, targetElement) {
2324
+ const boundingHost = hostElement === null || hostElement === void 0 ? void 0 : hostElement.getBoundingClientRect();
2325
+ const boundingTarget = targetElement === null || targetElement === void 0 ? void 0 : targetElement.getBoundingClientRect();
2326
+ if (boundingHost == undefined || boundingTarget == undefined) {
2327
+ return;
2328
+ }
2329
+ return (boundingHost.x - boundingTarget.width) + "px";
2330
+ }
2331
+ /**
2332
+ * Método responsável por atualizar a posição de um elemento HTML que renderizou fora da tela.
2333
+ * @param hostElement - Elemento HTML que será a referência de posição dentro da tela.
2334
+ * @param targetElement - Elemento HTML que será reposicionado na tela.
2335
+ */
2336
+ updatePosition(hostElement, targetElement) {
2337
+ const boundingHost = hostElement === null || hostElement === void 0 ? void 0 : hostElement.getBoundingClientRect();
2338
+ const boundingTarget = targetElement === null || targetElement === void 0 ? void 0 : targetElement.getBoundingClientRect();
2339
+ if (boundingHost == undefined || boundingTarget == undefined) {
2340
+ return;
2341
+ }
2342
+ if (boundingHost.x < boundingTarget.right) {
2343
+ targetElement.style.left = this.getPositionLeft(hostElement, targetElement);
2344
+ this.updatePosition(hostElement, targetElement);
2345
+ }
2346
+ }
2347
+ }
2348
+
2349
+ const ezDropdownCss = ":host{--ez-dropdown--z-index:var(--more-visible, 2);--ez-dropdown--padding:var(--space--small, 6px);--ez-dropdown--box-shadow:var(--shadow--medium, 0px 8px 24px rgba(0, 38, 111, 0.1));--ez-dropdown--border-radius:var(--border--radius-medium, 12px);--ez-dropdown--background-color:var(--background--xlight, #fff);--ez-dropdown--font-family:var(--font-pattern, 'Roboto');--ez-dropdown--max-width:320px;--ez-dropdown--max-height:440px;--ez-dropdown__item--padding:var(--space--small, 6px);--ez-dropdown__item--gap:var(--space--small, 6px);--ez-dropdown__item--border-radius:var(--border--radius-small, 6px);--ez-dropdown__item--color:var(--title--primary, #2b3a54);--ez-dropdown__item--font-weight:var(--text-weight--medium, 400);--ez-dropdown__item--font-size:var(--text--medium, 14px);--ez-dropdown__item--line-height:calc(var(--ez-dropdown__item--font-size) + 4px);--ez-dropdown__item--background-color:var(--background--medium, #f0f3f7);--ez-dropdown__item--transition:var(--transition, .2s linear);--ez-dropdown__item-label--margin-right:var(--space--medium, 12px);--ez-dropdown__icon--size:var(--icon--medium, 18px);--ez-dropdown__divider--background-color:var(--color--disable-secondary, #f2f5f8);--ez-dropdown__divider--margin:var(--space--extra-small, 3px) 0;--ez-dropdown__group-label--color:var(--text--secondary, #A2ABB9);--ez-dropdown__group-label--font-weight:var(--text-weight--large, 600);--ez-dropdown__group-label--font-size:var(--text--small, 12px);--ez-dropdown__group-label--line-height:var(--text--medium, 14px);--ez-dropdown__group-label--padding:var(--space--small, 6px);--ez-dropdown__submenu--z-index:var(--most-visible, 3);--ez-dropdown__link--font-weight:var(--text-weight--large, 600);--ez-dropdown__link--primary--color:var(--color--primary, #008561);--ez-dropdown__link--critical--color:var(--color-alert--error-800, #BD0025);--ez-dropdown__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-dropdown__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-dropdown__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-dropdown__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-dropdown__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-dropdown__scrollbar--width:var(--space--small, 6px);--ez-dropdown__scrollbar--padding-right:var(--space--extra-small, 3px);display:flex;flex-direction:column;height:fit-content;user-select:none;box-sizing:border-box;position:fixed;z-index:var(--ez-dropdown--z-index)}:host *{box-sizing:border-box}.ez-dropdown{display:flex;padding:var(--ez-dropdown--padding);box-shadow:var(--ez-dropdown--box-shadow);border-radius:var(--ez-dropdown--border-radius);background-color:var(--ez-dropdown--background-color);max-width:var(--ez-dropdown--max-width);max-height:var(--ez-dropdown--max-height)}.ez-dropdown *{font-family:var(--ez-dropdown--font-family)}.ez-dropdown__container{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;flex:auto;scrollbar-color:var(--ez-dropdown__scrollbar--color-clicked) var(--ez-dropdown__scrollbar--color-background)}.ez-dropdown__container::-webkit-scrollbar{background-color:var(--ez-dropdown__scrollbar--color-background);width:var(--ez-dropdown__scrollbar--width);max-width:var(--ez-dropdown__scrollbar--width);min-width:var(--ez-dropdown__scrollbar--width)}.ez-dropdown__container::-webkit-scrollbar-track{background-color:var(--ez-dropdown__scrollbar--color-background);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb{background-color:var(--ez-dropdown__scrollbar--color-default);border-radius:var(--ez-dropdown__scrollbar--border-radius)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:hover,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-dropdown__scrollbar--color-hover)}.ez-dropdown__container::-webkit-scrollbar-thumb:vertical:active,.ez-dropdown__container::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-dropdown__scrollbar--color-clicked)}.ez-dropdown__container--spacer{padding-right:var(--ez-dropdown__scrollbar--padding-right)}.ez-dropdown__item{display:flex;align-items:center;background-color:transparent;border-radius:var(--ez-dropdown__item--border-radius);transition:var(--ez-dropdown__item--transition)}.ez-dropdown__item:hover{background-color:var(--ez-dropdown__item--background-color)}.ez-dropdown__item-wrapper{display:flex;align-items:center;position:relative;cursor:pointer;width:100%;margin:0;white-space:nowrap;gap:var(--ez-dropdown__item--gap);color:var(--ez-dropdown__item--color);font-weight:var(--ez-dropdown__item--font-weight);font-size:var(--ez-dropdown__item--font-size);line-height:var(--ez-dropdown__item--line-height);padding:var(--ez-dropdown__item--padding)}.ez-dropdown__item-wrapper ez-icon{display:flex;justify-content:center;align-items:center;width:var(--ez-dropdown__icon--size);height:var(--ez-dropdown__icon--size);min-width:var(--ez-dropdown__icon--size);min-height:var(--ez-dropdown__icon--size)}.ez-dropdown__item-content{display:flex;align-items:center;flex:auto;overflow:hidden;gap:var(--ez-dropdown__item--gap)}.ez-dropdown__item-label{text-align:left;text-overflow:ellipsis;overflow:hidden;flex:auto}.ez-dropdown__item-label:not(:last-child){margin-right:var(--ez-dropdown__item-label--margin-right)}.ez-dropdown__item-content+.ez-dropdown__link{margin-left:var(--ez-dropdown__item-label--margin-right);margin-right:var(--ez-dropdown__item--padding)}.ez-dropdown__item-builder{flex:auto}.ez-dropdown__divider{width:100%;height:2px;border-radius:1px;border:none;display:block;background-color:var(--ez-dropdown__divider--background-color);margin:var(--ez-dropdown__divider--margin)}.ez-dropdown__hidden{visibility:hidden}.ez-dropdown__group{display:flex;flex-direction:column}.ez-dropdown__group-label{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ez-dropdown__group-label--color);font-weight:var(--ez-dropdown__group-label--font-weight);font-size:var(--ez-dropdown__group-label--font-size);line-height:var(--ez-dropdown__group-label--line-height);padding:var(--ez-dropdown__group-label--padding)}.ez-dropdown__icon-right{margin-left:auto}.ez-dropdown__submenu{position:fixed;z-index:var(--ez-dropdown__submenu--z-index);margin-top:calc(var(--ez-dropdown__item--padding) * -1)}.ez-dropdown__submenu--hide{display:none}.ez-dropdown__link{display:block;margin-left:auto;cursor:pointer;text-overflow:ellipsis;overflow:hidden;font-weight:var(--ez-dropdown__link--font-weight);max-width:calc(var(--ez-dropdown--max-width) * 0.43)}.ez-dropdown__link--primary{color:var(--ez-dropdown__link--primary--color)}.ez-dropdown__link--critical{color:var(--ez-dropdown__link--critical--color)}.ez-dropdown__link:hover{text-decoration:underline}";
2350
+
2351
+ let EzDropdown$1 = class extends HTMLElement$1 {
2352
+ constructor() {
2353
+ super();
2354
+ this.__registerHost();
2355
+ this.__attachShadow();
2356
+ this.ezClick = createEvent(this, "ezClick", 7);
2357
+ this.ezSubActionClick = createEvent(this, "ezSubActionClick", 7);
2358
+ this._itemList = {};
2359
+ this._submenuList = [];
2360
+ this._openedMenuList = {};
2361
+ /**
2362
+ * Limitador de níveis de menu + submenu.
2363
+ * Valor 0, null ou undefined desativa o limitador.
2364
+ */
2365
+ this._levelLimits = 3;
2366
+ /**
2367
+ * Lista de itens que vão ser apresentados no dropdown.
2368
+ */
2369
+ this.items = [];
2370
+ }
2371
+ //---------------------------------------------
2372
+ // Private methods
2373
+ //---------------------------------------------
2374
+ defaultItemBuilder(item, isLockedLevels, hasIcon, hasChildren) {
2375
+ return (h(DropdownItem, { item: item, hasIcon: hasIcon, hasChildren: hasChildren, isLockedLevels: isLockedLevels, onSubActionClick: this.onSubActionClick.bind(this) }));
2376
+ }
2377
+ getMaxOrder(items) {
2378
+ if (items == undefined || items.length === 0) {
2379
+ return -1;
2380
+ }
2381
+ return Math.max(...items.map((item) => {
2382
+ var _a;
2383
+ const order = (_a = item.group) === null || _a === void 0 ? void 0 : _a["order"];
2384
+ return order != undefined && order >= 0 ? order : -1;
2385
+ }));
2386
+ }
2387
+ hasIcon(items) {
2388
+ return items === null || items === void 0 ? void 0 : items.some((item) => (item.iconName || "") !== "");
2389
+ }
2390
+ hasGroup(items) {
2391
+ return items === null || items === void 0 ? void 0 : items.some((item) => (item.group || "") !== "");
2392
+ }
2393
+ hasChildren(items) {
2394
+ return items === null || items === void 0 ? void 0 : items.some((item) => (item.children || []).length > 0);
2395
+ }
2396
+ isLockedLevels(level) {
2397
+ if (!this._levelLimits) {
2398
+ return false;
2399
+ }
2400
+ return level === (this._levelLimits + 1);
2401
+ }
2402
+ getItemsByGroup(items, level) {
2403
+ let itemsByGroup = {};
2404
+ const maxOrder = this.getMaxOrder(items);
2405
+ items.forEach((item) => {
2406
+ const label = item.group && item.group["label"] != undefined ? item.group["label"] || "noGroup" : item.group || "noGroup";
2407
+ const order = item.group && item.group["order"] != undefined ? item.group["order"] : item.group ? (maxOrder + 1) : (maxOrder + 2);
2408
+ let groupObj = itemsByGroup[label];
2409
+ if (groupObj == undefined) {
2410
+ groupObj = {
2411
+ items: [],
2412
+ order
2413
+ };
2414
+ }
2415
+ this.validateItem(item, level);
2416
+ groupObj.items.push(item);
2417
+ itemsByGroup[label] = groupObj;
2418
+ });
2419
+ return ObjectUtils$1.sortByProperty(itemsByGroup, "order");
2420
+ }
2421
+ validateItem(item, level) {
2422
+ if (this._itemList == undefined) {
2423
+ this._itemList = {};
2424
+ }
2425
+ if (item.type == undefined) {
2426
+ item.type = "item";
2427
+ }
2428
+ if (item.id == undefined) {
2429
+ const itemId = `level_${level}_${item.type}`;
2430
+ const counter = Object.keys(this._itemList).filter((key) => key.includes(itemId)).length;
2431
+ item.id = `${itemId}_${counter + 1}`;
2432
+ }
2433
+ if (item.label == undefined) {
2434
+ item.label = "";
2435
+ }
2436
+ if (item.subAction != undefined) {
2437
+ if (item.subAction.id == undefined) {
2438
+ const subId = `subAction_${item.id}`;
2439
+ item.subAction.id = subId;
2440
+ }
2441
+ if (item.subAction.label == undefined) {
2442
+ item.subAction.label = "";
2443
+ }
2444
+ }
2445
+ if (this._itemList[item.id] == undefined) {
2446
+ this._itemList[item.id] = {};
2447
+ }
2448
+ }
2449
+ getItemsRender(groupItems, level, hasIcon, hasChildren) {
2450
+ if (groupItems == undefined) {
2451
+ return;
2452
+ }
2453
+ let counterLevel = level;
2454
+ let isLockedLevels = false;
2455
+ if (hasChildren) {
2456
+ counterLevel++;
2457
+ isLockedLevels = this.isLockedLevels(counterLevel);
2458
+ }
2459
+ return groupItems.map((item) => {
2460
+ var _a;
2461
+ return (item.type !== "divider"
2462
+ ? h("div", Object.assign({ ref: (ref) => this._itemList[item.id] = ref, class: "ez-dropdown__item", "data-level": level }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`${item.id}_ezDropdownItem`) }), h("div", { class: "ez-dropdown__item-content", onClick: (evt) => this.onItemClick(evt, item), onMouseOver: (evt) => this.onShowSubmenu(evt, item) }, this.itemBuilder
2463
+ ? h("div", { class: "ez-dropdown__item-builder", innerHTML: this.itemBuilder(item, level) })
2464
+ : this.defaultItemBuilder(item, isLockedLevels, hasIcon, hasChildren)), ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
2465
+ !isLockedLevels &&
2466
+ hasChildren &&
2467
+ h("div", { ref: (ref) => this._submenuList.push(ref), class: "ez-dropdown__submenu ez-dropdown__submenu--hide" }, this.renderDropdown(item.children, counterLevel)))
2468
+ : h("hr", Object.assign({ class: "ez-dropdown__divider" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${item.id}_ezDropdownDivider` })));
2469
+ });
2470
+ }
2471
+ renderDropdown(branchItems = this.items, level = 1) {
2472
+ if (branchItems == undefined || this.isLockedLevels(level)) {
2473
+ return;
2474
+ }
2475
+ const itemsByGroup = this.getItemsByGroup(branchItems, level);
2476
+ const hasGroup = this.hasGroup(branchItems);
2477
+ const hasIcon = this.hasIcon(branchItems);
2478
+ const hasChildren = this.hasChildren(branchItems);
2479
+ return (h("div", { class: "ez-dropdown", "data-level": level }, h("div", { class: "ez-dropdown__container" }, Object.keys(itemsByGroup)
2480
+ .map((groupLabel) => {
2481
+ return (h("div", Object.assign({ class: "ez-dropdown__group" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`${groupLabel}_ezDropdownGroup`) }), groupLabel !== "noGroup" &&
2482
+ h("label", { class: "ez-dropdown__group-label", title: groupLabel }, groupLabel), hasGroup &&
2483
+ groupLabel === "noGroup" &&
2484
+ h("hr", { class: "ez-dropdown__divider" }), this.getItemsRender(itemsByGroup[groupLabel].items, level, hasIcon, hasChildren)));
2485
+ }))));
2486
+ }
2487
+ hasOpenedSubmenu(level) {
2488
+ const openedLevels = Object.keys(this._openedMenuList);
2489
+ return openedLevels.includes(level.toString())
2490
+ || openedLevels.some((openedLevel) => Number(openedLevel) > level);
2491
+ }
2492
+ hasSubmenuOpened() {
2493
+ var _a;
2494
+ return (_a = this._submenuList) === null || _a === void 0 ? void 0 : _a.some((submenu) => !submenu.classList.contains("ez-dropdown__submenu--hide"));
2495
+ }
2496
+ setEvents() {
2497
+ document.removeEventListener('click', this.onHideAllSubmenu.bind(this));
2498
+ document.addEventListener('click', this.onHideAllSubmenu.bind(this));
2499
+ document.removeEventListener('scroll', this.onSubmenuReposition.bind(this));
2500
+ document.addEventListener('scroll', this.onSubmenuReposition.bind(this));
2501
+ }
2502
+ //---------------------------------------------
2503
+ // Event handlers
2504
+ //---------------------------------------------
2505
+ onShowSubmenu(evt, item) {
2506
+ var _a;
2507
+ if (evt == undefined) {
2508
+ return;
2509
+ }
2510
+ const menu = this._itemList[item.id];
2511
+ if (!(menu === null || menu === void 0 ? void 0 : menu.classList.contains("ez-dropdown__item"))) {
2512
+ return;
2513
+ }
2514
+ const level = Number(menu.dataset.level || "0");
2515
+ if (this.hasOpenedSubmenu(level)) {
2516
+ this._submenuControl.hide(this._openedMenuList[level]);
2517
+ delete this._openedMenuList[level];
2518
+ }
2519
+ if (!((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)) {
2520
+ return;
2521
+ }
2522
+ this._openedMenuList[menu.dataset.level] = menu;
2523
+ this._submenuControl.show(menu);
2524
+ }
2525
+ onItemClick(evt, item) {
2526
+ const target = evt === null || evt === void 0 ? void 0 : evt.target;
2527
+ if (target === null || target === void 0 ? void 0 : target.classList.contains("ez-dropdown__link")) {
2528
+ return;
2529
+ }
2530
+ this.value = item;
2531
+ this.ezClick.emit(item);
2532
+ }
2533
+ onSubActionClick(item) {
2534
+ this.ezSubActionClick.emit(item.subAction);
2535
+ }
2536
+ onHideAllSubmenu(evt = undefined) {
2537
+ const target = evt === null || evt === void 0 ? void 0 : evt.target;
2538
+ if (this.hasSubmenuOpened() && (target == undefined || (!target.closest(".ez-dropdown") && target.tagName !== "EZ-DROPDOWN"))) {
2539
+ this._openedMenuList = {};
2540
+ this._submenuList.forEach(this._submenuControl.reset.bind(this._submenuControl));
2541
+ }
2542
+ }
2543
+ onSubmenuReposition() {
2544
+ if (this._openedMenuList != undefined) {
2545
+ Object.keys(this._openedMenuList).forEach((key) => {
2546
+ const menu = this._openedMenuList[key];
2547
+ this._submenuControl.setPosition(menu);
2548
+ });
2549
+ }
2550
+ }
2551
+ //---------------------------------------------
2552
+ // Lifecycle web component
2553
+ //---------------------------------------------
2554
+ componentDidLoad() {
2555
+ ElementIDUtils.addIDInfo(this._element);
2556
+ this._submenuControl = new SubmenuControl();
2557
+ this._submenuControl.setMaxHeight(this._element);
2558
+ }
2559
+ componentDidUpdate() {
2560
+ this._submenuControl.setMaxHeight(this._element);
2561
+ }
2562
+ componentDidRender() {
2563
+ this.setEvents();
2564
+ }
2565
+ render() {
2566
+ return (h(Host, null, this.renderDropdown()));
2567
+ }
2568
+ get _element() { return this; }
2569
+ static get style() { return ezDropdownCss; }
2570
+ };
2571
+
2075
2572
  const ezFileItemCss = ":host{display:flex;width:100%;--ez-file-item--height:42px;--ez-file-item--padding:9px;--ez-file-item--border-radius:var(--border--radius-medium, 12px);--ez-file-item--border-color:var(--color--strokes, #DCE0E8);--ez-file-item--border-style:var(--border--small, 1px solid);--ez-file-item--font-family:var(--font-pattern, Arial);--ez-file-item--font-size:var(--text--medium, 14px);--ez-file-item--font-weight:var(--text-weight--medium, 400);--ez-file-item--color:var(--title--primary, #2B3A54);--ez-file-item__file-size--font-weight:var(--text-weight--large, 600);--ez-file-item__file-size--color:var(--color--primary, #008561);--ez-file-item__background-progress--color:var(--color--primary-300, E2F4EF);--ez-file-item--icon-color:var(--title--primary, #2B3A54)}.box{display:flex;box-sizing:border-box;position:relative;align-items:center;justify-content:space-between;width:100%;padding:var(--ez-file-item--padding);border:var(--ez-file-item--border-color) var(--ez-file-item--border-style);border-radius:var(--ez-file-item--border-radius);height:var(--ez-file-item--height)}.box::before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;clip-path:inset(2px calc(var(--ez-file-item--upload-progress, 0%) + 2px) 2px 2px round calc(var(--ez-file-item--border-radius) - 4px));background-color:var(--ez-file-item__background-progress--color)}.content{display:flex;align-items:center;z-index:0;overflow:hidden}.file-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-file-item--font-family);font-size:var(--ez-file-item--font-size);font-weight:var(--ez-file-item--font-weight);color:var(--ez-file-item--color)}.file-type-icon{flex-shrink:0;--ez-icon--color:var(--ez-file-item--icon-color);padding-right:var(--ez-file-item--padding)}.file-size{padding-left:2px;overflow:hidden;flex-shrink:0;white-space:nowrap;font-family:var(--ez-file-item--font-family);font-size:var(--ez-file-item--font-size);font-weight:var(--ez-file-item__file-size--font-weight);color:var(--ez-file-item__file-size--color)}.btn-remove{cursor:pointer;flex-shrink:0;--ez-icon--color:var(--ez-file-item--icon-color)}";
2076
2573
 
2077
2574
  let EzFileItem$1 = class extends HTMLElement$1 {
@@ -2217,284 +2714,6 @@ let EzFilterInput$1 = class extends HTMLElement$1 {
2217
2714
  static get style() { return ezFilterInputCss; }
2218
2715
  };
2219
2716
 
2220
- class FormMetadata {
2221
- constructor() {
2222
- this._sheets = new Map();
2223
- this._requiredFields = [];
2224
- this._cleanOnCopyFields = [];
2225
- this._defaultValues = {};
2226
- }
2227
- getSheet(name) {
2228
- return this._sheets.get(name);
2229
- }
2230
- getAllSheets() {
2231
- return this._sheets;
2232
- }
2233
- addSheet(sheet) {
2234
- this._sheets.set(sheet.name, sheet);
2235
- this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
2236
- this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
2237
- this._defaultValues = sheet.defaultValues;
2238
- }
2239
- getRequiredFields() {
2240
- return this._requiredFields;
2241
- }
2242
- getCleanOnCopyFields() {
2243
- return this._cleanOnCopyFields;
2244
- }
2245
- getDefaultValues() {
2246
- return this._defaultValues;
2247
- }
2248
- }
2249
- const isRequiredField = (descriptor, config) => {
2250
- if (descriptor.required) {
2251
- //Se for required pelo descritor não olha pra configuração.
2252
- return true;
2253
- }
2254
- return config === null || config === void 0 ? void 0 : config.required;
2255
- };
2256
- const isReadOnlyField = (descriptor, config) => {
2257
- if (descriptor.readOnly) {
2258
- //Se for readOnly pelo descritor não olha pra configuração.
2259
- return true;
2260
- }
2261
- return config === null || config === void 0 ? void 0 : config.readOnly;
2262
- };
2263
- const buildFromDataUnit = (dataUnit) => {
2264
- var _a, _b;
2265
- const unitMD = dataUnit.metadata;
2266
- const metadata = new FormMetadata();
2267
- if (unitMD) {
2268
- const visibleFields = (_a = unitMD.fields) === null || _a === void 0 ? void 0 : _a.filter(descriptor => descriptor.visible !== false);
2269
- const items = new Map();
2270
- (_b = unitMD === null || unitMD === void 0 ? void 0 : unitMD.fields) === null || _b === void 0 ? void 0 : _b.forEach((descriptor) => {
2271
- if (descriptor.visible !== false) {
2272
- resolveFieldGroup(items, null, descriptor);
2273
- }
2274
- });
2275
- let defaultValues = {};
2276
- visibleFields
2277
- .filter(descriptor => descriptor.defaultValue)
2278
- .map((descriptor) => defaultValues[descriptor.name] = descriptor.defaultValue);
2279
- metadata.addSheet({
2280
- label: unitMD.label,
2281
- name: unitMD.name,
2282
- items: Array.from(items.values()),
2283
- requiredFields: visibleFields
2284
- .filter(descriptor => descriptor.required)
2285
- .map(descriptor => descriptor.name),
2286
- cleanOnCopyFields: visibleFields
2287
- .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); })
2288
- .map(descriptor => descriptor.name),
2289
- defaultValues
2290
- });
2291
- }
2292
- return metadata;
2293
- };
2294
- function getTabConfig(tab, sheets) {
2295
- const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
2296
- return tabConfig || { label: tab, visible: true };
2297
- }
2298
- function sortTabs(a, b) {
2299
- return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
2300
- }
2301
- function resolveFieldGroup(items, field, descriptor) {
2302
- const fieldMD = { config: field, descriptor: descriptor };
2303
- let group = (field === null || field === void 0 ? void 0 : field.group) || descriptor.group;
2304
- if (group) {
2305
- const key = `group::${group}`;
2306
- if (!items.has(key)) {
2307
- items.set(key, { label: group, items: [fieldMD] });
2308
- }
2309
- else {
2310
- items.get(key).items.push(fieldMD);
2311
- }
2312
- }
2313
- else {
2314
- items.set((field === null || field === void 0 ? void 0 : field.name) || descriptor.name, fieldMD);
2315
- }
2316
- }
2317
- const buildFromConfig = (config, dataUnit) => {
2318
- var _a, _b;
2319
- const sheets = new Map();
2320
- const hiddenTabs = new Map();
2321
- const requiredFields = [];
2322
- const cleanOnCopyFields = [];
2323
- const defaultValues = {};
2324
- (_a = config === null || config === void 0 ? void 0 : config.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
2325
- if (!hiddenTabs.has(tab.label) && tab.visible === false) {
2326
- hiddenTabs.set(tab.label, tab);
2327
- }
2328
- });
2329
- (_b = config === null || config === void 0 ? void 0 : config.fields) === null || _b === void 0 ? void 0 : _b.forEach((field) => {
2330
- var _a, _b, _c, _d;
2331
- if (field.visible !== false) {
2332
- const tabConfig = getTabConfig(field.tab || "__main", sheets);
2333
- if (hiddenTabs.has(tabConfig.label)) {
2334
- return;
2335
- }
2336
- const descriptor = dataUnit.getField(field.name);
2337
- if (descriptor && tabConfig.visible) {
2338
- if (!sheets.has(tabConfig)) {
2339
- sheets.set(tabConfig, new Map());
2340
- }
2341
- const tabItens = sheets.get(tabConfig);
2342
- if (isRequiredField(descriptor, field)) {
2343
- requiredFields.push(field.name);
2344
- }
2345
- const cleanOnCopy = field.cleanOnCopy == undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : field.cleanOnCopy;
2346
- if (cleanOnCopy || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum) || ((_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.cleanOnCopy)) {
2347
- cleanOnCopyFields.push(field.name);
2348
- }
2349
- const defaultValue = field.defaultValue == undefined ? (_d = descriptor.properties) === null || _d === void 0 ? void 0 : _d.defaultValue : field.defaultValue;
2350
- if (defaultValue) {
2351
- defaultValues[field.name] = field.defaultValue;
2352
- }
2353
- resolveFieldGroup(tabItens, field, descriptor);
2354
- }
2355
- }
2356
- });
2357
- const metadata = new FormMetadata();
2358
- Array.from(sheets.entries())
2359
- .sort(sortTabs)
2360
- .forEach(([key, value]) => {
2361
- metadata.addSheet({
2362
- label: (key.label === "__main") ? "Principal" : key.label,
2363
- name: key.label,
2364
- items: Array.from(value.values()),
2365
- requiredFields,
2366
- cleanOnCopyFields,
2367
- defaultValues
2368
- });
2369
- });
2370
- return metadata;
2371
- };
2372
-
2373
- const buildTextArea = ({ name, label, readOnly }) => {
2374
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
2375
- h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
2376
- };
2377
-
2378
- const buildTextInput = ({ name, label, readOnly }) => {
2379
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2380
- h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
2381
- };
2382
-
2383
- const buildSwitch = (fieldConfig) => {
2384
- return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
2385
- };
2386
- const buildCheckBox = (fieldConfig) => {
2387
- return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
2388
- };
2389
- function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
2390
- 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" },
2391
- h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? CheckMode.SWITCH : CheckMode.REGULAR, "data-field-name": fieldName, key: fieldName })));
2392
- }
2393
-
2394
- const buildComboBox = ({ name, label, readOnly, required }, properties) => {
2395
- const prop = properties === null || properties === void 0 ? void 0 : properties.options;
2396
- let options;
2397
- if (typeof prop === "string") {
2398
- const parsed = JSON.parse(prop);
2399
- options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
2400
- }
2401
- else {
2402
- options = prop;
2403
- }
2404
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2405
- h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
2406
- };
2407
-
2408
- const buildSearch = ({ name, label, readOnly, required }) => {
2409
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2410
- h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
2411
- };
2412
-
2413
- const buildFile = ({ name, label, readOnly }) => {
2414
- return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
2415
- h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2416
- };
2417
-
2418
- const buildDate = ({ name, label, readOnly }) => {
2419
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2420
- h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2421
- };
2422
- const buildTime = ({ name, label, readOnly }) => {
2423
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2424
- h("ez-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2425
- };
2426
- const buildTimeDate = ({ name, label, readOnly }) => {
2427
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2428
- h("ez-date-time-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
2429
- };
2430
-
2431
- const buildDecimal = ({ name, label, readOnly }, properties) => {
2432
- const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
2433
- const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
2434
- return buildNumeric(name, label, readOnly, precision, prettyPrecision);
2435
- };
2436
- const buildInteger = ({ name, label, readOnly }) => {
2437
- return buildNumeric(name, label, readOnly, 0, 0);
2438
- };
2439
- function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
2440
- return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
2441
- h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
2442
- }
2443
-
2444
- const uiBuilders = new Map();
2445
- uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
2446
- uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
2447
- uiBuilders.set(UserInterface.SWITCH, buildSwitch);
2448
- uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
2449
- uiBuilders.set(UserInterface.SEARCH, buildSearch);
2450
- uiBuilders.set(UserInterface.FILE, buildFile);
2451
- uiBuilders.set(UserInterface.DATE, buildDate);
2452
- uiBuilders.set(UserInterface.TIME, buildTime);
2453
- uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
2454
- uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
2455
- uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
2456
- const buildField = (field) => {
2457
- const descriptor = field.descriptor;
2458
- const config = Object.assign({}, field.config);
2459
- let builder;
2460
- let props;
2461
- if (descriptor) {
2462
- if (!config.label) {
2463
- config.label = descriptor.label;
2464
- }
2465
- if (!config.name) {
2466
- config.name = descriptor.name;
2467
- }
2468
- // Forçamos uma avaliação priorizando o descriptor.
2469
- config.required = isRequiredField(descriptor, config);
2470
- config.readOnly = isReadOnlyField(descriptor, config);
2471
- props = descriptor.properties;
2472
- builder = uiBuilders.get(descriptor.userInterface);
2473
- }
2474
- if (config.required) {
2475
- config.label = `${config.label} (obrigatório) *`;
2476
- }
2477
- if (!builder) {
2478
- builder = buildTextInput;
2479
- }
2480
- return builder(config, props);
2481
- };
2482
-
2483
- const FormItem = ({ source }) => {
2484
- if ("items" in source) {
2485
- const fieldSet = source;
2486
- return h("ez-collapsible-box", { label: source.label, "header-size": "large", key: source.label }, fieldSet.items.map(fi => buildField(fi)));
2487
- }
2488
- else {
2489
- return buildField(source);
2490
- }
2491
- };
2492
-
2493
- const FormSheet = ({ store, source, dataElementId }) => {
2494
- return (h("div", { class: "dynamic-content ez-box__container", "data-element-id": dataElementId },
2495
- h("div", { class: "ez-row ez-padding-vertical--small" }, source.items.map(item => h(FormItem, { store: store, source: item })))));
2496
- };
2497
-
2498
2717
  /**
2499
2718
  * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
2500
2719
  *
@@ -2818,45 +3037,6 @@ function createStore(reducer, preloadedState, enhancer) {
2818
3037
  }, _ref2[$$observable] = observable, _ref2;
2819
3038
  }
2820
3039
 
2821
- const inicialState = {};
2822
- /////////////////////////////// REDUCERS ///////////////////////////////
2823
- function formReducer(state = inicialState, action) {
2824
- switch (action.type) {
2825
- case FormActions.METADATA_LOADED:
2826
- return Object.assign(Object.assign({}, state), { formMetadata: action.payload, currentSheet: undefined });
2827
- case FormActions.CHANGE_TAB:
2828
- return Object.assign(Object.assign({}, state), { currentSheet: action.payload });
2829
- default:
2830
- return state;
2831
- }
2832
- }
2833
- /////////////////////////////// ACTION CREATORS ///////////////////////////////
2834
- function loadMetadata(formMetadata) {
2835
- return {
2836
- type: FormActions.METADATA_LOADED,
2837
- payload: formMetadata
2838
- };
2839
- }
2840
- function changeTab(currentSheet) {
2841
- return {
2842
- type: FormActions.CHANGE_TAB,
2843
- payload: currentSheet.tabKey
2844
- };
2845
- }
2846
- /////////////////////////////// SELECTORS ///////////////////////////////
2847
- function selectFormMetadata(state) {
2848
- return state.formMetadata;
2849
- }
2850
- function selectCurrentSheet(state) {
2851
- return state.currentSheet ? state.formMetadata.getSheet(state.currentSheet) : Array.from(state.formMetadata.getAllSheets().values())[0];
2852
- }
2853
- /////////////////////////////// TYPES ///////////////////////////////
2854
- var FormActions;
2855
- (function (FormActions) {
2856
- FormActions["METADATA_LOADED"] = "FORM/METADATA_LOADED";
2857
- FormActions["CHANGE_TAB"] = "FORM/CHANGE_TAB";
2858
- })(FormActions || (FormActions = {}));
2859
-
2860
3040
  class DataBinder {
2861
3041
  constructor(dataUnit) {
2862
3042
  this._invalidFields = new Map();
@@ -3063,7 +3243,187 @@ class Bind {
3063
3243
  }
3064
3244
  }
3065
3245
 
3066
- const ezFormCss = "ez-form{display:flex;flex-direction:column;width:100%}.dynamic-content ez-collapsible-box{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";
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%}";
3067
3427
 
3068
3428
  let EzForm$1 = class extends HTMLElement$1 {
3069
3429
  constructor() {
@@ -3147,17 +3507,40 @@ let EzForm$1 = class extends HTMLElement$1 {
3147
3507
  }
3148
3508
  });
3149
3509
  }
3510
+ resolveLevel(items) {
3511
+ if (!this.levelResolver) {
3512
+ return items;
3513
+ }
3514
+ return this.levelResolver(items);
3515
+ }
3516
+ getMultiLevelContent(sheets, currentSheet, currentSheetId) {
3517
+ const treeItems = this.resolveLevel(sheets.map(sheet => {
3518
+ const item = {
3519
+ id: sheet.name,
3520
+ label: sheet.label
3521
+ };
3522
+ return item;
3523
+ }));
3524
+ return (h("div", { class: "multi-level__container" }, h("div", null, h("ez-tree", { selectedId: currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.name, items: treeItems, onEzChange: (evt) => {
3525
+ var _a;
3526
+ const selectedItem = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.id;
3527
+ if (selectedItem && selectedItem !== (currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.name)) {
3528
+ this._store.dispatch(changeTab(selectedItem));
3529
+ }
3530
+ } })), h("div", null, this.buildFormContent(currentSheetId, currentSheet))));
3531
+ }
3150
3532
  getDynamicContent() {
3151
- var _a;
3533
+ var _a, _b;
3152
3534
  const formMD = selectFormMetadata(this._store.getState());
3153
3535
  if (!formMD)
3154
3536
  return null;
3155
- const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
3156
- if (!currentSheet) {
3157
- return null;
3158
- }
3159
3537
  const allSheets = Array.from(formMD.getAllSheets().values());
3160
- const result = [];
3538
+ const currentSheetId = selectCurrentSheetId((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
3539
+ const currentSheet = selectCurrentSheet((_b = this._store) === null || _b === void 0 ? void 0 : _b.getState());
3540
+ if (this.multiLevel) {
3541
+ return this.getMultiLevelContent(allSheets, currentSheet, currentSheetId);
3542
+ }
3543
+ let result = [];
3161
3544
  if (allSheets.length > 1) {
3162
3545
  const tabs = allSheets.map((sheet, index) => {
3163
3546
  return { tabKey: sheet.name, label: sheet.label, index };
@@ -3165,12 +3548,25 @@ let EzForm$1 = class extends HTMLElement$1 {
3165
3548
  const idTabSelector = `selector`;
3166
3549
  result.push(h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
3167
3550
  }
3168
- const idFormSheet = `${StringUtils$1.replaceAccentuatedChars(StringUtils$1.toCamelCase(currentSheet.label), false)}_selectorContainer`;
3169
- result.push(h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
3551
+ result = result.concat(this.buildFormContent(currentSheetId, currentSheet));
3170
3552
  return result;
3171
3553
  }
3554
+ buildFormContent(sheetId, currentSheet) {
3555
+ const fields = currentSheet === null || currentSheet === void 0 ? void 0 : currentSheet.fields;
3556
+ if (this.contentBuilder != undefined) {
3557
+ const customContent = this.contentBuilder(sheetId, fields);
3558
+ if (customContent != undefined) {
3559
+ return h("div", { "innerHTML": customContent });
3560
+ }
3561
+ }
3562
+ if (currentSheet == undefined) {
3563
+ return;
3564
+ }
3565
+ 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 })));
3567
+ }
3172
3568
  processMetadata() {
3173
- if (!this.isStatic() && this.dataUnit) {
3569
+ if (!this.isStatic() && this.dataUnit && this._store) {
3174
3570
  const metadata = this.config != undefined && Object.values(this.config).length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
3175
3571
  this._store.dispatch(loadMetadata(metadata));
3176
3572
  }
@@ -3210,7 +3606,7 @@ let EzForm$1 = class extends HTMLElement$1 {
3210
3606
  }
3211
3607
  if (action.type === Action.RECORDS_ADDED) {
3212
3608
  const metadata = selectFormMetadata(this._store.getState());
3213
- const defaultValues = metadata.getDefaultValues();
3609
+ const defaultValues = metadata === null || metadata === void 0 ? void 0 : metadata.getDefaultValues();
3214
3610
  if (defaultValues) {
3215
3611
  const records = action.payload;
3216
3612
  return new DataUnitAction(Action.RECORDS_ADDED, records.map(record => {
@@ -3265,6 +3661,138 @@ let EzForm$1 = class extends HTMLElement$1 {
3265
3661
  static get style() { return ezFormCss; }
3266
3662
  };
3267
3663
 
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
+
3268
3796
  /**
3269
3797
  * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.1.1
3270
3798
  * @link https://www.ag-grid.com/
@@ -120216,9 +120744,12 @@ let EzTabselector$1 = class extends HTMLElement$1 {
120216
120744
  }
120217
120745
  componentWillRender() {
120218
120746
  if (!this._processedTabs) {
120219
- this._processedTabs = [];
120220
120747
  if (this.tabs) {
120221
- if (typeof this.tabs === "string") {
120748
+ if (Array.isArray(this.tabs)) {
120749
+ this._processedTabs = [...this.tabs];
120750
+ }
120751
+ else {
120752
+ this._processedTabs = [];
120222
120753
  this.tabs.split(",").forEach((label) => {
120223
120754
  label = label.trim();
120224
120755
  this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
@@ -121131,8 +121662,12 @@ const defaultIconResolver = (item, expanded, _level) => {
121131
121662
  return item.iconContracted || ICON_COLAPSED;
121132
121663
  };
121133
121664
 
121665
+ const defaultTooltipResolver = (item, _enabled, _level) => {
121666
+ return item.tooltip || item.label;
121667
+ };
121668
+
121134
121669
  const TreeItem = (props) => {
121135
- const { node, selectedId, itemClick, iconResolver, itemsList } = props;
121670
+ const { node, selectedId, itemClick, iconClick, iconResolver, tooltipResolver, itemsList } = props;
121136
121671
  const treeItem = node.item;
121137
121672
  const level = props.level || 1;
121138
121673
  const disabled = node.isDisabled();
@@ -121142,17 +121677,17 @@ const TreeItem = (props) => {
121142
121677
  if (available) {
121143
121678
  itemsList.push(treeItem);
121144
121679
  }
121145
- return (h("ul", { title: treeItem.label, class: level === 1 ? "first-level" : undefined },
121680
+ return (h("ul", { title: tooltipResolver(treeItem, !disabled, level), class: level === 1 ? "first-level" : undefined },
121146
121681
  h("li", Object.assign({ class: "tree-item", onClick: () => available && itemClick(treeItem) }, {
121147
121682
  disabled,
121148
121683
  selected: treeItem.id === selectedId,
121149
121684
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`ezTreeItem_${treeItem.id}`)
121150
121685
  }),
121151
121686
  h("div", { class: "item-icon-box" }, expandable &&
121152
- h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level) })),
121687
+ h("ez-icon", { id: treeItem.id, class: "item-icon", size: "small", iconName: iconResolver(treeItem, expanded, level), onClick: () => available && iconClick(treeItem) })),
121153
121688
  h("label", { class: "item-label" }, treeItem.label)),
121154
121689
  expanded
121155
- && node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, level: level + 1, iconResolver: iconResolver, itemsList: itemsList }))));
121690
+ && node.getChildren().map(child => h(TreeItem, { selectedId: selectedId, node: child, itemClick: itemClick, iconClick: iconClick, level: level + 1, iconResolver: iconResolver, tooltipResolver: tooltipResolver, itemsList: itemsList }))));
121156
121691
  };
121157
121692
 
121158
121693
  class Node$1 {
@@ -121174,6 +121709,31 @@ class Node$1 {
121174
121709
  this._childrenLoaded = true;
121175
121710
  }
121176
121711
  }
121712
+ refresh(newItem) {
121713
+ if (this.isPlaceHolder) {
121714
+ return;
121715
+ }
121716
+ this.item = Object.assign(Object.assign({}, newItem), { expanded: this.item.expanded });
121717
+ this._isLazyLoad = typeof this.item.children === "function" || this.item.childrenCount > 0;
121718
+ const oldChildren = this.children;
121719
+ this.children = new Map();
121720
+ if (Array.isArray(this.item.children)) {
121721
+ Array.from(this.item.children).forEach(item => {
121722
+ const node = oldChildren.get(item.id);
121723
+ if (node) {
121724
+ node.refresh(item);
121725
+ this.children.set(item.id, node);
121726
+ }
121727
+ else {
121728
+ this.addChild(this._tree, Object.assign({}, item));
121729
+ }
121730
+ });
121731
+ this._childrenLoaded = true;
121732
+ }
121733
+ else {
121734
+ this._childrenLoaded = false;
121735
+ }
121736
+ }
121177
121737
  isDisabled() {
121178
121738
  if (this.isPlaceHolder) {
121179
121739
  return false;
@@ -121184,10 +121744,7 @@ class Node$1 {
121184
121744
  if (this.isPlaceHolder) {
121185
121745
  return;
121186
121746
  }
121187
- this.item.children = children;
121188
- this._childrenLoaded = true;
121189
- this.children.clear();
121190
- children.forEach(item => this.addChild(this._tree, Object.assign({}, item)));
121747
+ this.refresh(Object.assign(Object.assign({}, this.item), { children }));
121191
121748
  }
121192
121749
  addChild(tree, item) {
121193
121750
  if (!this.children.has(item.id)) {
@@ -121253,8 +121810,29 @@ class Tree extends Node$1 {
121253
121810
  return this._disabledValues.get(id);
121254
121811
  }
121255
121812
  load(items) {
121256
- this.children.clear();
121257
- items.forEach(item => this.addChild(this, Object.assign({}, item)));
121813
+ const oldChildren = this.children;
121814
+ this.children = new Map();
121815
+ items.forEach(item => {
121816
+ const node = oldChildren.get(item.id);
121817
+ if (node) {
121818
+ node.refresh(item);
121819
+ this.children.set(item.id, node);
121820
+ }
121821
+ else {
121822
+ this.addChild(this, Object.assign({}, item));
121823
+ }
121824
+ });
121825
+ }
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();
121258
121836
  }
121259
121837
  async open(path) {
121260
121838
  return new Promise(async (resolve) => {
@@ -121298,7 +121876,7 @@ class Tree extends Node$1 {
121298
121876
  }
121299
121877
  }
121300
121878
 
121301
- const ezTreeCss = ":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item{display:flex;align-items:center;margin-top:var(--ez-tree--margin);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding)}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{cursor:pointer;background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{cursor:unset;background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";
121879
+ const ezTreeCss = ":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item{display:flex;align-items:center;margin-top:var(--ez-tree--margin);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding)}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";
121302
121880
 
121303
121881
  let EzTree$1 = class extends HTMLElement$1 {
121304
121882
  constructor() {
@@ -121309,6 +121887,9 @@ let EzTree$1 = class extends HTMLElement$1 {
121309
121887
  this.ezOpenItem = createEvent(this, "ezOpenItem", 7);
121310
121888
  this._tree = new Tree(() => forceUpdate(this));
121311
121889
  this._onItemClick = (item) => {
121890
+ this.value = item;
121891
+ };
121892
+ this._onIconClick = (item) => {
121312
121893
  this.openClose(item);
121313
121894
  this.value = item;
121314
121895
  };
@@ -121320,6 +121901,10 @@ let EzTree$1 = class extends HTMLElement$1 {
121320
121901
  * Define uma função que vai resolver o ícone daquele item. Retorna o nome do ícone da lib de icones do DS.
121321
121902
  */
121322
121903
  this.iconResolver = defaultIconResolver;
121904
+ /**
121905
+ * Define uma função que vai resolver o `tooltip` ou `title` daquele item.
121906
+ */
121907
+ this.tooltipResolver = defaultTooltipResolver;
121323
121908
  }
121324
121909
  /**
121325
121910
  * Efetua a seleção de um item.
@@ -121379,7 +121964,9 @@ let EzTree$1 = class extends HTMLElement$1 {
121379
121964
  this._tree.load(this.items);
121380
121965
  }
121381
121966
  observeValue() {
121967
+ var _a;
121382
121968
  this.ezChange.emit(this.value);
121969
+ this.selectedId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
121383
121970
  }
121384
121971
  onKeyDownListener(event) {
121385
121972
  if (!this.value) {
@@ -121422,7 +122009,7 @@ let EzTree$1 = class extends HTMLElement$1 {
121422
122009
  if (expanded) {
121423
122010
  this.ezOpenItem.emit(item);
121424
122011
  }
121425
- forceUpdate(this);
122012
+ this._tree.updateItem(item);
121426
122013
  }
121427
122014
  previousLevel() {
121428
122015
  var _a;
@@ -121431,7 +122018,7 @@ let EzTree$1 = class extends HTMLElement$1 {
121431
122018
  }
121432
122019
  if (this.value.expanded) {
121433
122020
  this.value.expanded = false;
121434
- forceUpdate(this);
122021
+ this._tree.updateItem(this.value);
121435
122022
  }
121436
122023
  else {
121437
122024
  const node = this._tree.getNode(this.value.id);
@@ -121454,19 +122041,50 @@ let EzTree$1 = class extends HTMLElement$1 {
121454
122041
  }
121455
122042
  else {
121456
122043
  this.value.expanded = true;
121457
- forceUpdate(this);
122044
+ this._tree.updateItem(this.value);
121458
122045
  }
121459
122046
  }
121460
- nextItem() {
121461
- const nextIndex = this._visibleItems.indexOf(this.value) + 1;
121462
- if (nextIndex < this._visibleItems.length) {
122047
+ indexOf(id) {
122048
+ if (id == undefined) {
122049
+ return -1;
122050
+ }
122051
+ for (let i = 0; i < this._visibleItems.length; i++) {
122052
+ const item = this._visibleItems[i];
122053
+ if (item.id === id) {
122054
+ return i;
122055
+ }
122056
+ }
122057
+ return -1;
122058
+ }
122059
+ selectNextItem(indexIncrement) {
122060
+ var _a;
122061
+ const nextIndex = this.indexOf((_a = this.value) === null || _a === void 0 ? void 0 : _a.id) + indexIncrement;
122062
+ if (nextIndex > -1 && nextIndex < this._visibleItems.length) {
121463
122063
  this.value = this._visibleItems[nextIndex];
121464
122064
  }
121465
122065
  }
122066
+ nextItem() {
122067
+ this.selectNextItem(1);
122068
+ }
121466
122069
  previousItem() {
121467
- const nextIndex = this._visibleItems.indexOf(this.value) - 1;
121468
- if (nextIndex > -1) {
121469
- this.value = this._visibleItems[nextIndex];
122070
+ this.selectNextItem(-1);
122071
+ }
122072
+ connectedCallback() {
122073
+ if (this.items) {
122074
+ this._tree.load(this.items);
122075
+ }
122076
+ }
122077
+ componentWillRender() {
122078
+ var _a;
122079
+ if (!this.selectedId || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.id) === this.selectedId) {
122080
+ return;
122081
+ }
122082
+ const node = this._tree.getNode(this.selectedId);
122083
+ if (node) {
122084
+ this.value = node.item;
122085
+ }
122086
+ else {
122087
+ this.selectedId = undefined;
121470
122088
  }
121471
122089
  }
121472
122090
  render() {
@@ -121480,7 +122098,7 @@ let EzTree$1 = class extends HTMLElement$1 {
121480
122098
  :
121481
122099
  this._tree.getChildren().map(node => {
121482
122100
  var _a;
121483
- return h(TreeItem, { selectedId: (_a = this.value) === null || _a === void 0 ? void 0 : _a.id, node: node, itemClick: this._onItemClick, iconResolver: this.iconResolver, itemsList: this._visibleItems });
122101
+ return h(TreeItem, { selectedId: (_a = this.value) === null || _a === void 0 ? void 0 : _a.id, node: node, itemClick: this._onItemClick, iconClick: this._onIconClick, iconResolver: this.iconResolver, tooltipResolver: this.tooltipResolver, itemsList: this._visibleItems });
121484
122102
  })));
121485
122103
  }
121486
122104
  get _element() { return this; }
@@ -121962,9 +122580,11 @@ const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [1,"ez-combo-bo
121962
122580
  const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513]}]);
121963
122581
  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]}]);
121964
122582
  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"]}]);
122583
+ const EzDropdown = /*@__PURE__*/proxyCustomElement(EzDropdown$1, [1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]}]);
121965
122584
  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]}]);
121966
122585
  const EzFilterInput = /*@__PURE__*/proxyCustomElement(EzFilterInput$1, [1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513]}]);
121967
- const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16]}]);
122586
+ 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]}]);
121968
122588
  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"]]]);
121969
122589
  const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]);
121970
122590
  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]}]);
@@ -121984,7 +122604,7 @@ const EzTextEdit = /*@__PURE__*/proxyCustomElement(EzTextEdit$1, [1,"ez-text-edi
121984
122604
  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"]}]);
121985
122605
  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]}]);
121986
122606
  const EzToast = /*@__PURE__*/proxyCustomElement(EzToast$1, [1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"]}]);
121987
- const EzTree = /*@__PURE__*/proxyCustomElement(EzTree$1, [1,"ez-tree",{"items":[16],"value":[1040],"iconResolver":[16],"_waintingForLoad":[32]},[[2,"keydown","onKeyDownListener"]]]);
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"]]]);
121988
122608
  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]}]);
121989
122609
  const EzViewStack = /*@__PURE__*/proxyCustomElement(EzViewStack$1, [0,"ez-view-stack"]);
121990
122610
  const defineCustomElements = (opts) => {
@@ -122004,9 +122624,11 @@ const defineCustomElements = (opts) => {
122004
122624
  EzDateInput,
122005
122625
  EzDateTimeInput,
122006
122626
  EzDialog,
122627
+ EzDropdown,
122007
122628
  EzFileItem,
122008
122629
  EzFilterInput,
122009
122630
  EzForm,
122631
+ EzFormView,
122010
122632
  EzGrid,
122011
122633
  EzIcon,
122012
122634
  EzList,
@@ -122037,4 +122659,4 @@ const defineCustomElements = (opts) => {
122037
122659
  }
122038
122660
  };
122039
122661
 
122040
- export { EzActionsButton, EzAlert, EzApplication, EzBreadcrumb, EzButton, EzCalendar, EzCardItem, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzFileItem, EzFilterInput, EzForm, EzGrid, EzIcon, EzList, EzLoadingBar, EzModal, EzModalContainer, EzNumberInput, EzPopover, EzPopup, EzRadioButton, EzScroller, EzSearch, EzSidebarButton, EzTabselector, EzTextArea, EzTextEdit, EzTextInput, EzTimeInput, EzToast, EzTree, EzUpload, EzViewStack, defineCustomElements };
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 };