@design.estate/dees-catalog 24.6.0 → 24.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-catalog",
3
- "version": "24.6.0",
3
+ "version": "24.6.1",
4
4
  "private": false,
5
5
  "description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
6
6
  "main": "dist_ts_web/index.js",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '24.6.0',
6
+ version: '24.6.1',
7
7
  description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
8
8
  }
@@ -1595,11 +1595,19 @@ export class DeesAppui extends DeesElement {
1595
1595
  if (config.logoText !== undefined) {
1596
1596
  this.mainmenuLogoText = config.logoText;
1597
1597
  }
1598
- if (config.groups !== undefined) {
1598
+ if (config.sections !== undefined) {
1599
+ this.mainmenuGroups = this.buildMainMenuFromSections(config.sections);
1600
+ } else if (config.groups !== undefined) {
1599
1601
  this.mainmenuGroups = [...config.groups];
1600
1602
  }
1601
1603
  if (config.bottomTabs !== undefined) {
1602
1604
  this.mainmenuBottomTabs = [...config.bottomTabs];
1605
+ } else if (config.bottomItems !== undefined) {
1606
+ this.mainmenuBottomTabs = this.buildBottomTabsFromItems(config.bottomItems);
1607
+ }
1608
+ if (config.sections !== undefined || config.groups !== undefined || config.bottomTabs !== undefined || config.bottomItems !== undefined) {
1609
+ const viewId = this.viewRegistry.getCurrentViewId();
1610
+ if (viewId) this.markViewInMainMenu(viewId);
1603
1611
  }
1604
1612
  }
1605
1613
 
@@ -2936,7 +2944,7 @@ export class DeesAppui extends DeesElement {
2936
2944
  // Build main menu from view references or direct config
2937
2945
  if (config.mainMenu) {
2938
2946
  if (config.mainMenu.sections) {
2939
- this.mainmenuGroups = this.buildMainMenuFromSections(config);
2947
+ this.mainmenuGroups = this.buildMainMenuFromSections(config.mainMenu.sections);
2940
2948
  } else if (config.mainMenu.groups) {
2941
2949
  this.mainmenuGroups = config.mainMenu.groups;
2942
2950
  }
@@ -3303,10 +3311,8 @@ export class DeesAppui extends DeesElement {
3303
3311
  }
3304
3312
  }
3305
3313
 
3306
- private buildMainMenuFromSections(config: interfaces.IAppConfig): interfaces.IMenuGroup[] {
3307
- if (!config.mainMenu?.sections) return [];
3308
-
3309
- return config.mainMenu.sections.map((section) => ({
3314
+ private buildMainMenuFromSections(sections: interfaces.IMainMenuSection[]): interfaces.IMenuGroup[] {
3315
+ return sections.map((section) => ({
3310
3316
  name: section.name || '',
3311
3317
  items: section.views
3312
3318
  .map((viewId) => {
@@ -258,6 +258,12 @@ appui.setMainMenuBadge('inbox', 12);
258
258
  appui.clearMainMenuBadge('inbox');
259
259
  ```
260
260
 
261
+ `setMainMenu()` also accepts `sections` and `bottomItems` containing registered view IDs, just as
262
+ `configure()` does. A later call can add or replace these after asynchronous data arrives; it changes
263
+ the sidebar without navigating or recreating the current view. `sections` takes precedence over
264
+ `groups`, and `bottomTabs` over `bottomItems`. An empty array clears that part of the menu; an omitted
265
+ field leaves it unchanged.
266
+
261
267
  A selection made in the sidebar reaches the host as `mainmenu-item-select` with
262
268
  `detail: { item }`. Every row shows `label` when the item carries one and `key`
263
269
  otherwise, so `key` stays the stable identity a badge or a selection is