@sankhyalabs/sankhyablocks 1.1.28 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) 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 +2 -2
  5. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  6. package/dist/cjs/snk-application.cjs.entry.js +668 -653
  7. package/dist/collection/collection-manifest.json +5 -34
  8. package/dist/collection/components/snk-application/snk-application.css +5 -5
  9. package/dist/collection/components/snk-application/snk-application.js +492 -492
  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 +655 -640
  23. package/dist/esm/index-72d4e2e0.js +709 -0
  24. package/dist/esm/loader.js +2 -2
  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 +2 -2
  31. package/dist/esm/snk-application.entry.js +626 -611
  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/index.d.ts +1 -1
  37. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +15 -15
  38. package/dist/types/lib/http/data-fetcher/fetchers/application-config-fetcher.d.ts +6 -6
  39. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +12 -12
  40. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +5 -5
  41. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +2 -2
  42. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +13 -13
  43. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +6 -6
  44. package/dist/types/lib/http/data-fetcher/state/LoadStateManager.d.ts +23 -23
  45. package/dist/types/lib/utils/pesquisa.d.ts +2 -2
  46. package/dist/types/lib/utils/urlutils.d.ts +4 -4
  47. package/dist/types/lib/workspace/workspace.d.ts +4 -4
  48. package/package.json +63 -52
  49. package/react/.keepfolder +1 -0
  50. package/react/components.d.ts +3 -32
  51. package/react/components.js +5 -34
  52. package/react/components.js.map +1 -1
  53. package/react/react-component-lib/createComponent.d.ts +10 -10
  54. package/react/react-component-lib/createComponent.js +58 -74
  55. package/react/react-component-lib/createComponent.js.map +1 -1
  56. package/react/react-component-lib/createOverlayComponent.d.ts +20 -21
  57. package/react/react-component-lib/createOverlayComponent.js +88 -108
  58. package/react/react-component-lib/createOverlayComponent.js.map +1 -1
  59. package/react/react-component-lib/index.d.ts +2 -2
  60. package/react/react-component-lib/index.js +2 -2
  61. package/react/react-component-lib/interfaces.d.ts +29 -29
  62. package/react/react-component-lib/utils/attachProps.d.ts +12 -12
  63. package/react/react-component-lib/utils/attachProps.js +95 -97
  64. package/react/react-component-lib/utils/attachProps.js.map +1 -1
  65. package/react/react-component-lib/utils/case.d.ts +2 -2
  66. package/react/react-component-lib/utils/case.js +6 -6
  67. package/react/react-component-lib/utils/dev.d.ts +2 -2
  68. package/react/react-component-lib/utils/dev.js +12 -12
  69. package/react/react-component-lib/utils/index.d.ts +7 -10
  70. package/react/react-component-lib/utils/index.js +20 -33
  71. package/react/react-component-lib/utils/index.js.map +1 -1
  72. package/dist/cjs/ApplicationUtils-05b74ee9.js +0 -39
  73. package/dist/cjs/AssetsUtils-7e3c38f9.js +0 -24
  74. package/dist/cjs/CSSVarsUtils-75ca9c64.js +0 -19
  75. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  76. package/dist/cjs/ez-action-chip.cjs.entry.js +0 -27
  77. package/dist/cjs/ez-application.cjs.entry.js +0 -26
  78. package/dist/cjs/ez-button_4.cjs.entry.js +0 -660
  79. package/dist/cjs/ez-calendar.cjs.entry.js +0 -223
  80. package/dist/cjs/ez-collapsible-box.cjs.entry.js +0 -47
  81. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -278
  82. package/dist/cjs/ez-date-input.cjs.entry.js +0 -102
  83. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -145
  84. package/dist/cjs/ez-dialog.cjs.entry.js +0 -89
  85. package/dist/cjs/ez-form.cjs.entry.js +0 -785
  86. package/dist/cjs/ez-grid.cjs.entry.js +0 -110485
  87. package/dist/cjs/ez-icon.cjs.entry.js +0 -41
  88. package/dist/cjs/ez-label-chip.cjs.entry.js +0 -104
  89. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -316
  90. package/dist/cjs/ez-number-input.cjs.entry.js +0 -86
  91. package/dist/cjs/ez-popover.cjs.entry.js +0 -120
  92. package/dist/cjs/ez-popup.cjs.entry.js +0 -48
  93. package/dist/cjs/ez-search.cjs.entry.js +0 -64
  94. package/dist/cjs/ez-tabselector.cjs.entry.js +0 -198
  95. package/dist/cjs/ez-text-area.cjs.entry.js +0 -114
  96. package/dist/cjs/ez-text-input.cjs.entry.js +0 -201
  97. package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
  98. package/dist/cjs/ez-toast.cjs.entry.js +0 -44
  99. package/dist/cjs/ez-upload.cjs.entry.js +0 -356
  100. package/dist/cjs/index-682c98b2.js +0 -1771
  101. package/dist/cjs/test-du.cjs.entry.js +0 -76
  102. package/dist/components/ApplicationUtils.js +0 -37
  103. package/dist/components/AssetsUtils.js +0 -22
  104. package/dist/components/CSSVarsUtils.js +0 -17
  105. package/dist/components/_commonjsHelpers.js +0 -17
  106. package/dist/components/ez-action-chip.js +0 -44
  107. package/dist/components/ez-application.js +0 -39
  108. package/dist/components/ez-button.js +0 -6
  109. package/dist/components/ez-button2.js +0 -105
  110. package/dist/components/ez-calendar.js +0 -6
  111. package/dist/components/ez-calendar2.js +0 -242
  112. package/dist/components/ez-check.js +0 -6
  113. package/dist/components/ez-check2.js +0 -94
  114. package/dist/components/ez-collapsible-box.js +0 -67
  115. package/dist/components/ez-combo-box.js +0 -6
  116. package/dist/components/ez-combo-box2.js +0 -311
  117. package/dist/components/ez-date-input.js +0 -135
  118. package/dist/components/ez-date-time-input.js +0 -179
  119. package/dist/components/ez-dialog.js +0 -124
  120. package/dist/components/ez-form.js +0 -6
  121. package/dist/components/ez-form2.js +0 -807
  122. package/dist/components/ez-grid.js +0 -110576
  123. package/dist/components/ez-icon.js +0 -6
  124. package/dist/components/ez-icon2.js +0 -56
  125. package/dist/components/ez-label-chip.js +0 -125
  126. package/dist/components/ez-list.js +0 -6
  127. package/dist/components/ez-list2.js +0 -523
  128. package/dist/components/ez-modal.js +0 -6
  129. package/dist/components/ez-modal2.js +0 -82
  130. package/dist/components/ez-number-input.js +0 -115
  131. package/dist/components/ez-popover.js +0 -145
  132. package/dist/components/ez-popup.js +0 -67
  133. package/dist/components/ez-search.js +0 -100
  134. package/dist/components/ez-tabselector.js +0 -6
  135. package/dist/components/ez-tabselector2.js +0 -213
  136. package/dist/components/ez-text-area.js +0 -137
  137. package/dist/components/ez-text-input.js +0 -6
  138. package/dist/components/ez-text-input2.js +0 -223
  139. package/dist/components/ez-time-input.js +0 -153
  140. package/dist/components/ez-toast.js +0 -64
  141. package/dist/components/ez-upload.js +0 -382
  142. package/dist/components/grid-config.js +0 -6
  143. package/dist/components/grid-config2.js +0 -318
  144. package/dist/components/select-box.js +0 -6
  145. package/dist/components/select-box2.js +0 -47
  146. package/dist/components/test-du.js +0 -101
  147. package/dist/esm/ApplicationUtils-e0b6d857.js +0 -37
  148. package/dist/esm/AssetsUtils-6e6624dc.js +0 -22
  149. package/dist/esm/CSSVarsUtils-0787c3f3.js +0 -17
  150. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  151. package/dist/esm/ez-action-chip.entry.js +0 -23
  152. package/dist/esm/ez-application.entry.js +0 -22
  153. package/dist/esm/ez-button_4.entry.js +0 -653
  154. package/dist/esm/ez-calendar.entry.js +0 -219
  155. package/dist/esm/ez-collapsible-box.entry.js +0 -43
  156. package/dist/esm/ez-combo-box.entry.js +0 -274
  157. package/dist/esm/ez-date-input.entry.js +0 -98
  158. package/dist/esm/ez-date-time-input.entry.js +0 -141
  159. package/dist/esm/ez-dialog.entry.js +0 -85
  160. package/dist/esm/ez-form.entry.js +0 -781
  161. package/dist/esm/ez-grid.entry.js +0 -110481
  162. package/dist/esm/ez-icon.entry.js +0 -37
  163. package/dist/esm/ez-label-chip.entry.js +0 -100
  164. package/dist/esm/ez-modal_2.entry.js +0 -311
  165. package/dist/esm/ez-number-input.entry.js +0 -82
  166. package/dist/esm/ez-popover.entry.js +0 -116
  167. package/dist/esm/ez-popup.entry.js +0 -44
  168. package/dist/esm/ez-search.entry.js +0 -60
  169. package/dist/esm/ez-tabselector.entry.js +0 -194
  170. package/dist/esm/ez-text-area.entry.js +0 -110
  171. package/dist/esm/ez-text-input.entry.js +0 -197
  172. package/dist/esm/ez-time-input.entry.js +0 -114
  173. package/dist/esm/ez-toast.entry.js +0 -40
  174. package/dist/esm/ez-upload.entry.js +0 -352
  175. package/dist/esm/index-35088a3f.js +0 -1740
  176. package/dist/esm/test-du.entry.js +0 -72
  177. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +0 -67
  178. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +0 -3
  179. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +0 -180
  180. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +0 -319
  181. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +0 -327
  182. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -162
  183. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -217
  184. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +0 -49
  185. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -44
  186. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +0 -527
  187. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +0 -5
  188. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +0 -31
  189. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +0 -129
  190. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +0 -10
  191. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +0 -176
  192. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +0 -139
  193. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +0 -335
  194. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +0 -358
  195. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +0 -4
  196. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +0 -44
  197. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +0 -405
  198. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +0 -3
  199. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -138
  200. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +0 -165
  201. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +0 -196
  202. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +0 -10
  203. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +0 -127
  204. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +0 -568
  205. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +0 -3
  206. package/dist/sankhyablocks/p-0183d259.entry.js +0 -1
  207. package/dist/sankhyablocks/p-01f23a70.entry.js +0 -1
  208. package/dist/sankhyablocks/p-07c32f68.entry.js +0 -1
  209. package/dist/sankhyablocks/p-0f90499d.entry.js +0 -1
  210. package/dist/sankhyablocks/p-105724a3.entry.js +0 -1
  211. package/dist/sankhyablocks/p-112455b1.js +0 -1
  212. package/dist/sankhyablocks/p-2ac02d48.entry.js +0 -1
  213. package/dist/sankhyablocks/p-35364a97.entry.js +0 -1
  214. package/dist/sankhyablocks/p-3f6aa9a7.entry.js +0 -1
  215. package/dist/sankhyablocks/p-4811bc0a.entry.js +0 -369
  216. package/dist/sankhyablocks/p-5f9af495.entry.js +0 -1
  217. package/dist/sankhyablocks/p-60967cf0.js +0 -1
  218. package/dist/sankhyablocks/p-70ad6c16.entry.js +0 -1
  219. package/dist/sankhyablocks/p-710bfffe.entry.js +0 -1
  220. package/dist/sankhyablocks/p-73397a0f.entry.js +0 -57
  221. package/dist/sankhyablocks/p-811b4b9d.js +0 -1
  222. package/dist/sankhyablocks/p-813fe4f7.js +0 -1
  223. package/dist/sankhyablocks/p-85a9446b.js +0 -2
  224. package/dist/sankhyablocks/p-89a1100f.entry.js +0 -1
  225. package/dist/sankhyablocks/p-8b543003.entry.js +0 -1
  226. package/dist/sankhyablocks/p-9750632b.entry.js +0 -1
  227. package/dist/sankhyablocks/p-a96272f7.entry.js +0 -1
  228. package/dist/sankhyablocks/p-ac8842e5.entry.js +0 -1
  229. package/dist/sankhyablocks/p-ba64cc41.entry.js +0 -1
  230. package/dist/sankhyablocks/p-c1ede043.entry.js +0 -1
  231. package/dist/sankhyablocks/p-d90ebb85.entry.js +0 -1
  232. package/dist/sankhyablocks/p-e5355a29.entry.js +0 -1
  233. package/dist/sankhyablocks/p-ef04b633.entry.js +0 -1
  234. package/dist/sankhyablocks/p-f6db07fb.entry.js +0 -1
  235. package/dist/sankhyablocks/p-f80cabc7.entry.js +0 -1
  236. package/dist/sankhyablocks/p-fcd9bd92.entry.js +0 -1
@@ -1,94 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
-
3
- const ezCheckCss = ":host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--text--secondary, #a2abb9);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(-2px) translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}";
4
-
5
- const EzCheck = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- this.ezChange = createEvent(this, "ezChange", 7);
11
- /**
12
- * Deixa o campo disponível ou não para interação com o usuário.
13
- */
14
- this.enabled = true;
15
- /**
16
- * Existem dois modos de visualização: regular e switch.
17
- * Se esta propriedade for omitida, o componete assume o formato "regular".
18
- * No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
19
- * No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
20
- */
21
- this.mode = "regular";
22
- }
23
- adjustMode() {
24
- if (this.mode === "switch") {
25
- this._inputElem.classList.remove("regularMode");
26
- this._inputElem.classList.add("switchMode");
27
- }
28
- else {
29
- this._inputElem.classList.remove("switchMode");
30
- this._inputElem.classList.add("regularMode");
31
- }
32
- }
33
- //---------------------------------------------
34
- // Public methods
35
- //---------------------------------------------
36
- /**
37
- * Devolve o modo escolhido para o componente
38
- */
39
- async getMode() {
40
- return this.mode;
41
- }
42
- /**
43
- * Faz o foco no componente de input
44
- */
45
- async setFocus() {
46
- this._inputElem.focus();
47
- }
48
- componentDidLoad() {
49
- this.adjustMode();
50
- }
51
- changeValue() {
52
- if (!this.enabled) {
53
- return;
54
- }
55
- this.value = !this.value;
56
- this.ezChange.emit(this.value);
57
- }
58
- getLabelClasses() {
59
- let classes = "label";
60
- if (!this.enabled) {
61
- classes += " label--disabled";
62
- }
63
- return classes;
64
- }
65
- render() {
66
- return (h(Host, null, h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
67
- }
68
- static get watchers() { return {
69
- "mode": ["adjustMode"]
70
- }; }
71
- static get style() { return ezCheckCss; }
72
- }, [1, "ez-check", {
73
- "label": [513],
74
- "value": [1540],
75
- "enabled": [516],
76
- "mode": [513],
77
- "getMode": [64],
78
- "setFocus": [64]
79
- }]);
80
- function defineCustomElement() {
81
- if (typeof customElements === "undefined") {
82
- return;
83
- }
84
- const components = ["ez-check"];
85
- components.forEach(tagName => { switch (tagName) {
86
- case "ez-check":
87
- if (!customElements.get(tagName)) {
88
- customElements.define(tagName, EzCheck);
89
- }
90
- break;
91
- } });
92
- }
93
-
94
- export { EzCheck as E, defineCustomElement as d };
@@ -1,67 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
-
3
- const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--height:42px;--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--ez-collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--ez-collapsible-box__btn--image--medium:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--ez-collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--ez-collapsible-box__btn--fill:var(--ez-collapsible-box--color);--ez-collapsible-box__btn--width:10px;--ez-collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--ez-collapsible-box__btn--fill);width:var(--ez-collapsible-box__btn--width);height:var(--ez-collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xsmall);mask-image:var(--ez-collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--small);mask-image:var(--ez-collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--medium);mask-image:var(--ez-collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--large);mask-image:var(--ez-collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xlarge);mask-image:var(--ez-collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
4
-
5
- const EzCollapsibleBox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- this.ezChange = createEvent(this, "ezChange", 7);
11
- /**
12
- * Valor externalizado que garante a exibição ou não do componente
13
- */
14
- this.value = false;
15
- /**
16
- * Define o tamanho do texto e do ícone do componente.
17
- */
18
- this.headerSize = "small";
19
- /**
20
- * Define o local onde o ícone será renderizado.
21
- */
22
- this.iconPlacement = "left";
23
- }
24
- observeValue() {
25
- this.ezChange.emit(this.value);
26
- }
27
- /**
28
- * Esconde ou revela o conteúdo do componente
29
- */
30
- async showHide() {
31
- this.value = !this.value;
32
- }
33
- render() {
34
- return (h(Host, null, this.iconPlacement == "right" ?
35
- h("div", { class: "collapsible-box__title" }, h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label), h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }))
36
- :
37
- h("div", { class: "collapsible-box__title" }, h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }), h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label)), !this.value ? h("slot", null) : null));
38
- }
39
- static get watchers() { return {
40
- "value": ["observeValue"]
41
- }; }
42
- static get style() { return ezCollapsibleBoxCss; }
43
- }, [1, "ez-collapsible-box", {
44
- "value": [1540],
45
- "label": [513],
46
- "headerSize": [513, "header-size"],
47
- "iconPlacement": [513, "icon-placement"],
48
- "showHide": [64]
49
- }]);
50
- function defineCustomElement$1() {
51
- if (typeof customElements === "undefined") {
52
- return;
53
- }
54
- const components = ["ez-collapsible-box"];
55
- components.forEach(tagName => { switch (tagName) {
56
- case "ez-collapsible-box":
57
- if (!customElements.get(tagName)) {
58
- customElements.define(tagName, EzCollapsibleBox$1);
59
- }
60
- break;
61
- } });
62
- }
63
-
64
- const EzCollapsibleBox = EzCollapsibleBox$1;
65
- const defineCustomElement = defineCustomElement$1;
66
-
67
- export { EzCollapsibleBox, defineCustomElement };
@@ -1,6 +0,0 @@
1
- import { E as EzComboBox$1, d as defineCustomElement$1 } from './ez-combo-box2.js';
2
-
3
- const EzComboBox = EzComboBox$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { EzComboBox, defineCustomElement };
@@ -1,311 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { FloatingManager } from '@sankhyalabs/core';
3
- import { C as CSSVarsUtils } from './CSSVarsUtils.js';
4
- import { d as defineCustomElement$1 } from './ez-text-input2.js';
5
-
6
- const ezComboBoxCss = ":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box__drop-down-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--ez-combo-box__search-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:'';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}";
7
-
8
- const EzComboBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
- constructor() {
10
- super();
11
- this.__registerHost();
12
- this.__attachShadow();
13
- this.ezChange = createEvent(this, "ezChange", 7);
14
- /**
15
- * Deixa o campo disponível ou não para interação com usuário.
16
- */
17
- this.enabled = true;
18
- /**
19
- * Ajusta a opção de mostrar o "value" ao selecionar uma opção. Por padrão não mostra.
20
- */
21
- this.showSelectedValue = false;
22
- /**
23
- * Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
24
- */
25
- this.showOptionValue = false;
26
- /**
27
- * Remove a opção vazia da lista de opções
28
- */
29
- this.suppressEmptyOption = false;
30
- /**
31
- * Permite exibir a mensagem de erro.
32
- */
33
- this.canShowError = true;
34
- }
35
- internalUpdate() {
36
- if (this._inputElement) {
37
- this._inputElement.value = this.getText();
38
- }
39
- this.hideOptions();
40
- this._criteria = undefined;
41
- this._preSelection = undefined;
42
- this.updateVisibleOptions();
43
- }
44
- /**
45
- * Realiza o foco no componente de seleção
46
- */
47
- async setFocus() {
48
- this._inputElement.setFocus();
49
- }
50
- /**
51
- * Remove o foco no componente de seleção
52
- */
53
- async setBlur() {
54
- this._inputElement.setBlur();
55
- }
56
- getText() {
57
- let text = "";
58
- const selected = this.getSelectedOption();
59
- if (selected) {
60
- text = this.showSelectedValue ? `${selected.value} - ${selected.label}` : selected.label;
61
- }
62
- return text;
63
- }
64
- getSelectedOption() {
65
- if (typeof this.value === "string" || this.value instanceof String) {
66
- return this._visibleOptions.find(o => o.value === this.value);
67
- }
68
- return this.value;
69
- }
70
- updateVisibleOptions() {
71
- let opts = this._source || [];
72
- if (!this.searchMode && this._criteria) {
73
- const upperCriteria = this._criteria.toUpperCase();
74
- opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
75
- }
76
- if (this.suppressEmptyOption) {
77
- this._visibleOptions = opts;
78
- }
79
- else {
80
- this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
81
- }
82
- }
83
- buildItem(opt, index) {
84
- return h("li", { class: index === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined }, h("span", { class: "item--label", title: opt.label }, opt.label), this.showOptionValue ? h("span", { class: "item--value", title: opt.value }, opt.value) : undefined);
85
- }
86
- showOptions() {
87
- if (!this.enabled) {
88
- return;
89
- }
90
- //FIXME: Provavelmente isso fará com que o popup abra em uma
91
- //posição errada no futuro. Preferi fazer simples no começo,
92
- //porque não quis onerar o text input com essa funcionalidade...
93
- const top = (this.errorMessage || !this.canShowError) ? "0px" : "-17px";
94
- this._floatingID = FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
95
- window.requestAnimationFrame(() => {
96
- this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
97
- });
98
- }
99
- hideOptions() {
100
- if (this._floatingID !== undefined) {
101
- FloatingManager.close(this._floatingID);
102
- }
103
- this._floatingID = undefined;
104
- }
105
- isOptionsVisible() {
106
- return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
107
- }
108
- nextOption() {
109
- if (this.searchMode && !this.isOptionsVisible()) {
110
- return;
111
- }
112
- this.showOptions();
113
- this._preSelection = this._preSelection === undefined ? 0 : Math.min(this._preSelection + 1, this._visibleOptions.length - 1);
114
- this.scrollToOption(this._visibleOptions[this._preSelection], true);
115
- }
116
- previousOption() {
117
- this._preSelection = this._preSelection === undefined ? 0 : Math.max(this._preSelection - 1, 0);
118
- this.scrollToOption(this._visibleOptions[this._preSelection], false);
119
- }
120
- scrollToOption(opt, down) {
121
- window.requestAnimationFrame(() => {
122
- const liElem = this._optionsList.querySelector(`li#item_${opt.value}`);
123
- if (liElem) {
124
- const parent = liElem.parentElement;
125
- const parentRect = parent.getBoundingClientRect();
126
- const itemRect = liElem.getBoundingClientRect();
127
- if (down && itemRect.bottom > parentRect.bottom) {
128
- parent.scrollTop = itemRect.top;
129
- }
130
- else if (!down && itemRect.top < parentRect.top) {
131
- parent.scrollTop = 0;
132
- }
133
- }
134
- });
135
- }
136
- selectCurrentOption() {
137
- if (this._preSelection !== undefined) {
138
- this.selectOption(this._visibleOptions[this._preSelection]);
139
- this._preSelection = undefined;
140
- }
141
- }
142
- selectOption(opt) {
143
- const currentOpt = this.getSelectedOption();
144
- if (currentOpt !== opt) {
145
- const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
146
- this.value = adjustedOpt;
147
- this.errorMessage = "";
148
- this.ezChange.emit(adjustedOpt);
149
- }
150
- else {
151
- this.internalUpdate();
152
- }
153
- }
154
- updateSource(source) {
155
- if (source instanceof Promise) {
156
- source.then(result => this.updateSource(result));
157
- this.updateVisibleOptions();
158
- }
159
- else {
160
- this._source = source;
161
- this.updateVisibleOptions();
162
- }
163
- }
164
- loadOptions(mode, argument = "") {
165
- this._criteria = argument;
166
- if (this.optionLoader) {
167
- this.updateSource(this.optionLoader({ mode, argument }));
168
- }
169
- else {
170
- this.updateSource(this.options);
171
- }
172
- }
173
- cancelPreselection() {
174
- if (!this._inputElement.value && this.value) {
175
- this.selectOption(undefined);
176
- }
177
- else {
178
- this.internalUpdate();
179
- }
180
- }
181
- //---------------------------------------------
182
- // Lifecycle web component
183
- //---------------------------------------------
184
- componentWillLoad() {
185
- if (this.options === undefined) {
186
- this.options = [];
187
- const optionsTags = this.el.querySelectorAll("option");
188
- if (optionsTags) {
189
- optionsTags.forEach(e => {
190
- let label = e.innerText;
191
- let value = e.getAttribute("value");
192
- if (!value) {
193
- value = label;
194
- }
195
- this.options.push({ label, value });
196
- e.hidden = true;
197
- });
198
- }
199
- }
200
- if (this.searchMode) {
201
- this.updateSource([]);
202
- }
203
- else {
204
- this.loadOptions("PRELOAD");
205
- }
206
- }
207
- componentDidRender() {
208
- if (this._floatingID === undefined) {
209
- this._optionsList.remove();
210
- }
211
- }
212
- componentDidLoad() {
213
- CSSVarsUtils.applyVarsTextInput(this.el, this._inputElement);
214
- }
215
- //---------------------------------------------
216
- // Event handlers
217
- //---------------------------------------------
218
- onTextInputChangeHandler(event) {
219
- if (!this._criteria) {
220
- this._inputElement.value = event.data;
221
- }
222
- const argument = event.target.value;
223
- this._criteria = argument;
224
- if (this._criteria) {
225
- if (this.searchMode) {
226
- if (this._changeDeboucingTimeout) {
227
- window.clearTimeout(this._changeDeboucingTimeout);
228
- }
229
- this._changeDeboucingTimeout = window.setTimeout(() => {
230
- this.loadOptions("PREDICTIVE", argument);
231
- }, 200);
232
- }
233
- else {
234
- this.updateVisibleOptions();
235
- }
236
- this.showOptions();
237
- }
238
- }
239
- onTextInputClickHandler() {
240
- if (!this.searchMode) {
241
- this.showOptions();
242
- }
243
- }
244
- keyDownHandler(event) {
245
- switch (event.key) {
246
- case "ArrowDown":
247
- this.nextOption();
248
- break;
249
- case "ArrowUp":
250
- this.previousOption();
251
- break;
252
- case "Enter":
253
- this.selectCurrentOption();
254
- break;
255
- case "Escape":
256
- this.cancelPreselection();
257
- break;
258
- }
259
- event.stopPropagation();
260
- }
261
- onTextInputFocusOutHandler() {
262
- this.cancelPreselection();
263
- }
264
- render() {
265
- return (h(Host, null, h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage }, this.searchMode ?
266
- h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
267
- :
268
- h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "options-list", ref: elem => this._optionsList = elem }, this._visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
269
- }
270
- get el() { return this; }
271
- static get watchers() { return {
272
- "value": ["internalUpdate"]
273
- }; }
274
- static get style() { return ezComboBoxCss; }
275
- }, [1, "ez-combo-box", {
276
- "value": [1537],
277
- "label": [513],
278
- "enabled": [516],
279
- "options": [1040],
280
- "errorMessage": [1537, "error-message"],
281
- "searchMode": [4, "search-mode"],
282
- "showSelectedValue": [4, "show-selected-value"],
283
- "showOptionValue": [4, "show-option-value"],
284
- "optionLoader": [16],
285
- "suppressEmptyOption": [4, "suppress-empty-option"],
286
- "canShowError": [516, "can-show-error"],
287
- "_preSelection": [32],
288
- "_visibleOptions": [32],
289
- "setFocus": [64],
290
- "setBlur": [64]
291
- }]);
292
- function defineCustomElement() {
293
- if (typeof customElements === "undefined") {
294
- return;
295
- }
296
- const components = ["ez-combo-box", "ez-text-input"];
297
- components.forEach(tagName => { switch (tagName) {
298
- case "ez-combo-box":
299
- if (!customElements.get(tagName)) {
300
- customElements.define(tagName, EzComboBox);
301
- }
302
- break;
303
- case "ez-text-input":
304
- if (!customElements.get(tagName)) {
305
- defineCustomElement$1();
306
- }
307
- break;
308
- } });
309
- }
310
-
311
- export { EzComboBox as E, defineCustomElement as d };
@@ -1,135 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { DateUtils } from '@sankhyalabs/core';
3
- import { C as CSSVarsUtils } from './CSSVarsUtils.js';
4
- import { d as defineCustomElement$3 } from './ez-calendar2.js';
5
- import { d as defineCustomElement$2 } from './ez-text-input2.js';
6
-
7
- 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)}";
8
-
9
- const EzDateInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
- constructor() {
11
- super();
12
- this.__registerHost();
13
- this.__attachShadow();
14
- this.ezChange = createEvent(this, "ezChange", 7);
15
- /**
16
- * Deixa o campo disponível ou não para uso.
17
- */
18
- this.enabled = true;
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 data
33
- */
34
- async setFocus() {
35
- this._textInput.setFocus();
36
- }
37
- /**
38
- * Remove o foco no componente de data
39
- */
40
- async setBlur() {
41
- this._textInput.setBlur();
42
- }
43
- changeValue(newValue) {
44
- var _a;
45
- newValue = newValue instanceof Date ? DateUtils.clearTime(newValue) : null;
46
- this.value = this.value instanceof Date ? DateUtils.clearTime(this.value) : null;
47
- this._textInput.errorMessage = "";
48
- if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
49
- this.value = newValue;
50
- this.ezChange.emit(this.value);
51
- }
52
- }
53
- showCalendar() {
54
- this.parseDate();
55
- this._calendar.value = this.value;
56
- //FIXME: Provavelmente isso fará com que o popup abra em uma
57
- //posição errada no futuro. Preferi fazer simples no começo,
58
- //porque não quis onerar o text input com essa funcionalidade...
59
- const top = this._textInput.errorMessage ? 0 : -17;
60
- this._calendar.fitVertical(top, this._elem.clientHeight);
61
- }
62
- hideCalendar() {
63
- this.changeValue(this._calendar.value);
64
- this._calendar.hide();
65
- }
66
- parseDate() {
67
- const strValue = this._textInput.value;
68
- const parsedDate = DateUtils.strToDate(strValue);
69
- if (parsedDate || !strValue) {
70
- if (this.value === parsedDate) {
71
- this.changeValue(this.value);
72
- }
73
- else {
74
- this.changeValue(parsedDate);
75
- }
76
- }
77
- else {
78
- this._textInput.errorMessage = "O valor digitado não é uma data válida";
79
- }
80
- }
81
- getTextValue(d) {
82
- return d ? new Intl.DateTimeFormat("pt-BR").format(d) : null;
83
- }
84
- componentDidLoad() {
85
- CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
86
- }
87
- render() {
88
- return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
89
- if (event.key === "H" || event.key === "h")
90
- this.changeValue(new Date());
91
- }, 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 })));
92
- }
93
- get _elem() { return this; }
94
- static get watchers() { return {
95
- "label": ["setLabel"],
96
- "errorMessage": ["setErrorMessage"],
97
- "value": ["applyValueToInput"]
98
- }; }
99
- static get style() { return ezDateInputCss; }
100
- }, [1, "ez-date-input", {
101
- "label": [513],
102
- "value": [1040],
103
- "enabled": [516],
104
- "errorMessage": [1537, "error-message"],
105
- "setFocus": [64],
106
- "setBlur": [64]
107
- }]);
108
- function defineCustomElement$1() {
109
- if (typeof customElements === "undefined") {
110
- return;
111
- }
112
- const components = ["ez-date-input", "ez-calendar", "ez-text-input"];
113
- components.forEach(tagName => { switch (tagName) {
114
- case "ez-date-input":
115
- if (!customElements.get(tagName)) {
116
- customElements.define(tagName, EzDateInput$1);
117
- }
118
- break;
119
- case "ez-calendar":
120
- if (!customElements.get(tagName)) {
121
- defineCustomElement$3();
122
- }
123
- break;
124
- case "ez-text-input":
125
- if (!customElements.get(tagName)) {
126
- defineCustomElement$2();
127
- }
128
- break;
129
- } });
130
- }
131
-
132
- const EzDateInput = EzDateInput$1;
133
- const defineCustomElement = defineCustomElement$1;
134
-
135
- export { EzDateInput, defineCustomElement };