@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
@@ -12,6 +12,7 @@ const SnkFilterBinarySelect = class {
|
|
12
12
|
this.value = undefined;
|
13
13
|
this.config = undefined;
|
14
14
|
this.presentationMode = EPresentationMode.CHIP;
|
15
|
+
this.errorMessage = undefined;
|
15
16
|
}
|
16
17
|
isSelected(option) {
|
17
18
|
return this.value == undefined || this.value === option;
|
@@ -20,6 +21,7 @@ const SnkFilterBinarySelect = class {
|
|
20
21
|
* Emitido quando acontece a alteração de valor do componente snk-filter-binary-select
|
21
22
|
*/
|
22
23
|
ezChangeListener(evt) {
|
24
|
+
this.errorMessage = undefined;
|
23
25
|
if (this.presentationMode === EPresentationMode.MODAL) {
|
24
26
|
if (!evt.detail) {
|
25
27
|
this.assertCheckedOption(evt.target);
|
@@ -36,6 +38,23 @@ const SnkFilterBinarySelect = class {
|
|
36
38
|
async resetValues() {
|
37
39
|
this.ezChangeListener({ detail: this._noOptionValue });
|
38
40
|
}
|
41
|
+
/**
|
42
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
43
|
+
*/
|
44
|
+
async clearValue() {
|
45
|
+
this.value = this.config.value;
|
46
|
+
this._radioButtonValue = this.value || this._noOptionValue;
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Define o foco no componente snk-filter-binary-select.
|
50
|
+
*/
|
51
|
+
async setFocus() {
|
52
|
+
if (this.presentationMode === EPresentationMode.MODAL) {
|
53
|
+
this._checkOne.setFocus();
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
this._element.querySelector('ez-radio-button').focus();
|
57
|
+
}
|
39
58
|
assertCheckedOption(updatingCheck) {
|
40
59
|
if (updatingCheck === this._checkOne) {
|
41
60
|
this._checkTwo.value = true;
|
@@ -77,9 +96,11 @@ const SnkFilterBinarySelect = class {
|
|
77
96
|
}
|
78
97
|
const [optOne, optTwo] = this.config.props.options;
|
79
98
|
if (this.presentationMode === EPresentationMode.MODAL) {
|
80
|
-
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) }))
|
99
|
+
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 &&
|
100
|
+
h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
|
81
101
|
}
|
82
|
-
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 }))
|
102
|
+
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 &&
|
103
|
+
h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
|
83
104
|
}
|
84
105
|
get _element() { return getElement(this); }
|
85
106
|
};
|
@@ -7,8 +7,24 @@ const SnkFilterCheckboxList = class {
|
|
7
7
|
registerInstance(this, hostRef);
|
8
8
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
9
9
|
this.config = undefined;
|
10
|
+
this.errorMessage = undefined;
|
10
11
|
this.optionsList = [];
|
11
12
|
}
|
13
|
+
/**
|
14
|
+
* Define o foco no componente snk-filter-checkbox-list.
|
15
|
+
*/
|
16
|
+
async setFocus() {
|
17
|
+
var _a, _b;
|
18
|
+
(_b = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector('ez-check')) === null || _b === void 0 ? void 0 : _b.setFocus();
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
22
|
+
*/
|
23
|
+
async clearValue() {
|
24
|
+
var _a;
|
25
|
+
this.config = Object.assign(Object.assign({}, this.config), { value: this.config.value });
|
26
|
+
this.valueChanged.emit((_a = this.config) === null || _a === void 0 ? void 0 : _a.value);
|
27
|
+
}
|
12
28
|
componentDidLoad() {
|
13
29
|
if (this._element) {
|
14
30
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
@@ -16,13 +32,14 @@ const SnkFilterCheckboxList = class {
|
|
16
32
|
}
|
17
33
|
handleToggleCheck(itemChanged, checked) {
|
18
34
|
var _a, _b;
|
35
|
+
this.errorMessage = undefined;
|
19
36
|
let configValueMap = (_a = this.config.value) !== null && _a !== void 0 ? _a : {};
|
20
37
|
configValueMap[itemChanged.name] = checked;
|
21
38
|
this.config = Object.assign(Object.assign({}, this.config), { value: configValueMap });
|
22
39
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
23
40
|
}
|
24
41
|
renderOptions() {
|
25
|
-
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
|
42
|
+
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 })));
|
26
43
|
}
|
27
44
|
isChecked(itemName) {
|
28
45
|
var _a;
|
@@ -40,7 +57,8 @@ const SnkFilterCheckboxList = class {
|
|
40
57
|
if (!this.config || this.config.type !== FilterItemType.CHECK_BOX_LIST) {
|
41
58
|
return undefined;
|
42
59
|
}
|
43
|
-
return (h("div", { class: 'ez-flex ez-flex--column' }, this.renderOptions()
|
60
|
+
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 &&
|
61
|
+
h("span", { class: 'ez-text ez-text--small ez-text--error ez-margin--small' }, this.errorMessage))));
|
44
62
|
}
|
45
63
|
get _element() { return getElement(this); }
|
46
64
|
};
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-479e1293.js';
|
2
|
-
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
|
-
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.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-2db38ff2.js';
|
5
|
+
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
6
|
+
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
7
7
|
import './index-8acbae97.js';
|
8
8
|
|
9
9
|
const SnkFilterDetail = class {
|
@@ -13,13 +13,30 @@ const SnkFilterDetail = class {
|
|
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 = class {
|
|
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
|
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-479e1293.js';
|
2
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import {
|
3
|
+
import { C as ConfigStorage } from './ConfigStorage-22eace3a.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
5
|
-
import {
|
5
|
+
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
6
6
|
import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
|
7
|
-
import './form-config-fetcher-
|
8
|
-
import './DataFetcher-
|
7
|
+
import './form-config-fetcher-bc6f0f1f.js';
|
8
|
+
import './DataFetcher-f6b2961a.js';
|
9
9
|
import './PrintUtils-3e4ff0f5.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
|
@@ -21,12 +21,6 @@ const SnkFilterModalItem = class {
|
|
21
21
|
this.configName = undefined;
|
22
22
|
this.resourceID = undefined;
|
23
23
|
}
|
24
|
-
observeFilterItem(newValue) {
|
25
|
-
var _a, _b;
|
26
|
-
this._editor && (this._editor["config"] = newValue);
|
27
|
-
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
28
|
-
this.filterChange.emit(newValue);
|
29
|
-
}
|
30
24
|
getContentEditorConfig() {
|
31
25
|
const props = { presentationMode: EPresentationMode.MODAL };
|
32
26
|
switch (this.filterItem.type) {
|
@@ -61,6 +55,7 @@ const SnkFilterModalItem = class {
|
|
61
55
|
return !this.filterItem.visible ? newValue !== undefined : true;
|
62
56
|
}
|
63
57
|
updateFilterValue(data) {
|
58
|
+
var _a, _b;
|
64
59
|
const newValue = (data === null || data === void 0 ? void 0 : data.value) !== undefined ? data.value : data;
|
65
60
|
if (this.filterItem.groupedItems != undefined) {
|
66
61
|
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { visible: newValue > 0, value: newValue, groupedItems: data.items });
|
@@ -68,6 +63,9 @@ const SnkFilterModalItem = class {
|
|
68
63
|
else {
|
69
64
|
this.filterItem = Object.assign(Object.assign({}, this.filterItem), { value: this.filterItem.type === (FilterItemType.SEARCH || FilterItemType.CHECK_BOX_LIST) ? data : newValue, visible: this.isVisible(newValue) });
|
70
65
|
}
|
66
|
+
this._editor && (this._editor["config"] = this.filterItem);
|
67
|
+
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a['reloadList']) === null || _b === void 0 ? void 0 : _b.call(_a);
|
68
|
+
this.filterChange.emit(this.filterItem);
|
71
69
|
}
|
72
70
|
handleDeleteFilter(filter, filterItemType) {
|
73
71
|
if (filterItemType === FilterItemType.PERSONALIZED) {
|
@@ -97,12 +95,9 @@ const SnkFilterModalItem = class {
|
|
97
95
|
}
|
98
96
|
render() {
|
99
97
|
const { tag: ContentEditor, props } = this.getContentEditorConfig();
|
100
|
-
return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("
|
98
|
+
return (h(Host, null, h("div", { class: "ez-flex ez-flex--column grow" }, this.canShowDetailModal() && (h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin-bottom--extra-small", htmlFor: `filter-item-${this.filterItem.id}` }, this.filterItem.detailModal)), h(ContentEditor, Object.assign({ ref: ref => this._editor = ref, id: `filter-item-${this.filterItem.id}`, config: this.filterItem, value: this.filterItem.value, onValueChanged: (event) => this.updateFilterValue(event.detail), "data-element-id": this._idContentEditor }, props)))));
|
101
99
|
}
|
102
100
|
get _element() { return getElement(this); }
|
103
|
-
static get watchers() { return {
|
104
|
-
"filterItem": ["observeFilterItem"]
|
105
|
-
}; }
|
106
101
|
};
|
107
102
|
SnkFilterModalItem.style = snkFilterModalItemCss;
|
108
103
|
|
@@ -8,21 +8,32 @@ const SnkFilterMultiSelect = class {
|
|
8
8
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
9
9
|
this.value = undefined;
|
10
10
|
this.config = undefined;
|
11
|
+
this.errorMessage = undefined;
|
11
12
|
}
|
12
13
|
/**
|
13
14
|
* Emitido quando acontece a alteração de valor do componente snk-filter-multi-select
|
14
15
|
*/
|
15
16
|
ezChangeListener(evt) {
|
16
17
|
var _a;
|
18
|
+
this.errorMessage = undefined;
|
17
19
|
this.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value;
|
18
20
|
this.valueChanged.emit(this.value);
|
19
21
|
}
|
20
22
|
/**
|
21
|
-
*
|
23
|
+
* Define o foco no componente snk-filter-multi-select.
|
22
24
|
*/
|
23
|
-
async
|
25
|
+
async setFocus() {
|
24
26
|
this._comboElement.setFocus();
|
25
27
|
}
|
28
|
+
/**
|
29
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
30
|
+
*/
|
31
|
+
async clearValue() {
|
32
|
+
this.value = this.config.value;
|
33
|
+
if (this._comboElement) {
|
34
|
+
this._comboElement.value = this.config.value;
|
35
|
+
}
|
36
|
+
}
|
26
37
|
componentDidLoad() {
|
27
38
|
if (this._element) {
|
28
39
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
@@ -32,7 +43,9 @@ const SnkFilterMultiSelect = class {
|
|
32
43
|
if (!this.config || this.config.type !== FilterItemType.MULTI_SELECT) {
|
33
44
|
return undefined;
|
34
45
|
}
|
35
|
-
return (h("ez-combo-box", { id: this.config.id, ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options
|
46
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-combo-box", { id: this.config.id, ref: ref => this._comboElement = ref, label: this.config.label, value: this.config.value, options: this.config.props.options, enabled: this.config.enabled, errorMessage: this.errorMessage, onEzVisibilityChange: (event) => {
|
47
|
+
event.stopPropagation();
|
48
|
+
} })));
|
36
49
|
}
|
37
50
|
get _element() { return getElement(this); }
|
38
51
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-479e1293.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
4
|
-
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
5
4
|
import { F as FilterNumberVariation } from './filterNumberVariation-8cee02ea.js';
|
5
|
+
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
6
6
|
|
7
7
|
const SnkFilterPeriod = class {
|
8
8
|
constructor(hostRef) {
|
@@ -15,11 +15,13 @@ const SnkFilterPeriod = class {
|
|
15
15
|
this.getMessage = undefined;
|
16
16
|
this.value = undefined;
|
17
17
|
this.presentationMode = EPresentationMode.CHIP;
|
18
|
+
this.errorMessage = undefined;
|
18
19
|
}
|
19
20
|
/**
|
20
21
|
* Emitido quando acontece a alteração de valor do componente snk-filter-number
|
21
22
|
*/
|
22
23
|
ezChangeListener(evt) {
|
24
|
+
this.errorMessage = undefined;
|
23
25
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
24
26
|
const start = this._startInterval.value;
|
25
27
|
const end = this._endInterval.value;
|
@@ -40,6 +42,35 @@ const SnkFilterPeriod = class {
|
|
40
42
|
}
|
41
43
|
this._numberElement.setFocus();
|
42
44
|
}
|
45
|
+
/**
|
46
|
+
* Define o foco no componente snk-filter-number
|
47
|
+
*/
|
48
|
+
async setFocus() {
|
49
|
+
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
50
|
+
await this._startInterval.setFocus();
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
await this._numberElement.setFocus();
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
57
|
+
*/
|
58
|
+
async clearValue() {
|
59
|
+
var _a, _b;
|
60
|
+
this.value = this.config.value;
|
61
|
+
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
62
|
+
const intervalValue = this.config.value;
|
63
|
+
if (this._startInterval) {
|
64
|
+
this._startInterval.value = (_a = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.start) !== null && _a !== void 0 ? _a : null;
|
65
|
+
}
|
66
|
+
if (this._endInterval) {
|
67
|
+
this._endInterval.value = (_b = intervalValue === null || intervalValue === void 0 ? void 0 : intervalValue.end) !== null && _b !== void 0 ? _b : null;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
else if (this._numberElement) {
|
71
|
+
this._numberElement.value = this.config.value;
|
72
|
+
}
|
73
|
+
}
|
43
74
|
getIntervalValue(prop) {
|
44
75
|
const objValue = this.value ? this.value[prop] : null;
|
45
76
|
return objValue !== null && objValue !== void 0 ? objValue : null;
|
@@ -71,9 +102,9 @@ const SnkFilterPeriod = class {
|
|
71
102
|
return undefined;
|
72
103
|
}
|
73
104
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
74
|
-
return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-number-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-number-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding-right--medium' : '', label: this._startIntervalLabel, ref: ref => this._startInterval = ref, value: this.getIntervalValue("start"), enabled: this.config.enabled, precision: (_a = this.config.props) === null || _a === void 0 ? void 0 : _a.precision, errorMessage: this.errorMessage }), this.buildLabel(), h("ez-number-input", { id: `${this.config.id}_end`, label: this._endIntervalLabel, ref: ref => this._endInterval = ref, value: this.getIntervalValue("end"), enabled: this.config.enabled, precision: (_b = this.config.props) === null || _b === void 0 ? void 0 : _b.precision, errorMessage: this.errorMessage }))));
|
75
106
|
}
|
76
|
-
return (h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref,
|
107
|
+
return (h("ez-tooltip", { active: this.config.enabled === false, message: this.config.disabledMessage, type: 'warning' }, h("ez-number-input", { id: this.config.id, ref: ref => this._numberElement = ref, value: this.config.value, precision: (_c = this.config.props) === null || _c === void 0 ? void 0 : _c.precision, enabled: this.config.enabled, errorMessage: this.errorMessage })));
|
77
108
|
}
|
78
109
|
get _element() { return getElement(this); }
|
79
110
|
};
|
@@ -10,37 +10,77 @@ const SnkFilterPeriod = class {
|
|
10
10
|
this._startDateLabel = 'Inicial';
|
11
11
|
this._endDateLabel = 'Final';
|
12
12
|
this._toLabel = 'até';
|
13
|
+
this.internalChange = {
|
14
|
+
start: false,
|
15
|
+
end: false
|
16
|
+
};
|
13
17
|
this.config = undefined;
|
14
18
|
this.getMessage = undefined;
|
15
|
-
this.value =
|
19
|
+
this.value = {
|
20
|
+
start: null,
|
21
|
+
end: null
|
22
|
+
};
|
16
23
|
this.presentationMode = EPresentationMode.CHIP;
|
24
|
+
this.errorMessage = undefined;
|
25
|
+
}
|
26
|
+
configChanged(newValue, oldValue) {
|
27
|
+
if (this.internalChange.end) {
|
28
|
+
this.internalChange.end = false;
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
if (this.internalChange.start) {
|
32
|
+
this.internalChange.start = false;
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
if (newValue && (newValue.start !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.start) || newValue.end !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.end))) {
|
36
|
+
this.valueStart = this.parseDate(newValue.start);
|
37
|
+
this.valueEnd = this.parseDate(newValue.end);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
ezChangeListener(event, field) {
|
41
|
+
this.errorMessage = undefined;
|
42
|
+
this.internalChange[field] = true;
|
43
|
+
this.value = Object.assign(Object.assign({}, (this.value || {})), { [field]: event.detail ? this.parseDate(event.detail) : null });
|
44
|
+
this.valueChanged.emit(this.value);
|
17
45
|
}
|
18
46
|
/**
|
19
|
-
*
|
47
|
+
* Define o foco no componente snk-filter-period.
|
20
48
|
*/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
49
|
+
async setFocus() {
|
50
|
+
this._startDate.setFocus();
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
54
|
+
*/
|
55
|
+
async clearValue() {
|
56
|
+
this.value = this.config.value;
|
57
|
+
this.valueStart = this.getDate("start");
|
58
|
+
this.valueEnd = this.getDate("end");
|
26
59
|
}
|
27
60
|
componentDidLoad() {
|
28
61
|
if (this._element) {
|
29
62
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
63
|
+
this._element.querySelectorAll('ez-date-input').forEach(input => {
|
64
|
+
const textInput = input.shadowRoot.querySelector('ez-text-input');
|
65
|
+
textInput.style.setProperty('--ez-text-input__min-width', '120px');
|
66
|
+
});
|
30
67
|
}
|
31
68
|
}
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return objValue;
|
69
|
+
parseDate(date) {
|
70
|
+
if (date instanceof Date) {
|
71
|
+
return date;
|
36
72
|
}
|
37
|
-
if (typeof
|
38
|
-
|
73
|
+
if (typeof date === "string") {
|
74
|
+
date = new Date(date);
|
39
75
|
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
|
40
76
|
return date;
|
41
77
|
}
|
42
78
|
return null;
|
43
79
|
}
|
80
|
+
getDate(prop) {
|
81
|
+
const objValue = this.value ? this.value[prop] : null;
|
82
|
+
return this.parseDate(objValue);
|
83
|
+
}
|
44
84
|
/**
|
45
85
|
* Exibe o componente snk-filter-period
|
46
86
|
*/
|
@@ -58,14 +98,19 @@ const SnkFilterPeriod = class {
|
|
58
98
|
this._endDateLabel = this.getMessage('snkFilterBar.labelEnd');
|
59
99
|
this._toLabel = this.getMessage('snkFilterBar.labelTo');
|
60
100
|
}
|
101
|
+
this.valueStart = this.getDate("start");
|
102
|
+
this.valueEnd = this.getDate("end");
|
61
103
|
}
|
62
104
|
render() {
|
63
105
|
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
64
106
|
return undefined;
|
65
107
|
}
|
66
|
-
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--
|
108
|
+
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') }))));
|
67
109
|
}
|
68
110
|
get _element() { return getElement(this); }
|
111
|
+
static get watchers() { return {
|
112
|
+
"value": ["configChanged"]
|
113
|
+
}; }
|
69
114
|
};
|
70
115
|
|
71
116
|
export { SnkFilterPeriod as snk_filter_period };
|
@@ -9,11 +9,13 @@ const SnkFilterSearch = class {
|
|
9
9
|
this._isSearchPlus = false;
|
10
10
|
this.config = undefined;
|
11
11
|
this.value = undefined;
|
12
|
+
this.errorMessage = undefined;
|
12
13
|
}
|
13
14
|
/**
|
14
15
|
* Emitido quando acontece a alteração de valor do componente snk-filter-search
|
15
16
|
*/
|
16
17
|
async ezChangeListener(_evt) {
|
18
|
+
this.errorMessage = undefined;
|
17
19
|
if (this._isSearchPlus) {
|
18
20
|
this.value = await this._searchInput.getValueAsync();
|
19
21
|
}
|
@@ -40,16 +42,25 @@ const SnkFilterSearch = class {
|
|
40
42
|
});
|
41
43
|
}
|
42
44
|
/**
|
43
|
-
*
|
45
|
+
* Define o foco no componente snk-filter-search.
|
44
46
|
*/
|
45
|
-
async
|
47
|
+
async setFocus() {
|
46
48
|
this._searchInput.setFocus();
|
47
49
|
}
|
50
|
+
/**
|
51
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
52
|
+
*/
|
53
|
+
async clearValue() {
|
54
|
+
this.value = this.config.value;
|
55
|
+
if (this._searchInput) {
|
56
|
+
this._searchInput.value = this.config.value;
|
57
|
+
}
|
58
|
+
}
|
48
59
|
getInputItem() {
|
49
60
|
var _a;
|
50
61
|
this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
|
51
62
|
const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
|
52
|
-
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) }));
|
63
|
+
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 })));
|
53
64
|
}
|
54
65
|
render() {
|
55
66
|
if (!this.config || this.config.type !== FilterItemType.SEARCH) {
|
@@ -7,14 +7,31 @@ const SnkFilterText = class {
|
|
7
7
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
8
8
|
this.config = undefined;
|
9
9
|
this.value = undefined;
|
10
|
+
this.errorMessage = undefined;
|
10
11
|
}
|
11
12
|
/**
|
12
13
|
* Emitido quando acontece a alteração de valor do componente snk-filter-text.
|
13
14
|
*/
|
14
15
|
ezChangeListener(evt) {
|
16
|
+
this.errorMessage = undefined;
|
15
17
|
this.value = evt.detail;
|
16
18
|
this.valueChanged.emit(this.value);
|
17
19
|
}
|
20
|
+
/**
|
21
|
+
* Define o foco no componente snk-filter-text.
|
22
|
+
*/
|
23
|
+
async setFocus() {
|
24
|
+
this._textInputElement.setFocus();
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
28
|
+
*/
|
29
|
+
async clearValue() {
|
30
|
+
this.value = this.config.value;
|
31
|
+
if (this._textInputElement) {
|
32
|
+
this._textInputElement.value = this.config.value;
|
33
|
+
}
|
34
|
+
}
|
18
35
|
componentDidLoad() {
|
19
36
|
if (this._element) {
|
20
37
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
@@ -25,7 +42,7 @@ const SnkFilterText = class {
|
|
25
42
|
if (!this.config) {
|
26
43
|
return undefined;
|
27
44
|
}
|
28
|
-
return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref,
|
45
|
+
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 })));
|
29
46
|
}
|
30
47
|
get _element() { return getElement(this); }
|
31
48
|
};
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-479e1293.js';
|
2
2
|
import { ElementIDUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-968b97e7.js';
|
4
4
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
5
5
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
6
6
|
import { b as buildGuides, a as buildGuidesMap, g as getFieldsToSave, u as updateTabInFieldsFromGroupList, c as buildNewGuideName } from './FormConfigHelper-4e42f0b6.js';
|
7
7
|
import { a as TAB_NAMES, G as GROUP_NAMES } from './constants-7b422de0.js';
|
8
8
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
9
|
-
import { U as UserConfigType } from './form-config-fetcher-
|
10
|
-
import './ConfigStorage-
|
11
|
-
import './DataFetcher-
|
9
|
+
import { U as UserConfigType } from './form-config-fetcher-bc6f0f1f.js';
|
10
|
+
import './ConfigStorage-22eace3a.js';
|
11
|
+
import './DataFetcher-f6b2961a.js';
|
12
12
|
import './PrintUtils-3e4ff0f5.js';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
14
|
import './filter-item-type.enum-d45e026f.js';
|
@@ -34,18 +34,26 @@ const SnkForm = class {
|
|
34
34
|
}
|
35
35
|
/**
|
36
36
|
* Exibe a janela de configurações do formulário.
|
37
|
+
* @async
|
38
|
+
* @returns {Promise<void>}
|
37
39
|
*/
|
38
40
|
async showConfig() {
|
39
41
|
this._showFormConfig = true;
|
40
42
|
}
|
41
43
|
/**
|
42
44
|
* Fecha a janela de configurações do formulário.
|
45
|
+
* @async
|
46
|
+
* @returns {Promise<void>}
|
43
47
|
*/
|
44
48
|
async hideConfig() {
|
45
49
|
this._showFormConfig = false;
|
46
50
|
}
|
47
51
|
/**
|
48
|
-
* Registra um editor customizado para campos
|
52
|
+
* Registra um editor customizado para campos do formulário.
|
53
|
+
* @async
|
54
|
+
* @param {string} fieldName - Nome do campo.
|
55
|
+
* @param {ICustomEditor} customEditor - Editor customizado.
|
56
|
+
* @returns {Promise<void>}
|
49
57
|
*/
|
50
58
|
async addCustomEditor(fieldName, customEditor) {
|
51
59
|
if (this._form) {
|
@@ -58,10 +66,28 @@ const SnkForm = class {
|
|
58
66
|
}
|
59
67
|
/**
|
60
68
|
* Altera/adiciona uma propriedade nos metadados do campo.
|
69
|
+
* @async
|
70
|
+
* @param {string} fieldName - Nome do campo.
|
71
|
+
* @param {string} propName - Nome da propriedade.
|
72
|
+
* @param {any} value - Valor da propriedade.
|
73
|
+
* @returns {Promise<void>}
|
61
74
|
*/
|
62
75
|
async setFieldProp(fieldName, propName, value) {
|
63
76
|
await this._form.setFieldProp(fieldName, propName, value);
|
64
77
|
}
|
78
|
+
/**
|
79
|
+
* Valida o formulário.
|
80
|
+
* @async
|
81
|
+
* @returns {Promise<void>}
|
82
|
+
* @description
|
83
|
+
* Este método executa a validação do formulário, verificando se todos os campos estão
|
84
|
+
* preenchidos corretamente de acordo com as regras definidas.
|
85
|
+
* Se a validação falhar, uma exceção será lançada com os detalhes dos erros encontrados.
|
86
|
+
* Caso contrário, o método será resolvido sem erros.
|
87
|
+
*/
|
88
|
+
async validate() {
|
89
|
+
await this._form.validate();
|
90
|
+
}
|
65
91
|
closeConfig() {
|
66
92
|
this.hideConfig();
|
67
93
|
}
|