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

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 (140) 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 +50 -214
  5. package/dist/cjs/snk-crud.cjs.entry.js +3 -3
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -23
  7. package/dist/cjs/snk-filter-bar_5.cjs.entry.js +902 -0
  8. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
  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 -22
  14. package/dist/cjs/snk-filter-search.cjs.entry.js +3 -3
  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/components/index.js +0 -4
  21. package/dist/components/snk-application2.js +10 -174
  22. package/dist/components/snk-crud.js +1 -1
  23. package/dist/components/snk-data-unit.js +2 -2
  24. package/dist/components/snk-filter-bar2.js +4 -2
  25. package/dist/components/snk-filter-detail2.js +1 -1
  26. package/dist/components/snk-filter-item2.js +1 -1
  27. package/dist/components/snk-filter-list2.js +1 -1
  28. package/dist/components/snk-filter-modal2.js +4 -19
  29. package/dist/components/snk-filter-personalized.js +2 -1
  30. package/dist/components/snk-filter-search.js +1 -1
  31. package/dist/components/snk-form2.js +1 -1
  32. package/dist/components/snk-grid2.js +1 -1
  33. package/dist/components/snk-pesquisa2.js +1 -1
  34. package/dist/components/snk-taskbar2.js +1 -1
  35. package/dist/components/teste-pesquisa.js +1 -1
  36. package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-81dda3cf.js} +160 -1508
  37. package/dist/esm/loader.js +2 -18
  38. package/dist/esm/sankhyablocks.js +4 -116
  39. package/dist/esm/snk-application.entry.js +11 -175
  40. package/dist/esm/snk-crud.entry.js +2 -2
  41. package/dist/esm/snk-data-unit.entry.js +3 -3
  42. package/dist/esm/{snk-filter-bar.entry.js → snk-filter-bar_5.entry.js} +436 -4
  43. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  44. package/dist/esm/snk-filter-detail.entry.js +2 -2
  45. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  46. package/dist/esm/snk-filter-number.entry.js +1 -1
  47. package/dist/esm/snk-filter-period.entry.js +1 -1
  48. package/dist/esm/snk-filter-personalized.entry.js +3 -2
  49. package/dist/esm/snk-filter-search.entry.js +2 -2
  50. package/dist/esm/snk-filter-text.entry.js +1 -1
  51. package/dist/{sankhyablocks/snk-form.entry.js → esm/snk-form_2.entry.js} +117 -4
  52. package/dist/esm/snk-pesquisa.entry.js +2 -2
  53. package/dist/esm/{taskbar-elements-35d64ff9.js → taskbar-elements-38eb5d51.js} +1 -1
  54. package/dist/esm/teste-pesquisa.entry.js +2 -2
  55. package/dist/sankhyablocks/index.esm.js +0 -1
  56. package/dist/sankhyablocks/p-0352c0e2.entry.js +1 -0
  57. package/dist/sankhyablocks/p-07ebda01.entry.js +1 -0
  58. package/dist/sankhyablocks/p-322c0df2.entry.js +1 -0
  59. package/dist/sankhyablocks/p-46caa101.entry.js +1 -0
  60. package/dist/sankhyablocks/p-473cedf9.entry.js +1 -0
  61. package/dist/sankhyablocks/p-586e2522.js +1 -0
  62. package/dist/sankhyablocks/p-86f15ffe.js +1 -0
  63. package/dist/sankhyablocks/p-8f3c5709.entry.js +1 -0
  64. package/dist/sankhyablocks/p-97009a2c.entry.js +1 -0
  65. package/dist/sankhyablocks/p-9be74b46.entry.js +74 -0
  66. package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
  67. package/dist/sankhyablocks/p-a8b59c61.entry.js +1 -0
  68. package/dist/sankhyablocks/p-aecf3e0a.entry.js +1 -0
  69. package/dist/sankhyablocks/p-c1c3b5d8.entry.js +1 -0
  70. package/dist/sankhyablocks/p-c78cb79a.entry.js +1 -0
  71. package/dist/sankhyablocks/p-c9eec639.entry.js +1 -0
  72. package/dist/sankhyablocks/p-dc482a42.entry.js +1 -0
  73. package/dist/sankhyablocks/p-fac2b6a9.js +2 -0
  74. package/dist/sankhyablocks/p-fb705f81.entry.js +1 -0
  75. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
  76. package/package.json +1 -1
  77. package/react/components.d.ts +19 -0
  78. package/react/components.js +19 -0
  79. package/react/components.js.map +1 -1
  80. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  81. package/dist/cjs/css-shim-b8158822.js +0 -6
  82. package/dist/cjs/dom-36862b77.js +0 -75
  83. package/dist/cjs/index-84fe3b86.js +0 -20
  84. package/dist/cjs/index-93965c41.js +0 -141
  85. package/dist/cjs/index-e90ae303.js +0 -2408
  86. package/dist/cjs/shadow-css-346c0795.js +0 -389
  87. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -466
  88. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -177
  89. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
  90. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -37
  91. package/dist/cjs/snk-grid.cjs.entry.js +0 -79
  92. package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
  93. package/dist/cjs/taskbar-processor-6bd0d35c.js +0 -47
  94. package/dist/components/index2.js +0 -2394
  95. package/dist/components/index3.js +0 -139
  96. package/dist/esm/app-globals-0f993ce5.js +0 -3
  97. package/dist/esm/css-shim-b3f2ee8d.js +0 -4
  98. package/dist/esm/dom-665d6011.js +0 -73
  99. package/dist/esm/index-2b4d2d14.js +0 -3262
  100. package/dist/esm/index-5992b7e6.js +0 -139
  101. package/dist/esm/index-c683b2b0.js +0 -2394
  102. package/dist/esm/index-c71285cb.js +0 -17
  103. package/dist/esm/shadow-css-b18e99d7.js +0 -387
  104. package/dist/esm/snk-filter-item.entry.js +0 -173
  105. package/dist/esm/snk-filter-list.entry.js +0 -87
  106. package/dist/esm/snk-filter-modal.entry.js +0 -33
  107. package/dist/esm/snk-form.entry.js +0 -129
  108. package/dist/esm/snk-grid.entry.js +0 -75
  109. package/dist/esm/snk-taskbar.entry.js +0 -156
  110. package/dist/esm/taskbar-processor-aa6772c9.js +0 -45
  111. package/dist/sankhyablocks/SnkMessageBuilder-35a20271.js +0 -199
  112. package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
  113. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
  114. package/dist/sankhyablocks/dom-665d6011.js +0 -73
  115. package/dist/sankhyablocks/filter-item-type.enum-a79b2fa8.js +0 -14
  116. package/dist/sankhyablocks/index-5992b7e6.js +0 -139
  117. package/dist/sankhyablocks/index-c683b2b0.js +0 -2394
  118. package/dist/sankhyablocks/index-c71285cb.js +0 -17
  119. package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
  120. package/dist/sankhyablocks/snk-application.entry.js +0 -8166
  121. package/dist/sankhyablocks/snk-crud.entry.js +0 -66
  122. package/dist/sankhyablocks/snk-data-unit.entry.js +0 -268
  123. package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -462
  124. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
  125. package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -80
  126. package/dist/sankhyablocks/snk-filter-item.entry.js +0 -173
  127. package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
  128. package/dist/sankhyablocks/snk-filter-modal.entry.js +0 -33
  129. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
  130. package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
  131. package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
  132. package/dist/sankhyablocks/snk-filter-personalized.entry.js +0 -85
  133. package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
  134. package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
  135. package/dist/sankhyablocks/snk-grid.entry.js +0 -75
  136. package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
  137. package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
  138. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +0 -90
  139. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
  140. package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
5
+ const index = require('./index-6fcf07f3.js');
6
6
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
7
7
 
8
8
  const SnkFilterBinarySelect = class {
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
6
- const index$1 = require('./index-93965c41.js');
5
+ const index = require('./index-6fcf07f3.js');
6
+ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
7
7
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
8
8
 
9
9
  const SnkFilterDetail = class {
@@ -64,7 +64,7 @@ const SnkFilterDetail = class {
64
64
  }
65
65
  if (!isValid) {
66
66
  this.keepOpened = true;
67
- index$1.ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.").then(() => setTimeout(() => this.keepOpened = false, 1));
67
+ utils.ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.").then(() => setTimeout(() => this.keepOpened = false, 1));
68
68
  }
69
69
  }
70
70
  /* WARNING: Temporário.*/
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
5
+ const index = require('./index-6fcf07f3.js');
6
6
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
7
7
 
8
8
  const SnkFilterMultiSelect = class {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
5
+ const index = require('./index-6fcf07f3.js');
6
6
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
7
7
 
8
8
  const SnkFilterPeriod = class {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
5
+ const index = require('./index-6fcf07f3.js');
6
6
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
7
7
 
8
8
  const SnkFilterPeriod = class {
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
6
- const index$1 = require('./index-e90ae303.js');
5
+ const index = require('./index-6fcf07f3.js');
6
+ const core = require('@sankhyalabs/core');
7
+ const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
7
8
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
8
9
 
9
10
  const SnkFilterPersonalized = class {
@@ -13,10 +14,10 @@ const SnkFilterPersonalized = class {
13
14
  getValue(param, index) {
14
15
  if (this.value && index >= 0 && index < this.value.length) {
15
16
  const rawValue = this.value[index];
16
- if (param.type === index$1.UserInterface.SEARCH) {
17
+ if (param.type === core.UserInterface.SEARCH) {
17
18
  return rawValue;
18
19
  }
19
- return index$1.convertType(param.dataType, rawValue);
20
+ return DataType.convertType(param.dataType, rawValue);
20
21
  }
21
22
  return undefined;
22
23
  }
@@ -33,7 +34,7 @@ const SnkFilterPersonalized = class {
33
34
  }
34
35
  }
35
36
  doSearch(mode, argument, param) {
36
- const application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
37
+ const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
37
38
  if (this.fix) {
38
39
  this.fix();
39
40
  }
@@ -55,26 +56,26 @@ const SnkFilterPersonalized = class {
55
56
  getParamsInterface() {
56
57
  var _a, _b, _c;
57
58
  const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
58
- return params.map((param, index$2) => {
59
+ return params.map((param, index$1) => {
59
60
  var _a;
60
61
  switch (param.type) {
61
- case index$1.UserInterface.SEARCH:
62
- return index.h("ez-search", { suppressEmptyOption: true, value: this.getValue(param, index$2), onEzChange: evt => this.setValue(index$2, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
63
- case index$1.UserInterface.SWITCH:
64
- case index$1.UserInterface.CHECKBOX:
65
- const mode = index$1.UserInterface.SWITCH === param.type ? "switch" : "regular";
66
- return index.h("ez-check", { class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index$2), label: param.label, onEzChange: evt => this.setValue(index$2, evt.detail) });
67
- case index$1.UserInterface.DECIMALNUMBER:
68
- case index$1.UserInterface.INTEGERNUMBER:
69
- return index.h("ez-number-input", { label: param.label, value: this.getValue(param, index$2), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index$2, evt.detail) });
70
- case index$1.UserInterface.OPTIONSELECTOR:
71
- return index.h("ez-combo-box", { label: param.label, value: this.getValue(param, index$2), options: param.options, onEzChange: evt => { var _a; return this.setValue(index$2, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
72
- case index$1.UserInterface.DATE:
73
- return index.h("ez-date-input", { label: param.label, value: this.getValue(param, index$2), onEzChange: evt => this.setValue(index$2, evt.detail) });
74
- case index$1.UserInterface.DATETIME:
75
- return index.h("ez-date-time-input", { label: param.label, value: this.getValue(param, index$2), onEzChange: evt => this.setValue(index$2, evt.detail) });
62
+ case core.UserInterface.SEARCH:
63
+ return index.h("ez-search", { suppressEmptyOption: true, value: this.getValue(param, index$1), onEzChange: evt => this.setValue(index$1, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
64
+ case core.UserInterface.SWITCH:
65
+ case core.UserInterface.CHECKBOX:
66
+ const mode = core.UserInterface.SWITCH === param.type ? "switch" : "regular";
67
+ return index.h("ez-check", { class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index$1), label: param.label, onEzChange: evt => this.setValue(index$1, evt.detail) });
68
+ case core.UserInterface.DECIMALNUMBER:
69
+ case core.UserInterface.INTEGERNUMBER:
70
+ return index.h("ez-number-input", { label: param.label, value: this.getValue(param, index$1), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index$1, evt.detail) });
71
+ case core.UserInterface.OPTIONSELECTOR:
72
+ return index.h("ez-combo-box", { label: param.label, value: this.getValue(param, index$1), options: param.options, onEzChange: evt => { var _a; return this.setValue(index$1, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
73
+ case core.UserInterface.DATE:
74
+ return index.h("ez-date-input", { label: param.label, value: this.getValue(param, index$1), onEzChange: evt => this.setValue(index$1, evt.detail) });
75
+ case core.UserInterface.DATETIME:
76
+ return index.h("ez-date-time-input", { label: param.label, value: this.getValue(param, index$1), onEzChange: evt => this.setValue(index$1, evt.detail) });
76
77
  default:
77
- return index.h("ez-text-input", { label: param.label, value: this.getValue(param, index$2), onEzChange: evt => this.setValue(index$2, evt.detail) });
78
+ return index.h("ez-text-input", { label: param.label, value: this.getValue(param, index$1), onEzChange: evt => this.setValue(index$1, evt.detail) });
78
79
  }
79
80
  });
80
81
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
6
- const index$1 = require('./index-e90ae303.js');
5
+ const index = require('./index-6fcf07f3.js');
6
+ const core = require('@sankhyalabs/core');
7
7
  const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
8
8
 
9
9
  const SnkFilterSearch = class {
@@ -14,7 +14,7 @@ const SnkFilterSearch = class {
14
14
  this.value = this._searchInput.value;
15
15
  }
16
16
  doSearch(mode, argument) {
17
- const application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
17
+ const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
18
18
  if (this.fix) {
19
19
  this.fix();
20
20
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
5
+ const index = require('./index-6fcf07f3.js');
6
6
 
7
7
  const SnkFilterText = class {
8
8
  constructor(hostRef) {
@@ -2,9 +2,53 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
6
- const index$1 = require('./index-e90ae303.js');
7
- const taskbarProcessor = require('./taskbar-processor-6bd0d35c.js');
5
+ const index = require('./index-6fcf07f3.js');
6
+ const core = require('@sankhyalabs/core');
7
+ const taskbarElements = require('./taskbar-elements-aedfeae6.js');
8
+
9
+ class TaskbarProcessor {
10
+ constructor(defaultButtons) {
11
+ this._defaultButtons = defaultButtons;
12
+ }
13
+ process(taskbarId, taskbarManager, dataState, disabledButtons = []) {
14
+ var _a;
15
+ this.customButtons = new Map();
16
+ this.buttons = "";
17
+ this.disabledButtons = [];
18
+ (_a = this.getButtonsArray(taskbarId, taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach(btnDef => {
19
+ let buttonName;
20
+ if (typeof btnDef === "string") {
21
+ buttonName = btnDef;
22
+ }
23
+ else {
24
+ const customBtn = btnDef;
25
+ this.customButtons.set(customBtn.name, customBtn);
26
+ buttonName = customBtn.name;
27
+ }
28
+ if (!this.isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabledButtons)) {
29
+ this.disabledButtons.push(buttonName);
30
+ }
31
+ if (this.buttons.length > 0) {
32
+ this.buttons += ",";
33
+ }
34
+ this.buttons += buttonName;
35
+ });
36
+ }
37
+ getButtonsArray(taskbarId, taskbarManager, dataState) {
38
+ const defaults = this._defaultButtons[taskbarId];
39
+ if (taskbarManager) {
40
+ return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
41
+ }
42
+ return defaults;
43
+ }
44
+ isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
45
+ const originalValue = disabled.includes(buttonName) ? false : true;
46
+ if (taskbarManager && taskbarManager.isEnabled) {
47
+ return taskbarManager.isEnabled(taskbarId, dataState, buttonName, originalValue);
48
+ }
49
+ return originalValue;
50
+ }
51
+ }
8
52
 
9
53
  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
54
 
@@ -13,7 +57,7 @@ const SnkForm = class {
13
57
  index.registerInstance(this, hostRef);
14
58
  this.exit = index.createEvent(this, "exit", 7);
15
59
  this.actionClick = index.createEvent(this, "actionClick", 7);
16
- this._taskbarProcessor = new taskbarProcessor.TaskbarProcessor({
60
+ this._taskbarProcessor = new TaskbarProcessor({
17
61
  "snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
18
62
  "snkForm.finish_edition": ["CANCEL", "SAVE"]
19
63
  });
@@ -74,7 +118,7 @@ const SnkForm = class {
74
118
  return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
75
119
  }
76
120
  componentWillLoad() {
77
- this._application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
121
+ this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
78
122
  if (this._application) {
79
123
  this._application.loadFormConfig(this.configName).then(cfg => {
80
124
  this._configLoaded = true;
@@ -130,4 +174,74 @@ const SnkForm = class {
130
174
  };
131
175
  SnkForm.style = snkFormCss;
132
176
 
177
+ 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)}";
178
+
179
+ const SnkGrid = class {
180
+ constructor(hostRef) {
181
+ index.registerInstance(this, hostRef);
182
+ this.actionClick = index.createEvent(this, "actionClick", 7);
183
+ this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
184
+ this._topTaskbarProcessor = new TaskbarProcessor({
185
+ "snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
186
+ });
187
+ this._headerTaskbarProcessor = new TaskbarProcessor({
188
+ "snkGridHeaderTaskbar.unselected": ["REFRESH"],
189
+ "snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
190
+ });
191
+ }
192
+ actionClickHandler(evt) {
193
+ if (evt.detail === taskbarElements.TaskbarElement.CONFIG_GRID && this._grid) {
194
+ this._grid.openGridConfig();
195
+ }
196
+ }
197
+ saveConfig(config) {
198
+ const snkApplication = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
199
+ if (snkApplication) {
200
+ snkApplication.saveGridConfig(config);
201
+ }
202
+ }
203
+ componentWillLoad() {
204
+ const snkApplication = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
205
+ if (snkApplication) {
206
+ snkApplication.loadGridConfig(this.configName).then(cfg => {
207
+ this._gridConfig = cfg;
208
+ this._configLoaded = true;
209
+ });
210
+ //Forçamos a carga dos acessos pra aproveitar a request inicial.
211
+ snkApplication.getAllAccess();
212
+ }
213
+ let parent = this._element.parentElement;
214
+ while (parent) {
215
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
216
+ this._snkDataUnit = parent;
217
+ this._dataUnit = this._snkDataUnit.dataUnit;
218
+ if (!this._dataUnit) {
219
+ this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
220
+ this._dataUnit = evt.detail;
221
+ });
222
+ }
223
+ this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
224
+ this._dataState = evt.detail;
225
+ });
226
+ break;
227
+ }
228
+ parent = parent.parentElement;
229
+ }
230
+ }
231
+ componentWillRender() {
232
+ const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
233
+ this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
234
+ this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
235
+ }
236
+ render() {
237
+ if (!this._configLoaded || !this._dataUnit) {
238
+ return undefined;
239
+ }
240
+ 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", { dataUnit: this._dataUnit, class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), 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(), statusResolver: this.statusResolver }, 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" }))));
241
+ }
242
+ get _element() { return index.getElement(this); }
243
+ };
244
+ SnkGrid.style = snkGridCss;
245
+
133
246
  exports.snk_form = SnkForm;
247
+ 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-b0b676c5.js');
6
- const index$1 = require('./index-e90ae303.js');
5
+ const index = require('./index-6fcf07f3.js');
6
+ const core = require('@sankhyalabs/core');
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 = index$1.ObjectUtils.stringToObject(resp.json.$);
62
+ resp = core.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 = !index$1.StringUtils.isEmpty(item[field.fieldName]) &&
90
+ let accept = !core.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 index$1.ObjectUtils.objectToString(obj1) === index$1.ObjectUtils.objectToString(obj2);
128
+ return core.ObjectUtils.objectToString(obj1) === core.ObjectUtils.objectToString(obj2);
129
129
  }
130
130
  find(arr, checkerFn) {
131
131
  if (arr) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-b0b676c5.js');
3
+ const index = require('./index-6fcf07f3.js');
4
4
 
5
5
  exports.TaskbarElement = void 0;
6
6
  (function (TaskbarElement) {
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
6
- const index$1 = require('./index-e90ae303.js');
5
+ const index = require('./index-6fcf07f3.js');
6
+ const core = require('@sankhyalabs/core');
7
7
 
8
8
  const testePesquisaCss = ":host{display:block}";
9
9
 
@@ -12,7 +12,7 @@ const TestePesquisa = class {
12
12
  index.registerInstance(this, hostRef);
13
13
  }
14
14
  componentWillLoad() {
15
- this.dataUnit = new index$1.DataUnit("testes_com_formulario");
15
+ this.dataUnit = new core.DataUnit("testes_com_formulario");
16
16
  this.dataUnit.metadata = {
17
17
  name: "dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",
18
18
  label: "Parceiro",
@@ -20,8 +20,8 @@ const TestePesquisa = class {
20
20
  {
21
21
  name: "CODPARC",
22
22
  label: "Parceiro",
23
- dataType: index$1.DataType.NUMBER,
24
- userInterface: index$1.UserInterface.SEARCH,
23
+ dataType: core.DataType.NUMBER,
24
+ userInterface: core.UserInterface.SEARCH,
25
25
  required: true,
26
26
  properties: { ENTITYNAME: "Parceiro" }
27
27
  }
@@ -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();