@sankhyalabs/sankhyablocks 1.1.22 → 1.1.25

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/ez-action-chip.cjs.entry.js +27 -0
  5. package/dist/cjs/ez-application.cjs.entry.js +26 -0
  6. package/dist/cjs/ez-button_4.cjs.entry.js +660 -0
  7. package/dist/cjs/ez-calendar.cjs.entry.js +223 -0
  8. package/dist/cjs/ez-collapsible-box.cjs.entry.js +47 -0
  9. package/dist/cjs/ez-combo-box.cjs.entry.js +278 -0
  10. package/dist/cjs/ez-date-input.cjs.entry.js +102 -0
  11. package/dist/cjs/ez-date-time-input.cjs.entry.js +145 -0
  12. package/dist/cjs/ez-dialog.cjs.entry.js +89 -0
  13. package/dist/cjs/ez-form.cjs.entry.js +463 -0
  14. package/dist/cjs/ez-grid.cjs.entry.js +647 -0
  15. package/dist/cjs/ez-icon.cjs.entry.js +41 -0
  16. package/dist/cjs/ez-label-chip.cjs.entry.js +104 -0
  17. package/dist/cjs/ez-modal_2.cjs.entry.js +316 -0
  18. package/dist/cjs/ez-number-input.cjs.entry.js +86 -0
  19. package/dist/cjs/ez-popover.cjs.entry.js +120 -0
  20. package/dist/cjs/ez-popup.cjs.entry.js +48 -0
  21. package/dist/cjs/ez-search.cjs.entry.js +64 -0
  22. package/dist/cjs/ez-tabselector.cjs.entry.js +198 -0
  23. package/dist/cjs/ez-text-area.cjs.entry.js +114 -0
  24. package/dist/cjs/ez-text-input.cjs.entry.js +201 -0
  25. package/dist/cjs/ez-time-input.cjs.entry.js +118 -0
  26. package/dist/cjs/ez-toast.cjs.entry.js +44 -0
  27. package/dist/cjs/ez-upload.cjs.entry.js +356 -0
  28. package/dist/cjs/index-682c98b2.js +1771 -0
  29. package/dist/cjs/loader.cjs.js +3 -3
  30. package/dist/cjs/sankhyablocks.cjs.js +3 -3
  31. package/dist/cjs/snk-application.cjs.entry.js +319 -1275
  32. package/dist/cjs/test-du.cjs.entry.js +76 -0
  33. package/dist/collection/collection-manifest.json +37 -2
  34. package/dist/collection/components/snk-application/snk-application.js +8 -4
  35. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +16 -9
  36. package/dist/{collection/temp → components}/ApplicationUtils.js +37 -31
  37. package/dist/components/AssetsUtils.js +22 -0
  38. package/dist/components/CSSVarsUtils.js +17 -0
  39. package/dist/components/ez-action-chip.js +44 -0
  40. package/dist/components/ez-application.js +39 -0
  41. package/dist/components/ez-button.js +6 -0
  42. package/dist/components/ez-button2.js +105 -0
  43. package/dist/components/ez-calendar.js +6 -0
  44. package/dist/components/ez-calendar2.js +242 -0
  45. package/dist/components/ez-check.js +6 -0
  46. package/dist/components/ez-check2.js +94 -0
  47. package/dist/components/ez-collapsible-box.js +67 -0
  48. package/dist/components/ez-combo-box.js +6 -0
  49. package/dist/components/ez-combo-box2.js +311 -0
  50. package/dist/components/ez-date-input.js +135 -0
  51. package/dist/components/ez-date-time-input.js +179 -0
  52. package/dist/components/ez-dialog.js +124 -0
  53. package/dist/components/ez-form.js +6 -0
  54. package/dist/components/ez-form2.js +485 -0
  55. package/dist/components/ez-grid.js +738 -0
  56. package/dist/components/ez-icon.js +6 -0
  57. package/dist/components/ez-icon2.js +56 -0
  58. package/dist/components/ez-label-chip.js +125 -0
  59. package/dist/components/ez-list.js +6 -0
  60. package/dist/components/ez-list2.js +523 -0
  61. package/dist/components/ez-modal.js +6 -0
  62. package/dist/components/ez-modal2.js +82 -0
  63. package/dist/components/ez-number-input.js +115 -0
  64. package/dist/components/ez-popover.js +145 -0
  65. package/dist/components/ez-popup.js +67 -0
  66. package/dist/components/ez-search.js +100 -0
  67. package/dist/components/ez-tabselector.js +6 -0
  68. package/dist/components/ez-tabselector2.js +213 -0
  69. package/dist/components/ez-text-area.js +137 -0
  70. package/dist/components/ez-text-input.js +6 -0
  71. package/dist/components/ez-text-input2.js +223 -0
  72. package/dist/components/ez-time-input.js +153 -0
  73. package/dist/components/ez-toast.js +64 -0
  74. package/dist/components/ez-upload.js +382 -0
  75. package/dist/components/grid-config.js +6 -0
  76. package/dist/components/grid-config2.js +318 -0
  77. package/dist/components/select-box.js +6 -0
  78. package/dist/components/select-box2.js +47 -0
  79. package/dist/components/snk-application.js +310 -1266
  80. package/dist/components/test-du.js +101 -0
  81. package/dist/esm/ApplicationUtils-e0b6d857.js +37 -0
  82. package/dist/esm/AssetsUtils-6e6624dc.js +22 -0
  83. package/dist/esm/CSSVarsUtils-0787c3f3.js +17 -0
  84. package/dist/esm/ez-action-chip.entry.js +23 -0
  85. package/dist/esm/ez-application.entry.js +22 -0
  86. package/dist/esm/ez-button_4.entry.js +653 -0
  87. package/dist/esm/ez-calendar.entry.js +219 -0
  88. package/dist/esm/ez-collapsible-box.entry.js +43 -0
  89. package/dist/esm/ez-combo-box.entry.js +274 -0
  90. package/dist/esm/ez-date-input.entry.js +98 -0
  91. package/dist/esm/ez-date-time-input.entry.js +141 -0
  92. package/dist/esm/ez-dialog.entry.js +85 -0
  93. package/dist/esm/ez-form.entry.js +459 -0
  94. package/dist/esm/ez-grid.entry.js +643 -0
  95. package/dist/esm/ez-icon.entry.js +37 -0
  96. package/dist/esm/ez-label-chip.entry.js +100 -0
  97. package/dist/esm/ez-modal_2.entry.js +311 -0
  98. package/dist/esm/ez-number-input.entry.js +82 -0
  99. package/dist/esm/ez-popover.entry.js +116 -0
  100. package/dist/esm/ez-popup.entry.js +44 -0
  101. package/dist/esm/ez-search.entry.js +60 -0
  102. package/dist/esm/ez-tabselector.entry.js +194 -0
  103. package/dist/esm/ez-text-area.entry.js +110 -0
  104. package/dist/esm/ez-text-input.entry.js +197 -0
  105. package/dist/esm/ez-time-input.entry.js +114 -0
  106. package/dist/esm/ez-toast.entry.js +40 -0
  107. package/dist/esm/ez-upload.entry.js +352 -0
  108. package/dist/esm/index-35088a3f.js +1740 -0
  109. package/dist/esm/loader.js +3 -3
  110. package/dist/esm/sankhyablocks.js +3 -3
  111. package/dist/esm/snk-application.entry.js +311 -1267
  112. package/dist/esm/test-du.entry.js +72 -0
  113. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +67 -0
  114. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +3 -0
  115. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +180 -0
  116. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +319 -0
  117. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +327 -0
  118. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +162 -0
  119. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +217 -0
  120. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +49 -0
  121. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +44 -0
  122. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +527 -0
  123. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +5 -0
  124. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +31 -0
  125. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +129 -0
  126. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -0
  127. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +176 -0
  128. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +139 -0
  129. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +335 -0
  130. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +358 -0
  131. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +4 -0
  132. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +44 -0
  133. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +405 -0
  134. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +3 -0
  135. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +138 -0
  136. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +165 -0
  137. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +196 -0
  138. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +10 -0
  139. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +127 -0
  140. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +568 -0
  141. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +3 -0
  142. package/dist/sankhyablocks/p-0183d259.entry.js +1 -0
  143. package/dist/sankhyablocks/p-01f23a70.entry.js +1 -0
  144. package/dist/sankhyablocks/p-07c32f68.entry.js +1 -0
  145. package/dist/sankhyablocks/p-0f90499d.entry.js +1 -0
  146. package/dist/sankhyablocks/p-105724a3.entry.js +1 -0
  147. package/dist/sankhyablocks/p-2ac02d48.entry.js +1 -0
  148. package/dist/sankhyablocks/p-35364a97.entry.js +1 -0
  149. package/dist/sankhyablocks/p-3f6aa9a7.entry.js +1 -0
  150. package/dist/sankhyablocks/p-5f9af495.entry.js +1 -0
  151. package/dist/sankhyablocks/p-60967cf0.js +1 -0
  152. package/dist/sankhyablocks/p-6ce33b60.entry.js +57 -0
  153. package/dist/sankhyablocks/p-70ad6c16.entry.js +1 -0
  154. package/dist/sankhyablocks/p-710bfffe.entry.js +1 -0
  155. package/dist/sankhyablocks/p-735440c1.entry.js +1 -0
  156. package/dist/sankhyablocks/p-811b4b9d.js +1 -0
  157. package/dist/sankhyablocks/p-813fe4f7.js +1 -0
  158. package/dist/sankhyablocks/p-85a9446b.js +2 -0
  159. package/dist/sankhyablocks/p-89a1100f.entry.js +1 -0
  160. package/dist/sankhyablocks/p-8b543003.entry.js +1 -0
  161. package/dist/sankhyablocks/p-9750632b.entry.js +1 -0
  162. package/dist/sankhyablocks/p-a96272f7.entry.js +1 -0
  163. package/dist/sankhyablocks/p-ac8842e5.entry.js +1 -0
  164. package/dist/sankhyablocks/p-ba64cc41.entry.js +1 -0
  165. package/dist/sankhyablocks/p-c1ede043.entry.js +1 -0
  166. package/dist/sankhyablocks/p-d90ebb85.entry.js +1 -0
  167. package/dist/sankhyablocks/p-e17dfaae.entry.js +1 -0
  168. package/dist/sankhyablocks/p-e5355a29.entry.js +1 -0
  169. package/dist/sankhyablocks/p-ef04b633.entry.js +1 -0
  170. package/dist/sankhyablocks/p-f6db07fb.entry.js +1 -0
  171. package/dist/sankhyablocks/p-fcd9bd92.entry.js +1 -0
  172. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  173. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  174. package/dist/types/components.d.ts +7 -3
  175. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
  176. package/package.json +12 -7
  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-20a7d705.js +0 -733
  181. package/dist/esm/index-8d3572c4.js +0 -707
  182. package/dist/sankhyablocks/p-5fa264b9.js +0 -1
  183. package/dist/sankhyablocks/p-fe95f2c4.entry.js +0 -57
  184. package/dist/types/temp/ApplicationUtils.d.ts +0 -7
@@ -0,0 +1,100 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-35088a3f.js';
2
+
3
+ const ezLabelChipCss = ":host{--ez-label-chip--height:36px;--ez-label-chip__label--font-size:var(--text--medium, 14px);--ez-label-chip__label--font-family:var(--font-pattern, Arial);--ez-label-chip__label--font-weight:var(--text-weight--large, 600);--ez-label-chip__label--space--medium:var(--space--medium, 12px);--ez-label-chip__label--title--primary:var(--title--primary, #919191);--ez-label-chip__label__container--border-radius:var(--border--radius-large, 24px);--ez-label-chip__label__container--border:1px solid;--ez-label-chip__label__container--border-color-strokes:var(--color--strokes, #DCE0E8);--ez-label-chip__label__container--color-primary:var(--color--primary, #008561);--ez-label-chip__label__container-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ez-label-chip__label__container--background-color:#0085610F;--ez-label-chip__label__container--border-color:#0085610F;--ez-label-chip__label__container--default--border-color--hover:var(--color--primary-600, #007a5a);--ez-label-chip__label__container--default--background-color--hover:var(--color--primary-200, #f2faf8);--ez-label-chip__label__container--text--disabled:var(--text--disable, #AFB6C0);--ez-label-chip__btn__close--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 4.7098145,3.9968334 7.8535703,0.85318776 C 7.9473034,0.75946455 8,0.63233985 8,0.49978585 8,0.36723841 7.947304,0.24011361 7.8535703,0.14638378 7.7598354,0.05266059 7.6327257,6.48e-8 7.500152,6.48e-8 7.3676457,6.48e-8 7.2404691,0.0526608 7.1467354,0.14638378 L 4.00298,3.2900293 0.8591984,0.14638378 C 0.76546463,0.05266059 0.63834103,6.48e-8 0.50578123,6.48e-8 0.3732281,6.48e-8 0.24609783,0.05266059 0.15236397,0.14638378 0.05863012,0.24011361 0.00597395,0.36723841 0.00597395,0.49978585 c 0,0.132554 0.05265617,0.2596787 0.14639002,0.35340191 L 3.2961455,3.9968334 0.15236397,7.1411589 C 0.10466427,7.1872561 0.06663114,7.2424161 0.04046961,7.303371 0.01431473,7.3643212 5.6180845e-4,7.429943 1.6859246e-5,7.4962264 -5.2808998e-4,7.5625744 0.01214297,7.6283944 0.03729854,7.6897476 c 0.02514888,0.061416 0.06227604,0.1171794 0.1092096,0.1640783 0.0469402,0.046903 0.10274083,0.083936 0.16415749,0.1090508 0.0614166,0.025114 0.12721688,0.037703 0.19355667,0.037103 0.06634,-5.714e-4 0.13190027,-0.014457 0.19284393,-0.04064 0.0609507,-0.026246 0.11606474,-0.064351 0.16213217,-0.1120492 L 4.00298,4.7036374 7.1467354,7.8472967 c 0.093734,0.09373 0.2209103,0.1463572 0.3534166,0.1463572 0.1325737,0 0.2596834,-0.052623 0.3534183,-0.1463572 C 7.9473034,7.753567 8,7.6264624 8,7.493895 8,7.3613281 7.9473086,7.2342224 7.8535703,7.1404927 Z\"/></svg>')}.btn-close{align-items:flex-start;display:flex;outline:none;border:none;padding:0px 0px 0px 6px;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-label-chip__label__container--color-primary);width:8px;height:8px;-webkit-mask-image:var(--ez-label-chip__btn__close--image);mask-image:var(--ez-label-chip__btn__close--image)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;background-color:#FFFFFF;align-self:center;color:var(--ez-label-chip__label--title--primary);fill:var(--ez-label-chip__label--title--primary);border:var(--ez-label-chip__label__container--border);border-radius:var(--ez-label-chip__label__container--border-radius);border-color:var(--ez-label-chip__label__container--border-color-strokes);padding-right:var(--ez-label-chip__label--space--medium);padding-left:var(--ez-label-chip__label--space--medium)}.label__container:hover{border-color:var(--ez-label-chip__label__container--default--border-color--hover);background-color:var(--ez-label-chip__label__container--default--background-color--hover)}.label__container--active{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;align-self:center;border:var(--ez-label-chip__label__container--border);border-radius:var(--ez-label-chip__label__container--border-radius);padding-right:var(--ez-label-chip__label--space--medium);padding-left:var(--ez-label-chip__label--space--medium);fill:var(--ez-label-chip__label__container--color-primary);color:var(--ez-label-chip__label__container--color-primary);border-color:var(--ez-label-chip__label__container--border-color);background-color:var(--ez-label-chip__label__container--background-color)}.label__container--disabled{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;align-self:center;border:var(--ez-label-chip__label__container--border);border-color:var(--ez-label-chip__label__container-color--disable-secondary);border-radius:var(--ez-label-chip__label__container--border-radius);padding-right:var(--ez-label-chip__label--space--medium);padding-left:var(--ez-label-chip__label--space--medium);fill:var(--ez-label-chip__label__container--text--disabled);color:var(--ez-label-chip__label__container--text--disabled);background-color:var(--ez-label-chip__label__container-color--disable-secondary)}label{display:flex;align-items:center;font-weight:var(--ez-label-chip__label--font-weight);cursor:pointer;height:var(--ez-label-chip--height);font-family:var(--ez-label-chip__label--font-family);font-size:var(--ez-label-chip__label--font-size)}.label__icon{display:flex;cursor:pointer}";
4
+
5
+ const EzLabelChip = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.valueChange = createEvent(this, "valueChange", 7);
9
+ this.removeChip = createEvent(this, "removeChip", 7);
10
+ /**
11
+ * Deixa o componente disponível ou não para seleção.
12
+ */
13
+ this.enabled = true;
14
+ /**
15
+ * Indica se o componente terá a opção de ser removido.
16
+ */
17
+ this.removable = false;
18
+ /**
19
+ * Indica se o componente está ou não ativado.
20
+ */
21
+ this.value = false;
22
+ }
23
+ //---------------------------------------------
24
+ // Public methods
25
+ //---------------------------------------------
26
+ /**
27
+ * Faz o foco no componente de input
28
+ */
29
+ async setFocus() {
30
+ this._labelElem.focus();
31
+ }
32
+ /**
33
+ * Remove o foco no componente de input
34
+ */
35
+ async setBlur() {
36
+ this._labelElem.blur();
37
+ }
38
+ //---------------------------------------------
39
+ // Event handlers
40
+ //---------------------------------------------
41
+ handleClick(ev) {
42
+ const target = ev.target;
43
+ if (target.assignedSlot === null && !target.classList.contains("label__icon")) {
44
+ this.valueChange.emit(this.value);
45
+ this.swichState();
46
+ }
47
+ }
48
+ swichState() {
49
+ if (this.enabled) {
50
+ this.value = !this.value;
51
+ }
52
+ }
53
+ reflectChange() {
54
+ if (this._divElem) {
55
+ this._divElem.classList.remove("label__container--active");
56
+ this._divElem.classList.remove("label__container");
57
+ if (this.value) {
58
+ this._divElem.classList.add("label__container--active");
59
+ }
60
+ else {
61
+ this._divElem.classList.add("label__container");
62
+ }
63
+ }
64
+ }
65
+ //---------------------------------------------
66
+ // Lifecycle web component
67
+ //---------------------------------------------
68
+ componentDidLoad() {
69
+ if (this._divElem) {
70
+ if (this.value) {
71
+ this._divElem.classList.add("label__container--active");
72
+ }
73
+ else {
74
+ this.handleEnabledState();
75
+ }
76
+ }
77
+ }
78
+ handleEnabledState() {
79
+ this._divElem.classList.remove("label__container--disabled");
80
+ if (!this.enabled) {
81
+ this._divElem.classList.remove("label__container");
82
+ this._divElem.classList.add("label__container--disabled");
83
+ if (this._labelElem) {
84
+ this._labelElem.style.cursor = "default";
85
+ }
86
+ }
87
+ }
88
+ render() {
89
+ return (h("div", { onClick: (ev) => this.handleClick(ev), class: this.value ? "label__container--active" : "label__container", ref: (el) => this._divElem = el }, h("slot", { name: "leftIcon" }), h("label", { ref: (el) => this._labelElem = el }, this.label), this.removable ?
90
+ h("button", { class: "btn-close", onClick: () => { this.removeChip.emit(); } })
91
+ : null, h("slot", { name: "rightIcon" })));
92
+ }
93
+ static get watchers() { return {
94
+ "value": ["reflectChange"],
95
+ "enabled": ["handleEnabledState"]
96
+ }; }
97
+ };
98
+ EzLabelChip.style = ezLabelChipCss;
99
+
100
+ export { EzLabelChip as ez_label_chip };
@@ -0,0 +1,311 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-35088a3f.js';
2
+ import { g as getSpritePath } from './AssetsUtils-6e6624dc.js';
3
+ import { StringUtils } from '@sankhyalabs/core';
4
+
5
+ const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
6
+
7
+ const EzModal = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
11
+ /**
12
+ * Controle de exibição do Modal
13
+ */
14
+ this.opened = true;
15
+ /**
16
+ * Define se o modal será fechado ao clicar ESC
17
+ */
18
+ this.closeEsc = false;
19
+ /**
20
+ * Define se o modal será fechado ao clicar fora do conteúdo.
21
+ */
22
+ this.closeOutsideClick = false;
23
+ this.handleKeyboardEvent = (ev) => {
24
+ if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
25
+ this.closeModal();
26
+ }
27
+ };
28
+ }
29
+ handleopenedChange() {
30
+ if (this.opened) {
31
+ document.addEventListener("keydown", this.handleKeyboardEvent);
32
+ }
33
+ else {
34
+ document.removeEventListener("keydown", this.handleKeyboardEvent);
35
+ }
36
+ }
37
+ closeModal() {
38
+ this.opened = false;
39
+ this.ezCloseModal.emit(this.opened);
40
+ }
41
+ componentDidLoad() {
42
+ this.handleopenedChange();
43
+ }
44
+ onMouseDownHandler(event) {
45
+ if (this.closeOutsideClick && event.target === this._overlay) {
46
+ this.closeModal();
47
+ }
48
+ }
49
+ render() {
50
+ const positionSufix = this.align === "left" ? "left" : "right";
51
+ return (h(Host, null, this.opened
52
+ ?
53
+ h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, h("slot", null))))
54
+ :
55
+ undefined));
56
+ }
57
+ static get watchers() { return {
58
+ "opened": ["handleopenedChange"]
59
+ }; }
60
+ };
61
+ EzModal.style = ezModalCss;
62
+
63
+ const gridConfigCss = ".sc-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-weight:var(--text-weight--large, 700);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__main__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__main__scrollbar--border-radius:var(--border--radius-medium, 12px);--ez-grid__group--font-family:var(--font-pattern, \"Sora\");--ez-grid__group--font-size:var(--text--medium, 14px);--ez-grid__group--font-weight:var(--text-weight--large, 600);--ez-grid__group--padding-bottom:var(--space-small, 6px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.padding-right--medium.sc-grid-config{padding-right:var(--space--medium)}ez-list.sc-grid-config{height:100%}.heigth-calc.sc-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-grid-config{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden.sc-grid-config{display:none}.grid-config__main.sc-grid-config{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container.sc-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-grid-config{display:flex;justify-content:space-between;align-items:center;width:359px}.subtitle.sc-grid-config{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size);color:var(--text--primary)}.title.sc-grid-config{display:flex;margin:0;font-family:var(--ez-grid-config__title--font-family);font-size:var(--title--large);font-weight:var(--ez-grid-config__title--font-weight);line-height:normal;letter-spacing:0em;text-align:left;color:var(--title--primary)}.grid-config__main.sc-grid-config::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main.sc-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__main__scrollbar--background-color);border-radius:var(--ez-grid-config__main__scrollbar--border-radius)}.grid-config__main.sc-grid-config::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}.group-name.sc-grid-config{font-family:var(--ez-grid__group--font-family);font-size:var(--ez-grid__group--font-size);font-weight:var(--ez-grid__group--font-weight);padding-bottom:var(--ez-grid__group--padding-bottom)}";
64
+
65
+ const GridConfig = class {
66
+ constructor(hostRef) {
67
+ registerInstance(this, hostRef);
68
+ this.configFinish = createEvent(this, "configFinish", 7);
69
+ this.configCancel = createEvent(this, "configCancel", 7);
70
+ this._columnListHistory = [];
71
+ this._orderListItems = [];
72
+ this._columListItems = [];
73
+ this.selectedTab = "Colunas";
74
+ this._selectedIndex = -1;
75
+ }
76
+ /* Creation Methods */
77
+ createOrderList() {
78
+ var _a;
79
+ let newList = [];
80
+ if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
81
+ this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
82
+ let item = { label: column.label };
83
+ newList.push(item);
84
+ });
85
+ }
86
+ else {
87
+ this.columns.forEach(column => {
88
+ let item = { name: column.name, label: column.label };
89
+ if (!column.hidden) {
90
+ newList.push(item);
91
+ }
92
+ });
93
+ }
94
+ this._orderListItems = newList;
95
+ }
96
+ createColumnList() {
97
+ let visibleGroup = {
98
+ group: 'Visíveis',
99
+ items: [],
100
+ };
101
+ let hiddenGroup = {
102
+ group: 'Ocultas',
103
+ items: [],
104
+ sort: 'ASC'
105
+ };
106
+ this.columns.forEach(column => {
107
+ let item = { label: column.label };
108
+ if (column.hidden) {
109
+ hiddenGroup.items.push(item);
110
+ }
111
+ else {
112
+ visibleGroup.items.push(item);
113
+ }
114
+ });
115
+ if (this._columnListHistory.length <= 0) {
116
+ this._columListItems = [visibleGroup, hiddenGroup];
117
+ }
118
+ }
119
+ buildColumnListSlot(item, group) {
120
+ return (h("div", null, h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
121
+ }
122
+ buildOrderListSlot(item) {
123
+ let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
124
+ return (h("div", null, h("select-box", { selectedOption: existingItem === null || existingItem === void 0 ? void 0 : existingItem.sort, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item); } })));
125
+ }
126
+ updateOrder(sortOrder, updatedItem) {
127
+ let newList = [...this.columns];
128
+ let newItem = newList.find(item => item.label === updatedItem.label);
129
+ if (newItem) {
130
+ newItem.sort = sortOrder.value;
131
+ }
132
+ this.columns = newList;
133
+ }
134
+ /* Actions Methods */
135
+ switchColumnGroup(ev, switchedItem) {
136
+ ev.stopPropagation();
137
+ let newList = [...this._columListItems];
138
+ if (ev.detail === true) {
139
+ let hiddenGroup = newList.find(group => group.group === "Ocultas");
140
+ let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
141
+ if (index >= 0) {
142
+ hiddenGroup.items.splice(index, 1);
143
+ }
144
+ let visibleGroup = newList.find(group => group.group === "Visíveis");
145
+ visibleGroup.items.push(switchedItem);
146
+ this._columListItems = newList;
147
+ this.createOrderList();
148
+ }
149
+ else if (ev.detail === false) {
150
+ let visibleGroup = newList.find(group => group.group === "Visíveis");
151
+ let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
152
+ if (index >= 0) {
153
+ visibleGroup.items.splice(index, 1);
154
+ }
155
+ let hiddenGroup = newList.find(group => group.group === "Ocultas");
156
+ hiddenGroup.items.push(switchedItem);
157
+ this._columListItems = newList;
158
+ this.createOrderList();
159
+ }
160
+ }
161
+ finish() {
162
+ let newColumnList = [];
163
+ this._columListItems.forEach(group => {
164
+ group.items.forEach(item => {
165
+ const baseColumn = this.columns.find(column => column.label === item.label);
166
+ let newColumnItem = Object.assign({}, baseColumn);
167
+ if (group.group === "Ocultas") {
168
+ newColumnItem.hidden = true;
169
+ }
170
+ else {
171
+ newColumnItem.hidden = false;
172
+ }
173
+ newColumnList.push(newColumnItem);
174
+ });
175
+ });
176
+ this._columnListHistory = [];
177
+ this.columns = newColumnList;
178
+ this.configFinish.emit(this.columns);
179
+ }
180
+ async locateColumn(evt, searchingText) {
181
+ var _a;
182
+ const hitEnter = evt.key === "Enter";
183
+ if (!searchingText) {
184
+ searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
185
+ }
186
+ let newSelected = -1;
187
+ if (this.selectedTab === "Ordenação das linhas") {
188
+ if (searchingText) {
189
+ const matchedIndexes = [];
190
+ let orderListDatasource;
191
+ await this._orderList.getList().then(listGroup => {
192
+ orderListDatasource = listGroup;
193
+ orderListDatasource.forEach((column, index) => {
194
+ if (this.compareWords(column, searchingText)) {
195
+ matchedIndexes.push(index);
196
+ }
197
+ });
198
+ });
199
+ if (matchedIndexes.length > 0) {
200
+ if (hitEnter) {
201
+ for (let j = 0; j < matchedIndexes.length; j++) {
202
+ if (matchedIndexes[j] > this._selectedIndex) {
203
+ newSelected = matchedIndexes[j];
204
+ break;
205
+ }
206
+ }
207
+ }
208
+ if (newSelected === -1) {
209
+ newSelected = matchedIndexes[0];
210
+ }
211
+ }
212
+ this._selectedIndex = newSelected;
213
+ let selectedColumn;
214
+ selectedColumn = orderListDatasource[newSelected];
215
+ if (selectedColumn) {
216
+ this._orderList.setSelection({ label: selectedColumn.label }, true);
217
+ }
218
+ else {
219
+ this._orderList.setSelection(undefined);
220
+ }
221
+ }
222
+ else {
223
+ this._orderList.setSelection(undefined);
224
+ }
225
+ }
226
+ else {
227
+ if (searchingText) {
228
+ const matchedIndexes = [];
229
+ this.columns.forEach((column, index) => {
230
+ if (this.compareWords(column, searchingText)) {
231
+ matchedIndexes.push(index);
232
+ }
233
+ });
234
+ if (matchedIndexes.length > 0) {
235
+ if (hitEnter) {
236
+ for (let j = 0; j < matchedIndexes.length; j++) {
237
+ if (matchedIndexes[j] > this._selectedIndex) {
238
+ newSelected = matchedIndexes[j];
239
+ break;
240
+ }
241
+ }
242
+ }
243
+ if (newSelected === -1) {
244
+ newSelected = matchedIndexes[0];
245
+ }
246
+ }
247
+ this._selectedIndex = newSelected;
248
+ let selectedColumn = this.columns[newSelected];
249
+ if (selectedColumn) {
250
+ this._columnList.setSelection({ label: selectedColumn.label }, true);
251
+ }
252
+ else {
253
+ this._columnList.setSelection(undefined);
254
+ }
255
+ }
256
+ else {
257
+ this._columnList.setSelection(undefined);
258
+ }
259
+ }
260
+ }
261
+ compareWords(column, searchingText) {
262
+ if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
263
+ return true;
264
+ }
265
+ return false;
266
+ }
267
+ closeConfig() {
268
+ this._columnListHistory = [];
269
+ this.configCancel.emit();
270
+ }
271
+ /* Handlers */
272
+ handleTabChange(ev) {
273
+ var _a;
274
+ if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
275
+ if (ev.target.selectedTab === "Ordenação das linhas") {
276
+ this._columnListHistory = this._columnList.dataSource;
277
+ this.createOrderList();
278
+ }
279
+ this.selectedTab = ev.target.selectedTab;
280
+ }
281
+ }
282
+ handleColumnListChange(ev) {
283
+ var _a;
284
+ if (ev.detail) {
285
+ let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
286
+ if (visibleItems) {
287
+ this._orderListItems = visibleItems;
288
+ }
289
+ }
290
+ }
291
+ componentWillRender() {
292
+ var _a;
293
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
294
+ this.createColumnList();
295
+ this.createOrderList();
296
+ }
297
+ }
298
+ componentDidRender() {
299
+ var _a;
300
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
301
+ this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
302
+ }
303
+ }
304
+ render() {
305
+ return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "" }, h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"), h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")), h("div", { class: "button-close" }, h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "tabselector-container" }, h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o das linhas' })), h("div", null, h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) }, h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))), h("div", { class: "grid-config__main" }, h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedTab === "Colunas" ? "" : "hidden", dataSource: this._columListItems, onEzChange: ev => this.handleColumnListChange(ev), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }), h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"), h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "heigth-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), h("div", { class: "grid-config__footer" }, h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }), h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
306
+ }
307
+ static get assetsDirs() { return ["../assets"]; }
308
+ };
309
+ GridConfig.style = gridConfigCss;
310
+
311
+ export { EzModal as ez_modal, GridConfig as grid_config };
@@ -0,0 +1,82 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-35088a3f.js';
2
+ import { NumberUtils } from '@sankhyalabs/core';
3
+ import { C as CSSVarsUtils } from './CSSVarsUtils-0787c3f3.js';
4
+
5
+ const ezNumberInputCss = ":host{display:block;width:100%}";
6
+
7
+ const EzNumberInput = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.ezChange = createEvent(this, "ezChange", 7);
11
+ /**
12
+ * Deixa o campo disponível ou não para uso.
13
+ */
14
+ this.enabled = true;
15
+ }
16
+ setLabel() {
17
+ this._textInput.label = this.label;
18
+ }
19
+ setErrorMessage() {
20
+ this._textInput.errorMessage = this.errorMessage;
21
+ }
22
+ applyValueToInput() {
23
+ if (this._textInput) {
24
+ this._textInput.value = this.getTextValue(this.value);
25
+ }
26
+ }
27
+ /**
28
+ * Realiza o foco no componente de input
29
+ */
30
+ async setFocus() {
31
+ this._textInput.setFocus();
32
+ }
33
+ /**
34
+ * Remove o foco no componente de input
35
+ */
36
+ async setBlur() {
37
+ this._textInput.setBlur();
38
+ }
39
+ changeValue(newValue) {
40
+ this.errorMessage = "";
41
+ if (newValue && newValue !== this.value) {
42
+ this.value = newValue;
43
+ this.ezChange.emit(this.value);
44
+ }
45
+ }
46
+ parseNumber() {
47
+ const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : null;
48
+ if (parsedNumber != null && isNaN(parsedNumber)) {
49
+ this.errorMessage = "O valor digitado não é um número válido";
50
+ }
51
+ else {
52
+ try {
53
+ this.changeValue(parsedNumber);
54
+ }
55
+ catch (e) {
56
+ this.errorMessage = e.message;
57
+ return;
58
+ }
59
+ }
60
+ }
61
+ getTextValue(value) {
62
+ if (value) {
63
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
64
+ }
65
+ return null;
66
+ }
67
+ componentDidLoad() {
68
+ CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
69
+ }
70
+ render() {
71
+ return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
72
+ }
73
+ get _elem() { return getElement(this); }
74
+ static get watchers() { return {
75
+ "label": ["setLabel"],
76
+ "errorMessage": ["setErrorMessage"],
77
+ "value": ["applyValueToInput"]
78
+ }; }
79
+ };
80
+ EzNumberInput.style = ezNumberInputCss;
81
+
82
+ export { EzNumberInput as ez_number_input };
@@ -0,0 +1,116 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-35088a3f.js';
2
+ import { FloatingManager } from '@sankhyalabs/core';
3
+
4
+ const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";
5
+
6
+ const EzPopover = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
10
+ this._firstRender = true;
11
+ /**
12
+ * No modo floating = false o popover só se tornará visível
13
+ * quando o método show() for acionado.
14
+ */
15
+ this.autoClose = true;
16
+ /**
17
+ * Offset top do popover em relação ao componente pai
18
+ */
19
+ this.top = "0px";
20
+ /**
21
+ * Offset left do popover em relação ao componente pai
22
+ */
23
+ this.left = "0px";
24
+ /**
25
+ * Offset bottom do popover em relação ao componente pai
26
+ */
27
+ this.bottom = "0px";
28
+ /**
29
+ * Offset right do popover em relação ao componente pai
30
+ */
31
+ this.right = "0px";
32
+ /**
33
+ * Ajusta o comportamento da largura do popover.
34
+ * Opções: "100% e "fit-content" (default)
35
+ */
36
+ this.boxWidth = "fit-content";
37
+ }
38
+ dispatchVisibilityChange(newValue, oldValue) {
39
+ if (newValue != oldValue) {
40
+ this.ezVisibilityChange.emit(newValue);
41
+ }
42
+ }
43
+ /**
44
+ * Atualiza a posição do popover em relação ao componente pai.
45
+ */
46
+ async updatePosition(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
47
+ const floatingOptions = {
48
+ autoClose: this.autoClose,
49
+ top,
50
+ left,
51
+ bottom,
52
+ right,
53
+ innerClickTest: (_container, node) => {
54
+ if (_container.contains(node)) {
55
+ return true;
56
+ }
57
+ if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
58
+ return true;
59
+ }
60
+ _container = this._host;
61
+ return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
62
+ }
63
+ };
64
+ FloatingManager.updateFloatPosition(this._box, this._container, floatingOptions);
65
+ }
66
+ /**
67
+ * Faz com que o popover seja renderizado na DOM.
68
+ */
69
+ async show(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
70
+ const floatingOptions = {
71
+ autoClose: this.autoClose,
72
+ top,
73
+ left,
74
+ bottom,
75
+ right,
76
+ innerClickTest: (_container, node) => {
77
+ if (_container.contains(node)) {
78
+ return true;
79
+ }
80
+ if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
81
+ return true;
82
+ }
83
+ _container = this._host;
84
+ return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
85
+ }
86
+ };
87
+ this._floatingID = FloatingManager.float(this._box, this._container, floatingOptions);
88
+ this.opened = true;
89
+ }
90
+ /**
91
+ * Usado no modo floating. Faz com que o componente seja ocultado.
92
+ */
93
+ async hide() {
94
+ if (this._floatingID !== undefined) {
95
+ FloatingManager.close(this._floatingID);
96
+ this._floatingID = undefined;
97
+ this.opened = false;
98
+ }
99
+ }
100
+ componentDidRender() {
101
+ if (this._firstRender) {
102
+ this._box.remove();
103
+ this._firstRender = false;
104
+ }
105
+ }
106
+ render() {
107
+ return (h(Host, null, h("section", { ref: el => this._container = el }, h("div", { class: `box ${this.boxWidth === "fit-content" ? "box--fit-content" : "box--full-width"}`, ref: el => this._box = el }, h("slot", null)))));
108
+ }
109
+ get _host() { return getElement(this); }
110
+ static get watchers() { return {
111
+ "opened": ["dispatchVisibilityChange"]
112
+ }; }
113
+ };
114
+ EzPopover.style = ezPopoverCss;
115
+
116
+ export { EzPopover as ez_popover };