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