@sankhyalabs/sankhyablocks 1.3.33 → 1.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/cjs/SnkMessageBuilder-7717f1e4.js +326 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/css-shim-b8158822.js +6 -0
  4. package/dist/cjs/dom-36862b77.js +75 -0
  5. package/dist/cjs/filter-item-type.enum-e2e1bc5b.js +14 -0
  6. package/dist/cjs/index-02201bc9.js +2397 -0
  7. package/dist/cjs/index-b0b676c5.js +3298 -0
  8. package/dist/cjs/loader.cjs.js +19 -3
  9. package/dist/cjs/sankhyablocks.cjs.js +117 -5
  10. package/dist/cjs/shadow-css-346c0795.js +389 -0
  11. package/dist/cjs/snk-application.cjs.entry.js +721 -169
  12. package/dist/cjs/snk-crud.cjs.entry.js +70 -0
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +280 -0
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +278 -0
  15. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
  16. package/dist/cjs/snk-filter-detail.cjs.entry.js +49 -0
  17. package/dist/cjs/snk-filter-item.cjs.entry.js +154 -0
  18. package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
  19. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
  20. package/dist/cjs/snk-filter-number.cjs.entry.js +24 -0
  21. package/dist/cjs/snk-filter-period.cjs.entry.js +37 -0
  22. package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
  23. package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
  24. package/dist/cjs/snk-form.cjs.entry.js +133 -0
  25. package/dist/cjs/snk-grid.cjs.entry.js +79 -0
  26. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +160 -0
  28. package/dist/cjs/taskbar-elements-283c737e.js +93 -0
  29. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  30. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  31. package/dist/collection/collection-manifest.json +17 -2
  32. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
  33. package/dist/collection/components/snk-application/snk-application.js +1126 -621
  34. package/dist/collection/components/snk-crud/snk-crud.css +6 -0
  35. package/dist/collection/components/snk-crud/snk-crud.js +203 -0
  36. package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
  37. package/dist/collection/components/snk-data-unit/snk-data-unit.js +544 -0
  38. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
  39. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
  40. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
  41. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +78 -0
  42. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
  43. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  44. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
  45. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +118 -0
  46. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +255 -0
  47. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +114 -0
  49. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +353 -0
  50. package/dist/collection/components/snk-form/snk-form.css +34 -0
  51. package/dist/collection/components/snk-form/snk-form.js +258 -0
  52. package/dist/collection/components/snk-grid/snk-grid.css +18 -0
  53. package/dist/collection/components/snk-grid/snk-grid.js +205 -0
  54. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
  55. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +86 -0
  56. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  57. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  58. package/dist/collection/components/snk-taskbar/snk-taskbar.js +307 -0
  59. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
  60. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +38 -13
  61. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
  62. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +54 -0
  63. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  64. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
  65. package/dist/collection/lib/index.js +1 -0
  66. package/dist/collection/lib/message/SnkMessageBuilder.js +121 -0
  67. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
  68. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +18 -0
  69. package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
  70. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
  71. package/dist/components/SnkMessageBuilder.js +303 -0
  72. package/dist/components/filter-item-type.enum.js +12 -0
  73. package/dist/components/index.d.ts +18 -5
  74. package/dist/components/index.js +22 -0
  75. package/dist/components/index2.js +2384 -0
  76. package/dist/components/snk-application2.js +701 -140
  77. package/dist/components/snk-crud.d.ts +11 -0
  78. package/dist/components/snk-crud.js +133 -0
  79. package/dist/components/snk-data-unit.d.ts +11 -0
  80. package/dist/components/snk-data-unit.js +303 -0
  81. package/dist/components/snk-filter-bar.d.ts +11 -0
  82. package/dist/components/snk-filter-bar.js +6 -0
  83. package/dist/components/snk-filter-bar2.js +310 -0
  84. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  85. package/dist/components/snk-filter-binary-select.js +63 -0
  86. package/dist/components/snk-filter-detail.d.ts +11 -0
  87. package/dist/components/snk-filter-detail.js +6 -0
  88. package/dist/components/snk-filter-detail2.js +63 -0
  89. package/dist/components/snk-filter-item.d.ts +11 -0
  90. package/dist/components/snk-filter-item.js +6 -0
  91. package/dist/components/snk-filter-item2.js +175 -0
  92. package/dist/components/snk-filter-list.d.ts +11 -0
  93. package/dist/components/snk-filter-list.js +6 -0
  94. package/dist/components/snk-filter-list2.js +111 -0
  95. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  96. package/dist/components/snk-filter-multi-select.js +39 -0
  97. package/dist/components/snk-filter-number.d.ts +11 -0
  98. package/dist/components/snk-filter-number.js +40 -0
  99. package/dist/components/snk-filter-period.d.ts +11 -0
  100. package/dist/components/snk-filter-period.js +53 -0
  101. package/dist/components/snk-filter-search.d.ts +11 -0
  102. package/dist/components/snk-filter-search.js +62 -0
  103. package/dist/components/snk-filter-text.d.ts +11 -0
  104. package/dist/components/snk-filter-text.js +38 -0
  105. package/dist/components/snk-form.d.ts +11 -0
  106. package/dist/components/snk-form.js +6 -0
  107. package/dist/components/snk-form2.js +159 -0
  108. package/dist/components/snk-grid.d.ts +11 -0
  109. package/dist/components/snk-grid.js +6 -0
  110. package/dist/components/snk-grid2.js +127 -0
  111. package/dist/components/snk-pesquisa2.js +1 -1
  112. package/dist/components/snk-taskbar.d.ts +11 -0
  113. package/dist/components/snk-taskbar.js +6 -0
  114. package/dist/components/snk-taskbar2.js +264 -0
  115. package/dist/components/taskbar-processor.js +45 -0
  116. package/dist/components/teste-pesquisa.js +1 -1
  117. package/dist/esm/SnkMessageBuilder-a7da466b.js +303 -0
  118. package/dist/esm/app-globals-0f993ce5.js +3 -0
  119. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  120. package/dist/esm/dom-665d6011.js +73 -0
  121. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  122. package/dist/esm/index-2b4d2d14.js +3262 -0
  123. package/dist/esm/index-f1d3e4da.js +2384 -0
  124. package/dist/esm/loader.js +19 -3
  125. package/dist/esm/polyfills/css-shim.js +1 -1
  126. package/dist/esm/sankhyablocks.js +117 -5
  127. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  128. package/dist/esm/snk-application.entry.js +693 -141
  129. package/dist/esm/snk-crud.entry.js +66 -0
  130. package/dist/esm/snk-data-unit.entry.js +276 -0
  131. package/dist/esm/snk-filter-bar.entry.js +274 -0
  132. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  133. package/dist/esm/snk-filter-detail.entry.js +45 -0
  134. package/dist/esm/snk-filter-item.entry.js +150 -0
  135. package/dist/esm/snk-filter-list.entry.js +87 -0
  136. package/dist/esm/snk-filter-multi-select.entry.js +19 -0
  137. package/dist/esm/snk-filter-number.entry.js +20 -0
  138. package/dist/esm/snk-filter-period.entry.js +33 -0
  139. package/dist/esm/snk-filter-search.entry.js +40 -0
  140. package/dist/esm/snk-filter-text.entry.js +18 -0
  141. package/dist/esm/snk-form.entry.js +129 -0
  142. package/dist/esm/snk-grid.entry.js +75 -0
  143. package/dist/esm/snk-pesquisa.entry.js +2 -2
  144. package/dist/esm/snk-taskbar.entry.js +156 -0
  145. package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
  146. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  147. package/dist/esm/teste-pesquisa.entry.js +2 -2
  148. package/dist/sankhyablocks/SnkMessageBuilder-a7da466b.js +303 -0
  149. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  150. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  151. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  152. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  153. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  154. package/dist/sankhyablocks/index-f1d3e4da.js +2384 -0
  155. package/dist/sankhyablocks/index.esm.js +1 -0
  156. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  157. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  158. package/dist/sankhyablocks/snk-application.entry.js +8148 -0
  159. package/dist/sankhyablocks/snk-crud.entry.js +66 -0
  160. package/dist/sankhyablocks/snk-data-unit.entry.js +276 -0
  161. package/dist/sankhyablocks/snk-filter-bar.entry.js +274 -0
  162. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  163. package/dist/sankhyablocks/snk-filter-detail.entry.js +45 -0
  164. package/dist/sankhyablocks/snk-filter-item.entry.js +150 -0
  165. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  166. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
  167. package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
  168. package/dist/sankhyablocks/snk-filter-period.entry.js +33 -0
  169. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  170. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  171. package/dist/sankhyablocks/snk-form.entry.js +129 -0
  172. package/dist/sankhyablocks/snk-grid.entry.js +75 -0
  173. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  174. package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
  175. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
  176. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
  177. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  178. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  179. package/dist/types/components/snk-application/snk-application.d.ts +145 -15
  180. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  181. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
  182. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  183. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +14 -0
  184. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  185. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  186. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  187. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +14 -0
  188. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
  189. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +51 -0
  190. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -0
  191. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  192. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +84 -0
  193. package/dist/types/components.d.ts +696 -8
  194. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
  195. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
  196. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +6 -0
  197. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
  198. package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
  199. package/dist/types/lib/index.d.ts +1 -0
  200. package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
  201. package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
  202. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  203. package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
  204. package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
  205. package/dist/types/stencil-public-runtime.d.ts +15 -4
  206. package/loader/package.json +1 -0
  207. package/package.json +5 -5
  208. package/react/components.d.ts +0 -2
  209. package/react/components.js +0 -2
  210. package/react/components.js.map +1 -1
  211. package/dist/cjs/index-1133bc2a.js +0 -1235
  212. package/dist/esm/index-ffda6382.js +0 -1208
  213. package/dist/sankhyablocks/p-2a7b4cb3.entry.js +0 -1
  214. package/dist/sankhyablocks/p-9520d78a.entry.js +0 -1
  215. package/dist/sankhyablocks/p-bd1b31db.entry.js +0 -69
  216. package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
@@ -0,0 +1,6 @@
1
+ import { S as SnkFilterList$1, d as defineCustomElement$1 } from './snk-filter-list2.js';
2
+
3
+ const SnkFilterList = SnkFilterList$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkFilterList, defineCustomElement };
@@ -0,0 +1,111 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { F as FloatingManager, g as ArrayUtils } from './index2.js';
3
+
4
+ const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
5
+ const MAX_FILTERS = 5;
6
+ const SnkFilterList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.snkItemSelected = createEvent(this, "snkItemSelected", 7);
11
+ this.innerClickCheck = (floatingContainer, node) => {
12
+ if (node && floatingContainer) {
13
+ if (!node.offsetParent) {
14
+ return true;
15
+ }
16
+ let current = node;
17
+ do {
18
+ if (current === floatingContainer || current === this._element) {
19
+ return true;
20
+ }
21
+ } while ((current = current.offsetParent) != null);
22
+ }
23
+ this._detailIsVisible = false;
24
+ return false;
25
+ };
26
+ }
27
+ showList() {
28
+ this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck });
29
+ this._detailIsVisible = true;
30
+ this._showAll = false;
31
+ this._filterArgument = "";
32
+ }
33
+ hideList() {
34
+ if (this._floatingID != undefined) {
35
+ FloatingManager.close(this._floatingID);
36
+ }
37
+ this._floatingID = undefined;
38
+ this._detailIsVisible = false;
39
+ }
40
+ buttonClick() {
41
+ if (this._detailIsVisible) {
42
+ this.hideList();
43
+ }
44
+ else {
45
+ this.showList();
46
+ }
47
+ }
48
+ componentDidRender() {
49
+ if (this._floatingID == undefined) {
50
+ if (this._popover) {
51
+ this._popover.remove();
52
+ }
53
+ }
54
+ }
55
+ buildItemElement(item) {
56
+ return (h("div", { class: "ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item", onClick: () => this.itemSelected(item.name) }, item.iconName ? h("ez-icon", { iconName: item.iconName, size: "small", class: `ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${item.iconClass || ""}` }) : undefined, h("div", { class: `ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${item.labelClass || ""}` }, item.label)));
57
+ }
58
+ itemSelected(itemName) {
59
+ if (itemName === SHOW_MORE_ITEM_NAME) {
60
+ this._showAll = true;
61
+ }
62
+ else {
63
+ this.hideList();
64
+ this.snkItemSelected.emit(itemName);
65
+ }
66
+ }
67
+ getFilterItems() {
68
+ const items = this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
69
+ if (items.length === 0) {
70
+ return h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty" }, this.emptyText);
71
+ }
72
+ const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
73
+ if (hideItems) {
74
+ items.splice(MAX_FILTERS);
75
+ items.push({ kind: "INTERNAL", label: "Mostrar mais", iconName: "dots-horizontal", name: SHOW_MORE_ITEM_NAME, iconClass: "snk-filter-bar__filter-list-item__icon--secondary", labelClass: "snk-filter-bar__filter-list-item__label--secondary" });
76
+ }
77
+ return h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
78
+ }
79
+ getFooterItems() {
80
+ return this.items.filter(item => item.kind === "FOOTER");
81
+ }
82
+ render() {
83
+ return (h(Host, { class: "ez-flex ez-flex--column" }, h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, h("slot", { name: "leftIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, h("ez-filter-input", { ref: ref => this._filterInput = ref, mode: "slim", label: this.findFilterText, value: this._filterArgument, onEzChange: (evt) => this._filterArgument = evt.detail }), this.getFilterItems(), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
84
+ }
85
+ get _element() { return this; }
86
+ }, [4, "snk-filter-list", {
87
+ "label": [1],
88
+ "iconName": [1, "icon-name"],
89
+ "items": [16],
90
+ "getMessage": [16],
91
+ "emptyText": [1, "empty-text"],
92
+ "findFilterText": [1, "find-filter-text"],
93
+ "buttonClass": [1, "button-class"],
94
+ "_filterArgument": [32],
95
+ "_showAll": [32]
96
+ }]);
97
+ function defineCustomElement() {
98
+ if (typeof customElements === "undefined") {
99
+ return;
100
+ }
101
+ const components = ["snk-filter-list"];
102
+ components.forEach(tagName => { switch (tagName) {
103
+ case "snk-filter-list":
104
+ if (!customElements.get(tagName)) {
105
+ customElements.define(tagName, SnkFilterList);
106
+ }
107
+ break;
108
+ } });
109
+ }
110
+
111
+ export { SnkFilterList as S, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterMultiSelect extends Components.SnkFilterMultiSelect, HTMLElement {}
4
+ export const SnkFilterMultiSelect: {
5
+ prototype: SnkFilterMultiSelect;
6
+ new (): SnkFilterMultiSelect;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,39 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterMultiSelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ }
9
+ ezChangeListener(evt) {
10
+ this.value = evt.detail.value;
11
+ }
12
+ render() {
13
+ if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
14
+ return undefined;
15
+ }
16
+ return (h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
17
+ }
18
+ }, [0, "snk-filter-multi-select", {
19
+ "value": [1544],
20
+ "config": [16]
21
+ }, [[0, "ezChange", "ezChangeListener"]]]);
22
+ function defineCustomElement$1() {
23
+ if (typeof customElements === "undefined") {
24
+ return;
25
+ }
26
+ const components = ["snk-filter-multi-select"];
27
+ components.forEach(tagName => { switch (tagName) {
28
+ case "snk-filter-multi-select":
29
+ if (!customElements.get(tagName)) {
30
+ customElements.define(tagName, SnkFilterMultiSelect$1);
31
+ }
32
+ break;
33
+ } });
34
+ }
35
+
36
+ const SnkFilterMultiSelect = SnkFilterMultiSelect$1;
37
+ const defineCustomElement = defineCustomElement$1;
38
+
39
+ export { SnkFilterMultiSelect, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterNumber extends Components.SnkFilterNumber, HTMLElement {}
4
+ export const SnkFilterNumber: {
5
+ prototype: SnkFilterNumber;
6
+ new (): SnkFilterNumber;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,40 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterPeriod = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ }
9
+ ezChangeListener(evt) {
10
+ this.value = evt.detail;
11
+ }
12
+ render() {
13
+ var _a;
14
+ if (!this.config || this.config.type !== FilterItemType.NUMBER) {
15
+ return undefined;
16
+ }
17
+ return (h("ez-number-input", { label: this.config.label, value: this.config.value, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision }));
18
+ }
19
+ }, [0, "snk-filter-number", {
20
+ "config": [16],
21
+ "value": [2]
22
+ }, [[0, "ezChange", "ezChangeListener"]]]);
23
+ function defineCustomElement$1() {
24
+ if (typeof customElements === "undefined") {
25
+ return;
26
+ }
27
+ const components = ["snk-filter-number"];
28
+ components.forEach(tagName => { switch (tagName) {
29
+ case "snk-filter-number":
30
+ if (!customElements.get(tagName)) {
31
+ customElements.define(tagName, SnkFilterPeriod);
32
+ }
33
+ break;
34
+ } });
35
+ }
36
+
37
+ const SnkFilterNumber = SnkFilterPeriod;
38
+ const defineCustomElement = defineCustomElement$1;
39
+
40
+ export { SnkFilterNumber, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterPeriod extends Components.SnkFilterPeriod, HTMLElement {}
4
+ export const SnkFilterPeriod: {
5
+ prototype: SnkFilterPeriod;
6
+ new (): SnkFilterPeriod;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,53 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ }
9
+ ezChangeListener() {
10
+ const start = this._startDate.value;
11
+ const end = this._endDate.value;
12
+ this.value = (start || end ? { start, end } : undefined);
13
+ }
14
+ getDate(prop) {
15
+ const objValue = this.value ? this.value[prop] : null;
16
+ if (objValue instanceof Date) {
17
+ return objValue;
18
+ }
19
+ if (typeof objValue === "string") {
20
+ let date = new Date(objValue);
21
+ date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
22
+ return date;
23
+ }
24
+ return null;
25
+ }
26
+ render() {
27
+ if (!this.config || this.config.type !== FilterItemType.PERIOD) {
28
+ return undefined;
29
+ }
30
+ return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { label: this.config.label, ref: ref => this._startDate = ref, value: this.getDate("start") }), h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9"), h("ez-date-input", { label: this.config.label, ref: ref => this._endDate = ref, value: this.getDate("end") })));
31
+ }
32
+ }, [0, "snk-filter-period", {
33
+ "config": [16],
34
+ "value": [8]
35
+ }, [[0, "ezChange", "ezChangeListener"]]]);
36
+ function defineCustomElement$1() {
37
+ if (typeof customElements === "undefined") {
38
+ return;
39
+ }
40
+ const components = ["snk-filter-period"];
41
+ components.forEach(tagName => { switch (tagName) {
42
+ case "snk-filter-period":
43
+ if (!customElements.get(tagName)) {
44
+ customElements.define(tagName, SnkFilterPeriod$1);
45
+ }
46
+ break;
47
+ } });
48
+ }
49
+
50
+ const SnkFilterPeriod = SnkFilterPeriod$1;
51
+ const defineCustomElement = defineCustomElement$1;
52
+
53
+ export { SnkFilterPeriod, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterSearch extends Components.SnkFilterSearch, HTMLElement {}
4
+ export const SnkFilterSearch: {
5
+ prototype: SnkFilterSearch;
6
+ new (): SnkFilterSearch;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,62 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { A as ApplicationContext } from './index2.js';
3
+ import { F as FilterItemType } from './filter-item-type.enum.js';
4
+
5
+ const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ }
10
+ ezChangeListener(_evt) {
11
+ this.value = this._searchInput.value;
12
+ }
13
+ doSearch(mode, argument) {
14
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
15
+ if (this.fix) {
16
+ this.fix();
17
+ }
18
+ return new Promise((resolve, reject) => {
19
+ application.executePreparedSearch(mode, argument, this.config.props.searchContext)
20
+ .then(result => {
21
+ resolve(result);
22
+ if (this.unfix) {
23
+ this.unfix();
24
+ }
25
+ }).catch(reason => {
26
+ reject(reason);
27
+ if (this.unfix) {
28
+ this.unfix();
29
+ }
30
+ });
31
+ });
32
+ }
33
+ render() {
34
+ if (!this.config || this.config.type !== FilterItemType.SEARCH) {
35
+ return undefined;
36
+ }
37
+ return (h("ez-search", { suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
38
+ }
39
+ }, [0, "snk-filter-search", {
40
+ "config": [16],
41
+ "value": [16],
42
+ "fix": [16],
43
+ "unfix": [16]
44
+ }, [[0, "ezChange", "ezChangeListener"]]]);
45
+ function defineCustomElement$1() {
46
+ if (typeof customElements === "undefined") {
47
+ return;
48
+ }
49
+ const components = ["snk-filter-search"];
50
+ components.forEach(tagName => { switch (tagName) {
51
+ case "snk-filter-search":
52
+ if (!customElements.get(tagName)) {
53
+ customElements.define(tagName, SnkFilterSearch$1);
54
+ }
55
+ break;
56
+ } });
57
+ }
58
+
59
+ const SnkFilterSearch = SnkFilterSearch$1;
60
+ const defineCustomElement = defineCustomElement$1;
61
+
62
+ export { SnkFilterSearch, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterText extends Components.SnkFilterText, HTMLElement {}
4
+ export const SnkFilterText: {
5
+ prototype: SnkFilterText;
6
+ new (): SnkFilterText;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,38 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const SnkFilterText$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
4
+ constructor() {
5
+ super();
6
+ this.__registerHost();
7
+ }
8
+ ezChangeListener(evt) {
9
+ this.value = evt.detail;
10
+ }
11
+ render() {
12
+ if (!this.config) {
13
+ return undefined;
14
+ }
15
+ return (h("ez-text-input", { label: this.config.label, value: this.config.value }));
16
+ }
17
+ }, [0, "snk-filter-text", {
18
+ "config": [16],
19
+ "value": [1]
20
+ }, [[0, "ezChange", "ezChangeListener"]]]);
21
+ function defineCustomElement$1() {
22
+ if (typeof customElements === "undefined") {
23
+ return;
24
+ }
25
+ const components = ["snk-filter-text"];
26
+ components.forEach(tagName => { switch (tagName) {
27
+ case "snk-filter-text":
28
+ if (!customElements.get(tagName)) {
29
+ customElements.define(tagName, SnkFilterText$1);
30
+ }
31
+ break;
32
+ } });
33
+ }
34
+
35
+ const SnkFilterText = SnkFilterText$1;
36
+ const defineCustomElement = defineCustomElement$1;
37
+
38
+ export { SnkFilterText, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkForm extends Components.SnkForm, HTMLElement {}
4
+ export const SnkForm: {
5
+ prototype: SnkForm;
6
+ new (): SnkForm;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { S as SnkForm$1, d as defineCustomElement$1 } from './snk-form2.js';
2
+
3
+ const SnkForm = SnkForm$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkForm, defineCustomElement };
@@ -0,0 +1,159 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { A as ApplicationContext } from './index2.js';
3
+ import { T as TaskbarProcessor } from './taskbar-processor.js';
4
+ import { d as defineCustomElement$1 } from './snk-taskbar2.js';
5
+
6
+ const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
7
+
8
+ const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.exit = createEvent(this, "exit", 7);
13
+ this.actionClick = createEvent(this, "actionClick", 7);
14
+ this._taskbarProcessor = new TaskbarProcessor({
15
+ "snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
16
+ "snkForm.finish_edition": ["CANCEL", "SAVE"]
17
+ });
18
+ }
19
+ getFormConfig() {
20
+ return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
21
+ }
22
+ getInsertionHiddenFields(formConfig) {
23
+ const hiddenFields = [];
24
+ formConfig === null || formConfig === void 0 ? void 0 : formConfig.forEach(cfg => {
25
+ const def = this._dataUnit.getField(cfg.name);
26
+ if (def === null || def === void 0 ? void 0 : def.readOnly) {
27
+ hiddenFields.push(cfg.name);
28
+ }
29
+ });
30
+ return hiddenFields;
31
+ }
32
+ exitForm() {
33
+ if (this._dataUnit.isDirty()) {
34
+ this._dataUnit.cancelEdition({ after: () => this.exit.emit() });
35
+ }
36
+ else {
37
+ this.exit.emit();
38
+ }
39
+ }
40
+ getDisabledButtons() {
41
+ const disabled = [];
42
+ if (!this._dataState.hasPrevious) {
43
+ disabled.push("PREVIOUS");
44
+ }
45
+ if (!this._dataState.hasNext) {
46
+ disabled.push("NEXT");
47
+ }
48
+ return disabled;
49
+ }
50
+ loadInsertionConfig() {
51
+ if (this._dataUnit && this._configLoaded) {
52
+ this._insertionFormConfig = this._editionFormConfig.filter(fieldCfg => {
53
+ const def = this._dataUnit.getField(fieldCfg.name);
54
+ if (def === null || def === void 0 ? void 0 : def.readOnly) {
55
+ return false;
56
+ }
57
+ return true;
58
+ });
59
+ }
60
+ }
61
+ /**
62
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
63
+ * através de um pequeno modulo na estrutura da aplicação:
64
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
65
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
66
+ */
67
+ getMessage(key) {
68
+ return this._application.messagesBuilder.getMessage(key, this.getMessageParams());
69
+ }
70
+ getMessageParams() {
71
+ var _a;
72
+ return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
73
+ }
74
+ componentWillLoad() {
75
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
76
+ if (this._application) {
77
+ this._application.loadFormConfig(this.configName).then(cfg => {
78
+ this._configLoaded = true;
79
+ this._editionFormConfig = cfg;
80
+ this.loadInsertionConfig();
81
+ });
82
+ //Forçamos a carga dos acessos pra aproveitar a request inicial.
83
+ this._application.getAllAccess();
84
+ }
85
+ let parent = this._element.parentElement;
86
+ while (parent) {
87
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
88
+ this._snkDataUnit = parent;
89
+ this._dataUnit = this._snkDataUnit.dataUnit;
90
+ this._dataState = this._snkDataUnit.dataState;
91
+ if (this._dataUnit) {
92
+ this.loadInsertionConfig();
93
+ }
94
+ else {
95
+ this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
96
+ this._dataUnit = evt.detail;
97
+ this.loadInsertionConfig();
98
+ });
99
+ }
100
+ this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
101
+ this._dataState = evt.detail;
102
+ });
103
+ break;
104
+ }
105
+ parent = parent.parentElement;
106
+ }
107
+ }
108
+ componentWillRender() {
109
+ var _a;
110
+ const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
111
+ const disabledButtons = [];
112
+ if (!this._dataState || !this._dataState.hasPrevious) {
113
+ disabledButtons.push("PREVIOUS");
114
+ }
115
+ if (!this._dataState || !this._dataState.hasNext) {
116
+ disabledButtons.push("NEXT");
117
+ }
118
+ this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
119
+ }
120
+ render() {
121
+ var _a;
122
+ if (!this._configLoaded || !this._dataUnit || !this._dataState) {
123
+ return undefined;
124
+ }
125
+ return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
126
+ }
127
+ get _element() { return this; }
128
+ static get style() { return snkFormCss; }
129
+ }, [2, "snk-form", {
130
+ "configName": [1, "config-name"],
131
+ "recordsValidator": [16],
132
+ "actionsList": [16],
133
+ "taskbarManager": [16],
134
+ "_dataUnit": [32],
135
+ "_configLoaded": [32],
136
+ "_dataState": [32],
137
+ "_editionFormConfig": [32],
138
+ "_insertionFormConfig": [32]
139
+ }]);
140
+ function defineCustomElement() {
141
+ if (typeof customElements === "undefined") {
142
+ return;
143
+ }
144
+ const components = ["snk-form", "snk-taskbar"];
145
+ components.forEach(tagName => { switch (tagName) {
146
+ case "snk-form":
147
+ if (!customElements.get(tagName)) {
148
+ customElements.define(tagName, SnkForm);
149
+ }
150
+ break;
151
+ case "snk-taskbar":
152
+ if (!customElements.get(tagName)) {
153
+ defineCustomElement$1();
154
+ }
155
+ break;
156
+ } });
157
+ }
158
+
159
+ export { SnkForm as S, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkGrid extends Components.SnkGrid, HTMLElement {}
4
+ export const SnkGrid: {
5
+ prototype: SnkGrid;
6
+ new (): SnkGrid;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { S as SnkGrid$1, d as defineCustomElement$1 } from './snk-grid2.js';
2
+
3
+ const SnkGrid = SnkGrid$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkGrid, defineCustomElement };