@design.estate/dees-wcctools 3.6.0 → 3.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.
@@ -42620,21 +42620,29 @@ var WccSidebar = class extends (_a3 = DeesElement, _selectedItem_dec = [n5({ att
42620
42620
  }
42621
42621
  groupedItems.get(group).push(entry);
42622
42622
  }
42623
- const result = [];
42623
+ const renderItems = [];
42624
42624
  const ungrouped = groupedItems.get(null) || [];
42625
42625
  for (const entry of ungrouped) {
42626
- result.push(this.renderElementItem(entry, section));
42626
+ renderItems.push({ type: "element", entry, sortKey: entry[0].toLowerCase() });
42627
42627
  }
42628
42628
  for (const [groupName, items] of groupedItems) {
42629
42629
  if (groupName === null) continue;
42630
- result.push(b2`
42631
- <div class="item-group">
42632
- <span class="item-group-legend">${groupName}</span>
42633
- ${items.map((entry) => this.renderElementItem(entry, section))}
42634
- </div>
42635
- `);
42630
+ const firstElementName = items[0]?.[0] || "";
42631
+ renderItems.push({ type: "group", groupName, items, sortKey: firstElementName.toLowerCase() });
42636
42632
  }
42637
- return result;
42633
+ renderItems.sort((a4, b4) => a4.sortKey.localeCompare(b4.sortKey));
42634
+ return renderItems.map((item) => {
42635
+ if (item.type === "element") {
42636
+ return this.renderElementItem(item.entry, section);
42637
+ } else {
42638
+ return b2`
42639
+ <div class="item-group">
42640
+ <span class="item-group-legend">${item.groupName}</span>
42641
+ ${item.items.map((entry) => this.renderElementItem(entry, section))}
42642
+ </div>
42643
+ `;
42644
+ }
42645
+ });
42638
42646
  }
42639
42647
  }
42640
42648
  /**