@sankhyalabs/ezui 1.1.161 → 1.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ApplicationUtils-4a223c7a.js → ApplicationUtils-483c0a9e.js} +26 -7
- package/dist/cjs/CSSVarsUtils-09b431cc.js +55 -0
- package/dist/cjs/DialogType-a1e288e6.js +8 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +101 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +8 -4
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -6
- package/dist/cjs/ez-date-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-dialog.cjs.entry.js +33 -14
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +101 -86
- package/dist/cjs/ez-grid-config.cjs.entry.js +3 -2
- package/dist/cjs/ez-grid.cjs.entry.js +97155 -92841
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +6 -0
- package/dist/cjs/ez-radio-button.cjs.entry.js +49 -0
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +177 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +31 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +4 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +5 -3
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +6 -6
- package/dist/collection/components/ez-dialog/DialogType.js +6 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css +9 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +53 -26
- package/dist/collection/components/ez-form/DataBinder.js +46 -18
- package/dist/collection/components/ez-form/ez-form.js +75 -68
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +24 -165
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +71 -44
- package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js +4 -4
- package/dist/collection/components/ez-grid/ez-grid.js +36 -321
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +2 -1
- package/dist/collection/components/ez-popover/ez-popover.js +6 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.css +204 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +160 -0
- package/dist/collection/utils/ApplicationUtils.js +25 -7
- package/dist/collection/utils/CSSVarsUtils.js +34 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/custom-elements/index.d.ts +12 -6
- package/dist/custom-elements/index.js +97132 -92676
- package/dist/esm/{ApplicationUtils-35350d20.js → ApplicationUtils-5f87ae60.js} +26 -7
- package/dist/esm/CSSVarsUtils-499b75c2.js +53 -0
- package/dist/esm/DialogType-72afa679.js +8 -0
- package/dist/esm/ez-actions-button.entry.js +97 -0
- package/dist/esm/ez-combo-box.entry.js +8 -4
- package/dist/esm/ez-date-input.entry.js +6 -6
- package/dist/esm/ez-date-time-input.entry.js +7 -7
- package/dist/esm/ez-dialog.entry.js +33 -14
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +101 -86
- package/dist/esm/ez-grid-config.entry.js +3 -2
- package/dist/esm/ez-grid.entry.js +96694 -92380
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +6 -0
- package/dist/esm/ez-radio-button.entry.js +45 -0
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +2 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-0b099e95.entry.js +1 -0
- package/dist/ezui/{p-ff7b4b13.entry.js → p-240a76f1.entry.js} +1 -1
- package/dist/ezui/p-3263a002.js +1 -0
- package/dist/ezui/p-787fbdfe.js +1 -0
- package/dist/ezui/p-78fc16d7.entry.js +1 -0
- package/dist/ezui/{p-4c3d136c.entry.js → p-7d29e829.entry.js} +1 -1
- package/dist/ezui/p-898b9906.js +1 -0
- package/dist/ezui/p-8aaca58b.entry.js +1 -0
- package/dist/ezui/p-99440dbc.entry.js +1 -0
- package/dist/ezui/p-a7064bc1.entry.js +1 -0
- package/dist/ezui/{p-53bbba8e.entry.js → p-ad071710.entry.js} +1 -1
- package/dist/ezui/p-b0195dae.entry.js +1 -0
- package/dist/ezui/p-ba2bfa01.entry.js +1 -0
- package/dist/ezui/p-bedef638.entry.js +1 -0
- package/dist/ezui/p-d1bc45bd.entry.js +1 -0
- package/dist/ezui/{p-003d53b1.entry.js → p-d75c3aae.entry.js} +1 -1
- package/dist/ezui/p-e5c572c1.entry.js +304 -0
- package/dist/ezui/p-f4819fa3.entry.js +1 -0
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +37 -0
- package/dist/types/components/ez-dialog/DialogType.d.ts +5 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +22 -3
- package/dist/types/components/ez-form/DataBinder.d.ts +6 -1
- package/dist/types/components/ez-form/ez-form.d.ts +27 -3
- package/dist/types/components/ez-form/fieldbuilder/tpl/TextInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +0 -85
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -23
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +14 -11
- package/dist/types/components/ez-grid/ez-grid.d.ts +8 -66
- package/dist/types/components/ez-radio-button/ez-radio-button.d.ts +36 -0
- package/dist/types/components.d.ts +129 -76
- package/dist/types/utils/ApplicationUtils.d.ts +4 -1
- package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -5
- package/react/components.d.ts +2 -1
- package/react/components.js +2 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/CSSVarsUtils-1034b7b6.js +0 -21
- package/dist/cjs/test-du.cjs.entry.js +0 -103
- package/dist/collection/components/test-du/test-du.css +0 -3
- package/dist/collection/components/test-du/test-du.js +0 -104
- package/dist/collection/utils/interfaces/PageableComponent.js +0 -1
- package/dist/esm/CSSVarsUtils-eb4c5af6.js +0 -19
- package/dist/esm/test-du.entry.js +0 -99
- package/dist/ezui/p-0cd386db.js +0 -1
- package/dist/ezui/p-403de0a4.entry.js +0 -1
- package/dist/ezui/p-4c3cd534.entry.js +0 -1
- package/dist/ezui/p-6668c3b0.entry.js +0 -1
- package/dist/ezui/p-7fd6deec.entry.js +0 -1
- package/dist/ezui/p-8be1a4d6.entry.js +0 -1
- package/dist/ezui/p-8d73594f.entry.js +0 -369
- package/dist/ezui/p-933a7475.js +0 -1
- package/dist/ezui/p-988ff301.entry.js +0 -1
- package/dist/ezui/p-cf56d3e8.entry.js +0 -1
- package/dist/ezui/p-da156da3.entry.js +0 -1
- package/dist/ezui/p-ec7b7e26.entry.js +0 -1
- package/dist/types/components/test-du/test-du.d.ts +0 -9
- package/dist/types/utils/interfaces/PageableComponent.d.ts +0 -12
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, f as forceUpdate, H as Host, g as getElement } from './index-b21f0a10.js';
|
|
2
2
|
import { UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit } from '@sankhyalabs/core';
|
|
3
|
-
import { A as ApplicationUtils } from './ApplicationUtils-
|
|
3
|
+
import { A as ApplicationUtils } from './ApplicationUtils-5f87ae60.js';
|
|
4
|
+
import './DialogType-72afa679.js';
|
|
4
5
|
|
|
5
6
|
const buildTextArea = ({ name, label, readOnly }) => {
|
|
6
7
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
7
8
|
h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
const buildTextInput = ({ name, label }) => {
|
|
11
|
+
const buildTextInput = ({ name, label, readOnly }) => {
|
|
11
12
|
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
12
|
-
h("ez-text-input", { label: label, "data-field-name": name, key: name })));
|
|
13
|
+
h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
const buildSwitch = (fieldConfig) => {
|
|
@@ -615,6 +616,7 @@ var FormActions;
|
|
|
615
616
|
|
|
616
617
|
class DataBinder {
|
|
617
618
|
constructor(dataUnit) {
|
|
619
|
+
this._invalidFields = new Map();
|
|
618
620
|
this.onDataUnitEvent = (action) => {
|
|
619
621
|
var _a;
|
|
620
622
|
switch (action.type) {
|
|
@@ -623,15 +625,16 @@ class DataBinder {
|
|
|
623
625
|
case Action.RECORDS_REMOVED:
|
|
624
626
|
case Action.RECORDS_ADDED:
|
|
625
627
|
case Action.RECORDS_COPIED:
|
|
626
|
-
case Action.DATA_CHANGED:
|
|
627
628
|
case Action.EDITION_CANCELED:
|
|
628
|
-
case Action.CHANGE_UNDONE:
|
|
629
|
-
case Action.CHANGE_REDONE:
|
|
630
629
|
case Action.SELECTION_CHANGED:
|
|
631
630
|
case Action.NEXT_SELECTED:
|
|
632
631
|
case Action.PREVIOUS_SELECTED:
|
|
632
|
+
this.clearInvalid();
|
|
633
|
+
case Action.DATA_CHANGED:
|
|
634
|
+
case Action.CHANGE_UNDONE:
|
|
635
|
+
case Action.CHANGE_REDONE:
|
|
633
636
|
(_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
634
|
-
this.updateValue(field.fieldName, field.field
|
|
637
|
+
this.updateValue(field.fieldName, field.field);
|
|
635
638
|
});
|
|
636
639
|
break;
|
|
637
640
|
}
|
|
@@ -649,24 +652,45 @@ class DataBinder {
|
|
|
649
652
|
onDisconnectedCallback() {
|
|
650
653
|
this._dataUnit.unsubscribe(this.onDataUnitEvent);
|
|
651
654
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
655
|
+
markInvalid(field) {
|
|
656
|
+
this._invalidFields.set(field.name, field);
|
|
657
|
+
if (this._fields.has(field.name)) {
|
|
658
|
+
this.updateErrorMessage(field.name, this._fields.get(field.name).field);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
clearInvalid() {
|
|
662
|
+
this._invalidFields.clear();
|
|
663
|
+
this._fields.forEach(fieldBinder => {
|
|
664
|
+
const fieldName = fieldBinder.field.dataset.fieldName;
|
|
665
|
+
this.updateErrorMessage(fieldName, fieldBinder.field);
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
updateValue(fieldName, field) {
|
|
669
|
+
const bind = this._fields.get(fieldName);
|
|
670
|
+
try {
|
|
671
|
+
if (bind) {
|
|
672
|
+
bind.listen = false;
|
|
673
|
+
}
|
|
674
|
+
field["value"] = this._dataUnit.getFieldValue(fieldName);
|
|
675
|
+
this.updateErrorMessage(fieldName, field);
|
|
676
|
+
}
|
|
677
|
+
finally {
|
|
678
|
+
if (bind) {
|
|
679
|
+
bind.listen = true;
|
|
680
|
+
}
|
|
662
681
|
}
|
|
663
682
|
}
|
|
683
|
+
updateErrorMessage(fieldName, field) {
|
|
684
|
+
const invalidField = this._invalidFields.get(fieldName);
|
|
685
|
+
field["errorMessage"] = invalidField ? invalidField.message : "";
|
|
686
|
+
}
|
|
664
687
|
updateBind(fieldName, field) {
|
|
665
688
|
const oldBind = this._fields.get(fieldName);
|
|
666
689
|
if (oldBind) {
|
|
667
690
|
oldBind.destroy();
|
|
668
691
|
}
|
|
669
|
-
this.
|
|
692
|
+
field["value"] = this._dataUnit.getFieldValue(fieldName);
|
|
693
|
+
this.updateErrorMessage(fieldName, field);
|
|
670
694
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName) => this.cancelWaitingChange(fieldName), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
671
695
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
672
696
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -707,6 +731,7 @@ class DataBinder {
|
|
|
707
731
|
if (this._dataUnit.records.length === 0) {
|
|
708
732
|
this._dataUnit.addRecord();
|
|
709
733
|
}
|
|
734
|
+
this._invalidFields.delete(fieldName);
|
|
710
735
|
this._dataUnit.setFieldValue(fieldName, newValue);
|
|
711
736
|
if (this._dataUnit.waitingForChange(fieldName)) {
|
|
712
737
|
const bind = this._fields.get(fieldName);
|
|
@@ -741,6 +766,7 @@ class DataBinder {
|
|
|
741
766
|
}
|
|
742
767
|
class Bind {
|
|
743
768
|
constructor() {
|
|
769
|
+
this.listen = true;
|
|
744
770
|
this.startChangeEventName = "ezStartChange";
|
|
745
771
|
this.cancelWaitingChangeEventName = "ezCancelWaitingChange";
|
|
746
772
|
this.changeEventName = "ezChange";
|
|
@@ -768,11 +794,14 @@ class Bind {
|
|
|
768
794
|
const b = new Bind();
|
|
769
795
|
b.field = field;
|
|
770
796
|
b.fieldName = fieldName;
|
|
771
|
-
b.startChangeListener = (evt) => {
|
|
797
|
+
b.startChangeListener = (evt) => { if (b.listen)
|
|
798
|
+
startChangeCallback(fieldName, evt.detail); };
|
|
772
799
|
b.field.addEventListener(b.startChangeEventName, b.startChangeListener);
|
|
773
|
-
b.cancelWaitingChangeListener = () => {
|
|
800
|
+
b.cancelWaitingChangeListener = () => { if (b.listen)
|
|
801
|
+
cancelWaitingChangeCallback(fieldName); };
|
|
774
802
|
b.field.addEventListener(b.cancelWaitingChangeEventName, b.cancelWaitingChangeListener);
|
|
775
|
-
b.changeListener = (evt) => {
|
|
803
|
+
b.changeListener = (evt) => { if (b.listen)
|
|
804
|
+
changeCallback(fieldName, evt.detail); };
|
|
776
805
|
b.field.addEventListener(b.changeEventName, b.changeListener);
|
|
777
806
|
return b;
|
|
778
807
|
}
|
|
@@ -797,87 +826,66 @@ let EzForm = class {
|
|
|
797
826
|
return Promise.resolve();
|
|
798
827
|
}
|
|
799
828
|
validate() {
|
|
800
|
-
return new Promise(
|
|
801
|
-
|
|
802
|
-
const requiredFields = this._staticFields
|
|
803
|
-
.filter(f => f.dataset.required)
|
|
804
|
-
.map(f => f.dataset.fieldName)
|
|
805
|
-
.concat(metadata.getRequiredFields());
|
|
806
|
-
let isReject = false;
|
|
829
|
+
return new Promise((accept, reject) => {
|
|
830
|
+
var _a;
|
|
807
831
|
const records = this.dataUnit.getModifiedRecords();
|
|
808
832
|
for (let i = 0; i < records.length; i++) {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
833
|
+
const record = records[i];
|
|
834
|
+
const invalidResults = [];
|
|
835
|
+
let validationResult = this.validateRequired(record);
|
|
836
|
+
if (validationResult && !validationResult.isValid) {
|
|
837
|
+
invalidResults.push(validationResult);
|
|
812
838
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
839
|
+
validationResult = (_a = this.recordsValidator) === null || _a === void 0 ? void 0 : _a.validateRecord(this, record);
|
|
840
|
+
if (validationResult && !validationResult.isValid) {
|
|
841
|
+
invalidResults.push(validationResult);
|
|
842
|
+
}
|
|
843
|
+
if (invalidResults.length > 0) {
|
|
844
|
+
this.processValidationResult(invalidResults);
|
|
845
|
+
reject();
|
|
846
|
+
break;
|
|
818
847
|
}
|
|
819
848
|
}
|
|
820
|
-
|
|
821
|
-
reject();
|
|
822
|
-
}
|
|
823
|
-
else {
|
|
824
|
-
accept();
|
|
825
|
-
}
|
|
849
|
+
accept();
|
|
826
850
|
});
|
|
827
851
|
}
|
|
828
852
|
observeConfig() {
|
|
829
853
|
this.processMetadata();
|
|
830
854
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
const fieldElem = dataFields[i];
|
|
838
|
-
if (fieldElem && fieldElem['isInvalid']) {
|
|
839
|
-
const hasError = await fieldElem['isInvalid']();
|
|
840
|
-
if (hasError && fieldElem['dataset']) {
|
|
841
|
-
invalidFields.push(fieldElem['dataset'].fieldName);
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
const isValid = invalidFields.length === 0;
|
|
847
|
-
if (!isValid) {
|
|
848
|
-
ApplicationUtils.info("Há pelo menos um campo com conteúdo inválido.");
|
|
849
|
-
}
|
|
850
|
-
return isValid;
|
|
851
|
-
}
|
|
852
|
-
validateRequired(requiredFields, record) {
|
|
855
|
+
validateRequired(record) {
|
|
856
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
857
|
+
const requiredFields = this._staticFields
|
|
858
|
+
.filter(f => f.dataset.required)
|
|
859
|
+
.map(f => f.dataset.fieldName)
|
|
860
|
+
.concat(metadata.getRequiredFields());
|
|
853
861
|
const invalidFields = [];
|
|
854
862
|
requiredFields.forEach(field => {
|
|
855
863
|
const value = record[field];
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
* TODO: fieldElem vai ser vazio quando o campo está em uma aba que
|
|
859
|
-
* está escondida.
|
|
860
|
-
* Temos que tratar esse caso para apresentar a mensagem de erro
|
|
861
|
-
* na aba, isso será tratado no card: https://sankhya.atlassian.net/browse/SKA-44182
|
|
862
|
-
*/
|
|
863
|
-
if (fieldElem) {
|
|
864
|
-
/**
|
|
865
|
-
* Devido o StencilJS não possuir Getter e Setter, para casos que o Watch não for chamado,
|
|
866
|
-
* é necessário limpar a propriedade antes de setar o valor novamente, para que o Watch seja disparado novamente,
|
|
867
|
-
* solução necessária para controlar componentes com herança (Exemplo: EzSearch -> EzComboBox -> EzTextInput).
|
|
868
|
-
*/
|
|
869
|
-
fieldElem["errorMessage"] = "";
|
|
870
|
-
if (value === null || value === undefined || value === "") {
|
|
871
|
-
invalidFields.push(field);
|
|
872
|
-
fieldElem["errorMessage"] = "Essa informação é obrigatória";
|
|
873
|
-
}
|
|
864
|
+
if (value == undefined || value === "") {
|
|
865
|
+
invalidFields.push({ name: field, message: "Essa informação é obrigatória" });
|
|
874
866
|
}
|
|
875
867
|
});
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
ApplicationUtils.info("Há pelo menos um campo obrigatório não preenchido.");
|
|
868
|
+
if (invalidFields.length > 0) {
|
|
869
|
+
return { isValid: false, invalidFields, infoMessage: "Há pelo menos um campo obrigatório não preenchido." };
|
|
879
870
|
}
|
|
880
|
-
return
|
|
871
|
+
return undefined;
|
|
872
|
+
}
|
|
873
|
+
processValidationResult(validationResult) {
|
|
874
|
+
validationResult.forEach(invalidResult => {
|
|
875
|
+
const invalidFields = invalidResult.invalidFields;
|
|
876
|
+
if (invalidFields) {
|
|
877
|
+
invalidFields.forEach(field => {
|
|
878
|
+
this._dataBinder.markInvalid(field);
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
if (invalidResult.infoMessage) {
|
|
882
|
+
ApplicationUtils.info(invalidResult.infoMessage);
|
|
883
|
+
}
|
|
884
|
+
if (invalidResult.errorMessage) {
|
|
885
|
+
const { errorTitle, errorMessage } = invalidResult;
|
|
886
|
+
ApplicationUtils.error(errorTitle, errorMessage);
|
|
887
|
+
}
|
|
888
|
+
});
|
|
881
889
|
}
|
|
882
890
|
getDynamicContent() {
|
|
883
891
|
var _a;
|
|
@@ -919,6 +927,13 @@ let EzForm = class {
|
|
|
919
927
|
}));
|
|
920
928
|
}
|
|
921
929
|
}
|
|
930
|
+
if (action.type === Action.SAVING_DATA) {
|
|
931
|
+
return new Promise((resolve) => {
|
|
932
|
+
this.validate()
|
|
933
|
+
.then(() => resolve(action))
|
|
934
|
+
.catch(() => { });
|
|
935
|
+
});
|
|
936
|
+
}
|
|
922
937
|
if (action.type === Action.RECORDS_ADDED) {
|
|
923
938
|
const metadata = selectFormMetadata(this._store.getState());
|
|
924
939
|
const defaultValues = metadata.getDefaultValues();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-b21f0a10.js';
|
|
2
2
|
import { StringUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { A as ApplicationUtils } from './ApplicationUtils-
|
|
3
|
+
import { A as ApplicationUtils } from './ApplicationUtils-5f87ae60.js';
|
|
4
|
+
import { D as DialogType } from './DialogType-72afa679.js';
|
|
4
5
|
|
|
5
6
|
const ezGridConfigCss = ".sc-ez-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-weight:var(--text-weight--large, 700);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__scrollbar--border-radius:var(--border--radius-medium, 12px);--ez-grid-config__group--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__group--font-size:var(--text--medium, 14px);--ez-grid-config__group--font-weight:var(--text-weight--large, 600);--ez-grid-config__group--padding-bottom:var(--space-small, 6px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-ez-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-ez-grid-config{padding-right:var(--space--medium)}ez-list.sc-ez-grid-config{height:100%}.height-calc.sc-ez-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-ez-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--ez-grid-config__footer--padding-top)}.hidden.sc-ez-grid-config{display:none}.grid-config__main.sc-ez-grid-config{overflow-y:auto;padding-right:var(--ez-grid-config__main--padding-right)}.tabselector-container.sc-ez-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-ez-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-ez-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.subtitle.sc-ez-grid-config{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size);color:var(--text--primary)}.title.sc-ez-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--title--primary);font-family:var(--ez-grid-config__title--font-family);font-size:var(--title--large);font-weight:var(--ez-grid-config__title--font-weight)}.grid-config__main.sc-ez-grid-config::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main.sc-ez-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__scrollbar--background-color);border-radius:var(--ez-grid-config__scrollbar--border-radius)}.grid-config__main.sc-ez-grid-config::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}.group-name.sc-ez-grid-config{font-family:var(--ez-grid-config__group--font-family);font-size:var(--ez-grid-config__group--font-size);font-weight:var(--ez-grid-config__group--font-weight);padding-bottom:var(--ez-grid-config__group--padding-bottom)}";
|
|
6
7
|
|
|
@@ -354,7 +355,7 @@ let EzGridConfig = class {
|
|
|
354
355
|
labelConfirm: "Salvar",
|
|
355
356
|
btnConfirmDanger: false
|
|
356
357
|
};
|
|
357
|
-
ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null,
|
|
358
|
+
ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null, DialogType.WARN, options)
|
|
358
359
|
.then(response => {
|
|
359
360
|
if (!response) {
|
|
360
361
|
this._dataChanged = false;
|