@sankhyalabs/sankhyablocks 6.5.0 → 6.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.
- package/dist/cjs/{PersonalizedFilterUtils-7d959e91.js → PersonalizedFilterUtils-cfcd9af2.js} +47 -10
- package/dist/cjs/{SnkMessageBuilder-aec46b5d.js → SnkMessageBuilder-ba6d4ade.js} +4 -1
- package/dist/cjs/{index-614af008.js → index-0e663819.js} +0 -36
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-ba0c368c.js → snk-data-unit-5f434275.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
- package/dist/cjs/snk-expression-group.cjs.entry.js +21 -17
- package/dist/cjs/snk-expression-item_3.cjs.entry.js +21 -31
- package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -16
- package/dist/cjs/snk-filter-detail.cjs.entry.js +11 -7
- package/dist/cjs/snk-filter-item.cjs.entry.js +16 -7
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +10 -8
- package/dist/cjs/snk-filter-modal.cjs.entry.js +13 -7
- package/dist/cjs/snk-grid.cjs.entry.js +2 -2
- package/dist/cjs/{snk-guides-viewer-7bedfa91.js → snk-guides-viewer-27586701.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/{snk-filter-personalized.cjs.entry.js → snk-personalized-filter-editor.cjs.entry.js} +35 -12
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +24 -13
- package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-7f91f4cd.js → taskbar-elements-b98dd6e9.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/{snk-filter-personalized/snk-filter-personalized.js → snk-personalized-filter-editor/snk-personalized-filter-editor.js} +36 -13
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +9 -5
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +16 -7
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +11 -5
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +10 -8
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +4 -5
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +2 -12
- package/dist/collection/components/snk-personalized-filter/interfaces/index.js +39 -0
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +24 -12
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +25 -21
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +7 -7
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +3 -3
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +6 -6
- package/dist/collection/lib/@types/index.js +0 -36
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +4 -1
- package/dist/components/PersonalizedFilterUtils.js +49 -7
- package/dist/components/SnkMessageBuilder.js +4 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -37
- package/dist/components/snk-expression-group2.js +22 -23
- package/dist/components/snk-expression-item2.js +4 -4
- package/dist/components/snk-filter-bar2.js +5 -7
- package/dist/components/snk-filter-detail2.js +9 -5
- package/dist/components/snk-filter-field-search2.js +2 -12
- package/dist/components/snk-filter-item2.js +16 -7
- package/dist/components/snk-filter-modal-item2.js +10 -8
- package/dist/components/snk-filter-modal.js +11 -5
- package/dist/components/snk-filter-param-config2.js +1 -2
- package/dist/components/snk-personalized-filter-editor.d.ts +11 -0
- package/dist/components/{snk-filter-personalized.js → snk-personalized-filter-editor.js} +42 -19
- package/dist/components/snk-personalized-filter2.js +25 -13
- package/dist/esm/{PersonalizedFilterUtils-202cd721.js → PersonalizedFilterUtils-1a167d89.js} +44 -7
- package/dist/esm/{SnkMessageBuilder-a4f7d858.js → SnkMessageBuilder-9d2becfb.js} +4 -1
- package/dist/esm/index-1564817d.js +33 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-3ecaf52c.js → snk-data-unit-ca4bcba6.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +4 -4
- package/dist/esm/snk-expression-group.entry.js +21 -17
- package/dist/esm/snk-expression-item_3.entry.js +7 -17
- package/dist/esm/snk-filter-bar.entry.js +6 -7
- package/dist/esm/snk-filter-detail.entry.js +11 -7
- package/dist/esm/snk-filter-item.entry.js +16 -7
- package/dist/esm/snk-filter-modal-item.entry.js +10 -8
- package/dist/esm/snk-filter-modal.entry.js +13 -7
- package/dist/esm/snk-grid.entry.js +2 -2
- package/dist/esm/{snk-guides-viewer-9240c017.js → snk-guides-viewer-950dd3b5.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/{snk-filter-personalized.entry.js → snk-personalized-filter-editor.entry.js} +35 -12
- package/dist/esm/snk-personalized-filter.entry.js +24 -13
- package/dist/esm/snk-simple-crud.entry.js +2 -2
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-139b1058.js → taskbar-elements-2c761819.js} +1 -1
- package/dist/sankhyablocks/{p-ab33e180.js → p-01070d6d.js} +1 -1
- package/dist/sankhyablocks/p-25df01a1.entry.js +1 -0
- package/dist/sankhyablocks/p-30134b16.entry.js +1 -0
- package/dist/sankhyablocks/{p-09f33525.entry.js → p-402db136.entry.js} +1 -1
- package/dist/sankhyablocks/p-40a5d35e.entry.js +1 -0
- package/dist/sankhyablocks/p-5534e08c.js +1 -0
- package/dist/sankhyablocks/{p-257aeea4.entry.js → p-5e06e139.entry.js} +1 -1
- package/dist/sankhyablocks/{p-43485c54.js → p-602dfb9e.js} +1 -1
- package/dist/sankhyablocks/{p-78a226a1.js → p-6f4f88ef.js} +1 -1
- package/dist/sankhyablocks/p-775e60f5.entry.js +1 -0
- package/dist/sankhyablocks/{p-aa4e880f.entry.js → p-7c10486f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a1cab141.entry.js → p-7c50ded4.entry.js} +1 -1
- package/dist/sankhyablocks/p-7d68a43a.js +1 -0
- package/dist/sankhyablocks/{p-f75dceb1.entry.js → p-7f37b801.entry.js} +1 -1
- package/dist/sankhyablocks/p-86e10ecc.entry.js +1 -0
- package/dist/sankhyablocks/p-88a40b96.entry.js +1 -0
- package/dist/sankhyablocks/{p-f1edaec0.js → p-a2493d11.js} +1 -1
- package/dist/sankhyablocks/p-b6f9f702.entry.js +1 -0
- package/dist/sankhyablocks/{p-6564f621.entry.js → p-c2d3e4fb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2adb4481.entry.js → p-c6380ea2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0d670404.entry.js → p-c7c4ed56.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e8be0aae.entry.js → p-ca29b093.entry.js} +1 -1
- package/dist/sankhyablocks/p-d881cab2.entry.js +1 -0
- package/dist/sankhyablocks/p-d9586ead.entry.js +1 -0
- package/dist/sankhyablocks/p-f8ce17d3.entry.js +1 -0
- package/dist/sankhyablocks/{p-cea58f8b.entry.js → p-fdc262aa.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/{snk-filter-personalized/snk-filter-personalized.d.ts → snk-personalized-filter-editor/snk-personalized-filter-editor.d.ts} +8 -25
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +3 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +0 -1
- package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionItem.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +37 -0
- package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IUserFilterConfig.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/interfaces/index.d.ts +35 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +5 -2
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +2 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.d.ts +1 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +2 -2
- package/dist/types/components.d.ts +62 -62
- package/dist/types/lib/@types/index.d.ts +0 -32
- package/dist/types/lib/configs/ConfigStorage.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
- package/package.json +1 -1
- package/react/components.d.ts +1 -1
- package/react/components.js +1 -1
- package/react/components.js.map +1 -1
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +0 -3
- package/dist/components/snk-filter-personalized.d.ts +0 -11
- package/dist/esm/index-a255b326.js +0 -69
- package/dist/sankhyablocks/p-0364abc8.entry.js +0 -1
- package/dist/sankhyablocks/p-18e3a2b7.entry.js +0 -1
- package/dist/sankhyablocks/p-36ecb6ab.js +0 -1
- package/dist/sankhyablocks/p-4374cc15.entry.js +0 -1
- package/dist/sankhyablocks/p-50c3700f.entry.js +0 -1
- package/dist/sankhyablocks/p-6ce48ae3.entry.js +0 -1
- package/dist/sankhyablocks/p-7add855c.entry.js +0 -1
- package/dist/sankhyablocks/p-abc4ae66.entry.js +0 -1
- package/dist/sankhyablocks/p-c7dd701c.entry.js +0 -1
- package/dist/sankhyablocks/p-d5a25c7d.entry.js +0 -1
- package/dist/sankhyablocks/p-e962ce72.entry.js +0 -1
- package/dist/sankhyablocks/p-eb90de43.js +0 -1
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +0 -21
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +0 -3
- /package/dist/cjs/{IExpressionItem-1090c3fd.js → IExpressionItem-0e32ebb7.js} +0 -0
- /package/dist/collection/components/snk-filter-bar/filter-item/editors/{snk-filter-personalized/snk-filter-personalized.css → snk-personalized-filter-editor/snk-personalized-filter-editor.css} +0 -0
- /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionGroup.js +0 -0
- /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionItem.js +0 -0
- /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IParameter.js +0 -0
- /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IPersonalizedFilter.js +0 -0
- /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/ISystemFilterConfig.js +0 -0
- /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IUserFilterConfig.js +0 -0
- /package/dist/esm/{IExpressionItem-2e922b2c.js → IExpressionItem-21f225bf.js} +0 -0
- /package/dist/sankhyablocks/{p-c6bf66e0.js → p-63bff2a8.js} +0 -0
- /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionGroup.d.ts +0 -0
- /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IPersonalizedFilter.d.ts +0 -0
- /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/ISystemFilterConfig.d.ts +0 -0
@@ -4,19 +4,24 @@ import { PersonalizedFilterUtils } from './subcomponents/snk-filter-param-config
|
|
4
4
|
import { ConfigStorage } from "../../lib/configs/ConfigStorage";
|
5
5
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
6
6
|
import { ObjectUtils } from "@sankhyalabs/core";
|
7
|
-
import { FilterGroupCondition } from './
|
7
|
+
import { FilterGroupCondition } from './interfaces/IExpressionItem';
|
8
8
|
import store from '../../lib/store';
|
9
9
|
import PersonalizedFilterFetcher from "../../lib/http/data-fetcher/fetchers/personalized-filter-fetcher";
|
10
10
|
export class SnkPersonalizedFilter {
|
11
11
|
constructor() {
|
12
12
|
this._personalizedFilterFetcher = new PersonalizedFilterFetcher();
|
13
|
+
this._filterMetadataStorage = new Map();
|
13
14
|
this._dataSourceFetcher = {
|
14
15
|
fetchData: async (entity) => {
|
15
16
|
let entityURI = entity === null || entity === void 0 ? void 0 : entity.uri;
|
16
17
|
if (StringUtils.isEmpty(entityURI)) {
|
17
18
|
entityURI = this.entityUri;
|
18
19
|
}
|
19
|
-
|
20
|
+
if (!this._filterMetadataStorage.has(entityURI)) {
|
21
|
+
const filterMetadata = await this._personalizedFilterFetcher.loadFields(entityURI);
|
22
|
+
this._filterMetadataStorage.set(entityURI, filterMetadata);
|
23
|
+
}
|
24
|
+
return this._filterMetadataStorage.get(entityURI);
|
20
25
|
}
|
21
26
|
};
|
22
27
|
this._filterAssistentMode = true;
|
@@ -129,11 +134,11 @@ export class SnkPersonalizedFilter {
|
|
129
134
|
ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"), this.getMessage("snkPersonalizedFilter.confirmCancel.description"))
|
130
135
|
.then((canCancel) => {
|
131
136
|
var _a;
|
132
|
-
if (canCancel)
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
+
if (!canCancel)
|
138
|
+
return;
|
139
|
+
this._filterAssistent = ObjectUtils.copy((_a = this._originalFilterAssistent) !== null && _a !== void 0 ? _a : {});
|
140
|
+
this.ezCancel.emit();
|
141
|
+
this._elButtonSave.enabled = false;
|
137
142
|
});
|
138
143
|
}
|
139
144
|
handleTitleChange(name) {
|
@@ -166,14 +171,21 @@ export class SnkPersonalizedFilter {
|
|
166
171
|
}
|
167
172
|
return (h("div", { class: "ez-flex" }, h("ez-alert", { alertType: "warn" }, this._filterAssistent.warningMessage)));
|
168
173
|
}
|
174
|
+
buildContainerPersonalizedFilter() {
|
175
|
+
var _a, _b, _c;
|
176
|
+
if (this._filterAssistentMode) {
|
177
|
+
return (h(Fragment, 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", null, 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" }, h("ez-text-area", { ref: (el) => this._elTextAreaExpression = el, enabled: false, label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.expression })))))));
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
return (h(Fragment, null, h("span", { class: "ez-text ez-text--small ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkPersonalizedFilter.info.applyExpression")), h("ez-text-area", { label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_c = this._filterAssistent) === null || _c === void 0 ? void 0 : _c.expression, onEzChange: (evt) => this.handleExpressionChange(evt.detail) }), this.getWarningMessageComponent()));
|
181
|
+
}
|
182
|
+
}
|
169
183
|
render() {
|
170
|
-
var _a, _b
|
184
|
+
var _a, _b;
|
171
185
|
if (!((_a = this._filterAssistent) === null || _a === void 0 ? void 0 : _a.assistent) && this._filterAssistentMode) {
|
172
186
|
return;
|
173
187
|
}
|
174
|
-
return (h(Host, null, h("div", { class: "snk-personalized-filter" }, h("div", null, h("snk-simple-bar", { label: this.filterId ? this.getMessage("snkPersonalizedFilter.info.titleEdit") : this.getMessage("snkPersonalizedFilter.info.titleAdd"), onExit: () => this.handleCancel() }, h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, h("ez-button", { size: "small", label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), h("ez-button", { size: "small", ref: (el) => this._elButtonSave = el, enabled: false, class: "ez-button--primary", label: this.getMessage("snkPersonalizedFilter.info.labelSave"), onClick: this.handleSave.bind(this) })))), h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, h("div", { class: "ez-box__container" }, h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("div", { class: "ez-flex" }, h("ez-text-input", { class: "ez-padding-right--medium", label: this.getMessage("snkPersonalizedFilter.info.labelNameFilter"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.name, onEzChange: (evt) => this.handleTitleChange(evt.detail) })), this.
|
175
|
-
h(Fragment, null, h("div", { class: "ez-padding-top--small snk-personalized-filter__group" }, h("snk-expression-group", { ref: (el) => this._mainExpressionGroup = el, group: (_c = this._filterAssistent) === null || _c === void 0 ? void 0 : _c.assistent, messagesBuilder: this.messagesBuilder, onEzFilterGroupChange: this.handleFilterGroupChange.bind(this), filterId: this.filterId, entityURI: this.entityUri })), h("div", null, 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" }, h("ez-text-area", { ref: (el) => this._elTextAreaExpression = el, enabled: false, label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_d = this._filterAssistent) === null || _d === void 0 ? void 0 : _d.expression })))))) :
|
176
|
-
h(Fragment, null, h("span", { class: "ez-text ez-text--small ez-text--bold ez-padding-bottom--medium" }, "Express\u00E3o a ser aplicada:"), h("ez-text-area", { label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_e = this._filterAssistent) === null || _e === void 0 ? void 0 : _e.expression, onEzChange: (evt) => this.handleExpressionChange(evt.detail) }), this.getWarningMessageComponent())))))));
|
188
|
+
return (h(Host, null, h("div", { class: "snk-personalized-filter" }, h("div", null, h("snk-simple-bar", { label: this.filterId ? this.getMessage("snkPersonalizedFilter.info.titleEdit") : this.getMessage("snkPersonalizedFilter.info.titleAdd"), onExit: () => this.handleCancel() }, h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, h("ez-button", { size: "small", label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), h("ez-button", { size: "small", ref: (el) => this._elButtonSave = el, enabled: false, class: "ez-button--primary", label: this.getMessage("snkPersonalizedFilter.info.labelSave"), onClick: this.handleSave.bind(this) })))), h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, h("div", { class: "ez-box__container" }, h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("div", { class: "ez-flex" }, h("ez-text-input", { class: "ez-padding-right--medium", label: this.getMessage("snkPersonalizedFilter.info.labelNameFilter"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.name, onEzChange: (evt) => this.handleTitleChange(evt.detail) })), this.buildContainerPersonalizedFilter()))))));
|
177
189
|
}
|
178
190
|
static get is() { return "snk-personalized-filter"; }
|
179
191
|
static get encapsulation() { return "scoped"; }
|
@@ -313,7 +325,7 @@ export class SnkPersonalizedFilter {
|
|
313
325
|
},
|
314
326
|
"IPersonalizedFilter": {
|
315
327
|
"location": "import",
|
316
|
-
"path": "./
|
328
|
+
"path": "./interfaces/IPersonalizedFilter"
|
317
329
|
}
|
318
330
|
},
|
319
331
|
"return": "Promise<void>"
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { h, Host, forceUpdate } from '@stencil/core';
|
2
|
-
import { FilterGroupCondition } from '../../
|
2
|
+
import { FilterGroupCondition } from '../../interfaces/IExpressionItem';
|
3
3
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
4
4
|
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
5
|
-
const LIMIT_GROUP_LEVEL = 4;
|
6
5
|
export class SnkExpressionGroup {
|
7
6
|
constructor() {
|
8
7
|
this.FIRST_LEVEL = "0";
|
8
|
+
this.LIMIT_GROUP_LEVEL = 4;
|
9
9
|
this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
10
10
|
this._conditionOperator = FilterGroupCondition.AND;
|
11
11
|
this._group = undefined;
|
@@ -32,11 +32,11 @@ export class SnkExpressionGroup {
|
|
32
32
|
}
|
33
33
|
watchGroup(newValue) {
|
34
34
|
this._group = newValue;
|
35
|
-
this._conditionOperator =
|
35
|
+
this._conditionOperator = this.getOperand();
|
36
36
|
}
|
37
37
|
componentWillLoad() {
|
38
38
|
this._group = this.group;
|
39
|
-
this._conditionOperator =
|
39
|
+
this._conditionOperator = this.getOperand();
|
40
40
|
if (!this.getDataGroupLevel()) {
|
41
41
|
this._element.setAttribute('data-group-level', this.FIRST_LEVEL);
|
42
42
|
}
|
@@ -62,6 +62,9 @@ export class SnkExpressionGroup {
|
|
62
62
|
getDashedHeight() {
|
63
63
|
return this._selfTop - this.parentTop;
|
64
64
|
}
|
65
|
+
getOperand() {
|
66
|
+
return !this._group.operand ? FilterGroupCondition.AND : this._group.operand;
|
67
|
+
}
|
65
68
|
getMessage(key, params) {
|
66
69
|
return this.application.messagesBuilder.getMessage(key, params);
|
67
70
|
}
|
@@ -95,18 +98,19 @@ export class SnkExpressionGroup {
|
|
95
98
|
this.changeHandler();
|
96
99
|
this.canAddExpression = true;
|
97
100
|
}
|
101
|
+
isFilledItem(item) {
|
102
|
+
if (!item.fieldName || !item.operand)
|
103
|
+
return false;
|
104
|
+
if (item.operand === 'NULL' || item.operand === 'NOT_NULL') {
|
105
|
+
return true;
|
106
|
+
}
|
107
|
+
else {
|
108
|
+
return item.paramVariable || (item.userInterface === 'SWITCH') ? true : !!item.value;
|
109
|
+
}
|
110
|
+
}
|
98
111
|
handleFilterItemChange() {
|
99
112
|
this.ezFilterGroupChange.emit(this._group);
|
100
|
-
this.canAddExpression = this.group.items.every(
|
101
|
-
if (!item.fieldName || !item.operand)
|
102
|
-
return false;
|
103
|
-
if (item.operand === 'NULL' || item.operand === 'NOT_NULL') {
|
104
|
-
return true;
|
105
|
-
}
|
106
|
-
else {
|
107
|
-
return item.paramVariable || (item.userInterface === 'SWITCH') ? true : !!item.value;
|
108
|
-
}
|
109
|
-
});
|
113
|
+
this.canAddExpression = this.group.items.every(this.isFilledItem);
|
110
114
|
}
|
111
115
|
handleAddExpression() {
|
112
116
|
const newItem = {
|
@@ -195,7 +199,7 @@ export class SnkExpressionGroup {
|
|
195
199
|
}
|
196
200
|
canAddGroup() {
|
197
201
|
const dataGroupLevel = Number(this.getDataGroupLevel() || this.FIRST_LEVEL);
|
198
|
-
return dataGroupLevel < LIMIT_GROUP_LEVEL;
|
202
|
+
return dataGroupLevel < this.LIMIT_GROUP_LEVEL;
|
199
203
|
}
|
200
204
|
isFirstLevel() {
|
201
205
|
return Boolean(this.getDataGroupLevel() === this.FIRST_LEVEL);
|
@@ -204,7 +208,7 @@ export class SnkExpressionGroup {
|
|
204
208
|
evt.preventDefault();
|
205
209
|
evt.stopPropagation();
|
206
210
|
}
|
207
|
-
|
211
|
+
getMessageAddTooltip() {
|
208
212
|
if (this.isFirstLevel()) {
|
209
213
|
const allValidItems = this.group.items.every(item => {
|
210
214
|
if (!item.fieldName || !item.operand)
|
@@ -223,7 +227,7 @@ export class SnkExpressionGroup {
|
|
223
227
|
}
|
224
228
|
render() {
|
225
229
|
const canAddGroup = this.canAddGroup();
|
226
|
-
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" }, "
|
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()))));
|
227
231
|
}
|
228
232
|
static get is() { return "snk-expression-group"; }
|
229
233
|
static get encapsulation() { return "scoped"; }
|
@@ -266,7 +270,7 @@ export class SnkExpressionGroup {
|
|
266
270
|
"references": {
|
267
271
|
"IExpressionGroup": {
|
268
272
|
"location": "import",
|
269
|
-
"path": "../../
|
273
|
+
"path": "../../interfaces/IExpressionItem"
|
270
274
|
}
|
271
275
|
}
|
272
276
|
},
|
@@ -359,7 +363,7 @@ export class SnkExpressionGroup {
|
|
359
363
|
"references": {
|
360
364
|
"IExpressionGroup": {
|
361
365
|
"location": "import",
|
362
|
-
"path": "../../
|
366
|
+
"path": "../../interfaces/IExpressionItem"
|
363
367
|
}
|
364
368
|
}
|
365
369
|
}
|
@@ -379,7 +383,7 @@ export class SnkExpressionGroup {
|
|
379
383
|
"references": {
|
380
384
|
"IExpressionGroup": {
|
381
385
|
"location": "import",
|
382
|
-
"path": "../../
|
386
|
+
"path": "../../interfaces/IExpressionItem"
|
383
387
|
}
|
384
388
|
}
|
385
389
|
}
|
@@ -412,7 +416,7 @@ export class SnkExpressionGroup {
|
|
412
416
|
},
|
413
417
|
"IExpressionGroup": {
|
414
418
|
"location": "import",
|
415
|
-
"path": "../../
|
419
|
+
"path": "../../interfaces/IExpressionItem"
|
416
420
|
}
|
417
421
|
},
|
418
422
|
"return": "Promise<IExpressionGroup>"
|
@@ -3,16 +3,16 @@ import { ApplicationContext, ElementIDUtils, UserInterface } from '@sankhyalabs/
|
|
3
3
|
import { SelectedItemType } from "../../../snk-filter-field-search/interfaces";
|
4
4
|
import { CheckMode, ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
5
5
|
import { fieldBuilder } from "@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder";
|
6
|
-
import { FilterOperand } from '
|
6
|
+
import { FilterOperand } from '../../interfaces/index';
|
7
7
|
import { FilterOperandDefault, FilterOperandTypeTextSearch, FIELD_TYPE_SEARCH_AND_TEXT } from "./filter-operands/filter-operands";
|
8
8
|
import store from '../../../../lib/store';
|
9
9
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
10
|
-
const DEFAULT_FIELD_NAME = 'NOT_DEFINED';
|
11
10
|
export class SnkExpressionItem {
|
12
11
|
constructor() {
|
13
12
|
this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
14
13
|
this.filterOperandDefault = FilterOperandDefault;
|
15
14
|
this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
|
15
|
+
this.DEFAULT_FIELD_NAME = 'NOT_DEFINED';
|
16
16
|
this._showValueVariable = false;
|
17
17
|
this._fieldSelected = undefined;
|
18
18
|
this._optionNotNull = false;
|
@@ -197,7 +197,7 @@ export class SnkExpressionItem {
|
|
197
197
|
if (this._optionNotNull && inputFieldData || ((_b = this._elValueVariable) === null || _b === void 0 ? void 0 : _b.value) && inputFieldData || this.expression.paramVariable || this._showValueVariable || !((_c = this._fieldSelected) === null || _c === void 0 ? void 0 : _c.dataType)) {
|
198
198
|
inputFieldData.$attrs$.enabled = false;
|
199
199
|
}
|
200
|
-
if (this.expression.value) {
|
200
|
+
if (this.expression.value != undefined) {
|
201
201
|
inputFieldData.$attrs$.value = this.getExpressiontValue(this.expression);
|
202
202
|
}
|
203
203
|
inputFieldData.$attrs$.onEzChange = (event) => {
|
@@ -254,7 +254,7 @@ export class SnkExpressionItem {
|
|
254
254
|
}
|
255
255
|
render() {
|
256
256
|
var _a;
|
257
|
-
return (h(Host, null, h("div", { class: "dashes" }), h("div", { class: "box" }, h("div", { class: "box__container" }, h("div", { class: "box__container--input-filter" }, h("ez-filter-input", Object.assign({ ref: ref => this._elFilterInput = ref, 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() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || DEFAULT_FIELD_NAME}` })), 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", Object.assign({ label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), value: this.expression.operand, canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => { var _a; return this.handleChangeOperator((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, suppressEmptyOption: true }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || DEFAULT_FIELD_NAME}` }))), h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
|
257
|
+
return (h(Host, null, h("div", { class: "dashes" }), h("div", { class: "box" }, h("div", { class: "box__container" }, h("div", { class: "box__container--input-filter" }, h("ez-filter-input", Object.assign({ ref: ref => this._elFilterInput = ref, 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() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` })), 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", Object.assign({ label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), value: this.expression.operand, canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => { var _a; return this.handleChangeOperator((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, suppressEmptyOption: true }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` }))), h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
|
258
258
|
h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
|
259
259
|
this.buildFieldByType()), h("div", { class: "box__container--input-value-variable" }, !this._optionNotNull &&
|
260
260
|
h("ez-check", { ref: ref => this._elValueVariable = ref, value: this.expression.paramVariable, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
|
@@ -283,7 +283,7 @@ export class SnkExpressionItem {
|
|
283
283
|
"references": {
|
284
284
|
"IExpressionItem": {
|
285
285
|
"location": "import",
|
286
|
-
"path": "
|
286
|
+
"path": "../../interfaces/IExpressionItem"
|
287
287
|
}
|
288
288
|
}
|
289
289
|
},
|
@@ -376,7 +376,7 @@ export class SnkExpressionItem {
|
|
376
376
|
"references": {
|
377
377
|
"IExpressionItem": {
|
378
378
|
"location": "import",
|
379
|
-
"path": "
|
379
|
+
"path": "../../interfaces/IExpressionItem"
|
380
380
|
}
|
381
381
|
}
|
382
382
|
}
|
@@ -396,7 +396,7 @@ export class SnkExpressionItem {
|
|
396
396
|
"references": {
|
397
397
|
"IExpressionItem": {
|
398
398
|
"location": "import",
|
399
|
-
"path": "
|
399
|
+
"path": "../../interfaces/IExpressionItem"
|
400
400
|
}
|
401
401
|
}
|
402
402
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { h } from "@stencil/core";
|
2
2
|
import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from "@sankhyalabs/core";
|
3
3
|
import { ModalAction } from "@sankhyalabs/ezui/dist/collection/components/ez-modal-container";
|
4
|
-
import { FilterConfigType, FilterEntities, FilterUserConfigTypes } from "
|
4
|
+
import { FilterConfigType, FilterEntities, FilterUserConfigTypes } from "../../interfaces/index";
|
5
5
|
import { PersonalizedFilterUtils } from "./utils/PersonalizedFilterUtils";
|
6
6
|
export class SnkFilterParamConfig {
|
7
7
|
constructor() {
|
@@ -249,7 +249,7 @@ export class SnkFilterParamConfig {
|
|
249
249
|
},
|
250
250
|
"IExpressionItem": {
|
251
251
|
"location": "import",
|
252
|
-
"path": "
|
252
|
+
"path": "../../interfaces/IExpressionItem"
|
253
253
|
}
|
254
254
|
},
|
255
255
|
"return": "Promise<IExpressionItem>"
|
@@ -269,7 +269,7 @@ export class SnkFilterParamConfig {
|
|
269
269
|
},
|
270
270
|
"IExpressionItem": {
|
271
271
|
"location": "import",
|
272
|
-
"path": "
|
272
|
+
"path": "../../interfaces/IExpressionItem"
|
273
273
|
}
|
274
274
|
},
|
275
275
|
"return": "Promise<IExpressionItem>"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DataType, DateUtils, NumberUtils, UserInterface } from "@sankhyalabs/core";
|
2
|
-
import { FilterOperand } from "
|
2
|
+
import { FilterOperand } from "../../../interfaces/index";
|
3
3
|
import FilterItemType from "../../../../snk-filter-bar/filter-item/filter-item-type.enum";
|
4
4
|
export class PersonalizedFilterUtils {
|
5
5
|
/**
|
@@ -29,16 +29,16 @@ export class PersonalizedFilterUtils {
|
|
29
29
|
expression += ` IS ${FilterOperand[expressionItem.operand]}`;
|
30
30
|
break;
|
31
31
|
case "LIKE":
|
32
|
-
expression += ` LIKE
|
32
|
+
expression += ` LIKE '%${value}%'`;
|
33
33
|
break;
|
34
34
|
case "START_WITH":
|
35
|
-
expression += ` LIKE ${
|
35
|
+
expression += ` LIKE '${value}%'`;
|
36
36
|
break;
|
37
37
|
case "FINISHED_WITH":
|
38
|
-
expression += ` LIKE
|
38
|
+
expression += ` LIKE '%${value}'`;
|
39
39
|
break;
|
40
40
|
default:
|
41
|
-
value =
|
41
|
+
value = typeof value === 'string' ? `${commas}${value}${commas}` : value;
|
42
42
|
expression += ` ${FilterOperand[expressionItem.operand]} ${value}`;
|
43
43
|
}
|
44
44
|
return expression;
|
@@ -150,7 +150,7 @@ export class PersonalizedFilterUtils {
|
|
150
150
|
value: (value, byPassValue) => {
|
151
151
|
if (byPassValue)
|
152
152
|
return true;
|
153
|
-
return
|
153
|
+
return value != undefined;
|
154
154
|
},
|
155
155
|
operand: (value) => !!value
|
156
156
|
};
|
@@ -29,39 +29,3 @@ export var DataExporterType;
|
|
29
29
|
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
30
30
|
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
31
31
|
})(DataExporterType || (DataExporterType = {}));
|
32
|
-
export var FilterConfigType;
|
33
|
-
(function (FilterConfigType) {
|
34
|
-
FilterConfigType["SYSTEM_CONFIG"] = "S";
|
35
|
-
FilterConfigType["USER_CONFIG"] = "E";
|
36
|
-
})(FilterConfigType || (FilterConfigType = {}));
|
37
|
-
export var FilterUserConfigTypes;
|
38
|
-
(function (FilterUserConfigTypes) {
|
39
|
-
FilterUserConfigTypes["DATE"] = "D";
|
40
|
-
FilterUserConfigTypes["HORA"] = "H";
|
41
|
-
FilterUserConfigTypes["TEXT"] = "S";
|
42
|
-
FilterUserConfigTypes["INTEGER"] = "I";
|
43
|
-
FilterUserConfigTypes["DECIMAL"] = "F";
|
44
|
-
FilterUserConfigTypes["NUMBER"] = "NUMBER";
|
45
|
-
})(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
|
46
|
-
export var FilterOperand;
|
47
|
-
(function (FilterOperand) {
|
48
|
-
FilterOperand["AND"] = "AND";
|
49
|
-
FilterOperand["OR"] = "OR";
|
50
|
-
FilterOperand["IN"] = "IN";
|
51
|
-
FilterOperand["DIFFERENT"] = "<>";
|
52
|
-
FilterOperand["LIKE"] = "LIKE";
|
53
|
-
FilterOperand["START_WITH"] = "LIKE_START";
|
54
|
-
FilterOperand["FINISHED_WITH"] = "LIKE_END";
|
55
|
-
FilterOperand["NULL"] = "NULL";
|
56
|
-
FilterOperand["NOT_NULL"] = "NOT NULL";
|
57
|
-
FilterOperand["EQUAL"] = "=";
|
58
|
-
FilterOperand["LARGER"] = ">";
|
59
|
-
FilterOperand["LARGER_EQUAL"] = ">=";
|
60
|
-
FilterOperand["SMALLER"] = "<";
|
61
|
-
FilterOperand["SMALLER_EQUAL"] = "<=";
|
62
|
-
})(FilterOperand || (FilterOperand = {}));
|
63
|
-
export var FilterEntities;
|
64
|
-
(function (FilterEntities) {
|
65
|
-
FilterEntities["FIELD"] = "Campo";
|
66
|
-
FilterEntities["INSTANCE"] = "Instancia";
|
67
|
-
})(FilterEntities || (FilterEntities = {}));
|
@@ -17,7 +17,10 @@ export const snkPersonalizedFilterMessages = {
|
|
17
17
|
labelNameFilter: "Nome do filtro",
|
18
18
|
labelExpression: "Expressão SQL",
|
19
19
|
badgeVariable: "variável",
|
20
|
-
noDataFound: "Nenhum filtro encontrado"
|
20
|
+
noDataFound: "Nenhum filtro encontrado",
|
21
|
+
condition: "Condição",
|
22
|
+
addGroup: "Adicionar grupo",
|
23
|
+
applyExpression: "Expressão a ser aplicada:"
|
21
24
|
},
|
22
25
|
confirmExpression: {
|
23
26
|
title: "Aviso",
|
@@ -1,7 +1,49 @@
|
|
1
1
|
import { DataType, NumberUtils, DateUtils, UserInterface } from '@sankhyalabs/core';
|
2
|
-
import { F as FilterOperand } from './index2.js';
|
3
2
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
3
|
|
4
|
+
var FilterGroupCondition;
|
5
|
+
(function (FilterGroupCondition) {
|
6
|
+
FilterGroupCondition["AND"] = "AND";
|
7
|
+
FilterGroupCondition["OR"] = "OR";
|
8
|
+
})(FilterGroupCondition || (FilterGroupCondition = {}));
|
9
|
+
|
10
|
+
var FilterConfigType;
|
11
|
+
(function (FilterConfigType) {
|
12
|
+
FilterConfigType["SYSTEM_CONFIG"] = "S";
|
13
|
+
FilterConfigType["USER_CONFIG"] = "E";
|
14
|
+
})(FilterConfigType || (FilterConfigType = {}));
|
15
|
+
var FilterUserConfigTypes;
|
16
|
+
(function (FilterUserConfigTypes) {
|
17
|
+
FilterUserConfigTypes["DATE"] = "D";
|
18
|
+
FilterUserConfigTypes["HORA"] = "H";
|
19
|
+
FilterUserConfigTypes["TEXT"] = "S";
|
20
|
+
FilterUserConfigTypes["INTEGER"] = "I";
|
21
|
+
FilterUserConfigTypes["DECIMAL"] = "F";
|
22
|
+
FilterUserConfigTypes["NUMBER"] = "NUMBER";
|
23
|
+
})(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
|
24
|
+
var FilterOperand;
|
25
|
+
(function (FilterOperand) {
|
26
|
+
FilterOperand["AND"] = "AND";
|
27
|
+
FilterOperand["OR"] = "OR";
|
28
|
+
FilterOperand["IN"] = "IN";
|
29
|
+
FilterOperand["DIFFERENT"] = "<>";
|
30
|
+
FilterOperand["LIKE"] = "LIKE";
|
31
|
+
FilterOperand["START_WITH"] = "LIKE_START";
|
32
|
+
FilterOperand["FINISHED_WITH"] = "LIKE_END";
|
33
|
+
FilterOperand["NULL"] = "NULL";
|
34
|
+
FilterOperand["NOT_NULL"] = "NOT NULL";
|
35
|
+
FilterOperand["EQUAL"] = "=";
|
36
|
+
FilterOperand["LARGER"] = ">";
|
37
|
+
FilterOperand["LARGER_EQUAL"] = ">=";
|
38
|
+
FilterOperand["SMALLER"] = "<";
|
39
|
+
FilterOperand["SMALLER_EQUAL"] = "<=";
|
40
|
+
})(FilterOperand || (FilterOperand = {}));
|
41
|
+
var FilterEntities;
|
42
|
+
(function (FilterEntities) {
|
43
|
+
FilterEntities["FIELD"] = "Campo";
|
44
|
+
FilterEntities["INSTANCE"] = "Instancia";
|
45
|
+
})(FilterEntities || (FilterEntities = {}));
|
46
|
+
|
5
47
|
class PersonalizedFilterUtils {
|
6
48
|
/**
|
7
49
|
* Cria uma expressão de filtro a partir de um IExpressionItem.
|
@@ -30,16 +72,16 @@ class PersonalizedFilterUtils {
|
|
30
72
|
expression += ` IS ${FilterOperand[expressionItem.operand]}`;
|
31
73
|
break;
|
32
74
|
case "LIKE":
|
33
|
-
expression += ` LIKE
|
75
|
+
expression += ` LIKE '%${value}%'`;
|
34
76
|
break;
|
35
77
|
case "START_WITH":
|
36
|
-
expression += ` LIKE ${
|
78
|
+
expression += ` LIKE '${value}%'`;
|
37
79
|
break;
|
38
80
|
case "FINISHED_WITH":
|
39
|
-
expression += ` LIKE
|
81
|
+
expression += ` LIKE '%${value}'`;
|
40
82
|
break;
|
41
83
|
default:
|
42
|
-
value =
|
84
|
+
value = typeof value === 'string' ? `${commas}${value}${commas}` : value;
|
43
85
|
expression += ` ${FilterOperand[expressionItem.operand]} ${value}`;
|
44
86
|
}
|
45
87
|
return expression;
|
@@ -151,7 +193,7 @@ class PersonalizedFilterUtils {
|
|
151
193
|
value: (value, byPassValue) => {
|
152
194
|
if (byPassValue)
|
153
195
|
return true;
|
154
|
-
return
|
196
|
+
return value != undefined;
|
155
197
|
},
|
156
198
|
operand: (value) => !!value
|
157
199
|
};
|
@@ -224,4 +266,4 @@ class PersonalizedFilterUtils {
|
|
224
266
|
}
|
225
267
|
}
|
226
268
|
|
227
|
-
export { PersonalizedFilterUtils as P };
|
269
|
+
export { FilterGroupCondition as F, PersonalizedFilterUtils as P, FilterOperand as a, FilterConfigType as b, FilterEntities as c, FilterUserConfigTypes as d };
|
@@ -361,7 +361,10 @@ const snkPersonalizedFilterMessages = {
|
|
361
361
|
labelNameFilter: "Nome do filtro",
|
362
362
|
labelExpression: "Expressão SQL",
|
363
363
|
badgeVariable: "variável",
|
364
|
-
noDataFound: "Nenhum filtro encontrado"
|
364
|
+
noDataFound: "Nenhum filtro encontrado",
|
365
|
+
condition: "Condição",
|
366
|
+
addGroup: "Adicionar grupo",
|
367
|
+
applyExpression: "Expressão a ser aplicada:"
|
365
368
|
},
|
366
369
|
confirmExpression: {
|
367
370
|
title: "Aviso",
|
@@ -27,7 +27,6 @@ export { SnkFilterMultiSelect as SnkFilterMultiSelect } from '../types/component
|
|
27
27
|
export { SnkFilterPeriod as SnkFilterNumber } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-number';
|
28
28
|
export { SnkFilterParamConfig as SnkFilterParamConfig } from '../types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config';
|
29
29
|
export { SnkFilterPeriod as SnkFilterPeriod } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-period';
|
30
|
-
export { SnkFilterPersonalized as SnkFilterPersonalized } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized';
|
31
30
|
export { SnkFilterSearch as SnkFilterSearch } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-search';
|
32
31
|
export { SnkFilterText as SnkFilterText } from '../types/components/snk-filter-bar/filter-item/editors/snk-filter-text';
|
33
32
|
export { SnkForm as SnkForm } from '../types/components/snk-form/snk-form';
|
@@ -38,6 +37,7 @@ export { SnkGrid as SnkGrid } from '../types/components/snk-grid/snk-grid';
|
|
38
37
|
export { SnkGridConfig as SnkGridConfig } from '../types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config';
|
39
38
|
export { SnkGuidesViewer as SnkGuidesViewer } from '../types/components/snk-crud/subcomponents/snk-guides-viewer';
|
40
39
|
export { SnkPersonalizedFilter as SnkPersonalizedFilter } from '../types/components/snk-personalized-filter/snk-personalized-filter';
|
40
|
+
export { SnkFilterPersonalized as SnkPersonalizedFilterEditor } from '../types/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor';
|
41
41
|
export { SnkPesquisa as SnkPesquisa } from '../types/components/snk-pesquisa/snk-pesquisa';
|
42
42
|
export { SelectBox as SnkSelectBox } from '../types/components/snk-grid/subcomponents/snk-select-box/snk-select-box';
|
43
43
|
export { SnkSimpleBar as SnkSimpleBar } from '../types/components/snk-simple-bar/snk-simple-bar';
|
package/dist/components/index.js
CHANGED
@@ -27,7 +27,6 @@ export { SnkFilterMultiSelect, defineCustomElement as defineCustomElementSnkFilt
|
|
27
27
|
export { SnkFilterNumber, defineCustomElement as defineCustomElementSnkFilterNumber } from './snk-filter-number.js';
|
28
28
|
export { SnkFilterParamConfig, defineCustomElement as defineCustomElementSnkFilterParamConfig } from './snk-filter-param-config.js';
|
29
29
|
export { SnkFilterPeriod, defineCustomElement as defineCustomElementSnkFilterPeriod } from './snk-filter-period.js';
|
30
|
-
export { SnkFilterPersonalized, defineCustomElement as defineCustomElementSnkFilterPersonalized } from './snk-filter-personalized.js';
|
31
30
|
export { SnkFilterSearch, defineCustomElement as defineCustomElementSnkFilterSearch } from './snk-filter-search.js';
|
32
31
|
export { SnkFilterText, defineCustomElement as defineCustomElementSnkFilterText } from './snk-filter-text.js';
|
33
32
|
export { SnkForm, defineCustomElement as defineCustomElementSnkForm } from './snk-form.js';
|
@@ -38,6 +37,7 @@ export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './sn
|
|
38
37
|
export { SnkGridConfig, defineCustomElement as defineCustomElementSnkGridConfig } from './snk-grid-config.js';
|
39
38
|
export { SnkGuidesViewer, defineCustomElement as defineCustomElementSnkGuidesViewer } from './snk-guides-viewer.js';
|
40
39
|
export { SnkPersonalizedFilter, defineCustomElement as defineCustomElementSnkPersonalizedFilter } from './snk-personalized-filter.js';
|
40
|
+
export { SnkPersonalizedFilterEditor, defineCustomElement as defineCustomElementSnkPersonalizedFilterEditor } from './snk-personalized-filter-editor.js';
|
41
41
|
export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
|
42
42
|
export { SnkSelectBox, defineCustomElement as defineCustomElementSnkSelectBox } from './snk-select-box.js';
|
43
43
|
export { SnkSimpleBar, defineCustomElement as defineCustomElementSnkSimpleBar } from './snk-simple-bar.js';
|
@@ -29,41 +29,5 @@ var DataExporterType;
|
|
29
29
|
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
30
30
|
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
31
31
|
})(DataExporterType || (DataExporterType = {}));
|
32
|
-
var FilterConfigType;
|
33
|
-
(function (FilterConfigType) {
|
34
|
-
FilterConfigType["SYSTEM_CONFIG"] = "S";
|
35
|
-
FilterConfigType["USER_CONFIG"] = "E";
|
36
|
-
})(FilterConfigType || (FilterConfigType = {}));
|
37
|
-
var FilterUserConfigTypes;
|
38
|
-
(function (FilterUserConfigTypes) {
|
39
|
-
FilterUserConfigTypes["DATE"] = "D";
|
40
|
-
FilterUserConfigTypes["HORA"] = "H";
|
41
|
-
FilterUserConfigTypes["TEXT"] = "S";
|
42
|
-
FilterUserConfigTypes["INTEGER"] = "I";
|
43
|
-
FilterUserConfigTypes["DECIMAL"] = "F";
|
44
|
-
FilterUserConfigTypes["NUMBER"] = "NUMBER";
|
45
|
-
})(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
|
46
|
-
var FilterOperand;
|
47
|
-
(function (FilterOperand) {
|
48
|
-
FilterOperand["AND"] = "AND";
|
49
|
-
FilterOperand["OR"] = "OR";
|
50
|
-
FilterOperand["IN"] = "IN";
|
51
|
-
FilterOperand["DIFFERENT"] = "<>";
|
52
|
-
FilterOperand["LIKE"] = "LIKE";
|
53
|
-
FilterOperand["START_WITH"] = "LIKE_START";
|
54
|
-
FilterOperand["FINISHED_WITH"] = "LIKE_END";
|
55
|
-
FilterOperand["NULL"] = "NULL";
|
56
|
-
FilterOperand["NOT_NULL"] = "NOT NULL";
|
57
|
-
FilterOperand["EQUAL"] = "=";
|
58
|
-
FilterOperand["LARGER"] = ">";
|
59
|
-
FilterOperand["LARGER_EQUAL"] = ">=";
|
60
|
-
FilterOperand["SMALLER"] = "<";
|
61
|
-
FilterOperand["SMALLER_EQUAL"] = "<=";
|
62
|
-
})(FilterOperand || (FilterOperand = {}));
|
63
|
-
var FilterEntities;
|
64
|
-
(function (FilterEntities) {
|
65
|
-
FilterEntities["FIELD"] = "Campo";
|
66
|
-
FilterEntities["INSTANCE"] = "Instancia";
|
67
|
-
})(FilterEntities || (FilterEntities = {}));
|
68
32
|
|
69
|
-
export { DataExporterOption as D,
|
33
|
+
export { DataExporterOption as D, PresentationMode as P, DataExporterFormat as a, DataExporterType as b };
|