@sprucelabs/spruce-role-utils 3.0.183 → 4.0.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/build/.spruce/schemas/roles/v2022_08_26/selectedRoleWithRequirement.schema.js +10 -5
- package/build/.spruce/schemas/schemas.types.d.ts +105 -100
- package/build/.spruce/schemas/schemas.types.js +1 -2
- package/build/esm/.spruce/schemas/roles/v2022_08_26/selectedRoleWithRequirement.schema.js +10 -5
- package/build/esm/.spruce/schemas/schemas.types.d.ts +105 -100
- package/build/esm/.spruce/schemas/schemas.types.js +1 -2
- package/build/esm/index-module.d.ts +1 -1
- package/build/index-module.d.ts +1 -1
- package/build/selectingRoles/RoleSelectCard.vc.js +17 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as selectedRoleWithRequirementSchema } from
|
|
1
|
+
export { default as selectedRoleWithRequirementSchema } from './.spruce/schemas/roles/v2022_08_26/selectedRoleWithRequirement.schema';
|
|
2
2
|
export { default as RoleSelectCardViewController } from './selectingRoles/RoleSelectCard.vc';
|
|
3
3
|
export * from './selectingRoles/RoleSelectCard.vc';
|
|
4
4
|
export * from './utils.types';
|
package/build/index-module.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as selectedRoleWithRequirementSchema } from
|
|
1
|
+
export { default as selectedRoleWithRequirementSchema } from './.spruce/schemas/roles/v2022_08_26/selectedRoleWithRequirement.schema';
|
|
2
2
|
export { default as RoleSelectCardViewController } from './selectingRoles/RoleSelectCard.vc';
|
|
3
3
|
export * from './selectingRoles/RoleSelectCard.vc';
|
|
4
4
|
export * from './utils.types';
|
|
@@ -3,19 +3,30 @@ 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;
|
|
6
11
|
constructor(options) {
|
|
7
12
|
super(options);
|
|
8
|
-
this.isLoaded = false;
|
|
9
|
-
this.shouldIgnoreControlChanges = false;
|
|
10
13
|
const { onChange } = options;
|
|
11
14
|
this.changeHandler = onChange;
|
|
12
15
|
this.activeCardVc = this.RoleListVc(options);
|
|
13
16
|
}
|
|
14
17
|
RoleListVc(options) {
|
|
15
|
-
return this.Controller('activeRecordCard', (0, heartwood_view_controllers_1.buildActiveRecordCard)(
|
|
18
|
+
return this.Controller('activeRecordCard', (0, heartwood_view_controllers_1.buildActiveRecordCard)({
|
|
19
|
+
id: 'role-select',
|
|
20
|
+
eventName: 'list-roles::v2020_12_25',
|
|
21
|
+
responseKey: 'roles',
|
|
22
|
+
columnWidths: ['content', 'fill'],
|
|
23
|
+
payload: {
|
|
16
24
|
shouldIncludeMetaRoles: false,
|
|
17
25
|
shouldIncludePrivateRoles: true,
|
|
18
|
-
}
|
|
26
|
+
},
|
|
27
|
+
...options,
|
|
28
|
+
rowTransformer: this.renderRow.bind(this),
|
|
29
|
+
}));
|
|
19
30
|
}
|
|
20
31
|
renderRow(role) {
|
|
21
32
|
return {
|
|
@@ -67,8 +78,7 @@ class RoleSelectCardViewController extends heartwood_view_controllers_1.Abstract
|
|
|
67
78
|
await this.handleDidChange();
|
|
68
79
|
}
|
|
69
80
|
async handleDidChange() {
|
|
70
|
-
|
|
71
|
-
await ((_a = this.changeHandler) === null || _a === void 0 ? void 0 : _a.call(this, this.getSelectedRoles()));
|
|
81
|
+
await this.changeHandler?.(this.getSelectedRoles());
|
|
72
82
|
}
|
|
73
83
|
getIsLoaded() {
|
|
74
84
|
return this.isLoaded;
|
|
@@ -85,7 +95,7 @@ class RoleSelectCardViewController extends heartwood_view_controllers_1.Abstract
|
|
|
85
95
|
});
|
|
86
96
|
await this.activeCardVc.load();
|
|
87
97
|
this.isLoaded = true;
|
|
88
|
-
for (const select of selected
|
|
98
|
+
for (const select of selected ?? []) {
|
|
89
99
|
await this.enableRow(select.roleId, select.requirement);
|
|
90
100
|
}
|
|
91
101
|
}
|
|
@@ -130,5 +140,4 @@ class RoleSelectCardViewController extends heartwood_view_controllers_1.Abstract
|
|
|
130
140
|
return this.activeCardVc.render();
|
|
131
141
|
}
|
|
132
142
|
}
|
|
133
|
-
RoleSelectCardViewController.id = 'role-select-card';
|
|
134
143
|
exports.default = RoleSelectCardViewController;
|