@sankhyalabs/sankhyablocks 5.5.0 → 5.6.0

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 (122) hide show
  1. package/dist/cjs/{SnkMessageBuilder-26da04f7.js → SnkMessageBuilder-e64dce7f.js} +14 -0
  2. package/dist/cjs/index-8d94b7e0.js +7 -0
  3. package/dist/cjs/index-de79181a.js +201 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  6. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-attach.cjs.entry.js +2 -1
  8. package/dist/cjs/snk-crud.cjs.entry.js +2 -1
  9. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  10. package/dist/cjs/{snk-data-unit-c43df27b.js → snk-data-unit-85d6565e.js} +1 -1
  11. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -3
  13. package/dist/cjs/snk-expression-item.cjs.entry.js +213 -0
  14. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +435 -0
  15. package/dist/cjs/snk-grid.cjs.entry.js +3 -2
  16. package/dist/cjs/{snk-guides-viewer-e6a65393.js → snk-guides-viewer-9784c527.js} +1 -1
  17. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -2
  18. package/dist/cjs/snk-personalized-filter.cjs.entry.js +126 -0
  19. package/dist/cjs/snk-simple-bar_2.cjs.entry.js +2 -1
  20. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
  21. package/dist/cjs/taskbar-elements-bc2598f9.js +118 -0
  22. package/dist/collection/collection-manifest.json +2 -0
  23. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +62 -69
  24. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +4 -0
  25. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +87 -0
  26. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +34 -0
  27. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +97 -0
  28. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +298 -0
  29. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +2 -2
  30. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +63 -0
  31. package/dist/collection/lib/message/SnkMessageBuilder.js +2 -0
  32. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +12 -0
  33. package/dist/collection/lib/store/index.js +2 -1
  34. package/dist/components/SnkMessageBuilder.js +14 -0
  35. package/dist/components/index.d.ts +2 -0
  36. package/dist/components/index.js +2 -0
  37. package/dist/components/index2.js +1 -1
  38. package/dist/components/index3.js +199 -0
  39. package/dist/components/snk-data-exporter2.js +1 -1
  40. package/dist/components/snk-expression-item.d.ts +11 -0
  41. package/dist/components/snk-expression-item.js +6 -0
  42. package/dist/components/snk-expression-item2.js +241 -0
  43. package/dist/components/snk-filter-field-search.js +1 -200
  44. package/dist/{esm/snk-filter-field-search.entry.js → components/snk-filter-field-search2.js} +65 -38
  45. package/dist/components/snk-filter-param-config.js +1 -273
  46. package/dist/{esm/snk-filter-param-config.entry.js → components/snk-filter-param-config2.js} +35 -11
  47. package/dist/components/snk-grid2.js +2 -1
  48. package/dist/components/snk-personalized-filter.d.ts +11 -0
  49. package/dist/components/snk-personalized-filter.js +158 -0
  50. package/dist/components/snk-taskbar2.js +3 -197
  51. package/dist/esm/{SnkMessageBuilder-7a9392e6.js → SnkMessageBuilder-f3590f65.js} +14 -0
  52. package/dist/esm/{index-6519a79e.js → index-507e19ec.js} +1 -1
  53. package/dist/esm/index-620ac460.js +7 -0
  54. package/dist/esm/index-8efbf198.js +199 -0
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/esm/sankhyablocks.js +1 -1
  57. package/dist/esm/snk-application.entry.js +1 -1
  58. package/dist/esm/snk-attach.entry.js +3 -2
  59. package/dist/esm/snk-crud.entry.js +3 -2
  60. package/dist/esm/snk-data-exporter.entry.js +3 -3
  61. package/dist/esm/{snk-data-unit-f9e4c694.js → snk-data-unit-50b1660c.js} +1 -1
  62. package/dist/esm/snk-data-unit.entry.js +2 -2
  63. package/dist/esm/snk-detail-view.entry.js +5 -4
  64. package/dist/esm/snk-expression-item.entry.js +209 -0
  65. package/dist/esm/snk-filter-field-search_2.entry.js +430 -0
  66. package/dist/esm/snk-grid.entry.js +3 -2
  67. package/dist/esm/{snk-guides-viewer-62a9f74d.js → snk-guides-viewer-4d12f268.js} +2 -2
  68. package/dist/esm/snk-guides-viewer.entry.js +4 -3
  69. package/dist/esm/snk-personalized-filter.entry.js +122 -0
  70. package/dist/esm/snk-simple-bar_2.entry.js +3 -2
  71. package/dist/esm/snk-taskbar.entry.js +3 -2
  72. package/dist/esm/taskbar-elements-e6af3e93.js +115 -0
  73. package/dist/sankhyablocks/p-1dcfd32a.entry.js +1 -0
  74. package/dist/sankhyablocks/p-27e264d9.entry.js +1 -0
  75. package/dist/sankhyablocks/p-343699ad.entry.js +1 -0
  76. package/dist/sankhyablocks/{p-f2223502.js → p-3d3263b4.js} +1 -1
  77. package/dist/sankhyablocks/{p-b2523981.entry.js → p-3fbe2d69.entry.js} +1 -1
  78. package/dist/sankhyablocks/p-433dfa63.entry.js +1 -0
  79. package/dist/sankhyablocks/{p-f132e371.js → p-4c2015a9.js} +1 -1
  80. package/dist/sankhyablocks/p-4eefe631.entry.js +1 -0
  81. package/dist/sankhyablocks/p-6a02e236.js +1 -0
  82. package/dist/sankhyablocks/p-8bdf5e57.entry.js +1 -0
  83. package/dist/sankhyablocks/{p-a412992c.entry.js → p-c4417efb.entry.js} +1 -1
  84. package/dist/sankhyablocks/{p-92a0fca4.js → p-c9477950.js} +1 -1
  85. package/dist/sankhyablocks/{p-aeffd219.js → p-ccd26e3a.js} +1 -1
  86. package/dist/sankhyablocks/p-d410f45a.js +1 -0
  87. package/dist/sankhyablocks/p-df8f13b4.entry.js +1 -0
  88. package/dist/sankhyablocks/p-e9f42525.entry.js +1 -0
  89. package/dist/sankhyablocks/p-f344b811.entry.js +1 -0
  90. package/dist/sankhyablocks/p-f4184ce7.js +1 -0
  91. package/dist/sankhyablocks/p-fd4ed40a.entry.js +1 -0
  92. package/dist/sankhyablocks/p-ff96b509.entry.js +27 -0
  93. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  94. package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +14 -4
  95. package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +13 -10
  96. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +20 -0
  97. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +9 -0
  98. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +54 -0
  99. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +4 -2
  100. package/dist/types/components.d.ts +83 -9
  101. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +7 -0
  102. package/dist/types/lib/message/resources/snk-personalized-filter.msg.d.ts +1 -0
  103. package/dist/types/lib/store/index.d.ts +1 -0
  104. package/package.json +1 -1
  105. package/react/components.d.ts +2 -0
  106. package/react/components.js +2 -0
  107. package/react/components.js.map +1 -1
  108. package/dist/cjs/snk-filter-field-search.cjs.entry.js +0 -185
  109. package/dist/cjs/snk-filter-param-config.cjs.entry.js +0 -256
  110. package/dist/cjs/taskbar-elements-80285601.js +0 -313
  111. package/dist/esm/taskbar-elements-055ba1ad.js +0 -309
  112. package/dist/sankhyablocks/p-4512cc6c.entry.js +0 -1
  113. package/dist/sankhyablocks/p-5cbbe1f7.entry.js +0 -1
  114. package/dist/sankhyablocks/p-63d01871.entry.js +0 -1
  115. package/dist/sankhyablocks/p-741b00ef.entry.js +0 -1
  116. package/dist/sankhyablocks/p-79d22df0.entry.js +0 -1
  117. package/dist/sankhyablocks/p-93d8fe00.entry.js +0 -1
  118. package/dist/sankhyablocks/p-999d1953.entry.js +0 -1
  119. package/dist/sankhyablocks/p-c3efd4eb.entry.js +0 -1
  120. package/dist/sankhyablocks/p-ebe876f5.entry.js +0 -1
  121. package/dist/sankhyablocks/p-ed438690.js +0 -1
  122. package/dist/sankhyablocks/p-f3d0c744.entry.js +0 -1
@@ -0,0 +1,34 @@
1
+ import { FilterOperand } from "../../../../../lib/@types";
2
+ import { UserInterface } from '@sankhyalabs/core';
3
+ export const FilterOperandDefault = [
4
+ { value: FilterOperand.EQUAL, label: "Igual (=)" },
5
+ { value: FilterOperand.DIFFERENT, label: "Diferente (<>)" },
6
+ { value: FilterOperand.LIKE, label: "Contendo (LIKE)" },
7
+ { value: FilterOperand.IN, label: "Contido em (IN)" },
8
+ { value: FilterOperand.START_WITH, label: "Iniciado com (%?)" },
9
+ { value: FilterOperand.FINISHED_WITH, label: "Terminado com (?%)" },
10
+ { value: FilterOperand.NULL, label: "Vazio (NULL)" },
11
+ { value: FilterOperand.NOT_NULL, label: "Não Vazio (NOT NULL)" },
12
+ { value: FilterOperand.LARGER, label: "Maior (>)" },
13
+ { value: FilterOperand.LARGER_EQUAL, label: "Maior ou Igual (>=)" },
14
+ { value: FilterOperand.SMALLER, label: "Menor (<)" },
15
+ { value: FilterOperand.SMALLER_EQUAL, label: "Menor ou Igual (<=)" }
16
+ ];
17
+ export const FilterOperandTypeTextSearch = [
18
+ { value: FilterOperand.EQUAL, label: "Igual (=)" },
19
+ { value: FilterOperand.DIFFERENT, label: "Diferente (<>)" },
20
+ { value: FilterOperand.LIKE, label: "Contendo (LIKE)" },
21
+ { value: FilterOperand.IN, label: "Contido em (IN)" },
22
+ { value: FilterOperand.START_WITH, label: "Iniciado com (%?)" },
23
+ { value: FilterOperand.FINISHED_WITH, label: "Terminado com (?%)" },
24
+ { value: FilterOperand.NULL, label: "Vazio (NULL)" },
25
+ { value: FilterOperand.NOT_NULL, label: "Não Vazio (NOT NULL)" }
26
+ ];
27
+ export const FIELD_TYPE_SEARCH_AND_TEXT = [
28
+ UserInterface.SEARCH,
29
+ UserInterface.SHORTTEXT,
30
+ UserInterface.PASSWORD,
31
+ UserInterface.MASKEDTEXT,
32
+ UserInterface.LONGTEXT,
33
+ UserInterface.HTML
34
+ ];
@@ -0,0 +1,97 @@
1
+ :host {
2
+ /*private*/
3
+ display: flex;
4
+ width: 100%;
5
+
6
+ /*@doc Define a cor de fundo do componente.*/
7
+ --snk-expression-item--background-color: var(--background--xlight, #fff);
8
+
9
+ /* Spacing */
10
+ /*@doc Define o espaçamento interno entre os itens*/
11
+ --snk-expression-item__itens--padding: var(--space--small, 6px);
12
+
13
+ /* Sizes */
14
+ /*@doc Define o tamanho do campo operator*/
15
+ --snk-expression-item__width--input-operator: 220px;
16
+ /*@doc Define o tamanho do campo value*/
17
+ --snk-expression-item__width--input-value: 240px;
18
+ /*@doc Define o tamanho do campo value-variable*/
19
+ --snk-expression-item__width--input-value-variable: 176px;
20
+
21
+ /* Bordes */
22
+ /*@doc Define o arredondamento das bordas*/
23
+ --snk-expression-item--border-radius: var(--border--radius-medium, 12px);
24
+ /*@doc Define a cor da borda.*/
25
+ --snk-expression-item--border-color: var(--color--strokes, #DCE0E8);
26
+ /*@doc Define largura e estilo da borda.*/
27
+ --snk-expression-item--border-style: var(--border--small, 1px solid);
28
+ }
29
+
30
+ .box{
31
+ /*private*/
32
+ width: 100%;
33
+ height: 100%;
34
+ background: var(--snk-expression-item--background-color);
35
+
36
+ /*public*/
37
+ margin: var(--space--small, 6px);
38
+ border: var(--snk-expression-item--border-color) var(--snk-expression-item--border-style);
39
+ border-radius: var(--snk-expression-item--border-radius);
40
+ }
41
+
42
+ .box__container{
43
+ /*private*/
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: space-between;
47
+ white-space: nowrap;
48
+
49
+ /*public*/
50
+ margin: var(--space--small, 6px);
51
+ }
52
+
53
+ .box__container--input-filter{
54
+ width: 100%;
55
+ }
56
+
57
+ .box__container--input-operator{
58
+ /*private*/
59
+ display: flex;
60
+ /*public*/
61
+ width: var(--snk-expression-item__width--input-operator);
62
+ min-width: var(--snk-expression-item__width--input-operator);
63
+ }
64
+
65
+ .box__container--input-value{
66
+ /*private*/
67
+ display: flex;
68
+ /*public*/
69
+ width: var(--snk-expression-item__width--input-value);
70
+ min-width: var(--snk-expression-item__width--input-value);
71
+ }
72
+
73
+ .box__container--input-value-variable{
74
+ /*private*/
75
+ display: flex;
76
+ /*public*/
77
+ width: var(--snk-expression-item__width--input-value-variable);
78
+ min-width: var(--snk-expression-item__width--input-value-variable);
79
+ }
80
+
81
+ .box__container--button-delete{
82
+ display: flex;
83
+ }
84
+
85
+ .box__container > div {
86
+ padding-left: var(--snk-expression-item__itens--padding);
87
+ padding-right: var(--snk-expression-item__itens--padding);
88
+ }
89
+
90
+ .box__container--button-delete--icon {
91
+ width: 42px;
92
+ min-width: 42px;
93
+ }
94
+
95
+ .box__container--input-value-variable--icon{
96
+ cursor: pointer;
97
+ }
@@ -0,0 +1,298 @@
1
+ import { Host, h } from '@stencil/core';
2
+ import { ApplicationContext, UserInterface } from '@sankhyalabs/core';
3
+ import { SelectedItemType } from "../../../snk-filter-field-search/interfaces";
4
+ import { CheckMode, ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
5
+ import { fieldBuilder } from "@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder";
6
+ import { FilterOperand } from '../../../../lib/@types';
7
+ import { FilterOperandDefault, FilterOperandTypeTextSearch, FIELD_TYPE_SEARCH_AND_TEXT } from "./filter-operands/filter-operands";
8
+ import store from '../../../../lib/store';
9
+ export class SnkExpressionItem {
10
+ constructor() {
11
+ this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
12
+ this.filterOperandDefault = FilterOperandDefault;
13
+ this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
14
+ this._showValueVariable = false;
15
+ this._fieldSelected = undefined;
16
+ this._optionNotNull = false;
17
+ this.expression = undefined;
18
+ this.canRemove = true;
19
+ this.messagesBuilder = undefined;
20
+ }
21
+ expressionChanged(newValue, oldValue) {
22
+ if (newValue !== oldValue) {
23
+ this.ezFilterItemChange.emit(newValue);
24
+ }
25
+ }
26
+ componentWillLoad() {
27
+ this._dataSourceFetcher = store.get("filterFieldsDataSource");
28
+ store.onChange('filterFieldsDataSource', () => {
29
+ this._dataSourceFetcher = store.get("filterFieldsDataSource");
30
+ });
31
+ }
32
+ setValueExpression(key, value) {
33
+ this.expression[key] = value;
34
+ this.expressionChanged(this.expression);
35
+ }
36
+ getMessage(key, params) {
37
+ return this.application.messagesBuilder.getMessage(key, params);
38
+ }
39
+ handleSelectItem(filterField) {
40
+ if (filterField.type === SelectedItemType.FIELD) {
41
+ const field = filterField;
42
+ this._fieldSelected = field;
43
+ this.setValueExpression("fieldName", field.name);
44
+ }
45
+ }
46
+ handleFocus() {
47
+ if (this._elFilterFieldSearch)
48
+ this._elFilterFieldSearch.show();
49
+ }
50
+ handleChangeFilterInput(evt) {
51
+ this._elFilterFieldSearch.applyFilter(evt.detail);
52
+ }
53
+ handleChangeValueVariable(showValueVariable) {
54
+ this._showValueVariable = showValueVariable;
55
+ if (this._elFieldDynamic) {
56
+ this._elFieldDynamic.value = undefined;
57
+ this._elFieldDynamic.enabled = !showValueVariable;
58
+ }
59
+ }
60
+ openSnkFilterParamConfig() {
61
+ var _a;
62
+ (_a = this._elFilterParamConfigRef) === null || _a === void 0 ? void 0 : _a.open(this.expression).then(this.onOpenPromiseReady.bind(this)).catch(error => {
63
+ console.error(error);
64
+ });
65
+ }
66
+ onOpenPromiseReady(changes) {
67
+ this.expression = changes;
68
+ }
69
+ buildOptionsOperator() {
70
+ var _a;
71
+ if (FIELD_TYPE_SEARCH_AND_TEXT.includes((_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.userInterface)) {
72
+ return this.filterOperandTypeTextSearch;
73
+ }
74
+ else {
75
+ return this.filterOperandDefault;
76
+ }
77
+ }
78
+ handleChangeOperator(optionSelected) {
79
+ this.checkOptionIsNull(optionSelected);
80
+ this.setValueExpression("operand", optionSelected);
81
+ }
82
+ checkOptionIsNull(optionSelected) {
83
+ if (optionSelected === FilterOperand.NULL || optionSelected === FilterOperand.NOT_NULL) {
84
+ this._optionNotNull = true;
85
+ if (this._elFieldDynamic) {
86
+ this._elFieldDynamic.enabled = false;
87
+ this._elFieldDynamic.value = undefined;
88
+ }
89
+ }
90
+ else {
91
+ this._optionNotNull = false;
92
+ if (this._elFieldDynamic) {
93
+ this._elFieldDynamic.enabled = this._showValueVariable ? false : true;
94
+ }
95
+ }
96
+ }
97
+ confirmRemove(evt) {
98
+ evt.preventDefault();
99
+ evt.stopPropagation();
100
+ ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirm.title"), this.getMessage("snkPersonalizedFilter.confirm.description"))
101
+ .then((canRemove) => {
102
+ if (canRemove) {
103
+ this.ezFilterItemRemove.emit(this.expression);
104
+ }
105
+ });
106
+ }
107
+ buildFieldByType() {
108
+ var _a, _b;
109
+ if (!this._fieldSelected)
110
+ return;
111
+ const inputFieldData = (_a = fieldBuilder(this.configureFieldByType())) === null || _a === void 0 ? void 0 : _a.$children$.shift();
112
+ if (this._optionNotNull && inputFieldData || ((_b = this._elValueVariable) === null || _b === void 0 ? void 0 : _b.value) && inputFieldData) {
113
+ inputFieldData.$attrs$.enabled = false;
114
+ }
115
+ return h(inputFieldData.$tag$, Object.assign(Object.assign({}, inputFieldData.$attrs$), { ref: (el) => {
116
+ this._elFieldDynamic = el;
117
+ } }));
118
+ }
119
+ configureFieldByType() {
120
+ const field = {
121
+ userInterface: this._fieldSelected.userInterface,
122
+ name: this._fieldSelected.name,
123
+ label: this._fieldSelected.label,
124
+ canShowError: false
125
+ };
126
+ switch (field.userInterface) {
127
+ case UserInterface.OPTIONSELECTOR:
128
+ field.props = {
129
+ options: this._fieldSelected.properties.map(option => ({
130
+ value: option.value,
131
+ label: option.name,
132
+ })),
133
+ };
134
+ break;
135
+ case UserInterface.LONGTEXT:
136
+ field.rows = 1;
137
+ break;
138
+ case UserInterface.SEARCH:
139
+ field.optionLoader = searchArgument => this.setCriteriaSearch(searchArgument, this.application);
140
+ break;
141
+ default:
142
+ break;
143
+ }
144
+ return field;
145
+ }
146
+ setCriteriaSearch({ mode, argument }, application) {
147
+ if (application == undefined)
148
+ return;
149
+ const searchOptions = {
150
+ showInactives: false
151
+ };
152
+ const options = {
153
+ entity: this._fieldSelected.properties.ENTITYNAME,
154
+ searchOptions: searchOptions,
155
+ entityDescription: this._fieldSelected.label
156
+ };
157
+ return application.executePreparedSearch(mode, argument, options);
158
+ }
159
+ render() {
160
+ var _a;
161
+ return (h(Host, null, h("div", { class: "box" }, h("div", { class: "box__container" }, h("div", { class: "box__container--input-filter" }, h("ez-filter-input", { value: (_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.path, label: this.getMessage("snkPersonalizedFilter.info.labelSearchField"), canShowError: false, onEzChange: (evt) => this.handleChangeFilterInput(evt), onFocus: () => this.handleFocus() }), h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), h("div", { class: "box__container--input-operator" }, h("ez-combo-box", { label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => this.handleChangeOperator(evt.detail.value), suppressEmptyOption: true })), h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
162
+ h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
163
+ this.buildFieldByType()), h("div", { class: "box__container--input-value-variable", title: this.getMessage("snkPersonalizedFilter.info.titleTooltip") }, !this._optionNotNull &&
164
+ h("ez-check", { ref: ref => this._elValueVariable = ref, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
165
+ h("ez-icon", { class: "box__container--input-value-variable--icon", size: "large", iconName: "settings-inverted", onClick: () => this.openSnkFilterParamConfig() }), h("snk-filter-param-config", { ref: (el) => this._elFilterParamConfigRef = el, messagesBuilder: this.messagesBuilder })), h("div", { class: "box__container--button-delete" }, h("div", { class: "box__container--button-delete--icon" }, this.canRemove && h("ez-button", { mode: "icon", iconName: "delete", onClick: (evt) => this.confirmRemove(evt) })))))));
166
+ }
167
+ static get is() { return "snk-expression-item"; }
168
+ static get encapsulation() { return "scoped"; }
169
+ static get originalStyleUrls() {
170
+ return {
171
+ "$": ["snk-expression-item.css"]
172
+ };
173
+ }
174
+ static get styleUrls() {
175
+ return {
176
+ "$": ["snk-expression-item.css"]
177
+ };
178
+ }
179
+ static get properties() {
180
+ return {
181
+ "expression": {
182
+ "type": "unknown",
183
+ "mutable": false,
184
+ "complexType": {
185
+ "original": "IExpressionItem",
186
+ "resolved": "IExpressionItem",
187
+ "references": {
188
+ "IExpressionItem": {
189
+ "location": "import",
190
+ "path": "../../../snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem"
191
+ }
192
+ }
193
+ },
194
+ "required": false,
195
+ "optional": false,
196
+ "docs": {
197
+ "tags": [],
198
+ "text": "Express\u00E3o que ser\u00E1 representada visualmente."
199
+ },
200
+ "defaultValue": "undefined"
201
+ },
202
+ "canRemove": {
203
+ "type": "boolean",
204
+ "mutable": false,
205
+ "complexType": {
206
+ "original": "boolean",
207
+ "resolved": "boolean",
208
+ "references": {}
209
+ },
210
+ "required": false,
211
+ "optional": false,
212
+ "docs": {
213
+ "tags": [],
214
+ "text": "Controla a exibi\u00E7\u00E3o do bot\u00E3o Remover."
215
+ },
216
+ "attribute": "can-remove",
217
+ "reflect": true,
218
+ "defaultValue": "true"
219
+ },
220
+ "messagesBuilder": {
221
+ "type": "unknown",
222
+ "mutable": true,
223
+ "complexType": {
224
+ "original": "SnkMessageBuilder",
225
+ "resolved": "SnkMessageBuilder",
226
+ "references": {
227
+ "SnkMessageBuilder": {
228
+ "location": "import",
229
+ "path": "../../../../lib/message/SnkMessageBuilder"
230
+ }
231
+ }
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
238
+ }
239
+ }
240
+ };
241
+ }
242
+ static get states() {
243
+ return {
244
+ "_showValueVariable": {},
245
+ "_fieldSelected": {},
246
+ "_optionNotNull": {}
247
+ };
248
+ }
249
+ static get events() {
250
+ return [{
251
+ "method": "ezFilterItemChange",
252
+ "name": "ezFilterItemChange",
253
+ "bubbles": true,
254
+ "cancelable": true,
255
+ "composed": true,
256
+ "docs": {
257
+ "tags": [],
258
+ "text": "Emitido quando acontece altera\u00E7\u00F5es na express\u00E3o."
259
+ },
260
+ "complexType": {
261
+ "original": "IExpressionItem",
262
+ "resolved": "IExpressionItem",
263
+ "references": {
264
+ "IExpressionItem": {
265
+ "location": "import",
266
+ "path": "../../../snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem"
267
+ }
268
+ }
269
+ }
270
+ }, {
271
+ "method": "ezFilterItemRemove",
272
+ "name": "ezFilterItemRemove",
273
+ "bubbles": true,
274
+ "cancelable": true,
275
+ "composed": true,
276
+ "docs": {
277
+ "tags": [],
278
+ "text": "Emitido ao confirmar uma remo\u00E7\u00E3o."
279
+ },
280
+ "complexType": {
281
+ "original": "IExpressionItem",
282
+ "resolved": "IExpressionItem",
283
+ "references": {
284
+ "IExpressionItem": {
285
+ "location": "import",
286
+ "path": "../../../snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem"
287
+ }
288
+ }
289
+ }
290
+ }];
291
+ }
292
+ static get watchers() {
293
+ return [{
294
+ "propName": "expression",
295
+ "methodName": "expressionChanged"
296
+ }];
297
+ }
298
+ }
@@ -33,7 +33,8 @@ export class SnkFilterParamConfig {
33
33
  * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-param-config.msg.ts"
34
34
  */
35
35
  getMessage(key, params) {
36
- return this.messagesBuilder.getMessage(key, params);
36
+ var _a;
37
+ return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
37
38
  }
38
39
  getConfigValue(configName, inputName, inputAlias = "") {
39
40
  var _a, _b, _c;
@@ -188,7 +189,6 @@ export class SnkFilterParamConfig {
188
189
  })))), h("ez-text-area", Object.assign({ ref: (ref) => this._expressionElement = ref, class: "snk-filter-param-config__expression", label: this.getMessage("snkFilterParamConfig.labelExpression"), enabled: false }, this.getElementID("presentationExpression"))), h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, h("ez-button", Object.assign({ class: "ez-padding-right--medium", label: this.getMessage("snkFilterParamConfig.labelCancel"), onClick: () => this.close() }, this.getElementID("cancelEditParam"))), h("ez-button", Object.assign({ class: "ez-button--primary", label: this.getMessage("snkFilterParamConfig.labelSave"), onClick: () => this.save(), enabled: this._canSave }, this.getElementID("saveEditParam")))))));
189
190
  }
190
191
  static get is() { return "snk-filter-param-config"; }
191
- static get encapsulation() { return "scoped"; }
192
192
  static get originalStyleUrls() {
193
193
  return {
194
194
  "$": ["snk-filter-param-config.css"]
@@ -0,0 +1,63 @@
1
+ import { gql } from "graphql-request";
2
+ import { DataFetcher } from "../DataFetcher";
3
+ export default class PersonalizedFilterFetcher {
4
+ constructor() {
5
+ this.templateByQuery = new Map();
6
+ this.buildTemplates();
7
+ }
8
+ buildTemplates() {
9
+ const query = gql `
10
+ query($name: String!) {
11
+ $queryAlias$: fetchFilterFields(name: $name){
12
+ currentLink {
13
+ description
14
+ uri
15
+ }
16
+ links {
17
+ description
18
+ uri
19
+ fieldCount
20
+ }
21
+ fields {
22
+ name
23
+ description
24
+ uri
25
+ onlyDate
26
+ dataType
27
+ userInterface
28
+ properties {
29
+ name
30
+ value
31
+ }
32
+ }
33
+ }
34
+ }
35
+ `;
36
+ this.templateByQuery.set("fetchFilterFields", query);
37
+ }
38
+ loadFields(uri) {
39
+ return new Promise((resolve, reject) => {
40
+ DataFetcher.get()
41
+ .callGraphQL({
42
+ values: { name: uri },
43
+ query: this.templateByQuery.get("fetchFilterFields"),
44
+ })
45
+ .then((resp) => {
46
+ let fields = resp.fields;
47
+ for (const field of fields) {
48
+ if (Array.isArray(field.properties) && field.properties.length > 0 && field.userInterface === "SEARCH") {
49
+ const propertiesConvertedObject = field.properties.reduce((accumulator, prop) => {
50
+ accumulator[prop.name] = prop.value;
51
+ return accumulator;
52
+ }, {});
53
+ field.properties = propertiesConvertedObject;
54
+ }
55
+ }
56
+ resolve(Object.assign(Object.assign({}, resp), { fields: fields }));
57
+ })
58
+ .catch((error) => {
59
+ reject(error);
60
+ });
61
+ });
62
+ }
63
+ }
@@ -13,6 +13,7 @@ import { snkFilterParamConfigMessages } from "./resources/snk-filter-param-confi
13
13
  import { snkFilterFieldSearchMessages } from "./resources/snk-filter-field-search.msg.js";
14
14
  import { snkSimpleBarMessages } from './resources/snk-simple-bar.msg.js';
15
15
  import { snkAttachMessages } from "./resources/snk-attach.msg";
16
+ import { snkPersonalizedFilterMessages } from "./resources/snk-personalized-filter.msg.js";
16
17
  export class SnkMessageBuilder {
17
18
  constructor(domainName) {
18
19
  this._defaults = {
@@ -35,6 +36,7 @@ export class SnkMessageBuilder {
35
36
  snkFilterFieldSearch: snkFilterFieldSearchMessages,
36
37
  snkSimpleBar: snkSimpleBarMessages,
37
38
  snkAttach: snkAttachMessages,
39
+ snkPersonalizedFilter: snkPersonalizedFilterMessages
38
40
  };
39
41
  this._currentOperation = OperationMap.CLEAN;
40
42
  this._domainName = domainName;
@@ -0,0 +1,12 @@
1
+ export const snkPersonalizedFilterMessages = {
2
+ info: {
3
+ labelSearchField: "Buscar campo",
4
+ labelOperator: "Operador",
5
+ labelValueVarible: "Valor variável",
6
+ titleTooltip: "Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado"
7
+ },
8
+ confirm: {
9
+ title: "Aviso",
10
+ description: `As informações da condição serão descartadas.</br></br><b>Gostaria de continuar?</b>`
11
+ }
12
+ };
@@ -1,5 +1,6 @@
1
1
  import { createStore } from "@stencil/store";
2
2
  const store = createStore({
3
- exporterProviders: {}
3
+ exporterProviders: {},
4
+ filterFieldsDataSource: undefined
4
5
  });
5
6
  export default store;
@@ -310,6 +310,19 @@ const snkAttachMessages = {
310
310
  }
311
311
  };
312
312
 
313
+ const snkPersonalizedFilterMessages = {
314
+ info: {
315
+ labelSearchField: "Buscar campo",
316
+ labelOperator: "Operador",
317
+ labelValueVarible: "Valor variável",
318
+ titleTooltip: "Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado"
319
+ },
320
+ confirm: {
321
+ title: "Aviso",
322
+ description: `As informações da condição serão descartadas.</br></br><b>Gostaria de continuar?</b>`
323
+ }
324
+ };
325
+
313
326
  class SnkMessageBuilder {
314
327
  constructor(domainName) {
315
328
  this._defaults = {
@@ -332,6 +345,7 @@ class SnkMessageBuilder {
332
345
  snkFilterFieldSearch: snkFilterFieldSearchMessages,
333
346
  snkSimpleBar: snkSimpleBarMessages,
334
347
  snkAttach: snkAttachMessages,
348
+ snkPersonalizedFilter: snkPersonalizedFilterMessages
335
349
  };
336
350
  this._currentOperation = OperationMap.CLEAN;
337
351
  this._domainName = domainName;
@@ -8,6 +8,7 @@ export { SnkDataExporter as SnkDataExporter } from '../types/components/snk-data
8
8
  export { SnkDataUnit as SnkDataUnit } from '../types/components/snk-data-unit/snk-data-unit';
9
9
  export { SnkDetailView as SnkDetailView } from '../types/components/snk-crud/subcomponents/snk-detail-view';
10
10
  export { SnkExporterEmailSender as SnkExporterEmailSender } from '../types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender';
11
+ export { SnkExpressionItem as SnkExpressionItem } from '../types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item';
11
12
  export { SnkFieldConfig as SnkFieldConfig } from '../types/components/snk-form/subcomponents/snk-field-config/snk-field-config';
12
13
  export { SnkFilterBar as SnkFilterBar } from '../types/components/snk-filter-bar/snk-filter-bar';
13
14
  export { SnkFilterBinarySelect as SnkFilterBinarySelect } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select';
@@ -30,6 +31,7 @@ export { SnkFormView as SnkFormView } from '../types/components/snk-crud/subcomp
30
31
  export { SnkGrid as SnkGrid } from '../types/components/snk-grid/snk-grid';
31
32
  export { SnkGridConfig as SnkGridConfig } from '../types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config';
32
33
  export { SnkGuidesViewer as SnkGuidesViewer } from '../types/components/snk-crud/subcomponents/snk-guides-viewer';
34
+ export { SnkPersonalizedFilter as SnkPersonalizedFilter } from '../types/components/snk-personalized-filter/snk-personalized-filter';
33
35
  export { SnkPesquisa as SnkPesquisa } from '../types/components/snk-pesquisa/snk-pesquisa';
34
36
  export { SelectBox as SnkSelectBox } from '../types/components/snk-grid/subcomponents/snk-select-box/snk-select-box';
35
37
  export { SnkSimpleBar as SnkSimpleBar } from '../types/components/snk-simple-bar/snk-simple-bar';
@@ -8,6 +8,7 @@ export { SnkDataExporter, defineCustomElement as defineCustomElementSnkDataExpor
8
8
  export { SnkDataUnit, defineCustomElement as defineCustomElementSnkDataUnit } from './snk-data-unit.js';
9
9
  export { SnkDetailView, defineCustomElement as defineCustomElementSnkDetailView } from './snk-detail-view.js';
10
10
  export { SnkExporterEmailSender, defineCustomElement as defineCustomElementSnkExporterEmailSender } from './snk-exporter-email-sender.js';
11
+ export { SnkExpressionItem, defineCustomElement as defineCustomElementSnkExpressionItem } from './snk-expression-item.js';
11
12
  export { SnkFieldConfig, defineCustomElement as defineCustomElementSnkFieldConfig } from './snk-field-config.js';
12
13
  export { SnkFilterBar, defineCustomElement as defineCustomElementSnkFilterBar } from './snk-filter-bar.js';
13
14
  export { SnkFilterBinarySelect, defineCustomElement as defineCustomElementSnkFilterBinarySelect } from './snk-filter-binary-select.js';
@@ -30,6 +31,7 @@ export { SnkFormView, defineCustomElement as defineCustomElementSnkFormView } fr
30
31
  export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './snk-grid.js';
31
32
  export { SnkGridConfig, defineCustomElement as defineCustomElementSnkGridConfig } from './snk-grid-config.js';
32
33
  export { SnkGuidesViewer, defineCustomElement as defineCustomElementSnkGuidesViewer } from './snk-guides-viewer.js';
34
+ export { SnkPersonalizedFilter, defineCustomElement as defineCustomElementSnkPersonalizedFilter } from './snk-personalized-filter.js';
33
35
  export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
34
36
  export { SnkSelectBox, defineCustomElement as defineCustomElementSnkSelectBox } from './snk-select-box.js';
35
37
  export { SnkSimpleBar, defineCustomElement as defineCustomElementSnkSimpleBar } from './snk-simple-bar.js';
@@ -64,4 +64,4 @@ var FilterEntities;
64
64
  FilterEntities["INSTANCE"] = "Instancia";
65
65
  })(FilterEntities || (FilterEntities = {}));
66
66
 
67
- export { DataExporterOption as D, FilterOperand as F, PresentationMode as P, FilterConfigType as a, FilterEntities as b, FilterUserConfigTypes as c, DataExporterFormat as d, DataExporterType as e };
67
+ export { DataExporterOption as D, FilterUserConfigTypes as F, PresentationMode as P, FilterOperand as a, DataExporterFormat as b, DataExporterType as c, FilterConfigType as d, FilterEntities as e };