tnx-shared 5.3.217 → 5.3.219
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/bundles/tnx-shared.umd.js +138 -95
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/base/data-form-base.d.ts.map +1 -1
- package/classes/form-schema.d.ts +1 -0
- package/classes/form-schema.d.ts.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +1 -0
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/components/user-picker/user-picker.component.d.ts.map +1 -1
- package/esm2015/classes/base/data-form-base.js +2 -1
- package/esm2015/classes/form-schema.js +2 -1
- package/esm2015/components/crud/crud-form/crud-form.component.js +12 -1
- package/esm2015/components/user-picker/user-picker.component.js +13 -2
- package/fesm2015/tnx-shared.js +24 -1
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -1917,6 +1917,7 @@
|
|
|
1917
1917
|
_this.operatorFieldSearchText = exports.Operator.contain;
|
|
1918
1918
|
_this.usePicker = true;
|
|
1919
1919
|
_this.hiddenCols = [];
|
|
1920
|
+
_this.formState = exports.FormState.ADD;
|
|
1920
1921
|
_this.funcCompare = function (item, value) { return item[_this.valueField] == value; };
|
|
1921
1922
|
for (var key in init) {
|
|
1922
1923
|
_this[key] = init[key];
|
|
@@ -14772,6 +14773,29 @@
|
|
|
14772
14773
|
finally { if (e_2) throw e_2.error; }
|
|
14773
14774
|
}
|
|
14774
14775
|
};
|
|
14776
|
+
CrudFormComponent.prototype.switchFormStateForUserpicker = function (isFormAddNew) {
|
|
14777
|
+
var e_3, _e;
|
|
14778
|
+
if (isFormAddNew === void 0) { isFormAddNew = false; }
|
|
14779
|
+
var keys = Object.keys(this.formControls);
|
|
14780
|
+
if (keys.length == 0)
|
|
14781
|
+
return;
|
|
14782
|
+
try {
|
|
14783
|
+
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
14784
|
+
var key = keys_1_1.value;
|
|
14785
|
+
var schema = this.formControls[key];
|
|
14786
|
+
if (schema instanceof UserPickerControlSchema) {
|
|
14787
|
+
schema.formState = isFormAddNew ? exports.FormState.ADD : exports.FormState.EDIT;
|
|
14788
|
+
}
|
|
14789
|
+
}
|
|
14790
|
+
}
|
|
14791
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
14792
|
+
finally {
|
|
14793
|
+
try {
|
|
14794
|
+
if (keys_1_1 && !keys_1_1.done && (_e = keys_1.return)) _e.call(keys_1);
|
|
14795
|
+
}
|
|
14796
|
+
finally { if (e_3) throw e_3.error; }
|
|
14797
|
+
}
|
|
14798
|
+
};
|
|
14775
14799
|
CrudFormComponent.prototype.reload = function () {
|
|
14776
14800
|
this.initLoad();
|
|
14777
14801
|
};
|
|
@@ -14779,7 +14803,7 @@
|
|
|
14779
14803
|
this.cleanModel(this._modelData);
|
|
14780
14804
|
};
|
|
14781
14805
|
CrudFormComponent.prototype.cleanModel = function (model) {
|
|
14782
|
-
var
|
|
14806
|
+
var e_4, _e;
|
|
14783
14807
|
if (isLiteralObject(model)) {
|
|
14784
14808
|
for (var key in model) {
|
|
14785
14809
|
if (key == '_status') {
|
|
@@ -14804,17 +14828,17 @@
|
|
|
14804
14828
|
this.cleanModel(item);
|
|
14805
14829
|
}
|
|
14806
14830
|
}
|
|
14807
|
-
catch (
|
|
14831
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
14808
14832
|
finally {
|
|
14809
14833
|
try {
|
|
14810
14834
|
if (model_1_1 && !model_1_1.done && (_e = model_1.return)) _e.call(model_1);
|
|
14811
14835
|
}
|
|
14812
|
-
finally { if (
|
|
14836
|
+
finally { if (e_4) throw e_4.error; }
|
|
14813
14837
|
}
|
|
14814
14838
|
}
|
|
14815
14839
|
};
|
|
14816
14840
|
CrudFormComponent.prototype.reInitControlModelAndRootNode = function () {
|
|
14817
|
-
var
|
|
14841
|
+
var e_5, _e;
|
|
14818
14842
|
var _this = this;
|
|
14819
14843
|
try {
|
|
14820
14844
|
for (var _f = __values(this.setting.schema), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
@@ -14822,12 +14846,12 @@
|
|
|
14822
14846
|
this.initControlModel(this._modelData, control);
|
|
14823
14847
|
}
|
|
14824
14848
|
}
|
|
14825
|
-
catch (
|
|
14849
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
14826
14850
|
finally {
|
|
14827
14851
|
try {
|
|
14828
14852
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
14829
14853
|
}
|
|
14830
|
-
finally { if (
|
|
14854
|
+
finally { if (e_5) throw e_5.error; }
|
|
14831
14855
|
}
|
|
14832
14856
|
var rootNodeOld = this._rootNode;
|
|
14833
14857
|
this._rootNode = new ControlTreeNode(this._modelData, this.formControls);
|
|
@@ -14848,7 +14872,7 @@
|
|
|
14848
14872
|
this.onModelChanged.emit(event);
|
|
14849
14873
|
};
|
|
14850
14874
|
CrudFormComponent.prototype.getMinimizeData = function (model) {
|
|
14851
|
-
var
|
|
14875
|
+
var e_6, _e;
|
|
14852
14876
|
if (isLiteralObject(model)) {
|
|
14853
14877
|
if (model._dropdownvalue != null && model._dropdownvalue !== '') {
|
|
14854
14878
|
return model[model._dropdownvalue] == null ? model['value'] : model[model._dropdownvalue];
|
|
@@ -14873,12 +14897,12 @@
|
|
|
14873
14897
|
arr.push(this.getMinimizeData(item));
|
|
14874
14898
|
}
|
|
14875
14899
|
}
|
|
14876
|
-
catch (
|
|
14900
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
14877
14901
|
finally {
|
|
14878
14902
|
try {
|
|
14879
14903
|
if (model_2_1 && !model_2_1.done && (_e = model_2.return)) _e.call(model_2);
|
|
14880
14904
|
}
|
|
14881
|
-
finally { if (
|
|
14905
|
+
finally { if (e_6) throw e_6.error; }
|
|
14882
14906
|
}
|
|
14883
14907
|
return arr;
|
|
14884
14908
|
}
|
|
@@ -14918,19 +14942,19 @@
|
|
|
14918
14942
|
});
|
|
14919
14943
|
};
|
|
14920
14944
|
CrudFormComponent.prototype.initSchema = function () {
|
|
14921
|
-
var
|
|
14945
|
+
var e_7, _e, e_8, _f;
|
|
14922
14946
|
try {
|
|
14923
14947
|
for (var _g = __values(this.setting.schema), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
14924
14948
|
var control = _h.value;
|
|
14925
14949
|
this.initControlSchema(control);
|
|
14926
14950
|
}
|
|
14927
14951
|
}
|
|
14928
|
-
catch (
|
|
14952
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
14929
14953
|
finally {
|
|
14930
14954
|
try {
|
|
14931
14955
|
if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
|
|
14932
14956
|
}
|
|
14933
|
-
finally { if (
|
|
14957
|
+
finally { if (e_7) throw e_7.error; }
|
|
14934
14958
|
}
|
|
14935
14959
|
try {
|
|
14936
14960
|
for (var _j = __values(this.setting.schema), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
@@ -14940,18 +14964,18 @@
|
|
|
14940
14964
|
this.initBindingControlSchema(control);
|
|
14941
14965
|
}
|
|
14942
14966
|
}
|
|
14943
|
-
catch (
|
|
14967
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
14944
14968
|
finally {
|
|
14945
14969
|
try {
|
|
14946
14970
|
if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
|
|
14947
14971
|
}
|
|
14948
|
-
finally { if (
|
|
14972
|
+
finally { if (e_8) throw e_8.error; }
|
|
14949
14973
|
}
|
|
14950
14974
|
this._rootNode = new ControlTreeNode(this._modelData, this.formControls);
|
|
14951
14975
|
this._rootNode.setCrudForm(this);
|
|
14952
14976
|
};
|
|
14953
14977
|
CrudFormComponent.prototype.initControlModel = function (parentModel, control, parentPath) {
|
|
14954
|
-
var
|
|
14978
|
+
var e_9, _e, e_10, _f, e_11, _g;
|
|
14955
14979
|
var _this = this;
|
|
14956
14980
|
this.initPrivateData(parentModel, control.field);
|
|
14957
14981
|
var _parentPath = control.field;
|
|
@@ -14976,27 +15000,27 @@
|
|
|
14976
15000
|
for (var _h = __values(parentModel[control.field]), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
14977
15001
|
var item = _j.value;
|
|
14978
15002
|
try {
|
|
14979
|
-
for (var _k = (
|
|
15003
|
+
for (var _k = (e_10 = void 0, __values(control.rowTemplate)), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
14980
15004
|
var subControl = _l.value;
|
|
14981
15005
|
this.initControlModel(item, subControl, _parentPath + '[' + i + ']');
|
|
14982
15006
|
}
|
|
14983
15007
|
}
|
|
14984
|
-
catch (
|
|
15008
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
14985
15009
|
finally {
|
|
14986
15010
|
try {
|
|
14987
15011
|
if (_l && !_l.done && (_f = _k.return)) _f.call(_k);
|
|
14988
15012
|
}
|
|
14989
|
-
finally { if (
|
|
15013
|
+
finally { if (e_10) throw e_10.error; }
|
|
14990
15014
|
}
|
|
14991
15015
|
i++;
|
|
14992
15016
|
}
|
|
14993
15017
|
}
|
|
14994
|
-
catch (
|
|
15018
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
14995
15019
|
finally {
|
|
14996
15020
|
try {
|
|
14997
15021
|
if (_j && !_j.done && (_e = _h.return)) _e.call(_h);
|
|
14998
15022
|
}
|
|
14999
|
-
finally { if (
|
|
15023
|
+
finally { if (e_9) throw e_9.error; }
|
|
15000
15024
|
}
|
|
15001
15025
|
}
|
|
15002
15026
|
else if (control instanceof ContainerSchema) {
|
|
@@ -15009,12 +15033,12 @@
|
|
|
15009
15033
|
this.initControlModel(parentModel[control.field], subControl, _parentPath);
|
|
15010
15034
|
}
|
|
15011
15035
|
}
|
|
15012
|
-
catch (
|
|
15036
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
15013
15037
|
finally {
|
|
15014
15038
|
try {
|
|
15015
15039
|
if (_o && !_o.done && (_g = _m.return)) _g.call(_m);
|
|
15016
15040
|
}
|
|
15017
|
-
finally { if (
|
|
15041
|
+
finally { if (e_11) throw e_11.error; }
|
|
15018
15042
|
}
|
|
15019
15043
|
}
|
|
15020
15044
|
// else {
|
|
@@ -15024,7 +15048,7 @@
|
|
|
15024
15048
|
// }
|
|
15025
15049
|
};
|
|
15026
15050
|
CrudFormComponent.prototype.initControlDefaultValueFromExternal = function () {
|
|
15027
|
-
var
|
|
15051
|
+
var e_12, _e;
|
|
15028
15052
|
try {
|
|
15029
15053
|
// const schemaDynamics = [];
|
|
15030
15054
|
for (var _f = __values(this.setting.schema), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
@@ -15037,12 +15061,12 @@
|
|
|
15037
15061
|
// }
|
|
15038
15062
|
}
|
|
15039
15063
|
}
|
|
15040
|
-
catch (
|
|
15064
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
15041
15065
|
finally {
|
|
15042
15066
|
try {
|
|
15043
15067
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
15044
15068
|
}
|
|
15045
|
-
finally { if (
|
|
15069
|
+
finally { if (e_12) throw e_12.error; }
|
|
15046
15070
|
}
|
|
15047
15071
|
// Tạm thời k render luôn tên công việc trong form init, vì đang k kiểm soát dc khi nào tất cả control ready
|
|
15048
15072
|
// schemaDynamics.forEach(schema => {
|
|
@@ -15052,7 +15076,7 @@
|
|
|
15052
15076
|
CrudFormComponent.prototype.initControlDefaultValue = function (parentModel, control, parentPath) {
|
|
15053
15077
|
return __awaiter(this, void 0, void 0, function () {
|
|
15054
15078
|
var _parentPath, addMore, i, _e, _f, item, _g, _h, subControl, _j, _k, subControl, _l;
|
|
15055
|
-
var
|
|
15079
|
+
var e_13, _m, e_14, _o, e_15, _p;
|
|
15056
15080
|
return __generator(this, function (_q) {
|
|
15057
15081
|
switch (_q.label) {
|
|
15058
15082
|
case 0:
|
|
@@ -15073,27 +15097,27 @@
|
|
|
15073
15097
|
for (_e = __values(parentModel[control.field]), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
15074
15098
|
item = _f.value;
|
|
15075
15099
|
try {
|
|
15076
|
-
for (_g = (
|
|
15100
|
+
for (_g = (e_14 = void 0, __values(control.rowTemplate)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
15077
15101
|
subControl = _h.value;
|
|
15078
15102
|
this.initControlDefaultValue(item, subControl, _parentPath + '[' + i + ']');
|
|
15079
15103
|
}
|
|
15080
15104
|
}
|
|
15081
|
-
catch (
|
|
15105
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
15082
15106
|
finally {
|
|
15083
15107
|
try {
|
|
15084
15108
|
if (_h && !_h.done && (_o = _g.return)) _o.call(_g);
|
|
15085
15109
|
}
|
|
15086
|
-
finally { if (
|
|
15110
|
+
finally { if (e_14) throw e_14.error; }
|
|
15087
15111
|
}
|
|
15088
15112
|
i++;
|
|
15089
15113
|
}
|
|
15090
15114
|
}
|
|
15091
|
-
catch (
|
|
15115
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
15092
15116
|
finally {
|
|
15093
15117
|
try {
|
|
15094
15118
|
if (_f && !_f.done && (_m = _e.return)) _m.call(_e);
|
|
15095
15119
|
}
|
|
15096
|
-
finally { if (
|
|
15120
|
+
finally { if (e_13) throw e_13.error; }
|
|
15097
15121
|
}
|
|
15098
15122
|
return [3 /*break*/, 5];
|
|
15099
15123
|
case 1:
|
|
@@ -15107,12 +15131,12 @@
|
|
|
15107
15131
|
this.initControlDefaultValue(parentModel[control.field], subControl, _parentPath);
|
|
15108
15132
|
}
|
|
15109
15133
|
}
|
|
15110
|
-
catch (
|
|
15134
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
15111
15135
|
finally {
|
|
15112
15136
|
try {
|
|
15113
15137
|
if (_k && !_k.done && (_p = _j.return)) _p.call(_j);
|
|
15114
15138
|
}
|
|
15115
|
-
finally { if (
|
|
15139
|
+
finally { if (e_15) throw e_15.error; }
|
|
15116
15140
|
}
|
|
15117
15141
|
return [3 /*break*/, 5];
|
|
15118
15142
|
case 2:
|
|
@@ -15155,7 +15179,7 @@
|
|
|
15155
15179
|
parentModel._errors[field] = [];
|
|
15156
15180
|
};
|
|
15157
15181
|
CrudFormComponent.prototype.reInitControlSchema = function () {
|
|
15158
|
-
var
|
|
15182
|
+
var e_16, _e;
|
|
15159
15183
|
var _this = this;
|
|
15160
15184
|
try {
|
|
15161
15185
|
for (var _f = __values(this.setting.schema), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
@@ -15163,12 +15187,12 @@
|
|
|
15163
15187
|
this.initControlSchema(control);
|
|
15164
15188
|
}
|
|
15165
15189
|
}
|
|
15166
|
-
catch (
|
|
15190
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
15167
15191
|
finally {
|
|
15168
15192
|
try {
|
|
15169
15193
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
15170
15194
|
}
|
|
15171
|
-
finally { if (
|
|
15195
|
+
finally { if (e_16) throw e_16.error; }
|
|
15172
15196
|
}
|
|
15173
15197
|
this._rootNode = new ControlTreeNode(this._modelData, this.formControls);
|
|
15174
15198
|
this._rootNode.setCrudForm(this);
|
|
@@ -15182,7 +15206,7 @@
|
|
|
15182
15206
|
});
|
|
15183
15207
|
};
|
|
15184
15208
|
CrudFormComponent.prototype.initControlSchema = function (schema, parentId) {
|
|
15185
|
-
var
|
|
15209
|
+
var e_17, _e, e_18, _f;
|
|
15186
15210
|
var _this = this;
|
|
15187
15211
|
if (schema.disabled != true) {
|
|
15188
15212
|
schema.disabled = null;
|
|
@@ -15244,12 +15268,12 @@
|
|
|
15244
15268
|
this.initControlSchema(subControl, schema.uniqueField);
|
|
15245
15269
|
}
|
|
15246
15270
|
}
|
|
15247
|
-
catch (
|
|
15271
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
15248
15272
|
finally {
|
|
15249
15273
|
try {
|
|
15250
15274
|
if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
|
|
15251
15275
|
}
|
|
15252
|
-
finally { if (
|
|
15276
|
+
finally { if (e_17) throw e_17.error; }
|
|
15253
15277
|
}
|
|
15254
15278
|
}
|
|
15255
15279
|
else if (schema instanceof DropdownControlSchema) {
|
|
@@ -15291,12 +15315,12 @@
|
|
|
15291
15315
|
this.initControlSchema(subControl, control.uniqueField);
|
|
15292
15316
|
}
|
|
15293
15317
|
}
|
|
15294
|
-
catch (
|
|
15318
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
15295
15319
|
finally {
|
|
15296
15320
|
try {
|
|
15297
15321
|
if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
|
|
15298
15322
|
}
|
|
15299
|
-
finally { if (
|
|
15323
|
+
finally { if (e_18) throw e_18.error; }
|
|
15300
15324
|
}
|
|
15301
15325
|
}
|
|
15302
15326
|
else if (schema instanceof AutoCompletePickerControlSchema) {
|
|
@@ -15328,7 +15352,7 @@
|
|
|
15328
15352
|
}
|
|
15329
15353
|
};
|
|
15330
15354
|
CrudFormComponent.prototype.disableControlSchema = function (schema, disabled) {
|
|
15331
|
-
var
|
|
15355
|
+
var e_19, _e, e_20, _f;
|
|
15332
15356
|
if (disabled === void 0) { disabled = true; }
|
|
15333
15357
|
if (!schema.disabled) {
|
|
15334
15358
|
schema.disabled = disabled;
|
|
@@ -15341,12 +15365,12 @@
|
|
|
15341
15365
|
this.disableControlSchema(subControl, disabled);
|
|
15342
15366
|
}
|
|
15343
15367
|
}
|
|
15344
|
-
catch (
|
|
15368
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
15345
15369
|
finally {
|
|
15346
15370
|
try {
|
|
15347
15371
|
if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
|
|
15348
15372
|
}
|
|
15349
|
-
finally { if (
|
|
15373
|
+
finally { if (e_19) throw e_19.error; }
|
|
15350
15374
|
}
|
|
15351
15375
|
}
|
|
15352
15376
|
else if (schema instanceof ContainerSchema) {
|
|
@@ -15357,12 +15381,12 @@
|
|
|
15357
15381
|
this.disableControlSchema(subControl, disabled);
|
|
15358
15382
|
}
|
|
15359
15383
|
}
|
|
15360
|
-
catch (
|
|
15384
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
15361
15385
|
finally {
|
|
15362
15386
|
try {
|
|
15363
15387
|
if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
|
|
15364
15388
|
}
|
|
15365
|
-
finally { if (
|
|
15389
|
+
finally { if (e_20) throw e_20.error; }
|
|
15366
15390
|
}
|
|
15367
15391
|
}
|
|
15368
15392
|
};
|
|
@@ -15379,7 +15403,7 @@
|
|
|
15379
15403
|
schema.data.tenCongViec = templateText;
|
|
15380
15404
|
};
|
|
15381
15405
|
CrudFormComponent.prototype.initBindingControlSchema = function (schema) {
|
|
15382
|
-
var
|
|
15406
|
+
var e_21, _e, e_22, _f;
|
|
15383
15407
|
if (schema instanceof TableSchema) {
|
|
15384
15408
|
var control = schema;
|
|
15385
15409
|
try {
|
|
@@ -15388,12 +15412,12 @@
|
|
|
15388
15412
|
this.initBindingControlSchema(subControl);
|
|
15389
15413
|
}
|
|
15390
15414
|
}
|
|
15391
|
-
catch (
|
|
15415
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
15392
15416
|
finally {
|
|
15393
15417
|
try {
|
|
15394
15418
|
if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
|
|
15395
15419
|
}
|
|
15396
|
-
finally { if (
|
|
15420
|
+
finally { if (e_21) throw e_21.error; }
|
|
15397
15421
|
}
|
|
15398
15422
|
}
|
|
15399
15423
|
else if (schema instanceof DropdownControlSchema) {
|
|
@@ -15416,12 +15440,12 @@
|
|
|
15416
15440
|
this.initBindingControlSchema(subControl);
|
|
15417
15441
|
}
|
|
15418
15442
|
}
|
|
15419
|
-
catch (
|
|
15443
|
+
catch (e_22_1) { e_22 = { error: e_22_1 }; }
|
|
15420
15444
|
finally {
|
|
15421
15445
|
try {
|
|
15422
15446
|
if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
|
|
15423
15447
|
}
|
|
15424
|
-
finally { if (
|
|
15448
|
+
finally { if (e_22) throw e_22.error; }
|
|
15425
15449
|
}
|
|
15426
15450
|
}
|
|
15427
15451
|
};
|
|
@@ -15445,7 +15469,7 @@
|
|
|
15445
15469
|
});
|
|
15446
15470
|
};
|
|
15447
15471
|
CrudFormComponent.prototype.bindOnChangeToDropdownRecursive = function (childDropdown, tmpFilters, markedControl) {
|
|
15448
|
-
var
|
|
15472
|
+
var e_23, _e;
|
|
15449
15473
|
var _this = this;
|
|
15450
15474
|
if (tmpFilters instanceof Array) {
|
|
15451
15475
|
var _loop_1 = function (filter) {
|
|
@@ -15504,12 +15528,12 @@
|
|
|
15504
15528
|
_loop_1(filter);
|
|
15505
15529
|
}
|
|
15506
15530
|
}
|
|
15507
|
-
catch (
|
|
15531
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
15508
15532
|
finally {
|
|
15509
15533
|
try {
|
|
15510
15534
|
if (tmpFilters_1_1 && !tmpFilters_1_1.done && (_e = tmpFilters_1.return)) _e.call(tmpFilters_1);
|
|
15511
15535
|
}
|
|
15512
|
-
finally { if (
|
|
15536
|
+
finally { if (e_23) throw e_23.error; }
|
|
15513
15537
|
}
|
|
15514
15538
|
}
|
|
15515
15539
|
};
|
|
@@ -15620,7 +15644,7 @@
|
|
|
15620
15644
|
}
|
|
15621
15645
|
};
|
|
15622
15646
|
CrudFormComponent.prototype.initValidatorAndCorrector = function (schema) {
|
|
15623
|
-
var
|
|
15647
|
+
var e_24, _e, e_25, _f;
|
|
15624
15648
|
var _this = this;
|
|
15625
15649
|
if (!schema.correctors)
|
|
15626
15650
|
schema.correctors = [];
|
|
@@ -15671,12 +15695,12 @@
|
|
|
15671
15695
|
this.initValidatorAndCorrector(subControl);
|
|
15672
15696
|
}
|
|
15673
15697
|
}
|
|
15674
|
-
catch (
|
|
15698
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
15675
15699
|
finally {
|
|
15676
15700
|
try {
|
|
15677
15701
|
if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
|
|
15678
15702
|
}
|
|
15679
|
-
finally { if (
|
|
15703
|
+
finally { if (e_24) throw e_24.error; }
|
|
15680
15704
|
}
|
|
15681
15705
|
}
|
|
15682
15706
|
else if (schema instanceof DateTimeControlSchema) {
|
|
@@ -15697,12 +15721,12 @@
|
|
|
15697
15721
|
this.initValidatorAndCorrector(subControl);
|
|
15698
15722
|
}
|
|
15699
15723
|
}
|
|
15700
|
-
catch (
|
|
15724
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
15701
15725
|
finally {
|
|
15702
15726
|
try {
|
|
15703
15727
|
if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
|
|
15704
15728
|
}
|
|
15705
|
-
finally { if (
|
|
15729
|
+
finally { if (e_25) throw e_25.error; }
|
|
15706
15730
|
}
|
|
15707
15731
|
}
|
|
15708
15732
|
schema.validators.forEach(function (validator) {
|
|
@@ -15807,7 +15831,7 @@
|
|
|
15807
15831
|
}
|
|
15808
15832
|
};
|
|
15809
15833
|
CrudFormComponent.prototype.setDataDefault = function () {
|
|
15810
|
-
var
|
|
15834
|
+
var e_26, _e;
|
|
15811
15835
|
var stringDataDefault = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.DEFAULT_DATA);
|
|
15812
15836
|
var getSettingDataDefault = this._moduleConfig.getConfig().environment.settingDataDefault;
|
|
15813
15837
|
if (stringDataDefault && (this._modelData && !this._modelData.id)) {
|
|
@@ -15841,12 +15865,12 @@
|
|
|
15841
15865
|
}
|
|
15842
15866
|
}
|
|
15843
15867
|
}
|
|
15844
|
-
catch (
|
|
15868
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
15845
15869
|
finally {
|
|
15846
15870
|
try {
|
|
15847
15871
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
15848
15872
|
}
|
|
15849
|
-
finally { if (
|
|
15873
|
+
finally { if (e_26) throw e_26.error; }
|
|
15850
15874
|
}
|
|
15851
15875
|
}
|
|
15852
15876
|
if (this.setting.function.modifyDataAfterGetCache) {
|
|
@@ -15858,7 +15882,7 @@
|
|
|
15858
15882
|
this.setCachedValueToModel(this._modelData);
|
|
15859
15883
|
};
|
|
15860
15884
|
CrudFormComponent.prototype.setCachedValueToModel = function (model, uniqueKeyControl, path) {
|
|
15861
|
-
var
|
|
15885
|
+
var e_27, _e;
|
|
15862
15886
|
for (var field in model) {
|
|
15863
15887
|
if (field != '_errors' && field != '_status' && field != '_source') {
|
|
15864
15888
|
var subUniqueKeyControl = void 0;
|
|
@@ -15882,18 +15906,18 @@
|
|
|
15882
15906
|
if (subModel instanceof Array) {
|
|
15883
15907
|
var index = 0;
|
|
15884
15908
|
try {
|
|
15885
|
-
for (var subModel_1 = (
|
|
15909
|
+
for (var subModel_1 = (e_27 = void 0, __values(subModel)), subModel_1_1 = subModel_1.next(); !subModel_1_1.done; subModel_1_1 = subModel_1.next()) {
|
|
15886
15910
|
var item = subModel_1_1.value;
|
|
15887
15911
|
this.setCachedValueToModel(item, subUniqueKeyControl, subPath + '[' + index + ']');
|
|
15888
15912
|
index++;
|
|
15889
15913
|
}
|
|
15890
15914
|
}
|
|
15891
|
-
catch (
|
|
15915
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
15892
15916
|
finally {
|
|
15893
15917
|
try {
|
|
15894
15918
|
if (subModel_1_1 && !subModel_1_1.done && (_e = subModel_1.return)) _e.call(subModel_1);
|
|
15895
15919
|
}
|
|
15896
|
-
finally { if (
|
|
15920
|
+
finally { if (e_27) throw e_27.error; }
|
|
15897
15921
|
}
|
|
15898
15922
|
}
|
|
15899
15923
|
else if (isLiteralObject(subModel)) {
|
|
@@ -16169,8 +16193,8 @@
|
|
|
16169
16193
|
};
|
|
16170
16194
|
CrudFormComponent.prototype.validateModel = function (currentNode) {
|
|
16171
16195
|
return __awaiter(this, void 0, void 0, function () {
|
|
16172
|
-
var _e, _f, childNode,
|
|
16173
|
-
var
|
|
16196
|
+
var _e, _f, childNode, e_28_1;
|
|
16197
|
+
var e_28, _g;
|
|
16174
16198
|
return __generator(this, function (_h) {
|
|
16175
16199
|
switch (_h.label) {
|
|
16176
16200
|
case 0:
|
|
@@ -16203,14 +16227,14 @@
|
|
|
16203
16227
|
return [3 /*break*/, 1];
|
|
16204
16228
|
case 5: return [3 /*break*/, 8];
|
|
16205
16229
|
case 6:
|
|
16206
|
-
|
|
16207
|
-
|
|
16230
|
+
e_28_1 = _h.sent();
|
|
16231
|
+
e_28 = { error: e_28_1 };
|
|
16208
16232
|
return [3 /*break*/, 8];
|
|
16209
16233
|
case 7:
|
|
16210
16234
|
try {
|
|
16211
16235
|
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
16212
16236
|
}
|
|
16213
|
-
finally { if (
|
|
16237
|
+
finally { if (e_28) throw e_28.error; }
|
|
16214
16238
|
return [7 /*endfinally*/];
|
|
16215
16239
|
case 8: return [2 /*return*/];
|
|
16216
16240
|
}
|
|
@@ -16442,7 +16466,7 @@
|
|
|
16442
16466
|
return this._modelData[controlTable.field];
|
|
16443
16467
|
};
|
|
16444
16468
|
CrudFormComponent.prototype.checkReadyAll = function () {
|
|
16445
|
-
var
|
|
16469
|
+
var e_29, _e;
|
|
16446
16470
|
try {
|
|
16447
16471
|
for (var _f = __values(this.controlNeedCheckReady), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
16448
16472
|
var control = _g.value;
|
|
@@ -16466,12 +16490,12 @@
|
|
|
16466
16490
|
}
|
|
16467
16491
|
}
|
|
16468
16492
|
}
|
|
16469
|
-
catch (
|
|
16493
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
16470
16494
|
finally {
|
|
16471
16495
|
try {
|
|
16472
16496
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
16473
16497
|
}
|
|
16474
|
-
finally { if (
|
|
16498
|
+
finally { if (e_29) throw e_29.error; }
|
|
16475
16499
|
}
|
|
16476
16500
|
return true;
|
|
16477
16501
|
};
|
|
@@ -16685,7 +16709,7 @@
|
|
|
16685
16709
|
* @param options
|
|
16686
16710
|
*/
|
|
16687
16711
|
CrudFormComponent.prototype.focusFirstControl = function () {
|
|
16688
|
-
var
|
|
16712
|
+
var e_30, _e;
|
|
16689
16713
|
var formElement = this.formElement.nativeElement;
|
|
16690
16714
|
var divs = formElement.querySelectorAll('div.crud-form-control');
|
|
16691
16715
|
if (divs) {
|
|
@@ -16720,12 +16744,12 @@
|
|
|
16720
16744
|
}
|
|
16721
16745
|
}
|
|
16722
16746
|
}
|
|
16723
|
-
catch (
|
|
16747
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
16724
16748
|
finally {
|
|
16725
16749
|
try {
|
|
16726
16750
|
if (divs_1_1 && !divs_1_1.done && (_e = divs_1.return)) _e.call(divs_1);
|
|
16727
16751
|
}
|
|
16728
|
-
finally { if (
|
|
16752
|
+
finally { if (e_30) throw e_30.error; }
|
|
16729
16753
|
}
|
|
16730
16754
|
}
|
|
16731
16755
|
};
|
|
@@ -16889,7 +16913,7 @@
|
|
|
16889
16913
|
if (fireEventFinish === void 0) { fireEventFinish = true; }
|
|
16890
16914
|
return __awaiter(this, void 0, void 0, function () {
|
|
16891
16915
|
var tableNode, index, parentPath, data, _e, _f, subControl, toAdd, newRowNode, _b_3, _c_3, _d_1;
|
|
16892
|
-
var
|
|
16916
|
+
var e_31, _g;
|
|
16893
16917
|
return __generator(this, function (_h) {
|
|
16894
16918
|
switch (_h.label) {
|
|
16895
16919
|
case 0:
|
|
@@ -16921,12 +16945,12 @@
|
|
|
16921
16945
|
this.initControlDefaultValue(data, subControl, parentPath);
|
|
16922
16946
|
}
|
|
16923
16947
|
}
|
|
16924
|
-
catch (
|
|
16948
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
16925
16949
|
finally {
|
|
16926
16950
|
try {
|
|
16927
16951
|
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
16928
16952
|
}
|
|
16929
|
-
finally { if (
|
|
16953
|
+
finally { if (e_31) throw e_31.error; }
|
|
16930
16954
|
}
|
|
16931
16955
|
toAdd = true;
|
|
16932
16956
|
if (control.onAdding) {
|
|
@@ -17012,7 +17036,7 @@
|
|
|
17012
17036
|
CrudFormComponent.prototype.handleSavedTableRow = function (data) {
|
|
17013
17037
|
return __awaiter(this, void 0, void 0, function () {
|
|
17014
17038
|
var control, tablePath, eventType, tableNode, index, parentPath, _e, _f, subControl, toAdd, newRowNode, _b_4, _c_4, _d_2;
|
|
17015
|
-
var
|
|
17039
|
+
var e_32, _g;
|
|
17016
17040
|
return __generator(this, function (_h) {
|
|
17017
17041
|
switch (_h.label) {
|
|
17018
17042
|
case 0:
|
|
@@ -17034,12 +17058,12 @@
|
|
|
17034
17058
|
this.initControlModel(data, subControl, parentPath);
|
|
17035
17059
|
}
|
|
17036
17060
|
}
|
|
17037
|
-
catch (
|
|
17061
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
17038
17062
|
finally {
|
|
17039
17063
|
try {
|
|
17040
17064
|
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
17041
17065
|
}
|
|
17042
|
-
finally { if (
|
|
17066
|
+
finally { if (e_32) throw e_32.error; }
|
|
17043
17067
|
}
|
|
17044
17068
|
toAdd = true;
|
|
17045
17069
|
if (control.onAdding) {
|
|
@@ -17474,7 +17498,7 @@
|
|
|
17474
17498
|
}
|
|
17475
17499
|
};
|
|
17476
17500
|
ControlTreeNode.prototype.initChildNodes = function (model, schemas, keysPlus) {
|
|
17477
|
-
var
|
|
17501
|
+
var e_33, _e, e_34, _f;
|
|
17478
17502
|
if (isLiteralObject(model)) {
|
|
17479
17503
|
var allKey = new Set(__spreadArray(__spreadArray([], __read(keysPlus)), __read(Object.keys(model))));
|
|
17480
17504
|
try {
|
|
@@ -17487,12 +17511,12 @@
|
|
|
17487
17511
|
}
|
|
17488
17512
|
}
|
|
17489
17513
|
}
|
|
17490
|
-
catch (
|
|
17514
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
17491
17515
|
finally {
|
|
17492
17516
|
try {
|
|
17493
17517
|
if (allKey_1_1 && !allKey_1_1.done && (_e = allKey_1.return)) _e.call(allKey_1);
|
|
17494
17518
|
}
|
|
17495
|
-
finally { if (
|
|
17519
|
+
finally { if (e_33) throw e_33.error; }
|
|
17496
17520
|
}
|
|
17497
17521
|
// Sau khi đã init xong node cho row thì fire event cho các control trong row
|
|
17498
17522
|
// Thường dùng với mục đích cần disabled, hidden các control của row khi có nhu cầu
|
|
@@ -17524,12 +17548,12 @@
|
|
|
17524
17548
|
i++;
|
|
17525
17549
|
}
|
|
17526
17550
|
}
|
|
17527
|
-
catch (
|
|
17551
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
17528
17552
|
finally {
|
|
17529
17553
|
try {
|
|
17530
17554
|
if (model_3_1 && !model_3_1.done && (_f = model_3.return)) _f.call(model_3);
|
|
17531
17555
|
}
|
|
17532
|
-
finally { if (
|
|
17556
|
+
finally { if (e_34) throw e_34.error; }
|
|
17533
17557
|
}
|
|
17534
17558
|
}
|
|
17535
17559
|
}
|
|
@@ -17675,7 +17699,7 @@
|
|
|
17675
17699
|
return this.findSchemaInTree(this.rootNode, schemaPath.toLowerCase());
|
|
17676
17700
|
};
|
|
17677
17701
|
ControlTreeNode.prototype.findInTree = function (node, modelPath) {
|
|
17678
|
-
var
|
|
17702
|
+
var e_35, _e;
|
|
17679
17703
|
if (node.modelPath != null && node.modelPath.toLowerCase() == modelPath.toLowerCase()) {
|
|
17680
17704
|
return node;
|
|
17681
17705
|
}
|
|
@@ -17690,18 +17714,18 @@
|
|
|
17690
17714
|
}
|
|
17691
17715
|
}
|
|
17692
17716
|
}
|
|
17693
|
-
catch (
|
|
17717
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
17694
17718
|
finally {
|
|
17695
17719
|
try {
|
|
17696
17720
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
17697
17721
|
}
|
|
17698
|
-
finally { if (
|
|
17722
|
+
finally { if (e_35) throw e_35.error; }
|
|
17699
17723
|
}
|
|
17700
17724
|
}
|
|
17701
17725
|
return null;
|
|
17702
17726
|
};
|
|
17703
17727
|
ControlTreeNode.prototype.findSchemaInTree = function (node, schemaPath) {
|
|
17704
|
-
var
|
|
17728
|
+
var e_36, _e;
|
|
17705
17729
|
if (node.schemaPath != null && node.schemaPath.toLowerCase() == schemaPath.toLowerCase()) {
|
|
17706
17730
|
return node;
|
|
17707
17731
|
}
|
|
@@ -17716,12 +17740,12 @@
|
|
|
17716
17740
|
}
|
|
17717
17741
|
}
|
|
17718
17742
|
}
|
|
17719
|
-
catch (
|
|
17743
|
+
catch (e_36_1) { e_36 = { error: e_36_1 }; }
|
|
17720
17744
|
finally {
|
|
17721
17745
|
try {
|
|
17722
17746
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
17723
17747
|
}
|
|
17724
|
-
finally { if (
|
|
17748
|
+
finally { if (e_36) throw e_36.error; }
|
|
17725
17749
|
}
|
|
17726
17750
|
}
|
|
17727
17751
|
return null;
|
|
@@ -18732,6 +18756,7 @@
|
|
|
18732
18756
|
}
|
|
18733
18757
|
if (this.crudForm) {
|
|
18734
18758
|
this.crudForm.switchViewMode(this.__isFormView);
|
|
18759
|
+
this.crudForm.switchFormStateForUserpicker(this._isFormAddNew());
|
|
18735
18760
|
this.crudForm.data = data;
|
|
18736
18761
|
this.crudForm.setIsLoadedDataEdit(true);
|
|
18737
18762
|
}
|
|
@@ -52705,7 +52730,22 @@
|
|
|
52705
52730
|
var _this = this;
|
|
52706
52731
|
this.control._component = this;
|
|
52707
52732
|
var commonFieldPlus = 'maChucVu,lstTenDonVi';
|
|
52708
|
-
this.controlPicker = new EntityPickerControlSchema(Object.assign(Object.assign({}, this.control), { field: 'arrIdNguoiDung', label: 'Người dùng', title: 'Chọn người dùng', baseService: this._userV5Service, required: true, displayField: this.control.getDisplayName ? 'displayName' : this.control.displayField, fieldPlus: this.control.fieldPlus ? this.control.fieldPlus + "," + commonFieldPlus : commonFieldPlus, valueField: this.control.valueField, defaultFilters:
|
|
52733
|
+
this.controlPicker = new EntityPickerControlSchema(Object.assign(Object.assign({}, this.control), { field: 'arrIdNguoiDung', label: 'Người dùng', title: 'Chọn người dùng', baseService: this._userV5Service, required: true, displayField: this.control.getDisplayName ? 'displayName' : this.control.displayField, fieldPlus: this.control.fieldPlus ? this.control.fieldPlus + "," + commonFieldPlus : commonFieldPlus, valueField: this.control.valueField, defaultFilters: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
52734
|
+
var filters;
|
|
52735
|
+
return __generator(this, function (_b) {
|
|
52736
|
+
switch (_b.label) {
|
|
52737
|
+
case 0:
|
|
52738
|
+
filters = [];
|
|
52739
|
+
return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
|
|
52740
|
+
case 1:
|
|
52741
|
+
_b.sent();
|
|
52742
|
+
if (this.control.formState == exports.FormState.ADD) {
|
|
52743
|
+
filters.push(this.newFilter('lockoutEnabled', exports.Operator.equal, false));
|
|
52744
|
+
}
|
|
52745
|
+
return [2 /*return*/, filters];
|
|
52746
|
+
}
|
|
52747
|
+
});
|
|
52748
|
+
}); }, multiple: this.control.multiple, funcGetLabel: function (item) {
|
|
52709
52749
|
var _a;
|
|
52710
52750
|
if (_this.control.funcGetLabel)
|
|
52711
52751
|
return _this.control.funcGetLabel(item);
|
|
@@ -52948,6 +52988,9 @@
|
|
|
52948
52988
|
return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
|
|
52949
52989
|
case 1:
|
|
52950
52990
|
_b.sent();
|
|
52991
|
+
if (this.control.formState == exports.FormState.ADD) {
|
|
52992
|
+
filters.push(this.newFilter('lockoutEnabled', exports.Operator.equal, false));
|
|
52993
|
+
}
|
|
52951
52994
|
if (keyWord && keyWord.length > 0) {
|
|
52952
52995
|
filters.push(this.getFilterOnSearch(keyWord));
|
|
52953
52996
|
}
|