@sankhyalabs/sankhyablocks 9.2.0-dev.2 → 9.2.0-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-1931defc.js → ConfigStorage-8b6def32.js} +2 -2
- package/dist/cjs/{DataFetcher-ad9fb3bb.js → DataFetcher-2c37b6a1.js} +52 -1
- package/dist/cjs/{ISave-18ffb73e.js → ISave-b22b3cf0.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-65e5288e.js → SnkFormConfigManager-477a27de.js} +2 -2
- package/dist/cjs/{ClientSideExporterProvider-994f6e26.js → SnkMultiSelectionListDataSource-b7ab26ba.js} +82 -79
- package/dist/cjs/{auth-fetcher-afbe69ab.js → auth-fetcher-78a90b36.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-c7253b02.js → dataunit-fetcher-877944a9.js} +1 -1
- package/dist/cjs/filter-validate-6993f6f2.js +30 -0
- package/dist/cjs/{form-config-fetcher-f6e66d64.js → form-config-fetcher-dee08eb4.js} +1 -1
- package/dist/cjs/{index-0ad2baeb.js → index-13d05f03.js} +21 -5
- package/dist/cjs/index-1cf293c1.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_8.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +6 -9
- package/dist/cjs/snk-attach.cjs.entry.js +7 -7
- package/dist/cjs/snk-crud.cjs.entry.js +7 -7
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-448fce74.js → snk-data-unit-6b0101fe.js} +13 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
- package/dist/cjs/snk-entity-list.cjs.entry.js +10 -3
- package/dist/cjs/snk-expression-group_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +189 -115
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +23 -2
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +20 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +25 -8
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -14
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +16 -3
- package/dist/cjs/snk-filter-number.cjs.entry.js +34 -3
- package/dist/cjs/snk-filter-period.cjs.entry.js +59 -14
- package/dist/cjs/snk-filter-search.cjs.entry.js +14 -3
- package/dist/cjs/snk-filter-text.cjs.entry.js +18 -1
- package/dist/cjs/snk-form_2.cjs.entry.js +31 -5
- package/dist/cjs/snk-grid.cjs.entry.js +158 -66
- package/dist/cjs/{snk-guides-viewer-c23ed218.js → snk-guides-viewer-38277265.js} +6 -6
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -6
- package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
- package/dist/cjs/snk-simple-bar.cjs.entry.js +5 -5
- package/dist/cjs/snk-simple-crud.cjs.entry.js +60 -23
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-3b74cd21.js → taskbar-elements-fb5d1e08.js} +1 -1
- package/dist/collection/components/snk-application/snk-application.js +0 -2
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +4 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +173 -28
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +28 -4
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +315 -114
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
- package/dist/collection/components/snk-form/snk-form.js +133 -22
- package/dist/collection/components/snk-grid/snk-grid.js +488 -133
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +83 -21
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -14
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +9 -9
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +414 -119
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +102 -36
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -0
- package/dist/collection/lib/http/data-fetcher/custom-xhr-override.js +39 -0
- package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
- package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
- package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
- package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
- package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
- package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
- package/dist/components/ContinuousInsertUtils.js +4 -1
- package/dist/components/DataFetcher.js +52 -1
- package/dist/components/index2.js +21 -5
- package/dist/components/snk-application2.js +0 -3
- package/dist/components/snk-crud.js +62 -44
- package/dist/components/snk-data-unit2.js +11 -1
- package/dist/components/snk-detail-view2.js +89 -56
- package/dist/components/snk-entity-list.js +11 -3
- package/dist/components/snk-filter-bar2.js +103 -108
- package/dist/components/snk-filter-binary-select.js +27 -3
- package/dist/components/snk-filter-checkbox-list.js +24 -3
- package/dist/components/snk-filter-detail2.js +28 -9
- package/dist/components/snk-filter-item2.js +70 -8
- package/dist/components/snk-filter-modal-item2.js +7 -12
- package/dist/components/snk-filter-modal.js +1 -325
- package/dist/components/snk-filter-modal2.js +391 -0
- package/dist/components/snk-filter-multi-select.js +19 -4
- package/dist/components/snk-filter-number.js +38 -4
- package/dist/components/snk-filter-period.js +64 -16
- package/dist/components/snk-filter-search.js +17 -4
- package/dist/components/snk-filter-text.js +22 -2
- package/dist/components/snk-form.js +29 -2
- package/dist/components/snk-grid2.js +188 -75
- package/dist/components/snk-personalized-filter2.js +10 -2
- package/dist/components/snk-simple-bar2.js +5 -5
- package/dist/components/snk-simple-crud2.js +45 -8
- package/dist/esm/{ConfigStorage-b5a1dba3.js → ConfigStorage-22eace3a.js} +2 -2
- package/dist/esm/{DataFetcher-6f6de657.js → DataFetcher-f6b2961a.js} +52 -1
- package/dist/esm/{ISave-7ecdca20.js → ISave-6b7b0423.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-34fc1dc7.js → SnkFormConfigManager-968b97e7.js} +2 -2
- package/dist/esm/{ClientSideExporterProvider-7c2781f4.js → SnkMultiSelectionListDataSource-1136c4e7.js} +87 -84
- package/dist/esm/{auth-fetcher-7332a9a9.js → auth-fetcher-cf39e42b.js} +1 -1
- package/dist/esm/{dataunit-fetcher-f21cbad0.js → dataunit-fetcher-6314b19d.js} +1 -1
- package/dist/esm/filter-validate-d765d450.js +27 -0
- package/dist/esm/{form-config-fetcher-6ab4e805.js → form-config-fetcher-bc6f0f1f.js} +1 -1
- package/dist/esm/{index-b72af127.js → index-446f9341.js} +21 -5
- package/dist/esm/index-479e1293.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +4 -4
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_8.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +6 -9
- package/dist/esm/snk-attach.entry.js +7 -7
- package/dist/esm/snk-crud.entry.js +7 -7
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-b7e6e7a6.js → snk-data-unit-d4a42b59.js} +13 -3
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +9 -9
- package/dist/esm/snk-entity-list.entry.js +10 -3
- package/dist/esm/snk-expression-group_2.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +190 -116
- package/dist/esm/snk-filter-binary-select.entry.js +23 -2
- package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
- package/dist/esm/snk-filter-detail.entry.js +25 -8
- package/dist/esm/snk-filter-modal-item.entry.js +9 -14
- package/dist/esm/snk-filter-multi-select.entry.js +16 -3
- package/dist/esm/snk-filter-number.entry.js +34 -3
- package/dist/esm/snk-filter-period.entry.js +59 -14
- package/dist/esm/snk-filter-search.entry.js +14 -3
- package/dist/esm/snk-filter-text.entry.js +18 -1
- package/dist/esm/snk-form_2.entry.js +31 -5
- package/dist/esm/snk-grid.entry.js +152 -60
- package/dist/esm/{snk-guides-viewer-fbfece85.js → snk-guides-viewer-19cb7f1f.js} +6 -6
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +14 -6
- package/dist/esm/snk-pesquisa.entry.js +4 -4
- package/dist/esm/snk-simple-bar.entry.js +5 -5
- package/dist/esm/snk-simple-crud.entry.js +55 -18
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-171476d4.js → taskbar-elements-faaf5d8f.js} +1 -1
- package/dist/sankhyablocks/{p-0e495575.js → p-0237c565.js} +1 -1
- package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
- package/dist/sankhyablocks/{p-8d1508aa.entry.js → p-0affc07a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ad2ae575.entry.js → p-0e1f0344.entry.js} +1 -1
- package/dist/sankhyablocks/p-29cacaf3.entry.js +1 -0
- package/dist/sankhyablocks/{p-eb0616d3.entry.js → p-32450ea2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b49281be.entry.js → p-3c29939c.entry.js} +1 -1
- package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
- package/dist/sankhyablocks/{p-4872dc3a.entry.js → p-44c5ec49.entry.js} +1 -1
- package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
- package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
- package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
- package/dist/sankhyablocks/p-505172c8.entry.js +1 -0
- package/dist/sankhyablocks/p-55798617.js +1 -0
- package/dist/sankhyablocks/{p-158adf33.entry.js → p-605ef7b2.entry.js} +1 -1
- package/dist/sankhyablocks/p-658f67a5.js +1 -0
- package/dist/sankhyablocks/p-72a9285d.entry.js +1 -0
- package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
- package/dist/sankhyablocks/p-88b7bc09.js +1 -0
- package/dist/sankhyablocks/{p-c6331595.js → p-8d256def.js} +1 -1
- package/dist/sankhyablocks/p-8f37b75b.entry.js +1 -0
- package/dist/sankhyablocks/{p-b35574b5.js → p-9062d640.js} +1 -1
- package/dist/sankhyablocks/{p-72c8c847.entry.js → p-95c71f5e.entry.js} +1 -1
- package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
- package/dist/sankhyablocks/{p-eacff4b7.entry.js → p-b2d7f4cd.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6a015ba2.js → p-b7f5caf6.js} +1 -1
- package/dist/sankhyablocks/p-b9200e77.entry.js +11 -0
- package/dist/sankhyablocks/{p-7de79adf.js → p-b987e15d.js} +1 -1
- package/dist/sankhyablocks/{p-ba4979b4.js → p-bf017a1f.js} +1 -1
- package/dist/sankhyablocks/{p-735a1175.entry.js → p-c3dbf441.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3dba3468.js → p-c71dcb2d.js} +1 -1
- package/dist/sankhyablocks/{p-5e282b33.entry.js → p-c95f20d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-c98e2085.js +1 -0
- package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
- package/dist/sankhyablocks/p-d03ae54e.entry.js +1 -0
- package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
- package/dist/sankhyablocks/p-d75a732c.js +1 -0
- package/dist/sankhyablocks/{p-f39b0ebe.entry.js → p-df7979fd.entry.js} +1 -1
- package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
- package/dist/sankhyablocks/{p-d377aa7a.entry.js → p-f8e87cf1.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +46 -3
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +60 -30
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
- package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
- package/dist/types/components/snk-form/snk-form.d.ts +29 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +132 -58
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +53 -5
- package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +44 -6
- package/dist/types/components/snk-simple-bar/snk-simple-bar.d.ts +15 -15
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +100 -43
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +23 -21
- package/dist/types/components.d.ts +771 -255
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/package.json +4 -3
- package/dist/collection/lib/licenses/sankhyalicense.module.js +0 -1
- package/dist/sankhyablocks/p-012208e0.entry.js +0 -1
- package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
- package/dist/sankhyablocks/p-0dac8fef.js +0 -1
- package/dist/sankhyablocks/p-1210500e.js +0 -1
- package/dist/sankhyablocks/p-16fc4acd.js +0 -1
- package/dist/sankhyablocks/p-25209340.entry.js +0 -1
- package/dist/sankhyablocks/p-295b83ae.entry.js +0 -1
- package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
- package/dist/sankhyablocks/p-4e63ffed.entry.js +0 -1
- package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
- package/dist/sankhyablocks/p-5c7af8a9.entry.js +0 -1
- package/dist/sankhyablocks/p-81769310.entry.js +0 -11
- package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
- package/dist/sankhyablocks/p-a349689a.js +0 -1
- package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
- package/dist/sankhyablocks/p-a86eee47.entry.js +0 -1
- package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
- package/dist/sankhyablocks/p-c9e6d720.js +0 -1
- package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
- package/dist/sankhyablocks/p-fa18530e.entry.js +0 -1
@@ -2,18 +2,20 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
2
2
|
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, LockManager, LockManagerOperation } from '@sankhyalabs/core';
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
5
|
+
import { a as FilterOperand, P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
5
6
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
7
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
7
|
-
import { a as FilterOperand, P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
8
8
|
import { F as FilterNumberVariation } from './filterNumberVariation.js';
|
9
|
-
import {
|
10
|
-
import { d as defineCustomElement$
|
11
|
-
import { d as defineCustomElement$
|
12
|
-
import { d as defineCustomElement$
|
13
|
-
import { d as defineCustomElement$
|
14
|
-
import { d as defineCustomElement$
|
15
|
-
import { d as defineCustomElement$
|
16
|
-
import { d as defineCustomElement$
|
9
|
+
import { d as defineCustomElement$d } from './snk-default-filter2.js';
|
10
|
+
import { d as defineCustomElement$c } from './snk-expression-group2.js';
|
11
|
+
import { d as defineCustomElement$b } from './snk-expression-item2.js';
|
12
|
+
import { d as defineCustomElement$a } from './snk-filter-advanced-mode2.js';
|
13
|
+
import { d as defineCustomElement$9 } from './snk-filter-assistent-mode2.js';
|
14
|
+
import { d as defineCustomElement$8 } from './snk-filter-detail2.js';
|
15
|
+
import { d as defineCustomElement$7 } from './snk-filter-field-search2.js';
|
16
|
+
import { d as defineCustomElement$6 } from './snk-filter-item2.js';
|
17
|
+
import { d as defineCustomElement$5 } from './snk-filter-modal2.js';
|
18
|
+
import { d as defineCustomElement$4 } from './snk-filter-modal-item2.js';
|
17
19
|
import { d as defineCustomElement$3 } from './snk-filter-param-config2.js';
|
18
20
|
import { d as defineCustomElement$2 } from './snk-personalized-filter2.js';
|
19
21
|
import { d as defineCustomElement$1 } from './snk-simple-bar2.js';
|
@@ -208,51 +210,6 @@ function buildPersonalized(item) {
|
|
208
210
|
return { name: id, expression, params };
|
209
211
|
}
|
210
212
|
|
211
|
-
class SnkFilterModalFactory {
|
212
|
-
constructor({ filterConfig, configName, onComplete, getMessage, disablePersonalizedFilter, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
|
213
|
-
this._filterConfig = filterConfig;
|
214
|
-
this._configName = configName;
|
215
|
-
this._onComplete = onComplete;
|
216
|
-
this._getMessage = getMessage;
|
217
|
-
this._disablePersonalizedFilter = disablePersonalizedFilter;
|
218
|
-
this._addPersonalizedFilterFn = onAddPersonalizedFilter;
|
219
|
-
this._editPersonalizedFilterFn = onEditPersonalizedFilter;
|
220
|
-
this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
|
221
|
-
}
|
222
|
-
applyFilters(newFilterConfig) {
|
223
|
-
this._onComplete(newFilterConfig);
|
224
|
-
this._closeModal();
|
225
|
-
}
|
226
|
-
buildFilterModal() {
|
227
|
-
const filterModal = document.createElement("snk-filter-modal");
|
228
|
-
filterModal.className = "ez-size-height--full";
|
229
|
-
filterModal.filters = this._filterConfig;
|
230
|
-
filterModal.configName = this._configName;
|
231
|
-
filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
|
232
|
-
filterModal.getMessage = this._getMessage.bind(this);
|
233
|
-
filterModal.applyFilters = this.applyFilters.bind(this);
|
234
|
-
filterModal.closeModal = () => this._closeModal();
|
235
|
-
filterModal.addPersonalizedFilter = (isDefault) => this._addPersonalizedFilterFn(isDefault);
|
236
|
-
filterModal.editPersonalizedFilter = (id, isDefault) => this._editPersonalizedFilterFn(id, isDefault);
|
237
|
-
filterModal.deletePersonalizedFilter = (filter, configName, isDefault) => this._onDeletePersonalizedFilter(filter, configName, isDefault);
|
238
|
-
return filterModal;
|
239
|
-
}
|
240
|
-
async showModal() {
|
241
|
-
const filterModal = this.buildFilterModal();
|
242
|
-
const modalProps = {
|
243
|
-
content: filterModal,
|
244
|
-
position: 'right',
|
245
|
-
heightMode: 'full',
|
246
|
-
closeOutsideClick: false,
|
247
|
-
useScrimLight: true
|
248
|
-
};
|
249
|
-
this._closeModal = await ApplicationUtils.showModal(modalProps);
|
250
|
-
}
|
251
|
-
async closeModal() {
|
252
|
-
this._closeModal();
|
253
|
-
}
|
254
|
-
}
|
255
|
-
|
256
213
|
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:1fr minmax(100px, 100%) 1fr 1fr;--snk-personalized-filter--z-index:var(--elevation--20, 20);--snk-personalized-filter--background-color:var(--background--xlight, #fff)}.snk-filter-bar__title.sc-snk-filter-bar{max-width:260px;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:16px;font-family:var(--font-pattern, Arial);font-weight:var(--text-weight--large, 600);color:var(--color--title-primary, #2B3A54);margin-top:12px}[data-mode=\"hidden\"].sc-snk-filter-bar-h{width:0px;height:0px}[data-mode=\"button\"].sc-snk-filter-bar-h{grid-template-columns:1fr;width:fit-content}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.filter-bar__personalized-filter.sc-snk-filter-bar{display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;z-index:var(--snk-personalized-filter--z-index);background-color:var(--snk-personalized-filter--background-color)}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small);height:80%}.snk-filter-bar__filter-item-container.sc-snk-filter-bar{display:flex;align-items:start;margin:var(--space--2, 2px) 0}.snk-filter-bar__scroller.sc-snk-filter-bar .sc-snk-filter-bar:first-child{margin-left:var(--space-extra-small, 3px)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
257
214
|
|
258
215
|
const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
@@ -294,10 +251,13 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
294
251
|
this.filterBarLegacyConfigName = undefined;
|
295
252
|
this.autoLoad = undefined;
|
296
253
|
this.afterApplyConfig = undefined;
|
254
|
+
this.filterCustomConfig = undefined;
|
255
|
+
this.filterCustomConfigInterceptor = undefined;
|
297
256
|
this.allowDefault = undefined;
|
298
257
|
this.scrollerLocked = false;
|
299
258
|
this.showPersonalizedFilter = false;
|
300
259
|
this.personalizedFilterId = undefined;
|
260
|
+
this.isFilterModalOpen = false;
|
301
261
|
}
|
302
262
|
hasValidValue(item) {
|
303
263
|
if (item.value === undefined || item.value === null)
|
@@ -346,22 +306,28 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
346
306
|
this.processAfterUpdateConfig();
|
347
307
|
}
|
348
308
|
/**
|
349
|
-
* Faz o recarregamento da
|
309
|
+
* @description Faz o recarregamento da barra de filtros buscando o state no servidor.
|
310
|
+
* @async
|
311
|
+
* @return {Promise<void>} Retorna uma Promise que resolve quando o recarregamento for concluído.
|
350
312
|
*/
|
351
313
|
async reload() {
|
352
314
|
this.loadConfigFromStorage(true);
|
353
315
|
}
|
354
316
|
/**
|
355
|
-
* Retorna um item de filtro pelo ID.
|
317
|
+
* @description Retorna um item de filtro pelo ID.
|
318
|
+
* @async
|
319
|
+
* @param {string} id - ID do item de filtro.
|
320
|
+
* @returns {Promise<SnkFilterItemConfig | undefined>} O item de filtro correspondente ou undefined se não for encontrado.
|
356
321
|
*/
|
357
322
|
async getFilterItem(id) {
|
358
323
|
const item = this.filterConfig.find(item => item.id === id);
|
359
324
|
return Promise.resolve(ObjectUtils.copy(item));
|
360
325
|
}
|
361
326
|
/**
|
362
|
-
* Atualiza um item do filtro.
|
363
|
-
*
|
364
|
-
* @param
|
327
|
+
* @description Atualiza um item do filtro.
|
328
|
+
* @async
|
329
|
+
* @param {SnkFilterItemConfig} newFilterItem - Item com as informações atualizadas, caso o item não seja encontrado no array, ele não será modificado.
|
330
|
+
* @return {Promise<void>} Retorna uma Promise que resolve quando a atualização for concluída.
|
365
331
|
*/
|
366
332
|
async updateFilterItem(newFilterItem) {
|
367
333
|
const itemIndex = this.filterConfig.findIndex(item => item.id === newFilterItem.id);
|
@@ -374,9 +340,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
374
340
|
return Promise.resolve();
|
375
341
|
}
|
376
342
|
/**
|
377
|
-
* Adiciona um item de filtro.
|
378
|
-
*
|
379
|
-
* @param filterItem - Item a ser adicionado, caso o item já exista com o ID ele não será adicionado novamente
|
343
|
+
* @description Adiciona um item de filtro.
|
344
|
+
* @async
|
345
|
+
* @param {SnkFilterItemConfig} filterItem - Item a ser adicionado, caso o item já exista com o ID, ele não será adicionado novamente.
|
346
|
+
* @return {Promise<void>} Retorna uma Promise que resolve quando o item for adicionado.
|
380
347
|
*/
|
381
348
|
async addFilterItem(filterItem) {
|
382
349
|
const itemIndex = this.filterConfig.findIndex(item => item.id === filterItem.id);
|
@@ -390,11 +357,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
390
357
|
return Promise.resolve();
|
391
358
|
}
|
392
359
|
/**
|
393
|
-
* Remove um item de filtro.
|
394
|
-
*
|
395
|
-
* @param filterID - ID do a ser
|
396
|
-
*
|
397
|
-
* @returns {Promise<SnkFilterItemConfig|undefined>} - Retorna o item de filtro removido, ou undefined caso não encontrado.
|
360
|
+
* @description Remove um item de filtro.
|
361
|
+
* @async
|
362
|
+
* @param {string} filterID - ID do item a ser removido.
|
363
|
+
* @returns {Promise<SnkFilterItemConfig|undefined>} Retorna o item de filtro removido, ou undefined caso não seja encontrado.
|
398
364
|
*/
|
399
365
|
async removeFilterItem(filterID) {
|
400
366
|
const itemIndex = this.filterConfig.findIndex(item => item.id === filterID);
|
@@ -439,7 +405,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
439
405
|
return;
|
440
406
|
}
|
441
407
|
this._loadingPending = false;
|
442
|
-
this.doLoadData(
|
408
|
+
this.doLoadData();
|
443
409
|
}
|
444
410
|
if (this._configUpdated) {
|
445
411
|
this._configUpdated = false;
|
@@ -466,7 +432,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
466
432
|
}
|
467
433
|
/**
|
468
434
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
469
|
-
* através de um pequeno
|
435
|
+
* através de um pequeno módulo na estrutura da aplicação:
|
470
436
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
471
437
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-bar.msg.ts"
|
472
438
|
*/
|
@@ -477,6 +443,9 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
477
443
|
}
|
478
444
|
return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
|
479
445
|
}
|
446
|
+
async getFilters() {
|
447
|
+
return this.getFilter(null);
|
448
|
+
}
|
480
449
|
getFilter(_dataUnit) {
|
481
450
|
var _a;
|
482
451
|
const filters = [];
|
@@ -535,11 +504,11 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
535
504
|
const unpinnedItems = [];
|
536
505
|
this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
|
537
506
|
.filter(this.filterActiveFilter)
|
538
|
-
.forEach((item
|
507
|
+
.forEach((item) => {
|
539
508
|
item = ObjectUtils.copy(item);
|
540
509
|
const itemId = `filter-${item.id}`;
|
541
|
-
const filterItem = (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:
|
542
|
-
if (item.fixed || item.hardFixed) {
|
510
|
+
const filterItem = (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: "ez-margin-horizontal--extra-small", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
|
511
|
+
if (item.fixed || item.hardFixed || item.required) {
|
543
512
|
pinnedItems.push(filterItem);
|
544
513
|
}
|
545
514
|
else {
|
@@ -548,9 +517,9 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
548
517
|
return filterItem;
|
549
518
|
});
|
550
519
|
const elements = [];
|
551
|
-
elements.push(...pinnedItems);
|
520
|
+
elements.push(...pinnedItems.reverse());
|
552
521
|
if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
|
553
|
-
elements.push(h("hr", { class: "ez-
|
522
|
+
elements.push(h("hr", { class: "ez-margin-horizontal--small ez-margin-vertical--auto ez-divider-vertical ez-divider--dark snk-filter-bar__divider" }));
|
554
523
|
}
|
555
524
|
elements.push(...unpinnedItems);
|
556
525
|
return elements;
|
@@ -575,7 +544,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
575
544
|
return normalized;
|
576
545
|
}
|
577
546
|
updateFilter(newItem) {
|
578
|
-
|
547
|
+
let config = this.filterConfig.map(item => {
|
579
548
|
newItem = this.normalizeItem(newItem);
|
580
549
|
if (item.id === newItem.id) {
|
581
550
|
if (ObjectUtils.objectToString(item) != ObjectUtils.objectToString(newItem)) {
|
@@ -585,6 +554,10 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
585
554
|
}
|
586
555
|
return item;
|
587
556
|
}).sort((a, b) => this._filtersComparator(a, b));
|
557
|
+
if (this.filterCustomConfigInterceptor) {
|
558
|
+
config = this.filterCustomConfigInterceptor(config);
|
559
|
+
}
|
560
|
+
this.filterConfig = config;
|
588
561
|
}
|
589
562
|
loadPermitions() {
|
590
563
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
@@ -606,6 +579,12 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
606
579
|
else {
|
607
580
|
config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
608
581
|
}
|
582
|
+
if (this.filterCustomConfig) {
|
583
|
+
config = [...this.filterCustomConfig, ...config];
|
584
|
+
}
|
585
|
+
if (this.filterCustomConfigInterceptor) {
|
586
|
+
config = this.filterCustomConfigInterceptor(config);
|
587
|
+
}
|
609
588
|
this.filterConfig = config.map(item => this.normalizeItem(item));
|
610
589
|
this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
|
611
590
|
}
|
@@ -645,33 +624,17 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
645
624
|
this.updateFilter(evt.detail);
|
646
625
|
}
|
647
626
|
/**
|
648
|
-
* Abre o modal de filtros
|
627
|
+
* @description Abre o modal de filtros.
|
628
|
+
* @async
|
649
629
|
*/
|
650
630
|
async showFilterModal() {
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
};
|
656
|
-
let filtersConfigCopy = ObjectUtils.copy(this.filterConfig);
|
657
|
-
filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
|
658
|
-
return itemA.originOrder - itemB.originOrder;
|
659
|
-
});
|
660
|
-
const factoryParams = {
|
661
|
-
filterConfig: filtersConfigCopy,
|
662
|
-
configName: this.configName,
|
663
|
-
onComplete: callbackOnApplyFilter,
|
664
|
-
disablePersonalizedFilter: this.disablePersonalizedFilter,
|
665
|
-
getMessage: (key, props) => this.getMessage(key, props),
|
666
|
-
onAddPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault),
|
667
|
-
onEditPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault),
|
668
|
-
onDeletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, FilterItemType.PERSONALIZED, configName, isDefault),
|
669
|
-
};
|
670
|
-
this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
|
671
|
-
await this._filterModalFactory.showModal();
|
631
|
+
if (this.isFilterModalOpen) {
|
632
|
+
return; // Evita abrir múltiplos modais
|
633
|
+
}
|
634
|
+
this.isFilterModalOpen = true;
|
672
635
|
}
|
673
636
|
addPersonalizedFilter(isDefault = false) {
|
674
|
-
this.
|
637
|
+
this.isFilterModalOpen = false;
|
675
638
|
this._isDefaultFilter = isDefault;
|
676
639
|
this.personalizedFilterId = undefined;
|
677
640
|
this.showPersonalizedFilter = true;
|
@@ -680,7 +643,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
680
643
|
});
|
681
644
|
}
|
682
645
|
editPersonalizedFilter(id, isDefault = false) {
|
683
|
-
this.
|
646
|
+
this.isFilterModalOpen = false;
|
684
647
|
this._isDefaultFilter = isDefault;
|
685
648
|
this.showPersonalizedFilter = true;
|
686
649
|
this.personalizedFilterId = id;
|
@@ -695,6 +658,15 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
695
658
|
ConfigStorage.removePersonalizedFilter(filter, this.resourceID, configName);
|
696
659
|
}
|
697
660
|
}
|
661
|
+
closeFilterModal() {
|
662
|
+
this.isFilterModalOpen = false;
|
663
|
+
}
|
664
|
+
applyFiltersFromModal(filters) {
|
665
|
+
var _a;
|
666
|
+
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
667
|
+
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
668
|
+
this.isFilterModalOpen = false;
|
669
|
+
}
|
698
670
|
handleHidePersonalizedFilter(reloadFilterBar) {
|
699
671
|
if (reloadFilterBar) {
|
700
672
|
this.loadConfigFromStorage().then(() => {
|
@@ -741,10 +713,14 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
741
713
|
if (this.showPersonalizedFilter) {
|
742
714
|
return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, isDefaultFilter: this._isDefaultFilter, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
|
743
715
|
}
|
716
|
+
let filtersConfigCopy = ObjectUtils.copy(this.filterConfig);
|
717
|
+
filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
|
718
|
+
return itemA.originOrder - itemB.originOrder;
|
719
|
+
});
|
744
720
|
if (this.mode !== "regular") {
|
745
|
-
return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) }))));
|
721
|
+
return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) })), h("snk-filter-modal", { opened: this.isFilterModalOpen, filterConfig: this.filterConfig, configName: this.configName, disablePersonalizedFilter: this.disablePersonalizedFilter, getMessage: (key, props) => this.getMessage(key, props), applyFilters: (filters) => this.applyFiltersFromModal(filters), closeModal: () => this.closeFilterModal(), addPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault), editPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault), deletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, FilterItemType.PERSONALIZED, configName, isDefault), filterCustomConfigInterceptor: this.filterCustomConfigInterceptor })));
|
746
722
|
}
|
747
|
-
return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium ez-margin-top--extra-small", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
723
|
+
return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium ez-margin-top--extra-small", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, this.getMessage("snkFilterBar.filters")), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" })), h("snk-filter-modal", { opened: this.isFilterModalOpen, filterConfig: this.filterConfig, configName: this.configName, disablePersonalizedFilter: this.disablePersonalizedFilter, getMessage: (key, props) => this.getMessage(key, props), applyFilters: (filters) => this.applyFiltersFromModal(filters), closeModal: () => this.closeFilterModal(), addPersonalizedFilter: (isDefault) => this.addPersonalizedFilter(isDefault), editPersonalizedFilter: (id, isDefault) => this.editPersonalizedFilter(id, isDefault), deletePersonalizedFilter: (filter, configName, isDefault) => this.deletePersonalizedFilter(filter, FilterItemType.PERSONALIZED, configName, isDefault), filterCustomConfigInterceptor: this.filterCustomConfigInterceptor })));
|
748
724
|
}
|
749
725
|
get _element() { return this; }
|
750
726
|
static get watchers() { return {
|
@@ -765,59 +741,78 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
765
741
|
"filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
|
766
742
|
"autoLoad": [4, "auto-load"],
|
767
743
|
"afterApplyConfig": [16],
|
744
|
+
"filterCustomConfig": [16],
|
745
|
+
"filterCustomConfigInterceptor": [16],
|
768
746
|
"allowDefault": [32],
|
769
747
|
"scrollerLocked": [32],
|
770
748
|
"showPersonalizedFilter": [32],
|
771
749
|
"personalizedFilterId": [32],
|
750
|
+
"isFilterModalOpen": [32],
|
772
751
|
"reload": [64],
|
773
752
|
"getFilterItem": [64],
|
774
753
|
"updateFilterItem": [64],
|
775
754
|
"addFilterItem": [64],
|
776
755
|
"removeFilterItem": [64],
|
756
|
+
"getFilters": [64],
|
777
757
|
"showFilterModal": [64]
|
778
758
|
}, [[0, "filterChange", "filterChangeListener"]]]);
|
779
759
|
function defineCustomElement() {
|
780
760
|
if (typeof customElements === "undefined") {
|
781
761
|
return;
|
782
762
|
}
|
783
|
-
const components = ["snk-filter-bar", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-param-config", "snk-personalized-filter", "snk-simple-bar"];
|
763
|
+
const components = ["snk-filter-bar", "snk-default-filter", "snk-expression-group", "snk-expression-item", "snk-filter-advanced-mode", "snk-filter-assistent-mode", "snk-filter-detail", "snk-filter-field-search", "snk-filter-item", "snk-filter-modal", "snk-filter-modal-item", "snk-filter-param-config", "snk-personalized-filter", "snk-simple-bar"];
|
784
764
|
components.forEach(tagName => { switch (tagName) {
|
785
765
|
case "snk-filter-bar":
|
786
766
|
if (!customElements.get(tagName)) {
|
787
767
|
customElements.define(tagName, SnkFilterBar);
|
788
768
|
}
|
789
769
|
break;
|
770
|
+
case "snk-default-filter":
|
771
|
+
if (!customElements.get(tagName)) {
|
772
|
+
defineCustomElement$d();
|
773
|
+
}
|
774
|
+
break;
|
790
775
|
case "snk-expression-group":
|
791
776
|
if (!customElements.get(tagName)) {
|
792
|
-
defineCustomElement$
|
777
|
+
defineCustomElement$c();
|
793
778
|
}
|
794
779
|
break;
|
795
780
|
case "snk-expression-item":
|
796
781
|
if (!customElements.get(tagName)) {
|
797
|
-
defineCustomElement$
|
782
|
+
defineCustomElement$b();
|
798
783
|
}
|
799
784
|
break;
|
800
785
|
case "snk-filter-advanced-mode":
|
801
786
|
if (!customElements.get(tagName)) {
|
802
|
-
defineCustomElement$
|
787
|
+
defineCustomElement$a();
|
803
788
|
}
|
804
789
|
break;
|
805
790
|
case "snk-filter-assistent-mode":
|
806
791
|
if (!customElements.get(tagName)) {
|
807
|
-
defineCustomElement$
|
792
|
+
defineCustomElement$9();
|
808
793
|
}
|
809
794
|
break;
|
810
795
|
case "snk-filter-detail":
|
811
796
|
if (!customElements.get(tagName)) {
|
812
|
-
defineCustomElement$
|
797
|
+
defineCustomElement$8();
|
813
798
|
}
|
814
799
|
break;
|
815
800
|
case "snk-filter-field-search":
|
816
801
|
if (!customElements.get(tagName)) {
|
817
|
-
defineCustomElement$
|
802
|
+
defineCustomElement$7();
|
818
803
|
}
|
819
804
|
break;
|
820
805
|
case "snk-filter-item":
|
806
|
+
if (!customElements.get(tagName)) {
|
807
|
+
defineCustomElement$6();
|
808
|
+
}
|
809
|
+
break;
|
810
|
+
case "snk-filter-modal":
|
811
|
+
if (!customElements.get(tagName)) {
|
812
|
+
defineCustomElement$5();
|
813
|
+
}
|
814
|
+
break;
|
815
|
+
case "snk-filter-modal-item":
|
821
816
|
if (!customElements.get(tagName)) {
|
822
817
|
defineCustomElement$4();
|
823
818
|
}
|
@@ -13,6 +13,7 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
13
13
|
this.value = undefined;
|
14
14
|
this.config = undefined;
|
15
15
|
this.presentationMode = EPresentationMode.CHIP;
|
16
|
+
this.errorMessage = undefined;
|
16
17
|
}
|
17
18
|
isSelected(option) {
|
18
19
|
return this.value == undefined || this.value === option;
|
@@ -21,6 +22,7 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
21
22
|
* Emitido quando acontece a alteração de valor do componente snk-filter-binary-select
|
22
23
|
*/
|
23
24
|
ezChangeListener(evt) {
|
25
|
+
this.errorMessage = undefined;
|
24
26
|
if (this.presentationMode === EPresentationMode.MODAL) {
|
25
27
|
if (!evt.detail) {
|
26
28
|
this.assertCheckedOption(evt.target);
|
@@ -37,6 +39,23 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
37
39
|
async resetValues() {
|
38
40
|
this.ezChangeListener({ detail: this._noOptionValue });
|
39
41
|
}
|
42
|
+
/**
|
43
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
44
|
+
*/
|
45
|
+
async clearValue() {
|
46
|
+
this.value = this.config.value;
|
47
|
+
this._radioButtonValue = this.value || this._noOptionValue;
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Define o foco no componente snk-filter-binary-select.
|
51
|
+
*/
|
52
|
+
async setFocus() {
|
53
|
+
if (this.presentationMode === EPresentationMode.MODAL) {
|
54
|
+
this._checkOne.setFocus();
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
this._element.querySelector('ez-radio-button').focus();
|
58
|
+
}
|
40
59
|
assertCheckedOption(updatingCheck) {
|
41
60
|
if (updatingCheck === this._checkOne) {
|
42
61
|
this._checkTwo.value = true;
|
@@ -78,16 +97,21 @@ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
78
97
|
}
|
79
98
|
const [optOne, optTwo] = this.config.props.options;
|
80
99
|
if (this.presentationMode === EPresentationMode.MODAL) {
|
81
|
-
return (h(Host, null, h("div", { class: "ez-row ez-size-height--full" }, h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: this.isSelected(optOne.name) })), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: this.isSelected(optTwo.name) }))
|
100
|
+
return (h(Host, null, h("div", { class: "ez-row ez-size-height--full" }, h("label", { class: "ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4" }, this.config.detailModal), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkOne = ref, id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, enabled: this.config.enabled, value: this.isSelected(optOne.name) })), h("div", { class: "ez-col ez-col--sd-4" }, h("ez-check", { ref: (ref) => this._checkTwo = ref, id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, enabled: this.config.enabled, value: this.isSelected(optTwo.name) })), this.errorMessage &&
|
101
|
+
h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
|
82
102
|
}
|
83
|
-
return (h(Host, null, h("ez-radio-button", { value: this._radioButtonValue }, h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue }))
|
103
|
+
return (h(Host, null, h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-radio-button", { value: this._radioButtonValue }, h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue })), this.errorMessage &&
|
104
|
+
h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
|
84
105
|
}
|
85
106
|
get _element() { return this; }
|
86
107
|
}, [0, "snk-filter-binary-select", {
|
87
108
|
"value": [1544],
|
88
109
|
"config": [16],
|
89
110
|
"presentationMode": [2, "presentation-mode"],
|
90
|
-
"
|
111
|
+
"errorMessage": [1537, "error-message"],
|
112
|
+
"resetValues": [64],
|
113
|
+
"clearValue": [64],
|
114
|
+
"setFocus": [64]
|
91
115
|
}, [[0, "ezChange", "ezChangeListener"]]]);
|
92
116
|
function defineCustomElement$1() {
|
93
117
|
if (typeof customElements === "undefined") {
|
@@ -8,8 +8,24 @@ const SnkFilterCheckboxList$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
8
8
|
this.__registerHost();
|
9
9
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
10
10
|
this.config = undefined;
|
11
|
+
this.errorMessage = undefined;
|
11
12
|
this.optionsList = [];
|
12
13
|
}
|
14
|
+
/**
|
15
|
+
* Define o foco no componente snk-filter-checkbox-list.
|
16
|
+
*/
|
17
|
+
async setFocus() {
|
18
|
+
var _a, _b;
|
19
|
+
(_b = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector('ez-check')) === null || _b === void 0 ? void 0 : _b.setFocus();
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
23
|
+
*/
|
24
|
+
async clearValue() {
|
25
|
+
var _a;
|
26
|
+
this.config = Object.assign(Object.assign({}, this.config), { value: this.config.value });
|
27
|
+
this.valueChanged.emit((_a = this.config) === null || _a === void 0 ? void 0 : _a.value);
|
28
|
+
}
|
13
29
|
componentDidLoad() {
|
14
30
|
if (this._element) {
|
15
31
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
@@ -17,13 +33,14 @@ const SnkFilterCheckboxList$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
17
33
|
}
|
18
34
|
handleToggleCheck(itemChanged, checked) {
|
19
35
|
var _a, _b;
|
36
|
+
this.errorMessage = undefined;
|
20
37
|
let configValueMap = (_a = this.config.value) !== null && _a !== void 0 ? _a : {};
|
21
38
|
configValueMap[itemChanged.name] = checked;
|
22
39
|
this.config = Object.assign(Object.assign({}, this.config), { value: configValueMap });
|
23
40
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
24
41
|
}
|
25
42
|
renderOptions() {
|
26
|
-
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
|
43
|
+
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name), enabled: this.config.enabled })));
|
27
44
|
}
|
28
45
|
isChecked(itemName) {
|
29
46
|
var _a;
|
@@ -41,12 +58,16 @@ const SnkFilterCheckboxList$1 = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
41
58
|
if (!this.config || this.config.type !== FilterItemType.CHECK_BOX_LIST) {
|
42
59
|
return undefined;
|
43
60
|
}
|
44
|
-
return (h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions()
|
61
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions(), this.errorMessage &&
|
62
|
+
h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
|
45
63
|
}
|
46
64
|
get _element() { return this; }
|
47
65
|
}, [0, "snk-filter-checkbox-list", {
|
48
66
|
"config": [1040],
|
49
|
-
"
|
67
|
+
"errorMessage": [1537, "error-message"],
|
68
|
+
"optionsList": [32],
|
69
|
+
"setFocus": [64],
|
70
|
+
"clearValue": [64]
|
50
71
|
}]);
|
51
72
|
function defineCustomElement$1() {
|
52
73
|
if (typeof customElements === "undefined") {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
|
-
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
|
-
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
5
|
-
import {
|
3
|
+
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
6
4
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
|
5
|
+
import { E as EPresentationMode } from './presentationMode.js';
|
6
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
7
7
|
|
8
8
|
const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
9
9
|
constructor() {
|
@@ -13,13 +13,30 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
13
13
|
this.config = undefined;
|
14
14
|
this.getMessage = undefined;
|
15
15
|
this.showHardFixed = true;
|
16
|
+
this.removalBlocked = false;
|
16
17
|
}
|
17
18
|
/**
|
18
|
-
*
|
19
|
+
* Define o foco no campo do editor.
|
19
20
|
*/
|
20
|
-
async
|
21
|
-
var _a, _b;
|
22
|
-
|
21
|
+
async setFocusField() {
|
22
|
+
var _a, _b, _c, _d;
|
23
|
+
if (!this._editor) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
if (this._editor["setFocus"]) {
|
27
|
+
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
28
|
+
}
|
29
|
+
else if (this._editor["focus"]) {
|
30
|
+
(_d = (_c = this._editor) === null || _c === void 0 ? void 0 : _c["focus"]) === null || _d === void 0 ? void 0 : _d.call(_c);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
async clearValue() {
|
34
|
+
if (!this._editor) {
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
if (this._editor["clearValue"]) {
|
38
|
+
await this._editor["clearValue"]();
|
39
|
+
}
|
23
40
|
}
|
24
41
|
observeConfig(newValue) {
|
25
42
|
var _a, _b;
|
@@ -91,7 +108,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
91
108
|
return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
|
92
109
|
}
|
93
110
|
getPopUpHeaderButtons() {
|
94
|
-
return (h(Fragment, null, !this.config.removalBlocked &&
|
111
|
+
return (h(Fragment, null, !this.removalBlocked && !this.config.removalBlocked &&
|
95
112
|
this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
|
96
113
|
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 })))));
|
97
114
|
}
|
@@ -176,7 +193,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
176
193
|
"config": [1040],
|
177
194
|
"getMessage": [16],
|
178
195
|
"showHardFixed": [4, "show-hard-fixed"],
|
179
|
-
"
|
196
|
+
"removalBlocked": [4, "removal-blocked"],
|
197
|
+
"setFocusField": [64],
|
198
|
+
"clearValue": [64]
|
180
199
|
}]);
|
181
200
|
function defineCustomElement() {
|
182
201
|
if (typeof customElements === "undefined") {
|