@sankhyalabs/sankhyablocks 1.1.24 → 1.1.28

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 (184) hide show
  1. package/dist/cjs/ApplicationUtils-05b74ee9.js +39 -0
  2. package/dist/cjs/AssetsUtils-7e3c38f9.js +24 -0
  3. package/dist/cjs/CSSVarsUtils-75ca9c64.js +19 -0
  4. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  5. package/dist/cjs/ez-action-chip.cjs.entry.js +27 -0
  6. package/dist/cjs/ez-application.cjs.entry.js +26 -0
  7. package/dist/cjs/ez-button_4.cjs.entry.js +660 -0
  8. package/dist/cjs/ez-calendar.cjs.entry.js +223 -0
  9. package/dist/cjs/ez-collapsible-box.cjs.entry.js +47 -0
  10. package/dist/cjs/ez-combo-box.cjs.entry.js +278 -0
  11. package/dist/cjs/ez-date-input.cjs.entry.js +102 -0
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +145 -0
  13. package/dist/cjs/ez-dialog.cjs.entry.js +89 -0
  14. package/dist/cjs/ez-form.cjs.entry.js +785 -0
  15. package/dist/cjs/ez-grid.cjs.entry.js +110485 -0
  16. package/dist/cjs/ez-icon.cjs.entry.js +41 -0
  17. package/dist/cjs/ez-label-chip.cjs.entry.js +104 -0
  18. package/dist/cjs/ez-modal_2.cjs.entry.js +316 -0
  19. package/dist/cjs/ez-number-input.cjs.entry.js +86 -0
  20. package/dist/cjs/ez-popover.cjs.entry.js +120 -0
  21. package/dist/cjs/ez-popup.cjs.entry.js +48 -0
  22. package/dist/cjs/ez-search.cjs.entry.js +64 -0
  23. package/dist/cjs/ez-tabselector.cjs.entry.js +198 -0
  24. package/dist/cjs/ez-text-area.cjs.entry.js +114 -0
  25. package/dist/cjs/ez-text-input.cjs.entry.js +201 -0
  26. package/dist/cjs/ez-time-input.cjs.entry.js +118 -0
  27. package/dist/cjs/ez-toast.cjs.entry.js +44 -0
  28. package/dist/cjs/ez-upload.cjs.entry.js +356 -0
  29. package/dist/cjs/index-682c98b2.js +1771 -0
  30. package/dist/cjs/loader.cjs.js +2 -2
  31. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  32. package/dist/cjs/snk-application.cjs.entry.js +49 -99
  33. package/dist/cjs/test-du.cjs.entry.js +76 -0
  34. package/dist/collection/collection-manifest.json +36 -1
  35. package/dist/collection/components/snk-application/snk-application.js +1 -3
  36. package/dist/{collection/temp → components}/ApplicationUtils.js +37 -36
  37. package/dist/components/AssetsUtils.js +22 -0
  38. package/dist/components/CSSVarsUtils.js +17 -0
  39. package/dist/components/_commonjsHelpers.js +17 -0
  40. package/dist/components/ez-action-chip.js +44 -0
  41. package/dist/components/ez-application.js +39 -0
  42. package/dist/components/ez-button.js +6 -0
  43. package/dist/components/ez-button2.js +105 -0
  44. package/dist/components/ez-calendar.js +6 -0
  45. package/dist/components/ez-calendar2.js +242 -0
  46. package/dist/components/ez-check.js +6 -0
  47. package/dist/components/ez-check2.js +94 -0
  48. package/dist/components/ez-collapsible-box.js +67 -0
  49. package/dist/components/ez-combo-box.js +6 -0
  50. package/dist/components/ez-combo-box2.js +311 -0
  51. package/dist/components/ez-date-input.js +135 -0
  52. package/dist/components/ez-date-time-input.js +179 -0
  53. package/dist/components/ez-dialog.js +124 -0
  54. package/dist/components/ez-form.js +6 -0
  55. package/dist/components/ez-form2.js +807 -0
  56. package/dist/components/ez-grid.js +110576 -0
  57. package/dist/components/ez-icon.js +6 -0
  58. package/dist/components/ez-icon2.js +56 -0
  59. package/dist/components/ez-label-chip.js +125 -0
  60. package/dist/components/ez-list.js +6 -0
  61. package/dist/components/ez-list2.js +523 -0
  62. package/dist/components/ez-modal.js +6 -0
  63. package/dist/components/ez-modal2.js +82 -0
  64. package/dist/components/ez-number-input.js +115 -0
  65. package/dist/components/ez-popover.js +145 -0
  66. package/dist/components/ez-popup.js +67 -0
  67. package/dist/components/ez-search.js +100 -0
  68. package/dist/components/ez-tabselector.js +6 -0
  69. package/dist/components/ez-tabselector2.js +213 -0
  70. package/dist/components/ez-text-area.js +137 -0
  71. package/dist/components/ez-text-input.js +6 -0
  72. package/dist/components/ez-text-input2.js +223 -0
  73. package/dist/components/ez-time-input.js +153 -0
  74. package/dist/components/ez-toast.js +64 -0
  75. package/dist/components/ez-upload.js +382 -0
  76. package/dist/components/grid-config.js +6 -0
  77. package/dist/components/grid-config2.js +318 -0
  78. package/dist/components/select-box.js +6 -0
  79. package/dist/components/select-box2.js +47 -0
  80. package/dist/components/snk-application.js +2 -52
  81. package/dist/components/test-du.js +101 -0
  82. package/dist/esm/ApplicationUtils-e0b6d857.js +37 -0
  83. package/dist/esm/AssetsUtils-6e6624dc.js +22 -0
  84. package/dist/esm/CSSVarsUtils-0787c3f3.js +17 -0
  85. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  86. package/dist/esm/ez-action-chip.entry.js +23 -0
  87. package/dist/esm/ez-application.entry.js +22 -0
  88. package/dist/esm/ez-button_4.entry.js +653 -0
  89. package/dist/esm/ez-calendar.entry.js +219 -0
  90. package/dist/esm/ez-collapsible-box.entry.js +43 -0
  91. package/dist/esm/ez-combo-box.entry.js +274 -0
  92. package/dist/esm/ez-date-input.entry.js +98 -0
  93. package/dist/esm/ez-date-time-input.entry.js +141 -0
  94. package/dist/esm/ez-dialog.entry.js +85 -0
  95. package/dist/esm/ez-form.entry.js +781 -0
  96. package/dist/esm/ez-grid.entry.js +110481 -0
  97. package/dist/esm/ez-icon.entry.js +37 -0
  98. package/dist/esm/ez-label-chip.entry.js +100 -0
  99. package/dist/esm/ez-modal_2.entry.js +311 -0
  100. package/dist/esm/ez-number-input.entry.js +82 -0
  101. package/dist/esm/ez-popover.entry.js +116 -0
  102. package/dist/esm/ez-popup.entry.js +44 -0
  103. package/dist/esm/ez-search.entry.js +60 -0
  104. package/dist/esm/ez-tabselector.entry.js +194 -0
  105. package/dist/esm/ez-text-area.entry.js +110 -0
  106. package/dist/esm/ez-text-input.entry.js +197 -0
  107. package/dist/esm/ez-time-input.entry.js +114 -0
  108. package/dist/esm/ez-toast.entry.js +40 -0
  109. package/dist/esm/ez-upload.entry.js +352 -0
  110. package/dist/esm/index-35088a3f.js +1740 -0
  111. package/dist/esm/loader.js +2 -2
  112. package/dist/esm/sankhyablocks.js +2 -2
  113. package/dist/esm/snk-application.entry.js +3 -53
  114. package/dist/esm/test-du.entry.js +72 -0
  115. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +67 -0
  116. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +3 -0
  117. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +180 -0
  118. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +319 -0
  119. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +327 -0
  120. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +162 -0
  121. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +217 -0
  122. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +49 -0
  123. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +44 -0
  124. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +527 -0
  125. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +5 -0
  126. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +31 -0
  127. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +129 -0
  128. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -0
  129. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +176 -0
  130. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +139 -0
  131. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +335 -0
  132. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +358 -0
  133. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +4 -0
  134. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +44 -0
  135. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +405 -0
  136. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +3 -0
  137. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +138 -0
  138. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +165 -0
  139. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +196 -0
  140. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +10 -0
  141. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +127 -0
  142. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +568 -0
  143. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +3 -0
  144. package/dist/sankhyablocks/p-0183d259.entry.js +1 -0
  145. package/dist/sankhyablocks/p-01f23a70.entry.js +1 -0
  146. package/dist/sankhyablocks/p-07c32f68.entry.js +1 -0
  147. package/dist/sankhyablocks/p-0f90499d.entry.js +1 -0
  148. package/dist/sankhyablocks/p-105724a3.entry.js +1 -0
  149. package/dist/sankhyablocks/p-112455b1.js +1 -0
  150. package/dist/sankhyablocks/p-2ac02d48.entry.js +1 -0
  151. package/dist/sankhyablocks/p-35364a97.entry.js +1 -0
  152. package/dist/sankhyablocks/p-3f6aa9a7.entry.js +1 -0
  153. package/dist/sankhyablocks/p-4811bc0a.entry.js +369 -0
  154. package/dist/sankhyablocks/p-5f9af495.entry.js +1 -0
  155. package/dist/sankhyablocks/p-60967cf0.js +1 -0
  156. package/dist/sankhyablocks/p-70ad6c16.entry.js +1 -0
  157. package/dist/sankhyablocks/p-710bfffe.entry.js +1 -0
  158. package/dist/sankhyablocks/p-73397a0f.entry.js +57 -0
  159. package/dist/sankhyablocks/p-811b4b9d.js +1 -0
  160. package/dist/sankhyablocks/p-813fe4f7.js +1 -0
  161. package/dist/sankhyablocks/p-85a9446b.js +2 -0
  162. package/dist/sankhyablocks/p-89a1100f.entry.js +1 -0
  163. package/dist/sankhyablocks/p-8b543003.entry.js +1 -0
  164. package/dist/sankhyablocks/p-9750632b.entry.js +1 -0
  165. package/dist/sankhyablocks/p-a96272f7.entry.js +1 -0
  166. package/dist/sankhyablocks/p-ac8842e5.entry.js +1 -0
  167. package/dist/sankhyablocks/p-ba64cc41.entry.js +1 -0
  168. package/dist/sankhyablocks/p-c1ede043.entry.js +1 -0
  169. package/dist/sankhyablocks/p-d90ebb85.entry.js +1 -0
  170. package/dist/sankhyablocks/p-e5355a29.entry.js +1 -0
  171. package/dist/sankhyablocks/p-ef04b633.entry.js +1 -0
  172. package/dist/sankhyablocks/p-f6db07fb.entry.js +1 -0
  173. package/dist/sankhyablocks/p-f80cabc7.entry.js +1 -0
  174. package/dist/sankhyablocks/p-fcd9bd92.entry.js +1 -0
  175. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  176. package/package.json +7 -4
  177. package/react/components.d.ts +29 -0
  178. package/react/components.js +29 -0
  179. package/react/components.js.map +1 -1
  180. package/dist/cjs/index-4720dab8.js +0 -735
  181. package/dist/esm/index-72d4e2e0.js +0 -709
  182. package/dist/sankhyablocks/p-45635e4f.entry.js +0 -57
  183. package/dist/sankhyablocks/p-a33afc3b.js +0 -2
  184. package/dist/types/temp/ApplicationUtils.d.ts +0 -11
@@ -0,0 +1,653 @@
1
+ import { r as registerInstance, h, c as createEvent, H as Host } from './index-35088a3f.js';
2
+
3
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
4
+
5
+ const EzButton = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ /**
9
+ * Deixa o botão disponível ou não para interação com o usuário.
10
+ */
11
+ this.enabled = true;
12
+ /**
13
+ * Define o modo de uso do botão; opções: icon, link e regular
14
+ */
15
+ this.mode = "regular";
16
+ /**
17
+ * É possível escolher entre [small,medium,large] (somente para os modos "icon" e "link")
18
+ */
19
+ this.size = "medium";
20
+ }
21
+ /**
22
+ * Realiza o foco no botão
23
+ */
24
+ async setFocus() {
25
+ this._button.focus();
26
+ }
27
+ /**
28
+ * Remove o foco no botão
29
+ */
30
+ async setBlur() {
31
+ this._button.blur();
32
+ }
33
+ getIconSize() {
34
+ return this.size;
35
+ }
36
+ handleSlotChange(ev) {
37
+ const slot = ev.target;
38
+ const content = slot.assignedElements()[0];
39
+ if (this.mode == "link") {
40
+ content.style.display = "inline";
41
+ if (slot.name == "leftIcon") {
42
+ content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
43
+ }
44
+ else if (slot.name == "rightIcon") {
45
+ content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
46
+ }
47
+ }
48
+ else {
49
+ content.style.setProperty('--ez-icon--color', 'var(--ez-icon--color)');
50
+ }
51
+ }
52
+ render() {
53
+ if (this.mode == "icon") {
54
+ return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
55
+ if (!this.enabled)
56
+ evt.stopPropagation();
57
+ } })));
58
+ }
59
+ else if (this.mode == "label-icon") {
60
+ return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
61
+ if (!this.enabled)
62
+ evt.stopPropagation();
63
+ } })), h("label", { title: this.label }, this.label)));
64
+ }
65
+ else if (this.mode == "link") {
66
+ return (h("a", { class: this.size, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
67
+ }
68
+ else {
69
+ return (h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
70
+ }
71
+ }
72
+ };
73
+ EzButton.style = ezButtonCss;
74
+
75
+ const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--text--secondary, #a2abb9);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(-2px) translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
76
+
77
+ const EzCheck = class {
78
+ constructor(hostRef) {
79
+ registerInstance(this, hostRef);
80
+ this.ezChange = createEvent(this, "ezChange", 7);
81
+ /**
82
+ * Deixa o campo disponível ou não para interação com o usuário.
83
+ */
84
+ this.enabled = true;
85
+ /**
86
+ * Existem dois modos de visualização: regular e switch.
87
+ * Se esta propriedade for omitida, o componete assume o formato "regular".
88
+ * No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
89
+ * No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
90
+ */
91
+ this.mode = "regular";
92
+ }
93
+ adjustMode() {
94
+ if (this.mode === "switch") {
95
+ this._inputElem.classList.remove("regularMode");
96
+ this._inputElem.classList.add("switchMode");
97
+ }
98
+ else {
99
+ this._inputElem.classList.remove("switchMode");
100
+ this._inputElem.classList.add("regularMode");
101
+ }
102
+ }
103
+ //---------------------------------------------
104
+ // Public methods
105
+ //---------------------------------------------
106
+ /**
107
+ * Devolve o modo escolhido para o componente
108
+ */
109
+ async getMode() {
110
+ return this.mode;
111
+ }
112
+ /**
113
+ * Faz o foco no componente de input
114
+ */
115
+ async setFocus() {
116
+ this._inputElem.focus();
117
+ }
118
+ componentDidLoad() {
119
+ this.adjustMode();
120
+ }
121
+ changeValue() {
122
+ if (!this.enabled) {
123
+ return;
124
+ }
125
+ this.value = !this.value;
126
+ this.ezChange.emit(this.value);
127
+ }
128
+ getLabelClasses() {
129
+ let classes = "label";
130
+ if (!this.enabled) {
131
+ classes += " label--disabled";
132
+ }
133
+ return classes;
134
+ }
135
+ render() {
136
+ return (h(Host, null, h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
137
+ }
138
+ static get watchers() { return {
139
+ "mode": ["adjustMode"]
140
+ }; }
141
+ };
142
+ EzCheck.style = ezCheckCss;
143
+
144
+ const ezListCss = ":host{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon__padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item__margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-color:var(--title--primary, #2b3a54);--ez-list__item--font-family:var(--font-pattern, \"Sora\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item__border-radius:var(--border--radius-small, 6px);--ez-list__selected-item__background:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Sora\");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group__overlay--font-family:var(--font-pattern, \"Sora\");--ez-list__group__overlay--font-size:var(--text--medium, 14px);--ez-list__group-container__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__group-container__scrollbar--width:var(--space--medium, 12px);--ez-list__group-container__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__draggable__list--padding-bottom:var(--space--small, 6px);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__draggable__scrollbar--width:var(--space--medium, 12px);--ez-list__draggable__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__draggable__icon--image:url('data:image/svg+xml;utf8,<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z\"/></svg>');max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}p{margin:0}.draggable{display:flex;align-items:center;border-top:1px dashed #fff;justify-content:space-between;background-color:#fff;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);flex:1}.dragging{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container{margin:0px !important}.item-content{display:flex;justify-content:center;align-items:center}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%}.draggable-list li{background-color:#fff;display:flex;margin:var(--ez-list__item__margin);font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);height:32px}.over{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space{height:var(--ez-list__last-droppable-space--height)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:#f0f2f5}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.draggable-list::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--ez-list__icon--color);width:18px;height:18px;-webkit-mask-image:var(--ez-list__draggable__icon--image);mask-image:var(--ez-list__draggable__icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-container{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%}.group-name{font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom);-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.group{display:flex;flex-direction:column}.group-container::-webkit-scrollbar-track{background-color:#f0f2f5}.group-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__group-container__scrollbar--background-color);border-radius:var(--ez-list__group-container__scrollbar--border-radius)}.group-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__group-container__scrollbar--width);max-width:var(--ez-list__group-container__scrollbar--width);min-width:var(--ez-list__group-container__scrollbar--width)}.section-container{display:flex;position:relative;height:100%}.items-container{width:100%;max-height:100%;overflow-y:auto;outline:none}.group-items-container{width:100%;max-height:100%;height:100%;outline:none}.items-container::-webkit-scrollbar-track{background-color:#f0f2f5}.items-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.items-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.group-overlay{font-family:var(--ez-list__group__overlay--font-family);font-size:var(--ez-list__group__overlay--font-size);background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer}.presetedHeight{min-height:100px}.overlay-text{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item{background:var(--ez-list__selected-item__background);border-radius:var(--ez-list__selected-item__border-radius)}.slot-item{align-items:flex-end}.overGroup{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
145
+
146
+ const EzList = class {
147
+ constructor(hostRef) {
148
+ registerInstance(this, hostRef);
149
+ this.ezChange = createEvent(this, "ezChange", 7);
150
+ this._listItems = [];
151
+ this._listGroupItems = [];
152
+ this._listItemsHistory = [];
153
+ /**
154
+ * Define a lista inicial do componente.
155
+ */
156
+ this.dataSource = [];
157
+ /**
158
+ * Define se o componente renderizará os itens separados em grupos..
159
+ */
160
+ this.useGroups = false;
161
+ /**
162
+ * Define se o componente terá o comportamento de arrasto de linhas.
163
+ */
164
+ this.ezDraggable = false;
165
+ /**
166
+ * Define se os items da lista serão selecionáveis.
167
+ */
168
+ this.ezSelectable = false;
169
+ }
170
+ createList() {
171
+ if (this.useGroups) {
172
+ let list = [...this.dataSource];
173
+ list.forEach(itemGroup => {
174
+ this.sortGroup(itemGroup);
175
+ });
176
+ this._listGroupItems = list;
177
+ }
178
+ else {
179
+ this._listItems = this._listItemsHistory.length > 0 ? this._listItemsHistory : [...this.dataSource];
180
+ }
181
+ }
182
+ sortGroup(itemGroup) {
183
+ if (itemGroup.sort) {
184
+ itemGroup.items.sort(function (a, b) {
185
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
186
+ });
187
+ if (itemGroup.sort === "DSC") {
188
+ itemGroup.items.reverse();
189
+ }
190
+ }
191
+ }
192
+ /**
193
+ * Recebe como argumento um ListItem {label: string} e um booleano que define se o componente deve fazer scroll para exibir o item específico (opcional).
194
+ */
195
+ async setSelection(selectedItem, scrollToOption) {
196
+ if (selectedItem && this.ezSelectable) {
197
+ if (this.useGroups) {
198
+ let newList = [...this._listGroupItems];
199
+ newList.forEach(groupItem => {
200
+ groupItem.items.forEach(item => {
201
+ if (item.label == selectedItem.label) {
202
+ item.selected = true;
203
+ }
204
+ else {
205
+ item.selected = false;
206
+ }
207
+ });
208
+ });
209
+ this._listGroupItems = newList;
210
+ }
211
+ else {
212
+ let newList = [...this._listItems];
213
+ newList.forEach(item => {
214
+ if (item.label === selectedItem.label) {
215
+ item.selected = true;
216
+ }
217
+ else {
218
+ item.selected = false;
219
+ }
220
+ });
221
+ this._listItems = newList;
222
+ }
223
+ if (scrollToOption) {
224
+ let liElem = this.useGroups ?
225
+ this._groupContainer.querySelector('li#item_' + this.getItemId(selectedItem.label))
226
+ : this._itemContainer.querySelector('li#item_' + this.getItemId(selectedItem.label));
227
+ if (liElem) {
228
+ liElem.scrollIntoView();
229
+ }
230
+ }
231
+ }
232
+ else {
233
+ this.removeSelection();
234
+ }
235
+ }
236
+ removeSelection() {
237
+ if (this.useGroups) {
238
+ let newList = [...this._listGroupItems];
239
+ newList.forEach(groupItem => {
240
+ groupItem.items.forEach(item => {
241
+ item.selected = false;
242
+ });
243
+ });
244
+ this._listGroupItems = newList;
245
+ }
246
+ else {
247
+ let newList = [...this._listItems];
248
+ newList.forEach(item => {
249
+ item.selected = false;
250
+ });
251
+ this._listItems = newList;
252
+ }
253
+ }
254
+ /**
255
+ * Retorna o item selecionado.
256
+ */
257
+ async getSelection() {
258
+ let selectedItem;
259
+ if (this.useGroups) {
260
+ this._listGroupItems.every(group => {
261
+ let item = group.items.find((item) => item.selected == true);
262
+ if (item) {
263
+ selectedItem = item;
264
+ return false;
265
+ }
266
+ return true;
267
+ });
268
+ }
269
+ else {
270
+ selectedItem = this._listItems.find((item) => item.selected == true);
271
+ }
272
+ return selectedItem;
273
+ }
274
+ /**
275
+ * Retorna a lista de items conforme o modo de uso.
276
+ */
277
+ async getList() {
278
+ if (this.useGroups) {
279
+ return this._listGroupItems;
280
+ }
281
+ return this._listItems;
282
+ }
283
+ componentWillLoad() {
284
+ this._listItemsHistory = [];
285
+ }
286
+ componentWillRender() {
287
+ this.createList();
288
+ }
289
+ onDrop(ev, dragEndItem) {
290
+ this.removeOverClass();
291
+ this.setSelection(undefined);
292
+ if (this._dragStartItem) {
293
+ if (this.useGroups) {
294
+ let newList = [...this._listGroupItems];
295
+ let groupEnd = this._listGroupItems.find(group => dragEndItem.groupName == group.group);
296
+ //Remove item arrastado
297
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
298
+ //Adiciona item arrastado
299
+ if (groupEnd.sort) {
300
+ newList.find(group => group.group == dragEndItem.groupName).items.push(this._dragStartItem.item);
301
+ newList.find(group => group.group == dragEndItem.groupName).items.sort(function (a, b) {
302
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
303
+ });
304
+ if (groupEnd.sort === "DSC") {
305
+ newList.find(group => group.group == dragEndItem.groupName).items.reverse();
306
+ }
307
+ }
308
+ else {
309
+ let indexForAdd = (dragEndItem.index > this._dragStartItem.index) ? dragEndItem.index - 1 : dragEndItem.index;
310
+ newList.find(group => group.group == dragEndItem.groupName).items.splice(indexForAdd, 0, this._dragStartItem.item);
311
+ }
312
+ this._listGroupItems = newList;
313
+ this.ezChange.emit(this._listGroupItems);
314
+ }
315
+ else {
316
+ let newList = [...this._listItems];
317
+ newList.splice(this._dragStartItem.index, 1);
318
+ newList.splice(dragEndItem.index, 0, this._dragStartItem.item);
319
+ this._listItems = newList;
320
+ this._listItemsHistory = newList;
321
+ this.ezChange.emit(this._listItems);
322
+ }
323
+ }
324
+ ev.stopPropagation();
325
+ }
326
+ onDropLastIndex(ev, groupDropped) {
327
+ this.removeOverClass();
328
+ this.setSelection(undefined);
329
+ if (this._dragStartItem) {
330
+ if (this.useGroups) {
331
+ let newList = [...this._listGroupItems];
332
+ let groupEnd = this._listGroupItems.find(group => groupDropped.group == group.group);
333
+ //Remove item arrastado
334
+ newList.find(group => group.group == this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
335
+ //Adiciona item arrastado
336
+ newList.find(group => group.group == groupDropped.group).items.push(this._dragStartItem.item);
337
+ if (groupEnd.sort) {
338
+ newList.find(group => group.group == groupDropped.group).items.sort(function (a, b) {
339
+ return a.label < b.label ? -1 : a.label > b.label ? 1 : 0;
340
+ });
341
+ if (groupEnd.sort === "DSC") {
342
+ newList.find(group => group.group == groupDropped.group).items.reverse();
343
+ }
344
+ }
345
+ this._listGroupItems = newList;
346
+ this.ezChange.emit(this._listGroupItems);
347
+ }
348
+ else {
349
+ let newList = [...this._listItems];
350
+ newList.splice(this._dragStartItem.index, 1);
351
+ newList.push(this._dragStartItem.item);
352
+ this._listItems = newList;
353
+ this._listItemsHistory = newList;
354
+ this.ezChange.emit(this._listItems);
355
+ }
356
+ }
357
+ ev.stopPropagation();
358
+ }
359
+ onDropGroup(groupSelected) {
360
+ var _a;
361
+ let newList = [...this._listGroupItems];
362
+ this.setSelection(undefined);
363
+ let newGroup = newList.find(group => group.group === groupSelected.group);
364
+ if (newGroup) {
365
+ if (((_a = newGroup.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
366
+ let newItem;
367
+ newGroup.items.forEach((item, index) => {
368
+ if (item.label === this._dragStartItem.item.label) {
369
+ newItem = { item: item, index: index };
370
+ }
371
+ });
372
+ if (newItem) {
373
+ newGroup.items.splice(newItem.index, 1);
374
+ newGroup.items.unshift(newItem.item);
375
+ this.sortGroup(newGroup);
376
+ }
377
+ else {
378
+ newGroup.items.unshift(this._dragStartItem.item);
379
+ this.sortGroup(newGroup);
380
+ newList.find(group => group.group === this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
381
+ }
382
+ }
383
+ else {
384
+ newList.find(group => group.group === this._dragStartItem.groupName).items.splice(this._dragStartItem.index, 1);
385
+ newGroup.items = [this._dragStartItem.item];
386
+ }
387
+ this._listGroupItems = newList;
388
+ }
389
+ }
390
+ onDragEnd() {
391
+ this._dragStartItem = undefined;
392
+ if (this.useGroups) {
393
+ this.hideOverlays();
394
+ }
395
+ if (this._draggingElement) {
396
+ try {
397
+ this._element.shadowRoot.removeChild(this._draggingElement);
398
+ }
399
+ catch (err) { }
400
+ this._draggingElement = undefined;
401
+ }
402
+ }
403
+ addOverClass(element) {
404
+ if ((element === null || element === void 0 ? void 0 : element.__proto__) == HTMLDivElement.prototype && element.classList.contains("draggable")) {
405
+ element.classList.add('over');
406
+ }
407
+ else if ((element === null || element === void 0 ? void 0 : element.parentElement) && !element.parentElement.classList.contains("draggable-list")) {
408
+ this.addOverClass(element.parentElement);
409
+ }
410
+ }
411
+ addOverGroupClass(ev, group) {
412
+ if (ev.target) {
413
+ let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
414
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
415
+ if (group.items.length > 0) {
416
+ groupOverlay.setAttribute("style", "display:grid");
417
+ }
418
+ else {
419
+ groupOverlay.classList.add("presetedHeight");
420
+ groupOverlay.setAttribute("style", "display:grid");
421
+ groupOverlay.scrollIntoView(false);
422
+ }
423
+ }
424
+ }
425
+ removeOverClass() {
426
+ var _a, _b;
427
+ let overCollection;
428
+ let overLastDroppableCollection;
429
+ if (this.useGroups) {
430
+ overCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName('over');
431
+ overLastDroppableCollection = this._groupContainer.getElementsByClassName('last-droppable-space');
432
+ }
433
+ else {
434
+ overCollection = (_b = this._itemContainer) === null || _b === void 0 ? void 0 : _b.getElementsByClassName('over');
435
+ overLastDroppableCollection = this._itemContainer.getElementsByClassName('last-droppable-space');
436
+ }
437
+ if (overCollection) {
438
+ Array.from(overCollection).forEach(function (element) {
439
+ element.classList.remove('over');
440
+ });
441
+ }
442
+ if (overLastDroppableCollection) {
443
+ Array.from(overLastDroppableCollection).forEach(function (element) {
444
+ element.classList.remove('over');
445
+ });
446
+ }
447
+ }
448
+ removeOverGroupClass(ev, group) {
449
+ if (ev.target) {
450
+ let groupContainer = this._groupContainer.querySelector("div#" + this.getDivGroupId(group.group));
451
+ let groupOverlay = groupContainer.getElementsByClassName("group-overlay")[0];
452
+ if (groupOverlay) {
453
+ groupOverlay.classList.remove("presetedHeight");
454
+ groupOverlay.setAttribute("style", "display:none");
455
+ }
456
+ }
457
+ }
458
+ onDragStart(item, group, index) {
459
+ if (this._changeDeboucingTimeout) {
460
+ window.clearTimeout(this._changeDeboucingTimeout);
461
+ }
462
+ if (this.useGroups) {
463
+ this._dragStartItem = { groupName: group.group, item: item, index: index };
464
+ this._changeDeboucingTimeout = window.setTimeout(() => {
465
+ this.showOverlays(group);
466
+ }, 10);
467
+ }
468
+ else {
469
+ this._dragStartItem = { item: item.item, index: item.index };
470
+ }
471
+ }
472
+ selectFirstItem() {
473
+ if (this.useGroups) {
474
+ this.setSelection(this._listGroupItems[0].items[0]);
475
+ }
476
+ {
477
+ this.setSelection(this._listItems[0]);
478
+ }
479
+ }
480
+ nextOption(selectedItem) {
481
+ let nextItem = undefined;
482
+ if (this.useGroups) {
483
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
484
+ let item = undefined;
485
+ let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
486
+ if (itemIndex != undefined && itemIndex != -1) {
487
+ if (itemIndex === group.items.length - 1) {
488
+ if (groupIndex + 1 <= listGroupItems.length - 1) {
489
+ item = { label: listGroupItems[groupIndex + 1].items[0].label };
490
+ }
491
+ }
492
+ else {
493
+ item = { label: group.items[itemIndex + 1].label };
494
+ }
495
+ }
496
+ if (item != undefined) {
497
+ nextItem = item;
498
+ return false;
499
+ }
500
+ return true;
501
+ });
502
+ }
503
+ else {
504
+ let itemIndex = this._listItems.findIndex(item => item.label === selectedItem.label);
505
+ if (itemIndex >= 0 && itemIndex < this._listItems.length) {
506
+ nextItem = this._listItems[itemIndex + 1];
507
+ }
508
+ }
509
+ this.setSelection(nextItem, true);
510
+ }
511
+ previousOption(selectedItem) {
512
+ let previousItem = undefined;
513
+ if (this.useGroups) {
514
+ this._listGroupItems.every((group, groupIndex, listGroupItems) => {
515
+ let item = undefined;
516
+ let itemIndex = group.items.findIndex(item => item.label == selectedItem.label);
517
+ if (itemIndex != undefined && itemIndex != -1) {
518
+ if (itemIndex === 0) {
519
+ if ((groupIndex - 1 >= 0)) {
520
+ item = { label: listGroupItems[groupIndex - 1].items[listGroupItems[groupIndex - 1].items.length - 1].label };
521
+ }
522
+ }
523
+ else {
524
+ item = { label: group.items[itemIndex - 1].label };
525
+ }
526
+ }
527
+ if (item != undefined) {
528
+ previousItem = item;
529
+ return false;
530
+ }
531
+ return true;
532
+ });
533
+ }
534
+ else {
535
+ let itemIndex = this._listItems.findIndex(item => item.label === selectedItem.label);
536
+ if (itemIndex > 0 && itemIndex < this._listItems.length) {
537
+ previousItem = this._listItems[itemIndex - 1];
538
+ }
539
+ }
540
+ this.setSelection(previousItem, true);
541
+ }
542
+ keyDownHandler(event) {
543
+ event.preventDefault();
544
+ this.getSelection().then(selectedItem => {
545
+ if (selectedItem) {
546
+ switch (event.key) {
547
+ case "ArrowDown":
548
+ this.nextOption(selectedItem);
549
+ break;
550
+ case "ArrowUp":
551
+ this.previousOption(selectedItem);
552
+ break;
553
+ }
554
+ }
555
+ else {
556
+ this.selectFirstItem();
557
+ }
558
+ });
559
+ event.stopPropagation();
560
+ }
561
+ getItemId(itemLabel) {
562
+ if (itemLabel) {
563
+ return itemLabel.replace(/[^a-z0-9_]/gi, "_");
564
+ }
565
+ return undefined;
566
+ }
567
+ getDivGroupId(groupName) {
568
+ if (groupName) {
569
+ return "group-" + groupName.replace(/[^a-z0-9_]/gi, "_");
570
+ }
571
+ return undefined;
572
+ }
573
+ getGroupOverlayId(groupName) {
574
+ if (groupName) {
575
+ return "group-overlay-" + groupName.replace(/[^a-z0-9_]/gi, "_");
576
+ }
577
+ return undefined;
578
+ }
579
+ onDragOverGroup(event, group) {
580
+ if (this._dragStartItem && this._dragStartItem.groupName !== group.group && group.sort) {
581
+ event.preventDefault();
582
+ this.addOverGroupClass(event, group);
583
+ }
584
+ }
585
+ onDragOverItem(event) {
586
+ if (this._dragStartItem) {
587
+ event.preventDefault();
588
+ this.addOverClass(event.target);
589
+ event.stopPropagation();
590
+ }
591
+ }
592
+ onDragOverLastIndex(ev) {
593
+ ev.preventDefault();
594
+ if (this._dragStartItem) {
595
+ ev.target.classList.add('over');
596
+ ev.stopPropagation();
597
+ }
598
+ }
599
+ showOverlays(groupDragStart) {
600
+ let groupOverlayCollection = this._groupContainer.getElementsByClassName("group-overlay");
601
+ Array.from(groupOverlayCollection).forEach(groupOverlay => {
602
+ let groupOverlayID = this.getGroupOverlayId(groupDragStart.group);
603
+ if (groupOverlayID && groupOverlay.getAttribute("id") && groupOverlayID != groupOverlay.getAttribute("id")) {
604
+ groupOverlay.classList.add("presetedHeight");
605
+ groupOverlay.setAttribute("style", "display:grid");
606
+ }
607
+ });
608
+ }
609
+ hideOverlays() {
610
+ var _a;
611
+ let groupOverlayCollection = (_a = this._groupContainer) === null || _a === void 0 ? void 0 : _a.getElementsByClassName("group-overlay");
612
+ Array.from(groupOverlayCollection).forEach(groupOverlay => {
613
+ groupOverlay.classList.remove("presetedHeight");
614
+ groupOverlay.setAttribute("style", "display:none");
615
+ });
616
+ }
617
+ render() {
618
+ return (h(Host, { ref: (el) => this._element = el }, this.useGroups ?
619
+ h("div", { class: "group-container", ref: (el) => this._groupContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, this._listGroupItems.map(group => {
620
+ return h("div", { id: this.getDivGroupId(group.group), class: "group", key: group.group + group.items.length, onDrop: () => this.onDropGroup(group) }, h("label", { draggable: false, class: "group-name" }, group.group), h("section", { class: "section-container", onDragOver: (ev) => ev.preventDefault() }, h("div", { class: "group-items-container" }, h("div", { class: "draggable-list" }, group.items.map((item, index) => {
621
+ return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onClick: () => { this.setSelection(item); }, onDragLeave: () => { group.sort ? undefined : this.removeOverClass(); }, onDragEnd: () => this.onDragEnd(), onDragStart: () => this.onDragStart(item, group, index), onDragOver: (event) => { group.sort ? undefined : this.onDragOverItem(event); }, onDrop: (event) => this.onDrop(event, { groupName: group.group, item: item, index: index }), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
622
+ h("div", { class: "slot-item" }, this.itemSlotBuilder(item, group))
623
+ : undefined));
624
+ })), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: (event) => { this.onDragOverLastIndex(event); }, onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDropLastIndex(event, group) })), group.sort ?
625
+ h("div", { id: this.getGroupOverlayId(group.group), class: "group-overlay" }, "Mover para ", group.group)
626
+ : undefined));
627
+ }))
628
+ :
629
+ h("div", { class: "items-container", ref: (el) => this._itemContainer = el, tabIndex: 0, onKeyDown: (event) => { this.keyDownHandler(event); } }, h("div", { class: "draggable-list" }, this._listItems.map((item, index) => {
630
+ return h("li", { id: 'item_' + this.getItemId(item.label), class: this.ezSelectable ? "selectable-container" : "", key: 'item_' + this.getItemId(item.label) }, h("div", { class: "draggable" + (item.selected == true ? " selected-item " : "") + (this.ezSelectable == true ? " selectable " : ""), onDragStart: () => this.onDragStart({ item: item, index: index }), onClick: () => { this.setSelection(item); }, onDragLeave: () => this.removeOverClass(), onDragOver: (event) => this.onDragOverItem(event), onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDrop(event, { item: item, index: index }), draggable: this.ezDraggable }, h("div", { class: "item-content" }, this.ezDraggable ? h("span", { class: "draggable-icon" }) : undefined, h("p", { title: item.label, class: "person-name text--ellipsis" }, item.label)), this.itemSlotBuilder ?
631
+ h("div", null, this.itemSlotBuilder(item))
632
+ : undefined));
633
+ }), h("div", { class: "last-droppable-space", onDragLeave: () => this.removeOverClass(), onDragOver: (event) => { this.onDragOverLastIndex(event); }, onDragEnd: () => this.onDragEnd(), onDrop: (event) => this.onDropLastIndex(event) })))));
634
+ }
635
+ };
636
+ EzList.style = ezListCss;
637
+
638
+ const selectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
639
+
640
+ const SelectBox = class {
641
+ constructor(hostRef) {
642
+ registerInstance(this, hostRef);
643
+ this.ezChange = createEvent(this, "ezChange", 7);
644
+ this.selectedOption = { value: "na", label: "N/A" };
645
+ }
646
+ render() {
647
+ return (h("ez-combo-box", { class: "grid-config-combo inverted", label: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, h("option", { value: "na" }, "N/A"), h("option", { value: "asc" }, "A-Z"), h("option", { value: "desc" }, "Z-A")));
648
+ }
649
+ static get assetsDirs() { return ["../assets"]; }
650
+ };
651
+ SelectBox.style = selectBoxCss;
652
+
653
+ export { EzButton as ez_button, EzCheck as ez_check, EzList as ez_list, SelectBox as select_box };