@sankhyalabs/sankhyablocks 9.2.0-dev.2 → 9.2.0-dev.21
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-0cfa7622.js} +14 -4
- 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 +174 -29
- 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 +12 -2
- 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-4acf4781.js} +14 -4
- 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-093f58fa.entry.js +1 -0
- package/dist/sankhyablocks/{p-0e495575.js → p-0a317e81.js} +1 -1
- package/dist/sankhyablocks/{p-ad2ae575.entry.js → p-0e1f0344.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8d1508aa.entry.js → p-16c1c209.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-658f67a5.js +1 -0
- package/dist/sankhyablocks/{p-158adf33.entry.js → p-701b024c.entry.js} +1 -1
- 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
@@ -7,37 +7,77 @@ export class SnkFilterPeriod {
|
|
7
7
|
this._startDateLabel = 'Inicial';
|
8
8
|
this._endDateLabel = 'Final';
|
9
9
|
this._toLabel = 'até';
|
10
|
+
this.internalChange = {
|
11
|
+
start: false,
|
12
|
+
end: false
|
13
|
+
};
|
10
14
|
this.config = undefined;
|
11
15
|
this.getMessage = undefined;
|
12
|
-
this.value =
|
16
|
+
this.value = {
|
17
|
+
start: null,
|
18
|
+
end: null
|
19
|
+
};
|
13
20
|
this.presentationMode = EPresentationMode.CHIP;
|
21
|
+
this.errorMessage = undefined;
|
22
|
+
}
|
23
|
+
configChanged(newValue, oldValue) {
|
24
|
+
if (this.internalChange.end) {
|
25
|
+
this.internalChange.end = false;
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
if (this.internalChange.start) {
|
29
|
+
this.internalChange.start = false;
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
|
33
|
+
this.valueStart = this.parseDate(newValue.start);
|
34
|
+
this.valueEnd = this.parseDate(newValue.end);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
ezChangeListener(event, field) {
|
38
|
+
this.errorMessage = undefined;
|
39
|
+
this.internalChange[field] = true;
|
40
|
+
this.value = Object.assign(Object.assign({}, (this.value || {})), { [field]: event.detail ? this.parseDate(event.detail) : null });
|
41
|
+
this.valueChanged.emit(this.value);
|
14
42
|
}
|
15
43
|
/**
|
16
|
-
*
|
44
|
+
* Define o foco no componente snk-filter-period.
|
17
45
|
*/
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
46
|
+
async setFocus() {
|
47
|
+
this._startDate.setFocus();
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
51
|
+
*/
|
52
|
+
async clearValue() {
|
53
|
+
this.value = this.config.value;
|
54
|
+
this.valueStart = this.getDate("start");
|
55
|
+
this.valueEnd = this.getDate("end");
|
23
56
|
}
|
24
57
|
componentDidLoad() {
|
25
58
|
if (this._element) {
|
26
59
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
60
|
+
this._element.querySelectorAll('ez-date-input').forEach(input => {
|
61
|
+
const textInput = input.shadowRoot.querySelector('ez-text-input');
|
62
|
+
textInput.style.setProperty('--ez-text-input__min-width', '120px');
|
63
|
+
});
|
27
64
|
}
|
28
65
|
}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
return objValue;
|
66
|
+
parseDate(date) {
|
67
|
+
if (date instanceof Date) {
|
68
|
+
return date;
|
33
69
|
}
|
34
|
-
if (typeof
|
35
|
-
|
70
|
+
if (typeof date === "string") {
|
71
|
+
date = new Date(date);
|
36
72
|
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
|
37
73
|
return date;
|
38
74
|
}
|
39
75
|
return null;
|
40
76
|
}
|
77
|
+
getDate(prop) {
|
78
|
+
const objValue = this.value ? this.value[prop] : null;
|
79
|
+
return this.parseDate(objValue);
|
80
|
+
}
|
41
81
|
/**
|
42
82
|
* Exibe o componente snk-filter-period
|
43
83
|
*/
|
@@ -55,12 +95,14 @@ export class SnkFilterPeriod {
|
|
55
95
|
this._endDateLabel = this.getMessage('snkFilterBar.labelEnd');
|
56
96
|
this._toLabel = this.getMessage('snkFilterBar.labelTo');
|
57
97
|
}
|
98
|
+
this.valueStart = this.getDate("start");
|
99
|
+
this.valueEnd = this.getDate("end");
|
58
100
|
}
|
59
101
|
render() {
|
60
102
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
61
103
|
return undefined;
|
62
104
|
}
|
63
|
-
return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--
|
105
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startDateLabel, ref: ref => this._startDate = ref, enabled: this.config.enabled, value: this.valueStart, errorMessage: this.errorMessage, onEzChange: (event) => this.ezChangeListener(event, 'start') }), this.buildLabel(), h("ez-date-input", { id: `${this.config.id}_end`, label: this._endDateLabel, ref: ref => this._endDate = ref, enabled: this.config.enabled, value: this.valueEnd, errorMessage: this.errorMessage, onEzChange: (event) => this.ezChangeListener(event, 'end') }))));
|
64
106
|
}
|
65
107
|
static get is() { return "snk-filter-period"; }
|
66
108
|
static get properties() {
|
@@ -101,12 +143,16 @@ export class SnkFilterPeriod {
|
|
101
143
|
}
|
102
144
|
},
|
103
145
|
"value": {
|
104
|
-
"type": "
|
105
|
-
"mutable":
|
146
|
+
"type": "unknown",
|
147
|
+
"mutable": true,
|
106
148
|
"complexType": {
|
107
|
-
"original": "
|
108
|
-
"resolved": "
|
109
|
-
"references": {
|
149
|
+
"original": "Period",
|
150
|
+
"resolved": "Period",
|
151
|
+
"references": {
|
152
|
+
"Period": {
|
153
|
+
"location": "local"
|
154
|
+
}
|
155
|
+
}
|
110
156
|
},
|
111
157
|
"required": false,
|
112
158
|
"optional": false,
|
@@ -114,8 +160,7 @@ export class SnkFilterPeriod {
|
|
114
160
|
"tags": [],
|
115
161
|
"text": "Define o valor do componente snk-filter-period"
|
116
162
|
},
|
117
|
-
"
|
118
|
-
"reflect": false
|
163
|
+
"defaultValue": "{\n start: null,\n end: null\n }"
|
119
164
|
},
|
120
165
|
"presentationMode": {
|
121
166
|
"type": "number",
|
@@ -139,6 +184,23 @@ export class SnkFilterPeriod {
|
|
139
184
|
"attribute": "presentation-mode",
|
140
185
|
"reflect": false,
|
141
186
|
"defaultValue": "EPresentationMode.CHIP"
|
187
|
+
},
|
188
|
+
"errorMessage": {
|
189
|
+
"type": "string",
|
190
|
+
"mutable": true,
|
191
|
+
"complexType": {
|
192
|
+
"original": "string",
|
193
|
+
"resolved": "string",
|
194
|
+
"references": {}
|
195
|
+
},
|
196
|
+
"required": false,
|
197
|
+
"optional": false,
|
198
|
+
"docs": {
|
199
|
+
"tags": [],
|
200
|
+
"text": "Usado para exibir mensagens de erro."
|
201
|
+
},
|
202
|
+
"attribute": "error-message",
|
203
|
+
"reflect": true
|
142
204
|
}
|
143
205
|
};
|
144
206
|
}
|
@@ -162,6 +224,38 @@ export class SnkFilterPeriod {
|
|
162
224
|
}
|
163
225
|
static get methods() {
|
164
226
|
return {
|
227
|
+
"setFocus": {
|
228
|
+
"complexType": {
|
229
|
+
"signature": "() => Promise<void>",
|
230
|
+
"parameters": [],
|
231
|
+
"references": {
|
232
|
+
"Promise": {
|
233
|
+
"location": "global"
|
234
|
+
}
|
235
|
+
},
|
236
|
+
"return": "Promise<void>"
|
237
|
+
},
|
238
|
+
"docs": {
|
239
|
+
"text": "Define o foco no componente snk-filter-period.",
|
240
|
+
"tags": []
|
241
|
+
}
|
242
|
+
},
|
243
|
+
"clearValue": {
|
244
|
+
"complexType": {
|
245
|
+
"signature": "() => Promise<void>",
|
246
|
+
"parameters": [],
|
247
|
+
"references": {
|
248
|
+
"Promise": {
|
249
|
+
"location": "global"
|
250
|
+
}
|
251
|
+
},
|
252
|
+
"return": "Promise<void>"
|
253
|
+
},
|
254
|
+
"docs": {
|
255
|
+
"text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
|
256
|
+
"tags": []
|
257
|
+
}
|
258
|
+
},
|
165
259
|
"show": {
|
166
260
|
"complexType": {
|
167
261
|
"signature": "() => Promise<void>",
|
@@ -181,13 +275,10 @@ export class SnkFilterPeriod {
|
|
181
275
|
};
|
182
276
|
}
|
183
277
|
static get elementRef() { return "_element"; }
|
184
|
-
static get
|
278
|
+
static get watchers() {
|
185
279
|
return [{
|
186
|
-
"
|
187
|
-
"
|
188
|
-
"target": undefined,
|
189
|
-
"capture": false,
|
190
|
-
"passive": false
|
280
|
+
"propName": "value",
|
281
|
+
"methodName": "configChanged"
|
191
282
|
}];
|
192
283
|
}
|
193
284
|
}
|
@@ -6,11 +6,13 @@ export class SnkFilterSearch {
|
|
6
6
|
this._isSearchPlus = false;
|
7
7
|
this.config = undefined;
|
8
8
|
this.value = undefined;
|
9
|
+
this.errorMessage = undefined;
|
9
10
|
}
|
10
11
|
/**
|
11
12
|
* Emitido quando acontece a alteração de valor do componente snk-filter-search
|
12
13
|
*/
|
13
14
|
async ezChangeListener(_evt) {
|
15
|
+
this.errorMessage = undefined;
|
14
16
|
if (this._isSearchPlus) {
|
15
17
|
this.value = await this._searchInput.getValueAsync();
|
16
18
|
}
|
@@ -37,16 +39,25 @@ export class SnkFilterSearch {
|
|
37
39
|
});
|
38
40
|
}
|
39
41
|
/**
|
40
|
-
*
|
42
|
+
* Define o foco no componente snk-filter-search.
|
41
43
|
*/
|
42
|
-
async
|
44
|
+
async setFocus() {
|
43
45
|
this._searchInput.setFocus();
|
44
46
|
}
|
47
|
+
/**
|
48
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
49
|
+
*/
|
50
|
+
async clearValue() {
|
51
|
+
this.value = this.config.value;
|
52
|
+
if (this._searchInput) {
|
53
|
+
this._searchInput.value = this.config.value;
|
54
|
+
}
|
55
|
+
}
|
45
56
|
getInputItem() {
|
46
57
|
var _a;
|
47
58
|
this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
|
48
59
|
const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
|
49
|
-
return (h(TagName, { id: this.config.id, suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, this._isSearchPlus) }));
|
60
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h(TagName, { id: this.config.id, suppressEmptyOption: true, value: this.config.value, label: this.config.label, enabled: this.config.enabled, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, this._isSearchPlus), errorMessage: this.errorMessage })));
|
50
61
|
}
|
51
62
|
render() {
|
52
63
|
if (!this.config || this.config.type !== FilterItemType.SEARCH) {
|
@@ -96,6 +107,23 @@ export class SnkFilterSearch {
|
|
96
107
|
"tags": [],
|
97
108
|
"text": "Define o valor do componente snk-filter-search"
|
98
109
|
}
|
110
|
+
},
|
111
|
+
"errorMessage": {
|
112
|
+
"type": "string",
|
113
|
+
"mutable": true,
|
114
|
+
"complexType": {
|
115
|
+
"original": "string",
|
116
|
+
"resolved": "string",
|
117
|
+
"references": {}
|
118
|
+
},
|
119
|
+
"required": false,
|
120
|
+
"optional": false,
|
121
|
+
"docs": {
|
122
|
+
"tags": [],
|
123
|
+
"text": "Usado para exibir mensagens de erro."
|
124
|
+
},
|
125
|
+
"attribute": "error-message",
|
126
|
+
"reflect": true
|
99
127
|
}
|
100
128
|
};
|
101
129
|
}
|
@@ -119,7 +147,23 @@ export class SnkFilterSearch {
|
|
119
147
|
}
|
120
148
|
static get methods() {
|
121
149
|
return {
|
122
|
-
"
|
150
|
+
"setFocus": {
|
151
|
+
"complexType": {
|
152
|
+
"signature": "() => Promise<void>",
|
153
|
+
"parameters": [],
|
154
|
+
"references": {
|
155
|
+
"Promise": {
|
156
|
+
"location": "global"
|
157
|
+
}
|
158
|
+
},
|
159
|
+
"return": "Promise<void>"
|
160
|
+
},
|
161
|
+
"docs": {
|
162
|
+
"text": "Define o foco no componente snk-filter-search.",
|
163
|
+
"tags": []
|
164
|
+
}
|
165
|
+
},
|
166
|
+
"clearValue": {
|
123
167
|
"complexType": {
|
124
168
|
"signature": "() => Promise<void>",
|
125
169
|
"parameters": [],
|
@@ -131,7 +175,7 @@ export class SnkFilterSearch {
|
|
131
175
|
"return": "Promise<void>"
|
132
176
|
},
|
133
177
|
"docs": {
|
134
|
-
"text": "
|
178
|
+
"text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
|
135
179
|
"tags": []
|
136
180
|
}
|
137
181
|
}
|
@@ -4,14 +4,31 @@ export class SnkFilterText {
|
|
4
4
|
constructor() {
|
5
5
|
this.config = undefined;
|
6
6
|
this.value = undefined;
|
7
|
+
this.errorMessage = undefined;
|
7
8
|
}
|
8
9
|
/**
|
9
10
|
* Emitido quando acontece a alteração de valor do componente snk-filter-text.
|
10
11
|
*/
|
11
12
|
ezChangeListener(evt) {
|
13
|
+
this.errorMessage = undefined;
|
12
14
|
this.value = evt.detail;
|
13
15
|
this.valueChanged.emit(this.value);
|
14
16
|
}
|
17
|
+
/**
|
18
|
+
* Define o foco no componente snk-filter-text.
|
19
|
+
*/
|
20
|
+
async setFocus() {
|
21
|
+
this._textInputElement.setFocus();
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
25
|
+
*/
|
26
|
+
async clearValue() {
|
27
|
+
this.value = this.config.value;
|
28
|
+
if (this._textInputElement) {
|
29
|
+
this._textInputElement.value = this.config.value;
|
30
|
+
}
|
31
|
+
}
|
15
32
|
componentDidLoad() {
|
16
33
|
if (this._element) {
|
17
34
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
@@ -22,7 +39,7 @@ export class SnkFilterText {
|
|
22
39
|
if (!this.config) {
|
23
40
|
return undefined;
|
24
41
|
}
|
25
|
-
return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref,
|
42
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, enabled: this.config.enabled, cleanValueMask: true, errorMessage: this.errorMessage })));
|
26
43
|
}
|
27
44
|
static get is() { return "snk-filter-text"; }
|
28
45
|
static get properties() {
|
@@ -63,6 +80,23 @@ export class SnkFilterText {
|
|
63
80
|
},
|
64
81
|
"attribute": "value",
|
65
82
|
"reflect": false
|
83
|
+
},
|
84
|
+
"errorMessage": {
|
85
|
+
"type": "string",
|
86
|
+
"mutable": true,
|
87
|
+
"complexType": {
|
88
|
+
"original": "string",
|
89
|
+
"resolved": "string",
|
90
|
+
"references": {}
|
91
|
+
},
|
92
|
+
"required": false,
|
93
|
+
"optional": false,
|
94
|
+
"docs": {
|
95
|
+
"tags": [],
|
96
|
+
"text": "Usado para exibir mensagens de erro."
|
97
|
+
},
|
98
|
+
"attribute": "error-message",
|
99
|
+
"reflect": true
|
66
100
|
}
|
67
101
|
};
|
68
102
|
}
|
@@ -84,6 +118,42 @@ export class SnkFilterText {
|
|
84
118
|
}
|
85
119
|
}];
|
86
120
|
}
|
121
|
+
static get methods() {
|
122
|
+
return {
|
123
|
+
"setFocus": {
|
124
|
+
"complexType": {
|
125
|
+
"signature": "() => Promise<void>",
|
126
|
+
"parameters": [],
|
127
|
+
"references": {
|
128
|
+
"Promise": {
|
129
|
+
"location": "global"
|
130
|
+
}
|
131
|
+
},
|
132
|
+
"return": "Promise<void>"
|
133
|
+
},
|
134
|
+
"docs": {
|
135
|
+
"text": "Define o foco no componente snk-filter-text.",
|
136
|
+
"tags": []
|
137
|
+
}
|
138
|
+
},
|
139
|
+
"clearValue": {
|
140
|
+
"complexType": {
|
141
|
+
"signature": "() => Promise<void>",
|
142
|
+
"parameters": [],
|
143
|
+
"references": {
|
144
|
+
"Promise": {
|
145
|
+
"location": "global"
|
146
|
+
}
|
147
|
+
},
|
148
|
+
"return": "Promise<void>"
|
149
|
+
},
|
150
|
+
"docs": {
|
151
|
+
"text": "Limpa o valor do componente restaurando o valor original da configura\u00E7\u00E3o.",
|
152
|
+
"tags": []
|
153
|
+
}
|
154
|
+
}
|
155
|
+
};
|
156
|
+
}
|
87
157
|
static get elementRef() { return "_element"; }
|
88
158
|
static get listeners() {
|
89
159
|
return [{
|
@@ -1,21 +1,38 @@
|
|
1
|
-
import { h, Host, Fragment } from '@stencil/core';
|
2
|
-
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
3
|
-
import FilterItemType from './filter-item-type.enum';
|
4
1
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
5
|
-
import {
|
2
|
+
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
3
|
+
import { Fragment, h, Host } from '@stencil/core';
|
6
4
|
import { PersonalizedFilterUtils } from '../../snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils';
|
5
|
+
import { EPresentationMode } from './editors/enum/presentationMode';
|
6
|
+
import FilterItemType from './filter-item-type.enum';
|
7
7
|
export class SnkFilterDetail {
|
8
8
|
constructor() {
|
9
9
|
this.config = undefined;
|
10
10
|
this.getMessage = undefined;
|
11
11
|
this.showHardFixed = true;
|
12
|
+
this.removalBlocked = false;
|
12
13
|
}
|
13
14
|
/**
|
14
|
-
*
|
15
|
+
* Define o foco no campo do editor.
|
15
16
|
*/
|
16
|
-
async
|
17
|
-
var _a, _b;
|
18
|
-
|
17
|
+
async setFocusField() {
|
18
|
+
var _a, _b, _c, _d;
|
19
|
+
if (!this._editor) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
if (this._editor["setFocus"]) {
|
23
|
+
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["setFocus"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
24
|
+
}
|
25
|
+
else if (this._editor["focus"]) {
|
26
|
+
(_d = (_c = this._editor) === null || _c === void 0 ? void 0 : _c["focus"]) === null || _d === void 0 ? void 0 : _d.call(_c);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
async clearValue() {
|
30
|
+
if (!this._editor) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
if (this._editor["clearValue"]) {
|
34
|
+
await this._editor["clearValue"]();
|
35
|
+
}
|
19
36
|
}
|
20
37
|
observeConfig(newValue) {
|
21
38
|
var _a, _b;
|
@@ -87,7 +104,7 @@ export class SnkFilterDetail {
|
|
87
104
|
return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
|
88
105
|
}
|
89
106
|
getPopUpHeaderButtons() {
|
90
|
-
return (h(Fragment, null, !this.config.removalBlocked &&
|
107
|
+
return (h(Fragment, null, !this.removalBlocked && !this.config.removalBlocked &&
|
91
108
|
this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
|
92
109
|
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 })))));
|
93
110
|
}
|
@@ -219,6 +236,24 @@ export class SnkFilterDetail {
|
|
219
236
|
"attribute": "show-hard-fixed",
|
220
237
|
"reflect": false,
|
221
238
|
"defaultValue": "true"
|
239
|
+
},
|
240
|
+
"removalBlocked": {
|
241
|
+
"type": "boolean",
|
242
|
+
"mutable": false,
|
243
|
+
"complexType": {
|
244
|
+
"original": "boolean",
|
245
|
+
"resolved": "boolean",
|
246
|
+
"references": {}
|
247
|
+
},
|
248
|
+
"required": false,
|
249
|
+
"optional": false,
|
250
|
+
"docs": {
|
251
|
+
"tags": [],
|
252
|
+
"text": "Define se o filtro pode ser removido."
|
253
|
+
},
|
254
|
+
"attribute": "removal-blocked",
|
255
|
+
"reflect": false,
|
256
|
+
"defaultValue": "false"
|
222
257
|
}
|
223
258
|
};
|
224
259
|
}
|
@@ -247,7 +282,23 @@ export class SnkFilterDetail {
|
|
247
282
|
}
|
248
283
|
static get methods() {
|
249
284
|
return {
|
250
|
-
"
|
285
|
+
"setFocusField": {
|
286
|
+
"complexType": {
|
287
|
+
"signature": "() => Promise<void>",
|
288
|
+
"parameters": [],
|
289
|
+
"references": {
|
290
|
+
"Promise": {
|
291
|
+
"location": "global"
|
292
|
+
}
|
293
|
+
},
|
294
|
+
"return": "Promise<void>"
|
295
|
+
},
|
296
|
+
"docs": {
|
297
|
+
"text": "Define o foco no campo do editor.",
|
298
|
+
"tags": []
|
299
|
+
}
|
300
|
+
},
|
301
|
+
"clearValue": {
|
251
302
|
"complexType": {
|
252
303
|
"signature": "() => Promise<void>",
|
253
304
|
"parameters": [],
|
@@ -259,7 +310,7 @@ export class SnkFilterDetail {
|
|
259
310
|
"return": "Promise<void>"
|
260
311
|
},
|
261
312
|
"docs": {
|
262
|
-
"text": "
|
313
|
+
"text": "",
|
263
314
|
"tags": []
|
264
315
|
}
|
265
316
|
}
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { ElementIDUtils,
|
1
|
+
import { DateUtils, ElementIDUtils, KeyboardManager, MaskFormatter } from '@sankhyalabs/core';
|
2
2
|
import { h, Host } from '@stencil/core';
|
3
|
-
import FilterItemType from './filter-item-type.enum';
|
4
3
|
import { FilterNumberVariation } from './editors/enum/filterNumberVariation';
|
4
|
+
import FilterItemType from './filter-item-type.enum';
|
5
5
|
export class SnkFilterItem {
|
6
6
|
constructor() {
|
7
|
+
this._keyboardManager = undefined;
|
7
8
|
this.detailIsVisible = undefined;
|
8
9
|
this.config = undefined;
|
9
10
|
this.getMessage = undefined;
|
@@ -27,13 +28,15 @@ export class SnkFilterItem {
|
|
27
28
|
if (open) {
|
28
29
|
await ((_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.setBlur());
|
29
30
|
await this._popover.showUnder(this._chipElement);
|
31
|
+
await this._filterDetail.setFocusField();
|
30
32
|
}
|
31
33
|
}
|
32
34
|
/**
|
33
35
|
* Oculta os detalhes de um item da lista.
|
34
36
|
*/
|
35
37
|
async hideDetail() {
|
36
|
-
|
38
|
+
var _a;
|
39
|
+
await ((_a = this._popover) === null || _a === void 0 ? void 0 : _a.hide());
|
37
40
|
}
|
38
41
|
getConfigChanges() {
|
39
42
|
var _a;
|
@@ -53,12 +56,15 @@ export class SnkFilterItem {
|
|
53
56
|
this.filterChange.emit(configChanged);
|
54
57
|
}
|
55
58
|
else {
|
56
|
-
this.togglePopover();
|
59
|
+
this.togglePopover(event);
|
57
60
|
}
|
58
61
|
}
|
59
62
|
async togglePopover(event) {
|
60
63
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
61
64
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
65
|
+
if (this.config.enabled === false) {
|
66
|
+
return;
|
67
|
+
}
|
62
68
|
if (this.detailIsVisible) {
|
63
69
|
await this.hideDetail();
|
64
70
|
}
|
@@ -207,8 +213,9 @@ export class SnkFilterItem {
|
|
207
213
|
return undefined;
|
208
214
|
}
|
209
215
|
hasActiveElements(value) {
|
210
|
-
var _a
|
211
|
-
|
216
|
+
var _a;
|
217
|
+
const list = Array.isArray(value) ? value : value === null || value === void 0 ? void 0 : value.elements;
|
218
|
+
return ((_a = list === null || list === void 0 ? void 0 : list.filter((val) => val === null || val === void 0 ? void 0 : val.check)) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
212
219
|
}
|
213
220
|
hasActiveValue(config) {
|
214
221
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
@@ -223,12 +230,67 @@ export class SnkFilterItem {
|
|
223
230
|
}
|
224
231
|
return this.hasActiveValue(this.config);
|
225
232
|
}
|
226
|
-
handleVisibilityPopover(event) {
|
233
|
+
async handleVisibilityPopover(event) {
|
227
234
|
this.detailIsVisible = event.detail;
|
235
|
+
if (!this.detailIsVisible) {
|
236
|
+
await this._filterDetail.clearValue();
|
237
|
+
}
|
238
|
+
}
|
239
|
+
getCustomMessage(key, params) {
|
240
|
+
var _a;
|
241
|
+
return (_a = this.getMessage) === null || _a === void 0 ? void 0 : _a.call(this, `snkFilterBar.filterModal.${key}`, params);
|
242
|
+
}
|
243
|
+
hasValue() {
|
244
|
+
if (this.config.type === FilterItemType.MULTI_LIST) {
|
245
|
+
return this.hasActiveElements(this.config.value);
|
246
|
+
}
|
247
|
+
return this.config.value !== undefined && this.config.value !== null;
|
248
|
+
}
|
249
|
+
getTooltipMessage() {
|
250
|
+
var _a, _b;
|
251
|
+
if (this.config.required && !this.hasValue()) {
|
252
|
+
return {
|
253
|
+
message: (_a = this.config.requiredMessage) !== null && _a !== void 0 ? _a : this.getCustomMessage('validations.requiredFilter'),
|
254
|
+
type: 'error'
|
255
|
+
};
|
256
|
+
}
|
257
|
+
if (this.config.enabled === false && this.config.disabledMessage) {
|
258
|
+
return { message: this.config.disabledMessage, type: 'warning' };
|
259
|
+
}
|
260
|
+
return {
|
261
|
+
message: (_b = this.config.defaultMessage) !== null && _b !== void 0 ? _b : this.getLabel(true),
|
262
|
+
type: 'default'
|
263
|
+
};
|
264
|
+
}
|
265
|
+
getTypeChip(type) {
|
266
|
+
switch (type) {
|
267
|
+
case 'default':
|
268
|
+
return 'secondary';
|
269
|
+
case 'warning':
|
270
|
+
return 'warning-light';
|
271
|
+
case 'error':
|
272
|
+
return 'error-light';
|
273
|
+
case 'success':
|
274
|
+
return 'success-light';
|
275
|
+
default:
|
276
|
+
return type;
|
277
|
+
}
|
278
|
+
}
|
279
|
+
initKeyboardManager() {
|
280
|
+
this._keyboardManager = new KeyboardManager({ element: this._filterItemElement, propagate: true });
|
281
|
+
this._keyboardManager
|
282
|
+
.bind("Escape", () => this.hideDetail());
|
283
|
+
}
|
284
|
+
connectedCallback() {
|
285
|
+
this.initKeyboardManager();
|
286
|
+
}
|
287
|
+
disconnectedCallback() {
|
288
|
+
this._keyboardManager.unbindAllShortcutKeys();
|
228
289
|
}
|
229
290
|
render() {
|
230
291
|
const leftIcon = this.getLeftIconName();
|
231
|
-
|
292
|
+
const { type, message } = this.getTooltipMessage();
|
293
|
+
return (h(Host, null, this.showChips && (h("ez-tooltip", { id: this.config.id, message: message, type: type, active: !this.detailIsVisible, strategy: "fixed" }, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), onClick: (event) => this.togglePopover(event), disableAutoUpdateValue: true, type: this.getTypeChip(type), enabled: this.config.enabled }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), slot: "rightIcon", id: "removeFilter", onClick: (event) => this.clearFilter(event) })))), h("ez-popover-core", { ref: elem => this._popover = elem, onEzVisibilityChange: (event) => this.handleVisibilityPopover(event) }, h("snk-filter-detail", { ref: ref => this._filterDetail = ref, key: this.config.id, config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips && !this.config.required, removalBlocked: this.config.required }))));
|
232
294
|
}
|
233
295
|
static get is() { return "snk-filter-item"; }
|
234
296
|
static get encapsulation() { return "scoped"; }
|