@sankhyalabs/sankhyablocks 6.5.0 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{PersonalizedFilterUtils-7d959e91.js → PersonalizedFilterUtils-cfcd9af2.js} +47 -10
- package/dist/cjs/{SnkMessageBuilder-aec46b5d.js → SnkMessageBuilder-ba6d4ade.js} +4 -1
- package/dist/cjs/SnkMultiSelectionListDataSource-804ff4c7.js +34 -0
- 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 +4 -32
- 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 +44 -15
- 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/components/snk-simple-crud/snk-simple-crud.js +10 -2
- package/dist/collection/lib/@types/index.js +0 -36
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +25 -4
- 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/{taskbar-processor.js → SnkMultiSelectionListDataSource.js} +32 -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-detail-view2.js +1 -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 +4 -33
- 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/components/snk-simple-crud2.js +34 -6
- 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/SnkMultiSelectionListDataSource-892f37f9.js +32 -0
- 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 +6 -34
- 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 +36 -7
- 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-18de3bbd.entry.js +1 -0
- 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-4c8d0516.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-7d68a43a.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-fa9d3f73.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/snk-simple-crud/snk-simple-crud.d.ts +3 -0
- 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/dataUnit/InMemoryLoader.d.ts +3 -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-a1cab141.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/sankhyablocks/p-f75dceb1.entry.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
@@ -1,8 +1,7 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
2
2
|
import { StringUtils, DataType, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
4
|
-
import {
|
5
|
-
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
4
|
+
import { b as FilterConfigType, P as PersonalizedFilterUtils, c as FilterEntities, d as FilterUserConfigTypes } from './PersonalizedFilterUtils.js';
|
6
5
|
|
7
6
|
const snkFilterParamConfigCss = ":host{--snk-filter-param-config__expression--color:var(--title--primary, #2b3a54);display:flex;position:relative}.snk-filter-param-config__expression{--text-area__input--disabled--color:var(--snk-filter-param-config__expression--color)}";
|
8
7
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import {
|
3
|
-
import { UserInterface
|
2
|
+
import { ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
|
3
|
+
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
4
|
import { d as defineCustomElement$1, T as TaskbarElement } from './snk-taskbar2.js';
|
5
5
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
6
6
|
import { P as PresentationMode } from './index2.js';
|
7
|
-
import { T as TaskbarProcessor } from './
|
7
|
+
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
8
8
|
import { s as store } from './index3.js';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
10
|
import { d as defineCustomElement$f } from './snk-actions-button2.js';
|
@@ -22,35 +22,6 @@ import { d as defineCustomElement$4 } from './snk-personalized-filter2.js';
|
|
22
22
|
import { d as defineCustomElement$3 } from './snk-select-box2.js';
|
23
23
|
import { d as defineCustomElement$2 } from './snk-simple-bar2.js';
|
24
24
|
|
25
|
-
class SnkMultiSelectionListDataSource {
|
26
|
-
setDataUnit(dataUnit) {
|
27
|
-
this._dataUnit = dataUnit;
|
28
|
-
}
|
29
|
-
setApplication(application) {
|
30
|
-
this._application = application;
|
31
|
-
}
|
32
|
-
formatLabel(fieldName, value) {
|
33
|
-
const { userInterface } = this._dataUnit.getField(fieldName);
|
34
|
-
if (userInterface === UserInterface.DATETIME) {
|
35
|
-
return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
|
36
|
-
}
|
37
|
-
return String(this._dataUnit.getFormattedValue(fieldName, value));
|
38
|
-
}
|
39
|
-
fetchData(filterTerm, fieldName) {
|
40
|
-
return new Promise(resolve => {
|
41
|
-
this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
|
42
|
-
resolve(result.map(item => {
|
43
|
-
const field = this._dataUnit.getField(fieldName);
|
44
|
-
if (field.userInterface === UserInterface.SEARCH) {
|
45
|
-
return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
|
46
|
-
}
|
47
|
-
return { value: item, label: this.formatLabel(fieldName, item), check: true };
|
48
|
-
}));
|
49
|
-
});
|
50
|
-
});
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
25
|
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
55
26
|
|
56
27
|
const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
@@ -185,7 +156,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
185
156
|
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
186
157
|
width: 200,
|
187
158
|
type: DataType.TEXT,
|
188
|
-
userInterface: UserInterface
|
159
|
+
userInterface: UserInterface.LONGTEXT
|
189
160
|
};
|
190
161
|
columnsMetadata.push(descriptionColumn);
|
191
162
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface SnkPersonalizedFilterEditor extends Components.SnkPersonalizedFilterEditor, HTMLElement {}
|
4
|
+
export const SnkPersonalizedFilterEditor: {
|
5
|
+
prototype: SnkPersonalizedFilterEditor;
|
6
|
+
new (): SnkPersonalizedFilterEditor;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h,
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
2
|
import { ElementIDUtils, UserInterface, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode.js';
|
5
5
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
6
6
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
7
7
|
|
8
|
-
const
|
8
|
+
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)}";
|
9
9
|
|
10
|
-
const SnkFilterPersonalized
|
10
|
+
const SnkFilterPersonalized = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
11
11
|
constructor() {
|
12
12
|
super();
|
13
13
|
this.__registerHost();
|
@@ -50,10 +50,15 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
50
50
|
var _a, _b;
|
51
51
|
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}`)}` })));
|
52
52
|
const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
|
53
|
-
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.
|
53
|
+
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)))));
|
54
|
+
}
|
55
|
+
buildModalListActions(item, isVariable) {
|
56
|
+
if (!this.isModalMode())
|
57
|
+
return;
|
58
|
+
return (this.isModalMode() ?
|
54
59
|
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) }))
|
55
60
|
:
|
56
|
-
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}`)}` }))))
|
61
|
+
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}`)}` }))));
|
57
62
|
}
|
58
63
|
isModalMode() {
|
59
64
|
return this.presentationMode === EPresentationMode.MODAL;
|
@@ -120,7 +125,7 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
120
125
|
});
|
121
126
|
this.emitChange();
|
122
127
|
}
|
123
|
-
|
128
|
+
handleSearchFilterList({ detail: query = "" }) {
|
124
129
|
this.items = query ? this.originalItems.filter(item => item.label.toLowerCase().includes(query.toLowerCase())) : this.originalItems;
|
125
130
|
}
|
126
131
|
handleFilterItemChange(value, formProp) {
|
@@ -153,11 +158,11 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
153
158
|
}
|
154
159
|
handleDeleteFilter(item) {
|
155
160
|
this._application.confirm(this.getMessage('snkPersonalizedFilter.deleteConfirm.title'), this.getMessage('snkPersonalizedFilter.deleteConfirm.message', { filterName: item.label })).then((actionConfirmed) => {
|
156
|
-
if (actionConfirmed)
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
+
if (!actionConfirmed)
|
162
|
+
return;
|
163
|
+
this.deleteFilter.emit(item);
|
164
|
+
this.items = this.originalItems = this.originalItems.filter(originalItem => originalItem.id !== item.id);
|
165
|
+
this.emitChange();
|
161
166
|
});
|
162
167
|
}
|
163
168
|
componentDidLoad() {
|
@@ -169,17 +174,35 @@ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
169
174
|
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
170
175
|
this.items = this.originalItems = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.groupedItems) || [];
|
171
176
|
}
|
177
|
+
buildModeModalHeader() {
|
178
|
+
if (this.presentationMode !== EPresentationMode.MODAL)
|
179
|
+
return;
|
180
|
+
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, " "))));
|
181
|
+
}
|
182
|
+
buildModeModalFooter() {
|
183
|
+
if (this.presentationMode !== EPresentationMode.MODAL)
|
184
|
+
return;
|
185
|
+
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() })));
|
186
|
+
}
|
187
|
+
buildContainerFiltersCreated() {
|
188
|
+
if (this.items.length) {
|
189
|
+
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)))));
|
190
|
+
}
|
191
|
+
else {
|
192
|
+
return (h("div", { class: "ez-margin--auto" }, h("span", { class: "ez-text ez-text--secondary ez-text--small" }, this.getMessage('snkPersonalizedFilter.info.noDataFound'))));
|
193
|
+
}
|
194
|
+
}
|
172
195
|
render() {
|
173
196
|
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED)
|
174
197
|
return undefined;
|
175
|
-
return (h(Host, null,
|
198
|
+
return (h(Host, null, this.buildModeModalHeader(), this.buildContainerFiltersCreated(), this.buildModeModalFooter()));
|
176
199
|
}
|
177
200
|
get _element() { return this; }
|
178
201
|
static get watchers() { return {
|
179
202
|
"config": ["configWatcher"]
|
180
203
|
}; }
|
181
|
-
static get style() { return
|
182
|
-
}, [2, "snk-filter-
|
204
|
+
static get style() { return snkPersonalizedFilterEditorCss; }
|
205
|
+
}, [2, "snk-personalized-filter-editor", {
|
183
206
|
"messagesBuilder": [1040],
|
184
207
|
"presentationMode": [2, "presentation-mode"],
|
185
208
|
"config": [16],
|
@@ -191,17 +214,17 @@ function defineCustomElement$1() {
|
|
191
214
|
if (typeof customElements === "undefined") {
|
192
215
|
return;
|
193
216
|
}
|
194
|
-
const components = ["snk-filter-
|
217
|
+
const components = ["snk-personalized-filter-editor"];
|
195
218
|
components.forEach(tagName => { switch (tagName) {
|
196
|
-
case "snk-filter-
|
219
|
+
case "snk-personalized-filter-editor":
|
197
220
|
if (!customElements.get(tagName)) {
|
198
|
-
customElements.define(tagName, SnkFilterPersonalized
|
221
|
+
customElements.define(tagName, SnkFilterPersonalized);
|
199
222
|
}
|
200
223
|
break;
|
201
224
|
} });
|
202
225
|
}
|
203
226
|
|
204
|
-
const
|
227
|
+
const SnkPersonalizedFilterEditor = SnkFilterPersonalized;
|
205
228
|
const defineCustomElement = defineCustomElement$1;
|
206
229
|
|
207
|
-
export {
|
230
|
+
export { SnkPersonalizedFilterEditor, defineCustomElement };
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h,
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
2
|
import { StringUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
|
-
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
3
|
+
import { F as FilterGroupCondition, P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
4
4
|
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage.js';
|
5
5
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
6
|
-
import { F as FilterGroupCondition, d as defineCustomElement$5 } from './snk-expression-group2.js';
|
7
6
|
import { s as store } from './index3.js';
|
7
|
+
import { d as defineCustomElement$5 } from './snk-expression-group2.js';
|
8
8
|
import { d as defineCustomElement$4 } from './snk-expression-item2.js';
|
9
9
|
import { d as defineCustomElement$3 } from './snk-filter-field-search2.js';
|
10
10
|
import { d as defineCustomElement$2 } from './snk-filter-param-config2.js';
|
@@ -19,13 +19,18 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
19
19
|
this.ezCancel = createEvent(this, "ezCancel", 7);
|
20
20
|
this.ezSave = createEvent(this, "ezSave", 7);
|
21
21
|
this._personalizedFilterFetcher = new PersonalizedFilterFetcher();
|
22
|
+
this._filterMetadataStorage = new Map();
|
22
23
|
this._dataSourceFetcher = {
|
23
24
|
fetchData: async (entity) => {
|
24
25
|
let entityURI = entity === null || entity === void 0 ? void 0 : entity.uri;
|
25
26
|
if (StringUtils.isEmpty(entityURI)) {
|
26
27
|
entityURI = this.entityUri;
|
27
28
|
}
|
28
|
-
|
29
|
+
if (!this._filterMetadataStorage.has(entityURI)) {
|
30
|
+
const filterMetadata = await this._personalizedFilterFetcher.loadFields(entityURI);
|
31
|
+
this._filterMetadataStorage.set(entityURI, filterMetadata);
|
32
|
+
}
|
33
|
+
return this._filterMetadataStorage.get(entityURI);
|
29
34
|
}
|
30
35
|
};
|
31
36
|
this._filterAssistentMode = true;
|
@@ -138,11 +143,11 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
138
143
|
ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"), this.getMessage("snkPersonalizedFilter.confirmCancel.description"))
|
139
144
|
.then((canCancel) => {
|
140
145
|
var _a;
|
141
|
-
if (canCancel)
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
+
if (!canCancel)
|
147
|
+
return;
|
148
|
+
this._filterAssistent = ObjectUtils.copy((_a = this._originalFilterAssistent) !== null && _a !== void 0 ? _a : {});
|
149
|
+
this.ezCancel.emit();
|
150
|
+
this._elButtonSave.enabled = false;
|
146
151
|
});
|
147
152
|
}
|
148
153
|
handleTitleChange(name) {
|
@@ -175,14 +180,21 @@ const SnkPersonalizedFilter = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
175
180
|
}
|
176
181
|
return (h("div", { class: "ez-flex" }, h("ez-alert", { alertType: "warn" }, this._filterAssistent.warningMessage)));
|
177
182
|
}
|
183
|
+
buildContainerPersonalizedFilter() {
|
184
|
+
var _a, _b, _c;
|
185
|
+
if (this._filterAssistentMode) {
|
186
|
+
return (h(Fragment, null, h("div", { class: "ez-padding-top--small snk-personalized-filter__group" }, h("snk-expression-group", { ref: (el) => this._mainExpressionGroup = el, group: (_a = this._filterAssistent) === null || _a === void 0 ? void 0 : _a.assistent, messagesBuilder: this.messagesBuilder, onEzFilterGroupChange: this.handleFilterGroupChange.bind(this), filterId: this.filterId, entityURI: this.entityUri })), h("div", null, h("div", { class: "snk-personalized-filter__expression-input--line" }), h("ez-collapsible-box", { label: this.getMessage("snkPersonalizedFilter.info.titleCollapsible"), headerSize: "medium", value: true }, h("div", { class: "ez-box" }, h("div", { class: "ez-box__container" }, h("ez-text-area", { ref: (el) => this._elTextAreaExpression = el, enabled: false, label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.expression })))))));
|
187
|
+
}
|
188
|
+
else {
|
189
|
+
return (h(Fragment, null, h("span", { class: "ez-text ez-text--small ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkPersonalizedFilter.info.applyExpression")), h("ez-text-area", { label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_c = this._filterAssistent) === null || _c === void 0 ? void 0 : _c.expression, onEzChange: (evt) => this.handleExpressionChange(evt.detail) }), this.getWarningMessageComponent()));
|
190
|
+
}
|
191
|
+
}
|
178
192
|
render() {
|
179
|
-
var _a, _b
|
193
|
+
var _a, _b;
|
180
194
|
if (!((_a = this._filterAssistent) === null || _a === void 0 ? void 0 : _a.assistent) && this._filterAssistentMode) {
|
181
195
|
return;
|
182
196
|
}
|
183
|
-
return (h(Host, null, h("div", { class: "snk-personalized-filter" }, h("div", null, h("snk-simple-bar", { label: this.filterId ? this.getMessage("snkPersonalizedFilter.info.titleEdit") : this.getMessage("snkPersonalizedFilter.info.titleAdd"), onExit: () => this.handleCancel() }, h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, h("ez-button", { size: "small", label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), h("ez-button", { size: "small", ref: (el) => this._elButtonSave = el, enabled: false, class: "ez-button--primary", label: this.getMessage("snkPersonalizedFilter.info.labelSave"), onClick: this.handleSave.bind(this) })))), h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, h("div", { class: "ez-box__container" }, h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("div", { class: "ez-flex" }, h("ez-text-input", { class: "ez-padding-right--medium", label: this.getMessage("snkPersonalizedFilter.info.labelNameFilter"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.name, onEzChange: (evt) => this.handleTitleChange(evt.detail) })), this.
|
184
|
-
h(Fragment, null, h("div", { class: "ez-padding-top--small snk-personalized-filter__group" }, h("snk-expression-group", { ref: (el) => this._mainExpressionGroup = el, group: (_c = this._filterAssistent) === null || _c === void 0 ? void 0 : _c.assistent, messagesBuilder: this.messagesBuilder, onEzFilterGroupChange: this.handleFilterGroupChange.bind(this), filterId: this.filterId, entityURI: this.entityUri })), h("div", null, h("div", { class: "snk-personalized-filter__expression-input--line" }), h("ez-collapsible-box", { label: this.getMessage("snkPersonalizedFilter.info.titleCollapsible"), headerSize: "medium", value: true }, h("div", { class: "ez-box" }, h("div", { class: "ez-box__container" }, h("ez-text-area", { ref: (el) => this._elTextAreaExpression = el, enabled: false, label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_d = this._filterAssistent) === null || _d === void 0 ? void 0 : _d.expression })))))) :
|
185
|
-
h(Fragment, null, h("span", { class: "ez-text ez-text--small ez-text--bold ez-padding-bottom--medium" }, "Express\u00E3o a ser aplicada:"), h("ez-text-area", { label: this.getMessage("snkPersonalizedFilter.info.labelExpression"), value: (_e = this._filterAssistent) === null || _e === void 0 ? void 0 : _e.expression, onEzChange: (evt) => this.handleExpressionChange(evt.detail) }), this.getWarningMessageComponent())))))));
|
197
|
+
return (h(Host, null, h("div", { class: "snk-personalized-filter" }, h("div", null, h("snk-simple-bar", { label: this.filterId ? this.getMessage("snkPersonalizedFilter.info.titleEdit") : this.getMessage("snkPersonalizedFilter.info.titleAdd"), onExit: () => this.handleCancel() }, h("div", { class: "snk-personalized-filter__header-actions", slot: "rightSlot" }, h("ez-button", { size: "small", label: this.getMessage("snkPersonalizedFilter.info.labelCancel"), onClick: () => this.handleCancel() }), h("ez-button", { size: "small", ref: (el) => this._elButtonSave = el, enabled: false, class: "ez-button--primary", label: this.getMessage("snkPersonalizedFilter.info.labelSave"), onClick: this.handleSave.bind(this) })))), h("div", { class: "ez-box ez-margin-bottom--medium ez-box__main" }, h("div", { class: "ez-box__container" }, h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("div", { class: "ez-flex" }, h("ez-text-input", { class: "ez-padding-right--medium", label: this.getMessage("snkPersonalizedFilter.info.labelNameFilter"), value: (_b = this._filterAssistent) === null || _b === void 0 ? void 0 : _b.name, onEzChange: (evt) => this.handleTitleChange(evt.detail) })), this.buildContainerPersonalizedFilter()))))));
|
186
198
|
}
|
187
199
|
static get watchers() { return {
|
188
200
|
"filterId": ["loadFilter"]
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
2
|
-
import { DataUnit, StringUtils, SortMode, DataType, ChangeOperation, ObjectUtils, UserInterface } from '@sankhyalabs/core';
|
2
|
+
import { DataUnit, StringUtils, SortMode, DataType, ChangeOperation, ObjectUtils, ApplicationContext, UserInterface } from '@sankhyalabs/core';
|
3
3
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants.js';
|
4
4
|
import { T as TaskbarElement, d as defineCustomElement$1 } from './snk-taskbar2.js';
|
5
5
|
import './DataFetcher.js';
|
6
6
|
import './pesquisa-fetcher.js';
|
7
7
|
import { P as PresentationMode } from './index2.js';
|
8
|
-
import { T as TaskbarProcessor } from './
|
8
|
+
import { S as SnkMultiSelectionListDataSource, T as TaskbarProcessor } from './SnkMultiSelectionListDataSource.js';
|
9
|
+
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
10
|
import { d as defineCustomElement$5 } from './snk-actions-button2.js';
|
10
11
|
import { d as defineCustomElement$4 } from './snk-data-exporter2.js';
|
11
12
|
import { d as defineCustomElement$3 } from './snk-data-unit2.js';
|
@@ -17,7 +18,7 @@ class InMemoryLoader {
|
|
17
18
|
this.metadata = metadata;
|
18
19
|
this._dataUnit = new DataUnit("InMemoryDataUnit");
|
19
20
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
20
|
-
this._dataUnit.dataLoader = (
|
21
|
+
this._dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
|
21
22
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
22
23
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
23
24
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -54,8 +55,9 @@ class InMemoryLoader {
|
|
54
55
|
metadaLoader() {
|
55
56
|
return Promise.resolve(this._metadata);
|
56
57
|
}
|
57
|
-
dataLoader(
|
58
|
-
|
58
|
+
dataLoader(dataUnit, request) {
|
59
|
+
const filters = this.getColumnFilters(dataUnit);
|
60
|
+
let records = this.applyFilters(filters);
|
59
61
|
if (request.sort) {
|
60
62
|
request.sort.forEach(sort => {
|
61
63
|
records = records.sort((recordA, recordB) => {
|
@@ -68,6 +70,25 @@ class InMemoryLoader {
|
|
68
70
|
}
|
69
71
|
return Promise.resolve({ records: records });
|
70
72
|
}
|
73
|
+
applyFilters(filters) {
|
74
|
+
let records = [...this._records];
|
75
|
+
filters.forEach(filter => {
|
76
|
+
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
77
|
+
});
|
78
|
+
return records;
|
79
|
+
}
|
80
|
+
getColumnFilters(dataUnit) {
|
81
|
+
var _a, _b;
|
82
|
+
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
83
|
+
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
84
|
+
return columnFilters.map(filter => {
|
85
|
+
var _a, _b;
|
86
|
+
return {
|
87
|
+
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
88
|
+
values: filter.params.map(param => param.value),
|
89
|
+
};
|
90
|
+
});
|
91
|
+
}
|
71
92
|
getSortFn(type) {
|
72
93
|
switch (type) {
|
73
94
|
case DataType.NUMBER:
|
@@ -134,6 +155,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
134
155
|
this.actionClick = createEvent(this, "actionClick", 7);
|
135
156
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
136
157
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
158
|
+
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
137
159
|
this._taskbarProcessor = new TaskbarProcessor({
|
138
160
|
"snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
|
139
161
|
"snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
|
@@ -195,6 +217,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
195
217
|
componentWillLoad() {
|
196
218
|
this.processMetadata();
|
197
219
|
this.onModeChange();
|
220
|
+
this.configDatasource();
|
221
|
+
}
|
222
|
+
configDatasource() {
|
223
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
224
|
+
this._multiSelectionListDataSource.setApplication(application);
|
225
|
+
this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
|
198
226
|
}
|
199
227
|
getTaskBarId() {
|
200
228
|
var _a, _b, _c;
|
@@ -280,7 +308,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
280
308
|
}
|
281
309
|
render() {
|
282
310
|
var _a;
|
283
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM) }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
311
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
284
312
|
}
|
285
313
|
get _element() { return this; }
|
286
314
|
static get watchers() { return {
|
package/dist/esm/{PersonalizedFilterUtils-202cd721.js → PersonalizedFilterUtils-1a167d89.js}
RENAMED
@@ -1,7 +1,44 @@
|
|
1
1
|
import { DataType, NumberUtils, DateUtils, UserInterface } from '@sankhyalabs/core';
|
2
|
-
import
|
2
|
+
import './IExpressionItem-21f225bf.js';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
4
|
|
5
|
+
var FilterConfigType;
|
6
|
+
(function (FilterConfigType) {
|
7
|
+
FilterConfigType["SYSTEM_CONFIG"] = "S";
|
8
|
+
FilterConfigType["USER_CONFIG"] = "E";
|
9
|
+
})(FilterConfigType || (FilterConfigType = {}));
|
10
|
+
var FilterUserConfigTypes;
|
11
|
+
(function (FilterUserConfigTypes) {
|
12
|
+
FilterUserConfigTypes["DATE"] = "D";
|
13
|
+
FilterUserConfigTypes["HORA"] = "H";
|
14
|
+
FilterUserConfigTypes["TEXT"] = "S";
|
15
|
+
FilterUserConfigTypes["INTEGER"] = "I";
|
16
|
+
FilterUserConfigTypes["DECIMAL"] = "F";
|
17
|
+
FilterUserConfigTypes["NUMBER"] = "NUMBER";
|
18
|
+
})(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
|
19
|
+
var FilterOperand;
|
20
|
+
(function (FilterOperand) {
|
21
|
+
FilterOperand["AND"] = "AND";
|
22
|
+
FilterOperand["OR"] = "OR";
|
23
|
+
FilterOperand["IN"] = "IN";
|
24
|
+
FilterOperand["DIFFERENT"] = "<>";
|
25
|
+
FilterOperand["LIKE"] = "LIKE";
|
26
|
+
FilterOperand["START_WITH"] = "LIKE_START";
|
27
|
+
FilterOperand["FINISHED_WITH"] = "LIKE_END";
|
28
|
+
FilterOperand["NULL"] = "NULL";
|
29
|
+
FilterOperand["NOT_NULL"] = "NOT NULL";
|
30
|
+
FilterOperand["EQUAL"] = "=";
|
31
|
+
FilterOperand["LARGER"] = ">";
|
32
|
+
FilterOperand["LARGER_EQUAL"] = ">=";
|
33
|
+
FilterOperand["SMALLER"] = "<";
|
34
|
+
FilterOperand["SMALLER_EQUAL"] = "<=";
|
35
|
+
})(FilterOperand || (FilterOperand = {}));
|
36
|
+
var FilterEntities;
|
37
|
+
(function (FilterEntities) {
|
38
|
+
FilterEntities["FIELD"] = "Campo";
|
39
|
+
FilterEntities["INSTANCE"] = "Instancia";
|
40
|
+
})(FilterEntities || (FilterEntities = {}));
|
41
|
+
|
5
42
|
class PersonalizedFilterUtils {
|
6
43
|
/**
|
7
44
|
* Cria uma expressão de filtro a partir de um IExpressionItem.
|
@@ -30,16 +67,16 @@ class PersonalizedFilterUtils {
|
|
30
67
|
expression += ` IS ${FilterOperand[expressionItem.operand]}`;
|
31
68
|
break;
|
32
69
|
case "LIKE":
|
33
|
-
expression += ` LIKE
|
70
|
+
expression += ` LIKE '%${value}%'`;
|
34
71
|
break;
|
35
72
|
case "START_WITH":
|
36
|
-
expression += ` LIKE ${
|
73
|
+
expression += ` LIKE '${value}%'`;
|
37
74
|
break;
|
38
75
|
case "FINISHED_WITH":
|
39
|
-
expression += ` LIKE
|
76
|
+
expression += ` LIKE '%${value}'`;
|
40
77
|
break;
|
41
78
|
default:
|
42
|
-
value =
|
79
|
+
value = typeof value === 'string' ? `${commas}${value}${commas}` : value;
|
43
80
|
expression += ` ${FilterOperand[expressionItem.operand]} ${value}`;
|
44
81
|
}
|
45
82
|
return expression;
|
@@ -151,7 +188,7 @@ class PersonalizedFilterUtils {
|
|
151
188
|
value: (value, byPassValue) => {
|
152
189
|
if (byPassValue)
|
153
190
|
return true;
|
154
|
-
return
|
191
|
+
return value != undefined;
|
155
192
|
},
|
156
193
|
operand: (value) => !!value
|
157
194
|
};
|
@@ -224,4 +261,4 @@ class PersonalizedFilterUtils {
|
|
224
261
|
}
|
225
262
|
}
|
226
263
|
|
227
|
-
export { PersonalizedFilterUtils as P };
|
264
|
+
export { FilterOperand as F, PersonalizedFilterUtils as P, FilterConfigType as a, FilterEntities as b, FilterUserConfigTypes as c };
|
@@ -361,7 +361,10 @@ const snkPersonalizedFilterMessages = {
|
|
361
361
|
labelNameFilter: "Nome do filtro",
|
362
362
|
labelExpression: "Expressão SQL",
|
363
363
|
badgeVariable: "variável",
|
364
|
-
noDataFound: "Nenhum filtro encontrado"
|
364
|
+
noDataFound: "Nenhum filtro encontrado",
|
365
|
+
condition: "Condição",
|
366
|
+
addGroup: "Adicionar grupo",
|
367
|
+
applyExpression: "Expressão a ser aplicada:"
|
365
368
|
},
|
366
369
|
confirmExpression: {
|
367
370
|
title: "Aviso",
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { UserInterface, DateUtils } from '@sankhyalabs/core';
|
2
|
+
|
3
|
+
class SnkMultiSelectionListDataSource {
|
4
|
+
setDataUnit(dataUnit) {
|
5
|
+
this._dataUnit = dataUnit;
|
6
|
+
}
|
7
|
+
setApplication(application) {
|
8
|
+
this._application = application;
|
9
|
+
}
|
10
|
+
formatLabel(fieldName, value) {
|
11
|
+
const { userInterface } = this._dataUnit.getField(fieldName);
|
12
|
+
if (userInterface === UserInterface.DATETIME) {
|
13
|
+
return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
|
14
|
+
}
|
15
|
+
return String(this._dataUnit.getFormattedValue(fieldName, value));
|
16
|
+
}
|
17
|
+
fetchData(filterTerm, fieldName) {
|
18
|
+
return new Promise(resolve => {
|
19
|
+
this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
|
20
|
+
resolve(result.map(item => {
|
21
|
+
const field = this._dataUnit.getField(fieldName);
|
22
|
+
if (field.userInterface === UserInterface.SEARCH) {
|
23
|
+
return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
|
24
|
+
}
|
25
|
+
return { value: item, label: this.formatLabel(fieldName, item), check: true };
|
26
|
+
}));
|
27
|
+
});
|
28
|
+
});
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
export { SnkMultiSelectionListDataSource as S };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
var PresentationMode;
|
2
|
+
(function (PresentationMode) {
|
3
|
+
PresentationMode["PRIMARY"] = "primary";
|
4
|
+
PresentationMode["SECONDARY"] = "secondary";
|
5
|
+
})(PresentationMode || (PresentationMode = {}));
|
6
|
+
var DataExporterOption;
|
7
|
+
(function (DataExporterOption) {
|
8
|
+
DataExporterOption["EXPORT_TO_PDF"] = "exportToPDF";
|
9
|
+
DataExporterOption["EXPORT_TO_XLS"] = "exportToXLS";
|
10
|
+
DataExporterOption["EXPORT_CURRENT_PAGE"] = "exportCurrentPage";
|
11
|
+
DataExporterOption["EXPORT_PAGE_TO_PDF"] = "exportPageToPDF";
|
12
|
+
DataExporterOption["EXPORT_PAGE_TO_XLS"] = "exportPageToXLS";
|
13
|
+
DataExporterOption["EXPORT_BY_EMAIL"] = "exportToEmail";
|
14
|
+
DataExporterOption["EXPORT_PDF_TO_EMAIL"] = "exportPDFToEmail";
|
15
|
+
DataExporterOption["EXPORT_XLS_TO_EMAIL"] = "exportXLSToEmail";
|
16
|
+
})(DataExporterOption || (DataExporterOption = {}));
|
17
|
+
var DataExporterFormat;
|
18
|
+
(function (DataExporterFormat) {
|
19
|
+
DataExporterFormat["PDF"] = "exportPDFToEmail";
|
20
|
+
DataExporterFormat["XLS"] = "exportXLSToEmail";
|
21
|
+
DataExporterFormat["XLSX"] = "exportXLSToEmail";
|
22
|
+
})(DataExporterFormat || (DataExporterFormat = {}));
|
23
|
+
var DataExporterType;
|
24
|
+
(function (DataExporterType) {
|
25
|
+
DataExporterType["EXPORT_TO_PDF"] = "PDF";
|
26
|
+
DataExporterType["EXPORT_TO_XLS"] = "XLS";
|
27
|
+
DataExporterType["EXPORT_PAGE_TO_PDF"] = "PDF";
|
28
|
+
DataExporterType["EXPORT_PAGE_TO_XLS"] = "XLS";
|
29
|
+
DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
|
30
|
+
DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
|
31
|
+
})(DataExporterType || (DataExporterType = {}));
|
32
|
+
|
33
|
+
export { DataExporterOption as D, PresentationMode as P, DataExporterFormat as a, DataExporterType as b };
|