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

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 (120) hide show
  1. package/dist/cjs/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-d8215915.js} +14 -119
  2. package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
  3. package/dist/cjs/index-84fe3b86.js +20 -0
  4. package/dist/cjs/index-93965c41.js +141 -0
  5. package/dist/cjs/{index-02201bc9.js → index-e90ae303.js} +11 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  8. package/dist/cjs/snk-application.cjs.entry.js +43 -25
  9. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-data-unit.cjs.entry.js +10 -18
  11. package/dist/cjs/snk-filter-bar.cjs.entry.js +334 -146
  12. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-filter-detail.cjs.entry.js +37 -2
  14. package/dist/cjs/snk-filter-item.cjs.entry.js +34 -11
  15. package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-filter-modal.cjs.entry.js +37 -0
  17. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
  21. package/dist/cjs/snk-filter-search.cjs.entry.js +2 -2
  22. package/dist/cjs/snk-form.cjs.entry.js +1 -1
  23. package/dist/cjs/snk-grid.cjs.entry.js +1 -1
  24. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
  26. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  27. package/dist/collection/collection-manifest.json +2 -0
  28. package/dist/collection/components/snk-application/snk-application.js +54 -7
  29. package/dist/collection/components/snk-crud/snk-crud.js +2 -4
  30. package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -27
  31. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
  33. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
  34. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +36 -1
  35. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +32 -9
  36. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
  37. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +22 -0
  38. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +238 -139
  39. package/dist/collection/components/snk-grid/snk-grid.js +2 -4
  40. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
  41. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
  42. package/dist/components/SnkMessageBuilder.js +15 -119
  43. package/dist/components/filter-item-type.enum.js +2 -0
  44. package/dist/components/index.d.ts +2 -0
  45. package/dist/components/index.js +2 -0
  46. package/dist/components/index2.js +11 -1
  47. package/dist/components/index3.js +139 -0
  48. package/dist/components/snk-application2.js +39 -19
  49. package/dist/components/snk-crud.js +15 -9
  50. package/dist/components/snk-data-unit.js +2 -11
  51. package/dist/components/snk-filter-bar2.js +340 -146
  52. package/dist/components/snk-filter-detail2.js +36 -1
  53. package/dist/components/snk-filter-item2.js +32 -9
  54. package/dist/components/snk-filter-list2.js +1 -1
  55. package/dist/components/snk-filter-modal.d.ts +11 -0
  56. package/dist/components/snk-filter-modal.js +6 -0
  57. package/dist/components/snk-filter-modal2.js +73 -0
  58. package/dist/components/snk-filter-personalized.d.ts +11 -0
  59. package/dist/components/snk-filter-personalized.js +107 -0
  60. package/dist/components/snk-grid2.js +15 -9
  61. package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-35a20271.js} +15 -119
  62. package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
  63. package/dist/esm/index-5992b7e6.js +139 -0
  64. package/dist/esm/{index-f1d3e4da.js → index-c683b2b0.js} +11 -1
  65. package/dist/esm/index-c71285cb.js +17 -0
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/sankhyablocks.js +1 -1
  68. package/dist/esm/snk-application.entry.js +37 -19
  69. package/dist/esm/snk-crud.entry.js +1 -1
  70. package/dist/esm/snk-data-unit.entry.js +3 -11
  71. package/dist/esm/snk-filter-bar.entry.js +328 -140
  72. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  73. package/dist/esm/snk-filter-detail.entry.js +37 -2
  74. package/dist/esm/snk-filter-item.entry.js +34 -11
  75. package/dist/esm/snk-filter-list.entry.js +1 -1
  76. package/dist/esm/snk-filter-modal.entry.js +33 -0
  77. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  78. package/dist/esm/snk-filter-number.entry.js +1 -1
  79. package/dist/esm/snk-filter-period.entry.js +1 -1
  80. package/dist/esm/snk-filter-personalized.entry.js +85 -0
  81. package/dist/esm/snk-filter-search.entry.js +2 -2
  82. package/dist/esm/snk-form.entry.js +1 -1
  83. package/dist/esm/snk-grid.entry.js +1 -1
  84. package/dist/esm/snk-pesquisa.entry.js +1 -1
  85. package/dist/esm/snk-taskbar.entry.js +1 -1
  86. package/dist/esm/teste-pesquisa.entry.js +1 -1
  87. package/dist/{esm/SnkMessageBuilder-a7da466b.js → sankhyablocks/SnkMessageBuilder-35a20271.js} +15 -119
  88. package/dist/sankhyablocks/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
  89. package/dist/sankhyablocks/index-5992b7e6.js +139 -0
  90. package/dist/sankhyablocks/{index-f1d3e4da.js → index-c683b2b0.js} +11 -1
  91. package/dist/sankhyablocks/index-c71285cb.js +17 -0
  92. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  93. package/dist/sankhyablocks/snk-application.entry.js +37 -19
  94. package/dist/sankhyablocks/snk-crud.entry.js +1 -1
  95. package/dist/sankhyablocks/snk-data-unit.entry.js +3 -11
  96. package/dist/sankhyablocks/snk-filter-bar.entry.js +328 -140
  97. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +1 -1
  98. package/dist/sankhyablocks/snk-filter-detail.entry.js +37 -2
  99. package/dist/sankhyablocks/snk-filter-item.entry.js +34 -11
  100. package/dist/sankhyablocks/snk-filter-list.entry.js +1 -1
  101. package/dist/sankhyablocks/snk-filter-modal.entry.js +33 -0
  102. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +1 -1
  103. package/dist/sankhyablocks/snk-filter-number.entry.js +1 -1
  104. package/dist/sankhyablocks/snk-filter-period.entry.js +1 -1
  105. package/dist/sankhyablocks/snk-filter-personalized.entry.js +85 -0
  106. package/dist/sankhyablocks/snk-filter-search.entry.js +2 -2
  107. package/dist/sankhyablocks/snk-form.entry.js +1 -1
  108. package/dist/sankhyablocks/snk-grid.entry.js +1 -1
  109. package/dist/sankhyablocks/snk-pesquisa.entry.js +1 -1
  110. package/dist/sankhyablocks/snk-taskbar.entry.js +1 -1
  111. package/dist/sankhyablocks/teste-pesquisa.entry.js +1 -1
  112. package/dist/types/components/snk-application/snk-application.d.ts +4 -1
  113. package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
  114. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
  115. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
  116. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
  117. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
  118. package/dist/types/components.d.ts +56 -8
  119. package/package.json +3 -3
  120. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -51
@@ -1,119 +1,3 @@
1
- var DialogType;
2
- (function (DialogType) {
3
- DialogType["WARN"] = "warn";
4
- DialogType["CRITICAL"] = "critical";
5
- DialogType["DEFAULT"] = "default";
6
- })(DialogType || (DialogType = {}));
7
-
8
- class ApplicationUtils {
9
- static async showDialog(title, message, icon = null, confirm, dialogType = DialogType.DEFAULT, options) {
10
- if (options) {
11
- options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
12
- }
13
- return new Promise(resolve => {
14
- let dialog = document.querySelector("ez-dialog");
15
- if (!dialog) {
16
- dialog = document.createElement("ez-dialog");
17
- window.document.body.appendChild(dialog);
18
- }
19
- dialog.show(title, message, dialogType, confirm, icon, options.labelCancel, options.labelConfirm, options.btnConfirmDanger).then(ok => resolve(ok));
20
- });
21
- }
22
- static async alert(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
23
- return ApplicationUtils.showDialog(title, message, icon, false, DialogType.WARN, options);
24
- }
25
- static async error(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
26
- return ApplicationUtils.showDialog(title, message, icon, false, DialogType.CRITICAL, options);
27
- }
28
- static async confirm(title, message, icon = null, dialogType = DialogType.WARN, options = ApplicationUtils.defaultMessageOptions) {
29
- return ApplicationUtils.showDialog(title, message, icon, true, dialogType, options);
30
- }
31
- static async message(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
32
- return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
33
- }
34
- static async info(message, options = ApplicationUtils.defaultMessageOptions) {
35
- let toast = document.querySelector("ez-toast");
36
- if (!toast) {
37
- toast = document.createElement("ez-toast");
38
- const icon = document.createElement("ez-icon");
39
- icon.className = "ez-margin-right--small toast__icon--color";
40
- icon.slot = "icon";
41
- toast.appendChild(icon);
42
- window.document.body.appendChild(toast);
43
- }
44
- if (options.iconName) {
45
- const iconElem = toast.querySelector("ez-icon");
46
- if (iconElem) {
47
- iconElem.iconName = options.iconName;
48
- toast.useIcon = true;
49
- }
50
- }
51
- else {
52
- toast.useIcon = false;
53
- }
54
- toast.show(message, 5000, false, options.canClose);
55
- }
56
- }
57
- ApplicationUtils.defaultMessageOptions = {
58
- canClose: true,
59
- labelCancel: 'Não',
60
- labelConfirm: 'Sim',
61
- btnConfirmDanger: false
62
- };
63
- ;
64
-
65
- class CSSVarsUtils {
66
- static applyVarsTextInput(host, child) {
67
- if (child) {
68
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
69
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
70
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
71
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--background-color');
72
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--color');
73
- }
74
- }
75
- static applyVarsButton(host, child) {
76
- if (child) {
77
- ["--ez-button--min-width",
78
- "--ez-button--height",
79
- "--ez-button__icon--width",
80
- "--ez-button__inline__icon--padding",
81
- "--ez-button--padding-top",
82
- "--ez-button--padding-bottom",
83
- "--ez-button--padding-right",
84
- "--ez-button--padding-left",
85
- "--ez-button--color",
86
- "--ez-button--font-size",
87
- "--ez-button--font-family",
88
- "--ez-button--font-weight",
89
- "--ez-button--background-color",
90
- "--ez-button--border-radius",
91
- "--ez-button--border",
92
- "--ez-button--hover-color",
93
- "--ez-button--hover--background-color",
94
- "--ez-button--disabled-color",
95
- "--ez-button--disabled--background-color",
96
- "--ez-button--focus--border",
97
- "--ez-button--focus--box-shadow",
98
- "--ez-button--active-color",
99
- "--ez-button--active--background-color",
100
- "--ez-button--link-color",
101
- "--ez-button--link--hover-color",
102
- "--ez-button--link--small--font-size",
103
- "--ez-button--link--medium--font-size",
104
- "--ez-button--link--large--font-size",].forEach(prop => {
105
- CSSVarsUtils.applyIfExists(host, child, prop);
106
- });
107
- }
108
- }
109
- static applyIfExists(host, element, varName) {
110
- const prop = getComputedStyle(host).getPropertyValue(varName);
111
- if (prop) {
112
- element.style.setProperty(varName, prop);
113
- }
114
- }
115
- }
116
-
117
1
  const snkDataUnitMessages = {
118
2
  saveInfo: {
119
3
  clone: "Duplicação realizada!",
@@ -146,13 +30,25 @@ const snkFilterBarMessages = {
146
30
  "applyFilter": "Aplicar",
147
31
  "findFilter": "Buscar filtros...",
148
32
  "findField": "Buscar filtros...",
33
+ "modalFindFilter": "Buscar filtro",
149
34
  "emptyFiltersList": "Não há filtros disponíveis",
150
35
  "emptyAppliedFiltersList": "Não há filtros aplicados",
151
36
  "customFilter": "Filtro personalizado",
152
- "defaultFilter": "Filtro padrao",
37
+ "defaultFilter": "Filtro padrão",
153
38
  "failToLoadConfig": "Falha ao buscar configuração de filtros",
154
39
  "clearAllFilters": "Limpar todos os filtros",
155
- "successfullyCleaned": "Filtro limpo com sucesso!"
40
+ "successfullyCleaned": "Filtro limpo com sucesso!",
41
+ "activeFilter": "{{ACTIVE_FILTERS}} filtro aplicado",
42
+ "activeFilters": "{{ACTIVE_FILTERS}} filtros aplicados",
43
+ "noActiveFilters": "Nenhum filtro aplicado",
44
+ "modalDefaultFilterTitle": "Filtro padrão",
45
+ "modalInfoTextEditDefault": "Use o layout antigo para editar o seu filtro padrão, em breve traremos uma nova experiência.",
46
+ "modalInfoTextCreateDefault": "Use o layout antigo para criar o seu filtro padrão, em breve traremos uma nova experiência.",
47
+ "modalPersonalizedFilterTitle": "Filtro personalizado",
48
+ "modalPersonalizedFilterSubTitle": "Gerencie seus filtros",
49
+ "modalInfoTextCreateEditPersonalized": "Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",
50
+ "modalOkButtonLabel": "Aplicar",
51
+ "modalCancelButtonLabel": "Limpar"
156
52
  };
157
53
 
158
54
  const snkFormMessages = {
@@ -300,4 +196,4 @@ var OperationMap;
300
196
  OperationMap["CLEAN"] = "clean";
301
197
  })(OperationMap || (OperationMap = {}));
302
198
 
303
- export { ApplicationUtils as A, DialogType as D, OperationMap as O, SnkMessageBuilder as S };
199
+ export { OperationMap as O, SnkMessageBuilder as S };
@@ -6,6 +6,8 @@ var FilterItemType;
6
6
  FilterItemType["SEARCH"] = "SEARCH";
7
7
  FilterItemType["TEXT"] = "TEXT";
8
8
  FilterItemType["NUMBER"] = "NUMBER";
9
+ FilterItemType["DEFAULT_FILTER"] = "DEFAULT_FILTER";
10
+ FilterItemType["PERSONALIZED"] = "PERSONALIZED";
9
11
  })(FilterItemType || (FilterItemType = {}));
10
12
  const FilterItemType$1 = FilterItemType;
11
13
 
@@ -7,9 +7,11 @@ export { SnkFilterBinarySelect as SnkFilterBinarySelect } from '../types/compone
7
7
  export { SnkFilterDetail as SnkFilterDetail } from '../types/components/snk-filter-bar/filter-item/snk-filter-detail';
8
8
  export { SnkFilterItem as SnkFilterItem } from '../types/components/snk-filter-bar/filter-item/snk-filter-item';
9
9
  export { SnkFilterList as SnkFilterList } from '../types/components/snk-filter-bar/filter-list/snk-filter-list';
10
+ export { SnkFilterModal as SnkFilterModal } from '../types/components/snk-filter-bar/filter-modal/snk-filter-modal';
10
11
  export { SnkFilterMultiSelect as SnkFilterMultiSelect } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select';
11
12
  export { SnkFilterPeriod as SnkFilterNumber } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-number';
12
13
  export { SnkFilterPeriod as SnkFilterPeriod } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-period';
14
+ export { SnkFilterPersonalized as SnkFilterPersonalized } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized';
13
15
  export { SnkFilterSearch as SnkFilterSearch } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-search';
14
16
  export { SnkFilterText as SnkFilterText } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-text';
15
17
  export { SnkForm as SnkForm } from '../types/components/snk-form/snk-form';
@@ -7,9 +7,11 @@ export { SnkFilterBinarySelect, defineCustomElement as defineCustomElementSnkFil
7
7
  export { SnkFilterDetail, defineCustomElement as defineCustomElementSnkFilterDetail } from './snk-filter-detail.js';
8
8
  export { SnkFilterItem, defineCustomElement as defineCustomElementSnkFilterItem } from './snk-filter-item.js';
9
9
  export { SnkFilterList, defineCustomElement as defineCustomElementSnkFilterList } from './snk-filter-list.js';
10
+ export { SnkFilterModal, defineCustomElement as defineCustomElementSnkFilterModal } from './snk-filter-modal.js';
10
11
  export { SnkFilterMultiSelect, defineCustomElement as defineCustomElementSnkFilterMultiSelect } from './snk-filter-multi-select.js';
11
12
  export { SnkFilterNumber, defineCustomElement as defineCustomElementSnkFilterNumber } from './snk-filter-number.js';
12
13
  export { SnkFilterPeriod, defineCustomElement as defineCustomElementSnkFilterPeriod } from './snk-filter-period.js';
14
+ export { SnkFilterPersonalized, defineCustomElement as defineCustomElementSnkFilterPersonalized } from './snk-filter-personalized.js';
13
15
  export { SnkFilterSearch, defineCustomElement as defineCustomElementSnkFilterSearch } from './snk-filter-search.js';
14
16
  export { SnkFilterText, defineCustomElement as defineCustomElementSnkFilterText } from './snk-filter-text.js';
15
17
  export { SnkForm, defineCustomElement as defineCustomElementSnkForm } from './snk-form.js';
@@ -268,6 +268,16 @@ NumberUtils.changeFormat = (value) => {
268
268
  //Formatting output following formatnumber
269
269
  return value.replace(/\./g, '_').replace(/\,/g, '.').replace(/\_/g, ',');
270
270
  };
271
+ /**
272
+ * @getValueOrZero: valida se o parametro é undefined caso seja retorna zero.
273
+ *
274
+ * @param value numero a ser validado
275
+ *
276
+ * @returns o proprio numero passado ou zero
277
+ */
278
+ NumberUtils.getValueOrZero = (value) => {
279
+ return value !== undefined ? value : 0;
280
+ };
271
281
 
272
282
  /**
273
283
  * `MaskFormatter` é usado para formatar strings. Seu comportamento
@@ -2381,4 +2391,4 @@ class ErrorTracking {
2381
2391
  }
2382
2392
  }
2383
2393
 
2384
- export { ApplicationContext as A, ChangeOperation as C, DataUnit as D, ErrorException as E, FloatingManager as F, ObjectUtils as O, StringUtils as S, UserInterface as U, WarningException as W, Action as a, DataType as b, DateUtils as c, WaitingChangeException as d, DependencyType as e, ErrorTracking as f, ArrayUtils as g, toString as t };
2394
+ export { ApplicationContext as A, ChangeOperation as C, DataUnit as D, ErrorException as E, FloatingManager as F, ObjectUtils as O, StringUtils as S, UserInterface as U, WarningException as W, Action as a, DataType as b, convertType as c, DateUtils as d, WaitingChangeException as e, DependencyType as f, ErrorTracking as g, ArrayUtils as h, toString as t };
@@ -0,0 +1,139 @@
1
+ var DialogType;
2
+ (function (DialogType) {
3
+ DialogType["WARN"] = "warn";
4
+ DialogType["CRITICAL"] = "critical";
5
+ DialogType["SUCCESS"] = "success";
6
+ DialogType["DEFAULT"] = "default";
7
+ })(DialogType || (DialogType = {}));
8
+
9
+ class ApplicationUtils {
10
+ static async showDialog(title, message, icon = null, confirm, dialogType = DialogType.DEFAULT, options) {
11
+ if (options) {
12
+ options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
13
+ }
14
+ return new Promise(resolve => {
15
+ let dialog = document.querySelector("ez-dialog");
16
+ if (!dialog) {
17
+ dialog = document.createElement("ez-dialog");
18
+ window.document.body.appendChild(dialog);
19
+ }
20
+ dialog.show(title, message, dialogType, confirm, icon, options.labelCancel, options.labelConfirm, options.btnConfirmDanger).then(ok => resolve(ok));
21
+ });
22
+ }
23
+ static async alert(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
24
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.WARN, options);
25
+ }
26
+ static async error(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
27
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.CRITICAL, options);
28
+ }
29
+ static async success(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
30
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.SUCCESS, options);
31
+ }
32
+ static async confirm(title, message, icon = null, dialogType = DialogType.WARN, options = ApplicationUtils.defaultMessageOptions) {
33
+ return ApplicationUtils.showDialog(title, message, icon, true, dialogType, options);
34
+ }
35
+ static async message(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
36
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
37
+ }
38
+ static async info(message, options = ApplicationUtils.defaultMessageOptions) {
39
+ let toast = document.querySelector("ez-toast");
40
+ if (!toast) {
41
+ toast = document.createElement("ez-toast");
42
+ const icon = document.createElement("ez-icon");
43
+ icon.className = "ez-margin-right--small";
44
+ icon.slot = "icon";
45
+ icon.style.setProperty('--ez-icon--color', 'var(--color--success)');
46
+ toast.appendChild(icon);
47
+ window.document.body.appendChild(toast);
48
+ }
49
+ if (options.iconName) {
50
+ const iconElem = toast.querySelector("ez-icon");
51
+ if (iconElem) {
52
+ iconElem.iconName = options.iconName;
53
+ toast.useIcon = true;
54
+ }
55
+ }
56
+ else {
57
+ toast.useIcon = false;
58
+ }
59
+ toast.show(message, 5000, false, options.canClose);
60
+ }
61
+ }
62
+ ApplicationUtils.defaultMessageOptions = {
63
+ canClose: true,
64
+ labelCancel: 'Não',
65
+ labelConfirm: 'Sim',
66
+ btnConfirmDanger: false
67
+ };
68
+ ;
69
+
70
+ class CSSVarsUtils {
71
+ static applyCSSVars(document, host, child) {
72
+ const isSameDomain = (styleSheet) => {
73
+ if (!styleSheet.href) {
74
+ return true;
75
+ }
76
+ return styleSheet.href.indexOf(window.location.origin) === 0;
77
+ };
78
+ Array.from(document.styleSheets).filter(isSameDomain).forEach((sheet) => {
79
+ Array.from(sheet.cssRules).filter(rule => rule instanceof CSSStyleRule).forEach((rule) => {
80
+ Array.from(rule.style).forEach((propName) => {
81
+ if (propName.startsWith("--")) {
82
+ CSSVarsUtils.applyIfExists(host, child, propName);
83
+ }
84
+ });
85
+ });
86
+ });
87
+ }
88
+ static applyVarsTextInput(host, child) {
89
+ if (child) {
90
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
91
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
92
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
93
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--background-color');
94
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--color');
95
+ }
96
+ }
97
+ static applyVarsButton(host, child) {
98
+ if (child) {
99
+ ["--ez-button--min-width",
100
+ "--ez-button--height",
101
+ "--ez-button__icon--width",
102
+ "--ez-button__inline__icon--padding",
103
+ "--ez-button--padding-top",
104
+ "--ez-button--padding-bottom",
105
+ "--ez-button--padding-right",
106
+ "--ez-button--padding-left",
107
+ "--ez-button--color",
108
+ "--ez-button--font-size",
109
+ "--ez-button--font-family",
110
+ "--ez-button--font-weight",
111
+ "--ez-button--background-color",
112
+ "--ez-button--border-radius",
113
+ "--ez-button--border",
114
+ "--ez-button--hover-color",
115
+ "--ez-button--hover--background-color",
116
+ "--ez-button--disabled-color",
117
+ "--ez-button--disabled--background-color",
118
+ "--ez-button--focus--border",
119
+ "--ez-button--focus--box-shadow",
120
+ "--ez-button--active-color",
121
+ "--ez-button--active--background-color",
122
+ "--ez-button--link-color",
123
+ "--ez-button--link--hover-color",
124
+ "--ez-button--link--small--font-size",
125
+ "--ez-button--link--medium--font-size",
126
+ "--ez-button--link--large--font-size",].forEach(prop => {
127
+ CSSVarsUtils.applyIfExists(host, child, prop);
128
+ });
129
+ }
130
+ }
131
+ static applyIfExists(host, element, varName) {
132
+ const prop = getComputedStyle(host).getPropertyValue(varName);
133
+ if (prop) {
134
+ element.style.setProperty(varName, prop);
135
+ }
136
+ }
137
+ }
138
+
139
+ export { ApplicationUtils as A, DialogType as D };
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { E as ErrorException, W as WarningException, S as StringUtils, D as DataUnit, b as DataType, C as ChangeOperation, c as DateUtils, O as ObjectUtils, d as WaitingChangeException, e as DependencyType, A as ApplicationContext, f as ErrorTracking } from './index2.js';
3
- import { A as ApplicationUtils, S as SnkMessageBuilder } from './SnkMessageBuilder.js';
2
+ import { E as ErrorException, W as WarningException, S as StringUtils, D as DataUnit, b as DataType, C as ChangeOperation, d as DateUtils, O as ObjectUtils, e as WaitingChangeException, f as DependencyType, A as ApplicationContext, g as ErrorTracking } from './index2.js';
3
+ import { A as ApplicationUtils } from './index3.js';
4
+ import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
4
5
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
5
6
 
6
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -7516,20 +7517,28 @@ class TotalsFetcher {
7516
7517
  }
7517
7518
 
7518
7519
  function normalizeValue(value) {
7520
+ if (value == undefined) {
7521
+ return value;
7522
+ }
7519
7523
  if (value instanceof Date) {
7520
7524
  return value.toISOString();
7521
7525
  }
7522
7526
  if (typeof value === "object") {
7523
- const normalized = Object.assign({}, value);
7524
- Object.keys(value).forEach(prop => {
7525
- if (value[prop]) {
7526
- normalized[prop] = normalizeValue(value[prop]);
7527
- }
7528
- else {
7529
- delete normalized[prop];
7530
- }
7531
- });
7532
- return normalized;
7527
+ if (value instanceof Array) {
7528
+ return value.map(item => normalizeValue(item));
7529
+ }
7530
+ else {
7531
+ const normalized = Object.assign({}, value);
7532
+ Object.keys(value).forEach(prop => {
7533
+ if (value[prop]) {
7534
+ normalized[prop] = normalizeValue(value[prop]);
7535
+ }
7536
+ else {
7537
+ delete normalized[prop];
7538
+ }
7539
+ });
7540
+ return normalized;
7541
+ }
7533
7542
  }
7534
7543
  return value;
7535
7544
  }
@@ -7695,15 +7704,24 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7695
7704
  * Mostra o conteúdo passado em um Popup
7696
7705
  */
7697
7706
  async showPopUp(content) {
7698
- this.clearPopUpContent();
7707
+ this.clearContent(this._popUp);
7699
7708
  this._popUp.appendChild(content);
7700
7709
  this._popUp.opened = true;
7701
7710
  }
7711
+ async showModal(content) {
7712
+ this.clearContent(this._rightModal);
7713
+ this._rightModal.appendChild(content);
7714
+ this._rightModal.opened = true;
7715
+ }
7716
+ async closeModal() {
7717
+ this.clearContent(this._rightModal);
7718
+ this._rightModal.opened = false;
7719
+ }
7702
7720
  /**
7703
7721
  * Fecha o popup, liberando o conteúdo.
7704
7722
  */
7705
7723
  async closePopUp() {
7706
- this.clearPopUpContent();
7724
+ this.clearContent(this._popUp);
7707
7725
  this._popUp.opened = false;
7708
7726
  }
7709
7727
  /**
@@ -8046,10 +8064,10 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
8046
8064
  accept(window['isDebugMode']);
8047
8065
  });
8048
8066
  }
8049
- clearPopUpContent() {
8050
- if (this._popUp) {
8051
- Array.from(this._popUp.children).forEach(c => {
8052
- this._popUp.removeChild(c);
8067
+ clearContent(container) {
8068
+ if (container) {
8069
+ Array.from(container.children).forEach(child => {
8070
+ container.removeChild(child);
8053
8071
  });
8054
8072
  }
8055
8073
  }
@@ -8093,7 +8111,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
8093
8111
  });
8094
8112
  }
8095
8113
  render() {
8096
- return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() })));
8114
+ return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "col col--sd-3", closeOutsideClick: true })));
8097
8115
  }
8098
8116
  static get style() { return snkApplicationCss; }
8099
8117
  }, [2, "snk-application", {
@@ -8108,6 +8126,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
8108
8126
  "getBooleanParam": [64],
8109
8127
  "getDateParam": [64],
8110
8128
  "showPopUp": [64],
8129
+ "showModal": [64],
8130
+ "closeModal": [64],
8111
8131
  "closePopUp": [64],
8112
8132
  "temOpcional": [64],
8113
8133
  "getConfig": [64],
@@ -1,9 +1,10 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { A as ApplicationContext } from './index2.js';
3
- import { d as defineCustomElement$8 } from './snk-filter-bar2.js';
4
- import { d as defineCustomElement$7 } from './snk-filter-detail2.js';
5
- import { d as defineCustomElement$6 } from './snk-filter-item2.js';
6
- import { d as defineCustomElement$5 } from './snk-filter-list2.js';
3
+ import { d as defineCustomElement$9 } from './snk-filter-bar2.js';
4
+ import { d as defineCustomElement$8 } from './snk-filter-detail2.js';
5
+ import { d as defineCustomElement$7 } from './snk-filter-item2.js';
6
+ import { d as defineCustomElement$6 } from './snk-filter-list2.js';
7
+ import { d as defineCustomElement$5 } from './snk-filter-modal2.js';
7
8
  import { d as defineCustomElement$4 } from './snk-form2.js';
8
9
  import { d as defineCustomElement$3 } from './snk-grid2.js';
9
10
  import { d as defineCustomElement$2 } from './snk-taskbar2.js';
@@ -74,7 +75,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
74
75
  "actionsList": [16],
75
76
  "taskbarManager": [16],
76
77
  "recordsValidator": [16],
77
- "statusResolver": [8, "status-resolver"],
78
+ "statusResolver": [16],
78
79
  "_dataUnit": [32],
79
80
  "_dataState": [32]
80
81
  }]);
@@ -82,7 +83,7 @@ function defineCustomElement$1() {
82
83
  if (typeof customElements === "undefined") {
83
84
  return;
84
85
  }
85
- const components = ["snk-crud", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-form", "snk-grid", "snk-taskbar"];
86
+ const components = ["snk-crud", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal", "snk-form", "snk-grid", "snk-taskbar"];
86
87
  components.forEach(tagName => { switch (tagName) {
87
88
  case "snk-crud":
88
89
  if (!customElements.get(tagName)) {
@@ -91,20 +92,25 @@ function defineCustomElement$1() {
91
92
  break;
92
93
  case "snk-filter-bar":
93
94
  if (!customElements.get(tagName)) {
94
- defineCustomElement$8();
95
+ defineCustomElement$9();
95
96
  }
96
97
  break;
97
98
  case "snk-filter-detail":
98
99
  if (!customElements.get(tagName)) {
99
- defineCustomElement$7();
100
+ defineCustomElement$8();
100
101
  }
101
102
  break;
102
103
  case "snk-filter-item":
103
104
  if (!customElements.get(tagName)) {
104
- defineCustomElement$6();
105
+ defineCustomElement$7();
105
106
  }
106
107
  break;
107
108
  case "snk-filter-list":
109
+ if (!customElements.get(tagName)) {
110
+ defineCustomElement$6();
111
+ }
112
+ break;
113
+ case "snk-filter-modal":
108
114
  if (!customElements.get(tagName)) {
109
115
  defineCustomElement$5();
110
116
  }
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { a as Action, A as ApplicationContext } from './index2.js';
3
- import { A as ApplicationUtils, D as DialogType, O as OperationMap } from './SnkMessageBuilder.js';
3
+ import { A as ApplicationUtils, D as DialogType } from './index3.js';
4
+ import { O as OperationMap } from './SnkMessageBuilder.js';
4
5
 
5
6
  const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
6
7
 
@@ -17,10 +18,6 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
17
18
  * Determina quantas linhas são retornadas por página
18
19
  */
19
20
  this.pageSize = 150;
20
- /**
21
- * Quando ativada essa propriedade faz com que haja uma carga imediata no DataUnit
22
- */
23
- this.autoLoad = true;
24
21
  this._dataUnitObserver = (action) => {
25
22
  const duState = {
26
23
  insertionMode: false,
@@ -242,11 +239,6 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
242
239
  while (resolver = this._onDataUnitResolve.pop()) {
243
240
  resolver(this.dataUnit);
244
241
  }
245
- if (this.autoLoad) {
246
- setTimeout(() => {
247
- this.dataUnit.loadData();
248
- }, 500); //TODO: Ajustar para aguardar filterProvider do dataunit estar pronto.
249
- }
250
242
  }
251
243
  }
252
244
  }
@@ -280,7 +272,6 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
280
272
  "dataUnit": [1040],
281
273
  "beforeSave": [16],
282
274
  "afterSave": [16],
283
- "autoLoad": [4, "auto-load"],
284
275
  "getDataUnit": [64]
285
276
  }]);
286
277
  function defineCustomElement$1() {