intelliwaketssveltekitv25 1.0.94 → 1.0.96

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.
@@ -14,6 +14,7 @@ type DropDownProps = {
14
14
  declare const meta: {
15
15
  title: string;
16
16
  component: import("svelte").Component<{
17
+ id?: string;
17
18
  show?: boolean;
18
19
  position?: import("./Definitions").TDropDownControlPosition;
19
20
  ddActions?: import("./Definitions").IDDAction[];
@@ -39,6 +39,7 @@
39
39
  import { DownloadURL } from './Functions'
40
40
 
41
41
  let {
42
+ id,
42
43
  show = $bindable(false),
43
44
  position = null,
44
45
  ddActions = [],
@@ -61,6 +62,7 @@
61
62
  dataColor,
62
63
  clientWidth = $bindable()
63
64
  }: {
65
+ id?: string
64
66
  show?: boolean
65
67
  position?: TDropDownControlPosition
66
68
  ddActions?: IDDAction[]
@@ -282,6 +284,7 @@
282
284
 
283
285
  {#if !!visibleDDActions?.length || !!actions}
284
286
  <DropDownControl bind:show
287
+ {id}
285
288
  {position}
286
289
  {fullBlock}
287
290
  {controlClass}
@@ -1,6 +1,7 @@
1
1
  import { type Snippet } from 'svelte';
2
2
  import type { IDDAction, TDropDownControlPosition } from './Definitions';
3
3
  type $$ComponentProps = {
4
+ id?: string;
4
5
  show?: boolean;
5
6
  position?: TDropDownControlPosition;
6
7
  ddActions?: IDDAction[];
@@ -11,6 +11,7 @@
11
11
  import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler } from 'svelte/elements'
12
12
 
13
13
  let {
14
+ id,
14
15
  show = $bindable(false),
15
16
  onblur,
16
17
  onkeydown,
@@ -41,6 +42,7 @@
41
42
  dataColor,
42
43
  clientWidth = $bindable()
43
44
  }: {
45
+ id?: string
44
46
  show?: boolean
45
47
  onblur?: FocusEventHandler<HTMLDivElement>
46
48
  onkeydown?: KeyboardEventHandler<HTMLDivElement>
@@ -307,6 +309,7 @@
307
309
  {onclick}>
308
310
  <div class={useToggleClass}
309
311
  role="button"
312
+ {id}
310
313
  tabindex={index}
311
314
  bind:this={divToggle}
312
315
  aria-expanded={show}
@@ -2,6 +2,7 @@ import { type Snippet } from 'svelte';
2
2
  import type { TDropDownControlDrop, TDropDownControlPosition } from './Definitions';
3
3
  import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler } from 'svelte/elements';
4
4
  type $$ComponentProps = {
5
+ id?: string;
5
6
  show?: boolean;
6
7
  onblur?: FocusEventHandler<HTMLDivElement>;
7
8
  onkeydown?: KeyboardEventHandler<HTMLDivElement>;
@@ -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.96",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "exports": {