intelliwaketssveltekitv25 1.0.94 → 1.0.95

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.
@@ -15,6 +15,7 @@
15
15
  emptyListMessage = null,
16
16
  borders = false,
17
17
  subsExist = false,
18
+ useValueInHref = false,
18
19
  topValue = null,
19
20
  active = true,
20
21
  indentLevel = 0,
@@ -27,12 +28,14 @@
27
28
  noLinkReplace = false,
28
29
  rounded = false,
29
30
  caret,
30
- empty
31
+ empty,
32
+ parentSection = null
31
33
  }: {
32
34
  listItems?: TListGroupItem[]
33
35
  emptyListMessage?: string | null
34
36
  borders?: boolean
35
37
  subsExist?: boolean
38
+ useValueInHref?: boolean
36
39
  topValue?: string | null
37
40
  active?: TFindIsActive
38
41
  indentLevel?: number
@@ -46,6 +49,7 @@
46
49
  rounded?: boolean
47
50
  caret?: boolean | 'left' | 'right'
48
51
  empty?: Snippet
52
+ parentSection?: string | null
49
53
  } = $props()
50
54
 
51
55
  let controlElement = $state<HTMLUListElement | null>(null)
@@ -56,7 +60,7 @@
56
60
 
57
61
  function pathFromItem(modalItem: TListGroupItem): string {
58
62
  return modalItem.href ??
59
- (ToPascalCase((titleString(modalItem.title) ?? '').toString()) + (modalItem.value ? `:${modalItem.value}` : ''))
63
+ (ToPascalCase((titleString(modalItem.title) ?? '').toString()) + (useValueInHref && !!modalItem.value ? `:${modalItem.value}` : ''))
60
64
  }
61
65
 
62
66
  type TGroupItemPath = TListGroupItem & {
@@ -87,12 +91,12 @@
87
91
  pathFromItem: pathAnalyzer?.open(pathFromItem(listItem)),
88
92
  isOpen: !!listItem.selected || !!pathAnalyzer?.isOpen(pathFromItem(listItem)),
89
93
  collapsed: !!collapsedValues?.some(val => val === listItem.value),
90
- subs: listItem.subs ?? !useSubsExist ? [] : (listItems ?? [])
91
- .filter(item => (item?.parent_value === listItem?.value) && (active === null || (item?.hidden ?? false) !== active))
94
+ subs: (!useSubsExist || listItem?.value === undefined) ? [] : (listItems ?? [])
95
+ .filter(item => item?.value !== listItem?.value && (item?.parent_value === listItem?.value) && (active === null || (item?.hidden ?? false) !== active))
92
96
  .map<TGroupItemPath>(listItemSub => ({
93
97
  ...listItemSub,
94
98
  pathFromItem: pathAnalyzer?.open(pathFromItem(listItemSub)),
95
- isOpen: !!listItemSub.selected || !pathAnalyzer?.isOpen(pathFromItem(listItemSub)),
99
+ isOpen: !!listItemSub.selected || !!pathAnalyzer?.isOpen(pathFromItem(listItemSub)),
96
100
  collapsed: !!collapsedValues?.some(val => val === listItemSub.value)
97
101
  }))
98
102
  })))
@@ -197,7 +201,7 @@
197
201
  </li>
198
202
  {:else}
199
203
  {#each subItems as listItem, idx (getKey(listItem))}
200
- {@const showSection = listItem?.section && listItem.section !== subItems[idx - 1]?.section}
204
+ {@const showSection = listItem?.section && listItem.section !== subItems[idx - 1]?.section && listItem.section !== parentSection}
201
205
  {#if showSection}
202
206
  <li
203
207
  class='listGroupHeader block w-full z-10 select-none font-bold p-1 cursor-pointer [&_*]:cursor-pointer sticky top-0 bg-primary-lighter text-white'
@@ -393,7 +397,8 @@
393
397
  indentLevel={indentLevel + 1}
394
398
  {rememberKey}
395
399
  {active}
396
- {collapsedValues} />
400
+ {collapsedValues}
401
+ parentSection={listItem.section} />
397
402
  {/if}
398
403
  {/if}
399
404
  {/each}
@@ -8,6 +8,7 @@ type $$ComponentProps = {
8
8
  emptyListMessage?: string | null;
9
9
  borders?: boolean;
10
10
  subsExist?: boolean;
11
+ useValueInHref?: boolean;
11
12
  topValue?: string | null;
12
13
  active?: TFindIsActive;
13
14
  indentLevel?: number;
@@ -21,6 +22,7 @@ type $$ComponentProps = {
21
22
  rounded?: boolean;
22
23
  caret?: boolean | 'left' | 'right';
23
24
  empty?: Snippet;
25
+ parentSection?: string | null;
24
26
  };
25
27
  declare const ListGroupItems: import("svelte").Component<$$ComponentProps, {}, "collapsedValues" | "collapsedSections">;
26
28
  type ListGroupItems = ReturnType<typeof ListGroupItems>;
@@ -17,6 +17,7 @@
17
17
  caret,
18
18
  emptyListMessage = null,
19
19
  active = true,
20
+ useValueInHref = false,
20
21
  mdClass = '',
21
22
  masterClass = '',
22
23
  detailClass = '',
@@ -43,6 +44,7 @@
43
44
  caret?: boolean | 'left' | 'right'
44
45
  emptyListMessage?: string | null
45
46
  active?: TFindIsActive
47
+ useValueInHref?: boolean
46
48
  mdClass?: string
47
49
  masterClass?: string
48
50
  detailClass?: string
@@ -67,7 +69,7 @@
67
69
 
68
70
  function pathFromItem(modalItem: TMasterDetailListGroupItem): string {
69
71
  return modalItem.href ??
70
- (ToPascalCase((modalItem.title ?? '').toString()) + (modalItem.value ? `:${modalItem.value}` : ''))
72
+ (ToPascalCase((modalItem.title ?? '').toString()) + ((useValueInHref && !!modalItem.value) ? `:${modalItem.value}` : ''))
71
73
  }
72
74
 
73
75
  let openItem = $derived((listItems ?? []).find(listItem => !!pathAnalyzer?.isOpen(pathFromItem(listItem))))
@@ -10,6 +10,7 @@ type $$ComponentProps = {
10
10
  caret?: boolean | 'left' | 'right';
11
11
  emptyListMessage?: string | null;
12
12
  active?: TFindIsActive;
13
+ useValueInHref?: boolean;
13
14
  mdClass?: string;
14
15
  masterClass?: string;
15
16
  detailClass?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "exports": {