@sankhyalabs/sankhyablocks 6.10.0 → 7.0.1
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.
- package/dist/cjs/{ConfigStorage-da2bf3bf.js → ConfigStorage-97468a0f.js} +28 -22
- package/dist/cjs/{PersonalizedFilterUtils-cfcd9af2.js → PersonalizedFilterUtils-9848e09b.js} +18 -64
- package/dist/cjs/{SnkFormConfigManager-d7cc9118.js → SnkFormConfigManager-bef6e022.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-a5a9b437.js → SnkMessageBuilder-f40df6d4.js} +18 -2
- package/dist/cjs/{filter-bar-config-fetcher-58cfc12e.js → filter-bar-config-fetcher-a7747f69.js} +22 -5
- package/dist/cjs/index-8d94b7e0.js +7 -0
- package/dist/cjs/index-c5771aba.js +44 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-9d03800c.js → snk-data-unit-b14563fc.js} +4 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -5
- package/dist/cjs/snk-expression-group_2.cjs.entry.js +542 -0
- package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +66 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +14 -14
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
- package/dist/cjs/{snk-expression-item_3.cjs.entry.js → snk-filter-field-search_2.cjs.entry.js} +23 -315
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid.cjs.entry.js +8 -2
- package/dist/cjs/{snk-guides-viewer-36766466.js → snk-guides-viewer-897368ea.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +122 -31
- package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +6 -0
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +5 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +114 -23
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +4 -6
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +2 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css +10 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js +95 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css +66 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js +158 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +8 -2
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +14 -23
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +14 -4
- package/dist/collection/lib/configs/ConfigStorage.js +5 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +22 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +22 -18
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +18 -2
- package/dist/components/ConfigStorage.js +27 -21
- package/dist/components/PersonalizedFilterUtils.js +14 -23
- package/dist/components/SnkMessageBuilder.js +18 -2
- package/dist/components/filter-bar-config-fetcher.js +22 -5
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/snk-crud.js +34 -22
- package/dist/components/snk-data-unit2.js +3 -1
- package/dist/components/snk-detail-view2.js +49 -27
- package/dist/components/snk-expression-group2.js +4 -6
- package/dist/components/snk-expression-item2.js +2 -1
- package/dist/components/snk-filter-advanced-mode.d.ts +11 -0
- package/dist/components/snk-filter-advanced-mode.js +6 -0
- package/dist/components/snk-filter-advanced-mode2.js +46 -0
- package/dist/components/snk-filter-assistent-mode.d.ts +11 -0
- package/dist/components/snk-filter-assistent-mode.js +6 -0
- package/dist/components/snk-filter-assistent-mode2.js +77 -0
- package/dist/components/snk-filter-bar2.js +17 -5
- package/dist/components/snk-filter-param-config2.js +6 -0
- package/dist/components/snk-grid2.js +28 -10
- package/dist/components/snk-personalized-filter2.js +131 -28
- package/dist/components/snk-simple-crud2.js +12 -2
- package/dist/esm/{ConfigStorage-f1e805a0.js → ConfigStorage-02f17a26.js} +28 -22
- package/dist/esm/{PersonalizedFilterUtils-1a167d89.js → PersonalizedFilterUtils-731cae01.js} +16 -62
- package/dist/esm/{SnkFormConfigManager-324f6dc7.js → SnkFormConfigManager-cd9e6cab.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-76f62087.js → SnkMessageBuilder-5be56185.js} +18 -2
- package/dist/esm/{filter-bar-config-fetcher-a358b8e0.js → filter-bar-config-fetcher-790283d8.js} +22 -5
- package/dist/esm/index-620ac460.js +7 -0
- package/dist/esm/index-ae591a44.js +44 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +3 -3
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-0ff2d644.js → snk-data-unit-d44b6bc0.js} +4 -2
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -5
- package/dist/esm/snk-expression-group_2.entry.js +537 -0
- package/dist/esm/snk-filter-advanced-mode_2.entry.js +61 -0
- package/dist/esm/snk-filter-bar.entry.js +5 -5
- package/dist/esm/snk-filter-detail.entry.js +3 -3
- package/dist/esm/{snk-expression-item_3.entry.js → snk-filter-field-search_2.entry.js} +12 -303
- package/dist/esm/snk-filter-modal-item.entry.js +2 -2
- package/dist/esm/snk-filter-modal.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +3 -3
- package/dist/esm/snk-grid-config.entry.js +2 -2
- package/dist/esm/snk-grid.entry.js +8 -2
- package/dist/esm/{snk-guides-viewer-e7209909.js → snk-guides-viewer-579c70cc.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +4 -4
- package/dist/esm/snk-personalized-filter.entry.js +119 -28
- package/dist/esm/snk-simple-crud.entry.js +12 -2
- package/dist/sankhyablocks/{p-522172e1.entry.js → p-1005cf8e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8f6575c8.entry.js → p-19fdcf88.entry.js} +1 -1
- package/dist/sankhyablocks/{p-18b74675.entry.js → p-1fe2976e.entry.js} +1 -1
- package/dist/sankhyablocks/p-2227bb94.js +1 -0
- package/dist/sankhyablocks/p-386102a7.entry.js +1 -0
- package/dist/sankhyablocks/{p-7a075ae6.js → p-3b059f4e.js} +1 -1
- package/dist/sankhyablocks/p-48156672.entry.js +1 -0
- package/dist/sankhyablocks/p-4af6cbef.entry.js +1 -0
- package/dist/sankhyablocks/p-4bbc7aac.entry.js +1 -0
- package/dist/sankhyablocks/{p-3251999f.entry.js → p-4f687570.entry.js} +1 -1
- package/dist/sankhyablocks/p-5098f618.js +1 -0
- package/dist/sankhyablocks/{p-652b9081.js → p-7e486ac9.js} +1 -1
- package/dist/sankhyablocks/p-7e636457.entry.js +1 -0
- package/dist/sankhyablocks/p-7f1c4687.js +56 -0
- package/dist/sankhyablocks/{p-ed9e1e52.entry.js → p-88f4ef73.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4f3df9b6.js → p-90a926c7.js} +1 -1
- package/dist/sankhyablocks/{p-eef26a01.entry.js → p-90e7c3a2.entry.js} +1 -1
- package/dist/sankhyablocks/p-933c0c0b.js +1 -0
- package/dist/sankhyablocks/p-97720467.entry.js +1 -0
- package/dist/sankhyablocks/{p-bd840081.entry.js → p-9fa9331b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-40a5d35e.entry.js → p-ad6673fb.entry.js} +1 -1
- package/dist/sankhyablocks/p-bd86c9d3.entry.js +1 -0
- package/dist/sankhyablocks/{p-8d583a79.entry.js → p-c39b27a3.entry.js} +1 -1
- package/dist/sankhyablocks/p-f4184ce7.js +1 -0
- package/dist/sankhyablocks/{p-56378a3b.js → p-fb1e5b6d.js} +1 -1
- package/dist/sankhyablocks/p-fcc487ea.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
- package/dist/types/components/snk-personalized-filter/interfaces/IPersonalizedFilter.d.ts +4 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +17 -6
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +2 -2
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.d.ts +20 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.d.ts +31 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.d.ts +6 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +2 -2
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +2 -1
- package/dist/types/components.d.ts +103 -2
- package/dist/types/lib/configs/ConfigStorage.d.ts +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/package.json +1 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/IExpressionItem-0e32ebb7.js +0 -7
- package/dist/cjs/snk-expression-group.cjs.entry.js +0 -250
- package/dist/esm/IExpressionItem-21f225bf.js +0 -7
- package/dist/esm/snk-expression-group.entry.js +0 -246
- package/dist/sankhyablocks/p-432a73a8.js +0 -1
- package/dist/sankhyablocks/p-63bff2a8.js +0 -1
- package/dist/sankhyablocks/p-6490021d.entry.js +0 -1
- package/dist/sankhyablocks/p-7d68a43a.js +0 -1
- package/dist/sankhyablocks/p-7fd8a0ab.entry.js +0 -1
- package/dist/sankhyablocks/p-9f34a127.entry.js +0 -1
- package/dist/sankhyablocks/p-a357d13c.entry.js +0 -1
- package/dist/sankhyablocks/p-d4adf773.js +0 -68
- package/dist/sankhyablocks/p-d9586ead.entry.js +0 -1
- package/dist/sankhyablocks/p-eb30a52a.entry.js +0 -1
- package/dist/sankhyablocks/p-f8ce17d3.entry.js +0 -1
@@ -25,8 +25,8 @@ export class SnkExpressionGroup {
|
|
25
25
|
this.updateDashes();
|
26
26
|
}
|
27
27
|
/*
|
28
|
-
|
29
|
-
|
28
|
+
* Retorna o grupo da expressão.
|
29
|
+
*/
|
30
30
|
async getExpressionGroup() {
|
31
31
|
return this._group;
|
32
32
|
}
|
@@ -40,9 +40,7 @@ export class SnkExpressionGroup {
|
|
40
40
|
if (!this.getDataGroupLevel()) {
|
41
41
|
this._element.setAttribute('data-group-level', this.FIRST_LEVEL);
|
42
42
|
}
|
43
|
-
|
44
|
-
this.canAddExpression = false;
|
45
|
-
}
|
43
|
+
this.canAddExpression = this.group.items.every(this.isFilledItem);
|
46
44
|
}
|
47
45
|
componentDidRender() {
|
48
46
|
this.setSelfTop();
|
@@ -227,7 +225,7 @@ export class SnkExpressionGroup {
|
|
227
225
|
}
|
228
226
|
render() {
|
229
227
|
const canAddGroup = this.canAddGroup();
|
230
|
-
return (h(Host, null, h("div", { class: !this.isFirstLevel() && this._showDashes ? 'dashes' : 'hidden', style: this.buildGroupStyle() }), h("div", { class: !this.isFirstLevel() && this._showDashes ? 'horizontal-dashes' : 'hidden' }), h("div", { class: 'ez-flex ez-flex--align-items-center' }, h("div", { class: 'snk-expression-group__container-condition ez-flex ez-flex-item--align-center ez-flex--align-items-center', "data-condition": this._conditionOperator, title: this.getTooltipMessageForOperator() }, h("label", { class: "ez-label ez-padding-right--medium ez-padding-left--medium ez-title--primary" }, this.getMessage("snkPersonalizedFilter.info.condition")), h("div", null, h("ez-combo-box", Object.assign({ class: "snk-expression-group__container-option", canShowError: false, mode: "slim", suppressEmptyOption: true, enabled: this.canChangeGroupCondition(), value: this._conditionOperator, onEzChange: (evt) => this.handleConditionOperatorChange(evt.detail.value) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxConditions_level_${this.getDataGroupLevel()}` }), h("option", { value: FilterGroupCondition.AND }, "E"), h("option", { value: FilterGroupCondition.OR }, "OU")))), h("ez-button", { class: "ez-padding-right--medium ez-padding-left--medium", mode: "icon", iconName: "plus", size: "small", enabled: this.canAddExpression, title: this.getMessageAddTooltip(), onClick: () => this.handleAddExpression() }), h("ez-button", { label: this.getMessage("snkPersonalizedFilter.info.addGroup"), size: "small", enabled: canAddGroup, title: !canAddGroup ? this.getMessage('snkPersonalizedFilter.info.labelDisabledAddGroupButton', { LIMIT_GROUP_LEVEL: this.LIMIT_GROUP_LEVEL + 1 }) : '', onClick: () => this.handleAddGroup() }, h("ez-icon", { slot: "leftIcon", iconName: "plus" })), !this.isFirstLevel() && h("ez-button", { title: this.getMessage("snkPersonalizedFilter.info.labelDeleteExpression"), class: "ez-padding-left--medium", mode: "icon", iconName: "delete", size: "small", onClick: (evt) => this.confirmRemoveGroup(evt) })), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderExpressionItems())), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderGroups()))));
|
228
|
+
return (h(Host, null, h("div", { class: !this.isFirstLevel() && this._showDashes ? 'dashes' : 'hidden', style: this.buildGroupStyle() }), h("div", { class: !this.isFirstLevel() && this._showDashes ? 'horizontal-dashes' : 'hidden' }), h("div", { class: 'ez-flex ez-flex--align-items-center' }, h("div", { class: 'snk-expression-group__container-condition ez-flex ez-flex-item--align-center ez-flex--align-items-center', "data-condition": this._conditionOperator, title: this.getTooltipMessageForOperator() }, h("label", { class: "ez-label ez-padding-right--medium ez-padding-left--medium ez-title--primary" }, this.getMessage("snkPersonalizedFilter.info.condition")), h("div", null, h("ez-combo-box", Object.assign({ class: "snk-expression-group__container-option", canShowError: false, mode: "slim", suppressEmptyOption: true, enabled: this.canChangeGroupCondition(), value: this._conditionOperator, onEzChange: (evt) => this.handleConditionOperatorChange(evt.detail.value) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxConditions_level_${this.getDataGroupLevel()}` }), h("option", { value: FilterGroupCondition.AND }, "E"), h("option", { value: FilterGroupCondition.OR }, "OU")))), h("ez-button", { class: "ez-padding-right--medium ez-padding-left--medium", mode: "icon", iconName: "plus", size: "small", enabled: this.canAddExpression, title: this.getMessageAddTooltip(), onClick: () => this.handleAddExpression() }), h("ez-button", { label: this.getMessage("snkPersonalizedFilter.info.addGroup"), size: "small", enabled: canAddGroup, title: !canAddGroup ? this.getMessage('snkPersonalizedFilter.info.labelDisabledAddGroupButton', { LIMIT_GROUP_LEVEL: this.LIMIT_GROUP_LEVEL + 1 }) : '', onClick: () => this.handleAddGroup() }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: "plus" })), !this.isFirstLevel() && h("ez-button", { title: this.getMessage("snkPersonalizedFilter.info.labelDeleteExpression"), class: "ez-padding-left--medium", mode: "icon", iconName: "delete", size: "small", onClick: (evt) => this.confirmRemoveGroup(evt) })), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderExpressionItems())), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderGroups()))));
|
231
229
|
}
|
232
230
|
static get is() { return "snk-expression-group"; }
|
233
231
|
static get encapsulation() { return "scoped"; }
|
@@ -38,7 +38,8 @@ export class SnkExpressionItem {
|
|
38
38
|
}
|
39
39
|
}
|
40
40
|
componentDidRender() {
|
41
|
-
|
41
|
+
var _a;
|
42
|
+
this._showValueVariable = (_a = this._elValueVariable) === null || _a === void 0 ? void 0 : _a.value;
|
42
43
|
}
|
43
44
|
updateFieldSelected() {
|
44
45
|
const field = {
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
2
|
+
import { StringUtils } from '@sankhyalabs/core';
|
3
|
+
export class SnkFilterAdvancedMode {
|
4
|
+
constructor() {
|
5
|
+
this.filterAssistent = undefined;
|
6
|
+
this.application = undefined;
|
7
|
+
}
|
8
|
+
getMessage(key, params) {
|
9
|
+
return this.application.messagesBuilder.getMessage(key, params);
|
10
|
+
}
|
11
|
+
getWarningMessageComponent() {
|
12
|
+
var _a;
|
13
|
+
if (StringUtils.isEmpty((_a = this.filterAssistent) === null || _a === void 0 ? void 0 : _a.warningMessage))
|
14
|
+
return undefined;
|
15
|
+
return (h("div", { class: "ez-flex" }, h("ez-alert", { alertType: "warn" }, this.filterAssistent.warningMessage)));
|
16
|
+
}
|
17
|
+
render() {
|
18
|
+
var _a;
|
19
|
+
return (h(Host, null, h("span", { class: "ez-title ez-title--small ez-padding-bottom--small snk-filter-advanced-mode__title" }, this.getMessage("snkPersonalizedFilter.info.applyExpression")), h("ez-text-area", { rows: 9, label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_a = this.filterAssistent) === null || _a === void 0 ? void 0 : _a.expression, onEzChange: (evt) => this.ezExpressionChange.emit(evt.detail) }), this.getWarningMessageComponent()));
|
20
|
+
}
|
21
|
+
static get is() { return "snk-filter-advanced-mode"; }
|
22
|
+
static get encapsulation() { return "scoped"; }
|
23
|
+
static get originalStyleUrls() {
|
24
|
+
return {
|
25
|
+
"$": ["snk-filter-advanced-mode.css"]
|
26
|
+
};
|
27
|
+
}
|
28
|
+
static get styleUrls() {
|
29
|
+
return {
|
30
|
+
"$": ["snk-filter-advanced-mode.css"]
|
31
|
+
};
|
32
|
+
}
|
33
|
+
static get properties() {
|
34
|
+
return {
|
35
|
+
"filterAssistent": {
|
36
|
+
"type": "unknown",
|
37
|
+
"mutable": true,
|
38
|
+
"complexType": {
|
39
|
+
"original": "IPersonalizedFilter",
|
40
|
+
"resolved": "IPersonalizedFilter",
|
41
|
+
"references": {
|
42
|
+
"IPersonalizedFilter": {
|
43
|
+
"location": "import",
|
44
|
+
"path": "../../interfaces/IPersonalizedFilter"
|
45
|
+
}
|
46
|
+
}
|
47
|
+
},
|
48
|
+
"required": false,
|
49
|
+
"optional": false,
|
50
|
+
"docs": {
|
51
|
+
"tags": [],
|
52
|
+
"text": "Propriedade que cont\u00E9m informa\u00E7\u00F5es do filtro personalizado."
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"application": {
|
56
|
+
"type": "unknown",
|
57
|
+
"mutable": true,
|
58
|
+
"complexType": {
|
59
|
+
"original": "SnkApplication",
|
60
|
+
"resolved": "SnkApplication",
|
61
|
+
"references": {
|
62
|
+
"SnkApplication": {
|
63
|
+
"location": "import",
|
64
|
+
"path": "../../../snk-application/snk-application"
|
65
|
+
}
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"required": false,
|
69
|
+
"optional": false,
|
70
|
+
"docs": {
|
71
|
+
"tags": [],
|
72
|
+
"text": "Propriedade que mant\u00E9m informa\u00E7\u00F5es relacionadas ao SnkApplication."
|
73
|
+
}
|
74
|
+
}
|
75
|
+
};
|
76
|
+
}
|
77
|
+
static get events() {
|
78
|
+
return [{
|
79
|
+
"method": "ezExpressionChange",
|
80
|
+
"name": "ezExpressionChange",
|
81
|
+
"bubbles": true,
|
82
|
+
"cancelable": true,
|
83
|
+
"composed": true,
|
84
|
+
"docs": {
|
85
|
+
"tags": [],
|
86
|
+
"text": "Evento emitido sempre que uma edi\u00E7\u00E3o na express\u00E3o \u00E9 realizada."
|
87
|
+
},
|
88
|
+
"complexType": {
|
89
|
+
"original": "void",
|
90
|
+
"resolved": "void",
|
91
|
+
"references": {}
|
92
|
+
}
|
93
|
+
}];
|
94
|
+
}
|
95
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
:host {
|
2
|
+
display: flex;
|
3
|
+
flex-direction: column;
|
4
|
+
height: 100%;
|
5
|
+
|
6
|
+
/*@doc Define a família da fonte.*/
|
7
|
+
--text-area--font-family: var(--font-pattern, Arial);
|
8
|
+
/*@doc Define o posicionamento do label.*/
|
9
|
+
--text-area__label--floating--top: var(--space--small, 6px);
|
10
|
+
/*@doc Define o raio da borda do container*/
|
11
|
+
--snk-filter-assistent-mode__container--border-radius: var(--border--radius-medium, 12px);
|
12
|
+
/*@doc Define a cor de fundo do container.*/
|
13
|
+
--snk-filter-assistent-mode__container--background: var(--background--medium, #f0f3f7);
|
14
|
+
/*@doc Define a margem interna do container*/
|
15
|
+
--snk-filter-assistent-mode__container--margin: var(--space--small, 6px) var(--space--medium, 12px);
|
16
|
+
}
|
17
|
+
|
18
|
+
.ez-box__container--external {
|
19
|
+
/*private*/
|
20
|
+
height: 100px;
|
21
|
+
width: 100%;
|
22
|
+
overflow-y: auto;
|
23
|
+
|
24
|
+
/*public*/
|
25
|
+
background-color: var(--snk-filter-assistent-mode__container--background);
|
26
|
+
border-radius: var(--snk-filter-assistent-mode__container--border-radius);
|
27
|
+
}
|
28
|
+
|
29
|
+
.ez-box__container--internal {
|
30
|
+
/*public*/
|
31
|
+
margin: var(--snk-filter-assistent-mode__container--margin);
|
32
|
+
}
|
33
|
+
|
34
|
+
.ez-box__container--title{
|
35
|
+
/*private*/
|
36
|
+
display: block;
|
37
|
+
user-select: none;
|
38
|
+
|
39
|
+
/*public*/
|
40
|
+
font-family: var(--text-area--font-family);
|
41
|
+
font-size: var(--text--extra-small);
|
42
|
+
color: var(--title--primary);
|
43
|
+
top: var(--text-area__label--floating--top);
|
44
|
+
}
|
45
|
+
|
46
|
+
.ez-box__container--expression{
|
47
|
+
/*private*/
|
48
|
+
display: block;
|
49
|
+
|
50
|
+
/*public*/
|
51
|
+
font-family: var(--text-area--font-family);
|
52
|
+
font-size: var(--text--medium);
|
53
|
+
color: var(--title--primary);
|
54
|
+
top: var(--text-area__label--floating--top);
|
55
|
+
}
|
56
|
+
|
57
|
+
.snk-personalized-filter__expression-input--line {
|
58
|
+
/*private*/
|
59
|
+
width: 100%;
|
60
|
+
height: 2px;
|
61
|
+
|
62
|
+
/*public*/
|
63
|
+
background-color: var(--snk-personalized-filter--background-color-line);
|
64
|
+
margin-top: var(--snk-personalized-filter--margin-line);
|
65
|
+
margin-bottom: var(--snk-personalized-filter--margin-line);
|
66
|
+
}
|
@@ -0,0 +1,158 @@
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
2
|
+
import { PersonalizedFilterUtils } from '../../subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
|
3
|
+
export class SnkFilterAssistentMode {
|
4
|
+
constructor() {
|
5
|
+
this.filterAssistent = undefined;
|
6
|
+
this.messagesBuilder = undefined;
|
7
|
+
this.filterId = undefined;
|
8
|
+
this.entityUri = undefined;
|
9
|
+
this.application = undefined;
|
10
|
+
}
|
11
|
+
getMessage(key, params) {
|
12
|
+
return this.application.messagesBuilder.getMessage(key, params);
|
13
|
+
}
|
14
|
+
async handleFilterGroupChange() {
|
15
|
+
const assistent = await this._mainExpressionGroup.getExpressionGroup();
|
16
|
+
this.filterAssistent = Object.assign(Object.assign({}, this.filterAssistent), { assistent });
|
17
|
+
this.filterAssistent.parameters = PersonalizedFilterUtils.buildVariableParameters(this.filterAssistent.assistent);
|
18
|
+
this.filterAssistent.expression = PersonalizedFilterUtils.buildGroupExpression(this.filterAssistent.assistent);
|
19
|
+
this.ezChangeFilter.emit(this.filterAssistent);
|
20
|
+
}
|
21
|
+
render() {
|
22
|
+
var _a, _b;
|
23
|
+
return (h(Host, null, h("div", { class: "ez-padding-top--small snk-personalized-filter__group" }, h("snk-expression-group", { ref: (el) => this._mainExpressionGroup = el, group: (_a = this.filterAssistent) === null || _a === void 0 ? void 0 : _a.assistent, messagesBuilder: this.messagesBuilder, onEzFilterGroupChange: this.handleFilterGroupChange.bind(this), filterId: this.filterId, entityURI: this.entityUri })), h("div", { class: "ez-margin-top--auto" }, h("div", { class: "snk-personalized-filter__expression-input--line" }), h("ez-collapsible-box", { label: this.getMessage("snkPersonalizedFilter.info.titleCollapsible"), headerSize: "medium", value: true }, h("div", { class: "ez-box" }, h("div", { class: "ez-box__container--external" }, h("div", { class: "ez-box__container--internal" }, h("span", { class: "ez-box__container--title" }, this.getMessage("snkPersonalizedFilter.info.labelExpression")), h("span", { class: "ez-box__container--expression" }, (_b = this.filterAssistent) === null || _b === void 0 ? void 0 : _b.expression))))))));
|
24
|
+
}
|
25
|
+
static get is() { return "snk-filter-assistent-mode"; }
|
26
|
+
static get encapsulation() { return "scoped"; }
|
27
|
+
static get originalStyleUrls() {
|
28
|
+
return {
|
29
|
+
"$": ["snk-filter-assistent-mode.css"]
|
30
|
+
};
|
31
|
+
}
|
32
|
+
static get styleUrls() {
|
33
|
+
return {
|
34
|
+
"$": ["snk-filter-assistent-mode.css"]
|
35
|
+
};
|
36
|
+
}
|
37
|
+
static get properties() {
|
38
|
+
return {
|
39
|
+
"filterAssistent": {
|
40
|
+
"type": "unknown",
|
41
|
+
"mutable": true,
|
42
|
+
"complexType": {
|
43
|
+
"original": "IPersonalizedFilter",
|
44
|
+
"resolved": "IPersonalizedFilter",
|
45
|
+
"references": {
|
46
|
+
"IPersonalizedFilter": {
|
47
|
+
"location": "import",
|
48
|
+
"path": "../../interfaces/IPersonalizedFilter"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
},
|
52
|
+
"required": false,
|
53
|
+
"optional": false,
|
54
|
+
"docs": {
|
55
|
+
"tags": [],
|
56
|
+
"text": "Propriedade que cont\u00E9m informa\u00E7\u00F5es do filtro personalizado."
|
57
|
+
}
|
58
|
+
},
|
59
|
+
"messagesBuilder": {
|
60
|
+
"type": "unknown",
|
61
|
+
"mutable": true,
|
62
|
+
"complexType": {
|
63
|
+
"original": "SnkMessageBuilder",
|
64
|
+
"resolved": "SnkMessageBuilder",
|
65
|
+
"references": {
|
66
|
+
"SnkMessageBuilder": {
|
67
|
+
"location": "import",
|
68
|
+
"path": "../../../../lib/message/SnkMessageBuilder"
|
69
|
+
}
|
70
|
+
}
|
71
|
+
},
|
72
|
+
"required": false,
|
73
|
+
"optional": false,
|
74
|
+
"docs": {
|
75
|
+
"tags": [],
|
76
|
+
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
77
|
+
}
|
78
|
+
},
|
79
|
+
"filterId": {
|
80
|
+
"type": "string",
|
81
|
+
"mutable": true,
|
82
|
+
"complexType": {
|
83
|
+
"original": "string",
|
84
|
+
"resolved": "string",
|
85
|
+
"references": {}
|
86
|
+
},
|
87
|
+
"required": false,
|
88
|
+
"optional": false,
|
89
|
+
"docs": {
|
90
|
+
"tags": [],
|
91
|
+
"text": "Id do filtro que ser\u00E1 carregado."
|
92
|
+
},
|
93
|
+
"attribute": "filter-id",
|
94
|
+
"reflect": false
|
95
|
+
},
|
96
|
+
"entityUri": {
|
97
|
+
"type": "string",
|
98
|
+
"mutable": true,
|
99
|
+
"complexType": {
|
100
|
+
"original": "string",
|
101
|
+
"resolved": "string",
|
102
|
+
"references": {}
|
103
|
+
},
|
104
|
+
"required": false,
|
105
|
+
"optional": false,
|
106
|
+
"docs": {
|
107
|
+
"tags": [],
|
108
|
+
"text": "Respons\u00E1vel por receber a URI da entidade."
|
109
|
+
},
|
110
|
+
"attribute": "entity-uri",
|
111
|
+
"reflect": false
|
112
|
+
},
|
113
|
+
"application": {
|
114
|
+
"type": "unknown",
|
115
|
+
"mutable": true,
|
116
|
+
"complexType": {
|
117
|
+
"original": "SnkApplication",
|
118
|
+
"resolved": "SnkApplication",
|
119
|
+
"references": {
|
120
|
+
"SnkApplication": {
|
121
|
+
"location": "import",
|
122
|
+
"path": "../../../snk-application/snk-application"
|
123
|
+
}
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"required": false,
|
127
|
+
"optional": false,
|
128
|
+
"docs": {
|
129
|
+
"tags": [],
|
130
|
+
"text": "Propriedade que mant\u00E9m informa\u00E7\u00F5es relacionadas ao SnkApplication."
|
131
|
+
}
|
132
|
+
}
|
133
|
+
};
|
134
|
+
}
|
135
|
+
static get events() {
|
136
|
+
return [{
|
137
|
+
"method": "ezChangeFilter",
|
138
|
+
"name": "ezChangeFilter",
|
139
|
+
"bubbles": true,
|
140
|
+
"cancelable": true,
|
141
|
+
"composed": true,
|
142
|
+
"docs": {
|
143
|
+
"tags": [],
|
144
|
+
"text": ""
|
145
|
+
},
|
146
|
+
"complexType": {
|
147
|
+
"original": "IPersonalizedFilter",
|
148
|
+
"resolved": "IPersonalizedFilter",
|
149
|
+
"references": {
|
150
|
+
"IPersonalizedFilter": {
|
151
|
+
"location": "import",
|
152
|
+
"path": "../../interfaces/IPersonalizedFilter"
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}];
|
157
|
+
}
|
158
|
+
}
|
@@ -12,6 +12,9 @@ export class SnkFilterParamConfig {
|
|
12
12
|
this._canSave = false;
|
13
13
|
this.messagesBuilder = undefined;
|
14
14
|
}
|
15
|
+
/**
|
16
|
+
* Abre o modal de configuração de valor variável
|
17
|
+
*/
|
15
18
|
open(expressionItem) {
|
16
19
|
this._opened = true;
|
17
20
|
this._expressionItem = expressionItem;
|
@@ -20,6 +23,9 @@ export class SnkFilterParamConfig {
|
|
20
23
|
this._promiseResolver = accept;
|
21
24
|
});
|
22
25
|
}
|
26
|
+
/**
|
27
|
+
* Fecha o modal de configuração de valor variável
|
28
|
+
*/
|
23
29
|
close() {
|
24
30
|
this._opened = false;
|
25
31
|
return new Promise(accept => {
|
@@ -255,7 +261,7 @@ export class SnkFilterParamConfig {
|
|
255
261
|
"return": "Promise<IExpressionItem>"
|
256
262
|
},
|
257
263
|
"docs": {
|
258
|
-
"text": "",
|
264
|
+
"text": "Abre o modal de configura\u00E7\u00E3o de valor vari\u00E1vel",
|
259
265
|
"tags": []
|
260
266
|
}
|
261
267
|
},
|
@@ -275,7 +281,7 @@ export class SnkFilterParamConfig {
|
|
275
281
|
"return": "Promise<IExpressionItem>"
|
276
282
|
},
|
277
283
|
"docs": {
|
278
|
-
"text": "",
|
284
|
+
"text": "Fecha o modal de configura\u00E7\u00E3o de valor vari\u00E1vel",
|
279
285
|
"tags": []
|
280
286
|
}
|
281
287
|
}
|
@@ -7,14 +7,12 @@ export class PersonalizedFilterUtils {
|
|
7
7
|
* @param expressionItem - Objeto com os parâmetros necessários para montar a expressão.
|
8
8
|
* @returns Retorna a expressão de filtro.
|
9
9
|
*/
|
10
|
-
static buildFilterExpression(expressionItem
|
10
|
+
static buildFilterExpression(expressionItem) {
|
11
|
+
var _a;
|
11
12
|
if (expressionItem == undefined) {
|
12
13
|
return;
|
13
14
|
}
|
14
|
-
|
15
|
-
return "";
|
16
|
-
}
|
17
|
-
let value = this.buildVariableParameterValue(expressionItem);
|
15
|
+
let value = (_a = this.buildVariableParameterValue(expressionItem)) !== null && _a !== void 0 ? _a : undefined;
|
18
16
|
let expression = expressionItem.expression || "";
|
19
17
|
let commas = "'";
|
20
18
|
if (expressionItem.paramVariable) {
|
@@ -38,8 +36,13 @@ export class PersonalizedFilterUtils {
|
|
38
36
|
expression += ` LIKE '%${value}'`;
|
39
37
|
break;
|
40
38
|
default:
|
41
|
-
|
42
|
-
|
39
|
+
if (expressionItem.operand) {
|
40
|
+
expression += ` ${FilterOperand[expressionItem.operand]}`;
|
41
|
+
}
|
42
|
+
if (value) {
|
43
|
+
value = isNaN(value) ? `${commas}${value}${commas}` : value;
|
44
|
+
expression += ` ${value}`;
|
45
|
+
}
|
43
46
|
}
|
44
47
|
return expression;
|
45
48
|
}
|
@@ -63,7 +66,7 @@ export class PersonalizedFilterUtils {
|
|
63
66
|
pois para filtros herdados do HTML5 não temos o tipo OBJECT, fazendo com que a expressão
|
64
67
|
fique inválida para campos do tipo pesquisa.
|
65
68
|
*/
|
66
|
-
if (UserInterface.SEARCH === expressionItem.userInterface || DataType.OBJECT == type) {
|
69
|
+
if (UserInterface.SEARCH === expressionItem.userInterface || expressionItem.userInterface === UserInterface.OPTIONSELECTOR || DataType.OBJECT == type) {
|
67
70
|
value = (_a = value === null || value === void 0 ? void 0 : value.value) !== null && _a !== void 0 ? _a : value;
|
68
71
|
}
|
69
72
|
if (DataType.NUMBER == type && value != undefined) {
|
@@ -105,11 +108,11 @@ export class PersonalizedFilterUtils {
|
|
105
108
|
/*
|
106
109
|
* Cria uma expressão de filtro para um grupo de itens.
|
107
110
|
*/
|
108
|
-
static buildGroupExpression(expressionGroup
|
111
|
+
static buildGroupExpression(expressionGroup) {
|
109
112
|
var _a, _b;
|
110
113
|
if (!((_a = expressionGroup === null || expressionGroup === void 0 ? void 0 : expressionGroup.items) === null || _a === void 0 ? void 0 : _a.length))
|
111
114
|
return "";
|
112
|
-
const itemExpressions = expressionGroup.items.map((item) => this.buildFilterExpression(item
|
115
|
+
const itemExpressions = expressionGroup.items.map((item) => this.buildFilterExpression(item)).join(` ${expressionGroup.operand} `);
|
113
116
|
if (((_b = expressionGroup === null || expressionGroup === void 0 ? void 0 : expressionGroup.childrenGroups) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
114
117
|
const childGroupExpressions = expressionGroup.childrenGroups.map((children) => this.buildGroupExpression(children)).join(` ${expressionGroup.operand} `);
|
115
118
|
return `(${itemExpressions} ${expressionGroup.operand} (${childGroupExpressions}))`;
|
@@ -196,7 +199,6 @@ export class PersonalizedFilterUtils {
|
|
196
199
|
* do tipo variavel;
|
197
200
|
*/
|
198
201
|
static buildVariableParameters(expressionGroup) {
|
199
|
-
var _a, _b, _c, _d;
|
200
202
|
const allItems = this.buildPlainExpressionItems(expressionGroup);
|
201
203
|
const allParams = [];
|
202
204
|
for (const item of allItems) {
|
@@ -205,18 +207,7 @@ export class PersonalizedFilterUtils {
|
|
205
207
|
}
|
206
208
|
allParams.push({
|
207
209
|
entityName: item.entityName,
|
208
|
-
fieldName: item.fieldName
|
209
|
-
dataType: item.type,
|
210
|
-
description: item.description,
|
211
|
-
userInterface: item.userInterface,
|
212
|
-
label: item.fieldLabel,
|
213
|
-
searchContext: {
|
214
|
-
entity: (_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.find(prop => prop.name == "ENTITYNAME")) === null || _b === void 0 ? void 0 : _b.value,
|
215
|
-
entityDescription: (_d = (_c = item.props) === null || _c === void 0 ? void 0 : _c.find(prop => prop.name == "DESCRIPTIONENTITY")) === null || _d === void 0 ? void 0 : _d.value,
|
216
|
-
searchOptions: {
|
217
|
-
showInactives: false
|
218
|
-
}
|
219
|
-
}
|
210
|
+
fieldName: item.fieldName
|
220
211
|
});
|
221
212
|
}
|
222
213
|
return allParams;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { ApplicationContext, DataType, ObjectUtils, UserInterface } from '@sankhyalabs/core';
|
1
|
+
import { ApplicationContext, DataType, ObjectUtils, UserInterface, } from '@sankhyalabs/core';
|
2
2
|
import { h } from '@stencil/core';
|
3
|
-
import {
|
3
|
+
import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
|
4
4
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
5
5
|
import { PresentationMode } from '../../lib';
|
6
6
|
import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
@@ -151,7 +151,7 @@ export class SnkSimpleCrud {
|
|
151
151
|
this.dataState = Object.assign({}, evt.detail);
|
152
152
|
}
|
153
153
|
getTaskBarDisabledButtons() {
|
154
|
-
var _a, _b;
|
154
|
+
var _a, _b, _c, _d;
|
155
155
|
const disabledButtons = [];
|
156
156
|
if (!((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.hasNext)) {
|
157
157
|
disabledButtons.push(TaskbarElement.NEXT);
|
@@ -159,11 +159,21 @@ export class SnkSimpleCrud {
|
|
159
159
|
if (!((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.hasPrevious)) {
|
160
160
|
disabledButtons.push(TaskbarElement.PREVIOUS);
|
161
161
|
}
|
162
|
+
if ((_d = (_c = this.dataState) === null || _c === void 0 ? void 0 : _c.selectionInfo) === null || _d === void 0 ? void 0 : _d.isEmpty()) {
|
163
|
+
disabledButtons.push(TaskbarElement.FORM_MODE);
|
164
|
+
}
|
162
165
|
return disabledButtons;
|
163
166
|
}
|
167
|
+
handleCancelEdit() {
|
168
|
+
var _a;
|
169
|
+
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
170
|
+
this.goToView(VIEW_MODE.GRID);
|
171
|
+
this.dataUnit.clearSelection();
|
172
|
+
}
|
173
|
+
}
|
164
174
|
render() {
|
165
175
|
var _a;
|
166
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
176
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
167
177
|
}
|
168
178
|
static get is() { return "snk-simple-crud"; }
|
169
179
|
static get encapsulation() { return "scoped"; }
|
@@ -17,17 +17,16 @@ export class ConfigStorage {
|
|
17
17
|
const resourceID = await application.getResourceID();
|
18
18
|
ConfigStorage.instance = new ConfigStorage();
|
19
19
|
ConfigStorage.resourceID = resourceID;
|
20
|
-
ConfigStorage.instance.loadFilterBarConfig(configName);
|
21
20
|
ConfigStorage.instance.loadFormConfig(configName);
|
22
21
|
ConfigStorage.instance.loadGridConfig(configName);
|
23
22
|
}
|
24
23
|
}
|
25
24
|
return this.instance;
|
26
25
|
}
|
27
|
-
async loadFilterBarConfig(name) {
|
26
|
+
async loadFilterBarConfig(name, urlParams) {
|
28
27
|
const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.filterBar);
|
29
28
|
if (!ConfigStorage.configById.has(cacheID)) {
|
30
|
-
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(ConfigStorage.resourceID, name));
|
29
|
+
ConfigStorage.configById.set(cacheID, ConfigStorage.filterBarConfigFetcher.getConfig(ConfigStorage.resourceID, name, urlParams));
|
31
30
|
}
|
32
31
|
return ConfigStorage.configById.get(cacheID);
|
33
32
|
}
|
@@ -79,6 +78,9 @@ export class ConfigStorage {
|
|
79
78
|
static async removePersonalizedFilter(personalizedFilter, configName) {
|
80
79
|
return this.personalizedFilterFetcher.removePersonalizedFilter(personalizedFilter, this.resourceID, configName);
|
81
80
|
}
|
81
|
+
static async validatePersonalizedFilter(dataUnitName, expression) {
|
82
|
+
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
83
|
+
}
|
82
84
|
static buildCacheID(name, source) {
|
83
85
|
if (name == undefined) {
|
84
86
|
return `req_${source}_${this.resourceID}`;
|
@@ -75,9 +75,9 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
75
75
|
saveConfig(items, resourceID, configName) {
|
76
76
|
return this.saveResource(this.normalize(items), this.getPath(resourceID, configName));
|
77
77
|
}
|
78
|
-
getConfig(resourceID, configName) {
|
78
|
+
getConfig(resourceID, configName, urlParams) {
|
79
79
|
return new Promise((accept, reject) => {
|
80
|
-
this.loadResource(this.getPath(resourceID, configName))
|
80
|
+
this.loadResource(this.getPath(resourceID, configName, urlParams))
|
81
81
|
.then((configAsString) => {
|
82
82
|
let fieldsList;
|
83
83
|
if (configAsString) {
|
@@ -125,10 +125,27 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
125
125
|
return item;
|
126
126
|
});
|
127
127
|
}
|
128
|
-
getPath(resourceID, name) {
|
128
|
+
getPath(resourceID, name, urlParams) {
|
129
|
+
let path = `cfg://filter/FilterBarState:${resourceID}`;
|
129
130
|
if (name) {
|
130
|
-
|
131
|
+
path += `.${name}`;
|
131
132
|
}
|
132
|
-
|
133
|
+
if (urlParams) {
|
134
|
+
path += this.buildQueryString(urlParams);
|
135
|
+
}
|
136
|
+
return path;
|
137
|
+
}
|
138
|
+
buildQueryString(urlParams) {
|
139
|
+
let queryString = '?';
|
140
|
+
for (let key in urlParams) {
|
141
|
+
if (!urlParams.hasOwnProperty(key)) {
|
142
|
+
continue;
|
143
|
+
}
|
144
|
+
if (queryString.length > 1) {
|
145
|
+
queryString += '&';
|
146
|
+
}
|
147
|
+
queryString += key + '=' + urlParams[key];
|
148
|
+
}
|
149
|
+
return queryString;
|
133
150
|
}
|
134
151
|
}
|