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

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 (170) hide show
  1. package/dist/cjs/{SnkMessageBuilder-79cf15c5.js → SnkMessageBuilder-cb132e6d.js} +133 -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 +542 -66
  12. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -24
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +199 -0
  15. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
  16. package/dist/cjs/snk-filter-detail.cjs.entry.js +44 -0
  17. package/dist/cjs/snk-filter-item.cjs.entry.js +131 -0
  18. package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
  19. package/dist/cjs/snk-filter-number.cjs.entry.js +23 -0
  20. package/dist/cjs/snk-filter-period.cjs.entry.js +26 -0
  21. package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
  22. package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
  23. package/dist/cjs/{snk-form_2.cjs.entry.js → snk-form.cjs.entry.js} +3 -65
  24. package/dist/cjs/snk-grid.cjs.entry.js +69 -0
  25. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  26. package/dist/cjs/snk-taskbar.cjs.entry.js +5 -4
  27. package/dist/cjs/{taskbar-elements-2ae0d005.js → taskbar-elements-efa44ff1.js} +1 -1
  28. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  29. package/dist/collection/collection-manifest.json +9 -0
  30. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +7 -0
  31. package/dist/collection/components/snk-application/snk-application.js +89 -17
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
  33. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +64 -0
  34. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +69 -0
  35. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
  36. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  37. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
  38. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +113 -0
  39. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +209 -0
  40. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +182 -0
  41. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +99 -0
  42. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +257 -0
  43. package/dist/collection/components/snk-grid/snk-grid.css +14 -1
  44. package/dist/collection/components/snk-grid/snk-grid.js +1 -1
  45. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +24 -2
  46. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +1 -1
  47. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +268 -0
  48. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  49. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -0
  50. package/dist/components/SnkMessageBuilder.js +133 -2
  51. package/dist/components/filter-item-type.enum.js +12 -0
  52. package/dist/components/index.d.ts +9 -0
  53. package/dist/components/index.js +13 -0
  54. package/dist/components/index2.js +2384 -0
  55. package/dist/components/snk-application2.js +508 -30
  56. package/dist/components/snk-crud.js +25 -1
  57. package/dist/components/snk-data-unit.js +2 -3
  58. package/dist/components/snk-filter-bar.d.ts +11 -0
  59. package/dist/components/snk-filter-bar.js +6 -0
  60. package/dist/components/snk-filter-bar2.js +230 -0
  61. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  62. package/dist/components/snk-filter-binary-select.js +63 -0
  63. package/dist/components/snk-filter-detail.d.ts +11 -0
  64. package/dist/components/snk-filter-detail.js +6 -0
  65. package/dist/components/snk-filter-detail2.js +58 -0
  66. package/dist/components/snk-filter-item.d.ts +11 -0
  67. package/dist/components/snk-filter-item.js +6 -0
  68. package/dist/components/snk-filter-item2.js +151 -0
  69. package/dist/components/snk-filter-list.d.ts +11 -0
  70. package/dist/components/snk-filter-list.js +6 -0
  71. package/dist/components/snk-filter-list2.js +108 -0
  72. package/dist/components/snk-filter-number.d.ts +11 -0
  73. package/dist/components/snk-filter-number.js +39 -0
  74. package/dist/components/snk-filter-period.d.ts +11 -0
  75. package/dist/components/snk-filter-period.js +42 -0
  76. package/dist/components/snk-filter-search.d.ts +11 -0
  77. package/dist/components/snk-filter-search.js +62 -0
  78. package/dist/components/snk-filter-text.d.ts +11 -0
  79. package/dist/components/snk-filter-text.js +38 -0
  80. package/dist/components/snk-form2.js +1 -1
  81. package/dist/components/snk-grid2.js +28 -4
  82. package/dist/components/snk-pesquisa2.js +1 -1
  83. package/dist/components/snk-taskbar2.js +2 -1
  84. package/dist/components/teste-pesquisa.js +1 -1
  85. package/dist/esm/{SnkMessageBuilder-3cdde541.js → SnkMessageBuilder-cff80920.js} +133 -2
  86. package/dist/esm/app-globals-0f993ce5.js +3 -0
  87. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  88. package/dist/esm/dom-665d6011.js +73 -0
  89. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  90. package/dist/esm/index-2b4d2d14.js +3262 -0
  91. package/dist/esm/index-e5b61043.js +2384 -0
  92. package/dist/esm/loader.js +18 -2
  93. package/dist/esm/sankhyablocks.js +116 -4
  94. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  95. package/dist/esm/snk-application.entry.js +507 -31
  96. package/dist/esm/snk-crud.entry.js +1 -1
  97. package/dist/esm/snk-data-unit.entry.js +3 -4
  98. package/dist/esm/snk-filter-bar.entry.js +195 -0
  99. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  100. package/dist/esm/snk-filter-detail.entry.js +40 -0
  101. package/dist/esm/snk-filter-item.entry.js +127 -0
  102. package/dist/esm/snk-filter-list.entry.js +87 -0
  103. package/dist/esm/snk-filter-number.entry.js +19 -0
  104. package/dist/esm/snk-filter-period.entry.js +22 -0
  105. package/dist/esm/snk-filter-search.entry.js +40 -0
  106. package/dist/esm/snk-filter-text.entry.js +18 -0
  107. package/dist/esm/{snk-form_2.entry.js → snk-form.entry.js} +3 -64
  108. package/dist/esm/snk-grid.entry.js +65 -0
  109. package/dist/esm/snk-pesquisa.entry.js +2 -2
  110. package/dist/esm/snk-taskbar.entry.js +4 -3
  111. package/dist/esm/{taskbar-elements-bcccc0ff.js → taskbar-elements-c119510a.js} +1 -1
  112. package/dist/esm/teste-pesquisa.entry.js +2 -2
  113. package/dist/sankhyablocks/SnkMessageBuilder-cff80920.js +299 -0
  114. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  115. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  116. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  117. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  118. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  119. package/dist/sankhyablocks/index-e5b61043.js +2384 -0
  120. package/dist/sankhyablocks/index.esm.js +1 -0
  121. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  122. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  123. package/dist/sankhyablocks/snk-application.entry.js +8306 -0
  124. package/dist/sankhyablocks/snk-crud.entry.js +60 -0
  125. package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
  126. package/dist/sankhyablocks/snk-filter-bar.entry.js +195 -0
  127. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  128. package/dist/sankhyablocks/snk-filter-detail.entry.js +40 -0
  129. package/dist/sankhyablocks/snk-filter-item.entry.js +127 -0
  130. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  131. package/dist/sankhyablocks/snk-filter-number.entry.js +19 -0
  132. package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
  133. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  134. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  135. package/dist/sankhyablocks/snk-form.entry.js +111 -0
  136. package/dist/sankhyablocks/snk-grid.entry.js +65 -0
  137. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  138. package/dist/sankhyablocks/snk-taskbar.entry.js +153 -0
  139. package/dist/sankhyablocks/taskbar-elements-c119510a.js +72 -0
  140. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  141. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  142. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  143. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  144. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  145. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
  146. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  147. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  148. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  149. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +13 -0
  150. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +37 -0
  151. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +43 -0
  152. package/dist/types/components.d.ts +199 -0
  153. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  154. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
  155. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  156. package/package.json +2 -2
  157. package/react/components.d.ts +0 -7
  158. package/react/components.js +0 -7
  159. package/react/components.js.map +1 -1
  160. package/dist/esm/index-cf91f542.js +0 -1817
  161. package/dist/sankhyablocks/p-1ba29824.entry.js +0 -74
  162. package/dist/sankhyablocks/p-2266555e.entry.js +0 -1
  163. package/dist/sankhyablocks/p-23c4c94f.js +0 -2
  164. package/dist/sankhyablocks/p-2454be94.js +0 -1
  165. package/dist/sankhyablocks/p-49743bc5.js +0 -1
  166. package/dist/sankhyablocks/p-4fa389bd.entry.js +0 -1
  167. package/dist/sankhyablocks/p-5327ba05.entry.js +0 -1
  168. package/dist/sankhyablocks/p-7a922fb4.entry.js +0 -1
  169. package/dist/sankhyablocks/p-92d6f826.entry.js +0 -1
  170. package/dist/sankhyablocks/p-bdeef7f2.entry.js +0 -1
@@ -17,6 +17,7 @@ import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
17
17
  import { agGridLicense } from '../../lib/licenses/sankhyalicense.module';
18
18
  import { TotalsFetcher } from "../../lib/http/data-fetcher/fetchers/totals-fetcher";
19
19
  import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
20
+ import FilterBarConfigFetcher from "../../lib/http/data-fetcher/fetchers/filter-bar-config-fetcher";
20
21
  /**
21
22
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
22
23
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -346,6 +347,12 @@ export class SnkApplication {
346
347
  async saveGridConfig(config) {
347
348
  return this.gridConfigFetcher.saveConfig(config, this.resourceID);
348
349
  }
350
+ /**
351
+ * Obtém as configurações da barra de filtros
352
+ */
353
+ async getFilterBarConfig() {
354
+ return this.filterBarConfigFetcher.getConfig(this.resourceID);
355
+ }
349
356
  async getAuthList(_auth) {
350
357
  return await (new MGEAuthorization()).parseFromJSON(_auth);
351
358
  }
@@ -391,6 +398,12 @@ export class SnkApplication {
391
398
  }
392
399
  return this._authFetcher;
393
400
  }
401
+ get filterBarConfigFetcher() {
402
+ if (!this._filterBarConfigFetcher) {
403
+ this._filterBarConfigFetcher = new FilterBarConfigFetcher();
404
+ }
405
+ return this._filterBarConfigFetcher;
406
+ }
394
407
  async executeSearch(searchArgument, fieldName, dataUnit) {
395
408
  const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
396
409
  if (!descriptor) {
@@ -427,23 +440,27 @@ export class SnkApplication {
427
440
  }
428
441
  }
429
442
  });
430
- if (mode === "ADVANCED") {
431
- return new Promise(accept => {
432
- const pesquisaContent = document.createElement("snk-pesquisa");
433
- pesquisaContent.argument = argument;
434
- pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(ENTITYNAME, text, criteria, searchOptions);
435
- pesquisaContent.selectItem = (option) => {
436
- accept(option);
437
- this.clearPopUpTitle();
438
- this.closePopUp();
439
- };
440
- this.setPopUpTitle(DESCRIPTIONENTITY);
441
- this.showPopUp(pesquisaContent);
442
- });
443
- }
444
- else {
445
- return this.pesquisaFetcher.loadSearchOptions(ENTITYNAME, argument, criteria, searchOptions);
446
- }
443
+ return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
444
+ }
445
+ }
446
+ async executePreparedSearch(mode, argument, options) {
447
+ const { entity, entityDescription, criteria, searchOptions } = options;
448
+ if (mode === "ADVANCED") {
449
+ return new Promise(accept => {
450
+ const pesquisaContent = document.createElement("snk-pesquisa");
451
+ pesquisaContent.argument = argument;
452
+ pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
453
+ pesquisaContent.selectItem = (option) => {
454
+ accept(option);
455
+ this.clearPopUpTitle();
456
+ this.closePopUp();
457
+ };
458
+ this.setPopUpTitle(entityDescription);
459
+ this.showPopUp(pesquisaContent);
460
+ });
461
+ }
462
+ else {
463
+ return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
447
464
  }
448
465
  }
449
466
  async isDebugMode() {
@@ -1195,6 +1212,29 @@ export class SnkApplication {
1195
1212
  "tags": []
1196
1213
  }
1197
1214
  },
1215
+ "getFilterBarConfig": {
1216
+ "complexType": {
1217
+ "signature": "() => Promise<Array<SnkFilterItemConfig>>",
1218
+ "parameters": [],
1219
+ "references": {
1220
+ "Promise": {
1221
+ "location": "global"
1222
+ },
1223
+ "SnkFilterItemConfig": {
1224
+ "location": "import",
1225
+ "path": "../snk-filter-bar/filter-item/snk-filter-item"
1226
+ },
1227
+ "Array": {
1228
+ "location": "global"
1229
+ }
1230
+ },
1231
+ "return": "Promise<SnkFilterItemConfig[]>"
1232
+ },
1233
+ "docs": {
1234
+ "text": "Obt\u00E9m as configura\u00E7\u00F5es da barra de filtros",
1235
+ "tags": []
1236
+ }
1237
+ },
1198
1238
  "executeSearch": {
1199
1239
  "complexType": {
1200
1240
  "signature": "(searchArgument: any, fieldName: string, dataUnit: DataUnit) => Promise<Array<Option> | Option>",
@@ -1226,6 +1266,38 @@ export class SnkApplication {
1226
1266
  "SearchCriteria": {
1227
1267
  "location": "import",
1228
1268
  "path": "../../lib/http/data-fetcher/fetchers/pesquisa-fetcher"
1269
+ }
1270
+ },
1271
+ "return": "Promise<Option | Option[]>"
1272
+ },
1273
+ "docs": {
1274
+ "text": "",
1275
+ "tags": []
1276
+ }
1277
+ },
1278
+ "executePreparedSearch": {
1279
+ "complexType": {
1280
+ "signature": "(mode: string, argument: string, options: any) => Promise<Array<Option> | Option>",
1281
+ "parameters": [{
1282
+ "tags": [],
1283
+ "text": ""
1284
+ }, {
1285
+ "tags": [],
1286
+ "text": ""
1287
+ }, {
1288
+ "tags": [],
1289
+ "text": ""
1290
+ }],
1291
+ "references": {
1292
+ "Promise": {
1293
+ "location": "global"
1294
+ },
1295
+ "Option": {
1296
+ "location": "import",
1297
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
1298
+ },
1299
+ "Array": {
1300
+ "location": "global"
1229
1301
  },
1230
1302
  "HTMLSnkPesquisaElement": {
1231
1303
  "location": "global"
@@ -0,0 +1,88 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import FilterItemType from '../filter-item-type.enum';
3
+ export class SnkFilterBinarySelect {
4
+ isSelected(option) {
5
+ return this.config.value == undefined || this.config.value === option;
6
+ }
7
+ ezChangeListener(evt) {
8
+ if (!evt.detail) {
9
+ this.assertCheckedOption(evt.target);
10
+ }
11
+ this.updateValue();
12
+ }
13
+ assertCheckedOption(updatingCheck) {
14
+ if (updatingCheck === this._checkOne) {
15
+ this._checkTwo.value = true;
16
+ }
17
+ else {
18
+ this._checkOne.value = true;
19
+ }
20
+ }
21
+ updateValue() {
22
+ if (!this._checkOne.value || !this._checkTwo.value) {
23
+ const [optOne, optTwo] = this.config.props.options;
24
+ this.value = this._checkOne.value ? optOne.name : optTwo.name;
25
+ }
26
+ else {
27
+ this.value = undefined;
28
+ }
29
+ }
30
+ render() {
31
+ if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
32
+ return undefined;
33
+ }
34
+ const [optOne, optTwo] = this.config.props.options;
35
+ return (h(Host, null, h("ez-check", { label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), h("ez-check", { label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) })));
36
+ }
37
+ static get is() { return "snk-filter-binary-select"; }
38
+ static get properties() {
39
+ return {
40
+ "value": {
41
+ "type": "any",
42
+ "mutable": true,
43
+ "complexType": {
44
+ "original": "any",
45
+ "resolved": "any",
46
+ "references": {}
47
+ },
48
+ "required": false,
49
+ "optional": false,
50
+ "docs": {
51
+ "tags": [],
52
+ "text": ""
53
+ },
54
+ "attribute": "value",
55
+ "reflect": true
56
+ },
57
+ "config": {
58
+ "type": "unknown",
59
+ "mutable": false,
60
+ "complexType": {
61
+ "original": "SnkFilterItemConfig",
62
+ "resolved": "SnkFilterItemConfig",
63
+ "references": {
64
+ "SnkFilterItemConfig": {
65
+ "location": "import",
66
+ "path": "../snk-filter-item"
67
+ }
68
+ }
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": ""
75
+ }
76
+ }
77
+ };
78
+ }
79
+ static get listeners() {
80
+ return [{
81
+ "name": "ezChange",
82
+ "method": "ezChangeListener",
83
+ "target": undefined,
84
+ "capture": false,
85
+ "passive": false
86
+ }];
87
+ }
88
+ }
@@ -0,0 +1,64 @@
1
+ import { h } from '@stencil/core';
2
+ import FilterItemType from '../filter-item-type.enum';
3
+ export class SnkFilterPeriod {
4
+ ezChangeListener(evt) {
5
+ this.value = evt.detail;
6
+ }
7
+ render() {
8
+ if (!this.config || this.config.type !== FilterItemType.NUMBER) {
9
+ return undefined;
10
+ }
11
+ return (h("ez-number-input", { label: this.config.label, value: this.config.value }));
12
+ }
13
+ static get is() { return "snk-filter-number"; }
14
+ static get properties() {
15
+ return {
16
+ "config": {
17
+ "type": "unknown",
18
+ "mutable": false,
19
+ "complexType": {
20
+ "original": "SnkFilterItemConfig",
21
+ "resolved": "SnkFilterItemConfig",
22
+ "references": {
23
+ "SnkFilterItemConfig": {
24
+ "location": "import",
25
+ "path": "../snk-filter-item"
26
+ }
27
+ }
28
+ },
29
+ "required": false,
30
+ "optional": false,
31
+ "docs": {
32
+ "tags": [],
33
+ "text": ""
34
+ }
35
+ },
36
+ "value": {
37
+ "type": "number",
38
+ "mutable": false,
39
+ "complexType": {
40
+ "original": "number",
41
+ "resolved": "number",
42
+ "references": {}
43
+ },
44
+ "required": false,
45
+ "optional": false,
46
+ "docs": {
47
+ "tags": [],
48
+ "text": ""
49
+ },
50
+ "attribute": "value",
51
+ "reflect": false
52
+ }
53
+ };
54
+ }
55
+ static get listeners() {
56
+ return [{
57
+ "name": "ezChange",
58
+ "method": "ezChangeListener",
59
+ "target": undefined,
60
+ "capture": false,
61
+ "passive": false
62
+ }];
63
+ }
64
+ }
@@ -0,0 +1,69 @@
1
+ import { h } from '@stencil/core';
2
+ import FilterItemType from '../filter-item-type.enum';
3
+ export class SnkFilterPeriod {
4
+ ezChangeListener() {
5
+ const start = this._startDate.value;
6
+ const end = this._endDate.value;
7
+ this.value = (start || end ? { start, end } : undefined);
8
+ }
9
+ render() {
10
+ var _a, _b;
11
+ if (!this.config || this.config.type !== FilterItemType.PERIOD) {
12
+ return undefined;
13
+ }
14
+ return (h("div", { class: "ez-col ez-col--nowrap" }, 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 }), 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: (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.end })));
15
+ }
16
+ static get is() { return "snk-filter-period"; }
17
+ static get properties() {
18
+ return {
19
+ "config": {
20
+ "type": "unknown",
21
+ "mutable": false,
22
+ "complexType": {
23
+ "original": "SnkFilterItemConfig",
24
+ "resolved": "SnkFilterItemConfig",
25
+ "references": {
26
+ "SnkFilterItemConfig": {
27
+ "location": "import",
28
+ "path": "../snk-filter-item"
29
+ }
30
+ }
31
+ },
32
+ "required": false,
33
+ "optional": false,
34
+ "docs": {
35
+ "tags": [],
36
+ "text": ""
37
+ }
38
+ },
39
+ "value": {
40
+ "type": "unknown",
41
+ "mutable": false,
42
+ "complexType": {
43
+ "original": "Period",
44
+ "resolved": "Period",
45
+ "references": {
46
+ "Period": {
47
+ "location": "local"
48
+ }
49
+ }
50
+ },
51
+ "required": false,
52
+ "optional": false,
53
+ "docs": {
54
+ "tags": [],
55
+ "text": ""
56
+ }
57
+ }
58
+ };
59
+ }
60
+ static get listeners() {
61
+ return [{
62
+ "name": "ezChange",
63
+ "method": "ezChangeListener",
64
+ "target": undefined,
65
+ "capture": false,
66
+ "passive": false
67
+ }];
68
+ }
69
+ }
@@ -0,0 +1,118 @@
1
+ import { ApplicationContext } from '@sankhyalabs/core';
2
+ import { h } from '@stencil/core';
3
+ import FilterItemType from '../filter-item-type.enum';
4
+ export class SnkFilterSearch {
5
+ ezChangeListener(_evt) {
6
+ this.value = this._searchInput.value;
7
+ }
8
+ doSearch(mode, argument) {
9
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
10
+ if (this.fix) {
11
+ this.fix();
12
+ }
13
+ return new Promise((resolve, reject) => {
14
+ application.executePreparedSearch(mode, argument, this.config.props.searchContext)
15
+ .then(result => {
16
+ resolve(result);
17
+ if (this.unfix) {
18
+ this.unfix();
19
+ }
20
+ }).catch(reason => {
21
+ reject(reason);
22
+ if (this.unfix) {
23
+ this.unfix();
24
+ }
25
+ });
26
+ });
27
+ }
28
+ render() {
29
+ if (!this.config || this.config.type !== FilterItemType.SEARCH) {
30
+ return undefined;
31
+ }
32
+ return (h("ez-search", { value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
33
+ }
34
+ static get is() { return "snk-filter-search"; }
35
+ static get properties() {
36
+ return {
37
+ "config": {
38
+ "type": "unknown",
39
+ "mutable": false,
40
+ "complexType": {
41
+ "original": "SnkFilterItemConfig",
42
+ "resolved": "SnkFilterItemConfig",
43
+ "references": {
44
+ "SnkFilterItemConfig": {
45
+ "location": "import",
46
+ "path": "../snk-filter-item"
47
+ }
48
+ }
49
+ },
50
+ "required": false,
51
+ "optional": false,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": ""
55
+ }
56
+ },
57
+ "value": {
58
+ "type": "unknown",
59
+ "mutable": false,
60
+ "complexType": {
61
+ "original": "Option",
62
+ "resolved": "Option",
63
+ "references": {
64
+ "Option": {
65
+ "location": "import",
66
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box"
67
+ }
68
+ }
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": ""
75
+ }
76
+ },
77
+ "fix": {
78
+ "type": "unknown",
79
+ "mutable": false,
80
+ "complexType": {
81
+ "original": "()=>void",
82
+ "resolved": "() => void",
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": false,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": ""
90
+ }
91
+ },
92
+ "unfix": {
93
+ "type": "unknown",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "()=>void",
97
+ "resolved": "() => void",
98
+ "references": {}
99
+ },
100
+ "required": false,
101
+ "optional": false,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": ""
105
+ }
106
+ }
107
+ };
108
+ }
109
+ static get listeners() {
110
+ return [{
111
+ "name": "ezChange",
112
+ "method": "ezChangeListener",
113
+ "target": undefined,
114
+ "capture": false,
115
+ "passive": false
116
+ }];
117
+ }
118
+ }
@@ -0,0 +1,63 @@
1
+ import { h } from '@stencil/core';
2
+ export class SnkFilterText {
3
+ ezChangeListener(evt) {
4
+ this.value = evt.detail;
5
+ }
6
+ render() {
7
+ if (!this.config) {
8
+ return undefined;
9
+ }
10
+ return (h("ez-text-input", { label: this.config.label, value: this.config.value }));
11
+ }
12
+ static get is() { return "snk-filter-text"; }
13
+ static get properties() {
14
+ return {
15
+ "config": {
16
+ "type": "unknown",
17
+ "mutable": false,
18
+ "complexType": {
19
+ "original": "SnkFilterItemConfig",
20
+ "resolved": "SnkFilterItemConfig",
21
+ "references": {
22
+ "SnkFilterItemConfig": {
23
+ "location": "import",
24
+ "path": "../snk-filter-item"
25
+ }
26
+ }
27
+ },
28
+ "required": false,
29
+ "optional": false,
30
+ "docs": {
31
+ "tags": [],
32
+ "text": ""
33
+ }
34
+ },
35
+ "value": {
36
+ "type": "string",
37
+ "mutable": false,
38
+ "complexType": {
39
+ "original": "string",
40
+ "resolved": "string",
41
+ "references": {}
42
+ },
43
+ "required": false,
44
+ "optional": false,
45
+ "docs": {
46
+ "tags": [],
47
+ "text": ""
48
+ },
49
+ "attribute": "value",
50
+ "reflect": false
51
+ }
52
+ };
53
+ }
54
+ static get listeners() {
55
+ return [{
56
+ "name": "ezChange",
57
+ "method": "ezChangeListener",
58
+ "target": undefined,
59
+ "capture": false,
60
+ "passive": false
61
+ }];
62
+ }
63
+ }
@@ -0,0 +1,10 @@
1
+ var FilterItemType;
2
+ (function (FilterItemType) {
3
+ FilterItemType["MULTI_SELECT"] = "MULTI_SELECT";
4
+ FilterItemType["BINARY_SELECT"] = "BINARY_SELECT";
5
+ FilterItemType["PERIOD"] = "PERIOD";
6
+ FilterItemType["SEARCH"] = "SEARCH";
7
+ FilterItemType["TEXT"] = "TEXT";
8
+ FilterItemType["NUMBER"] = "NUMBER";
9
+ })(FilterItemType || (FilterItemType = {}));
10
+ export default FilterItemType;
@@ -0,0 +1,113 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import FilterItemType from './filter-item-type.enum';
3
+ export class SnkFilterDetail {
4
+ changeConfig(newConfig) {
5
+ this.filterChange.emit(newConfig);
6
+ }
7
+ getContentEditor() {
8
+ switch (this.config.type) {
9
+ case FilterItemType.BINARY_SELECT:
10
+ return "snk-filter-binary-select";
11
+ case FilterItemType.PERIOD:
12
+ return "snk-filter-period";
13
+ case FilterItemType.SEARCH:
14
+ return "snk-filter-search";
15
+ case FilterItemType.NUMBER:
16
+ return "snk-filter-number";
17
+ }
18
+ return "snk-filter-text";
19
+ }
20
+ getPopUpHeaderButtons() {
21
+ if (this.config.hardFixed) {
22
+ return undefined;
23
+ }
24
+ return ([
25
+ h("ez-icon", { title: this.getMessage("snkFilterBar.removeFilter"), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: "delete", onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false })) }),
26
+ h("ez-icon", { title: this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), class: "ez-margin-left--small sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: this.config.fixed ? "un-pin" : "push-pin", onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })) })
27
+ ]);
28
+ }
29
+ render() {
30
+ const ContentEditor = this.getContentEditor();
31
+ return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
32
+ }
33
+ static get is() { return "snk-filter-detail"; }
34
+ static get properties() {
35
+ return {
36
+ "config": {
37
+ "type": "unknown",
38
+ "mutable": true,
39
+ "complexType": {
40
+ "original": "SnkFilterItemConfig",
41
+ "resolved": "SnkFilterItemConfig",
42
+ "references": {
43
+ "SnkFilterItemConfig": {
44
+ "location": "import",
45
+ "path": "./snk-filter-item"
46
+ }
47
+ }
48
+ },
49
+ "required": false,
50
+ "optional": false,
51
+ "docs": {
52
+ "tags": [],
53
+ "text": ""
54
+ }
55
+ },
56
+ "keepOpened": {
57
+ "type": "boolean",
58
+ "mutable": true,
59
+ "complexType": {
60
+ "original": "boolean",
61
+ "resolved": "boolean",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "attribute": "keep-opened",
71
+ "reflect": false
72
+ },
73
+ "getMessage": {
74
+ "type": "unknown",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "(key: string, props?: any) => string",
78
+ "resolved": "(key: string, props?: any) => string",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": ""
86
+ }
87
+ }
88
+ };
89
+ }
90
+ static get events() {
91
+ return [{
92
+ "method": "filterChange",
93
+ "name": "filterChange",
94
+ "bubbles": true,
95
+ "cancelable": true,
96
+ "composed": true,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": ""
100
+ },
101
+ "complexType": {
102
+ "original": "SnkFilterItemConfig",
103
+ "resolved": "SnkFilterItemConfig",
104
+ "references": {
105
+ "SnkFilterItemConfig": {
106
+ "location": "import",
107
+ "path": "./snk-filter-item"
108
+ }
109
+ }
110
+ }
111
+ }];
112
+ }
113
+ }