@sankhyalabs/sankhyablocks 1.3.31-beta.16 → 1.3.31-beta.18

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 (190) hide show
  1. package/dist/cjs/{SnkMessageBuilder-79cf15c5.js → SnkMessageBuilder-02c2ca02.js} +137 -1
  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-5575fe3d.js → index-b0b676c5.js} +1598 -145
  8. package/dist/cjs/loader.cjs.js +18 -2
  9. package/dist/cjs/sankhyablocks.cjs.js +116 -4
  10. package/dist/cjs/shadow-css-346c0795.js +389 -0
  11. package/dist/cjs/snk-application.cjs.entry.js +662 -66
  12. package/dist/cjs/snk-crud.cjs.entry.js +3 -2
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -24
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +247 -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 +143 -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 +26 -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_2.cjs.entry.js → snk-form.cjs.entry.js} +21 -65
  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 +17 -13
  28. package/dist/cjs/{taskbar-elements-2ae0d005.js → taskbar-elements-283c737e.js} +37 -18
  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 +10 -0
  32. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +7 -0
  33. package/dist/collection/components/snk-application/snk-application.js +89 -17
  34. package/dist/collection/components/snk-crud/snk-crud.js +41 -3
  35. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
  36. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
  37. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
  38. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +69 -0
  39. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
  40. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  41. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
  42. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +118 -0
  43. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +244 -0
  44. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
  45. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +114 -0
  46. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +305 -0
  47. package/dist/collection/components/snk-form/snk-form.js +41 -1
  48. package/dist/collection/components/snk-grid/snk-grid.css +14 -1
  49. package/dist/collection/components/snk-grid/snk-grid.js +35 -3
  50. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +35 -17
  51. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  52. package/dist/collection/components/snk-taskbar/snk-taskbar.js +36 -11
  53. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +24 -2
  54. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +1 -1
  55. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +388 -0
  56. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  57. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +18 -0
  58. package/dist/components/SnkMessageBuilder.js +137 -2
  59. package/dist/components/filter-item-type.enum.js +12 -0
  60. package/dist/components/index.d.ts +10 -0
  61. package/dist/components/index.js +14 -0
  62. package/dist/components/index2.js +2384 -0
  63. package/dist/components/snk-application2.js +628 -30
  64. package/dist/components/snk-crud.js +29 -3
  65. package/dist/components/snk-data-unit.js +2 -3
  66. package/dist/components/snk-filter-bar.d.ts +11 -0
  67. package/dist/components/snk-filter-bar.js +6 -0
  68. package/dist/components/snk-filter-bar2.js +278 -0
  69. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  70. package/dist/components/snk-filter-binary-select.js +63 -0
  71. package/dist/components/snk-filter-detail.d.ts +11 -0
  72. package/dist/components/snk-filter-detail.js +6 -0
  73. package/dist/components/snk-filter-detail2.js +63 -0
  74. package/dist/components/snk-filter-item.d.ts +11 -0
  75. package/dist/components/snk-filter-item.js +6 -0
  76. package/dist/components/snk-filter-item2.js +164 -0
  77. package/dist/components/snk-filter-list.d.ts +11 -0
  78. package/dist/components/snk-filter-list.js +6 -0
  79. package/dist/components/snk-filter-list2.js +111 -0
  80. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  81. package/dist/components/snk-filter-multi-select.js +39 -0
  82. package/dist/components/snk-filter-number.d.ts +11 -0
  83. package/dist/components/snk-filter-number.js +40 -0
  84. package/dist/components/snk-filter-period.d.ts +11 -0
  85. package/dist/components/snk-filter-period.js +42 -0
  86. package/dist/components/snk-filter-search.d.ts +11 -0
  87. package/dist/components/snk-filter-search.js +62 -0
  88. package/dist/components/snk-filter-text.d.ts +11 -0
  89. package/dist/components/snk-filter-text.js +38 -0
  90. package/dist/components/snk-form2.js +21 -2
  91. package/dist/components/snk-grid2.js +42 -7
  92. package/dist/components/snk-pesquisa2.js +1 -1
  93. package/dist/components/snk-taskbar2.js +50 -27
  94. package/dist/components/taskbar-processor.js +45 -0
  95. package/dist/components/teste-pesquisa.js +1 -1
  96. package/dist/esm/{SnkMessageBuilder-3cdde541.js → SnkMessageBuilder-65d431bd.js} +137 -2
  97. package/dist/esm/app-globals-0f993ce5.js +3 -0
  98. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  99. package/dist/esm/dom-665d6011.js +73 -0
  100. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  101. package/dist/esm/index-2b4d2d14.js +3262 -0
  102. package/dist/esm/index-e5b61043.js +2384 -0
  103. package/dist/esm/loader.js +18 -2
  104. package/dist/esm/sankhyablocks.js +116 -4
  105. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  106. package/dist/esm/snk-application.entry.js +627 -31
  107. package/dist/esm/snk-crud.entry.js +3 -2
  108. package/dist/esm/snk-data-unit.entry.js +3 -4
  109. package/dist/esm/snk-filter-bar.entry.js +243 -0
  110. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  111. package/dist/esm/snk-filter-detail.entry.js +45 -0
  112. package/dist/esm/snk-filter-item.entry.js +139 -0
  113. package/dist/esm/snk-filter-list.entry.js +87 -0
  114. package/dist/esm/snk-filter-multi-select.entry.js +19 -0
  115. package/dist/esm/snk-filter-number.entry.js +20 -0
  116. package/dist/esm/snk-filter-period.entry.js +22 -0
  117. package/dist/esm/snk-filter-search.entry.js +40 -0
  118. package/dist/esm/snk-filter-text.entry.js +18 -0
  119. package/dist/esm/{snk-form_2.entry.js → snk-form.entry.js} +21 -64
  120. package/dist/esm/snk-grid.entry.js +75 -0
  121. package/dist/esm/snk-pesquisa.entry.js +2 -2
  122. package/dist/esm/snk-taskbar.entry.js +16 -12
  123. package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
  124. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  125. package/dist/esm/teste-pesquisa.entry.js +2 -2
  126. package/dist/sankhyablocks/SnkMessageBuilder-65d431bd.js +303 -0
  127. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  128. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  129. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  130. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  131. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  132. package/dist/sankhyablocks/index-e5b61043.js +2384 -0
  133. package/dist/sankhyablocks/index.esm.js +1 -0
  134. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  135. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  136. package/dist/sankhyablocks/snk-application.entry.js +8426 -0
  137. package/dist/sankhyablocks/snk-crud.entry.js +61 -0
  138. package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
  139. package/dist/sankhyablocks/snk-filter-bar.entry.js +243 -0
  140. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  141. package/dist/sankhyablocks/snk-filter-detail.entry.js +45 -0
  142. package/dist/sankhyablocks/snk-filter-item.entry.js +139 -0
  143. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  144. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
  145. package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
  146. package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
  147. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  148. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  149. package/dist/sankhyablocks/snk-form.entry.js +129 -0
  150. package/dist/sankhyablocks/snk-grid.entry.js +75 -0
  151. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  152. package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
  153. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
  154. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
  155. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  156. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  157. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  158. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  159. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
  160. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  161. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  164. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  165. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +14 -0
  166. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
  167. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +45 -0
  168. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -2
  169. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  170. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +17 -1
  171. package/dist/types/components.d.ts +277 -2
  172. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  173. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
  174. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  175. package/package.json +2 -2
  176. package/react/components.d.ts +0 -7
  177. package/react/components.js +0 -7
  178. package/react/components.js.map +1 -1
  179. package/dist/esm/index-cf91f542.js +0 -1817
  180. package/dist/esm/taskbar-elements-bcccc0ff.js +0 -72
  181. package/dist/sankhyablocks/p-1ba29824.entry.js +0 -74
  182. package/dist/sankhyablocks/p-2266555e.entry.js +0 -1
  183. package/dist/sankhyablocks/p-23c4c94f.js +0 -2
  184. package/dist/sankhyablocks/p-2454be94.js +0 -1
  185. package/dist/sankhyablocks/p-49743bc5.js +0 -1
  186. package/dist/sankhyablocks/p-4fa389bd.entry.js +0 -1
  187. package/dist/sankhyablocks/p-5327ba05.entry.js +0 -1
  188. package/dist/sankhyablocks/p-7a922fb4.entry.js +0 -1
  189. package/dist/sankhyablocks/p-92d6f826.entry.js +0 -1
  190. package/dist/sankhyablocks/p-bdeef7f2.entry.js +0 -1
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+ const index$1 = require('./index-02201bc9.js');
7
+
8
+ const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
9
+ const MAX_FILTERS = 5;
10
+ const SnkFilterList = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.snkItemSelected = index.createEvent(this, "snkItemSelected", 7);
14
+ this.innerClickCheck = (floatingContainer, node) => {
15
+ if (node && floatingContainer) {
16
+ if (!node.offsetParent) {
17
+ return true;
18
+ }
19
+ let current = node;
20
+ do {
21
+ if (current === floatingContainer || current === this._element) {
22
+ return true;
23
+ }
24
+ } while ((current = current.offsetParent) != null);
25
+ }
26
+ this._detailIsVisible = false;
27
+ return false;
28
+ };
29
+ }
30
+ showList() {
31
+ this._floatingID = index$1.FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck });
32
+ this._detailIsVisible = true;
33
+ this._showAll = false;
34
+ this._filterArgument = "";
35
+ }
36
+ hideList() {
37
+ if (this._floatingID != undefined) {
38
+ index$1.FloatingManager.close(this._floatingID);
39
+ }
40
+ this._floatingID = undefined;
41
+ this._detailIsVisible = false;
42
+ }
43
+ buttonClick() {
44
+ if (this._detailIsVisible) {
45
+ this.hideList();
46
+ }
47
+ else {
48
+ this.showList();
49
+ }
50
+ }
51
+ componentDidRender() {
52
+ if (this._floatingID == undefined) {
53
+ if (this._popover) {
54
+ this._popover.remove();
55
+ }
56
+ }
57
+ }
58
+ buildItemElement(item) {
59
+ return (index.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 ? index.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, index.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)));
60
+ }
61
+ itemSelected(itemName) {
62
+ if (itemName === SHOW_MORE_ITEM_NAME) {
63
+ this._showAll = true;
64
+ }
65
+ else {
66
+ this.hideList();
67
+ this.snkItemSelected.emit(itemName);
68
+ }
69
+ }
70
+ getFilterItems() {
71
+ const items = this.items ? index$1.ArrayUtils.applyStringFilter(this._filterArgument, this.items.filter(item => item.kind === "FILTER")) : [];
72
+ if (items.length === 0) {
73
+ return index.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);
74
+ }
75
+ const hideItems = !this._filterArgument && !this._showAll && (items.length > MAX_FILTERS + 1);
76
+ if (hideItems) {
77
+ items.splice(MAX_FILTERS);
78
+ 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" });
79
+ }
80
+ return index.h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-list-items-container" }, items.map(item => this.buildItemElement(item)));
81
+ }
82
+ getFooterItems() {
83
+ return this.items.filter(item => item.kind === "FOOTER");
84
+ }
85
+ render() {
86
+ return (index.h(index.Host, { class: "ez-flex ez-flex--column" }, index.h("ez-button", { class: this.buttonClass, label: this.label, onClick: () => this.buttonClick(), mode: this.iconName ? "icon" : undefined, iconName: this.iconName, size: "small" }, index.h("slot", { name: "leftIcon" })), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("div", { class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem }, index.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(), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), this.items ? this.getFooterItems().map(item => this.buildItemElement(item)) : undefined))));
87
+ }
88
+ get _element() { return index.getElement(this); }
89
+ };
90
+
91
+ exports.snk_filter_list = SnkFilterList;
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+ const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
7
+
8
+ const SnkFilterMultiSelect = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ }
12
+ ezChangeListener(evt) {
13
+ this.value = evt.detail.value;
14
+ }
15
+ render() {
16
+ if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.MULTI_SELECT) {
17
+ return undefined;
18
+ }
19
+ return (index.h("ez-combo-box", { label: this.config.label, value: this.config.value, options: this.config.props.options }));
20
+ }
21
+ };
22
+
23
+ exports.snk_filter_multi_select = SnkFilterMultiSelect;
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+ const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
7
+
8
+ const SnkFilterPeriod = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ }
12
+ ezChangeListener(evt) {
13
+ this.value = evt.detail;
14
+ }
15
+ render() {
16
+ var _a;
17
+ if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.NUMBER) {
18
+ return undefined;
19
+ }
20
+ return (index.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 }));
21
+ }
22
+ };
23
+
24
+ exports.snk_filter_number = SnkFilterPeriod;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+ const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
7
+
8
+ const SnkFilterPeriod = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ }
12
+ ezChangeListener() {
13
+ const start = this._startDate.value;
14
+ const end = this._endDate.value;
15
+ this.value = (start || end ? { start, end } : undefined);
16
+ }
17
+ render() {
18
+ var _a, _b;
19
+ if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.PERIOD) {
20
+ return undefined;
21
+ }
22
+ return (index.h("div", { class: "ez-col ez-col--nowrap" }, index.h("ez-date-input", { label: this.config.label, ref: ref => this._startDate = ref, value: (_a = this.config.value) === null || _a === void 0 ? void 0 : _a.start }), index.h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9"), index.h("ez-date-input", { label: this.config.label, ref: ref => this._endDate = ref, value: (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.end })));
23
+ }
24
+ };
25
+
26
+ exports.snk_filter_period = SnkFilterPeriod;
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+ const index$1 = require('./index-02201bc9.js');
7
+ const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
8
+
9
+ const SnkFilterSearch = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ }
13
+ ezChangeListener(_evt) {
14
+ this.value = this._searchInput.value;
15
+ }
16
+ doSearch(mode, argument) {
17
+ const application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
18
+ if (this.fix) {
19
+ this.fix();
20
+ }
21
+ return new Promise((resolve, reject) => {
22
+ application.executePreparedSearch(mode, argument, this.config.props.searchContext)
23
+ .then(result => {
24
+ resolve(result);
25
+ if (this.unfix) {
26
+ this.unfix();
27
+ }
28
+ }).catch(reason => {
29
+ reject(reason);
30
+ if (this.unfix) {
31
+ this.unfix();
32
+ }
33
+ });
34
+ });
35
+ }
36
+ render() {
37
+ if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.SEARCH) {
38
+ return undefined;
39
+ }
40
+ return (index.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) }));
41
+ }
42
+ };
43
+
44
+ exports.snk_filter_search = SnkFilterSearch;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+
7
+ const SnkFilterText = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ }
11
+ ezChangeListener(evt) {
12
+ this.value = evt.detail;
13
+ }
14
+ render() {
15
+ if (!this.config) {
16
+ return undefined;
17
+ }
18
+ return (index.h("ez-text-input", { label: this.config.label, value: this.config.value }));
19
+ }
20
+ };
21
+
22
+ exports.snk_filter_text = SnkFilterText;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-5575fe3d.js');
6
- const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-2ae0d005.js');
5
+ const index = require('./index-b0b676c5.js');
6
+ const index$1 = require('./index-02201bc9.js');
7
+ const taskbarProcessor = require('./taskbar-processor-6bd0d35c.js');
8
8
 
9
9
  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))}";
10
10
 
@@ -13,6 +13,10 @@ const SnkForm = class {
13
13
  index.registerInstance(this, hostRef);
14
14
  this.exit = index.createEvent(this, "exit", 7);
15
15
  this.actionClick = index.createEvent(this, "actionClick", 7);
16
+ this._taskbarProcessor = new taskbarProcessor.TaskbarProcessor({
17
+ "snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
18
+ "snkForm.finish_edition": ["CANCEL", "SAVE"]
19
+ });
16
20
  }
17
21
  getFormConfig() {
18
22
  return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
@@ -70,7 +74,7 @@ const SnkForm = class {
70
74
  return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
71
75
  }
72
76
  componentWillLoad() {
73
- this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
77
+ this._application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
74
78
  if (this._application) {
75
79
  this._application.loadFormConfig(this.configName).then(cfg => {
76
80
  this._configLoaded = true;
@@ -103,75 +107,27 @@ const SnkForm = class {
103
107
  parent = parent.parentElement;
104
108
  }
105
109
  }
106
- render() {
107
- if (!this._configLoaded || !this._dataUnit || !this._dataState) {
108
- return undefined;
109
- }
110
- return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.h("snk-taskbar", { key: "formTaskbar", buttons: this._dataState.isDirty ? "CANCEL,SAVE" : "PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,INSERT", primaryButton: this._dataState.isDirty ? "SAVE" : "INSERT", disabledButtons: this.getDisabledButtons(), actionsList: this.actionsList, dataUnit: this._dataUnit }))), index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
111
- }
112
- get _element() { return index.getElement(this); }
113
- };
114
- SnkForm.style = snkFormCss;
115
-
116
- const snkGridCss = ".sc-snk-grid-h{display:flex;height:100%;width:100%}";
117
-
118
- const SnkGrid = class {
119
- constructor(hostRef) {
120
- index.registerInstance(this, hostRef);
121
- this.actionClick = index.createEvent(this, "actionClick", 7);
122
- this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
123
- }
124
- getHeaderButtons() {
125
- return this._dataState && this._dataState.selectedRecords.length > 0 ? "UPDATE,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,REFRESH" : "REFRESH";
126
- }
127
- actionClickHandler(evt) {
128
- if (evt.detail === taskbarElements.TaskbarElement.CONFIG_GRID && this._grid) {
129
- this._grid.openGridConfig();
130
- }
131
- }
132
- saveConfig(config) {
133
- const snkApplication = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
134
- if (snkApplication) {
135
- snkApplication.saveGridConfig(config);
136
- }
137
- }
138
- componentWillLoad() {
139
- const snkApplication = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
140
- if (snkApplication) {
141
- snkApplication.loadGridConfig(this.configName).then(cfg => {
142
- this._gridConfig = cfg;
143
- this._configLoaded = true;
144
- });
145
- //Forçamos a carga dos acessos pra aproveitar a request inicial.
146
- snkApplication.getAllAccess();
110
+ componentWillRender() {
111
+ var _a;
112
+ const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
113
+ const disabledButtons = [];
114
+ if (!this._dataState || !this._dataState.hasPrevious) {
115
+ disabledButtons.push("PREVIOUS");
147
116
  }
148
- let parent = this._element.parentElement;
149
- while (parent) {
150
- if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
151
- this._snkDataUnit = parent;
152
- this._dataUnit = this._snkDataUnit.dataUnit;
153
- if (!this._dataUnit) {
154
- this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
155
- this._dataUnit = evt.detail;
156
- });
157
- }
158
- this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
159
- this._dataState = evt.detail;
160
- });
161
- break;
162
- }
163
- parent = parent.parentElement;
117
+ if (!this._dataState || !this._dataState.hasNext) {
118
+ disabledButtons.push("NEXT");
164
119
  }
120
+ this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
165
121
  }
166
122
  render() {
167
- if (!this._configLoaded || !this._dataUnit) {
123
+ var _a;
124
+ if (!this._configLoaded || !this._dataUnit || !this._dataState) {
168
125
  return undefined;
169
126
  }
170
- return (index.h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "ez-row ez-padding-bottom--medium ez-margin-bottom--medium" }, index.h("div", { class: "ez-col ez-col--sd-9 ez-col--tb-9 ez-align--bottom" }, index.h("slot", { name: "SnkGridHeader" })), index.h("div", { class: "ez-col ez-col--sd-3 ez-col--tb-3 ez-align--right" }, index.h("snk-taskbar", { onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: "FORM_MODE,CONFIG_GRID,INSERT", primaryButton: "INSERT" }))), index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() }, index.h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this.getHeaderButtons(), slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" }))));
127
+ return (index.h("section", { class: "snk-form" }, index.h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, index.h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), index.h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), index.h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, index.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 }))), index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
171
128
  }
172
129
  get _element() { return index.getElement(this); }
173
130
  };
174
- SnkGrid.style = snkGridCss;
131
+ SnkForm.style = snkFormCss;
175
132
 
176
133
  exports.snk_form = SnkForm;
177
- exports.snk_grid = SnkGrid;
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b0b676c5.js');
6
+ const index$1 = require('./index-02201bc9.js');
7
+ const taskbarElements = require('./taskbar-elements-283c737e.js');
8
+ const taskbarProcessor = require('./taskbar-processor-6bd0d35c.js');
9
+
10
+ const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--small)}";
11
+
12
+ const SnkGrid = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.actionClick = index.createEvent(this, "actionClick", 7);
16
+ this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
17
+ this._topTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
18
+ "snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
19
+ });
20
+ this._headerTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
21
+ "snkGridHeaderTaskbar.unselected": ["REFRESH"],
22
+ "snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
23
+ });
24
+ }
25
+ actionClickHandler(evt) {
26
+ if (evt.detail === taskbarElements.TaskbarElement.CONFIG_GRID && this._grid) {
27
+ this._grid.openGridConfig();
28
+ }
29
+ }
30
+ saveConfig(config) {
31
+ const snkApplication = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
32
+ if (snkApplication) {
33
+ snkApplication.saveGridConfig(config);
34
+ }
35
+ }
36
+ componentWillLoad() {
37
+ const snkApplication = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
38
+ if (snkApplication) {
39
+ snkApplication.loadGridConfig(this.configName).then(cfg => {
40
+ this._gridConfig = cfg;
41
+ this._configLoaded = true;
42
+ });
43
+ //Forçamos a carga dos acessos pra aproveitar a request inicial.
44
+ snkApplication.getAllAccess();
45
+ }
46
+ let parent = this._element.parentElement;
47
+ while (parent) {
48
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
49
+ this._snkDataUnit = parent;
50
+ this._dataUnit = this._snkDataUnit.dataUnit;
51
+ if (!this._dataUnit) {
52
+ this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
53
+ this._dataUnit = evt.detail;
54
+ });
55
+ }
56
+ this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
57
+ this._dataState = evt.detail;
58
+ });
59
+ break;
60
+ }
61
+ parent = parent.parentElement;
62
+ }
63
+ }
64
+ componentWillRender() {
65
+ const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
66
+ this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
67
+ this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
68
+ }
69
+ render() {
70
+ if (!this._configLoaded || !this._dataUnit) {
71
+ return undefined;
72
+ }
73
+ return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, index.h("snk-filter-bar", { class: "snk-grid__filter-bar ez-align--top" }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), index.h("snk-taskbar", { class: "ez-padding-left--medium", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit() }, index.h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" }))));
74
+ }
75
+ get _element() { return index.getElement(this); }
76
+ };
77
+ SnkGrid.style = snkGridCss;
78
+
79
+ exports.snk_grid = SnkGrid;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-5575fe3d.js');
6
- const core = require('@sankhyalabs/core');
5
+ const index = require('./index-b0b676c5.js');
6
+ const index$1 = require('./index-02201bc9.js');
7
7
 
8
8
  const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-pesquisa__content-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__content-scrollbar--background-color-primary) var(--snk-pesquisa__content-scrollbar--background-color-secondary);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__content-scrollbar--background-color-primary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);width:var(--snk-pesquisa__content-scrollbar--width);max-width:var(--snk-pesquisa__content-scrollbar--width);min-width:var(--snk-pesquisa__content-scrollbar--width)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
9
9
 
@@ -59,7 +59,7 @@ const SnkPesquisa = class {
59
59
  .then((resp) => {
60
60
  this._startLoading = false;
61
61
  if (resp) {
62
- resp = core.ObjectUtils.stringToObject(resp.json.$);
62
+ resp = index$1.ObjectUtils.stringToObject(resp.json.$);
63
63
  let descriptionField = resp.descriptionField;
64
64
  let pkField = resp.pkField;
65
65
  if (descriptionField && pkField) {
@@ -87,7 +87,7 @@ const SnkPesquisa = class {
87
87
  }
88
88
  filterFieldsMetadata(resp, item) {
89
89
  let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
90
- let accept = !core.StringUtils.isEmpty(item[field.fieldName]) &&
90
+ let accept = !index$1.StringUtils.isEmpty(item[field.fieldName]) &&
91
91
  field.visible !== false &&
92
92
  field.type !== 'B' &&
93
93
  resp.pkField !== field.fieldName &&
@@ -125,7 +125,7 @@ const SnkPesquisa = class {
125
125
  return index;
126
126
  }
127
127
  equals(obj1, obj2) {
128
- return core.ObjectUtils.objectToString(obj1) === core.ObjectUtils.objectToString(obj2);
128
+ return index$1.ObjectUtils.objectToString(obj1) === index$1.ObjectUtils.objectToString(obj2);
129
129
  }
130
130
  find(arr, checkerFn) {
131
131
  if (arr) {
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-5575fe3d.js');
6
- const core = require('@sankhyalabs/core');
7
- const taskbarElements = require('./taskbar-elements-2ae0d005.js');
5
+ const index = require('./index-b0b676c5.js');
6
+ const index$1 = require('./index-02201bc9.js');
7
+ const taskbarElements = require('./taskbar-elements-283c737e.js');
8
8
 
9
9
  const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
10
10
 
@@ -104,17 +104,20 @@ const SnkTaskbar = class {
104
104
  return !(this.disabledButtons && this.disabledButtons.includes(elem));
105
105
  }
106
106
  getElement(index, def) {
107
- let element;
108
107
  let className = def === this.primaryButton ? "ez-button--primary " : "";
109
108
  if (index > 1) {
110
109
  className += "ez-padding-left--medium";
111
110
  }
112
- element = taskbarElements.buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
113
- return element;
111
+ if (taskbarElements.TaskbarElement[def.toString()]) {
112
+ return taskbarElements.buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
113
+ }
114
+ else {
115
+ return taskbarElements.buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
116
+ }
114
117
  }
115
118
  // Lifecycle
116
119
  componentWillLoad() {
117
- this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
120
+ this._application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
118
121
  if (this._application) {
119
122
  this._application.getAllAccess().then(access => this._permissions = access);
120
123
  }
@@ -132,19 +135,20 @@ const SnkTaskbar = class {
132
135
  return undefined;
133
136
  }
134
137
  let index$1 = 0;
135
- return (index.h(index.Host, null, this._definitions.map((btn) => {
136
- if (btn === taskbarElements.TaskbarElement.DIVIDER) {
138
+ return (index.h(index.Host, null, this._definitions.map((elem) => {
139
+ if (elem === taskbarElements.TaskbarElement.DIVIDER) {
137
140
  index$1 = 0;
138
141
  }
139
142
  else {
140
143
  index$1++;
141
144
  }
142
- if (taskbarElements.TaskbarElement[btn]) {
143
- return this.getElement(index$1, taskbarElements.TaskbarElement[btn]);
145
+ if (taskbarElements.TaskbarElement[elem]) {
146
+ return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
144
147
  }
145
- else {
146
- return index.h("slot", { name: btn });
148
+ if (this.customButtons.has(elem)) {
149
+ return this.getElement(index$1, this.customButtons.get(elem));
147
150
  }
151
+ return index.h("slot", { name: elem });
148
152
  })));
149
153
  }
150
154
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-5575fe3d.js');
3
+ const index = require('./index-b0b676c5.js');
4
4
 
5
5
  exports.TaskbarElement = void 0;
6
6
  (function (TaskbarElement) {
@@ -31,44 +31,63 @@ exports.VisibleWhenForbidden = void 0;
31
31
  (function (VisibleWhenForbidden) {
32
32
  VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
33
33
  })(exports.VisibleWhenForbidden || (exports.VisibleWhenForbidden = {}));
34
+ const buildCustomButton = (def, className, action, isEnabled) => {
35
+ const { hint, text, iconName } = def;
36
+ if (iconName) {
37
+ if (text) {
38
+ return iconTextButton(iconName, def.name, className, hint, text, action, isEnabled);
39
+ }
40
+ else {
41
+ return iconButton(iconName, def.name, className, hint, action, isEnabled);
42
+ }
43
+ }
44
+ else {
45
+ return textButton(def.name, className, text, hint, action, isEnabled);
46
+ }
47
+ };
34
48
  const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
49
+ const title = getTitle(element);
35
50
  switch (element) {
36
51
  case exports.TaskbarElement.PREVIOUS:
37
- return iconButton("chevron-left", element, className, getTitle, action, isEnabled);
52
+ return iconButton("chevron-left", element, className, title, action, isEnabled);
38
53
  case exports.TaskbarElement.NEXT:
39
- return iconButton("chevron-right", element, className, getTitle, action, isEnabled);
54
+ return iconButton("chevron-right", element, className, title, action, isEnabled);
40
55
  case exports.TaskbarElement.REFRESH:
41
- return iconButton("sync", element, className, getTitle, action, isEnabled);
56
+ return iconButton("sync", element, className, title, action, isEnabled);
42
57
  case exports.TaskbarElement.UPDATE:
43
- return iconButton("edit", element, className, getTitle, action, isEnabled);
58
+ return iconButton("edit", element, className, title, action, isEnabled);
44
59
  case exports.TaskbarElement.CLONE:
45
- return iconButton("copy", element, className, getTitle, action, isEnabled);
60
+ return iconButton("copy", element, className, title, action, isEnabled);
46
61
  case exports.TaskbarElement.REMOVE:
47
- return iconButton("delete", element, className, getTitle, action, isEnabled);
62
+ return iconButton("delete", element, className, title, action, isEnabled);
48
63
  case exports.TaskbarElement.INSERT:
49
- return iconTextButton("plus", element, className, getTitle, action, isEnabled);
64
+ return iconTextButton("plus", element, className, title, title, action, isEnabled);
50
65
  case exports.TaskbarElement.CANCEL:
51
- return index.h("ez-button", { title: getTitle(element), label: getTitle(element), size: "small", enabled: isEnabled(element), onClick: () => action(element) });
66
+ return textButton(element, className, title, title, action, isEnabled);
52
67
  case exports.TaskbarElement.SAVE:
53
- return iconTextButton("save", element, className, getTitle, action, isEnabled);
68
+ return iconTextButton("save", element, className, title, title, action, isEnabled);
54
69
  case exports.TaskbarElement.GRID_MODE:
55
- return iconButton("table", element, className, getTitle, action, isEnabled);
70
+ return iconButton("table", element, className, title, action, isEnabled);
56
71
  case exports.TaskbarElement.FORM_MODE:
57
- return iconButton("list", element, className, getTitle, action, isEnabled);
72
+ return iconButton("list", element, className, title, action, isEnabled);
58
73
  case exports.TaskbarElement.CONFIG_GRID:
59
- return iconButton("settings-inverted", element, className, getTitle, action, isEnabled);
74
+ return iconButton("settings-inverted", element, className, title, action, isEnabled);
60
75
  case exports.TaskbarElement.MORE_OPTIONS:
61
- return actions && actions.length > 0 ? index.h("ez-actions-button", { title: getTitle(element), size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
76
+ return actions && actions.length > 0 ? index.h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
62
77
  case exports.TaskbarElement.DIVIDER:
63
78
  return index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
64
79
  }
65
80
  };
66
- function iconButton(iconName, element, className, getTitle, action, isEnabled) {
67
- return index.h("ez-button", { key: iconName, title: getTitle(element), mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(element), onClick: () => action(element) });
81
+ function textButton(name, className, text, title, action, isEnabled) {
82
+ return index.h("ez-button", { title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) });
83
+ }
84
+ function iconButton(iconName, name, className, title, action, isEnabled) {
85
+ return index.h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
68
86
  }
69
- function iconTextButton(iconName, element, className, getTitle, action, isEnabled) {
70
- return index.h("ez-button", { key: iconName, title: getTitle(element), label: getTitle(element), size: "small", class: className, enabled: isEnabled(element), onClick: () => action(element) },
87
+ function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
88
+ return index.h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) },
71
89
  index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
72
90
  }
73
91
 
92
+ exports.buildCustomButton = buildCustomButton;
74
93
  exports.buildElem = buildElem;