tuain-ng-forms-lib 12.0.11 → 12.0.12
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/tuain-ng-forms-lib.umd.js +17 -8
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/element.js +7 -1
- package/esm2015/lib/classes/forms/form.js +3 -3
- package/esm2015/lib/components/elements/layout/element.component.js +5 -7
- package/esm2015/lib/components/forms/basic-form.js +2 -1
- package/fesm2015/tuain-ng-forms-lib.js +13 -8
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/element.d.ts +2 -0
- package/lib/classes/forms/form.d.ts +2 -2
- package/lib/components/elements/layout/element.component.d.ts +1 -1
- package/lib/components/forms/basic-form.d.ts +1 -0
- package/package.json +1 -1
|
@@ -114,14 +114,12 @@ class ElementComponent {
|
|
|
114
114
|
}
|
|
115
115
|
start() { }
|
|
116
116
|
get visible() {
|
|
117
|
-
var _a, _b
|
|
118
|
-
|
|
119
|
-
return visible && ((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.viewOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
|
|
117
|
+
var _a, _b;
|
|
118
|
+
return (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visibleOn((_b = this.formManager) === null || _b === void 0 ? void 0 : _b.currentState);
|
|
120
119
|
}
|
|
121
120
|
get disabled() {
|
|
122
|
-
var _a, _b
|
|
123
|
-
|
|
124
|
-
return disabled || !((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.enabledOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
|
|
121
|
+
var _a, _b;
|
|
122
|
+
return !((_a = this.formElement) === null || _a === void 0 ? void 0 : _a.enabledOn((_b = this.formManager) === null || _b === void 0 ? void 0 : _b.currentState));
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
125
|
ElementComponent.decorators = [
|
|
@@ -283,6 +281,12 @@ class FormElement {
|
|
|
283
281
|
supportMode(state) { return this.viewOnState(state); }
|
|
284
282
|
get visible() { return (this._isForced) ? this._visibleForced : this._visible; }
|
|
285
283
|
set visible(visible) { this.setVisibility(visible); }
|
|
284
|
+
visibleOn(state) {
|
|
285
|
+
return this.visible && this.viewOnState(state);
|
|
286
|
+
}
|
|
287
|
+
enabledOn(state) {
|
|
288
|
+
return !this.disabled && this.enabledOnState(state);
|
|
289
|
+
}
|
|
286
290
|
setVisibility(visible, forced = null) {
|
|
287
291
|
this._visible = visible && true;
|
|
288
292
|
if (forced != null) {
|
|
@@ -1868,7 +1872,7 @@ class FormStructureAndData {
|
|
|
1868
1872
|
? this._sectionsObj[sectionCode] : null;
|
|
1869
1873
|
return (section) ? section.getSubsection(subsectionCode) : null;
|
|
1870
1874
|
}
|
|
1871
|
-
get actions() { return this.
|
|
1875
|
+
get actions() { return this._actionsObj; }
|
|
1872
1876
|
getSection(sectionCode) {
|
|
1873
1877
|
return (this._sectionsObj && this._sectionsObj[sectionCode])
|
|
1874
1878
|
? this._sectionsObj[sectionCode] : null;
|
|
@@ -2000,7 +2004,7 @@ class FormStructureAndData {
|
|
|
2000
2004
|
const actionNames = (Array.isArray(actionArray)) ? actionArray : [actionArray];
|
|
2001
2005
|
actionNames.forEach(actionCode => this.disableAction(actionCode));
|
|
2002
2006
|
}
|
|
2003
|
-
get fields() { return this.
|
|
2007
|
+
get fields() { return this._fieldsObj; }
|
|
2004
2008
|
enableField(fieldCode) {
|
|
2005
2009
|
const fieldObject = this.getFieldObject(fieldCode);
|
|
2006
2010
|
return (fieldObject) ? fieldObject.enable() : null;
|
|
@@ -2403,6 +2407,7 @@ class BasicFormComponent {
|
|
|
2403
2407
|
this.tableGetDataStart = {};
|
|
2404
2408
|
this.tableGetDataFinish = {};
|
|
2405
2409
|
}
|
|
2410
|
+
get form() { return this.formStructure; }
|
|
2406
2411
|
get currentState() { return this.formStructure.state; }
|
|
2407
2412
|
set currentState(state) { this.formStructure.changeState(state); }
|
|
2408
2413
|
get currentMode() { return this.currentState; }
|