@sankhyalabs/sankhyablocks 1.1.27 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +75 -75
  3. package/dist/cjs/index-4720dab8.js +735 -0
  4. package/dist/cjs/loader.cjs.js +3 -3
  5. package/dist/cjs/sankhyablocks.cjs.js +3 -3
  6. package/dist/cjs/snk-application.cjs.entry.js +954 -656
  7. package/dist/collection/collection-manifest.json +6 -35
  8. package/dist/collection/components/snk-application/snk-application.css +5 -5
  9. package/dist/collection/components/snk-application/snk-application.js +492 -495
  10. package/dist/collection/index.js +1 -1
  11. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +158 -158
  12. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js +23 -23
  13. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +188 -188
  14. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +25 -25
  15. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +2 -2
  16. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +59 -59
  17. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +30 -30
  18. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js +66 -66
  19. package/dist/collection/lib/utils/pesquisa.js +16 -16
  20. package/dist/collection/lib/utils/urlutils.js +23 -23
  21. package/dist/collection/lib/workspace/workspace.js +7 -7
  22. package/dist/components/snk-application.js +945 -647
  23. package/dist/esm/index-72d4e2e0.js +709 -0
  24. package/dist/esm/loader.js +3 -3
  25. package/dist/esm/polyfills/core-js.js +0 -0
  26. package/dist/esm/polyfills/dom.js +0 -0
  27. package/dist/esm/polyfills/es5-html-element.js +0 -0
  28. package/dist/esm/polyfills/index.js +0 -0
  29. package/dist/esm/polyfills/system.js +0 -0
  30. package/dist/esm/sankhyablocks.js +3 -3
  31. package/dist/esm/snk-application.entry.js +916 -618
  32. package/dist/sankhyablocks/p-5d8ddbda.entry.js +57 -0
  33. package/dist/sankhyablocks/p-a33afc3b.js +2 -0
  34. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  35. package/dist/types/components/snk-application/snk-application.d.ts +44 -44
  36. package/dist/types/components.d.ts +6 -2
  37. package/dist/types/index.d.ts +1 -1
  38. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +15 -15
  39. package/dist/types/lib/http/data-fetcher/fetchers/application-config-fetcher.d.ts +6 -6
  40. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +12 -12
  41. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +5 -5
  42. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +2 -2
  43. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +13 -13
  44. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +6 -6
  45. package/dist/types/lib/http/data-fetcher/state/LoadStateManager.d.ts +23 -23
  46. package/dist/types/lib/utils/pesquisa.d.ts +2 -2
  47. package/dist/types/lib/utils/urlutils.d.ts +4 -4
  48. package/dist/types/lib/workspace/workspace.d.ts +4 -4
  49. package/package.json +63 -52
  50. package/react/.keepfolder +1 -0
  51. package/react/components.d.ts +3 -32
  52. package/react/components.js +5 -34
  53. package/react/components.js.map +1 -1
  54. package/react/react-component-lib/createComponent.d.ts +10 -10
  55. package/react/react-component-lib/createComponent.js +58 -74
  56. package/react/react-component-lib/createComponent.js.map +1 -1
  57. package/react/react-component-lib/createOverlayComponent.d.ts +20 -21
  58. package/react/react-component-lib/createOverlayComponent.js +88 -108
  59. package/react/react-component-lib/createOverlayComponent.js.map +1 -1
  60. package/react/react-component-lib/index.d.ts +2 -2
  61. package/react/react-component-lib/index.js +2 -2
  62. package/react/react-component-lib/interfaces.d.ts +29 -29
  63. package/react/react-component-lib/utils/attachProps.d.ts +12 -12
  64. package/react/react-component-lib/utils/attachProps.js +95 -97
  65. package/react/react-component-lib/utils/attachProps.js.map +1 -1
  66. package/react/react-component-lib/utils/case.d.ts +2 -2
  67. package/react/react-component-lib/utils/case.js +6 -6
  68. package/react/react-component-lib/utils/dev.d.ts +2 -2
  69. package/react/react-component-lib/utils/dev.js +12 -12
  70. package/react/react-component-lib/utils/index.d.ts +7 -10
  71. package/react/react-component-lib/utils/index.js +20 -33
  72. package/react/react-component-lib/utils/index.js.map +1 -1
  73. package/dist/cjs/ApplicationUtils-05b74ee9.js +0 -39
  74. package/dist/cjs/AssetsUtils-bd004f63.js +0 -24
  75. package/dist/cjs/CSSVarsUtils-75ca9c64.js +0 -19
  76. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  77. package/dist/cjs/ez-action-chip.cjs.entry.js +0 -27
  78. package/dist/cjs/ez-application.cjs.entry.js +0 -26
  79. package/dist/cjs/ez-button_4.cjs.entry.js +0 -660
  80. package/dist/cjs/ez-calendar.cjs.entry.js +0 -223
  81. package/dist/cjs/ez-collapsible-box.cjs.entry.js +0 -47
  82. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -278
  83. package/dist/cjs/ez-date-input.cjs.entry.js +0 -102
  84. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -145
  85. package/dist/cjs/ez-dialog.cjs.entry.js +0 -89
  86. package/dist/cjs/ez-form.cjs.entry.js +0 -785
  87. package/dist/cjs/ez-grid.cjs.entry.js +0 -110485
  88. package/dist/cjs/ez-icon.cjs.entry.js +0 -41
  89. package/dist/cjs/ez-label-chip.cjs.entry.js +0 -104
  90. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -316
  91. package/dist/cjs/ez-number-input.cjs.entry.js +0 -86
  92. package/dist/cjs/ez-popover.cjs.entry.js +0 -120
  93. package/dist/cjs/ez-popup.cjs.entry.js +0 -48
  94. package/dist/cjs/ez-search.cjs.entry.js +0 -64
  95. package/dist/cjs/ez-tabselector.cjs.entry.js +0 -198
  96. package/dist/cjs/ez-text-area.cjs.entry.js +0 -114
  97. package/dist/cjs/ez-text-input.cjs.entry.js +0 -201
  98. package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
  99. package/dist/cjs/ez-toast.cjs.entry.js +0 -44
  100. package/dist/cjs/ez-upload.cjs.entry.js +0 -356
  101. package/dist/cjs/index-6ac5268e.js +0 -1769
  102. package/dist/cjs/test-du.cjs.entry.js +0 -76
  103. package/dist/components/ApplicationUtils.js +0 -37
  104. package/dist/components/AssetsUtils.js +0 -22
  105. package/dist/components/CSSVarsUtils.js +0 -17
  106. package/dist/components/_commonjsHelpers.js +0 -17
  107. package/dist/components/ez-action-chip.js +0 -44
  108. package/dist/components/ez-application.js +0 -39
  109. package/dist/components/ez-button.js +0 -6
  110. package/dist/components/ez-button2.js +0 -105
  111. package/dist/components/ez-calendar.js +0 -6
  112. package/dist/components/ez-calendar2.js +0 -242
  113. package/dist/components/ez-check.js +0 -6
  114. package/dist/components/ez-check2.js +0 -94
  115. package/dist/components/ez-collapsible-box.js +0 -67
  116. package/dist/components/ez-combo-box.js +0 -6
  117. package/dist/components/ez-combo-box2.js +0 -311
  118. package/dist/components/ez-date-input.js +0 -135
  119. package/dist/components/ez-date-time-input.js +0 -179
  120. package/dist/components/ez-dialog.js +0 -124
  121. package/dist/components/ez-form.js +0 -6
  122. package/dist/components/ez-form2.js +0 -807
  123. package/dist/components/ez-grid.js +0 -110576
  124. package/dist/components/ez-icon.js +0 -6
  125. package/dist/components/ez-icon2.js +0 -56
  126. package/dist/components/ez-label-chip.js +0 -125
  127. package/dist/components/ez-list.js +0 -6
  128. package/dist/components/ez-list2.js +0 -523
  129. package/dist/components/ez-modal.js +0 -6
  130. package/dist/components/ez-modal2.js +0 -82
  131. package/dist/components/ez-number-input.js +0 -115
  132. package/dist/components/ez-popover.js +0 -145
  133. package/dist/components/ez-popup.js +0 -67
  134. package/dist/components/ez-search.js +0 -100
  135. package/dist/components/ez-tabselector.js +0 -6
  136. package/dist/components/ez-tabselector2.js +0 -213
  137. package/dist/components/ez-text-area.js +0 -137
  138. package/dist/components/ez-text-input.js +0 -6
  139. package/dist/components/ez-text-input2.js +0 -223
  140. package/dist/components/ez-time-input.js +0 -153
  141. package/dist/components/ez-toast.js +0 -64
  142. package/dist/components/ez-upload.js +0 -382
  143. package/dist/components/grid-config.js +0 -6
  144. package/dist/components/grid-config2.js +0 -318
  145. package/dist/components/select-box.js +0 -6
  146. package/dist/components/select-box2.js +0 -47
  147. package/dist/components/test-du.js +0 -101
  148. package/dist/esm/ApplicationUtils-e0b6d857.js +0 -37
  149. package/dist/esm/AssetsUtils-98074c9c.js +0 -22
  150. package/dist/esm/CSSVarsUtils-0787c3f3.js +0 -17
  151. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  152. package/dist/esm/ez-action-chip.entry.js +0 -23
  153. package/dist/esm/ez-application.entry.js +0 -22
  154. package/dist/esm/ez-button_4.entry.js +0 -653
  155. package/dist/esm/ez-calendar.entry.js +0 -219
  156. package/dist/esm/ez-collapsible-box.entry.js +0 -43
  157. package/dist/esm/ez-combo-box.entry.js +0 -274
  158. package/dist/esm/ez-date-input.entry.js +0 -98
  159. package/dist/esm/ez-date-time-input.entry.js +0 -141
  160. package/dist/esm/ez-dialog.entry.js +0 -85
  161. package/dist/esm/ez-form.entry.js +0 -781
  162. package/dist/esm/ez-grid.entry.js +0 -110481
  163. package/dist/esm/ez-icon.entry.js +0 -37
  164. package/dist/esm/ez-label-chip.entry.js +0 -100
  165. package/dist/esm/ez-modal_2.entry.js +0 -311
  166. package/dist/esm/ez-number-input.entry.js +0 -82
  167. package/dist/esm/ez-popover.entry.js +0 -116
  168. package/dist/esm/ez-popup.entry.js +0 -44
  169. package/dist/esm/ez-search.entry.js +0 -60
  170. package/dist/esm/ez-tabselector.entry.js +0 -194
  171. package/dist/esm/ez-text-area.entry.js +0 -110
  172. package/dist/esm/ez-text-input.entry.js +0 -197
  173. package/dist/esm/ez-time-input.entry.js +0 -114
  174. package/dist/esm/ez-toast.entry.js +0 -40
  175. package/dist/esm/ez-upload.entry.js +0 -352
  176. package/dist/esm/index-df166135.js +0 -1738
  177. package/dist/esm/test-du.entry.js +0 -72
  178. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +0 -67
  179. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +0 -3
  180. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +0 -180
  181. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +0 -319
  182. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +0 -327
  183. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -162
  184. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -217
  185. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +0 -49
  186. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -44
  187. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +0 -527
  188. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +0 -5
  189. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +0 -31
  190. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +0 -129
  191. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +0 -10
  192. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +0 -176
  193. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +0 -139
  194. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +0 -335
  195. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +0 -358
  196. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +0 -4
  197. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +0 -44
  198. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +0 -405
  199. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +0 -3
  200. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -138
  201. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +0 -165
  202. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +0 -196
  203. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +0 -10
  204. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +0 -127
  205. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +0 -568
  206. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +0 -3
  207. package/dist/sankhyablocks/p-08e1cded.entry.js +0 -1
  208. package/dist/sankhyablocks/p-0a77ac95.entry.js +0 -57
  209. package/dist/sankhyablocks/p-112455b1.js +0 -1
  210. package/dist/sankhyablocks/p-126c4aaa.entry.js +0 -1
  211. package/dist/sankhyablocks/p-1421b89a.entry.js +0 -1
  212. package/dist/sankhyablocks/p-1beadcaf.entry.js +0 -1
  213. package/dist/sankhyablocks/p-1c423f5d.entry.js +0 -1
  214. package/dist/sankhyablocks/p-28a0dbf0.entry.js +0 -1
  215. package/dist/sankhyablocks/p-4763d5c2.js +0 -1
  216. package/dist/sankhyablocks/p-4c66200a.entry.js +0 -1
  217. package/dist/sankhyablocks/p-5dc772be.entry.js +0 -1
  218. package/dist/sankhyablocks/p-5ff3e300.entry.js +0 -1
  219. package/dist/sankhyablocks/p-7122cec4.entry.js +0 -1
  220. package/dist/sankhyablocks/p-811b4b9d.js +0 -1
  221. package/dist/sankhyablocks/p-813fe4f7.js +0 -1
  222. package/dist/sankhyablocks/p-9b33a005.entry.js +0 -1
  223. package/dist/sankhyablocks/p-9e22ec87.entry.js +0 -1
  224. package/dist/sankhyablocks/p-9f7239df.entry.js +0 -1
  225. package/dist/sankhyablocks/p-9f7e6e48.js +0 -1
  226. package/dist/sankhyablocks/p-a47e0537.entry.js +0 -1
  227. package/dist/sankhyablocks/p-a9aba60a.entry.js +0 -1
  228. package/dist/sankhyablocks/p-afda7940.entry.js +0 -1
  229. package/dist/sankhyablocks/p-b3a83eaf.entry.js +0 -1
  230. package/dist/sankhyablocks/p-b96a8d40.entry.js +0 -1
  231. package/dist/sankhyablocks/p-c61c0e40.entry.js +0 -1
  232. package/dist/sankhyablocks/p-ca29d028.entry.js +0 -1
  233. package/dist/sankhyablocks/p-cd17abb1.entry.js +0 -1
  234. package/dist/sankhyablocks/p-d3a5366d.entry.js +0 -369
  235. package/dist/sankhyablocks/p-d5703a41.entry.js +0 -1
  236. package/dist/sankhyablocks/p-e5f77a59.entry.js +0 -1
  237. package/dist/sankhyablocks/p-e9e94d51.entry.js +0 -1
@@ -1,98 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-df166135.js';
2
- import { DateUtils } from '@sankhyalabs/core';
3
- import { C as CSSVarsUtils } from './CSSVarsUtils-0787c3f3.js';
4
-
5
- const ezDateInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
6
-
7
- const EzDateInput = 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 data
29
- */
30
- async setFocus() {
31
- this._textInput.setFocus();
32
- }
33
- /**
34
- * Remove o foco no componente de data
35
- */
36
- async setBlur() {
37
- this._textInput.setBlur();
38
- }
39
- changeValue(newValue) {
40
- var _a;
41
- newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
42
- this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
43
- this._textInput.errorMessage = "";
44
- if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
45
- this.value = newValue;
46
- this.ezChange.emit(this.value);
47
- }
48
- }
49
- showCalendar() {
50
- this.parseDate();
51
- this._calendar.value = this.value;
52
- //FIXME: Provavelmente isso fará com que o popup abra em uma
53
- //posição errada no futuro. Preferi fazer simples no começo,
54
- //porque não quis onerar o text input com essa funcionalidade...
55
- const top = this._textInput.errorMessage ? 0 : -17;
56
- this._calendar.fitVertical(top, this._elem.clientHeight);
57
- }
58
- hideCalendar() {
59
- this.changeValue(this._calendar.value);
60
- this._calendar.hide();
61
- }
62
- parseDate() {
63
- const strValue = this._textInput.value;
64
- const parsedDate = DateUtils.strToDate(strValue);
65
- if (parsedDate || !strValue) {
66
- if (this.value === parsedDate) {
67
- this.changeValue(this.value);
68
- }
69
- else {
70
- this.changeValue(parsedDate);
71
- }
72
- }
73
- else {
74
- this._textInput.errorMessage = "O valor digitado não é uma data válida";
75
- }
76
- }
77
- getTextValue(d) {
78
- return d ? new Intl.DateTimeFormat("pt-BR").format(d) : null;
79
- }
80
- componentDidLoad() {
81
- CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
82
- }
83
- render() {
84
- return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
85
- if (event.key === "H" || event.key === "h")
86
- this.changeValue(new Date());
87
- }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
88
- }
89
- get _elem() { return getElement(this); }
90
- static get watchers() { return {
91
- "label": ["setLabel"],
92
- "errorMessage": ["setErrorMessage"],
93
- "value": ["applyValueToInput"]
94
- }; }
95
- };
96
- EzDateInput.style = ezDateInputCss;
97
-
98
- export { EzDateInput as ez_date_input };
@@ -1,141 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-df166135.js';
2
- import { TimeFormatter, DateUtils } from '@sankhyalabs/core';
3
- import { C as CSSVarsUtils } from './CSSVarsUtils-0787c3f3.js';
4
-
5
- const ezDateTimeInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
6
-
7
- const EzDateTimeInput = 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
- * Exibe ou não os segundos no input
17
- */
18
- this.showSeconds = false;
19
- }
20
- setLabel() {
21
- this._textInput.label = this.label;
22
- }
23
- setErrorMessage() {
24
- this._textInput.errorMessage = this.errorMessage;
25
- }
26
- applyValueToInput() {
27
- if (this._textInput) {
28
- this._textInput.value = this.getTextValue(this.value);
29
- }
30
- }
31
- /**
32
- * Realiza o foco no componente de datetime
33
- */
34
- async setFocus() {
35
- this._textInput.setFocus();
36
- }
37
- /**
38
- * Remove o foco no componente de datetime
39
- */
40
- async setBlur() {
41
- this._textInput.setBlur();
42
- }
43
- onChangeKeyDown(ev) {
44
- const input = this._textInput.shadowRoot.querySelector('input');
45
- if (ev.key === "H" || ev.key === "h") {
46
- this.changeValue(new Date());
47
- }
48
- else if (ev.shiftKey && ev.key === "Tab") {
49
- if (input.selectionStart > 0) {
50
- let selectIni = input.value.lastIndexOf(" ", input.selectionStart);
51
- if (selectIni !== -1) {
52
- input.setSelectionRange(0, selectIni);
53
- ev.preventDefault();
54
- }
55
- }
56
- }
57
- else if (ev.key === "Tab") {
58
- if (input.value.length !== input.selectionEnd) {
59
- let selectIni = input.value.indexOf(" ", input.selectionEnd);
60
- selectIni = selectIni === -1 ? input.selectionEnd : selectIni + 1;
61
- input.setSelectionRange(selectIni, input.value.length);
62
- ev.preventDefault();
63
- }
64
- }
65
- }
66
- onFocused() {
67
- const input = this._textInput.shadowRoot.querySelector('input');
68
- if (input.selectionStart !== input.selectionEnd) {
69
- let selectIni = input.value.indexOf(" ", input.selectionStart);
70
- selectIni = selectIni === -1 ? input.value.length : selectIni;
71
- input.setSelectionRange(0, selectIni);
72
- }
73
- }
74
- onClicked() {
75
- const input = this._textInput.shadowRoot.querySelector('input');
76
- let selectIni = input.value.lastIndexOf(" ", input.selectionEnd);
77
- selectIni = selectIni === -1 ? 0 : selectIni + 1;
78
- selectIni = selectIni > input.selectionEnd ? 0 : selectIni;
79
- let selectFin = selectIni === 0 ? input.value.indexOf(" ") : input.value.length;
80
- input.setSelectionRange(selectIni, selectFin);
81
- }
82
- changeValue(newValue) {
83
- var _a;
84
- this._textInput.errorMessage = "";
85
- if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
86
- this.value = newValue;
87
- this.ezChange.emit(this.value);
88
- }
89
- }
90
- showCalendar() {
91
- const top = this._textInput.errorMessage ? 0 : -17;
92
- this._calendar.fitVertical(top, this._elem.clientHeight);
93
- this._calendar.style.visibility = 'inherit';
94
- }
95
- parseDate() {
96
- const strValue = this._textInput.value;
97
- const partsDateTime = (strValue && strValue.length > 0) ? strValue.split(" ") : [];
98
- const onlyDate = partsDateTime.length > 0 ? partsDateTime[0] : strValue;
99
- const onlyTime = partsDateTime[1] ? partsDateTime[1] : "";
100
- const parsedTime = TimeFormatter.prepareValue(onlyTime, this.showSeconds);
101
- const strDateTime = onlyDate + (parsedTime && " " + parsedTime);
102
- const parsedDate = DateUtils.strToDate(strDateTime);
103
- if (parsedDate || !strValue) {
104
- if (this.value === parsedDate) {
105
- this.changeValue(this.value);
106
- }
107
- else {
108
- this.changeValue(parsedDate);
109
- }
110
- }
111
- else {
112
- this._textInput.errorMessage = "O valor digitado não é uma data válida";
113
- }
114
- }
115
- getTextValue(d) {
116
- const options = {
117
- year: 'numeric', month: 'numeric', day: 'numeric',
118
- hour: 'numeric', minute: 'numeric'
119
- };
120
- const optionsSecond = {
121
- year: 'numeric', month: 'numeric', day: 'numeric',
122
- hour: 'numeric', minute: 'numeric', second: 'numeric'
123
- };
124
- return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : null;
125
- }
126
- componentDidLoad() {
127
- CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
128
- }
129
- render() {
130
- return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, onFocus: () => this.onFocused(), onClick: () => this.onClicked() }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
131
- }
132
- get _elem() { return getElement(this); }
133
- static get watchers() { return {
134
- "label": ["setLabel"],
135
- "errorMessage": ["setErrorMessage"],
136
- "value": ["applyValueToInput"]
137
- }; }
138
- };
139
- EzDateTimeInput.style = ezDateTimeInputCss;
140
-
141
- export { EzDateTimeInput as ez_date_time_input };
@@ -1,85 +0,0 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h } from './index-df166135.js';
2
-
3
- const ezDialogCss = ":host{--dialog__container-padding:var(--space--large, 24px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--dialog__title--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dialog__body--text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--large, 24px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog-z-index:var(--most-visible, 3);--dialog--warning__image:url('data: image/svg+xml;utf8,<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895\"/></svg>');--dialog--critical__image:url('data: image/svg+xml;utf8,<svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z\"/></svg>')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.changeable__icon{background:var(--dialog__warning--background-color);--ez-icon--color:var(--dialog__icon--color);display:grid;place-items:center;width:26px;height:26px;border-radius:50%}.changeable__icon.critical{background:var(--dialog__critical--background-color)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);line-height:1.3}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title--label{padding-left:var(--dialog__title--padding-left)}.title-icon{outline:none;border:none;background-color:var(--dialog__warning--background-color);width:26px;height:26px;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center}.title-icon--critical{background-color:var(--dialog__critical--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:'';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.title-icon--critical::after{content:'';display:flex;background-color:#FFFF;width:13px;height:13px;-webkit-mask-image:var(--dialog--critical__image);mask-image:var(--dialog--critical__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__no{padding-right:var(--dialog__btn__no--padding-right)}.button__ok--container{display:flex;justify-content:flex-end}.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%}}";
4
-
5
- class Message {
6
- constructor(title, message, critical, confirm, icon, callBack) {
7
- this.title = title;
8
- this.message = message;
9
- this.critical = critical;
10
- this.confirm = confirm;
11
- this.icon = icon;
12
- this.callBack = callBack;
13
- }
14
- }
15
- const EzDialog = class {
16
- constructor(hostRef) {
17
- registerInstance(this, hostRef);
18
- this.ezCancel = createEvent(this, "ezCancel", 7);
19
- this.ezAccept = createEvent(this, "ezAccept", 7);
20
- /**
21
- * Define se o componente será utilizado no modo de confirmação.
22
- */
23
- this.confirm = false;
24
- /**
25
- * Define se o componente terá o visual de erro ou de aviso
26
- */
27
- this.critical = false;
28
- /**
29
- * Controla a exibição do componente
30
- */
31
- this.opened = false;
32
- this._messageQueue = [];
33
- }
34
- /**
35
- * Lida com o clique nos botões de dentro do componente.
36
- */
37
- async handleButtonClick(selectedOption) {
38
- this.opened = this._messageQueue.length > 0;
39
- if (this._currentMessage.callBack) {
40
- this._currentMessage.callBack(selectedOption);
41
- }
42
- else {
43
- selectedOption ? this.ezAccept.emit(selectedOption) : this.ezCancel.emit(selectedOption);
44
- }
45
- this._currentMessage = this._messageQueue.shift();
46
- forceUpdate(this);
47
- }
48
- /**
49
- * Faz com que o componente seja exibido.
50
- */
51
- async show(title, message, critical, confirm, icon) {
52
- this.opened = true;
53
- return new Promise(resolve => {
54
- this._messageQueue.push(new Message(title, message, critical, confirm, icon, resolve));
55
- });
56
- }
57
- componentWillRender() {
58
- if (!this._currentMessage) {
59
- if (this._messageQueue.length > 0) {
60
- this._currentMessage = this._messageQueue.pop();
61
- }
62
- else {
63
- if (this.opened) {
64
- this._currentMessage = new Message(this.ezTitle, this.message, this.critical, this.confirm, this.personalizedIconPath, null);
65
- }
66
- }
67
- }
68
- }
69
- render() {
70
- if (this.opened && this._currentMessage) {
71
- return (h("div", { class: "overlay" }, h("div", { class: "dialog" }, h("div", { class: this._currentMessage.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), h("div", { class: "dialog__container" }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this._currentMessage.icon ?
72
- h("ez-icon", { class: this._currentMessage.critical ? "changeable__icon critical" : "changeable__icon", size: "small", iconName: this._currentMessage.icon })
73
- :
74
- h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }), h("div", { class: "title title--label", innerHTML: this._currentMessage.title })), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })), h("div", { class: "message", innerHTML: this._currentMessage.message }), this._currentMessage.confirm ?
75
- h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }), h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
76
- : undefined, !this._currentMessage.confirm ?
77
- h("div", { class: "button__ok--container" }, h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
78
- : undefined))));
79
- }
80
- return null;
81
- }
82
- };
83
- EzDialog.style = ezDialogCss;
84
-
85
- export { EzDialog as ez_dialog };