@sankhyalabs/sankhyablocks 1.1.27 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +75 -75
  3. package/dist/cjs/index-4720dab8.js +735 -0
  4. package/dist/cjs/loader.cjs.js +3 -3
  5. package/dist/cjs/sankhyablocks.cjs.js +3 -3
  6. package/dist/cjs/snk-application.cjs.entry.js +954 -656
  7. package/dist/collection/collection-manifest.json +6 -35
  8. package/dist/collection/components/snk-application/snk-application.css +5 -5
  9. package/dist/collection/components/snk-application/snk-application.js +492 -495
  10. package/dist/collection/index.js +1 -1
  11. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +158 -158
  12. package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js +23 -23
  13. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +188 -188
  14. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +25 -25
  15. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +2 -2
  16. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +59 -59
  17. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +30 -30
  18. package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js +66 -66
  19. package/dist/collection/lib/utils/pesquisa.js +16 -16
  20. package/dist/collection/lib/utils/urlutils.js +23 -23
  21. package/dist/collection/lib/workspace/workspace.js +7 -7
  22. package/dist/components/snk-application.js +945 -647
  23. package/dist/esm/index-72d4e2e0.js +709 -0
  24. package/dist/esm/loader.js +3 -3
  25. package/dist/esm/polyfills/core-js.js +0 -0
  26. package/dist/esm/polyfills/dom.js +0 -0
  27. package/dist/esm/polyfills/es5-html-element.js +0 -0
  28. package/dist/esm/polyfills/index.js +0 -0
  29. package/dist/esm/polyfills/system.js +0 -0
  30. package/dist/esm/sankhyablocks.js +3 -3
  31. package/dist/esm/snk-application.entry.js +916 -618
  32. package/dist/sankhyablocks/p-5d8ddbda.entry.js +57 -0
  33. package/dist/sankhyablocks/p-a33afc3b.js +2 -0
  34. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  35. package/dist/types/components/snk-application/snk-application.d.ts +44 -44
  36. package/dist/types/components.d.ts +6 -2
  37. package/dist/types/index.d.ts +1 -1
  38. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +15 -15
  39. package/dist/types/lib/http/data-fetcher/fetchers/application-config-fetcher.d.ts +6 -6
  40. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +12 -12
  41. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +5 -5
  42. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +2 -2
  43. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +13 -13
  44. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +6 -6
  45. package/dist/types/lib/http/data-fetcher/state/LoadStateManager.d.ts +23 -23
  46. package/dist/types/lib/utils/pesquisa.d.ts +2 -2
  47. package/dist/types/lib/utils/urlutils.d.ts +4 -4
  48. package/dist/types/lib/workspace/workspace.d.ts +4 -4
  49. package/package.json +63 -52
  50. package/react/.keepfolder +1 -0
  51. package/react/components.d.ts +3 -32
  52. package/react/components.js +5 -34
  53. package/react/components.js.map +1 -1
  54. package/react/react-component-lib/createComponent.d.ts +10 -10
  55. package/react/react-component-lib/createComponent.js +58 -74
  56. package/react/react-component-lib/createComponent.js.map +1 -1
  57. package/react/react-component-lib/createOverlayComponent.d.ts +20 -21
  58. package/react/react-component-lib/createOverlayComponent.js +88 -108
  59. package/react/react-component-lib/createOverlayComponent.js.map +1 -1
  60. package/react/react-component-lib/index.d.ts +2 -2
  61. package/react/react-component-lib/index.js +2 -2
  62. package/react/react-component-lib/interfaces.d.ts +29 -29
  63. package/react/react-component-lib/utils/attachProps.d.ts +12 -12
  64. package/react/react-component-lib/utils/attachProps.js +95 -97
  65. package/react/react-component-lib/utils/attachProps.js.map +1 -1
  66. package/react/react-component-lib/utils/case.d.ts +2 -2
  67. package/react/react-component-lib/utils/case.js +6 -6
  68. package/react/react-component-lib/utils/dev.d.ts +2 -2
  69. package/react/react-component-lib/utils/dev.js +12 -12
  70. package/react/react-component-lib/utils/index.d.ts +7 -10
  71. package/react/react-component-lib/utils/index.js +20 -33
  72. package/react/react-component-lib/utils/index.js.map +1 -1
  73. package/dist/cjs/ApplicationUtils-05b74ee9.js +0 -39
  74. package/dist/cjs/AssetsUtils-bd004f63.js +0 -24
  75. package/dist/cjs/CSSVarsUtils-75ca9c64.js +0 -19
  76. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  77. package/dist/cjs/ez-action-chip.cjs.entry.js +0 -27
  78. package/dist/cjs/ez-application.cjs.entry.js +0 -26
  79. package/dist/cjs/ez-button_4.cjs.entry.js +0 -660
  80. package/dist/cjs/ez-calendar.cjs.entry.js +0 -223
  81. package/dist/cjs/ez-collapsible-box.cjs.entry.js +0 -47
  82. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -278
  83. package/dist/cjs/ez-date-input.cjs.entry.js +0 -102
  84. package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -145
  85. package/dist/cjs/ez-dialog.cjs.entry.js +0 -89
  86. package/dist/cjs/ez-form.cjs.entry.js +0 -785
  87. package/dist/cjs/ez-grid.cjs.entry.js +0 -110485
  88. package/dist/cjs/ez-icon.cjs.entry.js +0 -41
  89. package/dist/cjs/ez-label-chip.cjs.entry.js +0 -104
  90. package/dist/cjs/ez-modal_2.cjs.entry.js +0 -316
  91. package/dist/cjs/ez-number-input.cjs.entry.js +0 -86
  92. package/dist/cjs/ez-popover.cjs.entry.js +0 -120
  93. package/dist/cjs/ez-popup.cjs.entry.js +0 -48
  94. package/dist/cjs/ez-search.cjs.entry.js +0 -64
  95. package/dist/cjs/ez-tabselector.cjs.entry.js +0 -198
  96. package/dist/cjs/ez-text-area.cjs.entry.js +0 -114
  97. package/dist/cjs/ez-text-input.cjs.entry.js +0 -201
  98. package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
  99. package/dist/cjs/ez-toast.cjs.entry.js +0 -44
  100. package/dist/cjs/ez-upload.cjs.entry.js +0 -356
  101. package/dist/cjs/index-6ac5268e.js +0 -1769
  102. package/dist/cjs/test-du.cjs.entry.js +0 -76
  103. package/dist/components/ApplicationUtils.js +0 -37
  104. package/dist/components/AssetsUtils.js +0 -22
  105. package/dist/components/CSSVarsUtils.js +0 -17
  106. package/dist/components/_commonjsHelpers.js +0 -17
  107. package/dist/components/ez-action-chip.js +0 -44
  108. package/dist/components/ez-application.js +0 -39
  109. package/dist/components/ez-button.js +0 -6
  110. package/dist/components/ez-button2.js +0 -105
  111. package/dist/components/ez-calendar.js +0 -6
  112. package/dist/components/ez-calendar2.js +0 -242
  113. package/dist/components/ez-check.js +0 -6
  114. package/dist/components/ez-check2.js +0 -94
  115. package/dist/components/ez-collapsible-box.js +0 -67
  116. package/dist/components/ez-combo-box.js +0 -6
  117. package/dist/components/ez-combo-box2.js +0 -311
  118. package/dist/components/ez-date-input.js +0 -135
  119. package/dist/components/ez-date-time-input.js +0 -179
  120. package/dist/components/ez-dialog.js +0 -124
  121. package/dist/components/ez-form.js +0 -6
  122. package/dist/components/ez-form2.js +0 -807
  123. package/dist/components/ez-grid.js +0 -110576
  124. package/dist/components/ez-icon.js +0 -6
  125. package/dist/components/ez-icon2.js +0 -56
  126. package/dist/components/ez-label-chip.js +0 -125
  127. package/dist/components/ez-list.js +0 -6
  128. package/dist/components/ez-list2.js +0 -523
  129. package/dist/components/ez-modal.js +0 -6
  130. package/dist/components/ez-modal2.js +0 -82
  131. package/dist/components/ez-number-input.js +0 -115
  132. package/dist/components/ez-popover.js +0 -145
  133. package/dist/components/ez-popup.js +0 -67
  134. package/dist/components/ez-search.js +0 -100
  135. package/dist/components/ez-tabselector.js +0 -6
  136. package/dist/components/ez-tabselector2.js +0 -213
  137. package/dist/components/ez-text-area.js +0 -137
  138. package/dist/components/ez-text-input.js +0 -6
  139. package/dist/components/ez-text-input2.js +0 -223
  140. package/dist/components/ez-time-input.js +0 -153
  141. package/dist/components/ez-toast.js +0 -64
  142. package/dist/components/ez-upload.js +0 -382
  143. package/dist/components/grid-config.js +0 -6
  144. package/dist/components/grid-config2.js +0 -318
  145. package/dist/components/select-box.js +0 -6
  146. package/dist/components/select-box2.js +0 -47
  147. package/dist/components/test-du.js +0 -101
  148. package/dist/esm/ApplicationUtils-e0b6d857.js +0 -37
  149. package/dist/esm/AssetsUtils-98074c9c.js +0 -22
  150. package/dist/esm/CSSVarsUtils-0787c3f3.js +0 -17
  151. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  152. package/dist/esm/ez-action-chip.entry.js +0 -23
  153. package/dist/esm/ez-application.entry.js +0 -22
  154. package/dist/esm/ez-button_4.entry.js +0 -653
  155. package/dist/esm/ez-calendar.entry.js +0 -219
  156. package/dist/esm/ez-collapsible-box.entry.js +0 -43
  157. package/dist/esm/ez-combo-box.entry.js +0 -274
  158. package/dist/esm/ez-date-input.entry.js +0 -98
  159. package/dist/esm/ez-date-time-input.entry.js +0 -141
  160. package/dist/esm/ez-dialog.entry.js +0 -85
  161. package/dist/esm/ez-form.entry.js +0 -781
  162. package/dist/esm/ez-grid.entry.js +0 -110481
  163. package/dist/esm/ez-icon.entry.js +0 -37
  164. package/dist/esm/ez-label-chip.entry.js +0 -100
  165. package/dist/esm/ez-modal_2.entry.js +0 -311
  166. package/dist/esm/ez-number-input.entry.js +0 -82
  167. package/dist/esm/ez-popover.entry.js +0 -116
  168. package/dist/esm/ez-popup.entry.js +0 -44
  169. package/dist/esm/ez-search.entry.js +0 -60
  170. package/dist/esm/ez-tabselector.entry.js +0 -194
  171. package/dist/esm/ez-text-area.entry.js +0 -110
  172. package/dist/esm/ez-text-input.entry.js +0 -197
  173. package/dist/esm/ez-time-input.entry.js +0 -114
  174. package/dist/esm/ez-toast.entry.js +0 -40
  175. package/dist/esm/ez-upload.entry.js +0 -352
  176. package/dist/esm/index-df166135.js +0 -1738
  177. package/dist/esm/test-du.entry.js +0 -72
  178. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +0 -67
  179. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +0 -3
  180. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +0 -180
  181. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +0 -319
  182. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +0 -327
  183. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -162
  184. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -217
  185. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +0 -49
  186. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -44
  187. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +0 -527
  188. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +0 -5
  189. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +0 -31
  190. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +0 -129
  191. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +0 -10
  192. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +0 -176
  193. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +0 -139
  194. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +0 -335
  195. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +0 -358
  196. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +0 -4
  197. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +0 -44
  198. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +0 -405
  199. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +0 -3
  200. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -138
  201. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +0 -165
  202. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +0 -196
  203. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +0 -10
  204. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +0 -127
  205. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +0 -568
  206. package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +0 -3
  207. package/dist/sankhyablocks/p-08e1cded.entry.js +0 -1
  208. package/dist/sankhyablocks/p-0a77ac95.entry.js +0 -57
  209. package/dist/sankhyablocks/p-112455b1.js +0 -1
  210. package/dist/sankhyablocks/p-126c4aaa.entry.js +0 -1
  211. package/dist/sankhyablocks/p-1421b89a.entry.js +0 -1
  212. package/dist/sankhyablocks/p-1beadcaf.entry.js +0 -1
  213. package/dist/sankhyablocks/p-1c423f5d.entry.js +0 -1
  214. package/dist/sankhyablocks/p-28a0dbf0.entry.js +0 -1
  215. package/dist/sankhyablocks/p-4763d5c2.js +0 -1
  216. package/dist/sankhyablocks/p-4c66200a.entry.js +0 -1
  217. package/dist/sankhyablocks/p-5dc772be.entry.js +0 -1
  218. package/dist/sankhyablocks/p-5ff3e300.entry.js +0 -1
  219. package/dist/sankhyablocks/p-7122cec4.entry.js +0 -1
  220. package/dist/sankhyablocks/p-811b4b9d.js +0 -1
  221. package/dist/sankhyablocks/p-813fe4f7.js +0 -1
  222. package/dist/sankhyablocks/p-9b33a005.entry.js +0 -1
  223. package/dist/sankhyablocks/p-9e22ec87.entry.js +0 -1
  224. package/dist/sankhyablocks/p-9f7239df.entry.js +0 -1
  225. package/dist/sankhyablocks/p-9f7e6e48.js +0 -1
  226. package/dist/sankhyablocks/p-a47e0537.entry.js +0 -1
  227. package/dist/sankhyablocks/p-a9aba60a.entry.js +0 -1
  228. package/dist/sankhyablocks/p-afda7940.entry.js +0 -1
  229. package/dist/sankhyablocks/p-b3a83eaf.entry.js +0 -1
  230. package/dist/sankhyablocks/p-b96a8d40.entry.js +0 -1
  231. package/dist/sankhyablocks/p-c61c0e40.entry.js +0 -1
  232. package/dist/sankhyablocks/p-ca29d028.entry.js +0 -1
  233. package/dist/sankhyablocks/p-cd17abb1.entry.js +0 -1
  234. package/dist/sankhyablocks/p-d3a5366d.entry.js +0 -369
  235. package/dist/sankhyablocks/p-d5703a41.entry.js +0 -1
  236. package/dist/sankhyablocks/p-e5f77a59.entry.js +0 -1
  237. package/dist/sankhyablocks/p-e9e94d51.entry.js +0 -1
@@ -1,807 +0,0 @@
1
- import { h, proxyCustomElement, HTMLElement, forceUpdate, Host } from '@stencil/core/internal/client';
2
- import { UserInterface, ApplicationContext, Action, DataUnitAction, DataUnit } from '@sankhyalabs/core';
3
- import { A as ApplicationUtils } from './ApplicationUtils.js';
4
- import { d as defineCustomElement$1 } from './ez-tabselector2.js';
5
-
6
- const buildTextArea = ({ name, label, readOnly }) => {
7
- return (h("div", { class: "col col--sd-12 padding-horizontal--small", key: name },
8
- h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
9
- };
10
-
11
- const buildTextInput = ({ name, label }) => {
12
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
13
- h("ez-text-input", { label: label, "data-field-name": name, key: name })));
14
- };
15
-
16
- const buildSwitch = (fieldConfig) => {
17
- return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
18
- };
19
- const buildCheckBox = (fieldConfig) => {
20
- return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
21
- };
22
- function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
23
- return (h("div", { class: "col col--sd-12 col--tb-3 align--middle padding-horizontal--small padding-bottom--large" },
24
- h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
25
- }
26
-
27
- const buildComboBox = ({ name, label, readOnly }, properties) => {
28
- const prop = properties === null || properties === void 0 ? void 0 : properties.options;
29
- let options;
30
- if (typeof prop === "string") {
31
- const parsed = JSON.parse(prop);
32
- options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
33
- }
34
- else {
35
- options = prop;
36
- }
37
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
38
- h("ez-combo-box", { enabled: !readOnly, label: label, "data-field-name": name, key: name, options: options })));
39
- };
40
-
41
- const buildSearch = ({ name, label, readOnly }) => {
42
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
43
- h("ez-search", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
44
- };
45
-
46
- const buildFile = ({ name, label, readOnly }) => {
47
- return (h("div", { class: "col col--sd-12 padding-horizontal--small" },
48
- h("ez-upload", { enabled: !readOnly, label: label, urlUpload: "", requestHeaders: "", maxFiles: 10, "data-field-name": name, key: name })));
49
- };
50
-
51
- const buildDate = ({ name, label, readOnly }) => {
52
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
53
- h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
54
- };
55
- const buildTime = ({ name, label }) => {
56
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
57
- h("ez-time-input", { label: label, "data-field-name": name, key: name })));
58
- };
59
- const buildTimeDate = ({ name, label }) => {
60
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
61
- h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
62
- };
63
-
64
- const buildDecimal = ({ name, label, readOnly }, properties) => {
65
- const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
66
- const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
67
- return buildNumeric(name, label, readOnly, precision, prettyPrecision);
68
- };
69
- const buildInteger = ({ name, label, readOnly }) => {
70
- return buildNumeric(name, label, readOnly, 0, 0);
71
- };
72
- function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
73
- return (h("div", { class: "col col--sd-12 col--tb-3 padding-horizontal--small" },
74
- h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
75
- }
76
-
77
- const uiBuilders = new Map();
78
- uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
79
- uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
80
- uiBuilders.set(UserInterface.SWITCH, buildSwitch);
81
- uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
82
- uiBuilders.set(UserInterface.SEARCH, buildSearch);
83
- uiBuilders.set(UserInterface.FILE, buildFile);
84
- uiBuilders.set(UserInterface.DATE, buildDate);
85
- uiBuilders.set(UserInterface.TIME, buildTime);
86
- uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
87
- uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
88
- uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
89
- const buildField = (field) => {
90
- const descriptor = field.descriptor;
91
- const config = Object.assign({}, field.config);
92
- let builder;
93
- let props;
94
- if (descriptor) {
95
- if (!config.label) {
96
- config.label = descriptor.label;
97
- }
98
- if (!config.name) {
99
- config.name = descriptor.name;
100
- }
101
- if (config.required === undefined) {
102
- config.required = descriptor.required;
103
- }
104
- if (config.readOnly === undefined) {
105
- config.readOnly = descriptor.readOnly;
106
- }
107
- props = descriptor.properties;
108
- builder = uiBuilders.get(descriptor.userInterface);
109
- }
110
- if (config.required) {
111
- config.label = `* ${config.label} (obrigatório)`;
112
- }
113
- if (!builder) {
114
- builder = buildTextInput;
115
- }
116
- return builder(config, props);
117
- };
118
-
119
- const FormItem = ({ source }) => {
120
- if ("items" in source) {
121
- const fieldSet = source;
122
- return h("ez-collapsible-box", { label: source.label }, fieldSet.items.map(fi => buildField(fi)));
123
- }
124
- else {
125
- return buildField(source);
126
- }
127
- };
128
-
129
- const FormSheet = ({ store, source }) => {
130
- return (h("div", { class: "box__container" },
131
- h("div", { class: "row padding-vertical--small" }, source.items.map(item => h(FormItem, { store: store, source: item })))));
132
- };
133
-
134
- class FormMetadata {
135
- constructor() {
136
- this._sheets = new Map();
137
- this._requiredFields = [];
138
- this._cleanOnCopyFields = [];
139
- }
140
- getSheet(name) {
141
- return this._sheets.get(name);
142
- }
143
- getAllSheets() {
144
- return this._sheets;
145
- }
146
- addSheet(sheet) {
147
- this._sheets.set(sheet.name, sheet);
148
- this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
149
- this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
150
- }
151
- getRequiredFields() {
152
- return this._requiredFields;
153
- }
154
- getCleanOnCopyFields() {
155
- return this._cleanOnCopyFields;
156
- }
157
- }
158
- const buildFromDataUnit = (dataUnit) => {
159
- var _a;
160
- const unitMD = dataUnit.metadata;
161
- const metadata = new FormMetadata();
162
- if (unitMD) {
163
- const visibleFields = (_a = unitMD.fields) === null || _a === void 0 ? void 0 : _a.filter(descriptor => descriptor.visible !== false);
164
- metadata.addSheet({
165
- label: unitMD.label,
166
- name: unitMD.name,
167
- items: visibleFields.map(descriptor => { return { descriptor }; }),
168
- requiredFields: visibleFields
169
- .filter(descriptor => descriptor.required)
170
- .map(descriptor => descriptor.name),
171
- cleanOnCopyFields: visibleFields
172
- .filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
173
- .map(descriptor => descriptor.name)
174
- });
175
- }
176
- return metadata;
177
- };
178
- function getTabConfig(tab, sheets) {
179
- const tabConfig = (typeof tab === "string" ? Array.from(sheets.keys()).find(t => t.label === tab) : tab);
180
- return tabConfig || { label: tab, visible: true };
181
- }
182
- const buildFromConfig = (fields, dataUnit) => {
183
- const sheets = new Map();
184
- const requiredFields = [];
185
- const cleanOnCopyFields = [];
186
- fields.forEach(config => {
187
- var _a;
188
- if (config.visible !== false) {
189
- const tabConfig = getTabConfig(config.tab || "Geral", sheets);
190
- const descriptor = dataUnit.getField(config.name);
191
- if (descriptor && tabConfig.visible) {
192
- if (!sheets.has(tabConfig)) {
193
- sheets.set(tabConfig, new Map());
194
- }
195
- const tabItens = sheets.get(tabConfig);
196
- const isRequired = config.required === undefined ? descriptor.required : config.required;
197
- if (isRequired) {
198
- requiredFields.push(config.name);
199
- }
200
- const clearOnCopy = config.cleanOnCopy === undefined ? (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy : config.cleanOnCopy;
201
- if (clearOnCopy) {
202
- cleanOnCopyFields.push(config.name);
203
- }
204
- const fieldMD = { config, descriptor };
205
- const group = config.group;
206
- if (group) {
207
- const key = `group::${group}`;
208
- if (!tabItens.has(key)) {
209
- tabItens.set(key, { label: group, items: [fieldMD] });
210
- }
211
- else {
212
- tabItens.get(key).items.push(fieldMD);
213
- }
214
- }
215
- else {
216
- tabItens.set(config.name, fieldMD);
217
- }
218
- }
219
- }
220
- });
221
- const metadata = new FormMetadata();
222
- Array.from(sheets.entries())
223
- .sort((a, b) => (a[0].order || 10000) - (b[0].order || 10000))
224
- .forEach(([key, value]) => {
225
- metadata.addSheet({
226
- label: key.label,
227
- name: key.label,
228
- items: Array.from(value.values()),
229
- requiredFields,
230
- cleanOnCopyFields
231
- });
232
- });
233
- return metadata;
234
- };
235
-
236
- /**
237
- * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
238
- *
239
- * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
240
- * during build.
241
- * @param {number} code
242
- */
243
- function formatProdErrorMessage(code) {
244
- return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
245
- }
246
-
247
- // Inlined version of the `symbol-observable` polyfill
248
- var $$observable = (function () {
249
- return typeof Symbol === 'function' && Symbol.observable || '@@observable';
250
- })();
251
-
252
- /**
253
- * These are private action types reserved by Redux.
254
- * For any unknown actions, you must return the current state.
255
- * If the current state is undefined, you must return the initial state.
256
- * Do not reference these action types directly in your code.
257
- */
258
- var randomString = function randomString() {
259
- return Math.random().toString(36).substring(7).split('').join('.');
260
- };
261
-
262
- var ActionTypes = {
263
- INIT: "@@redux/INIT" + randomString(),
264
- REPLACE: "@@redux/REPLACE" + randomString(),
265
- PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
266
- return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
267
- }
268
- };
269
-
270
- /**
271
- * @param {any} obj The object to inspect.
272
- * @returns {boolean} True if the argument appears to be a plain object.
273
- */
274
- function isPlainObject(obj) {
275
- if (typeof obj !== 'object' || obj === null) return false;
276
- var proto = obj;
277
-
278
- while (Object.getPrototypeOf(proto) !== null) {
279
- proto = Object.getPrototypeOf(proto);
280
- }
281
-
282
- return Object.getPrototypeOf(obj) === proto;
283
- }
284
-
285
- /**
286
- * @deprecated
287
- *
288
- * **We recommend using the `configureStore` method
289
- * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
290
- *
291
- * Redux Toolkit is our recommended approach for writing Redux logic today,
292
- * including store setup, reducers, data fetching, and more.
293
- *
294
- * **For more details, please read this Redux docs page:**
295
- * **https://redux.js.org/introduction/why-rtk-is-redux-today**
296
- *
297
- * `configureStore` from Redux Toolkit is an improved version of `createStore` that
298
- * simplifies setup and helps avoid common bugs.
299
- *
300
- * You should not be using the `redux` core package by itself today, except for learning purposes.
301
- * The `createStore` method from the core `redux` package will not be removed, but we encourage
302
- * all users to migrate to using Redux Toolkit for all Redux code.
303
- *
304
- * If you want to use `createStore` without this visual deprecation warning, use
305
- * the `legacy_createStore` import instead:
306
- *
307
- * `import { legacy_createStore as createStore} from 'redux'`
308
- *
309
- */
310
-
311
- function createStore(reducer, preloadedState, enhancer) {
312
- var _ref2;
313
-
314
- if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
315
- throw new Error(formatProdErrorMessage(0) );
316
- }
317
-
318
- if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
319
- enhancer = preloadedState;
320
- preloadedState = undefined;
321
- }
322
-
323
- if (typeof enhancer !== 'undefined') {
324
- if (typeof enhancer !== 'function') {
325
- throw new Error(formatProdErrorMessage(1) );
326
- }
327
-
328
- return enhancer(createStore)(reducer, preloadedState);
329
- }
330
-
331
- if (typeof reducer !== 'function') {
332
- throw new Error(formatProdErrorMessage(2) );
333
- }
334
-
335
- var currentReducer = reducer;
336
- var currentState = preloadedState;
337
- var currentListeners = [];
338
- var nextListeners = currentListeners;
339
- var isDispatching = false;
340
- /**
341
- * This makes a shallow copy of currentListeners so we can use
342
- * nextListeners as a temporary list while dispatching.
343
- *
344
- * This prevents any bugs around consumers calling
345
- * subscribe/unsubscribe in the middle of a dispatch.
346
- */
347
-
348
- function ensureCanMutateNextListeners() {
349
- if (nextListeners === currentListeners) {
350
- nextListeners = currentListeners.slice();
351
- }
352
- }
353
- /**
354
- * Reads the state tree managed by the store.
355
- *
356
- * @returns {any} The current state tree of your application.
357
- */
358
-
359
-
360
- function getState() {
361
- if (isDispatching) {
362
- throw new Error(formatProdErrorMessage(3) );
363
- }
364
-
365
- return currentState;
366
- }
367
- /**
368
- * Adds a change listener. It will be called any time an action is dispatched,
369
- * and some part of the state tree may potentially have changed. You may then
370
- * call `getState()` to read the current state tree inside the callback.
371
- *
372
- * You may call `dispatch()` from a change listener, with the following
373
- * caveats:
374
- *
375
- * 1. The subscriptions are snapshotted just before every `dispatch()` call.
376
- * If you subscribe or unsubscribe while the listeners are being invoked, this
377
- * will not have any effect on the `dispatch()` that is currently in progress.
378
- * However, the next `dispatch()` call, whether nested or not, will use a more
379
- * recent snapshot of the subscription list.
380
- *
381
- * 2. The listener should not expect to see all state changes, as the state
382
- * might have been updated multiple times during a nested `dispatch()` before
383
- * the listener is called. It is, however, guaranteed that all subscribers
384
- * registered before the `dispatch()` started will be called with the latest
385
- * state by the time it exits.
386
- *
387
- * @param {Function} listener A callback to be invoked on every dispatch.
388
- * @returns {Function} A function to remove this change listener.
389
- */
390
-
391
-
392
- function subscribe(listener) {
393
- if (typeof listener !== 'function') {
394
- throw new Error(formatProdErrorMessage(4) );
395
- }
396
-
397
- if (isDispatching) {
398
- throw new Error(formatProdErrorMessage(5) );
399
- }
400
-
401
- var isSubscribed = true;
402
- ensureCanMutateNextListeners();
403
- nextListeners.push(listener);
404
- return function unsubscribe() {
405
- if (!isSubscribed) {
406
- return;
407
- }
408
-
409
- if (isDispatching) {
410
- throw new Error(formatProdErrorMessage(6) );
411
- }
412
-
413
- isSubscribed = false;
414
- ensureCanMutateNextListeners();
415
- var index = nextListeners.indexOf(listener);
416
- nextListeners.splice(index, 1);
417
- currentListeners = null;
418
- };
419
- }
420
- /**
421
- * Dispatches an action. It is the only way to trigger a state change.
422
- *
423
- * The `reducer` function, used to create the store, will be called with the
424
- * current state tree and the given `action`. Its return value will
425
- * be considered the **next** state of the tree, and the change listeners
426
- * will be notified.
427
- *
428
- * The base implementation only supports plain object actions. If you want to
429
- * dispatch a Promise, an Observable, a thunk, or something else, you need to
430
- * wrap your store creating function into the corresponding middleware. For
431
- * example, see the documentation for the `redux-thunk` package. Even the
432
- * middleware will eventually dispatch plain object actions using this method.
433
- *
434
- * @param {Object} action A plain object representing “what changed”. It is
435
- * a good idea to keep actions serializable so you can record and replay user
436
- * sessions, or use the time travelling `redux-devtools`. An action must have
437
- * a `type` property which may not be `undefined`. It is a good idea to use
438
- * string constants for action types.
439
- *
440
- * @returns {Object} For convenience, the same action object you dispatched.
441
- *
442
- * Note that, if you use a custom middleware, it may wrap `dispatch()` to
443
- * return something else (for example, a Promise you can await).
444
- */
445
-
446
-
447
- function dispatch(action) {
448
- if (!isPlainObject(action)) {
449
- throw new Error(formatProdErrorMessage(7) );
450
- }
451
-
452
- if (typeof action.type === 'undefined') {
453
- throw new Error(formatProdErrorMessage(8) );
454
- }
455
-
456
- if (isDispatching) {
457
- throw new Error(formatProdErrorMessage(9) );
458
- }
459
-
460
- try {
461
- isDispatching = true;
462
- currentState = currentReducer(currentState, action);
463
- } finally {
464
- isDispatching = false;
465
- }
466
-
467
- var listeners = currentListeners = nextListeners;
468
-
469
- for (var i = 0; i < listeners.length; i++) {
470
- var listener = listeners[i];
471
- listener();
472
- }
473
-
474
- return action;
475
- }
476
- /**
477
- * Replaces the reducer currently used by the store to calculate the state.
478
- *
479
- * You might need this if your app implements code splitting and you want to
480
- * load some of the reducers dynamically. You might also need this if you
481
- * implement a hot reloading mechanism for Redux.
482
- *
483
- * @param {Function} nextReducer The reducer for the store to use instead.
484
- * @returns {void}
485
- */
486
-
487
-
488
- function replaceReducer(nextReducer) {
489
- if (typeof nextReducer !== 'function') {
490
- throw new Error(formatProdErrorMessage(10) );
491
- }
492
-
493
- currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
494
- // Any reducers that existed in both the new and old rootReducer
495
- // will receive the previous state. This effectively populates
496
- // the new state tree with any relevant data from the old one.
497
-
498
- dispatch({
499
- type: ActionTypes.REPLACE
500
- });
501
- }
502
- /**
503
- * Interoperability point for observable/reactive libraries.
504
- * @returns {observable} A minimal observable of state changes.
505
- * For more information, see the observable proposal:
506
- * https://github.com/tc39/proposal-observable
507
- */
508
-
509
-
510
- function observable() {
511
- var _ref;
512
-
513
- var outerSubscribe = subscribe;
514
- return _ref = {
515
- /**
516
- * The minimal observable subscription method.
517
- * @param {Object} observer Any object that can be used as an observer.
518
- * The observer object should have a `next` method.
519
- * @returns {subscription} An object with an `unsubscribe` method that can
520
- * be used to unsubscribe the observable from the store, and prevent further
521
- * emission of values from the observable.
522
- */
523
- subscribe: function subscribe(observer) {
524
- if (typeof observer !== 'object' || observer === null) {
525
- throw new Error(formatProdErrorMessage(11) );
526
- }
527
-
528
- function observeState() {
529
- if (observer.next) {
530
- observer.next(getState());
531
- }
532
- }
533
-
534
- observeState();
535
- var unsubscribe = outerSubscribe(observeState);
536
- return {
537
- unsubscribe: unsubscribe
538
- };
539
- }
540
- }, _ref[$$observable] = function () {
541
- return this;
542
- }, _ref;
543
- } // When a store is created, an "INIT" action is dispatched so that every
544
- // reducer returns their initial state. This effectively populates
545
- // the initial state tree.
546
-
547
-
548
- dispatch({
549
- type: ActionTypes.INIT
550
- });
551
- return _ref2 = {
552
- dispatch: dispatch,
553
- subscribe: subscribe,
554
- getState: getState,
555
- replaceReducer: replaceReducer
556
- }, _ref2[$$observable] = observable, _ref2;
557
- }
558
-
559
- const inicialState = {};
560
- /////////////////////////////// REDUCERS ///////////////////////////////
561
- function formReducer(state = inicialState, action) {
562
- switch (action.type) {
563
- case FormActions.METADATA_LOADED:
564
- return Object.assign(Object.assign({}, state), { formMetadata: action.payload });
565
- case FormActions.CHANGE_TAB:
566
- return Object.assign(Object.assign({}, state), { currentSheet: action.payload });
567
- default:
568
- return state;
569
- }
570
- }
571
- /////////////////////////////// ACTION CREATORS ///////////////////////////////
572
- function loadMetadata(formMetadata) {
573
- return {
574
- type: FormActions.METADATA_LOADED,
575
- payload: formMetadata
576
- };
577
- }
578
- function changeTab(currentSheet) {
579
- return {
580
- type: FormActions.CHANGE_TAB,
581
- payload: currentSheet.tabKey
582
- };
583
- }
584
- /////////////////////////////// SELECTORS ///////////////////////////////
585
- function selectFormMetadata(state) {
586
- return state.formMetadata;
587
- }
588
- function selectCurrentSheet(state) {
589
- return state.currentSheet ? state.formMetadata.getSheet(state.currentSheet) : Array.from(state.formMetadata.getAllSheets().values())[0];
590
- }
591
- /////////////////////////////// TYPES ///////////////////////////////
592
- var FormActions;
593
- (function (FormActions) {
594
- FormActions["METADATA_LOADED"] = "FORM/METADATA_LOADED";
595
- FormActions["CHANGE_TAB"] = "FORM/CHANGE_TAB";
596
- })(FormActions || (FormActions = {}));
597
-
598
- class DataBinder {
599
- constructor(dataUnit) {
600
- this._fields = new Map();
601
- this._dataUnit = dataUnit;
602
- this._dataUnit.subscribe(_action => {
603
- var _a;
604
- (_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
605
- this.updateValue(field.fieldName, field.field);
606
- });
607
- });
608
- }
609
- bind(fields) {
610
- fields.forEach(fieldElement => {
611
- const fieldName = fieldElement.dataset.fieldName;
612
- this.updateBind(fieldName, fieldElement);
613
- this.updateValue(fieldName, fieldElement);
614
- });
615
- }
616
- updateValue(fieldName, field) {
617
- field["value"] = this._dataUnit.getFieldValue(fieldName);
618
- }
619
- updateBind(fieldName, field) {
620
- const oldBind = this._fields.get(fieldName);
621
- if (oldBind) {
622
- oldBind.destroy();
623
- }
624
- this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
625
- this.bindSearchOptionsLoader(fieldName, field);
626
- }
627
- setFieldValue(fieldName, newValue) {
628
- if (this._dataUnit.records.length === 0) {
629
- this._dataUnit.addRecord();
630
- }
631
- this._dataUnit.setFieldValue(fieldName, newValue);
632
- }
633
- bindSearchOptionsLoader(fieldName, field) {
634
- if (field.nodeName === "EZ-SEARCH" && field["optionLoader"] === undefined) {
635
- const loader = ApplicationContext.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");
636
- if (loader) {
637
- field["optionLoader"] = (arg) => {
638
- return loader(arg, fieldName, this._dataUnit);
639
- };
640
- }
641
- }
642
- }
643
- }
644
- class Bind {
645
- destroy() {
646
- this.field.removeEventListener(this.eventName, this.eventListener);
647
- }
648
- static create(fieldName, field, callback) {
649
- const b = new Bind();
650
- b.fieldName = fieldName;
651
- b.field = field;
652
- //FIXME: Verificar se o field é um EzField
653
- b.eventListener = (evt) => { callback(fieldName, evt.detail); };
654
- b.eventName = "ezChange";
655
- b.field.addEventListener(b.eventName, b.eventListener);
656
- return b;
657
- }
658
- }
659
-
660
- const ezFormCss = "ez-form{display:flex;flex-direction:column;width:100%}";
661
-
662
- const EzForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
663
- constructor() {
664
- super();
665
- this.__registerHost();
666
- }
667
- submit() {
668
- return Promise.resolve();
669
- }
670
- cancel() {
671
- return Promise.resolve();
672
- }
673
- validate() {
674
- return new Promise((accept, reject) => {
675
- const metadata = selectFormMetadata(this._store.getState());
676
- const requiredFields = this._staticFields
677
- .filter(f => f.dataset.required)
678
- .map(f => f.dataset.fieldName)
679
- .concat(metadata.getRequiredFields());
680
- const records = this.dataUnit.records;
681
- for (let i = 0; i < records.length; i++) {
682
- if (!this.validateRequired(requiredFields, records[i])) {
683
- reject();
684
- break;
685
- }
686
- }
687
- accept();
688
- });
689
- }
690
- configChanged() {
691
- this.processMetadata();
692
- }
693
- validateRequired(requiredFields, record) {
694
- const invalidFields = [];
695
- requiredFields.forEach(field => {
696
- const value = record[field];
697
- const fieldElem = this._element.querySelector(`[data-field-name=${field}]`);
698
- if (value === null || value === undefined || value === "") {
699
- invalidFields.push(field);
700
- fieldElem["errorMessage"] = "Essa informação é obrigatória";
701
- }
702
- else {
703
- fieldElem["errorMessage"] = "";
704
- }
705
- });
706
- const isValid = invalidFields.length === 0;
707
- if (!isValid) {
708
- ApplicationUtils.info("Há pelo menos um campo obrigatório não preenchido.");
709
- }
710
- return isValid;
711
- }
712
- getDynamicContent() {
713
- var _a;
714
- const formMD = selectFormMetadata(this._store.getState());
715
- if (!formMD)
716
- return null;
717
- const currentSheet = selectCurrentSheet((_a = this._store) === null || _a === void 0 ? void 0 : _a.getState());
718
- if (!currentSheet) {
719
- return null;
720
- }
721
- const allSheets = Array.from(formMD.getAllSheets().values());
722
- const result = [];
723
- if (allSheets.length > 1) {
724
- result.push(h("ez-tabselector", { onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name }, allSheets.map(s => h("ez-tab", { tabKey: s.name, label: s.label }))));
725
- }
726
- result.push(h(FormSheet, { store: this._store, source: currentSheet }));
727
- return result;
728
- }
729
- processMetadata() {
730
- if (!this.isStatic()) {
731
- const metadata = this.config && this.config.length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
732
- this._store.dispatch(loadMetadata(metadata));
733
- }
734
- }
735
- isStatic() {
736
- var _a;
737
- return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
738
- }
739
- interceptAction(action) {
740
- if (action.type === Action.RECORDS_COPIED) {
741
- const metadata = selectFormMetadata(this._store.getState());
742
- const cleanFields = metadata.getCleanOnCopyFields();
743
- if (cleanFields) {
744
- const records = action.payload;
745
- return new DataUnitAction(Action.RECORDS_COPIED, records.map(record => {
746
- const newRecord = Object.assign({}, record);
747
- cleanFields.forEach(fieldName => delete newRecord[fieldName]);
748
- return newRecord;
749
- }));
750
- }
751
- }
752
- return action;
753
- }
754
- componentWillLoad() {
755
- if (this.dataUnit === undefined) {
756
- this.dataUnit = new DataUnit("ez-form");
757
- }
758
- this.dataUnit.addInterceptor(this);
759
- this.dataUnit.subscribe(action => {
760
- if (action.type === Action.METADATA_LOADED) {
761
- this.processMetadata();
762
- }
763
- });
764
- this._dataBinder = new DataBinder(this.dataUnit);
765
- this._store = createStore(formReducer);
766
- this._store.subscribe(() => forceUpdate(this));
767
- this._staticFields = Array.from(this._element.querySelectorAll("[data-field-name]"));
768
- this.processMetadata();
769
- }
770
- componentDidRender() {
771
- this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
772
- }
773
- render() {
774
- return (h(Host, null, this.isStatic() ? null : this.getDynamicContent()));
775
- }
776
- get _element() { return this; }
777
- static get watchers() { return {
778
- "config": ["configChanged"]
779
- }; }
780
- static get style() { return ezFormCss; }
781
- }, [0, "ez-form", {
782
- "dataUnit": [1040],
783
- "config": [16],
784
- "submit": [64],
785
- "cancel": [64],
786
- "validate": [64]
787
- }]);
788
- function defineCustomElement() {
789
- if (typeof customElements === "undefined") {
790
- return;
791
- }
792
- const components = ["ez-form", "ez-tabselector"];
793
- components.forEach(tagName => { switch (tagName) {
794
- case "ez-form":
795
- if (!customElements.get(tagName)) {
796
- customElements.define(tagName, EzForm);
797
- }
798
- break;
799
- case "ez-tabselector":
800
- if (!customElements.get(tagName)) {
801
- defineCustomElement$1();
802
- }
803
- break;
804
- } });
805
- }
806
-
807
- export { EzForm as E, defineCustomElement as d };