@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
@@ -6,11 +6,11 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const FieldBuilder = require('@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder');
|
9
|
-
const
|
9
|
+
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
|
10
10
|
const index$1 = require('./index-102ba62d.js');
|
11
11
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
12
12
|
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
13
|
-
|
13
|
+
require('./IExpressionItem-0e32ebb7.js');
|
14
14
|
require('./filter-item-type.enum-aa823a00.js');
|
15
15
|
|
16
16
|
var SelectedItemType;
|
@@ -47,7 +47,6 @@ const FIELD_TYPE_SEARCH_AND_TEXT = [
|
|
47
47
|
|
48
48
|
const snkExpressionItemCss = ".sc-snk-expression-item-h{display:flex;width:100%;--snk-expression-item--background-color:var(--background--xlight, #fff);--snk-expression-item__itens--padding:var(--space--small, 6px);--snk-expression-item__width--input-operator:220px;--snk-expression-item__width--input-value:240px;--snk-expression-item__width--input-value-variable:176px;--snk-expression-item--border-radius:var(--border--radius-medium, 12px);--snk-expression-item--border-color:var(--color--strokes, #DCE0E8);--snk-expression-item--border-style:var(--border--small, 1px solid);--snk-expression-item__background-color-dashed:var(--background--body, #fafcff)}.box.sc-snk-expression-item{width:100%;height:56px;background:var(--snk-expression-item--background-color);border:var(--snk-expression-item--border-color) var(--snk-expression-item--border-style);border-radius:var(--snk-expression-item--border-radius)}.box__container.sc-snk-expression-item{display:flex;align-items:center;justify-content:space-between;white-space:nowrap;margin:var(--space--small, 6px)}.box__container--input-filter.sc-snk-expression-item{width:100%}.box__container--input-operator.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-operator);min-width:var(--snk-expression-item__width--input-operator)}.box__container--input-value.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value);min-width:var(--snk-expression-item__width--input-value)}.box__container--input-value-variable.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value-variable);min-width:var(--snk-expression-item__width--input-value-variable)}.box__container--button-delete.sc-snk-expression-item{display:flex}.box__container.sc-snk-expression-item>div.sc-snk-expression-item{padding-left:var(--snk-expression-item__itens--padding);padding-right:var(--snk-expression-item__itens--padding)}.box__container--button-delete--icon.sc-snk-expression-item{width:42px;min-width:42px}.box__container--input-value-variable--icon.sc-snk-expression-item{cursor:pointer}.dashes.sc-snk-expression-item{z-index:var(--more-visible, 2);background:var(--snk-expression-item__background-color-dashed);border-bottom:2px dashed var(--text-secondary, #A2ABB9);border-left:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:62px;margin-left:-15px;margin-top:-33.5px}";
|
49
49
|
|
50
|
-
const DEFAULT_FIELD_NAME = 'NOT_DEFINED';
|
51
50
|
const SnkExpressionItem = class {
|
52
51
|
constructor(hostRef) {
|
53
52
|
index.registerInstance(this, hostRef);
|
@@ -56,6 +55,7 @@ const SnkExpressionItem = class {
|
|
56
55
|
this.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
57
56
|
this.filterOperandDefault = FilterOperandDefault;
|
58
57
|
this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
|
58
|
+
this.DEFAULT_FIELD_NAME = 'NOT_DEFINED';
|
59
59
|
this._showValueVariable = false;
|
60
60
|
this._fieldSelected = undefined;
|
61
61
|
this._optionNotNull = false;
|
@@ -207,8 +207,8 @@ const SnkExpressionItem = class {
|
|
207
207
|
this.setValueExpression("operand", optionSelected);
|
208
208
|
}
|
209
209
|
checkOptionIsNull(optionSelected) {
|
210
|
-
const filterOperandValue =
|
211
|
-
if ([
|
210
|
+
const filterOperandValue = PersonalizedFilterUtils.FilterOperand[optionSelected];
|
211
|
+
if ([PersonalizedFilterUtils.FilterOperand.NULL, PersonalizedFilterUtils.FilterOperand.NOT_NULL].includes(filterOperandValue)) {
|
212
212
|
this._optionNotNull = true;
|
213
213
|
if (this._elFieldDynamic) {
|
214
214
|
this._elFieldDynamic.enabled = false;
|
@@ -240,7 +240,7 @@ const SnkExpressionItem = class {
|
|
240
240
|
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)) {
|
241
241
|
inputFieldData.$attrs$.enabled = false;
|
242
242
|
}
|
243
|
-
if (this.expression.value) {
|
243
|
+
if (this.expression.value != undefined) {
|
244
244
|
inputFieldData.$attrs$.value = this.getExpressiontValue(this.expression);
|
245
245
|
}
|
246
246
|
inputFieldData.$attrs$.onEzChange = (event) => {
|
@@ -295,7 +295,7 @@ const SnkExpressionItem = class {
|
|
295
295
|
}
|
296
296
|
render() {
|
297
297
|
var _a;
|
298
|
-
return (index.h(index.Host, null, index.h("div", { class: "dashes" }), index.h("div", { class: "box" }, index.h("div", { class: "box__container" }, index.h("div", { class: "box__container--input-filter" }, index.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() }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || DEFAULT_FIELD_NAME}` })), index.h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), index.h("div", { class: "box__container--input-operator" }, index.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 }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || DEFAULT_FIELD_NAME}` }))), index.h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
|
298
|
+
return (index.h(index.Host, null, index.h("div", { class: "dashes" }), index.h("div", { class: "box" }, index.h("div", { class: "box__container" }, index.h("div", { class: "box__container--input-filter" }, index.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() }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` })), index.h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), index.h("div", { class: "box__container--input-operator" }, index.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 }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` }))), index.h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
|
299
299
|
index.h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
|
300
300
|
this.buildFieldByType()), index.h("div", { class: "box__container--input-value-variable" }, !this._optionNotNull &&
|
301
301
|
index.h("ez-check", { ref: ref => this._elValueVariable = ref, value: this.expression.paramVariable, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: utils.CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
|
@@ -338,7 +338,6 @@ const SnkFilterFieldSearch = class {
|
|
338
338
|
constructor(hostRef) {
|
339
339
|
index.registerInstance(this, hostRef);
|
340
340
|
this.ezSelectFilterItem = index.createEvent(this, "ezSelectFilterItem", 7);
|
341
|
-
this._filterMetadataStorage = new Map();
|
342
341
|
this._currentMetadata = null;
|
343
342
|
this._filterText = "";
|
344
343
|
this._isLoading = false;
|
@@ -381,15 +380,8 @@ const SnkFilterFieldSearch = class {
|
|
381
380
|
async loadData() {
|
382
381
|
var _a, _b;
|
383
382
|
this._isLoading = true;
|
384
|
-
let metadata;
|
385
|
-
|
386
|
-
metadata = this._filterMetadataStorage.get(this._currentLink.uri);
|
387
|
-
}
|
388
|
-
if (!metadata) {
|
389
|
-
metadata = await this.fieldsDataSource.fetchData(this._currentLink);
|
390
|
-
this._currentLink = metadata.currentLink;
|
391
|
-
this._filterMetadataStorage.set(this._currentLink.uri, metadata);
|
392
|
-
}
|
383
|
+
let metadata = await this.fieldsDataSource.fetchData(this._currentLink);
|
384
|
+
this._currentLink = metadata.currentLink;
|
393
385
|
const { fields, links } = metadata || {};
|
394
386
|
if (!Array.isArray(fields) || !Array.isArray(links))
|
395
387
|
throw new Error('Invalid metadata');
|
@@ -442,7 +434,6 @@ const SnkFilterFieldSearch = class {
|
|
442
434
|
if (this._isLoading)
|
443
435
|
return;
|
444
436
|
const breadcrumbByIndex = this.breadcrumbItems.findIndex(breadcrumbItem => breadcrumbItem.id === item.id);
|
445
|
-
item.cache = this._filterMetadataStorage.has(item.uri);
|
446
437
|
if (breadcrumbByIndex > -1) {
|
447
438
|
this.breadcrumbItems = this.breadcrumbItems.slice(0, (breadcrumbByIndex + 1));
|
448
439
|
}
|
@@ -494,7 +485,6 @@ const SnkFilterFieldSearch = class {
|
|
494
485
|
}
|
495
486
|
disconnectedCallback() {
|
496
487
|
var _a;
|
497
|
-
this._filterMetadataStorage.clear();
|
498
488
|
(_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
|
499
489
|
}
|
500
490
|
render() {
|
@@ -517,7 +507,7 @@ const SnkFilterParamConfig = class {
|
|
517
507
|
constructor(hostRef) {
|
518
508
|
index.registerInstance(this, hostRef);
|
519
509
|
this._opened = false;
|
520
|
-
this._configType =
|
510
|
+
this._configType = PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG;
|
521
511
|
this._expressionItem = undefined;
|
522
512
|
this._informedInstance = false;
|
523
513
|
this._canSave = false;
|
@@ -559,10 +549,10 @@ const SnkFilterParamConfig = class {
|
|
559
549
|
const description = this.getConfigValue("userConfig", "description");
|
560
550
|
const type = this.getConfigValue("userConfig", "type");
|
561
551
|
if (((_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a.userConfig) != undefined) {
|
562
|
-
this._configType =
|
552
|
+
this._configType = PersonalizedFilterUtils.FilterConfigType.USER_CONFIG;
|
563
553
|
}
|
564
554
|
else {
|
565
|
-
this._configType =
|
555
|
+
this._configType = PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG;
|
566
556
|
}
|
567
557
|
if (!core.StringUtils.isEmpty(entityName) && !core.StringUtils.isEmpty(fieldName)) {
|
568
558
|
this._instanceElement.value = { value: entityName, label: "" };
|
@@ -575,14 +565,14 @@ const SnkFilterParamConfig = class {
|
|
575
565
|
this.buildFilterExpression();
|
576
566
|
}
|
577
567
|
changeDefinitionUsed(option) {
|
578
|
-
this._configType = option !== null && option !== void 0 ? option :
|
579
|
-
if (this._configType ===
|
568
|
+
this._configType = option !== null && option !== void 0 ? option : PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG;
|
569
|
+
if (this._configType === PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG) {
|
580
570
|
const entityName = this.getConfigValue("systemConfig", "entity", "entityName");
|
581
571
|
const fieldName = this.getConfigValue("systemConfig", "fieldName");
|
582
572
|
this._instanceElement.value = this._instanceElement.value || { value: entityName, label: "" };
|
583
573
|
this._fieldElement.value = this._fieldElement.value || { value: fieldName, label: "" };
|
584
574
|
}
|
585
|
-
else if (this._configType ===
|
575
|
+
else if (this._configType === PersonalizedFilterUtils.FilterConfigType.USER_CONFIG) {
|
586
576
|
const description = this.getConfigValue("userConfig", "description");
|
587
577
|
const type = this.getConfigValue("userConfig", "type");
|
588
578
|
this._descriptionElement.value = this._descriptionElement.value || description;
|
@@ -599,12 +589,12 @@ const SnkFilterParamConfig = class {
|
|
599
589
|
var _a, _b, _c, _d, _e;
|
600
590
|
let systemConfig;
|
601
591
|
let userConfig;
|
602
|
-
if (this._configType ===
|
592
|
+
if (this._configType === PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG) {
|
603
593
|
const entity = (_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value;
|
604
594
|
const fieldName = (_d = (_c = this._fieldElement) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.value;
|
605
595
|
systemConfig = { entity, fieldName };
|
606
596
|
}
|
607
|
-
else if (this._configType ===
|
597
|
+
else if (this._configType === PersonalizedFilterUtils.FilterConfigType.USER_CONFIG) {
|
608
598
|
const description = (_e = this._descriptionElement) === null || _e === void 0 ? void 0 : _e.value;
|
609
599
|
const type = this.getTypeValue();
|
610
600
|
userConfig = { description, type };
|
@@ -656,7 +646,7 @@ const SnkFilterParamConfig = class {
|
|
656
646
|
if (this._application == undefined || !this._opened) {
|
657
647
|
return;
|
658
648
|
}
|
659
|
-
const isField = entity ===
|
649
|
+
const isField = entity === PersonalizedFilterUtils.FilterEntities.FIELD;
|
660
650
|
const criteria = isField ? this.getInstanceCriteria() : undefined;
|
661
651
|
const messageKey = `snkFilterParamConfig.label${isField ? "Field" : "Instance"}`;
|
662
652
|
const entityDescription = this.getMessage(messageKey);
|
@@ -682,7 +672,7 @@ const SnkFilterParamConfig = class {
|
|
682
672
|
}
|
683
673
|
getCanSave() {
|
684
674
|
var _a;
|
685
|
-
if (this._configType ===
|
675
|
+
if (this._configType === PersonalizedFilterUtils.FilterConfigType.USER_CONFIG) {
|
686
676
|
const description = (_a = this._descriptionElement) === null || _a === void 0 ? void 0 : _a.value;
|
687
677
|
const type = this.getTypeValue();
|
688
678
|
return !core.StringUtils.isEmpty(description) && !core.StringUtils.isEmpty(type);
|
@@ -697,8 +687,8 @@ const SnkFilterParamConfig = class {
|
|
697
687
|
return (index.h("ez-popup", Object.assign({ useHeader: false, size: "small", heightMode: "auto", opened: this._opened }, this.getElementID("popup")), index.h("ez-modal-container", Object.assign({ onEzModalAction: (evt) => {
|
698
688
|
if (evt.detail === ezModalContainer.ModalAction.CLOSE)
|
699
689
|
this.close();
|
700
|
-
}, modalTitle: this.getMessage("snkFilterParamConfig.modalTitle") }, this.getElementID("modalContainer")), index.h("div", { class: "ez-flex" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("systemConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelSystemConfig"), value:
|
701
|
-
return (index.h("option", { value:
|
690
|
+
}, modalTitle: this.getMessage("snkFilterParamConfig.modalTitle") }, this.getElementID("modalContainer")), index.h("div", { class: "ez-flex" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("systemConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelSystemConfig"), value: PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG })), index.h("ez-search", Object.assign({ ref: (ref) => this._instanceElement = ref, label: this.getMessage("snkFilterParamConfig.labelInstance"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG), suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.handleChangeInstance(), optionLoader: (searchArgument) => this.onSearch(searchArgument, PersonalizedFilterUtils.FilterEntities.INSTANCE) }, this.getElementID("configFindEntity"))), index.h("ez-search", Object.assign({ ref: (ref) => this._fieldElement = ref, label: this.getMessage("snkFilterParamConfig.labelField"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG) && this._informedInstance, suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.buildFilterExpression(), optionLoader: (searchArgument) => this.onSearch(searchArgument, PersonalizedFilterUtils.FilterEntities.FIELD) }, this.getElementID("configFindField")))), index.h("div", { class: "ez-flex ez-padding--medium" }, index.h("hr", { class: "ez-divider-vertical" })), index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("userConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelUserConfig"), value: PersonalizedFilterUtils.FilterConfigType.USER_CONFIG })), index.h("ez-text-input", Object.assign({ ref: (ref) => this._descriptionElement = ref, label: this.getMessage("snkFilterParamConfig.labelDescription"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.USER_CONFIG), onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamLabel"))), index.h("ez-combo-box", Object.assign({ ref: (ref) => this._typeElement = ref, label: this.getMessage("snkFilterParamConfig.labelType"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.USER_CONFIG), suppressEmptyOption: true, onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamType")), Object.keys(PersonalizedFilterUtils.FilterUserConfigTypes).map((configType) => {
|
691
|
+
return (index.h("option", { value: PersonalizedFilterUtils.FilterUserConfigTypes[configType] }, this.getMessage(`snkFilterParamConfig.labelTypeValues.${configType.toLowerCase()}`)));
|
702
692
|
})))), index.h("ez-text-area", Object.assign({ ref: (ref) => this._expressionElement = ref, class: "snk-filter-param-config__expression", label: this.getMessage("snkFilterParamConfig.labelExpression"), enabled: false }, this.getElementID("presentationExpression"))), index.h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, index.h("ez-button", Object.assign({ class: "ez-padding-right--medium", label: this.getMessage("snkFilterParamConfig.labelCancel"), onClick: () => this.close() }, this.getElementID("cancelEditParam"))), index.h("ez-button", Object.assign({ class: "ez-button--primary", label: this.getMessage("snkFilterParamConfig.labelSave"), onClick: () => this.save(), enabled: this._canSave }, this.getElementID("saveEditParam")))))));
|
703
693
|
}
|
704
694
|
get _element() { return index.getElement(this); }
|
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index
|
5
|
+
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
8
|
const ConfigStorage = require('./ConfigStorage-0a738cdc.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
11
|
-
const
|
11
|
+
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
|
12
12
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
13
|
-
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7d959e91.js');
|
14
13
|
require('./form-config-fetcher-92bc8fe7.js');
|
15
14
|
require('./DataFetcher-a9d0228f.js');
|
16
15
|
require('./_commonjsHelpers-537d719a.js');
|
17
16
|
require('./resource-fetcher-2979b54b.js');
|
18
17
|
require('./filter-bar-config-fetcher-75219599.js');
|
18
|
+
require('./IExpressionItem-0e32ebb7.js');
|
19
19
|
|
20
20
|
const buildFilter = (item) => {
|
21
21
|
switch (item.type) {
|
@@ -136,7 +136,7 @@ function buildPersonalized(item) {
|
|
136
136
|
});
|
137
137
|
return { expression, name: item.id, params };
|
138
138
|
});
|
139
|
-
const expression = filters.map(filter => `(${filter.expression})`).join(` ${
|
139
|
+
const expression = filters.map(filter => `(${filter.expression})`).join(` ${PersonalizedFilterUtils.FilterOperand.AND} `);
|
140
140
|
const params = filters.flatMap(filter => filter.params);
|
141
141
|
return { name: id, expression, params };
|
142
142
|
}
|
@@ -186,7 +186,7 @@ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns
|
|
186
186
|
|
187
187
|
const SnkFilterBar = class {
|
188
188
|
constructor(hostRef) {
|
189
|
-
index
|
189
|
+
index.registerInstance(this, hostRef);
|
190
190
|
this._updateSequence = [];
|
191
191
|
this._loadingPending = false;
|
192
192
|
this._configUpdated = false;
|
@@ -271,13 +271,12 @@ const SnkFilterBar = class {
|
|
271
271
|
this.processAfterUpdateConfig();
|
272
272
|
}
|
273
273
|
}
|
274
|
+
getPersonalizedFilterItem() {
|
275
|
+
return this.filterConfig.find(item => item.type === filterItemType_enum.FilterItemType.PERSONALIZED);
|
276
|
+
}
|
274
277
|
async processAfterUpdateConfig() {
|
275
278
|
if (this._loadingPending) {
|
276
|
-
const personalizedFilter = this.
|
277
|
-
if (item.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
|
278
|
-
return true;
|
279
|
-
}
|
280
|
-
});
|
279
|
+
const personalizedFilter = this.getPersonalizedFilterItem();
|
281
280
|
this._pendingVariables = !PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
|
282
281
|
if (this._pendingVariables) {
|
283
282
|
return;
|
@@ -347,10 +346,10 @@ const SnkFilterBar = class {
|
|
347
346
|
const unpinnedItems = [];
|
348
347
|
this.filterConfig
|
349
348
|
.filter(this.filterActiveFilter)
|
350
|
-
.forEach((item, index) => {
|
349
|
+
.forEach((item, index$1) => {
|
351
350
|
item = core.ObjectUtils.copy(item);
|
352
351
|
const itemId = `filter-${item.id}`;
|
353
|
-
const filterItem = (index
|
352
|
+
const filterItem = (index.h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
354
353
|
if (item.fixed || item.hardFixed) {
|
355
354
|
pinnedItems.push(filterItem);
|
356
355
|
}
|
@@ -362,7 +361,7 @@ const SnkFilterBar = class {
|
|
362
361
|
const elements = [];
|
363
362
|
elements.push(...pinnedItems);
|
364
363
|
if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
|
365
|
-
elements.push(index
|
364
|
+
elements.push(index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
|
366
365
|
}
|
367
366
|
elements.push(...unpinnedItems);
|
368
367
|
return elements;
|
@@ -496,11 +495,11 @@ const SnkFilterBar = class {
|
|
496
495
|
return undefined;
|
497
496
|
}
|
498
497
|
if (this.showPersonalizedFilter) {
|
499
|
-
return index
|
498
|
+
return index.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
|
500
499
|
}
|
501
|
-
return (index
|
500
|
+
return (index.h(index.Host, null, index.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index.h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
502
501
|
}
|
503
|
-
get _element() { return index
|
502
|
+
get _element() { return index.getElement(this); }
|
504
503
|
static get watchers() { return {
|
505
504
|
"filterConfig": ["observeFilterConfig"]
|
506
505
|
}; }
|
@@ -8,11 +8,11 @@ const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
|
8
8
|
const core = require('@sankhyalabs/core');
|
9
9
|
const filterBarConfigFetcher = require('./filter-bar-config-fetcher-75219599.js');
|
10
10
|
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
11
|
-
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-
|
11
|
+
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
|
12
12
|
require('./resource-fetcher-2979b54b.js');
|
13
13
|
require('./DataFetcher-a9d0228f.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
15
|
-
require('./
|
15
|
+
require('./IExpressionItem-0e32ebb7.js');
|
16
16
|
|
17
17
|
const SnkFilterDetail = class {
|
18
18
|
constructor(hostRef) {
|
@@ -58,12 +58,9 @@ const SnkFilterDetail = class {
|
|
58
58
|
return { tag: "snk-filter-number" };
|
59
59
|
case filterItemType_enum.FilterItemType.PERSONALIZED:
|
60
60
|
const snkFilterPersonalizedProps = {
|
61
|
-
tag: "snk-filter-
|
61
|
+
tag: "snk-personalized-filter-editor", props: {
|
62
62
|
presentationMode: presentationMode.EPresentationMode.CHIP,
|
63
|
-
onValueChanged:
|
64
|
-
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
65
|
-
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
66
|
-
}
|
63
|
+
onValueChanged: evt => this.handleValueChanged(evt),
|
67
64
|
}
|
68
65
|
};
|
69
66
|
return snkFilterPersonalizedProps;
|
@@ -72,6 +69,10 @@ const SnkFilterDetail = class {
|
|
72
69
|
}
|
73
70
|
return { tag: "snk-filter-text" };
|
74
71
|
}
|
72
|
+
handleValueChanged({ detail }) {
|
73
|
+
const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
|
74
|
+
this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
|
75
|
+
}
|
75
76
|
removeItem() {
|
76
77
|
const hasMultiValues = this.config.type === filterItemType_enum.FilterItemType.MULTI_LIST && Array.isArray(this.config.value);
|
77
78
|
const newValue = hasMultiValues ? this.config.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
|
@@ -81,6 +82,9 @@ const SnkFilterDetail = class {
|
|
81
82
|
}
|
82
83
|
this.changeConfig(removedConfig);
|
83
84
|
}
|
85
|
+
removeItemFromGroup(item) {
|
86
|
+
return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
|
87
|
+
}
|
84
88
|
getPopUpHeaderButtons() {
|
85
89
|
return (index.h(index.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 })))));
|
86
90
|
}
|
@@ -185,11 +185,7 @@ const SnkFilterItem = class {
|
|
185
185
|
return `${label}: ${value.value} - ${value.label}`;
|
186
186
|
}
|
187
187
|
if (type === filterItemType_enum.FilterItemType.PERSONALIZED) {
|
188
|
-
const activeCount =
|
189
|
-
if (!!item.visible)
|
190
|
-
return total + 1;
|
191
|
-
return total;
|
192
|
-
}, 0);
|
188
|
+
const activeCount = this.calculateActiveCount(groupedItems);
|
193
189
|
if (activeCount <= 0)
|
194
190
|
return label;
|
195
191
|
return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
|
@@ -213,6 +209,13 @@ const SnkFilterItem = class {
|
|
213
209
|
}
|
214
210
|
return label;
|
215
211
|
}
|
212
|
+
calculateActiveCount(groupedItems) {
|
213
|
+
return groupedItems.reduce((total, item) => {
|
214
|
+
if (!!item.visible)
|
215
|
+
return total + 1;
|
216
|
+
return total;
|
217
|
+
}, 0);
|
218
|
+
}
|
216
219
|
applyTooltip() {
|
217
220
|
if (!this.config.value)
|
218
221
|
return undefined;
|
@@ -261,13 +264,19 @@ const SnkFilterItem = class {
|
|
261
264
|
}
|
262
265
|
return undefined;
|
263
266
|
}
|
267
|
+
hasActiveElements(value) {
|
268
|
+
var _a, _b, _c;
|
269
|
+
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;
|
270
|
+
}
|
271
|
+
hasActiveValue(config) {
|
272
|
+
return (config.type !== filterItemType_enum.FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
273
|
+
}
|
264
274
|
getEnabledChip() {
|
265
|
-
var _a, _b, _c, _d;
|
266
275
|
if (this.config.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
|
267
276
|
const { groupedItems = [] } = this.config;
|
268
277
|
return groupedItems.some(item => item.visible);
|
269
278
|
}
|
270
|
-
return
|
279
|
+
return this.hasActiveValue(this.config);
|
271
280
|
}
|
272
281
|
render() {
|
273
282
|
const leftIcon = this.getLeftIconName();
|
@@ -47,19 +47,21 @@ const SnkFilterModalItem = class {
|
|
47
47
|
case filterItemType_enum.FilterItemType.NUMBER:
|
48
48
|
return { tag: "snk-filter-number" };
|
49
49
|
case filterItemType_enum.FilterItemType.PERSONALIZED:
|
50
|
-
|
51
|
-
tag: "snk-filter-personalized", props: {
|
52
|
-
onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, filterItemType_enum.FilterItemType.PERSONALIZED),
|
53
|
-
onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
|
54
|
-
onAddFilter: () => this.addPersonalizedFilter.emit(),
|
55
|
-
}
|
56
|
-
};
|
57
|
-
return snkFilterPersonalizedProps;
|
50
|
+
return this.buildSnkFilterPersonalizedProps();
|
58
51
|
case filterItemType_enum.FilterItemType.MULTI_LIST:
|
59
52
|
return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
|
60
53
|
}
|
61
54
|
return { tag: "snk-filter-text" };
|
62
55
|
}
|
56
|
+
buildSnkFilterPersonalizedProps() {
|
57
|
+
return {
|
58
|
+
tag: "snk-personalized-filter-editor", props: {
|
59
|
+
onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, filterItemType_enum.FilterItemType.PERSONALIZED),
|
60
|
+
onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
|
61
|
+
onAddFilter: () => this.addPersonalizedFilter.emit(),
|
62
|
+
}
|
63
|
+
};
|
64
|
+
}
|
63
65
|
isVisible(newValue) {
|
64
66
|
return !this.filterItem.visible ? newValue !== undefined : true;
|
65
67
|
}
|
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const filterType_enum = require('./filter-type.enum-b14ce507.js');
|
9
9
|
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
10
10
|
const core = require('@sankhyalabs/core');
|
11
|
-
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-
|
12
|
-
require('./
|
11
|
+
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
|
12
|
+
require('./IExpressionItem-0e32ebb7.js');
|
13
13
|
|
14
14
|
const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px;overflow-x:clip;overflow-y:auto}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
|
15
15
|
|
@@ -75,7 +75,7 @@ const SnkFilterModal = class {
|
|
75
75
|
});
|
76
76
|
}
|
77
77
|
handleClose() {
|
78
|
-
const hasChangesToSave =
|
78
|
+
const hasChangesToSave = core.ObjectUtils.objectToString(this.filters) !== core.ObjectUtils.objectToString(this._originalFilterConfig);
|
79
79
|
if (!hasChangesToSave) {
|
80
80
|
this.closeModal();
|
81
81
|
return;
|
@@ -85,13 +85,19 @@ const SnkFilterModal = class {
|
|
85
85
|
this.closeModal();
|
86
86
|
});
|
87
87
|
}
|
88
|
-
|
88
|
+
handleApplyFilters() {
|
89
89
|
const filterPersonalized = this.filters.find(filter => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER);
|
90
|
+
if (this.isValidCustomFilter(filterPersonalized)) {
|
91
|
+
this.applyFilters(this.filters);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
isValidCustomFilter(filterPersonalized) {
|
90
95
|
const isValid = PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
|
91
96
|
if (!isValid) {
|
92
|
-
|
97
|
+
utils.ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
|
98
|
+
return false;
|
93
99
|
}
|
94
|
-
|
100
|
+
return true;
|
95
101
|
}
|
96
102
|
modalActionListener(evt) {
|
97
103
|
const modalAction = evt.detail;
|
@@ -100,7 +106,7 @@ const SnkFilterModal = class {
|
|
100
106
|
this.handleClearAll();
|
101
107
|
break;
|
102
108
|
case ezModalContainer.ModalAction.OK:
|
103
|
-
this.
|
109
|
+
this.handleApplyFilters();
|
104
110
|
break;
|
105
111
|
case ezModalContainer.ModalAction.CLOSE:
|
106
112
|
this.handleClose();
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
9
|
const ConfigStorage = require('./ConfigStorage-0a738cdc.js');
|
10
|
-
const index$1 = require('./index-
|
10
|
+
const index$1 = require('./index-0e663819.js');
|
11
11
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
12
12
|
const index$2 = require('./index-102ba62d.js');
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -5,11 +5,11 @@ const core = require('@sankhyalabs/core');
|
|
5
5
|
const SnkFormConfigManager = require('./SnkFormConfigManager-a583f503.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
9
9
|
const constants = require('./constants-d187e03e.js');
|
10
10
|
require('./DataFetcher-a9d0228f.js');
|
11
11
|
require('./pesquisa-fetcher-954b74c3.js');
|
12
|
-
const index$1 = require('./index-
|
12
|
+
const index$1 = require('./index-0e663819.js');
|
13
13
|
|
14
14
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
15
15
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-27586701.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-a583f503.js');
|
@@ -15,8 +15,8 @@ require('./filter-bar-config-fetcher-75219599.js');
|
|
15
15
|
require('./filter-item-type.enum-aa823a00.js');
|
16
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
17
17
|
require('./taskbar-processor-bce3f499.js');
|
18
|
-
require('./taskbar-elements-
|
19
|
-
require('./index-
|
18
|
+
require('./taskbar-elements-b98dd6e9.js');
|
19
|
+
require('./index-0e663819.js');
|
20
20
|
require('./index-102ba62d.js');
|
21
21
|
require('./constants-d187e03e.js');
|
22
22
|
require('./pesquisa-fetcher-954b74c3.js');
|