@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
|
@@ -4,16 +4,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-c15a9551.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ApplicationUtils = require('./ApplicationUtils-
|
|
7
|
+
const ApplicationUtils = require('./ApplicationUtils-483c0a9e.js');
|
|
8
|
+
require('./DialogType-a1e288e6.js');
|
|
8
9
|
|
|
9
10
|
const buildTextArea = ({ name, label, readOnly }) => {
|
|
10
11
|
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
11
12
|
index.h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
const buildTextInput = ({ name, label }) => {
|
|
15
|
+
const buildTextInput = ({ name, label, readOnly }) => {
|
|
15
16
|
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
16
|
-
index.h("ez-text-input", { label: label, "data-field-name": name, key: name })));
|
|
17
|
+
index.h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const buildSwitch = (fieldConfig) => {
|
|
@@ -619,6 +620,7 @@ var FormActions;
|
|
|
619
620
|
|
|
620
621
|
class DataBinder {
|
|
621
622
|
constructor(dataUnit) {
|
|
623
|
+
this._invalidFields = new Map();
|
|
622
624
|
this.onDataUnitEvent = (action) => {
|
|
623
625
|
var _a;
|
|
624
626
|
switch (action.type) {
|
|
@@ -627,15 +629,16 @@ class DataBinder {
|
|
|
627
629
|
case core.Action.RECORDS_REMOVED:
|
|
628
630
|
case core.Action.RECORDS_ADDED:
|
|
629
631
|
case core.Action.RECORDS_COPIED:
|
|
630
|
-
case core.Action.DATA_CHANGED:
|
|
631
632
|
case core.Action.EDITION_CANCELED:
|
|
632
|
-
case core.Action.CHANGE_UNDONE:
|
|
633
|
-
case core.Action.CHANGE_REDONE:
|
|
634
633
|
case core.Action.SELECTION_CHANGED:
|
|
635
634
|
case core.Action.NEXT_SELECTED:
|
|
636
635
|
case core.Action.PREVIOUS_SELECTED:
|
|
636
|
+
this.clearInvalid();
|
|
637
|
+
case core.Action.DATA_CHANGED:
|
|
638
|
+
case core.Action.CHANGE_UNDONE:
|
|
639
|
+
case core.Action.CHANGE_REDONE:
|
|
637
640
|
(_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
|
|
638
|
-
this.updateValue(field.fieldName, field.field
|
|
641
|
+
this.updateValue(field.fieldName, field.field);
|
|
639
642
|
});
|
|
640
643
|
break;
|
|
641
644
|
}
|
|
@@ -653,24 +656,45 @@ class DataBinder {
|
|
|
653
656
|
onDisconnectedCallback() {
|
|
654
657
|
this._dataUnit.unsubscribe(this.onDataUnitEvent);
|
|
655
658
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
659
|
+
markInvalid(field) {
|
|
660
|
+
this._invalidFields.set(field.name, field);
|
|
661
|
+
if (this._fields.has(field.name)) {
|
|
662
|
+
this.updateErrorMessage(field.name, this._fields.get(field.name).field);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
clearInvalid() {
|
|
666
|
+
this._invalidFields.clear();
|
|
667
|
+
this._fields.forEach(fieldBinder => {
|
|
668
|
+
const fieldName = fieldBinder.field.dataset.fieldName;
|
|
669
|
+
this.updateErrorMessage(fieldName, fieldBinder.field);
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
updateValue(fieldName, field) {
|
|
673
|
+
const bind = this._fields.get(fieldName);
|
|
674
|
+
try {
|
|
675
|
+
if (bind) {
|
|
676
|
+
bind.listen = false;
|
|
677
|
+
}
|
|
678
|
+
field["value"] = this._dataUnit.getFieldValue(fieldName);
|
|
679
|
+
this.updateErrorMessage(fieldName, field);
|
|
680
|
+
}
|
|
681
|
+
finally {
|
|
682
|
+
if (bind) {
|
|
683
|
+
bind.listen = true;
|
|
684
|
+
}
|
|
666
685
|
}
|
|
667
686
|
}
|
|
687
|
+
updateErrorMessage(fieldName, field) {
|
|
688
|
+
const invalidField = this._invalidFields.get(fieldName);
|
|
689
|
+
field["errorMessage"] = invalidField ? invalidField.message : "";
|
|
690
|
+
}
|
|
668
691
|
updateBind(fieldName, field) {
|
|
669
692
|
const oldBind = this._fields.get(fieldName);
|
|
670
693
|
if (oldBind) {
|
|
671
694
|
oldBind.destroy();
|
|
672
695
|
}
|
|
673
|
-
this.
|
|
696
|
+
field["value"] = this._dataUnit.getFieldValue(fieldName);
|
|
697
|
+
this.updateErrorMessage(fieldName, field);
|
|
674
698
|
this._fields.set(fieldName, Bind.create(fieldName, field, (fieldName, waitingChange) => this.changeStarted(fieldName, waitingChange), (fieldName) => this.cancelWaitingChange(fieldName), (fieldName, newValue) => this.setFieldValue(fieldName, newValue)));
|
|
675
699
|
this.bindSearchOptionsLoader(fieldName, field);
|
|
676
700
|
this.applyEzUploadContext(fieldName, field);
|
|
@@ -711,6 +735,7 @@ class DataBinder {
|
|
|
711
735
|
if (this._dataUnit.records.length === 0) {
|
|
712
736
|
this._dataUnit.addRecord();
|
|
713
737
|
}
|
|
738
|
+
this._invalidFields.delete(fieldName);
|
|
714
739
|
this._dataUnit.setFieldValue(fieldName, newValue);
|
|
715
740
|
if (this._dataUnit.waitingForChange(fieldName)) {
|
|
716
741
|
const bind = this._fields.get(fieldName);
|
|
@@ -745,6 +770,7 @@ class DataBinder {
|
|
|
745
770
|
}
|
|
746
771
|
class Bind {
|
|
747
772
|
constructor() {
|
|
773
|
+
this.listen = true;
|
|
748
774
|
this.startChangeEventName = "ezStartChange";
|
|
749
775
|
this.cancelWaitingChangeEventName = "ezCancelWaitingChange";
|
|
750
776
|
this.changeEventName = "ezChange";
|
|
@@ -772,11 +798,14 @@ class Bind {
|
|
|
772
798
|
const b = new Bind();
|
|
773
799
|
b.field = field;
|
|
774
800
|
b.fieldName = fieldName;
|
|
775
|
-
b.startChangeListener = (evt) => {
|
|
801
|
+
b.startChangeListener = (evt) => { if (b.listen)
|
|
802
|
+
startChangeCallback(fieldName, evt.detail); };
|
|
776
803
|
b.field.addEventListener(b.startChangeEventName, b.startChangeListener);
|
|
777
|
-
b.cancelWaitingChangeListener = () => {
|
|
804
|
+
b.cancelWaitingChangeListener = () => { if (b.listen)
|
|
805
|
+
cancelWaitingChangeCallback(fieldName); };
|
|
778
806
|
b.field.addEventListener(b.cancelWaitingChangeEventName, b.cancelWaitingChangeListener);
|
|
779
|
-
b.changeListener = (evt) => {
|
|
807
|
+
b.changeListener = (evt) => { if (b.listen)
|
|
808
|
+
changeCallback(fieldName, evt.detail); };
|
|
780
809
|
b.field.addEventListener(b.changeEventName, b.changeListener);
|
|
781
810
|
return b;
|
|
782
811
|
}
|
|
@@ -801,87 +830,66 @@ let EzForm = class {
|
|
|
801
830
|
return Promise.resolve();
|
|
802
831
|
}
|
|
803
832
|
validate() {
|
|
804
|
-
return new Promise(
|
|
805
|
-
|
|
806
|
-
const requiredFields = this._staticFields
|
|
807
|
-
.filter(f => f.dataset.required)
|
|
808
|
-
.map(f => f.dataset.fieldName)
|
|
809
|
-
.concat(metadata.getRequiredFields());
|
|
810
|
-
let isReject = false;
|
|
833
|
+
return new Promise((accept, reject) => {
|
|
834
|
+
var _a;
|
|
811
835
|
const records = this.dataUnit.getModifiedRecords();
|
|
812
836
|
for (let i = 0; i < records.length; i++) {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
837
|
+
const record = records[i];
|
|
838
|
+
const invalidResults = [];
|
|
839
|
+
let validationResult = this.validateRequired(record);
|
|
840
|
+
if (validationResult && !validationResult.isValid) {
|
|
841
|
+
invalidResults.push(validationResult);
|
|
816
842
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
843
|
+
validationResult = (_a = this.recordsValidator) === null || _a === void 0 ? void 0 : _a.validateRecord(this, record);
|
|
844
|
+
if (validationResult && !validationResult.isValid) {
|
|
845
|
+
invalidResults.push(validationResult);
|
|
846
|
+
}
|
|
847
|
+
if (invalidResults.length > 0) {
|
|
848
|
+
this.processValidationResult(invalidResults);
|
|
849
|
+
reject();
|
|
850
|
+
break;
|
|
822
851
|
}
|
|
823
852
|
}
|
|
824
|
-
|
|
825
|
-
reject();
|
|
826
|
-
}
|
|
827
|
-
else {
|
|
828
|
-
accept();
|
|
829
|
-
}
|
|
853
|
+
accept();
|
|
830
854
|
});
|
|
831
855
|
}
|
|
832
856
|
observeConfig() {
|
|
833
857
|
this.processMetadata();
|
|
834
858
|
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
const fieldElem = dataFields[i];
|
|
842
|
-
if (fieldElem && fieldElem['isInvalid']) {
|
|
843
|
-
const hasError = await fieldElem['isInvalid']();
|
|
844
|
-
if (hasError && fieldElem['dataset']) {
|
|
845
|
-
invalidFields.push(fieldElem['dataset'].fieldName);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
const isValid = invalidFields.length === 0;
|
|
851
|
-
if (!isValid) {
|
|
852
|
-
ApplicationUtils.ApplicationUtils.info("Há pelo menos um campo com conteúdo inválido.");
|
|
853
|
-
}
|
|
854
|
-
return isValid;
|
|
855
|
-
}
|
|
856
|
-
validateRequired(requiredFields, record) {
|
|
859
|
+
validateRequired(record) {
|
|
860
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
861
|
+
const requiredFields = this._staticFields
|
|
862
|
+
.filter(f => f.dataset.required)
|
|
863
|
+
.map(f => f.dataset.fieldName)
|
|
864
|
+
.concat(metadata.getRequiredFields());
|
|
857
865
|
const invalidFields = [];
|
|
858
866
|
requiredFields.forEach(field => {
|
|
859
867
|
const value = record[field];
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
* TODO: fieldElem vai ser vazio quando o campo está em uma aba que
|
|
863
|
-
* está escondida.
|
|
864
|
-
* Temos que tratar esse caso para apresentar a mensagem de erro
|
|
865
|
-
* na aba, isso será tratado no card: https://sankhya.atlassian.net/browse/SKA-44182
|
|
866
|
-
*/
|
|
867
|
-
if (fieldElem) {
|
|
868
|
-
/**
|
|
869
|
-
* Devido o StencilJS não possuir Getter e Setter, para casos que o Watch não for chamado,
|
|
870
|
-
* é necessário limpar a propriedade antes de setar o valor novamente, para que o Watch seja disparado novamente,
|
|
871
|
-
* solução necessária para controlar componentes com herança (Exemplo: EzSearch -> EzComboBox -> EzTextInput).
|
|
872
|
-
*/
|
|
873
|
-
fieldElem["errorMessage"] = "";
|
|
874
|
-
if (value === null || value === undefined || value === "") {
|
|
875
|
-
invalidFields.push(field);
|
|
876
|
-
fieldElem["errorMessage"] = "Essa informação é obrigatória";
|
|
877
|
-
}
|
|
868
|
+
if (value == undefined || value === "") {
|
|
869
|
+
invalidFields.push({ name: field, message: "Essa informação é obrigatória" });
|
|
878
870
|
}
|
|
879
871
|
});
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
ApplicationUtils.ApplicationUtils.info("Há pelo menos um campo obrigatório não preenchido.");
|
|
872
|
+
if (invalidFields.length > 0) {
|
|
873
|
+
return { isValid: false, invalidFields, infoMessage: "Há pelo menos um campo obrigatório não preenchido." };
|
|
883
874
|
}
|
|
884
|
-
return
|
|
875
|
+
return undefined;
|
|
876
|
+
}
|
|
877
|
+
processValidationResult(validationResult) {
|
|
878
|
+
validationResult.forEach(invalidResult => {
|
|
879
|
+
const invalidFields = invalidResult.invalidFields;
|
|
880
|
+
if (invalidFields) {
|
|
881
|
+
invalidFields.forEach(field => {
|
|
882
|
+
this._dataBinder.markInvalid(field);
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
if (invalidResult.infoMessage) {
|
|
886
|
+
ApplicationUtils.ApplicationUtils.info(invalidResult.infoMessage);
|
|
887
|
+
}
|
|
888
|
+
if (invalidResult.errorMessage) {
|
|
889
|
+
const { errorTitle, errorMessage } = invalidResult;
|
|
890
|
+
ApplicationUtils.ApplicationUtils.error(errorTitle, errorMessage);
|
|
891
|
+
}
|
|
892
|
+
});
|
|
885
893
|
}
|
|
886
894
|
getDynamicContent() {
|
|
887
895
|
var _a;
|
|
@@ -923,6 +931,13 @@ let EzForm = class {
|
|
|
923
931
|
}));
|
|
924
932
|
}
|
|
925
933
|
}
|
|
934
|
+
if (action.type === core.Action.SAVING_DATA) {
|
|
935
|
+
return new Promise((resolve) => {
|
|
936
|
+
this.validate()
|
|
937
|
+
.then(() => resolve(action))
|
|
938
|
+
.catch(() => { });
|
|
939
|
+
});
|
|
940
|
+
}
|
|
926
941
|
if (action.type === core.Action.RECORDS_ADDED) {
|
|
927
942
|
const metadata = selectFormMetadata(this._store.getState());
|
|
928
943
|
const defaultValues = metadata.getDefaultValues();
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-c15a9551.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const ApplicationUtils = require('./ApplicationUtils-
|
|
7
|
+
const ApplicationUtils = require('./ApplicationUtils-483c0a9e.js');
|
|
8
|
+
const DialogType = require('./DialogType-a1e288e6.js');
|
|
8
9
|
|
|
9
10
|
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)}";
|
|
10
11
|
|
|
@@ -358,7 +359,7 @@ let EzGridConfig = class {
|
|
|
358
359
|
labelConfirm: "Salvar",
|
|
359
360
|
btnConfirmDanger: false
|
|
360
361
|
};
|
|
361
|
-
ApplicationUtils.ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null,
|
|
362
|
+
ApplicationUtils.ApplicationUtils.confirm("Aviso", "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?", null, DialogType.DialogType.WARN, options)
|
|
362
363
|
.then(response => {
|
|
363
364
|
if (!response) {
|
|
364
365
|
this._dataChanged = false;
|