@sankhyalabs/sankhyablocks 1.1.28 → 1.2.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 (254) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +75 -75
  3. package/package.json +94 -52
  4. package/react/.keepfolder +1 -0
  5. package/dist/cjs/ApplicationUtils-05b74ee9.js +0 -39
  6. package/dist/cjs/AssetsUtils-7e3c38f9.js +0 -24
  7. package/dist/cjs/CSSVarsUtils-75ca9c64.js +0 -19
  8. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  9. package/dist/cjs/ez-action-chip.cjs.entry.js +0 -27
  10. package/dist/cjs/ez-application.cjs.entry.js +0 -26
  11. package/dist/cjs/ez-button_4.cjs.entry.js +0 -660
  12. package/dist/cjs/ez-calendar.cjs.entry.js +0 -223
  13. package/dist/cjs/ez-collapsible-box.cjs.entry.js +0 -47
  14. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -278
  15. package/dist/cjs/ez-date-input.cjs.entry.js +0 -102
  16. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -145
  17. package/dist/cjs/ez-dialog.cjs.entry.js +0 -89
  18. package/dist/cjs/ez-form.cjs.entry.js +0 -785
  19. package/dist/cjs/ez-grid.cjs.entry.js +0 -110485
  20. package/dist/cjs/ez-icon.cjs.entry.js +0 -41
  21. package/dist/cjs/ez-label-chip.cjs.entry.js +0 -104
  22. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -316
  23. package/dist/cjs/ez-number-input.cjs.entry.js +0 -86
  24. package/dist/cjs/ez-popover.cjs.entry.js +0 -120
  25. package/dist/cjs/ez-popup.cjs.entry.js +0 -48
  26. package/dist/cjs/ez-search.cjs.entry.js +0 -64
  27. package/dist/cjs/ez-tabselector.cjs.entry.js +0 -198
  28. package/dist/cjs/ez-text-area.cjs.entry.js +0 -114
  29. package/dist/cjs/ez-text-input.cjs.entry.js +0 -201
  30. package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
  31. package/dist/cjs/ez-toast.cjs.entry.js +0 -44
  32. package/dist/cjs/ez-upload.cjs.entry.js +0 -356
  33. package/dist/cjs/index-682c98b2.js +0 -1771
  34. package/dist/cjs/index.cjs.js +0 -2
  35. package/dist/cjs/loader.cjs.js +0 -21
  36. package/dist/cjs/sankhyablocks.cjs.js +0 -19
  37. package/dist/cjs/snk-application.cjs.entry.js +0 -7050
  38. package/dist/cjs/test-du.cjs.entry.js +0 -76
  39. package/dist/collection/collection-manifest.json +0 -47
  40. package/dist/collection/components/snk-application/snk-application.css +0 -5
  41. package/dist/collection/components/snk-application/snk-application.js +0 -492
  42. package/dist/collection/index.js +0 -1
  43. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +0 -158
  44. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js +0 -23
  45. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +0 -188
  46. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +0 -25
  47. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +0 -2
  48. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +0 -59
  49. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +0 -30
  50. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js +0 -66
  51. package/dist/collection/lib/utils/pesquisa.js +0 -16
  52. package/dist/collection/lib/utils/urlutils.js +0 -23
  53. package/dist/collection/lib/workspace/workspace.js +0 -7
  54. package/dist/components/ApplicationUtils.js +0 -37
  55. package/dist/components/AssetsUtils.js +0 -22
  56. package/dist/components/CSSVarsUtils.js +0 -17
  57. package/dist/components/_commonjsHelpers.js +0 -17
  58. package/dist/components/ez-action-chip.js +0 -44
  59. package/dist/components/ez-application.js +0 -39
  60. package/dist/components/ez-button.js +0 -6
  61. package/dist/components/ez-button2.js +0 -105
  62. package/dist/components/ez-calendar.js +0 -6
  63. package/dist/components/ez-calendar2.js +0 -242
  64. package/dist/components/ez-check.js +0 -6
  65. package/dist/components/ez-check2.js +0 -94
  66. package/dist/components/ez-collapsible-box.js +0 -67
  67. package/dist/components/ez-combo-box.js +0 -6
  68. package/dist/components/ez-combo-box2.js +0 -311
  69. package/dist/components/ez-date-input.js +0 -135
  70. package/dist/components/ez-date-time-input.js +0 -179
  71. package/dist/components/ez-dialog.js +0 -124
  72. package/dist/components/ez-form.js +0 -6
  73. package/dist/components/ez-form2.js +0 -807
  74. package/dist/components/ez-grid.js +0 -110576
  75. package/dist/components/ez-icon.js +0 -6
  76. package/dist/components/ez-icon2.js +0 -56
  77. package/dist/components/ez-label-chip.js +0 -125
  78. package/dist/components/ez-list.js +0 -6
  79. package/dist/components/ez-list2.js +0 -523
  80. package/dist/components/ez-modal.js +0 -6
  81. package/dist/components/ez-modal2.js +0 -82
  82. package/dist/components/ez-number-input.js +0 -115
  83. package/dist/components/ez-popover.js +0 -145
  84. package/dist/components/ez-popup.js +0 -67
  85. package/dist/components/ez-search.js +0 -100
  86. package/dist/components/ez-tabselector.js +0 -6
  87. package/dist/components/ez-tabselector2.js +0 -213
  88. package/dist/components/ez-text-area.js +0 -137
  89. package/dist/components/ez-text-input.js +0 -6
  90. package/dist/components/ez-text-input2.js +0 -223
  91. package/dist/components/ez-time-input.js +0 -153
  92. package/dist/components/ez-toast.js +0 -64
  93. package/dist/components/ez-upload.js +0 -382
  94. package/dist/components/grid-config.js +0 -6
  95. package/dist/components/grid-config2.js +0 -318
  96. package/dist/components/index.d.ts +0 -26
  97. package/dist/components/index.js +0 -1
  98. package/dist/components/select-box.js +0 -6
  99. package/dist/components/select-box2.js +0 -47
  100. package/dist/components/snk-application.d.ts +0 -11
  101. package/dist/components/snk-application.js +0 -7079
  102. package/dist/components/test-du.js +0 -101
  103. package/dist/esm/ApplicationUtils-e0b6d857.js +0 -37
  104. package/dist/esm/AssetsUtils-6e6624dc.js +0 -22
  105. package/dist/esm/CSSVarsUtils-0787c3f3.js +0 -17
  106. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  107. package/dist/esm/ez-action-chip.entry.js +0 -23
  108. package/dist/esm/ez-application.entry.js +0 -22
  109. package/dist/esm/ez-button_4.entry.js +0 -653
  110. package/dist/esm/ez-calendar.entry.js +0 -219
  111. package/dist/esm/ez-collapsible-box.entry.js +0 -43
  112. package/dist/esm/ez-combo-box.entry.js +0 -274
  113. package/dist/esm/ez-date-input.entry.js +0 -98
  114. package/dist/esm/ez-date-time-input.entry.js +0 -141
  115. package/dist/esm/ez-dialog.entry.js +0 -85
  116. package/dist/esm/ez-form.entry.js +0 -781
  117. package/dist/esm/ez-grid.entry.js +0 -110481
  118. package/dist/esm/ez-icon.entry.js +0 -37
  119. package/dist/esm/ez-label-chip.entry.js +0 -100
  120. package/dist/esm/ez-modal_2.entry.js +0 -311
  121. package/dist/esm/ez-number-input.entry.js +0 -82
  122. package/dist/esm/ez-popover.entry.js +0 -116
  123. package/dist/esm/ez-popup.entry.js +0 -44
  124. package/dist/esm/ez-search.entry.js +0 -60
  125. package/dist/esm/ez-tabselector.entry.js +0 -194
  126. package/dist/esm/ez-text-area.entry.js +0 -110
  127. package/dist/esm/ez-text-input.entry.js +0 -197
  128. package/dist/esm/ez-time-input.entry.js +0 -114
  129. package/dist/esm/ez-toast.entry.js +0 -40
  130. package/dist/esm/ez-upload.entry.js +0 -352
  131. package/dist/esm/index-35088a3f.js +0 -1740
  132. package/dist/esm/index.js +0 -1
  133. package/dist/esm/loader.js +0 -17
  134. package/dist/esm/polyfills/core-js.js +0 -11
  135. package/dist/esm/polyfills/css-shim.js +0 -1
  136. package/dist/esm/polyfills/dom.js +0 -79
  137. package/dist/esm/polyfills/es5-html-element.js +0 -1
  138. package/dist/esm/polyfills/index.js +0 -34
  139. package/dist/esm/polyfills/system.js +0 -6
  140. package/dist/esm/sankhyablocks.js +0 -17
  141. package/dist/esm/snk-application.entry.js +0 -7046
  142. package/dist/esm/test-du.entry.js +0 -72
  143. package/dist/index.cjs.js +0 -1
  144. package/dist/index.js +0 -1
  145. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +0 -67
  146. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +0 -3
  147. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +0 -180
  148. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +0 -319
  149. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +0 -327
  150. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -162
  151. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -217
  152. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +0 -49
  153. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -44
  154. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +0 -527
  155. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +0 -5
  156. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +0 -31
  157. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +0 -129
  158. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +0 -10
  159. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +0 -176
  160. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +0 -139
  161. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +0 -335
  162. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +0 -358
  163. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +0 -4
  164. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +0 -44
  165. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +0 -405
  166. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +0 -3
  167. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -138
  168. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +0 -165
  169. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +0 -196
  170. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +0 -10
  171. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +0 -127
  172. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +0 -568
  173. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +0 -3
  174. package/dist/sankhyablocks/index.esm.js +0 -0
  175. package/dist/sankhyablocks/p-0183d259.entry.js +0 -1
  176. package/dist/sankhyablocks/p-01f23a70.entry.js +0 -1
  177. package/dist/sankhyablocks/p-07c32f68.entry.js +0 -1
  178. package/dist/sankhyablocks/p-0f90499d.entry.js +0 -1
  179. package/dist/sankhyablocks/p-105724a3.entry.js +0 -1
  180. package/dist/sankhyablocks/p-112455b1.js +0 -1
  181. package/dist/sankhyablocks/p-2ac02d48.entry.js +0 -1
  182. package/dist/sankhyablocks/p-35364a97.entry.js +0 -1
  183. package/dist/sankhyablocks/p-3f6aa9a7.entry.js +0 -1
  184. package/dist/sankhyablocks/p-4811bc0a.entry.js +0 -369
  185. package/dist/sankhyablocks/p-5f9af495.entry.js +0 -1
  186. package/dist/sankhyablocks/p-60967cf0.js +0 -1
  187. package/dist/sankhyablocks/p-70ad6c16.entry.js +0 -1
  188. package/dist/sankhyablocks/p-710bfffe.entry.js +0 -1
  189. package/dist/sankhyablocks/p-73397a0f.entry.js +0 -57
  190. package/dist/sankhyablocks/p-811b4b9d.js +0 -1
  191. package/dist/sankhyablocks/p-813fe4f7.js +0 -1
  192. package/dist/sankhyablocks/p-85a9446b.js +0 -2
  193. package/dist/sankhyablocks/p-89a1100f.entry.js +0 -1
  194. package/dist/sankhyablocks/p-8b543003.entry.js +0 -1
  195. package/dist/sankhyablocks/p-9750632b.entry.js +0 -1
  196. package/dist/sankhyablocks/p-a96272f7.entry.js +0 -1
  197. package/dist/sankhyablocks/p-ac8842e5.entry.js +0 -1
  198. package/dist/sankhyablocks/p-ba64cc41.entry.js +0 -1
  199. package/dist/sankhyablocks/p-c1ede043.entry.js +0 -1
  200. package/dist/sankhyablocks/p-d90ebb85.entry.js +0 -1
  201. package/dist/sankhyablocks/p-e5355a29.entry.js +0 -1
  202. package/dist/sankhyablocks/p-ef04b633.entry.js +0 -1
  203. package/dist/sankhyablocks/p-f6db07fb.entry.js +0 -1
  204. package/dist/sankhyablocks/p-f80cabc7.entry.js +0 -1
  205. package/dist/sankhyablocks/p-fcd9bd92.entry.js +0 -1
  206. package/dist/sankhyablocks/sankhyablocks.esm.js +0 -1
  207. package/dist/types/components/snk-application/snk-application.d.ts +0 -44
  208. package/dist/types/components.d.ts +0 -66
  209. package/dist/types/index.d.ts +0 -1
  210. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -15
  211. package/dist/types/lib/http/data-fetcher/fetchers/application-config-fetcher.d.ts +0 -6
  212. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +0 -12
  213. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +0 -5
  214. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +0 -2
  215. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +0 -13
  216. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +0 -6
  217. package/dist/types/lib/http/data-fetcher/state/LoadStateManager.d.ts +0 -23
  218. package/dist/types/lib/utils/pesquisa.d.ts +0 -2
  219. package/dist/types/lib/utils/urlutils.d.ts +0 -4
  220. package/dist/types/lib/workspace/workspace.d.ts +0 -4
  221. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  222. package/loader/cdn.js +0 -3
  223. package/loader/index.cjs.js +0 -3
  224. package/loader/index.d.ts +0 -12
  225. package/loader/index.es2017.js +0 -3
  226. package/loader/index.js +0 -4
  227. package/loader/package.json +0 -10
  228. package/react/components.d.ts +0 -32
  229. package/react/components.js +0 -35
  230. package/react/components.js.map +0 -1
  231. package/react/react-component-lib/createComponent.d.ts +0 -10
  232. package/react/react-component-lib/createComponent.js +0 -75
  233. package/react/react-component-lib/createComponent.js.map +0 -1
  234. package/react/react-component-lib/createOverlayComponent.d.ts +0 -21
  235. package/react/react-component-lib/createOverlayComponent.js +0 -109
  236. package/react/react-component-lib/createOverlayComponent.js.map +0 -1
  237. package/react/react-component-lib/index.d.ts +0 -2
  238. package/react/react-component-lib/index.js +0 -3
  239. package/react/react-component-lib/index.js.map +0 -1
  240. package/react/react-component-lib/interfaces.d.ts +0 -29
  241. package/react/react-component-lib/interfaces.js +0 -1
  242. package/react/react-component-lib/interfaces.js.map +0 -1
  243. package/react/react-component-lib/utils/attachProps.d.ts +0 -12
  244. package/react/react-component-lib/utils/attachProps.js +0 -98
  245. package/react/react-component-lib/utils/attachProps.js.map +0 -1
  246. package/react/react-component-lib/utils/case.d.ts +0 -2
  247. package/react/react-component-lib/utils/case.js +0 -7
  248. package/react/react-component-lib/utils/case.js.map +0 -1
  249. package/react/react-component-lib/utils/dev.d.ts +0 -2
  250. package/react/react-component-lib/utils/dev.js +0 -13
  251. package/react/react-component-lib/utils/dev.js.map +0 -1
  252. package/react/react-component-lib/utils/index.d.ts +0 -10
  253. package/react/react-component-lib/utils/index.js +0 -34
  254. package/react/react-component-lib/utils/index.js.map +0 -1
@@ -1,120 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-682c98b2.js');
6
- const core = require('@sankhyalabs/core');
7
-
8
- const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";
9
-
10
- const EzPopover = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.ezVisibilityChange = index.createEvent(this, "ezVisibilityChange", 7);
14
- this._firstRender = true;
15
- /**
16
- * No modo floating = false o popover só se tornará visível
17
- * quando o método show() for acionado.
18
- */
19
- this.autoClose = true;
20
- /**
21
- * Offset top do popover em relação ao componente pai
22
- */
23
- this.top = "0px";
24
- /**
25
- * Offset left do popover em relação ao componente pai
26
- */
27
- this.left = "0px";
28
- /**
29
- * Offset bottom do popover em relação ao componente pai
30
- */
31
- this.bottom = "0px";
32
- /**
33
- * Offset right do popover em relação ao componente pai
34
- */
35
- this.right = "0px";
36
- /**
37
- * Ajusta o comportamento da largura do popover.
38
- * Opções: "100% e "fit-content" (default)
39
- */
40
- this.boxWidth = "fit-content";
41
- }
42
- dispatchVisibilityChange(newValue, oldValue) {
43
- if (newValue != oldValue) {
44
- this.ezVisibilityChange.emit(newValue);
45
- }
46
- }
47
- /**
48
- * Atualiza a posição do popover em relação ao componente pai.
49
- */
50
- async updatePosition(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
51
- const floatingOptions = {
52
- autoClose: this.autoClose,
53
- top,
54
- left,
55
- bottom,
56
- right,
57
- innerClickTest: (_container, node) => {
58
- if (_container.contains(node)) {
59
- return true;
60
- }
61
- if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
62
- return true;
63
- }
64
- _container = this._host;
65
- return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
66
- }
67
- };
68
- core.FloatingManager.updateFloatPosition(this._box, this._container, floatingOptions);
69
- }
70
- /**
71
- * Faz com que o popover seja renderizado na DOM.
72
- */
73
- async show(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
74
- const floatingOptions = {
75
- autoClose: this.autoClose,
76
- top,
77
- left,
78
- bottom,
79
- right,
80
- innerClickTest: (_container, node) => {
81
- if (_container.contains(node)) {
82
- return true;
83
- }
84
- if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
85
- return true;
86
- }
87
- _container = this._host;
88
- return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
89
- }
90
- };
91
- this._floatingID = core.FloatingManager.float(this._box, this._container, floatingOptions);
92
- this.opened = true;
93
- }
94
- /**
95
- * Usado no modo floating. Faz com que o componente seja ocultado.
96
- */
97
- async hide() {
98
- if (this._floatingID !== undefined) {
99
- core.FloatingManager.close(this._floatingID);
100
- this._floatingID = undefined;
101
- this.opened = false;
102
- }
103
- }
104
- componentDidRender() {
105
- if (this._firstRender) {
106
- this._box.remove();
107
- this._firstRender = false;
108
- }
109
- }
110
- render() {
111
- return (index.h(index.Host, null, index.h("section", { ref: el => this._container = el }, index.h("div", { class: `box ${this.boxWidth === "fit-content" ? "box--fit-content" : "box--full-width"}`, ref: el => this._box = el }, index.h("slot", null)))));
112
- }
113
- get _host() { return index.getElement(this); }
114
- static get watchers() { return {
115
- "opened": ["dispatchVisibilityChange"]
116
- }; }
117
- };
118
- EzPopover.style = ezPopoverCss;
119
-
120
- exports.ez_popover = EzPopover;
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-682c98b2.js');
6
-
7
- const ezPopupCss = ":host{display:flex;--ez-popup-z-index:var(--most-visible, 3);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, \"'Sora', 'Algerian'\");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:grid;grid-template-rows:auto 1fr}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;height:100%;width:100%}.popup__header{padding-bottom:var(--ez-popup__header--padding-bottom);width:100%;display:flex}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.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%}}";
8
-
9
- const EzPopup = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.ezClosePopup = index.createEvent(this, "ezClosePopup", 7);
13
- this.sizeClasses = {
14
- "x-small": "col--sd-3",
15
- "small": "col--sd-5",
16
- "medium": "col--sd-6",
17
- "large": "col--sd-9",
18
- "x-large": "col--sd-11"
19
- };
20
- /**
21
- * Define o width que o componente deve ter, seguindo o grid system. Os valores devem estar
22
- * compreendidos em [x-small | small | medium | large | x-large].
23
- */
24
- this.size = "medium";
25
- /**
26
- * Controla a exibição do componente.
27
- */
28
- this.opened = false;
29
- /**
30
- * Define se o componente utilizará um cabeçalho com botão de fechamento.
31
- */
32
- this.useHeader = false;
33
- }
34
- getGridSize() {
35
- return this.sizeClasses[this.size] || this.sizeClasses["medium"];
36
- }
37
- render() {
38
- if (this.opened) {
39
- return (index.h(index.Host, null, index.h("div", { class: "overlay" }, index.h("div", { class: "popup col " + this.getGridSize() }, index.h("div", { class: "popup__container" }, index.h("div", { class: "popup__content" }, index.h("div", { class: "popup__header" }, this.ezTitle ?
40
- index.h("div", { class: "popup__title" }, this.ezTitle)
41
- : undefined, index.h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } })), index.h("div", { class: "popup__expandable-content" }, index.h("slot", null))))))));
42
- }
43
- return null;
44
- }
45
- };
46
- EzPopup.style = ezPopupCss;
47
-
48
- exports.ez_popup = EzPopup;
@@ -1,64 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-682c98b2.js');
6
- const CSSVarsUtils = require('./CSSVarsUtils-75ca9c64.js');
7
-
8
- const ezSearchCss = ":host{width:100%}";
9
-
10
- const EzSearch = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.ezChange = index.createEvent(this, "ezChange", 7);
14
- this.showPopup = index.createEvent(this, "showPopup", 7);
15
- /**
16
- * Deixa o campo disponível ou não.
17
- */
18
- this.enabled = true;
19
- /**
20
- * Ajusta a opção de mostrar o "value" ao selecionar uma opção.
21
- */
22
- this.showSelectedValue = true;
23
- /**
24
- * Ajusta a opção de mostrar o "value" para cada opção.
25
- */
26
- this.showOptionValue = true;
27
- }
28
- updateValue() {
29
- if (this._comboElement) {
30
- this._comboElement.value = this.value;
31
- }
32
- }
33
- /**
34
- * Realiza o foco no componente de pesquisa
35
- */
36
- async setFocus() {
37
- this._comboElement.setFocus();
38
- }
39
- /**
40
- * Remove o foco no componente de pesquisa
41
- */
42
- async setBlur() {
43
- this._comboElement.setBlur();
44
- }
45
- onComboChange(evt) {
46
- evt.stopPropagation();
47
- this.value = evt.detail;
48
- this.ezChange.emit(evt.detail);
49
- }
50
- componentDidLoad() {
51
- CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
52
- }
53
- render() {
54
- return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
55
- }
56
- ;
57
- get _elem() { return index.getElement(this); }
58
- static get watchers() { return {
59
- "value": ["updateValue"]
60
- }; }
61
- };
62
- EzSearch.style = ezSearchCss;
63
-
64
- exports.ez_search = EzSearch;
@@ -1,198 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-682c98b2.js');
6
-
7
- const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon: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>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.midle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Sora, Algerian\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}";
8
-
9
- const EzTabselector = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.ezChange = index.createEvent(this, "ezChange", 7);
13
- this.setFocusedParam = (ev) => {
14
- if (ev.key === "Enter") {
15
- const selectedTab = this._processedTabs[this._focusedIndex];
16
- this.handleTabClick(selectedTab);
17
- ev.preventDefault();
18
- this.setFocusedTab(selectedTab.index);
19
- }
20
- else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
21
- let operator = undefined;
22
- if (ev.key === "ArrowLeft") {
23
- operator = false;
24
- }
25
- else if (ev.key === "ArrowRight") {
26
- operator = true;
27
- }
28
- else {
29
- return;
30
- }
31
- if (this._focusedIndex === undefined) {
32
- if (operator === false) {
33
- this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex - 1 : undefined;
34
- }
35
- else {
36
- this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex + 1 : undefined;
37
- }
38
- }
39
- else {
40
- if (operator === false) {
41
- this._focusedIndex = this._focusedIndex - 1;
42
- }
43
- else {
44
- this._focusedIndex = this._focusedIndex + 1;
45
- }
46
- }
47
- if (this._focusedIndex < 0) {
48
- this._focusedIndex = 0;
49
- }
50
- else if (this._focusedIndex > this._processedTabs.length - 1) {
51
- this._focusedIndex = this._processedTabs.length - 1;
52
- }
53
- this.setFocusedBtn(true, this._focusedIndex);
54
- this.setFocusedTab(this._focusedIndex);
55
- }
56
- else if (ev.key === "Tab" || ev.key === "Escape") {
57
- const currentTab = this._processedTabs[this.selectedIndex];
58
- this._focusedIndex = undefined;
59
- this.handleTabClick(currentTab);
60
- ev.preventDefault();
61
- this.setFocusedTab(this.selectedIndex);
62
- }
63
- };
64
- }
65
- handleTabClick(tab) {
66
- this.selectedIndex = tab.index;
67
- this._focusedIndex = undefined;
68
- this.selectedTab = tab.tabKey;
69
- this.ezChange.emit(tab);
70
- this.setFocusedBtn(false, tab.index);
71
- }
72
- componentWillRender() {
73
- if (!this._processedTabs) {
74
- this._processedTabs = [];
75
- if (this.tabs) {
76
- this.tabs.split(",").forEach((label) => {
77
- label = label.trim();
78
- this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
79
- });
80
- }
81
- this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
82
- const tabKey = elem.getAttribute("tabKey");
83
- const label = elem.getAttribute("label");
84
- const t = { label, tabKey, index: this._processedTabs.length };
85
- const content = elem.firstChild;
86
- if (content) {
87
- content.setAttribute("slot", "tab" + t.index);
88
- this._hostElem.appendChild(content);
89
- }
90
- this._processedTabs.push(t);
91
- });
92
- }
93
- }
94
- handleSlotChange(ev) {
95
- const slot = ev.target;
96
- const content = slot.assignedElements()[0];
97
- if (content) {
98
- content.style.marginLeft = "6px";
99
- }
100
- }
101
- scrollBackward() {
102
- const container = this._scrollContainer;
103
- if (container) {
104
- container.scrollLeft -= container.clientWidth;
105
- }
106
- }
107
- scrollFoward() {
108
- const container = this._scrollContainer;
109
- if (container) {
110
- let lastTab = null;
111
- container.querySelectorAll(".tab").forEach((tab) => {
112
- if (tab.getBoundingClientRect().right < container.clientWidth) {
113
- lastTab = tab;
114
- }
115
- });
116
- container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
117
- }
118
- }
119
- componentDidRender() {
120
- this.updateScroll();
121
- }
122
- updateScroll() {
123
- const container = this._scrollContainer;
124
- if (container) {
125
- const { scrollWidth, clientWidth, scrollLeft } = container;
126
- const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
127
- this._startHidden = container.scrollLeft > 0;
128
- this._endHidden = remainingScroll > 0;
129
- if (this._startHidden) {
130
- this._backwardButton.classList.remove("hidden");
131
- }
132
- else {
133
- this._backwardButton.classList.add("hidden");
134
- }
135
- if (this._endHidden) {
136
- this._forwardButton.classList.remove("hidden");
137
- }
138
- else {
139
- this._forwardButton.classList.add("hidden");
140
- }
141
- const classNames = ["", "startHidden", "endHidden", "midle"];
142
- const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
143
- classNames.forEach((name) => {
144
- if (name !== currentClass && container.classList.contains(name)) {
145
- container.classList.remove(name);
146
- }
147
- });
148
- if (currentClass && !container.classList.contains(currentClass)) {
149
- container.classList.add(currentClass);
150
- }
151
- }
152
- }
153
- domScrollHandler() {
154
- window.clearTimeout(this._scrollCallBack);
155
- this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
156
- }
157
- setFocusedTab(index) {
158
- window.clearTimeout(this._scrollCallBackTest);
159
- this._scrollCallBackTest = window.setTimeout(() => {
160
- const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
161
- tabtoscroll.scrollIntoView();
162
- }, 200);
163
- }
164
- getTextWidth(text) {
165
- if (this._textMesurement === undefined) {
166
- this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
167
- }
168
- const context = this._textMesurement.getContext("2d");
169
- context.font = "14px Sora, Algerian";
170
- return Math.min(220, 24 + context.measureText(text).width) + "px";
171
- }
172
- ;
173
- setFocusedBtn(visible, parameter) {
174
- const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
175
- tabsButtons.forEach((el) => {
176
- el.classList.remove("is-focused");
177
- if (el.id === "tab" + parameter && visible) {
178
- el.classList.add("is-focused");
179
- }
180
- });
181
- }
182
- render() {
183
- return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index$1) => {
184
- const labelStyle = { "min-width": this.getTextWidth(tab.label) };
185
- const tabId = "tab" + index$1;
186
- const isSelected = index$1 === this.selectedIndex || (this.selectedTab && tab.tabKey === this.selectedTab);
187
- if (isSelected) {
188
- this.selectedTab = tab.tabKey;
189
- this.selectedIndex = index$1;
190
- }
191
- return index.h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, index.h("span", { class: "tab-label", title: tab.label }, tab.label), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
192
- })), index.h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
193
- }
194
- get _hostElem() { return index.getElement(this); }
195
- };
196
- EzTabselector.style = ezTabselectorCss;
197
-
198
- exports.ez_tabselector = EzTabselector;
@@ -1,114 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-682c98b2.js');
6
-
7
- const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--large, 500);--text-area--color:var(--title--primary, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-weight--large, 600);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color)}";
8
-
9
- const EzTextArea = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.ezChange = index.createEvent(this, "ezChange", 7);
13
- /**
14
- * Deixa o campo disponível ou não para digitação.
15
- */
16
- this.enabled = true;
17
- /**
18
- * Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
19
- */
20
- this.rows = 4;
21
- }
22
- showError() {
23
- const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
24
- if (hasError) {
25
- this._container.classList.add('hasError');
26
- this._messageBoxElem.classList.add('hasError');
27
- }
28
- else {
29
- this._container.classList.remove('hasError');
30
- this._messageBoxElem.classList.remove('hasError');
31
- }
32
- }
33
- updateInputValue() {
34
- this._inputElem.value = this.value === undefined ? "" : this.value;
35
- this.handleChange();
36
- this.adjustFloatingLabel();
37
- this.ezChange.emit(this.value);
38
- }
39
- adjustFloatingLabel() {
40
- if (this.label) {
41
- const hasValue = this.value && this.value.toString().length > 0;
42
- const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
43
- if (hasValue || this.isFocused()) {
44
- if (!containsFloatedClass) {
45
- this._labelElem.classList.add("textarea__label--floated");
46
- }
47
- }
48
- else {
49
- if (containsFloatedClass) {
50
- this._labelElem.classList.remove("textarea__label--floated");
51
- }
52
- }
53
- }
54
- }
55
- isFocused() {
56
- return this._hostElement.shadowRoot.activeElement !== null;
57
- }
58
- //---------------------------------------------
59
- // Public methods
60
- //---------------------------------------------
61
- /**
62
- * Faz o foco no componente de input
63
- */
64
- async setFocus() {
65
- this._inputElem.focus();
66
- }
67
- /**
68
- * Remove o foco no componente de input
69
- */
70
- async setBlur() {
71
- this._inputElem.blur();
72
- }
73
- //---------------------------------------------
74
- // Event handlers
75
- //---------------------------------------------
76
- handleFocusout() {
77
- this.adjustFloatingLabel();
78
- if (this._container && this._container.classList.contains("textarea--focus")) {
79
- this._container.classList.remove("textarea--focus");
80
- }
81
- }
82
- handleChange() {
83
- this.errorMessage = "";
84
- this.value = this._inputElem.value;
85
- }
86
- handleFocus() {
87
- if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {
88
- this._labelElem.classList.add("textarea__label--floated");
89
- }
90
- if (this._container && !this._container.classList.contains("textarea--focus")) {
91
- this._container.classList.add("textarea--focus");
92
- }
93
- }
94
- //---------------------------------------------
95
- // Lifecycle web component
96
- //---------------------------------------------
97
- componentDidLoad() {
98
- this.showError();
99
- this.adjustFloatingLabel();
100
- }
101
- render() {
102
- return (index.h(index.Host, null, index.h("div", { class: "textarea", ref: (el) => this._container = el }, this.label ?
103
- index.h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
104
- : null, index.h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
105
- }
106
- get _hostElement() { return index.getElement(this); }
107
- static get watchers() { return {
108
- "errorMessage": ["showError"],
109
- "value": ["updateInputValue"]
110
- }; }
111
- };
112
- EzTextArea.style = ezTextAreaCss;
113
-
114
- exports.ez_text_area = EzTextArea;