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.
@@ -114,14 +114,12 @@ class ElementComponent {
114
114
  }
115
115
  start() { }
116
116
  get visible() {
117
- var _a, _b, _c, _d;
118
- const visible = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : true;
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, _c, _d;
123
- const disabled = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : false;
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.getActions(); }
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.getFields(); }
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; }