intelliwaketssveltekitv25 0.1.56 → 0.1.58
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/dist/Definitions.d.ts
CHANGED
|
@@ -93,6 +93,11 @@ export type TListGroupItem = {
|
|
|
93
93
|
bigIcon?: boolean;
|
|
94
94
|
itemClass?: string;
|
|
95
95
|
};
|
|
96
|
+
export type TMasterDetailListGroupItem = Omit<TListGroupItem, 'subs'> & {
|
|
97
|
+
subs?: TMasterDetailListGroupItem[];
|
|
98
|
+
roundedDetailFormatted?: boolean;
|
|
99
|
+
detailShowHeader?: boolean;
|
|
100
|
+
};
|
|
96
101
|
export declare const MasterDetailSubItemBuild: (item: TListGroupItem, items: TListGroupItem[], collapsedValues: (string | null | undefined)[], options?: {
|
|
97
102
|
start_date?: string | null;
|
|
98
103
|
end_date?: string | null;
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
import { quintOut } from 'svelte/easing'
|
|
5
5
|
import { fly } from 'svelte/transition'
|
|
6
6
|
import { browser } from '$app/environment'
|
|
7
|
-
import type {
|
|
8
|
-
import type
|
|
7
|
+
import type { TMasterDetailListGroupItem } from './Definitions'
|
|
8
|
+
import { type TFindIsActive, ToPascalCase } from '@solidbasisventures/intelliwaketsfoundation'
|
|
9
9
|
import { PathAnalyzer } from './PathAnalyzer'
|
|
10
10
|
import type { Snippet } from 'svelte'
|
|
11
|
+
import { Icon } from './index'
|
|
11
12
|
|
|
12
13
|
let {
|
|
13
14
|
pageRoute,
|
|
@@ -24,6 +25,9 @@
|
|
|
24
25
|
ellipses = false,
|
|
25
26
|
noLinkReplace = false,
|
|
26
27
|
rounded = false,
|
|
28
|
+
roundedDetailFormatted = true,
|
|
29
|
+
detailShowHeader = false,
|
|
30
|
+
showDetailOnNoSelection = true,
|
|
27
31
|
showAllPrint = false,
|
|
28
32
|
smallScreenWidth = 767, // 1024
|
|
29
33
|
empty: emptySlot = undefined,
|
|
@@ -33,7 +37,7 @@
|
|
|
33
37
|
detail
|
|
34
38
|
}: {
|
|
35
39
|
pageRoute: string
|
|
36
|
-
listItems?:
|
|
40
|
+
listItems?: TMasterDetailListGroupItem[] | null
|
|
37
41
|
emptyListMessage?: string | null
|
|
38
42
|
masterXVisible?: boolean
|
|
39
43
|
active?: TFindIsActive
|
|
@@ -46,6 +50,9 @@
|
|
|
46
50
|
ellipses?: boolean
|
|
47
51
|
noLinkReplace?: boolean
|
|
48
52
|
rounded?: boolean
|
|
53
|
+
roundedDetailFormatted?: boolean
|
|
54
|
+
detailShowHeader?: boolean
|
|
55
|
+
showDetailOnNoSelection?: boolean
|
|
49
56
|
showAllPrint?: boolean
|
|
50
57
|
smallScreenWidth?: number
|
|
51
58
|
empty?: Snippet
|
|
@@ -57,6 +64,17 @@
|
|
|
57
64
|
|
|
58
65
|
let pathAnalyzer = $derived(browser ? new PathAnalyzer(page, pageRoute) : null)
|
|
59
66
|
|
|
67
|
+
function pathFromItem(modalItem: TMasterDetailListGroupItem): string {
|
|
68
|
+
return modalItem.href ??
|
|
69
|
+
(ToPascalCase((modalItem.title ?? '').toString()) + (modalItem.value ? `:${modalItem.value}` : ''))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let openItem = $derived((listItems ?? []).find(listItem => !!pathAnalyzer?.isOpen(pathFromItem(listItem))))
|
|
73
|
+
|
|
74
|
+
let showRoundedDetailFormatted = $derived(rounded && (openItem?.roundedDetailFormatted ?? roundedDetailFormatted))
|
|
75
|
+
|
|
76
|
+
let showDetailShowHeader = $derived(!!openItem && (openItem?.detailShowHeader ?? detailShowHeader))
|
|
77
|
+
|
|
60
78
|
let innerWidth = $state<number | undefined>(undefined)
|
|
61
79
|
|
|
62
80
|
type TScreenSize = 'small' | 'medium' | 'large'
|
|
@@ -69,9 +87,10 @@
|
|
|
69
87
|
<svelte:window bind:innerWidth={innerWidth} />
|
|
70
88
|
|
|
71
89
|
{#if pathAnalyzer && innerWidth}
|
|
72
|
-
<div
|
|
73
|
-
|
|
74
|
-
|
|
90
|
+
<div
|
|
91
|
+
class='masterDetail absolute inset-0 print:relative grid grid-cols-1 md:grid-cols-[auto_1fr] print:md:block {mdClass}'
|
|
92
|
+
class:gap-3={rounded}
|
|
93
|
+
class:p-3={rounded}>
|
|
75
94
|
{#if !smallScreen || !pathAnalyzer.activePageSlug}
|
|
76
95
|
{#if mdHideMaster && !smallScreen}
|
|
77
96
|
<div class='w-0'></div>
|
|
@@ -127,17 +146,29 @@
|
|
|
127
146
|
{/if}
|
|
128
147
|
{/if}
|
|
129
148
|
|
|
130
|
-
{#if !smallScreen || !!pathAnalyzer.activePageSlug}
|
|
131
|
-
<div
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
149
|
+
{#if (!smallScreen || !!pathAnalyzer.activePageSlug) && (showDetailOnNoSelection || !!openItem)}
|
|
150
|
+
<div class="grid grid-rows-[auto_1fr] overflow-hidden"
|
|
151
|
+
transition:fly|local={!animate ? undefined : {duration: 300, x: 100, opacity: 0, easing: quintOut}}>
|
|
152
|
+
<div>
|
|
153
|
+
{#if showDetailShowHeader}
|
|
154
|
+
<h3 class="text-center">
|
|
155
|
+
{#if !!openItem?.faProps}
|
|
156
|
+
<Icon {...openItem.faProps} fw />
|
|
157
|
+
{/if}
|
|
158
|
+
{openItem?.title ?? ''}
|
|
159
|
+
</h3>
|
|
160
|
+
{/if}
|
|
161
|
+
</div>
|
|
162
|
+
<div
|
|
163
|
+
class='masterDetailMaster relative grid grid-rows-1 md:relative overflow-hidden print:overflow-visible max-md:h-full max-md:w-full {detailClass}'
|
|
164
|
+
class:bg-white={showRoundedDetailFormatted}
|
|
165
|
+
class:dark:bg-slate-700={showRoundedDetailFormatted}
|
|
166
|
+
class:rounded-lg={showRoundedDetailFormatted}
|
|
167
|
+
class:drop-shadow={showRoundedDetailFormatted}>
|
|
168
|
+
{#if detail}
|
|
169
|
+
{@render detail()}
|
|
170
|
+
{/if}
|
|
171
|
+
</div>
|
|
141
172
|
</div>
|
|
142
173
|
{/if}
|
|
143
174
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { TMasterDetailListGroupItem } from './Definitions';
|
|
2
|
+
import { type TFindIsActive } from '@solidbasisventures/intelliwaketsfoundation';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
type $$ComponentProps = {
|
|
5
5
|
pageRoute: string;
|
|
6
|
-
listItems?:
|
|
6
|
+
listItems?: TMasterDetailListGroupItem[] | null;
|
|
7
7
|
emptyListMessage?: string | null;
|
|
8
8
|
masterXVisible?: boolean;
|
|
9
9
|
active?: TFindIsActive;
|
|
@@ -16,6 +16,9 @@ type $$ComponentProps = {
|
|
|
16
16
|
ellipses?: boolean;
|
|
17
17
|
noLinkReplace?: boolean;
|
|
18
18
|
rounded?: boolean;
|
|
19
|
+
roundedDetailFormatted?: boolean;
|
|
20
|
+
detailShowHeader?: boolean;
|
|
21
|
+
showDetailOnNoSelection?: boolean;
|
|
19
22
|
showAllPrint?: boolean;
|
|
20
23
|
smallScreenWidth?: number;
|
|
21
24
|
empty?: Snippet;
|