@sankhyalabs/sankhyablocks 1.4.0-beta.7 → 1.4.0-beta.9

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 (194) hide show
  1. package/dist/cjs/{SnkMessageBuilder-b54dfb89.js → SnkMessageBuilder-6c2f7bcd.js} +87 -11
  2. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  3. package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
  4. package/dist/cjs/constants-9056ca9e.js +84 -0
  5. package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
  6. package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
  7. package/dist/cjs/{index-6fcf07f3.js → index-20e8b68a.js} +50 -2
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  10. package/dist/cjs/snk-application.cjs.entry.js +209 -6976
  11. package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
  12. package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
  13. package/dist/cjs/{snk-filter-bar_5.cjs.entry.js → snk-configurator_6.cjs.entry.js} +194 -7
  14. package/dist/cjs/snk-crud.cjs.entry.js +13 -11
  15. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  16. package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
  17. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -2
  23. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  24. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
  26. package/dist/cjs/snk-form.cjs.entry.js +146 -0
  27. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
  29. package/dist/cjs/{taskbar-elements-aedfeae6.js → taskbar-elements-9a4b1e19.js} +10 -6
  30. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  31. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  32. package/dist/collection/collection-manifest.json +27 -1
  33. package/dist/collection/components/snk-application/snk-application.js +144 -23
  34. package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
  35. package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
  36. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
  37. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
  38. package/dist/collection/components/snk-crud/snk-crud.js +15 -13
  39. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +35 -4
  40. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +3 -3
  41. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +2 -1
  42. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  43. package/dist/collection/components/snk-form/snk-form.css +4 -0
  44. package/dist/collection/components/snk-form/snk-form.js +108 -30
  45. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
  46. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
  47. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
  48. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
  49. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
  50. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
  51. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
  52. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
  53. package/dist/collection/components/snk-grid/snk-grid.js +92 -22
  54. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
  55. package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
  56. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
  57. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
  58. package/dist/collection/lib/message/SnkMessageBuilder.js +8 -1
  59. package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
  60. package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
  61. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
  62. package/dist/collection/lib/utils/constants.js +72 -0
  63. package/dist/components/SnkMessageBuilder.js +87 -11
  64. package/dist/components/_commonjsHelpers.js +17 -0
  65. package/dist/components/constants.js +74 -0
  66. package/dist/components/form-config-fetcher.js +6889 -0
  67. package/dist/components/index.d.ts +6 -0
  68. package/dist/components/index.js +6 -0
  69. package/dist/components/snk-application2.js +221 -6985
  70. package/dist/components/snk-config-modal.d.ts +11 -0
  71. package/dist/components/snk-config-modal.js +6 -0
  72. package/dist/components/snk-config-modal2.js +91 -0
  73. package/dist/components/snk-config-options.d.ts +11 -0
  74. package/dist/components/snk-config-options.js +6 -0
  75. package/dist/components/snk-config-options2.js +245 -0
  76. package/dist/components/snk-configurator.d.ts +11 -0
  77. package/dist/components/snk-configurator.js +6 -0
  78. package/dist/components/snk-configurator2.js +212 -0
  79. package/dist/components/snk-crud.js +62 -25
  80. package/dist/components/snk-field-config.d.ts +11 -0
  81. package/dist/components/snk-field-config.js +6 -0
  82. package/dist/components/snk-field-config2.js +70 -0
  83. package/dist/components/snk-filter-bar2.js +1 -1
  84. package/dist/components/snk-filter-modal2.js +2 -1
  85. package/dist/components/snk-filter-personalized.js +4 -1
  86. package/dist/components/snk-form-config.d.ts +11 -0
  87. package/dist/components/snk-form-config.js +6 -0
  88. package/dist/components/snk-form-config2.js +996 -0
  89. package/dist/components/snk-form2.js +79 -29
  90. package/dist/components/snk-grid2.js +43 -24
  91. package/dist/components/snk-tab-config.d.ts +11 -0
  92. package/dist/components/snk-tab-config.js +6 -0
  93. package/dist/components/snk-tab-config2.js +7220 -0
  94. package/dist/components/snk-taskbar2.js +27 -9
  95. package/dist/esm/{SnkMessageBuilder-d440381c.js → SnkMessageBuilder-5792c260.js} +87 -11
  96. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  97. package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
  98. package/dist/esm/constants-c6039d3d.js +74 -0
  99. package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
  100. package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
  101. package/dist/esm/{index-81dda3cf.js → index-e4121713.js} +50 -3
  102. package/dist/esm/loader.js +2 -2
  103. package/dist/esm/sankhyablocks.js +2 -2
  104. package/dist/esm/snk-application.entry.js +220 -6987
  105. package/dist/esm/snk-config-modal.entry.js +58 -0
  106. package/dist/esm/snk-config-options.entry.js +226 -0
  107. package/dist/esm/{snk-filter-bar_5.entry.js → snk-configurator_6.entry.js} +195 -9
  108. package/dist/esm/snk-crud.entry.js +13 -11
  109. package/dist/esm/snk-data-unit.entry.js +2 -2
  110. package/dist/esm/snk-field-config_2.entry.js +130 -0
  111. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  112. package/dist/esm/snk-filter-detail.entry.js +1 -1
  113. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  114. package/dist/esm/snk-filter-number.entry.js +1 -1
  115. package/dist/esm/snk-filter-period.entry.js +1 -1
  116. package/dist/esm/snk-filter-personalized.entry.js +3 -2
  117. package/dist/esm/snk-filter-search.entry.js +1 -1
  118. package/dist/esm/snk-filter-text.entry.js +1 -1
  119. package/dist/esm/snk-form-config.entry.js +953 -0
  120. package/dist/esm/snk-form.entry.js +142 -0
  121. package/dist/esm/snk-pesquisa.entry.js +1 -1
  122. package/dist/esm/snk-tab-config.entry.js +317 -0
  123. package/dist/esm/{taskbar-elements-38eb5d51.js → taskbar-elements-e2ed0536.js} +10 -6
  124. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  125. package/dist/esm/teste-pesquisa.entry.js +1 -1
  126. package/dist/sankhyablocks/{p-4574a955.entry.js → p-029ae4e4.entry.js} +1 -1
  127. package/dist/sankhyablocks/p-03f9c407.js +1 -0
  128. package/dist/sankhyablocks/p-112455b1.js +1 -0
  129. package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
  130. package/dist/sankhyablocks/p-1feabfc7.entry.js +1 -0
  131. package/dist/sankhyablocks/p-21c8929b.js +1 -0
  132. package/dist/sankhyablocks/p-2284c850.entry.js +1 -0
  133. package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-0ea25487.entry.js → p-2dc76d79.entry.js} +1 -1
  135. package/dist/sankhyablocks/p-361299e8.js +26 -0
  136. package/dist/sankhyablocks/p-366aa0f5.entry.js +1 -0
  137. package/dist/sankhyablocks/p-36d2d9cf.entry.js +75 -0
  138. package/dist/sankhyablocks/{p-6386d720.entry.js → p-3a276f3d.entry.js} +1 -1
  139. package/dist/sankhyablocks/{p-0352c0e2.entry.js → p-44ce5b90.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-aecf3e0a.entry.js → p-6988f4a6.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
  142. package/dist/sankhyablocks/p-7b4a4a50.entry.js +1 -0
  143. package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
  144. package/dist/sankhyablocks/{p-40b27004.entry.js → p-9dc4426d.entry.js} +1 -1
  145. package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
  146. package/dist/sankhyablocks/p-a5b26df2.js +1 -0
  147. package/dist/sankhyablocks/p-b6d6b172.js +1 -0
  148. package/dist/sankhyablocks/{p-5bdb8452.entry.js → p-cc4bef9f.entry.js} +1 -1
  149. package/dist/sankhyablocks/{p-2e49afef.entry.js → p-d1ac09c9.entry.js} +1 -1
  150. package/dist/sankhyablocks/p-d50651a3.js +1 -0
  151. package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
  152. package/dist/sankhyablocks/{p-49580cdd.entry.js → p-deb1f523.entry.js} +1 -1
  153. package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
  154. package/dist/sankhyablocks/{p-ba426ea9.entry.js → p-e9beab79.entry.js} +1 -1
  155. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  156. package/dist/types/components/snk-application/snk-application.d.ts +29 -14
  157. package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
  158. package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
  159. package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
  160. package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
  161. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +8 -6
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +3 -3
  164. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
  165. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +65 -0
  166. package/dist/types/components/snk-form/snk-form.d.ts +71 -0
  167. package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
  168. package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
  169. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
  170. package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
  171. package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
  172. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +6 -5
  173. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
  174. package/dist/types/components.d.ts +358 -13
  175. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
  176. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
  177. package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
  178. package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -2
  179. package/dist/types/lib/utils/constants.d.ts +76 -0
  180. package/dist/types/lib/utils/pesquisa.d.ts +2 -1
  181. package/package.json +4 -3
  182. package/react/components.d.ts +6 -0
  183. package/react/components.js +6 -0
  184. package/react/components.js.map +1 -1
  185. package/dist/cjs/snk-form_2.cjs.entry.js +0 -247
  186. package/dist/esm/snk-form_2.entry.js +0 -242
  187. package/dist/sankhyablocks/p-21e940aa.entry.js +0 -1
  188. package/dist/sankhyablocks/p-2eea7eea.js +0 -1
  189. package/dist/sankhyablocks/p-42036db1.entry.js +0 -84
  190. package/dist/sankhyablocks/p-77216252.entry.js +0 -1
  191. package/dist/sankhyablocks/p-86f15ffe.js +0 -1
  192. package/dist/sankhyablocks/p-97009a2c.entry.js +0 -1
  193. package/dist/sankhyablocks/p-a14c49db.entry.js +0 -1
  194. package/dist/sankhyablocks/p-fac2b6a9.js +0 -2
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-20e8b68a.js');
6
+ const core = require('@sankhyalabs/core');
7
+ const constants = require('./constants-9056ca9e.js');
8
+ const configurableElementsStorage = require('./configurableElementsStorage-93459c72.js');
9
+
10
+ const snkConfigModalCss = ".sc-snk-config-modal-h{--snk-config-modal__button-close--padding-left:var(--space--medium, 12px);--snk-config-modal__title--color:var(--title--primary, #2B3A54);--snk-config-modal__title--font-family:var(--font-pattern, \"Sora\");--snk-config-modal__title--font-size:var(--title--large, 20px);--snk-config-modal__title--font-weight:var(--text-weight--extra-large, 700);--snk-config-modal__subtitle--color:var(--title--primary, #2B3A54);--snk-config-modal__subtitle--font-family:var(--font-pattern, \"Sora\");--snk-config-modal__subtitle--font-size:var(--text--medium, 14px);--snk-config-modal__subtitle--font-weight:var(--text-weight--large, 600);--snk-config-modal__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-config-modal__scrollbar--width:var(--space--medium, 12px);--snk-config-modal__scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-config-modal__scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-config-modal-h{width:359px;max-width:359px}}.snk-config-modal__button-config.sc-snk-config-modal{--ez-button--min-width:100%}.snk-config-modal__header.sc-snk-config-modal{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-config-modal__title.sc-snk-config-modal{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-config-modal__title--color);font-size:var(--snk-config-modal__title--font-size);font-family:var(--snk-config-modal__title--font-family);font-weight:var(--snk-config-modal__title--font-weight)}.snk-config-modal__subtitle.sc-snk-config-modal{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-config-modal__subtitle--color);font-size:var(--snk-config-modal__subtitle--font-size);font-family:var(--snk-config-modal__subtitle--font-family);font-weight:var(--snk-config-modal__subtitle--font-weight)}.snk-config-modal__button-close.sc-snk-config-modal{padding-left:var(--snk-config-modal__button-close--padding-left)}.snk-config-modal__main.sc-snk-config-modal{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-config-modal__scrollbar--background-color-primary) var(--snk-config-modal__scrollbar--background-color-secondary)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar-track{background-color:var(--snk-config-modal__scrollbar--background-color-secondary)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar-thumb{background-color:var(--snk-config-modal__scrollbar--background-color-primary);border-radius:var(--snk-config-modal__scrollbar--border-radius)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar{background-color:var(--snk-config-modal__scrollbar--background-color-secondary);width:var(--snk-config-modal__scrollbar--width);max-width:var(--snk-config-modal__scrollbar--width);min-width:var(--snk-config-modal__scrollbar--width)}";
11
+
12
+ const GRID_MODE = constants.VIEW_MODE.grid;
13
+ const FORM_MODE = constants.VIEW_MODE.form;
14
+ const SnkConfigModal = class {
15
+ constructor(hostRef) {
16
+ index.registerInstance(this, hostRef);
17
+ this.cancelConfig = index.createEvent(this, "cancelConfig", 7);
18
+ this.changeConfig = index.createEvent(this, "changeConfig", 7);
19
+ /**
20
+ * Define se o modo grid está ativo.
21
+ */
22
+ this.gridMode = true;
23
+ }
24
+ dispatchChange(openConfig = false) {
25
+ const data = {
26
+ viewMode: this.gridMode ? GRID_MODE.index : FORM_MODE.index,
27
+ openConfig
28
+ };
29
+ this.changeConfig.emit(data);
30
+ }
31
+ closeConfig() {
32
+ this.cancelConfig.emit();
33
+ }
34
+ onChecked(evt) {
35
+ const value = evt === null || evt === void 0 ? void 0 : evt.detail;
36
+ this.gridMode = value === "G" ? true : false;
37
+ this.dispatchChange();
38
+ }
39
+ onClicked() {
40
+ this.dispatchChange(true);
41
+ }
42
+ /**
43
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
44
+ * através de um pequeno modulo na estrutura da aplicação:
45
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
46
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-configurator.msg.ts"
47
+ */
48
+ getMessage(key) {
49
+ return this._application.messagesBuilder.getMessage(key, {});
50
+ }
51
+ componentWillLoad() {
52
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
53
+ }
54
+ render() {
55
+ return (index.h(index.Host, null, index.h("div", { class: "snk-config-modal__header" }, index.h("label", { class: "snk-config-modal__title" }, this.getMessage("snkConfigModal.titleConfigurations")), index.h("div", { class: "snk-config-modal__button-close" }, index.h("ez-button", { mode: 'icon', iconName: "close", size: 'medium', onClick: () => this.closeConfig() }))), index.h("div", { class: "snk-config-modal__main" }, index.h("ez-radio-button", { class: "ez-margin-top--medium", label: this.getMessage("snkConfigModal.subTitleModeConfig"), value: this.gridMode ? "G" : "F", onEzChange: (evt) => this.onChecked(evt) }, configurableElementsStorage.ConfigurableElementsStorage.getForm(this.configName) && index.h("ez-radio-button-option", { label: this.getMessage("snkConfigModal.labelGrid"), value: "G" }), configurableElementsStorage.ConfigurableElementsStorage.getGrid(this.configName) && index.h("ez-radio-button-option", { label: this.getMessage("snkConfigModal.labelForm"), value: "F" })), index.h("ez-button", { mode: "slim", label: this.gridMode
56
+ ? this.getMessage("snkConfigModal.labelConfigGrid")
57
+ : this.getMessage("snkConfigModal.labelConfigForm"), class: "snk-config-modal__button-config ez-button--primary", onClick: () => this.onClicked() }), index.h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" }))));
58
+ }
59
+ };
60
+ SnkConfigModal.style = snkConfigModalCss;
61
+
62
+ exports.snk_config_modal = SnkConfigModal;
@@ -0,0 +1,230 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-20e8b68a.js');
6
+ const core = require('@sankhyalabs/core');
7
+ const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
8
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
9
+ const constants = require('./constants-9056ca9e.js');
10
+
11
+ const snkConfigOptionsCss = ".sc-snk-config-options-h{width:100%;border:2px solid var(--color--secondary-200);border-radius:15px}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
12
+
13
+ const SnkConfigOptions = class {
14
+ constructor(hostRef) {
15
+ index.registerInstance(this, hostRef);
16
+ this.configOptionsChanged = index.createEvent(this, "configOptionsChanged", 7);
17
+ /**
18
+ * Armazena as propriedades do campo
19
+ */
20
+ this.fieldConfig = {};
21
+ }
22
+ onConfigDefault(optionSelected) {
23
+ if (optionSelected != undefined) {
24
+ this._defaultType = optionSelected;
25
+ this.fieldConfig.defaultValue = {
26
+ type: this._defaultType
27
+ };
28
+ this.configOptionsChanged.emit(this.fieldConfig);
29
+ }
30
+ }
31
+ buildOptions() {
32
+ var _a, _b, _c;
33
+ const interfaceField = (_c = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name)) === null || _c === void 0 ? void 0 : _c.userInterface;
34
+ return constants.VARS_BY_TYPE.UserInterface[interfaceField];
35
+ }
36
+ enabledValueDefault() {
37
+ var _a, _b, _c;
38
+ const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
39
+ const allowDefault = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.allowDefault;
40
+ const hasVariableVar = constants.VARS_BY_TYPE.UserInterface.hasOwnProperty(field === null || field === void 0 ? void 0 : field.userInterface);
41
+ if ((allowDefault == undefined || allowDefault === "true") && hasVariableVar) {
42
+ return true;
43
+ }
44
+ return false;
45
+ }
46
+ isAllowDefault() {
47
+ var _a, _b;
48
+ const allowDefault = (_b = (_a = this._fieldProperties) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.allowDefault;
49
+ if (allowDefault == undefined) {
50
+ return true;
51
+ }
52
+ return allowDefault === "true";
53
+ }
54
+ loadDefaultValue() {
55
+ var _a;
56
+ if (this.fieldConfig == undefined) {
57
+ this._defaultType = constants.DEFAULT_TYPE.fixed;
58
+ this.fieldConfig = {
59
+ defaultValue: {
60
+ type: this._defaultType
61
+ }
62
+ };
63
+ }
64
+ else if (((_a = this.fieldConfig.defaultValue) === null || _a === void 0 ? void 0 : _a.type) == undefined) {
65
+ this._defaultType = constants.DEFAULT_TYPE.fixed;
66
+ this.fieldConfig.defaultValue = {
67
+ type: this._defaultType
68
+ };
69
+ }
70
+ else {
71
+ this._defaultType = this.fieldConfig.defaultValue.type;
72
+ }
73
+ }
74
+ getFieldProperties(field) {
75
+ var _a;
76
+ if (field != undefined) {
77
+ return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field);
78
+ }
79
+ }
80
+ getMessage(key, params) {
81
+ return this._application.messagesBuilder.getMessage(key, params);
82
+ }
83
+ getDefaultType() {
84
+ var _a;
85
+ return (_a = this.fieldConfig.defaultValue.type) !== null && _a !== void 0 ? _a : constants.DEFAULT_TYPE.fixed;
86
+ }
87
+ getEnabledByProperty(property) {
88
+ const properties = this._fieldProperties;
89
+ if (properties != undefined && properties[property] === true) {
90
+ return false;
91
+ }
92
+ return true;
93
+ }
94
+ getValueByProperty(property) {
95
+ const properties = this._fieldProperties;
96
+ if (properties != undefined && properties[property] === true) {
97
+ return true;
98
+ }
99
+ return this.fieldConfig[property];
100
+ }
101
+ getValidatedValue(fieldValue) {
102
+ var _a, _b;
103
+ if (fieldValue == undefined) {
104
+ return;
105
+ }
106
+ const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
107
+ const dataType = field === null || field === void 0 ? void 0 : field.dataType;
108
+ if (dataType == undefined) {
109
+ return;
110
+ }
111
+ const value = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.waitmessage) != undefined ? undefined :
112
+ dataType !== DataType.DataType.OBJECT && dataType !== DataType.DataType.DATE
113
+ && typeof fieldValue === "object"
114
+ ? fieldValue.value
115
+ : fieldValue;
116
+ return dataType === DataType.DataType.OBJECT ? JSON.stringify(value) : value;
117
+ }
118
+ buildInputDefault({ value, enabled, label, name, required, userInterface }, properties = undefined, mode = undefined) {
119
+ let options;
120
+ let precision = 0;
121
+ let prettyPrecision = 0;
122
+ const TagName = userInterface == undefined || constants.TAGS_BY_TYPE[userInterface] == undefined
123
+ ? constants.TAGS_BY_TYPE.DEFAULT
124
+ : constants.TAGS_BY_TYPE[userInterface];
125
+ if (userInterface === core.UserInterface.OPTIONSELECTOR) {
126
+ const prop = properties === null || properties === void 0 ? void 0 : properties.options;
127
+ if (typeof prop === "string") {
128
+ const parsed = core.ObjectUtils.stringToObject(prop);
129
+ options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
130
+ }
131
+ else {
132
+ options = prop;
133
+ }
134
+ }
135
+ else if (userInterface === core.UserInterface.DECIMALNUMBER) {
136
+ precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
137
+ prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
138
+ }
139
+ return index.h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
140
+ }
141
+ getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
142
+ switch (userInterface) {
143
+ case core.UserInterface.SEARCH:
144
+ return {
145
+ suppressEmptyOption: required,
146
+ optionLoader: (searchArgument) => this.onSearch(searchArgument)
147
+ };
148
+ case core.UserInterface.OPTIONSELECTOR:
149
+ return {
150
+ suppressEmptyOption: required,
151
+ options
152
+ };
153
+ case core.UserInterface.CHECKBOX:
154
+ case core.UserInterface.SWITCH:
155
+ return {
156
+ mode
157
+ };
158
+ case core.UserInterface.INTEGERNUMBER:
159
+ case core.UserInterface.DECIMALNUMBER:
160
+ return {
161
+ precision,
162
+ prettyPrecision,
163
+ onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
164
+ };
165
+ case core.UserInterface.DATE:
166
+ case core.UserInterface.DATETIME:
167
+ case core.UserInterface.TIME:
168
+ return {
169
+ onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
170
+ };
171
+ default:
172
+ return {};
173
+ }
174
+ }
175
+ onChange(fieldValue) {
176
+ this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
177
+ this.configOptionsChanged.emit(this.fieldConfig);
178
+ }
179
+ onSearch(searchArgument) {
180
+ if (this._application != undefined && this.fieldConfig != undefined) {
181
+ return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
182
+ }
183
+ }
184
+ buildField(field) {
185
+ const { config, descriptor } = field;
186
+ const { name, label, readOnly, required, defaultValue } = config;
187
+ const { userInterface, properties } = descriptor;
188
+ const enabled = (properties === null || properties === void 0 ? void 0 : properties.allowDefault) != undefined ? properties.allowDefault === "true" : !readOnly;
189
+ let value;
190
+ if (enabled) {
191
+ value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
192
+ if (value != undefined) {
193
+ value = DataType.getConvertedValue(descriptor === null || descriptor === void 0 ? void 0 : descriptor.dataType, value);
194
+ }
195
+ }
196
+ const configField = { value, enabled, label, name, required, userInterface };
197
+ switch (userInterface) {
198
+ case core.UserInterface.SWITCH:
199
+ return this.buildInputDefault(configField, undefined, utils.CheckMode.SWITCH);
200
+ case core.UserInterface.CHECKBOX:
201
+ return this.buildInputDefault(configField, undefined, utils.CheckMode.REGULAR);
202
+ case core.UserInterface.OPTIONSELECTOR:
203
+ case core.UserInterface.DECIMALNUMBER:
204
+ return this.buildInputDefault(configField, properties);
205
+ default:
206
+ return this.buildInputDefault(configField);
207
+ }
208
+ }
209
+ componentWillLoad() {
210
+ var _a;
211
+ this.loadDefaultValue();
212
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
213
+ this._fieldProperties = this.getFieldProperties((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
214
+ }
215
+ render() {
216
+ var _a, _b;
217
+ return (index.h(index.Host, null, index.h("div", { id: this.idConfig }, index.h("div", { class: "ez-row ez-padding--medium" }, index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-text-input", { label: this.getMessage("snkConfigOptions.label.nameField"), value: (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label, onEzChange: (evt) => { this.fieldConfig.label = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.typeValueDefault"), suppressEmptyOption: true, enabled: this.enabledValueDefault(), onEzChange: (evt) => { var _a; return this.onConfigDefault((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, value: this.getDefaultType() }, index.h("option", { value: constants.DEFAULT_TYPE.fixed }, this.getMessage("snkConfigOptions.options.valueFixed")), index.h("option", { value: constants.DEFAULT_TYPE.variable }, this.getMessage("snkConfigOptions.options.variable")))), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, this._defaultType === constants.DEFAULT_TYPE.variable ?
218
+ index.h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.valueDefault"), enabled: this.isAllowDefault(), onEzChange: (evt) => { var _a; this.fieldConfig.defaultValue.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value; this.configOptionsChanged.emit(this.fieldConfig); }, value: this.fieldConfig.defaultValue.value, options: this.buildOptions() })
219
+ :
220
+ ((_b = this._fieldProperties) === null || _b === void 0 ? void 0 : _b.userInterface) &&
221
+ this.buildField({
222
+ descriptor: this._fieldProperties,
223
+ config: this.fieldConfig
224
+ }))), index.h("div", { class: "ez-row ez-padding--medium config-options__switch-row" }, index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.clearDuplicate"), value: this.fieldConfig.cleanOnCopy, onEzChange: (evt) => { this.fieldConfig.cleanOnCopy = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.requiredField"), enabled: this.getEnabledByProperty("required"), value: this.getValueByProperty("required"), onEzChange: (evt) => { this.fieldConfig.required = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.protectedField"), enabled: this.getEnabledByProperty("readOnly"), value: this.getValueByProperty("readOnly"), onEzChange: (evt) => { this.fieldConfig.readOnly = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } }))))));
225
+ }
226
+ get _element() { return index.getElement(this); }
227
+ };
228
+ SnkConfigOptions.style = snkConfigOptionsCss;
229
+
230
+ exports.snk_config_options = SnkConfigOptions;
@@ -2,12 +2,197 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6fcf07f3.js');
5
+ const index = require('./index-20e8b68a.js');
6
6
  const core = require('@sankhyalabs/core');
7
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
+ const constants = require('./constants-9056ca9e.js');
9
+ const configurableElementsStorage = require('./configurableElementsStorage-93459c72.js');
7
10
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
8
11
  const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
9
12
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
10
- const taskbarElements = require('./taskbar-elements-aedfeae6.js');
13
+ const taskbarElements = require('./taskbar-elements-9a4b1e19.js');
14
+
15
+ const GRID_MODE = constants.VIEW_MODE.grid;
16
+ const FORM_MODE = constants.VIEW_MODE.form;
17
+ const SnkConfigurator = class {
18
+ constructor(hostRef) {
19
+ index.registerInstance(this, hostRef);
20
+ this.changeViewMode = index.createEvent(this, "changeViewMode", 7);
21
+ /**
22
+ * Nome do componente que será vinculado ao `data-configurator-parent` para controlar o modal de configurações.
23
+ */
24
+ this.name = "snkConfigurator";
25
+ /**
26
+ * Define se o campo está habilitado.
27
+ */
28
+ this.enabled = true;
29
+ }
30
+ /**
31
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
32
+ * através de um pequeno modulo na estrutura da aplicação:
33
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
34
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-configurator.msg.ts"
35
+ */
36
+ getMessage(key) {
37
+ return this._application.messagesBuilder.getMessage(key, {});
38
+ }
39
+ controlConfigModal(opened) {
40
+ var _a;
41
+ if (this._modal != undefined) {
42
+ this._modal.opened = opened;
43
+ if (this._configModal != undefined) {
44
+ this._configModal.gridMode = ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.offsetParent) != undefined;
45
+ }
46
+ }
47
+ }
48
+ changeConfigModal(evt) {
49
+ const data = evt === null || evt === void 0 ? void 0 : evt.detail;
50
+ if (data === null || data === void 0 ? void 0 : data.openConfig) {
51
+ this.controlConfigModal(false);
52
+ this.callShowConfig(data === null || data === void 0 ? void 0 : data.viewMode);
53
+ }
54
+ else if ((data === null || data === void 0 ? void 0 : data.viewMode) === GRID_MODE.index) {
55
+ this.changeViewMode.emit(GRID_MODE.name);
56
+ }
57
+ else if ((data === null || data === void 0 ? void 0 : data.viewMode) === FORM_MODE.index) {
58
+ this.changeViewMode.emit(FORM_MODE.name);
59
+ }
60
+ }
61
+ callShowConfig(viewMode) {
62
+ if (viewMode === GRID_MODE.index) {
63
+ if (this._grid == undefined) {
64
+ this.findGrid();
65
+ }
66
+ if (this._grid != undefined) {
67
+ this._grid.setShowGridConfig(true);
68
+ }
69
+ }
70
+ else if (viewMode === FORM_MODE.index) {
71
+ if (this._form == undefined) {
72
+ this.findForm();
73
+ }
74
+ if (this._form != undefined) {
75
+ this._form.setShowFormConfig(true);
76
+ }
77
+ }
78
+ }
79
+ getConfigModal() {
80
+ const modalContainer = document.createElement("ez-modal");
81
+ modalContainer.modalSize = "small";
82
+ modalContainer.opened = false;
83
+ modalContainer.closeEsc = false;
84
+ modalContainer.closeOutsideClick = false;
85
+ modalContainer.dataset.configuratorModal = this.name;
86
+ modalContainer.addEventListener(constants.CONFIG_EVENTS.closeModal, () => {
87
+ this.controlConfigModal(false);
88
+ });
89
+ const modalContent = document.createElement("snk-config-modal");
90
+ modalContent.addEventListener(constants.CONFIG_EVENTS.cancelConfig, () => {
91
+ this.controlConfigModal(false);
92
+ });
93
+ modalContent.addEventListener(constants.CONFIG_EVENTS.changeConfig, (evt) => {
94
+ this.changeConfigModal(evt);
95
+ });
96
+ modalContent.configName = this.configName;
97
+ modalContainer.append(modalContent);
98
+ return modalContainer;
99
+ }
100
+ findConfigModal() {
101
+ let modalContainer = document.body.querySelector(`[data-configurator-modal="${this.name}"]`);
102
+ if (modalContainer == undefined) {
103
+ modalContainer = this.getConfigModal();
104
+ document.body.appendChild(modalContainer);
105
+ }
106
+ this._modal = modalContainer;
107
+ this._configModal = modalContainer.querySelector("snk-config-modal");
108
+ }
109
+ findGrid() {
110
+ if (this._grid != undefined) {
111
+ return;
112
+ }
113
+ this._grid = configurableElementsStorage.ConfigurableElementsStorage.getGrid(this.configName);
114
+ if (this._grid != undefined && this._grid.dataset.eventConfigChanged == undefined) {
115
+ this._grid.dataset.eventConfigChanged = "true";
116
+ this._grid.addEventListener(constants.CONFIG_EVENTS.configChanged, (evt) => {
117
+ this.saveConfig(evt);
118
+ });
119
+ }
120
+ }
121
+ findForm() {
122
+ if (this._form != undefined) {
123
+ return;
124
+ }
125
+ this._form = configurableElementsStorage.ConfigurableElementsStorage.getForm(this.configName);
126
+ if (this._form != undefined && this._form.dataset.eventConfigChanged == undefined) {
127
+ this._form.dataset.eventConfigChanged = "true";
128
+ this._form.addEventListener(constants.CONFIG_EVENTS.configChanged, (evt) => {
129
+ this.saveConfig(evt);
130
+ });
131
+ }
132
+ }
133
+ saveConfig(evt) {
134
+ const config = evt === null || evt === void 0 ? void 0 : evt.detail;
135
+ if (this._application != undefined && config != undefined) {
136
+ if ((config === null || config === void 0 ? void 0 : config.fields) != undefined) {
137
+ this._application.saveFormConfig(config, this.configName)
138
+ .then((response) => {
139
+ if ((response === null || response === void 0 ? void 0 : response.resource) != undefined) {
140
+ this.loadFormConfig(true);
141
+ }
142
+ });
143
+ }
144
+ else if ((config === null || config === void 0 ? void 0 : config.columns) != undefined) {
145
+ this._application.saveGridConfig(config)
146
+ .then((response) => {
147
+ if ((response === null || response === void 0 ? void 0 : response.resource) != undefined) {
148
+ this.setGridConfig(response.resource);
149
+ }
150
+ });
151
+ }
152
+ }
153
+ }
154
+ setGridConfig(strConfig) {
155
+ if (this._grid != undefined) {
156
+ const config = core.ObjectUtils.stringToObject(strConfig);
157
+ this._grid.setConfig(config).then(() => {
158
+ utils.ApplicationUtils.info(this.getMessage("snkConfigurator.msgSaveSuccessfully"), { iconName: "check" });
159
+ });
160
+ }
161
+ }
162
+ loadGridConfig() {
163
+ if (this._application != undefined && this.configName != undefined && this._grid != undefined) {
164
+ this._application.loadGridConfig(this.configName).then((config) => {
165
+ this._grid.setConfig(config);
166
+ });
167
+ }
168
+ }
169
+ loadFormConfig(showInfoSuccess = false) {
170
+ if (this._application != undefined && this.configName != undefined && this._form != undefined) {
171
+ this._application.loadFormConfig(this.configName).then((config) => {
172
+ this._form.setConfig(config).then(() => {
173
+ if (showInfoSuccess) {
174
+ utils.ApplicationUtils.info(this.getMessage("snkConfigurator.msgSaveSuccessfully"), { iconName: "check" });
175
+ }
176
+ });
177
+ });
178
+ }
179
+ }
180
+ loadConfig() {
181
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
182
+ this.loadGridConfig();
183
+ this.loadFormConfig();
184
+ }
185
+ componentDidLoad() {
186
+ this.findConfigModal();
187
+ this.findGrid();
188
+ this.findForm();
189
+ this.loadConfig();
190
+ }
191
+ render() {
192
+ return (index.h("ez-button", { mode: "icon", iconName: "settings-inverted", size: "small", enabled: this.enabled, onClick: () => this.controlConfigModal(true) }));
193
+ }
194
+ get _element() { return index.getElement(this); }
195
+ };
11
196
 
12
197
  const buildFilter = (item) => {
13
198
  switch (item.type) {
@@ -106,7 +291,7 @@ function buildPersonalized(item) {
106
291
  };
107
292
  }
108
293
 
109
- const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}";
294
+ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 2);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}";
110
295
 
111
296
  const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
112
297
  const DEFAULT_FILTER = "DEFAULT_FILTER";
@@ -782,7 +967,7 @@ const SnkFilterModal = class {
782
967
  }
783
968
  buildItems(list) {
784
969
  return list.map(item => {
785
- return (index.h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, index.h("ez-check", { id: `checkbox_${item.id}`, tabIndex: "-1", class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: "switch" }), index.h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
970
+ return (index.h("button", { onClick: () => this.updateValue(item.id), class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, index.h("ez-check", { id: `checkbox_${item.id}`, tabIndex: "-1", class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: utils.CheckMode.SWITCH }), index.h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)));
786
971
  });
787
972
  }
788
973
  itemKeyBoardSelect(event, item) {
@@ -817,6 +1002,7 @@ const SnkTaskbar = class {
817
1002
  constructor(hostRef) {
818
1003
  index.registerInstance(this, hostRef);
819
1004
  this.actionClick = index.createEvent(this, "actionClick", 7);
1005
+ this.actionChange = index.createEvent(this, "actionChange", 7);
820
1006
  this._titleKeyByElement = {
821
1007
  [taskbarElements.TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
822
1008
  [taskbarElements.TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
@@ -829,8 +1015,8 @@ const SnkTaskbar = class {
829
1015
  [taskbarElements.TaskbarElement.CANCEL]: "snkTaskbar.titleCancel",
830
1016
  [taskbarElements.TaskbarElement.SAVE]: "snkTaskbar.titleSave",
831
1017
  [taskbarElements.TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
832
- [taskbarElements.TaskbarElement.CONFIG_GRID]: "snkTaskbar.titleConfigGrid",
833
- [taskbarElements.TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode"
1018
+ [taskbarElements.TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode",
1019
+ [taskbarElements.TaskbarElement.CONFIGURATOR]: "snkTaskbar.titleConfigurator"
834
1020
  };
835
1021
  }
836
1022
  observeButtons() {
@@ -914,7 +1100,7 @@ const SnkTaskbar = class {
914
1100
  className += "ez-padding-left--medium";
915
1101
  }
916
1102
  if (taskbarElements.TaskbarElement[def.toString()]) {
917
- return taskbarElements.buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
1103
+ return taskbarElements.buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName);
918
1104
  }
919
1105
  else {
920
1106
  return taskbarElements.buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
@@ -962,6 +1148,7 @@ const SnkTaskbar = class {
962
1148
  };
963
1149
  SnkTaskbar.style = snkTaskbarCss;
964
1150
 
1151
+ exports.snk_configurator = SnkConfigurator;
965
1152
  exports.snk_filter_bar = SnkFilterBar;
966
1153
  exports.snk_filter_item = SnkFilterItem;
967
1154
  exports.snk_filter_list = SnkFilterList;
@@ -2,13 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6fcf07f3.js');
5
+ const index = require('./index-20e8b68a.js');
6
6
  const core = require('@sankhyalabs/core');
7
+ const constants = require('./constants-9056ca9e.js');
8
+ const taskbarElements = require('./taskbar-elements-9a4b1e19.js');
7
9
 
8
10
  const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
9
11
 
10
- const GRID_MODE = 0;
11
- const FORM_MODE = 1;
12
+ const GRID_MODE = constants.VIEW_MODE.grid;
13
+ const FORM_MODE = constants.VIEW_MODE.form;
12
14
  const SnkCrud = class {
13
15
  constructor(hostRef) {
14
16
  index.registerInstance(this, hostRef);
@@ -21,15 +23,15 @@ const SnkCrud = class {
21
23
  this.executeAction(mode);
22
24
  }
23
25
  async gridToForm(keepFormMode = false) {
24
- this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE;
25
- this._viewStack.show(FORM_MODE);
26
+ this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE.index;
27
+ this._viewStack.show(FORM_MODE.index);
26
28
  }
27
29
  async executeAction(act) {
28
- if (act === "GRID_MODE") {
29
- this._viewStack.show(GRID_MODE);
30
+ if (act === taskbarElements.TaskbarElement.GRID_MODE) {
31
+ this._viewStack.show(GRID_MODE.index);
30
32
  }
31
- else if (act === "FORM_MODE" || act === "UPDATE") {
32
- this.gridToForm(act !== "UPDATE");
33
+ else if (act === taskbarElements.TaskbarElement.FORM_MODE || act === taskbarElements.TaskbarElement.UPDATE) {
34
+ this.gridToForm(act !== taskbarElements.TaskbarElement.UPDATE);
33
35
  }
34
36
  }
35
37
  insertionModeHandler() {
@@ -37,7 +39,7 @@ const SnkCrud = class {
37
39
  }
38
40
  cancelHandler() {
39
41
  if (this._backToGrid) {
40
- this._viewStack.show(GRID_MODE);
42
+ this._viewStack.show(GRID_MODE.index);
41
43
  }
42
44
  }
43
45
  componentWillLoad() {
@@ -67,7 +69,7 @@ const SnkCrud = class {
67
69
  }
68
70
  }
69
71
  render() {
70
- return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, index.h("stack-item", null, index.h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver }, index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, index.h("slot", { name: "SnkFormTaskBar" })))));
72
+ return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-configurator-parent": "snkConfigurator" }, index.h("stack-item", null, index.h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList, statusResolver: this.statusResolver }, index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE.index), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, index.h("slot", { name: "SnkFormTaskBar" })))));
71
73
  }
72
74
  get _element() { return index.getElement(this); }
73
75
  };
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6fcf07f3.js');
5
+ const index = require('./index-20e8b68a.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
- const SnkMessageBuilder = require('./SnkMessageBuilder-b54dfb89.js');
8
+ const SnkMessageBuilder = require('./SnkMessageBuilder-6c2f7bcd.js');
9
9
 
10
10
  const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
11
11