@sankhyalabs/sankhyablocks 6.4.2 → 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 +4 -3
- 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 +4 -3
- 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-crud/snk-crud.js +22 -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-grid/snk-grid.js +22 -1
- 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-crud.js +3 -1
- 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-grid2.js +3 -1
- 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 +4 -3
- 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 +4 -3
- 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-7c10486f.entry.js +1 -0
- 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-7f37b801.entry.js +1 -0
- 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-crud/snk-crud.d.ts +5 -0
- 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-grid/snk-grid.d.ts +5 -0
- 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 +79 -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 +2 -2
- 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-19ae873b.entry.js +0 -1
- package/dist/sankhyablocks/p-257e3eaf.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
@@ -9,7 +9,7 @@ const presentationMode = require('./presentationMode-52ec3bdd.js');
|
|
9
9
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
10
10
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
11
11
|
|
12
|
-
const
|
12
|
+
const snkPersonalizedFilterEditorCss = ".sc-snk-personalized-filter-editor-h{--snk-filter-personalized__max-height:21;--snk-filter-personalized__max-width:21.5}.SnkFilterPersonalized_list-container.sc-snk-personalized-filter-editor{margin:0;padding:0;list-style:none;display:flex;flex-direction:column}.SnkFilterPersonalized_list-container-chip.sc-snk-personalized-filter-editor{width:400px}.SnkFilterPersonalized_list-scroller.sc-snk-personalized-filter-editor{display:block;max-height:calc(var(--space--2xl) * var(--snk-filter-personalized__max-height));cursor:auto;--ez-scroller__max-height:300px}.SnkFilterPersonalized_checkbox.sc-snk-personalized-filter-editor{display:grid;grid-template-columns:auto auto;justify-content:start}.SnkFilterPersonalized_list-container.sc-snk-personalized-filter-editor:has(.SnkFilterPersonalized_list-item--chip){gap:var(--space--small, 6px);max-width:calc(var(--space--md) * var(--snk-filter-personalized__max-width))}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor{display:flex;border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor:hover{background-color:var(--background--medium, #f0f3f7)}.SnkFilterPersonalized_list-actions.sc-snk-personalized-filter-editor{display:none;align-items:center}.SnkFilterPersonalized_list-item--modal.sc-snk-personalized-filter-editor:hover .SnkFilterPersonalized_list-actions.sc-snk-personalized-filter-editor{display:flex}.SnkFilterPersonalized_list-item--chip.sc-snk-personalized-filter-editor{display:flex;flex-direction:column;border:var(--border--small, 1px solid) var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-regular)}.SnkFilterPersonalized_list-item--chip.sc-snk-personalized-filter-editor .sc-snk-personalized-filter-editor:first-of-type{gap:var(--space--3xs)}";
|
13
13
|
|
14
14
|
const SnkFilterPersonalized = class {
|
15
15
|
constructor(hostRef) {
|
@@ -53,10 +53,15 @@ const SnkFilterPersonalized = class {
|
|
53
53
|
var _a, _b;
|
54
54
|
const CheckboxElement = () => (index.h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, compact: true, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
|
55
55
|
const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
|
56
|
-
return (index.h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, index.h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, index.h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, index.h(CheckboxElement, null), this.
|
56
|
+
return (index.h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, index.h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, index.h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, index.h(CheckboxElement, null), this.buildModalListActions(item, isVariable))), (item.visible && isVariable) && (index.h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
|
57
|
+
}
|
58
|
+
buildModalListActions(item, isVariable) {
|
59
|
+
if (!this.isModalMode())
|
60
|
+
return;
|
61
|
+
return (this.isModalMode() ?
|
57
62
|
index.h("div", { class: "SnkFilterPersonalized_list-actions" }, index.h("ez-button", { size: "small", mode: "icon", iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), index.h("ez-button", { size: "small", mode: "icon", iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
|
58
63
|
:
|
59
|
-
isVariable && (index.h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))))
|
64
|
+
isVariable && (index.h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))));
|
60
65
|
}
|
61
66
|
isModalMode() {
|
62
67
|
return this.presentationMode === presentationMode.EPresentationMode.MODAL;
|
@@ -123,7 +128,7 @@ const SnkFilterPersonalized = class {
|
|
123
128
|
});
|
124
129
|
this.emitChange();
|
125
130
|
}
|
126
|
-
|
131
|
+
handleSearchFilterList({ detail: query = "" }) {
|
127
132
|
this.items = query ? this.originalItems.filter(item => item.label.toLowerCase().includes(query.toLowerCase())) : this.originalItems;
|
128
133
|
}
|
129
134
|
handleFilterItemChange(value, formProp) {
|
@@ -156,11 +161,11 @@ const SnkFilterPersonalized = class {
|
|
156
161
|
}
|
157
162
|
handleDeleteFilter(item) {
|
158
163
|
this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.deleteConfirm.message', { filterName: item.label })).then((actionConfirmed) => {
|
159
|
-
if (actionConfirmed)
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
+
if (!actionConfirmed)
|
165
|
+
return;
|
166
|
+
this.deleteFilter.emit(item);
|
167
|
+
this.items = this.originalItems = this.originalItems.filter(originalItem => originalItem.id !== item.id);
|
168
|
+
this.emitChange();
|
164
169
|
});
|
165
170
|
}
|
166
171
|
componentDidLoad() {
|
@@ -172,16 +177,34 @@ const SnkFilterPersonalized = class {
|
|
172
177
|
this._application = core.ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
173
178
|
this.items = this.originalItems = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.groupedItems) || [];
|
174
179
|
}
|
180
|
+
buildModeModalHeader() {
|
181
|
+
if (this.presentationMode !== presentationMode.EPresentationMode.MODAL)
|
182
|
+
return;
|
183
|
+
return (index.h("div", { class: "ez-margin-bottom--medium" }, index.h(index.Fragment, null, index.h("ez-filter-input", Object.assign({ label: this.config.label, onEzChange: this.handleSearchFilterList.bind(this) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("filterSearch")}` })), index.h("span", { class: "ez-text ez-title--small ez-title--primary" }, " ", this.config.detailTitle, " "))));
|
184
|
+
}
|
185
|
+
buildModeModalFooter() {
|
186
|
+
if (this.presentationMode !== presentationMode.EPresentationMode.MODAL)
|
187
|
+
return;
|
188
|
+
return (index.h("div", { class: "ez-flex ez-flex--justify-end grow ez-margin-top--medium" }, index.h("ez-button", { class: "ez-button--tertiary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.clear'), onClick: this.handleClearFilters.bind(this) }), index.h("ez-button", { class: "ez-button--secondary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.create'), onClick: () => this.addFilter.emit() })));
|
189
|
+
}
|
190
|
+
buildContainerFiltersCreated() {
|
191
|
+
if (this.items.length) {
|
192
|
+
return (index.h("ez-scroller", { class: "SnkFilterPersonalized_list-scroller", direction: EzScrollDirection.EzScrollDirection.VERTICAL }, index.h("ul", { class: `SnkFilterPersonalized_list-container ${!this.isModalMode() ? "SnkFilterPersonalized_list-container-chip" : ""}` }, this.items.map((itemConfig) => this.getItemContent(itemConfig)))));
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
return (index.h("div", { class: "ez-margin--auto" }, index.h("span", { class: "ez-text ez-text--secondary ez-text--small" }, this.getMessage('snkPersonalizedFilter.info.noDataFound'))));
|
196
|
+
}
|
197
|
+
}
|
175
198
|
render() {
|
176
199
|
if (!this.config || this.config.type !== filterItemType_enum.FilterItemType.PERSONALIZED)
|
177
200
|
return undefined;
|
178
|
-
return (index.h(index.Host, null,
|
201
|
+
return (index.h(index.Host, null, this.buildModeModalHeader(), this.buildContainerFiltersCreated(), this.buildModeModalFooter()));
|
179
202
|
}
|
180
203
|
get _element() { return index.getElement(this); }
|
181
204
|
static get watchers() { return {
|
182
205
|
"config": ["configWatcher"]
|
183
206
|
}; }
|
184
207
|
};
|
185
|
-
SnkFilterPersonalized.style =
|
208
|
+
SnkFilterPersonalized.style = snkPersonalizedFilterEditorCss;
|
186
209
|
|
187
|
-
exports.
|
210
|
+
exports.snk_personalized_filter_editor = SnkFilterPersonalized;
|
@@ -4,12 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-
|
7
|
+
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
|
8
8
|
const ConfigStorage = require('./ConfigStorage-0a738cdc.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
|
-
const IExpressionItem = require('./IExpressionItem-
|
10
|
+
const IExpressionItem = require('./IExpressionItem-0e32ebb7.js');
|
11
11
|
const index$1 = require('./index-102ba62d.js');
|
12
|
-
require('./index-614af008.js');
|
13
12
|
require('./filter-item-type.enum-aa823a00.js');
|
14
13
|
require('./form-config-fetcher-92bc8fe7.js');
|
15
14
|
require('./DataFetcher-a9d0228f.js');
|
@@ -25,13 +24,18 @@ const SnkPersonalizedFilter = class {
|
|
25
24
|
this.ezCancel = index.createEvent(this, "ezCancel", 7);
|
26
25
|
this.ezSave = index.createEvent(this, "ezSave", 7);
|
27
26
|
this._personalizedFilterFetcher = new ConfigStorage.PersonalizedFilterFetcher();
|
27
|
+
this._filterMetadataStorage = new Map();
|
28
28
|
this._dataSourceFetcher = {
|
29
29
|
fetchData: async (entity) => {
|
30
30
|
let entityURI = entity === null || entity === void 0 ? void 0 : entity.uri;
|
31
31
|
if (core.StringUtils.isEmpty(entityURI)) {
|
32
32
|
entityURI = this.entityUri;
|
33
33
|
}
|
34
|
-
|
34
|
+
if (!this._filterMetadataStorage.has(entityURI)) {
|
35
|
+
const filterMetadata = await this._personalizedFilterFetcher.loadFields(entityURI);
|
36
|
+
this._filterMetadataStorage.set(entityURI, filterMetadata);
|
37
|
+
}
|
38
|
+
return this._filterMetadataStorage.get(entityURI);
|
35
39
|
}
|
36
40
|
};
|
37
41
|
this._filterAssistentMode = true;
|
@@ -144,11 +148,11 @@ const SnkPersonalizedFilter = class {
|
|
144
148
|
utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"), this.getMessage("snkPersonalizedFilter.confirmCancel.description"))
|
145
149
|
.then((canCancel) => {
|
146
150
|
var _a;
|
147
|
-
if (canCancel)
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
151
|
+
if (!canCancel)
|
152
|
+
return;
|
153
|
+
this._filterAssistent = core.ObjectUtils.copy((_a = this._originalFilterAssistent) !== null && _a !== void 0 ? _a : {});
|
154
|
+
this.ezCancel.emit();
|
155
|
+
this._elButtonSave.enabled = false;
|
152
156
|
});
|
153
157
|
}
|
154
158
|
handleTitleChange(name) {
|
@@ -181,14 +185,21 @@ const SnkPersonalizedFilter = class {
|
|
181
185
|
}
|
182
186
|
return (index.h("div", { class: "ez-flex" }, index.h("ez-alert", { alertType: "warn" }, this._filterAssistent.warningMessage)));
|
183
187
|
}
|
188
|
+
buildContainerPersonalizedFilter() {
|
189
|
+
var _a, _b, _c;
|
190
|
+
if (this._filterAssistentMode) {
|
191
|
+
return (index.h(index.Fragment, null, index.h("div", { class: "ez-padding-top--small snk-personalized-filter__group" }, index.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 })), index.h("div", null, index.h("div", { class: "snk-personalized-filter__expression-input--line" }), index.h("ez-collapsible-box", { label: this.getMessage("snkPersonalizedFilter.info.titleCollapsible"), headerSize: "medium", value: true }, index.h("div", { class: "ez-box" }, index.h("div", { class: "ez-box__container" }, index.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 })))))));
|
192
|
+
}
|
193
|
+
else {
|
194
|
+
return (index.h(index.Fragment, null, index.h("span", { class: "ez-text ez-text--small ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkPersonalizedFilter.info.applyExpression")), index.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()));
|
195
|
+
}
|
196
|
+
}
|
184
197
|
render() {
|
185
|
-
var _a, _b
|
198
|
+
var _a, _b;
|
186
199
|
if (!((_a = this._filterAssistent) === null || _a === void 0 ? void 0 : _a.assistent) && this._filterAssistentMode) {
|
187
200
|
return;
|
188
201
|
}
|
189
|
-
return (index.h(index.Host, null, index.h("div", { class: "snk-personalized-filter" }, index.h("div", null, index.h("snk-simple-bar", { label: this.filterId ? this.getMessage("snkPersonalizedFilter.info.titleEdit") : this.getMessage("snkPersonalizedFilter.info.titleAdd"), onExit: () => this.handleCancel() }, index.h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, index.h("ez-button", { size: "small", label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), index.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) })))), index.h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, index.h("div", { class: "ez-box__container" }, index.h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, index.h("div", { class: "ez-flex" }, index.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.
|
190
|
-
index.h(index.Fragment, null, index.h("div", { class: "ez-padding-top--small snk-personalized-filter__group" }, index.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 })), index.h("div", null, index.h("div", { class: "snk-personalized-filter__expression-input--line" }), index.h("ez-collapsible-box", { label: this.getMessage("snkPersonalizedFilter.info.titleCollapsible"), headerSize: "medium", value: true }, index.h("div", { class: "ez-box" }, index.h("div", { class: "ez-box__container" }, index.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 })))))) :
|
191
|
-
index.h(index.Fragment, null, index.h("span", { class: "ez-text ez-text--small ez-text--bold ez-padding-bottom--medium" }, "Express\u00E3o a ser aplicada:"), index.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())))))));
|
202
|
+
return (index.h(index.Host, null, index.h("div", { class: "snk-personalized-filter" }, index.h("div", null, index.h("snk-simple-bar", { label: this.filterId ? this.getMessage("snkPersonalizedFilter.info.titleEdit") : this.getMessage("snkPersonalizedFilter.info.titleAdd"), onExit: () => this.handleCancel() }, index.h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, index.h("ez-button", { size: "small", label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), index.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) })))), index.h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, index.h("div", { class: "ez-box__container" }, index.h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, index.h("div", { class: "ez-flex" }, index.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()))))));
|
192
203
|
}
|
193
204
|
static get watchers() { return {
|
194
205
|
"filterId": ["loadFilter"]
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const constants = require('./constants-d187e03e.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
9
|
require('./DataFetcher-a9d0228f.js');
|
10
10
|
require('./pesquisa-fetcher-954b74c3.js');
|
11
|
-
const index$1 = require('./index-
|
11
|
+
const index$1 = require('./index-0e663819.js');
|
12
12
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
13
13
|
require('./index-102ba62d.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
9
|
-
const index$1 = require('./index-
|
8
|
+
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
|
+
const index$1 = require('./index-0e663819.js');
|
10
10
|
require('./index-102ba62d.js');
|
11
11
|
|
12
12
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
@@ -19,8 +19,8 @@
|
|
19
19
|
"./components/snk-data-exporter/snk-data-exporter.js",
|
20
20
|
"./components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js",
|
21
21
|
"./components/snk-entity-list/snk-entity-list.js",
|
22
|
-
"./components/snk-filter-bar/filter-item/editors/snk-filter-personalized/snk-filter-personalized.js",
|
23
22
|
"./components/snk-filter-bar/snk-filter-bar.js",
|
23
|
+
"./components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js",
|
24
24
|
"./components/snk-filter-bar/filter-item/snk-filter-detail.js",
|
25
25
|
"./components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js",
|
26
26
|
"./components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js",
|
@@ -16,6 +16,7 @@ export class SnkCrud {
|
|
16
16
|
this.attachmentRegisterKey = undefined;
|
17
17
|
this._currentViewMode = VIEW_MODE.GRID;
|
18
18
|
this.configName = undefined;
|
19
|
+
this.selectionToastConfig = undefined;
|
19
20
|
this.showActionButtons = false;
|
20
21
|
this.actionsList = undefined;
|
21
22
|
this.taskbarManager = undefined;
|
@@ -153,7 +154,7 @@ export class SnkCrud {
|
|
153
154
|
this.configuratorCancel.emit();
|
154
155
|
}
|
155
156
|
render() {
|
156
|
-
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form" }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
157
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form" }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
157
158
|
}
|
158
159
|
static get is() { return "snk-crud"; }
|
159
160
|
static get encapsulation() { return "scoped"; }
|
@@ -186,6 +187,26 @@ export class SnkCrud {
|
|
186
187
|
"attribute": "config-name",
|
187
188
|
"reflect": false
|
188
189
|
},
|
190
|
+
"selectionToastConfig": {
|
191
|
+
"type": "unknown",
|
192
|
+
"mutable": false,
|
193
|
+
"complexType": {
|
194
|
+
"original": "ISelectionToastConfig",
|
195
|
+
"resolved": "ISelectionToastConfig",
|
196
|
+
"references": {
|
197
|
+
"ISelectionToastConfig": {
|
198
|
+
"location": "import",
|
199
|
+
"path": "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces"
|
200
|
+
}
|
201
|
+
}
|
202
|
+
},
|
203
|
+
"required": false,
|
204
|
+
"optional": false,
|
205
|
+
"docs": {
|
206
|
+
"tags": [],
|
207
|
+
"text": "Configura\u00E7\u00E3o da sele\u00E7\u00E3o de grade no toast."
|
208
|
+
}
|
209
|
+
},
|
189
210
|
"showActionButtons": {
|
190
211
|
"type": "boolean",
|
191
212
|
"mutable": false,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { DataType } from "@sankhyalabs/core";
|
2
2
|
import { toString } from "@sankhyalabs/core/dist/dataunit/metadata/DataType";
|
3
3
|
import FilterItemType from "../filter-item-type.enum";
|
4
|
-
import { FilterOperand } from "
|
4
|
+
import { FilterOperand } from "../../../snk-personalized-filter/interfaces/index";
|
5
5
|
const buildFilter = (item) => {
|
6
6
|
switch (item.type) {
|
7
7
|
case FilterItemType.DEFAULT_FILTER:
|
@@ -41,10 +41,15 @@ export class SnkFilterPersonalized {
|
|
41
41
|
var _a, _b;
|
42
42
|
const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, compact: true, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
|
43
43
|
const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
|
44
|
-
return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, h(CheckboxElement, null), this.
|
44
|
+
return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, h(CheckboxElement, null), this.buildModalListActions(item, isVariable))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
|
45
|
+
}
|
46
|
+
buildModalListActions(item, isVariable) {
|
47
|
+
if (!this.isModalMode())
|
48
|
+
return;
|
49
|
+
return (this.isModalMode() ?
|
45
50
|
h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-button", { size: "small", mode: "icon", iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), h("ez-button", { size: "small", mode: "icon", iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
|
46
51
|
:
|
47
|
-
isVariable && (h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))))
|
52
|
+
isVariable && (h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))));
|
48
53
|
}
|
49
54
|
isModalMode() {
|
50
55
|
return this.presentationMode === EPresentationMode.MODAL;
|
@@ -111,7 +116,7 @@ export class SnkFilterPersonalized {
|
|
111
116
|
});
|
112
117
|
this.emitChange();
|
113
118
|
}
|
114
|
-
|
119
|
+
handleSearchFilterList({ detail: query = "" }) {
|
115
120
|
this.items = query ? this.originalItems.filter(item => item.label.toLowerCase().includes(query.toLowerCase())) : this.originalItems;
|
116
121
|
}
|
117
122
|
handleFilterItemChange(value, formProp) {
|
@@ -144,11 +149,11 @@ export class SnkFilterPersonalized {
|
|
144
149
|
}
|
145
150
|
handleDeleteFilter(item) {
|
146
151
|
this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.deleteConfirm.message', { filterName: item.label })).then((actionConfirmed) => {
|
147
|
-
if (actionConfirmed)
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
+
if (!actionConfirmed)
|
153
|
+
return;
|
154
|
+
this.deleteFilter.emit(item);
|
155
|
+
this.items = this.originalItems = this.originalItems.filter(originalItem => originalItem.id !== item.id);
|
156
|
+
this.emitChange();
|
152
157
|
});
|
153
158
|
}
|
154
159
|
componentDidLoad() {
|
@@ -160,21 +165,39 @@ export class SnkFilterPersonalized {
|
|
160
165
|
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
161
166
|
this.items = this.originalItems = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.groupedItems) || [];
|
162
167
|
}
|
168
|
+
buildModeModalHeader() {
|
169
|
+
if (this.presentationMode !== EPresentationMode.MODAL)
|
170
|
+
return;
|
171
|
+
return (h("div", { class: "ez-margin-bottom--medium" }, h(Fragment, null, h("ez-filter-input", Object.assign({ label: this.config.label, onEzChange: this.handleSearchFilterList.bind(this) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("filterSearch")}` })), h("span", { class: "ez-text ez-title--small ez-title--primary" }, " ", this.config.detailTitle, " "))));
|
172
|
+
}
|
173
|
+
buildModeModalFooter() {
|
174
|
+
if (this.presentationMode !== EPresentationMode.MODAL)
|
175
|
+
return;
|
176
|
+
return (h("div", { class: "ez-flex ez-flex--justify-end grow ez-margin-top--medium" }, h("ez-button", { class: "ez-button--tertiary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.clear'), onClick: this.handleClearFilters.bind(this) }), h("ez-button", { class: "ez-button--secondary", size: "medium", label: this.getMessage('snkPersonalizedFilter.footerActions.create'), onClick: () => this.addFilter.emit() })));
|
177
|
+
}
|
178
|
+
buildContainerFiltersCreated() {
|
179
|
+
if (this.items.length) {
|
180
|
+
return (h("ez-scroller", { class: "SnkFilterPersonalized_list-scroller", direction: EzScrollDirection.VERTICAL }, h("ul", { class: `SnkFilterPersonalized_list-container ${!this.isModalMode() ? "SnkFilterPersonalized_list-container-chip" : ""}` }, this.items.map((itemConfig) => this.getItemContent(itemConfig)))));
|
181
|
+
}
|
182
|
+
else {
|
183
|
+
return (h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--small" }, this.getMessage('snkPersonalizedFilter.info.noDataFound'))));
|
184
|
+
}
|
185
|
+
}
|
163
186
|
render() {
|
164
187
|
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED)
|
165
188
|
return undefined;
|
166
|
-
return (h(Host, null,
|
189
|
+
return (h(Host, null, this.buildModeModalHeader(), this.buildContainerFiltersCreated(), this.buildModeModalFooter()));
|
167
190
|
}
|
168
|
-
static get is() { return "snk-filter-
|
191
|
+
static get is() { return "snk-personalized-filter-editor"; }
|
169
192
|
static get encapsulation() { return "scoped"; }
|
170
193
|
static get originalStyleUrls() {
|
171
194
|
return {
|
172
|
-
"$": ["snk-filter-
|
195
|
+
"$": ["snk-personalized-filter-editor.css"]
|
173
196
|
};
|
174
197
|
}
|
175
198
|
static get styleUrls() {
|
176
199
|
return {
|
177
|
-
"$": ["snk-filter-
|
200
|
+
"$": ["snk-personalized-filter-editor.css"]
|
178
201
|
};
|
179
202
|
}
|
180
203
|
static get properties() {
|
@@ -292,7 +315,7 @@ export class SnkFilterPersonalized {
|
|
292
315
|
"references": {
|
293
316
|
"IPersonalizedFilter": {
|
294
317
|
"location": "import",
|
295
|
-
"path": "../../../../snk-personalized-filter/
|
318
|
+
"path": "../../../../snk-personalized-filter/interfaces/IPersonalizedFilter"
|
296
319
|
}
|
297
320
|
}
|
298
321
|
}
|
@@ -47,12 +47,9 @@ export class SnkFilterDetail {
|
|
47
47
|
return { tag: "snk-filter-number" };
|
48
48
|
case FilterItemType.PERSONALIZED:
|
49
49
|
const snkFilterPersonalizedProps = {
|
50
|
-
tag: "snk-filter-
|
50
|
+
tag: "snk-personalized-filter-editor", props: {
|
51
51
|
presentationMode: EPresentationMode.CHIP,
|
52
|
-
onValueChanged:
|
53
|
-
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
54
|
-
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
55
|
-
}
|
52
|
+
onValueChanged: evt => this.handleValueChanged(evt),
|
56
53
|
}
|
57
54
|
};
|
58
55
|
return snkFilterPersonalizedProps;
|
@@ -61,6 +58,10 @@ export class SnkFilterDetail {
|
|
61
58
|
}
|
62
59
|
return { tag: "snk-filter-text" };
|
63
60
|
}
|
61
|
+
handleValueChanged({ detail }) {
|
62
|
+
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
63
|
+
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
64
|
+
}
|
64
65
|
removeItem() {
|
65
66
|
const hasMultiValues = this.config.type === FilterItemType.MULTI_LIST && Array.isArray(this.config.value);
|
66
67
|
const newValue = hasMultiValues ? this.config.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
|
@@ -70,6 +71,9 @@ export class SnkFilterDetail {
|
|
70
71
|
}
|
71
72
|
this.changeConfig(removedConfig);
|
72
73
|
}
|
74
|
+
removeItemFromGroup(item) {
|
75
|
+
return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
|
76
|
+
}
|
73
77
|
getPopUpHeaderButtons() {
|
74
78
|
return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
|
75
79
|
}
|
@@ -177,11 +177,7 @@ export class SnkFilterItem {
|
|
177
177
|
return `${label}: ${value.value} - ${value.label}`;
|
178
178
|
}
|
179
179
|
if (type === FilterItemType.PERSONALIZED) {
|
180
|
-
const activeCount =
|
181
|
-
if (!!item.visible)
|
182
|
-
return total + 1;
|
183
|
-
return total;
|
184
|
-
}, 0);
|
180
|
+
const activeCount = this.calculateActiveCount(groupedItems);
|
185
181
|
if (activeCount <= 0)
|
186
182
|
return label;
|
187
183
|
return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
|
@@ -205,6 +201,13 @@ export class SnkFilterItem {
|
|
205
201
|
}
|
206
202
|
return label;
|
207
203
|
}
|
204
|
+
calculateActiveCount(groupedItems) {
|
205
|
+
return groupedItems.reduce((total, item) => {
|
206
|
+
if (!!item.visible)
|
207
|
+
return total + 1;
|
208
|
+
return total;
|
209
|
+
}, 0);
|
210
|
+
}
|
208
211
|
applyTooltip() {
|
209
212
|
if (!this.config.value)
|
210
213
|
return undefined;
|
@@ -253,13 +256,19 @@ export class SnkFilterItem {
|
|
253
256
|
}
|
254
257
|
return undefined;
|
255
258
|
}
|
259
|
+
hasActiveElements(value) {
|
260
|
+
var _a, _b, _c;
|
261
|
+
return ((_c = (_b = ((_a = value === null || value === void 0 ? void 0 : value.elements) !== null && _a !== void 0 ? _a : value)) === null || _b === void 0 ? void 0 : _b.filter(val => val === null || val === void 0 ? void 0 : val.check)) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
262
|
+
}
|
263
|
+
hasActiveValue(config) {
|
264
|
+
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
265
|
+
}
|
256
266
|
getEnabledChip() {
|
257
|
-
var _a, _b, _c, _d;
|
258
267
|
if (this.config.type === FilterItemType.PERSONALIZED) {
|
259
268
|
const { groupedItems = [] } = this.config;
|
260
269
|
return groupedItems.some(item => item.visible);
|
261
270
|
}
|
262
|
-
return
|
271
|
+
return this.hasActiveValue(this.config);
|
263
272
|
}
|
264
273
|
render() {
|
265
274
|
const leftIcon = this.getLeftIconName();
|
@@ -66,7 +66,7 @@ export class SnkFilterModal {
|
|
66
66
|
});
|
67
67
|
}
|
68
68
|
handleClose() {
|
69
|
-
const hasChangesToSave =
|
69
|
+
const hasChangesToSave = ObjectUtils.objectToString(this.filters) !== ObjectUtils.objectToString(this._originalFilterConfig);
|
70
70
|
if (!hasChangesToSave) {
|
71
71
|
this.closeModal();
|
72
72
|
return;
|
@@ -76,13 +76,19 @@ export class SnkFilterModal {
|
|
76
76
|
this.closeModal();
|
77
77
|
});
|
78
78
|
}
|
79
|
-
|
79
|
+
handleApplyFilters() {
|
80
80
|
const filterPersonalized = this.filters.find(filter => filter.filterType === FilterType.CUSTOM_FILTER);
|
81
|
+
if (this.isValidCustomFilter(filterPersonalized)) {
|
82
|
+
this.applyFilters(this.filters);
|
83
|
+
}
|
84
|
+
}
|
85
|
+
isValidCustomFilter(filterPersonalized) {
|
81
86
|
const isValid = PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
|
82
87
|
if (!isValid) {
|
83
|
-
|
88
|
+
ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
|
89
|
+
return false;
|
84
90
|
}
|
85
|
-
|
91
|
+
return true;
|
86
92
|
}
|
87
93
|
modalActionListener(evt) {
|
88
94
|
const modalAction = evt.detail;
|
@@ -91,7 +97,7 @@ export class SnkFilterModal {
|
|
91
97
|
this.handleClearAll();
|
92
98
|
break;
|
93
99
|
case ModalAction.OK:
|
94
|
-
this.
|
100
|
+
this.handleApplyFilters();
|
95
101
|
break;
|
96
102
|
case ModalAction.CLOSE:
|
97
103
|
this.handleClose();
|
@@ -31,19 +31,21 @@ export class SnkFilterModalItem {
|
|
31
31
|
case FilterItemType.NUMBER:
|
32
32
|
return { tag: "snk-filter-number" };
|
33
33
|
case FilterItemType.PERSONALIZED:
|
34
|
-
|
35
|
-
tag: "snk-filter-personalized", props: {
|
36
|
-
onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
|
37
|
-
onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
|
38
|
-
onAddFilter: () => this.addPersonalizedFilter.emit(),
|
39
|
-
}
|
40
|
-
};
|
41
|
-
return snkFilterPersonalizedProps;
|
34
|
+
return this.buildSnkFilterPersonalizedProps();
|
42
35
|
case FilterItemType.MULTI_LIST:
|
43
36
|
return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
|
44
37
|
}
|
45
38
|
return { tag: "snk-filter-text" };
|
46
39
|
}
|
40
|
+
buildSnkFilterPersonalizedProps() {
|
41
|
+
return {
|
42
|
+
tag: "snk-personalized-filter-editor", props: {
|
43
|
+
onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
|
44
|
+
onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
|
45
|
+
onAddFilter: () => this.addPersonalizedFilter.emit(),
|
46
|
+
}
|
47
|
+
};
|
48
|
+
}
|
47
49
|
isVisible(newValue) {
|
48
50
|
return !this.filterItem.visible ? newValue !== undefined : true;
|
49
51
|
}
|
@@ -92,13 +92,12 @@ export class SnkFilterBar {
|
|
92
92
|
this.processAfterUpdateConfig();
|
93
93
|
}
|
94
94
|
}
|
95
|
+
getPersonalizedFilterItem() {
|
96
|
+
return this.filterConfig.find(item => item.type === FilterItemType.PERSONALIZED);
|
97
|
+
}
|
95
98
|
async processAfterUpdateConfig() {
|
96
99
|
if (this._loadingPending) {
|
97
|
-
const personalizedFilter = this.
|
98
|
-
if (item.type === FilterItemType.PERSONALIZED) {
|
99
|
-
return true;
|
100
|
-
}
|
101
|
-
});
|
100
|
+
const personalizedFilter = this.getPersonalizedFilterItem();
|
102
101
|
this._pendingVariables = !PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
|
103
102
|
if (this._pendingVariables) {
|
104
103
|
return;
|
@@ -6,7 +6,6 @@ const SNK_CONTEXT_KEY = "__SNK__APPLICATION__";
|
|
6
6
|
const ENTITY_NAME_PATTERN = /\w+:\/\/(\w+)/;
|
7
7
|
export class SnkFilterFieldSearch {
|
8
8
|
constructor() {
|
9
|
-
this._filterMetadataStorage = new Map();
|
10
9
|
this._currentMetadata = null;
|
11
10
|
this._filterText = "";
|
12
11
|
this._isLoading = false;
|
@@ -49,15 +48,8 @@ export class SnkFilterFieldSearch {
|
|
49
48
|
async loadData() {
|
50
49
|
var _a, _b;
|
51
50
|
this._isLoading = true;
|
52
|
-
let metadata;
|
53
|
-
|
54
|
-
metadata = this._filterMetadataStorage.get(this._currentLink.uri);
|
55
|
-
}
|
56
|
-
if (!metadata) {
|
57
|
-
metadata = await this.fieldsDataSource.fetchData(this._currentLink);
|
58
|
-
this._currentLink = metadata.currentLink;
|
59
|
-
this._filterMetadataStorage.set(this._currentLink.uri, metadata);
|
60
|
-
}
|
51
|
+
let metadata = await this.fieldsDataSource.fetchData(this._currentLink);
|
52
|
+
this._currentLink = metadata.currentLink;
|
61
53
|
const { fields, links } = metadata || {};
|
62
54
|
if (!Array.isArray(fields) || !Array.isArray(links))
|
63
55
|
throw new Error('Invalid metadata');
|
@@ -110,7 +102,6 @@ export class SnkFilterFieldSearch {
|
|
110
102
|
if (this._isLoading)
|
111
103
|
return;
|
112
104
|
const breadcrumbByIndex = this.breadcrumbItems.findIndex(breadcrumbItem => breadcrumbItem.id === item.id);
|
113
|
-
item.cache = this._filterMetadataStorage.has(item.uri);
|
114
105
|
if (breadcrumbByIndex > -1) {
|
115
106
|
this.breadcrumbItems = this.breadcrumbItems.slice(0, (breadcrumbByIndex + 1));
|
116
107
|
}
|
@@ -162,7 +153,6 @@ export class SnkFilterFieldSearch {
|
|
162
153
|
}
|
163
154
|
disconnectedCallback() {
|
164
155
|
var _a;
|
165
|
-
this._filterMetadataStorage.clear();
|
166
156
|
(_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
|
167
157
|
}
|
168
158
|
render() {
|