@sankhyalabs/sankhyablocks 1.3.31-beta.2 → 1.3.31-beta.20

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 (218) 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 +1041 -177
  12. package/dist/cjs/snk-crud.cjs.entry.js +65 -0
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +276 -0
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +265 -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.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 +10 -7
  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 +1061 -629
  34. package/dist/collection/components/snk-crud/snk-crud.css +6 -0
  35. package/dist/collection/components/snk-crud/snk-crud.js +176 -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 +540 -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 +69 -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 +244 -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 +323 -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 +183 -0
  54. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +56 -13
  55. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +81 -76
  56. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +86 -0
  57. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  58. package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
  59. package/dist/collection/components/snk-taskbar/snk-taskbar.js +307 -0
  60. package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
  61. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +38 -13
  62. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
  63. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +388 -0
  64. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
  65. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +2 -0
  66. package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
  67. package/dist/collection/lib/index.js +1 -0
  68. package/dist/collection/lib/message/SnkMessageBuilder.js +121 -0
  69. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
  70. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +18 -0
  71. package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
  72. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
  73. package/dist/components/SnkMessageBuilder.js +303 -0
  74. package/dist/components/filter-item-type.enum.js +12 -0
  75. package/dist/components/index.d.ts +18 -5
  76. package/dist/components/index.js +22 -0
  77. package/dist/components/index2.js +2384 -0
  78. package/dist/components/snk-application2.js +1019 -148
  79. package/dist/components/snk-crud.d.ts +11 -0
  80. package/dist/components/snk-crud.js +127 -0
  81. package/dist/components/snk-data-unit.d.ts +11 -0
  82. package/dist/components/snk-data-unit.js +299 -0
  83. package/dist/components/snk-filter-bar.d.ts +11 -0
  84. package/dist/components/snk-filter-bar.js +6 -0
  85. package/dist/components/snk-filter-bar2.js +296 -0
  86. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  87. package/dist/components/snk-filter-binary-select.js +63 -0
  88. package/dist/components/snk-filter-detail.d.ts +11 -0
  89. package/dist/components/snk-filter-detail.js +6 -0
  90. package/dist/components/snk-filter-detail2.js +63 -0
  91. package/dist/components/snk-filter-item.d.ts +11 -0
  92. package/dist/components/snk-filter-item.js +6 -0
  93. package/dist/components/snk-filter-item2.js +164 -0
  94. package/dist/components/snk-filter-list.d.ts +11 -0
  95. package/dist/components/snk-filter-list.js +6 -0
  96. package/dist/components/snk-filter-list2.js +111 -0
  97. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  98. package/dist/components/snk-filter-multi-select.js +39 -0
  99. package/dist/components/snk-filter-number.d.ts +11 -0
  100. package/dist/components/snk-filter-number.js +40 -0
  101. package/dist/components/snk-filter-period.d.ts +11 -0
  102. package/dist/components/snk-filter-period.js +42 -0
  103. package/dist/components/snk-filter-search.d.ts +11 -0
  104. package/dist/components/snk-filter-search.js +62 -0
  105. package/dist/components/snk-filter-text.d.ts +11 -0
  106. package/dist/components/snk-filter-text.js +38 -0
  107. package/dist/components/snk-form.d.ts +11 -0
  108. package/dist/components/snk-form.js +6 -0
  109. package/dist/components/snk-form2.js +159 -0
  110. package/dist/components/snk-grid.d.ts +11 -0
  111. package/dist/components/snk-grid.js +6 -0
  112. package/dist/components/snk-grid2.js +126 -0
  113. package/dist/components/snk-pesquisa2.js +6 -3
  114. package/dist/components/snk-taskbar.d.ts +11 -0
  115. package/dist/components/snk-taskbar.js +6 -0
  116. package/dist/components/snk-taskbar2.js +264 -0
  117. package/dist/components/taskbar-processor.js +45 -0
  118. package/dist/components/teste-pesquisa.js +1 -1
  119. package/dist/esm/SnkMessageBuilder-a7da466b.js +303 -0
  120. package/dist/esm/app-globals-0f993ce5.js +3 -0
  121. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  122. package/dist/esm/dom-665d6011.js +73 -0
  123. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  124. package/dist/esm/index-2b4d2d14.js +3262 -0
  125. package/dist/esm/index-e5b61043.js +2384 -0
  126. package/dist/esm/loader.js +19 -3
  127. package/dist/esm/polyfills/css-shim.js +1 -1
  128. package/dist/esm/sankhyablocks.js +117 -5
  129. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  130. package/dist/esm/snk-application.entry.js +1013 -149
  131. package/dist/esm/snk-crud.entry.js +61 -0
  132. package/dist/esm/snk-data-unit.entry.js +272 -0
  133. package/dist/esm/snk-filter-bar.entry.js +261 -0
  134. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  135. package/dist/esm/snk-filter-detail.entry.js +45 -0
  136. package/dist/esm/snk-filter-item.entry.js +139 -0
  137. package/dist/esm/snk-filter-list.entry.js +87 -0
  138. package/dist/esm/snk-filter-multi-select.entry.js +19 -0
  139. package/dist/esm/snk-filter-number.entry.js +20 -0
  140. package/dist/esm/snk-filter-period.entry.js +22 -0
  141. package/dist/esm/snk-filter-search.entry.js +40 -0
  142. package/dist/esm/snk-filter-text.entry.js +18 -0
  143. package/dist/esm/snk-form.entry.js +129 -0
  144. package/dist/esm/snk-grid.entry.js +75 -0
  145. package/dist/esm/snk-pesquisa.entry.js +7 -4
  146. package/dist/esm/snk-taskbar.entry.js +156 -0
  147. package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
  148. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  149. package/dist/esm/teste-pesquisa.entry.js +2 -2
  150. package/dist/sankhyablocks/SnkMessageBuilder-a7da466b.js +303 -0
  151. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  152. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  153. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  154. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  155. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  156. package/dist/sankhyablocks/index-e5b61043.js +2384 -0
  157. package/dist/sankhyablocks/index.esm.js +1 -0
  158. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  159. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  160. package/dist/sankhyablocks/snk-application.entry.js +8452 -0
  161. package/dist/sankhyablocks/snk-crud.entry.js +61 -0
  162. package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
  163. package/dist/sankhyablocks/snk-filter-bar.entry.js +261 -0
  164. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  165. package/dist/sankhyablocks/snk-filter-detail.entry.js +45 -0
  166. package/dist/sankhyablocks/snk-filter-item.entry.js +139 -0
  167. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  168. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
  169. package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
  170. package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
  171. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  172. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  173. package/dist/sankhyablocks/snk-form.entry.js +129 -0
  174. package/dist/sankhyablocks/snk-grid.entry.js +75 -0
  175. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  176. package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
  177. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
  178. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
  179. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  180. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  181. package/dist/types/components/snk-application/snk-application.d.ts +141 -20
  182. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  183. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
  184. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  185. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
  186. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  187. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  188. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  189. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +14 -0
  190. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
  191. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +46 -0
  192. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -0
  193. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  194. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +84 -0
  195. package/dist/types/components.d.ts +662 -9
  196. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
  197. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
  198. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
  199. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -3
  200. package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
  201. package/dist/types/lib/index.d.ts +1 -0
  202. package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
  203. package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
  204. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  205. package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
  206. package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
  207. package/dist/types/stencil-public-runtime.d.ts +15 -4
  208. package/loader/package.json +1 -0
  209. package/package.json +5 -5
  210. package/react/components.d.ts +0 -2
  211. package/react/components.js +0 -2
  212. package/react/components.js.map +1 -1
  213. package/dist/cjs/index-1133bc2a.js +0 -1235
  214. package/dist/esm/index-ffda6382.js +0 -1208
  215. package/dist/sankhyablocks/p-2a7b4cb3.entry.js +0 -1
  216. package/dist/sankhyablocks/p-d62412bb.entry.js +0 -1
  217. package/dist/sankhyablocks/p-e6e91d5f.entry.js +0 -69
  218. package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
2
- import { Component, h, Host, Prop, State, Watch } from '@stencil/core';
2
+ import { h, Host } from '@stencil/core';
3
3
  export class SnkPesquisa {
4
4
  constructor() {
5
5
  this._mdByName = {};
@@ -291,89 +291,94 @@ export class SnkPesquisa {
291
291
  : 'Os resultados de sua pesquisa aparecerão aqui...';
292
292
  }
293
293
  render() {
294
- return (h(Host, null,
295
- h("div", { class: "snk-pesquisa" },
296
- h("div", { class: "snk-pesquisa__input" },
297
- h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument },
298
- h("ez-icon", { slot: "leftIcon", iconName: "search" }),
299
- h("ez-icon", { class: "snk-pesquisa__input-close", slot: "rightIcon", iconName: "close", onClick: () => { this.clearSearch(); } })),
300
- h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() })),
301
- h("label", { class: "snk-pesquisa__records" }, this.getMessageView()),
302
- h("div", { class: "snk-pesquisa__content" }, this._itemList && this._itemList.map((item) => {
303
- return (h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
304
- })))));
294
+ var _a;
295
+ return (h(Host, null, h("div", { class: "snk-pesquisa" }, h("div", { class: "snk-pesquisa__input" }, h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument }, h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
296
+ ? h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
297
+ : undefined), h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() })), h("label", { class: "snk-pesquisa__records" }, this.getMessageView()), h("div", { class: "snk-pesquisa__content" }, this._itemList && this._itemList.map((item) => {
298
+ return (h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
299
+ })))));
305
300
  }
306
301
  static get is() { return "snk-pesquisa"; }
307
302
  static get encapsulation() { return "scoped"; }
308
- static get originalStyleUrls() { return {
309
- "$": ["snk-pesquisa.css"]
310
- }; }
311
- static get styleUrls() { return {
312
- "$": ["snk-pesquisa.css"]
313
- }; }
314
- static get properties() { return {
315
- "searchLoader": {
316
- "type": "unknown",
317
- "mutable": false,
318
- "complexType": {
319
- "original": "Function",
320
- "resolved": "Function",
321
- "references": {
322
- "Function": {
323
- "location": "global"
303
+ static get originalStyleUrls() {
304
+ return {
305
+ "$": ["snk-pesquisa.css"]
306
+ };
307
+ }
308
+ static get styleUrls() {
309
+ return {
310
+ "$": ["snk-pesquisa.css"]
311
+ };
312
+ }
313
+ static get properties() {
314
+ return {
315
+ "searchLoader": {
316
+ "type": "unknown",
317
+ "mutable": false,
318
+ "complexType": {
319
+ "original": "Function",
320
+ "resolved": "Function",
321
+ "references": {
322
+ "Function": {
323
+ "location": "global"
324
+ }
324
325
  }
326
+ },
327
+ "required": false,
328
+ "optional": false,
329
+ "docs": {
330
+ "tags": [],
331
+ "text": ""
325
332
  }
326
333
  },
327
- "required": false,
328
- "optional": false,
329
- "docs": {
330
- "tags": [],
331
- "text": ""
332
- }
333
- },
334
- "selectItem": {
335
- "type": "unknown",
336
- "mutable": false,
337
- "complexType": {
338
- "original": "Function",
339
- "resolved": "Function",
340
- "references": {
341
- "Function": {
342
- "location": "global"
334
+ "selectItem": {
335
+ "type": "unknown",
336
+ "mutable": false,
337
+ "complexType": {
338
+ "original": "Function",
339
+ "resolved": "Function",
340
+ "references": {
341
+ "Function": {
342
+ "location": "global"
343
+ }
343
344
  }
345
+ },
346
+ "required": false,
347
+ "optional": false,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": ""
344
351
  }
345
352
  },
346
- "required": false,
347
- "optional": false,
348
- "docs": {
349
- "tags": [],
350
- "text": ""
353
+ "argument": {
354
+ "type": "string",
355
+ "mutable": true,
356
+ "complexType": {
357
+ "original": "string",
358
+ "resolved": "string",
359
+ "references": {}
360
+ },
361
+ "required": false,
362
+ "optional": false,
363
+ "docs": {
364
+ "tags": [],
365
+ "text": ""
366
+ },
367
+ "attribute": "argument",
368
+ "reflect": false
351
369
  }
352
- },
353
- "argument": {
354
- "type": "string",
355
- "mutable": true,
356
- "complexType": {
357
- "original": "string",
358
- "resolved": "string",
359
- "references": {}
360
- },
361
- "required": false,
362
- "optional": false,
363
- "docs": {
364
- "tags": [],
365
- "text": ""
366
- },
367
- "attribute": "argument",
368
- "reflect": false
369
- }
370
- }; }
371
- static get states() { return {
372
- "_itemList": {},
373
- "_startLoading": {}
374
- }; }
375
- static get watchers() { return [{
376
- "propName": "argument",
377
- "methodName": "observeArgument"
378
- }]; }
370
+ };
371
+ }
372
+ static get states() {
373
+ return {
374
+ "_itemList": {},
375
+ "_startLoading": {}
376
+ };
377
+ }
378
+ static get watchers() {
379
+ return [{
380
+ "propName": "argument",
381
+ "methodName": "observeArgument"
382
+ }];
383
+ }
379
384
  }
@@ -0,0 +1,86 @@
1
+ import { h } from "@stencil/core";
2
+ export var TaskbarElement;
3
+ (function (TaskbarElement) {
4
+ TaskbarElement["PREVIOUS"] = "PREVIOUS";
5
+ TaskbarElement["NEXT"] = "NEXT";
6
+ TaskbarElement["REFRESH"] = "REFRESH";
7
+ TaskbarElement["UPDATE"] = "UPDATE";
8
+ TaskbarElement["CLONE"] = "CLONE";
9
+ TaskbarElement["REMOVE"] = "REMOVE";
10
+ TaskbarElement["INSERT"] = "INSERT";
11
+ TaskbarElement["CANCEL"] = "CANCEL";
12
+ TaskbarElement["SAVE"] = "SAVE";
13
+ TaskbarElement["GRID_MODE"] = "GRID_MODE";
14
+ TaskbarElement["FORM_MODE"] = "FORM_MODE";
15
+ TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
16
+ TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
17
+ TaskbarElement["DIVIDER"] = "DIVIDER";
18
+ })(TaskbarElement || (TaskbarElement = {}));
19
+ export var AuthorizationElements;
20
+ (function (AuthorizationElements) {
21
+ AuthorizationElements["UPDATE"] = "UPDATE";
22
+ AuthorizationElements["CLONE"] = "CLONE";
23
+ AuthorizationElements["REMOVE"] = "REMOVE";
24
+ AuthorizationElements["INSERT"] = "INSERT";
25
+ AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
26
+ })(AuthorizationElements || (AuthorizationElements = {}));
27
+ export var VisibleWhenForbidden;
28
+ (function (VisibleWhenForbidden) {
29
+ VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
30
+ })(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
31
+ export const buildCustomButton = (def, className, action, isEnabled) => {
32
+ const { hint, text, iconName } = def;
33
+ if (iconName) {
34
+ if (text) {
35
+ return iconTextButton(iconName, def.name, className, hint, text, action, isEnabled);
36
+ }
37
+ else {
38
+ return iconButton(iconName, def.name, className, hint, action, isEnabled);
39
+ }
40
+ }
41
+ else {
42
+ return textButton(def.name, className, text, hint, action, isEnabled);
43
+ }
44
+ };
45
+ export const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
46
+ const title = getTitle(element);
47
+ switch (element) {
48
+ case TaskbarElement.PREVIOUS:
49
+ return iconButton("chevron-left", element, className, title, action, isEnabled);
50
+ case TaskbarElement.NEXT:
51
+ return iconButton("chevron-right", element, className, title, action, isEnabled);
52
+ case TaskbarElement.REFRESH:
53
+ return iconButton("sync", element, className, title, action, isEnabled);
54
+ case TaskbarElement.UPDATE:
55
+ return iconButton("edit", element, className, title, action, isEnabled);
56
+ case TaskbarElement.CLONE:
57
+ return iconButton("copy", element, className, title, action, isEnabled);
58
+ case TaskbarElement.REMOVE:
59
+ return iconButton("delete", element, className, title, action, isEnabled);
60
+ case TaskbarElement.INSERT:
61
+ return iconTextButton("plus", element, className, title, title, action, isEnabled);
62
+ case TaskbarElement.CANCEL:
63
+ return textButton(element, className, title, title, action, isEnabled);
64
+ case TaskbarElement.SAVE:
65
+ return iconTextButton("save", element, className, title, title, action, isEnabled);
66
+ case TaskbarElement.GRID_MODE:
67
+ return iconButton("table", element, className, title, action, isEnabled);
68
+ case TaskbarElement.FORM_MODE:
69
+ return iconButton("list", element, className, title, action, isEnabled);
70
+ case TaskbarElement.CONFIG_GRID:
71
+ return iconButton("settings-inverted", element, className, title, action, isEnabled);
72
+ case TaskbarElement.MORE_OPTIONS:
73
+ return actions && actions.length > 0 ? h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
74
+ case TaskbarElement.DIVIDER:
75
+ return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium" });
76
+ }
77
+ };
78
+ function textButton(name, className, text, title, action, isEnabled) {
79
+ return h("ez-button", { title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) });
80
+ }
81
+ function iconButton(iconName, name, className, title, action, isEnabled) {
82
+ return h("ez-button", { name: iconName, title: title, mode: "icon", size: "small", class: className, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
83
+ }
84
+ function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
85
+ return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
86
+ }
@@ -0,0 +1,43 @@
1
+ export default class TaskbarProcessor {
2
+ constructor(defaultButtons) {
3
+ this._defaultButtons = defaultButtons;
4
+ }
5
+ process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
6
+ var _a;
7
+ this.customButtons = new Map();
8
+ this.buttons = "";
9
+ this.disabledButtons = [];
10
+ (_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
11
+ let buttonName;
12
+ if (typeof btnDef === "string") {
13
+ buttonName = btnDef;
14
+ }
15
+ else {
16
+ const customBtn = btnDef;
17
+ this.customButtons.set(customBtn.name, customBtn);
18
+ buttonName = customBtn.name;
19
+ }
20
+ if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
21
+ this.disabledButtons.push(buttonName);
22
+ }
23
+ if (this.buttons.length > 0) {
24
+ this.buttons += ",";
25
+ }
26
+ this.buttons += buttonName;
27
+ });
28
+ }
29
+ getButtonsArray(taskbarId, taskbarManager, dataState) {
30
+ const defaults = this._defaultButtons[taskbarId];
31
+ if (taskbarManager) {
32
+ return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
33
+ }
34
+ return defaults;
35
+ }
36
+ isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
37
+ const originalValue = disabled.includes(buttonName) ? false : true;
38
+ if (taskbarManager && taskbarManager.isEnabled) {
39
+ return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
40
+ }
41
+ return originalValue;
42
+ }
43
+ }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: flex;
3
+ }
@@ -0,0 +1,307 @@
1
+ import { ApplicationContext } from '@sankhyalabs/core';
2
+ import { h, Host } from '@stencil/core';
3
+ import { TaskbarElement, buildElem, AuthorizationElements, buildCustomButton, VisibleWhenForbidden } from './elements/taskbar-elements';
4
+ export class SnkTaskbar {
5
+ constructor() {
6
+ this._titleKeyByElement = {
7
+ [TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
8
+ [TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
9
+ [TaskbarElement.NEXT]: "snkTaskbar.titleNext",
10
+ [TaskbarElement.REFRESH]: "snkTaskbar.titleRefresh",
11
+ [TaskbarElement.CLONE]: "snkTaskbar.titleClone",
12
+ [TaskbarElement.REMOVE]: "snkTaskbar.titleRemove",
13
+ [TaskbarElement.MORE_OPTIONS]: "snkTaskbar.titleMoreOptions",
14
+ [TaskbarElement.INSERT]: "snkTaskbar.titleInsert",
15
+ [TaskbarElement.CANCEL]: "snkTaskbar.titleCancel",
16
+ [TaskbarElement.SAVE]: "snkTaskbar.titleSave",
17
+ [TaskbarElement.GRID_MODE]: "snkTaskbar.titleGridMode",
18
+ [TaskbarElement.CONFIG_GRID]: "snkTaskbar.titleConfigGrid",
19
+ [TaskbarElement.FORM_MODE]: "snkTaskbar.titleFormMode"
20
+ };
21
+ }
22
+ observeButtons() {
23
+ this._definitions = undefined;
24
+ }
25
+ // Internal methods
26
+ elementsFromString(strButtons) {
27
+ const elements = [];
28
+ if (strButtons) {
29
+ strButtons.split(",").forEach(buttonName => {
30
+ buttonName = buttonName.trim();
31
+ if (VisibleWhenForbidden[buttonName] || this.isAllowed(buttonName)) {
32
+ elements.push(buttonName.trim());
33
+ }
34
+ });
35
+ }
36
+ return elements;
37
+ }
38
+ isAllowed(buttonName) {
39
+ if (AuthorizationElements[buttonName]) {
40
+ return this._permissions ? this._permissions.isSup || this._permissions[buttonName] : false;
41
+ }
42
+ return true;
43
+ }
44
+ /**
45
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
46
+ * através de um pequeno modulo na estrutura da aplicação:
47
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
48
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-taskbar.msg.ts"
49
+ */
50
+ getTitle(element) {
51
+ let key;
52
+ if (this.isAllowed(element)) {
53
+ key = this._titleKeyByElement[element];
54
+ }
55
+ else {
56
+ key = "snkTaskbar.forbidden";
57
+ }
58
+ return key ? this._application.messagesBuilder.getMessage(key, {}) : "";
59
+ }
60
+ elementClick(elem) {
61
+ if (this.dataUnit) {
62
+ switch (elem) {
63
+ case TaskbarElement.PREVIOUS:
64
+ this.dataUnit.previousRecord();
65
+ break;
66
+ case TaskbarElement.NEXT:
67
+ this.dataUnit.nextRecord();
68
+ break;
69
+ case TaskbarElement.REFRESH:
70
+ this.dataUnit.loadData();
71
+ break;
72
+ case TaskbarElement.CLONE:
73
+ this.dataUnit.copySelected();
74
+ break;
75
+ case TaskbarElement.REMOVE:
76
+ this.dataUnit.removeSelectedRecords();
77
+ break;
78
+ case TaskbarElement.INSERT:
79
+ this.dataUnit.addRecord();
80
+ break;
81
+ case TaskbarElement.CANCEL:
82
+ this.dataUnit.cancelEdition();
83
+ break;
84
+ case TaskbarElement.SAVE:
85
+ this.dataUnit.saveData();
86
+ break;
87
+ }
88
+ }
89
+ this.actionClick.emit(elem);
90
+ }
91
+ isEnabled(elem) {
92
+ if (!this.isAllowed(elem)) {
93
+ return false;
94
+ }
95
+ return !(this.disabledButtons && this.disabledButtons.includes(elem));
96
+ }
97
+ getElement(index, def) {
98
+ let className = def === this.primaryButton ? "ez-button--primary " : "";
99
+ if (index > 1) {
100
+ className += "ez-padding-left--medium";
101
+ }
102
+ if (TaskbarElement[def.toString()]) {
103
+ return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
104
+ }
105
+ else {
106
+ return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
107
+ }
108
+ }
109
+ // Lifecycle
110
+ componentWillLoad() {
111
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
112
+ if (this._application) {
113
+ this._application.getAllAccess().then(access => this._permissions = access);
114
+ }
115
+ else {
116
+ this._permissions = {};
117
+ }
118
+ }
119
+ componentWillRender() {
120
+ if (this._definitions == undefined && this._permissions) {
121
+ this._definitions = this.elementsFromString(this.buttons);
122
+ }
123
+ }
124
+ render() {
125
+ if (this._definitions === undefined) {
126
+ return undefined;
127
+ }
128
+ let index = 0;
129
+ return (h(Host, null, this._definitions.map((elem) => {
130
+ if (elem === TaskbarElement.DIVIDER) {
131
+ index = 0;
132
+ }
133
+ else {
134
+ index++;
135
+ }
136
+ if (TaskbarElement[elem]) {
137
+ return this.getElement(index, TaskbarElement[elem]);
138
+ }
139
+ if (this.customButtons.has(elem)) {
140
+ return this.getElement(index, this.customButtons.get(elem));
141
+ }
142
+ return h("slot", { name: elem });
143
+ })));
144
+ }
145
+ static get is() { return "snk-taskbar"; }
146
+ static get encapsulation() { return "scoped"; }
147
+ static get originalStyleUrls() {
148
+ return {
149
+ "$": ["snk-taskbar.css"]
150
+ };
151
+ }
152
+ static get styleUrls() {
153
+ return {
154
+ "$": ["snk-taskbar.css"]
155
+ };
156
+ }
157
+ static get properties() {
158
+ return {
159
+ "buttons": {
160
+ "type": "string",
161
+ "mutable": false,
162
+ "complexType": {
163
+ "original": "string",
164
+ "resolved": "string",
165
+ "references": {}
166
+ },
167
+ "required": false,
168
+ "optional": false,
169
+ "docs": {
170
+ "tags": [],
171
+ "text": "Lista separada por virgula, contendo todos os elementos a serem criados"
172
+ },
173
+ "attribute": "buttons",
174
+ "reflect": false
175
+ },
176
+ "customButtons": {
177
+ "type": "unknown",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "Map<string, CustomButton>",
181
+ "resolved": "Map<string, CustomButton>",
182
+ "references": {
183
+ "Map": {
184
+ "location": "global"
185
+ },
186
+ "CustomButton": {
187
+ "location": "local"
188
+ }
189
+ }
190
+ },
191
+ "required": false,
192
+ "optional": false,
193
+ "docs": {
194
+ "tags": [],
195
+ "text": "Mapa com defini\u00E7\u00E3o de bot\u00F5es personalizados. A chave do mapa deve ser \npassada na lista \"buttons\" no lugar onde o bot\u00E3o ir\u00E1 aparecer."
196
+ }
197
+ },
198
+ "actionsList": {
199
+ "type": "unknown",
200
+ "mutable": false,
201
+ "complexType": {
202
+ "original": "Array<Action>",
203
+ "resolved": "Action[]",
204
+ "references": {
205
+ "Array": {
206
+ "location": "global"
207
+ },
208
+ "Action": {
209
+ "location": "local"
210
+ }
211
+ }
212
+ },
213
+ "required": false,
214
+ "optional": false,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": "Lista de a\u00E7\u00F5es que devem ser usadas no bot\u00E3o \"Mais op\u00E7\u00F5es\""
218
+ }
219
+ },
220
+ "primaryButton": {
221
+ "type": "string",
222
+ "mutable": false,
223
+ "complexType": {
224
+ "original": "string",
225
+ "resolved": "string",
226
+ "references": {}
227
+ },
228
+ "required": false,
229
+ "optional": false,
230
+ "docs": {
231
+ "tags": [],
232
+ "text": "Qual bot\u00E3o deve ter apar\u00EAncia prim\u00E1ria"
233
+ },
234
+ "attribute": "primary-button",
235
+ "reflect": false
236
+ },
237
+ "disabledButtons": {
238
+ "type": "unknown",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "Array<string>",
242
+ "resolved": "string[]",
243
+ "references": {
244
+ "Array": {
245
+ "location": "global"
246
+ }
247
+ }
248
+ },
249
+ "required": false,
250
+ "optional": false,
251
+ "docs": {
252
+ "tags": [],
253
+ "text": "Array contendo todos os bot\u00F5es a serem desabilitados"
254
+ }
255
+ },
256
+ "dataUnit": {
257
+ "type": "unknown",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "DataUnit",
261
+ "resolved": "DataUnit",
262
+ "references": {
263
+ "DataUnit": {
264
+ "location": "import",
265
+ "path": "@sankhyalabs/core"
266
+ }
267
+ }
268
+ },
269
+ "required": false,
270
+ "optional": false,
271
+ "docs": {
272
+ "tags": [],
273
+ "text": "Inst\u00E2ncia do DataUnit"
274
+ }
275
+ }
276
+ };
277
+ }
278
+ static get states() {
279
+ return {
280
+ "_permissions": {}
281
+ };
282
+ }
283
+ static get events() {
284
+ return [{
285
+ "method": "actionClick",
286
+ "name": "actionClick",
287
+ "bubbles": true,
288
+ "cancelable": true,
289
+ "composed": true,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": "Emitido sempre que houver click de bot\u00E3o ou a\u00E7\u00E3o"
293
+ },
294
+ "complexType": {
295
+ "original": "string",
296
+ "resolved": "string",
297
+ "references": {}
298
+ }
299
+ }];
300
+ }
301
+ static get watchers() {
302
+ return [{
303
+ "propName": "buttons",
304
+ "methodName": "observeButtons"
305
+ }];
306
+ }
307
+ }
@@ -1,5 +1,5 @@
1
1
  import { DataType, DataUnit, UserInterface } from '@sankhyalabs/core';
2
- import { Component, h } from '@stencil/core';
2
+ import { h } from '@stencil/core';
3
3
  export class TestePesquisa {
4
4
  componentWillLoad() {
5
5
  this.dataUnit = new DataUnit("testes_com_formulario");
@@ -19,15 +19,18 @@ export class TestePesquisa {
19
19
  };
20
20
  }
21
21
  render() {
22
- return (h("snk-application", null,
23
- h("ez-form", { dataUnit: this.dataUnit })));
22
+ return (h("snk-application", null, h("ez-form", { dataUnit: this.dataUnit })));
24
23
  }
25
24
  static get is() { return "teste-pesquisa"; }
26
25
  static get encapsulation() { return "shadow"; }
27
- static get originalStyleUrls() { return {
28
- "$": ["teste-pesquisa.css"]
29
- }; }
30
- static get styleUrls() { return {
31
- "$": ["teste-pesquisa.css"]
32
- }; }
26
+ static get originalStyleUrls() {
27
+ return {
28
+ "$": ["teste-pesquisa.css"]
29
+ };
30
+ }
31
+ static get styleUrls() {
32
+ return {
33
+ "$": ["teste-pesquisa.css"]
34
+ };
35
+ }
33
36
  }