cats-ui-lib 2.2.4 → 2.2.5
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/fesm2022/cats-ui-lib.mjs +14 -8
- package/fesm2022/cats-ui-lib.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +1 -1
package/fesm2022/cats-ui-lib.mjs
CHANGED
|
@@ -4189,10 +4189,10 @@ class SidebarComponent {
|
|
|
4189
4189
|
return (feature.attributes?.length ?? 0) > 0;
|
|
4190
4190
|
}
|
|
4191
4191
|
ngOnChanges(_changes) {
|
|
4192
|
-
if (_changes['activeItem']
|
|
4192
|
+
if (_changes['activeItem']?.currentValue && this.activeItem) {
|
|
4193
4193
|
this.isActiveItem(this.activeItem.moduleIndex, this.activeItem.featureIndex, this.activeItem.attrIndex);
|
|
4194
|
-
this.setActiveItem(this.activeItem.moduleIndex, this.activeItem.featureIndex ?? -1, this.activeItem.attrIndex ?? -1);
|
|
4195
|
-
this.onFeatureClick(this.activeItem.moduleIndex, this.activeItem.featureIndex ?? -1, this.appMenus[this.activeItem.moduleIndex].features?.[this.activeItem.featureIndex ?? -1] ?? { featuresName: '' });
|
|
4194
|
+
this.setActiveItem(this.activeItem.moduleIndex, this.activeItem.featureIndex ?? -1, this.activeItem.attrIndex ?? -1, false);
|
|
4195
|
+
this.onFeatureClick(this.activeItem.moduleIndex, this.activeItem.featureIndex ?? -1, this.appMenus[this.activeItem.moduleIndex].features?.[this.activeItem.featureIndex ?? -1] ?? { featuresName: '' }, false);
|
|
4196
4196
|
}
|
|
4197
4197
|
}
|
|
4198
4198
|
ngOnInit() {
|
|
@@ -4298,20 +4298,22 @@ class SidebarComponent {
|
|
|
4298
4298
|
isFeatureExpanded(moduleIndex, featureIndex) {
|
|
4299
4299
|
return this.expandedFeatures.has(`${moduleIndex}-${featureIndex}`);
|
|
4300
4300
|
}
|
|
4301
|
-
setActiveItem(moduleIndex, featureIndex, attrIndex) {
|
|
4301
|
+
setActiveItem(moduleIndex, featureIndex, attrIndex, navigate) {
|
|
4302
4302
|
this.openAttributeFeatureIndex = null;
|
|
4303
4303
|
this.activeItem = { moduleIndex, featureIndex, attrIndex };
|
|
4304
4304
|
const selectedModule = this.appMenus[moduleIndex];
|
|
4305
4305
|
const selectedFeature = selectedModule?.features[featureIndex];
|
|
4306
4306
|
const selectedAttribute = selectedFeature?.attributes?.[attrIndex];
|
|
4307
|
-
|
|
4307
|
+
if (navigate) {
|
|
4308
|
+
this.navigateToItem(selectedModule, selectedFeature, selectedAttribute);
|
|
4309
|
+
}
|
|
4308
4310
|
this.activeSidebar.emit({
|
|
4309
4311
|
module: selectedModule,
|
|
4310
4312
|
feature: selectedFeature,
|
|
4311
4313
|
attribute: selectedAttribute,
|
|
4312
4314
|
});
|
|
4313
4315
|
}
|
|
4314
|
-
onFeatureClick(moduleIndex, featureIndex, feature) {
|
|
4316
|
+
onFeatureClick(moduleIndex, featureIndex, feature, navigate) {
|
|
4315
4317
|
const module = this.appMenus[moduleIndex];
|
|
4316
4318
|
if (this.isExpandable(feature)) {
|
|
4317
4319
|
this.toggleFeature(moduleIndex, featureIndex);
|
|
@@ -4322,7 +4324,9 @@ class SidebarComponent {
|
|
|
4322
4324
|
featureIndex,
|
|
4323
4325
|
attrIndex: 0,
|
|
4324
4326
|
};
|
|
4325
|
-
|
|
4327
|
+
if (navigate) {
|
|
4328
|
+
this.navigateToItem(module, feature, attribute);
|
|
4329
|
+
}
|
|
4326
4330
|
this.activeSidebar.emit({ module, feature, attribute });
|
|
4327
4331
|
}
|
|
4328
4332
|
else {
|
|
@@ -4331,7 +4335,9 @@ class SidebarComponent {
|
|
|
4331
4335
|
featureIndex,
|
|
4332
4336
|
attrIndex: -1,
|
|
4333
4337
|
};
|
|
4334
|
-
|
|
4338
|
+
if (navigate) {
|
|
4339
|
+
this.navigateToItem(module, feature);
|
|
4340
|
+
}
|
|
4335
4341
|
this.activeSidebar.emit({ module, feature, attribute: null });
|
|
4336
4342
|
}
|
|
4337
4343
|
}
|