@sprucelabs/spruce-role-utils 4.0.2 → 4.0.4

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.
@@ -1,2 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-namespace */
2
+ /* eslint-disable no-redeclare */
3
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
4
  /* eslint-disable import/order */
2
5
  import '@sprucelabs/spruce-event-utils';
@@ -3,13 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
4
4
  const schema_1 = require("@sprucelabs/schema");
5
5
  class RoleSelectCardViewController extends heartwood_view_controllers_1.AbstractViewController {
6
- static id = 'role-select-card';
7
- isLoaded = false;
8
- activeCardVc;
9
- changeHandler;
10
- shouldIgnoreControlChanges = false;
11
6
  constructor(options) {
12
7
  super(options);
8
+ this.isLoaded = false;
9
+ this.shouldIgnoreControlChanges = false;
13
10
  const { onChange } = options;
14
11
  this.changeHandler = onChange;
15
12
  this.activeCardVc = this.RoleListVc(options);
@@ -78,7 +75,8 @@ class RoleSelectCardViewController extends heartwood_view_controllers_1.Abstract
78
75
  await this.handleDidChange();
79
76
  }
80
77
  async handleDidChange() {
81
- await this.changeHandler?.(this.getSelectedRoles());
78
+ var _a;
79
+ await ((_a = this.changeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.getSelectedRoles()));
82
80
  }
83
81
  getIsLoaded() {
84
82
  return this.isLoaded;
@@ -95,7 +93,7 @@ class RoleSelectCardViewController extends heartwood_view_controllers_1.Abstract
95
93
  });
96
94
  await this.activeCardVc.load();
97
95
  this.isLoaded = true;
98
- for (const select of selected ?? []) {
96
+ for (const select of selected !== null && selected !== void 0 ? selected : []) {
99
97
  await this.enableRow(select.roleId, select.requirement);
100
98
  }
101
99
  }
@@ -140,4 +138,5 @@ class RoleSelectCardViewController extends heartwood_view_controllers_1.Abstract
140
138
  return this.activeCardVc.render();
141
139
  }
142
140
  }
141
+ RoleSelectCardViewController.id = 'role-select-card';
143
142
  exports.default = RoleSelectCardViewController;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-role-utils",
3
3
  "description": "Useful role utilities",
4
- "version": "4.0.2",
4
+ "version": "4.0.4",
5
5
  "skill": {
6
6
  "namespace": "role"
7
7
  },