@sankhyalabs/sankhyablocks 1.4.0-beta.2 → 1.4.0-beta.4

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 (152) hide show
  1. package/dist/cjs/{index-b0b676c5.js → index-6fcf07f3.js} +159 -1515
  2. package/dist/cjs/loader.cjs.js +2 -18
  3. package/dist/cjs/sankhyablocks.cjs.js +4 -116
  4. package/dist/cjs/snk-application.cjs.entry.js +53 -217
  5. package/dist/cjs/snk-crud.cjs.entry.js +9 -3
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -23
  7. package/dist/cjs/snk-filter-bar_5.cjs.entry.js +883 -0
  8. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-filter-detail.cjs.entry.js +32 -21
  10. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  11. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  12. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-filter-personalized.cjs.entry.js +23 -31
  14. package/dist/cjs/snk-filter-search.cjs.entry.js +3 -12
  15. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  16. package/dist/cjs/{snk-form.cjs.entry.js → snk-form_2.cjs.entry.js} +119 -5
  17. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  18. package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-aedfeae6.js} +1 -1
  19. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  20. package/dist/collection/components/snk-crud/snk-crud.js +29 -0
  21. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +0 -39
  22. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +0 -39
  23. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +30 -36
  24. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -14
  25. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +4 -12
  26. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +3 -3
  27. package/dist/components/index.js +0 -4
  28. package/dist/components/snk-application2.js +13 -177
  29. package/dist/components/snk-crud.js +9 -2
  30. package/dist/components/snk-data-unit.js +2 -2
  31. package/dist/components/snk-filter-bar2.js +4 -2
  32. package/dist/components/snk-filter-detail2.js +31 -21
  33. package/dist/components/snk-filter-item2.js +4 -15
  34. package/dist/components/snk-filter-list2.js +5 -13
  35. package/dist/components/snk-filter-modal2.js +4 -19
  36. package/dist/components/snk-filter-personalized.js +3 -13
  37. package/dist/components/snk-filter-search.js +2 -13
  38. package/dist/components/snk-form2.js +1 -1
  39. package/dist/components/snk-grid2.js +1 -1
  40. package/dist/components/snk-pesquisa2.js +1 -1
  41. package/dist/components/snk-taskbar2.js +1 -1
  42. package/dist/components/teste-pesquisa.js +1 -1
  43. package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-81dda3cf.js} +160 -1508
  44. package/dist/esm/loader.js +2 -18
  45. package/dist/esm/sankhyablocks.js +4 -116
  46. package/dist/esm/snk-application.entry.js +14 -178
  47. package/dist/esm/snk-crud.entry.js +8 -2
  48. package/dist/esm/snk-data-unit.entry.js +3 -3
  49. package/dist/esm/{snk-filter-bar.entry.js → snk-filter-bar_5.entry.js} +417 -4
  50. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  51. package/dist/esm/snk-filter-detail.entry.js +32 -21
  52. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  53. package/dist/esm/snk-filter-number.entry.js +1 -1
  54. package/dist/esm/snk-filter-period.entry.js +1 -1
  55. package/dist/esm/snk-filter-personalized.entry.js +3 -11
  56. package/dist/esm/snk-filter-search.entry.js +2 -11
  57. package/dist/esm/snk-filter-text.entry.js +1 -1
  58. package/dist/{sankhyablocks/snk-form.entry.js → esm/snk-form_2.entry.js} +117 -4
  59. package/dist/esm/snk-pesquisa.entry.js +2 -2
  60. package/dist/esm/{taskbar-elements-35d64ff9.js → taskbar-elements-38eb5d51.js} +1 -1
  61. package/dist/esm/teste-pesquisa.entry.js +2 -2
  62. package/dist/sankhyablocks/index.esm.js +0 -1
  63. package/dist/sankhyablocks/p-01823784.entry.js +1 -0
  64. package/dist/sankhyablocks/p-0352c0e2.entry.js +1 -0
  65. package/dist/sankhyablocks/p-07ebda01.entry.js +1 -0
  66. package/dist/sankhyablocks/p-46caa101.entry.js +1 -0
  67. package/dist/sankhyablocks/p-586e2522.js +1 -0
  68. package/dist/sankhyablocks/p-6f8303f3.entry.js +1 -0
  69. package/dist/sankhyablocks/p-746fc78b.entry.js +1 -0
  70. package/dist/sankhyablocks/p-77216252.entry.js +1 -0
  71. package/dist/sankhyablocks/p-86f15ffe.js +1 -0
  72. package/dist/sankhyablocks/p-8bbc0cbb.entry.js +74 -0
  73. package/dist/sankhyablocks/p-8f3c5709.entry.js +1 -0
  74. package/dist/sankhyablocks/p-97009a2c.entry.js +1 -0
  75. package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
  76. package/dist/sankhyablocks/p-aecf3e0a.entry.js +1 -0
  77. package/dist/sankhyablocks/p-c1c3b5d8.entry.js +1 -0
  78. package/dist/sankhyablocks/p-c9eec639.entry.js +1 -0
  79. package/dist/sankhyablocks/p-eea6444c.entry.js +1 -0
  80. package/dist/sankhyablocks/p-fac2b6a9.js +2 -0
  81. package/dist/sankhyablocks/p-fb705f81.entry.js +1 -0
  82. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
  83. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +0 -2
  84. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +0 -2
  85. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -1
  86. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +1 -1
  87. package/dist/types/components.d.ts +4 -10
  88. package/package.json +1 -1
  89. package/react/components.d.ts +19 -0
  90. package/react/components.js +19 -0
  91. package/react/components.js.map +1 -1
  92. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  93. package/dist/cjs/css-shim-b8158822.js +0 -6
  94. package/dist/cjs/dom-36862b77.js +0 -75
  95. package/dist/cjs/index-84fe3b86.js +0 -20
  96. package/dist/cjs/index-93965c41.js +0 -141
  97. package/dist/cjs/index-e90ae303.js +0 -2408
  98. package/dist/cjs/shadow-css-346c0795.js +0 -389
  99. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -466
  100. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -177
  101. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
  102. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -37
  103. package/dist/cjs/snk-grid.cjs.entry.js +0 -79
  104. package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
  105. package/dist/cjs/taskbar-processor-6bd0d35c.js +0 -47
  106. package/dist/components/index2.js +0 -2394
  107. package/dist/components/index3.js +0 -139
  108. package/dist/esm/app-globals-0f993ce5.js +0 -3
  109. package/dist/esm/css-shim-b3f2ee8d.js +0 -4
  110. package/dist/esm/dom-665d6011.js +0 -73
  111. package/dist/esm/index-2b4d2d14.js +0 -3262
  112. package/dist/esm/index-5992b7e6.js +0 -139
  113. package/dist/esm/index-c683b2b0.js +0 -2394
  114. package/dist/esm/index-c71285cb.js +0 -17
  115. package/dist/esm/shadow-css-b18e99d7.js +0 -387
  116. package/dist/esm/snk-filter-item.entry.js +0 -173
  117. package/dist/esm/snk-filter-list.entry.js +0 -87
  118. package/dist/esm/snk-filter-modal.entry.js +0 -33
  119. package/dist/esm/snk-form.entry.js +0 -129
  120. package/dist/esm/snk-grid.entry.js +0 -75
  121. package/dist/esm/snk-taskbar.entry.js +0 -156
  122. package/dist/esm/taskbar-processor-aa6772c9.js +0 -45
  123. package/dist/sankhyablocks/SnkMessageBuilder-35a20271.js +0 -199
  124. package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
  125. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
  126. package/dist/sankhyablocks/dom-665d6011.js +0 -73
  127. package/dist/sankhyablocks/filter-item-type.enum-a79b2fa8.js +0 -14
  128. package/dist/sankhyablocks/index-5992b7e6.js +0 -139
  129. package/dist/sankhyablocks/index-c683b2b0.js +0 -2394
  130. package/dist/sankhyablocks/index-c71285cb.js +0 -17
  131. package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
  132. package/dist/sankhyablocks/snk-application.entry.js +0 -8166
  133. package/dist/sankhyablocks/snk-crud.entry.js +0 -66
  134. package/dist/sankhyablocks/snk-data-unit.entry.js +0 -268
  135. package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -462
  136. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
  137. package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -80
  138. package/dist/sankhyablocks/snk-filter-item.entry.js +0 -173
  139. package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
  140. package/dist/sankhyablocks/snk-filter-modal.entry.js +0 -33
  141. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
  142. package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
  143. package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
  144. package/dist/sankhyablocks/snk-filter-personalized.entry.js +0 -85
  145. package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
  146. package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
  147. package/dist/sankhyablocks/snk-grid.entry.js +0 -75
  148. package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
  149. package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
  150. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +0 -90
  151. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
  152. package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
@@ -36,39 +36,50 @@ export class SnkFilterDetail {
36
36
  }
37
37
  apply() {
38
38
  var _a;
39
+ let value = this._editor["value"];
39
40
  let isValid = true;
40
- const value = this._editor["value"];
41
- /* WARNING: Temporário. Isso só está sendo feito até desconsiderar os parametros não informados para PersonalizedFilter*/
42
- if (value != undefined && this.config.type === FilterItemType.PERSONALIZED) {
41
+ if (this.config.type === FilterItemType.PERSONALIZED) {
43
42
  const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
44
- if (params.length > 1) {
45
- if (params.length > value.length) {
46
- isValid = false;
47
- }
48
- else {
49
- value.forEach(item => {
50
- if (item == undefined) {
51
- isValid = false;
52
- }
53
- });
54
- }
43
+ const paramsCount = params.length;
44
+ if (paramsCount === 0) {
45
+ //Valor do filtro personalizado sem parametros deve ser um array vazio
46
+ value = [];
55
47
  }
56
- if (!isValid) {
57
- this.keepOpened = true;
58
- ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.").then(() => setTimeout(() => this.keepOpened = false, 1));
48
+ else {
49
+ isValid = this.validateAllFilled(paramsCount, value);
59
50
  }
60
51
  }
61
- /* WARNING: Temporário.*/
62
52
  if (isValid) {
63
53
  this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
64
54
  }
65
55
  }
56
+ /* WARNING: Temporário. Isso só está sendo feito até desconsiderar os parametros não informados para PersonalizedFilter*/
57
+ validateAllFilled(paramsCount, value) {
58
+ let isValid = true;
59
+ if (value != undefined && paramsCount > 1) {
60
+ if (paramsCount > value.length) {
61
+ isValid = false;
62
+ }
63
+ else {
64
+ value.forEach(item => {
65
+ if (item == undefined) {
66
+ isValid = false;
67
+ }
68
+ });
69
+ }
70
+ }
71
+ if (!isValid) {
72
+ ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.");
73
+ }
74
+ return isValid;
75
+ }
76
+ /* WARNING: Temporário.*/
66
77
  clear() {
67
78
  this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
68
79
  }
69
80
  render() {
70
81
  const ContentEditor = this.getContentEditor();
71
- 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, value: this.config.value, 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.clear(), size: "small" }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
82
+ 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, value: this.config.value, config: this.config }), 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.clear(), size: "small" }), h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
72
83
  }
73
84
  static get is() { return "snk-filter-detail"; }
74
85
  static get properties() {
@@ -93,23 +104,6 @@ export class SnkFilterDetail {
93
104
  "text": ""
94
105
  }
95
106
  },
96
- "keepOpened": {
97
- "type": "boolean",
98
- "mutable": true,
99
- "complexType": {
100
- "original": "boolean",
101
- "resolved": "boolean",
102
- "references": {}
103
- },
104
- "required": false,
105
- "optional": false,
106
- "docs": {
107
- "tags": [],
108
- "text": ""
109
- },
110
- "attribute": "keep-opened",
111
- "reflect": false
112
- },
113
107
  "getMessage": {
114
108
  "type": "unknown",
115
109
  "mutable": false,
@@ -3,21 +3,10 @@ import { h, Host } from '@stencil/core';
3
3
  import FilterItemType from './filter-item-type.enum';
4
4
  export class SnkFilterItem {
5
5
  constructor() {
6
- this.innerClickCheck = (floatingContainer, node) => {
7
- if (this._popover.keepOpened) {
6
+ this.innerClickCheck = (_floatingContainer, node) => {
7
+ if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
8
8
  return true;
9
9
  }
10
- if (node && floatingContainer) {
11
- if (!node.offsetParent) {
12
- return true;
13
- }
14
- let current = node;
15
- do {
16
- if (current === floatingContainer) {
17
- return true;
18
- }
19
- } while ((current = current.offsetParent) != null);
20
- }
21
10
  this.detailIsVisible = false;
22
11
  this.executeCloseCallback();
23
12
  return false;
@@ -35,7 +24,7 @@ export class SnkFilterItem {
35
24
  });
36
25
  }
37
26
  showDetail() {
38
- this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, left: this.getScrollOffset() });
27
+ this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, left: this.getScrollOffset(), useOverlay: true });
39
28
  this.detailIsVisible = true;
40
29
  }
41
30
  getScrollOffset() {
@@ -4,24 +4,16 @@ const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
4
4
  const MAX_FILTERS = 5;
5
5
  export class SnkFilterList {
6
6
  constructor() {
7
- this.innerClickCheck = (floatingContainer, node) => {
8
- if (node && floatingContainer) {
9
- if (!node.offsetParent) {
10
- return true;
11
- }
12
- let current = node;
13
- do {
14
- if (current === floatingContainer || current === this._element) {
15
- return true;
16
- }
17
- } while ((current = current.offsetParent) != null);
7
+ this.innerClickCheck = (_floatingContainer, node) => {
8
+ if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
9
+ return true;
18
10
  }
19
11
  this._detailIsVisible = false;
20
12
  return false;
21
13
  };
22
14
  }
23
15
  showList() {
24
- this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck });
16
+ this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, useOverlay: true });
25
17
  this._detailIsVisible = true;
26
18
  this._showAll = false;
27
19
  this._filterArgument = "";
@@ -83,14 +83,14 @@ export class DataFetcher {
83
83
  return UrlUtils.getUrlBase();
84
84
  }
85
85
  getContext(module) {
86
+ var _a;
86
87
  const urlParams = UrlUtils.getQueryParams(location.search);
87
88
  return {
88
89
  baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
89
90
  appName: "SankhyaBlocks",
90
- mgeSession: `${window['skw_session'] || urlParams.mgeSession}`,
91
+ mgeSession: `${window['skw_session'] || urlParams.get("mgeSession")}`,
91
92
  globalID: "85C0093DFA240EAB699B4E47A10215BD",
92
- //FIXME: Precisamos ajustar para buscar o resourceId pela aplicação
93
- resourceID: "br.com.sankhya.mov.bancaria"
93
+ resourceID: (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID))
94
94
  };
95
95
  }
96
96
  async callServiceBroker(serviceName, payload) {
@@ -19,7 +19,3 @@ export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './sn
19
19
  export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
20
20
  export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
21
21
  export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';
22
-
23
- const globalScripts = () => {};
24
-
25
- globalScripts();