intelliwaketssveltekitv25 0.1.122 → 0.1.123
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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Writable } from 'svelte/store';
|
|
2
2
|
import { type TDateAny } from '@solidbasisventures/intelliwaketsfoundation';
|
|
3
3
|
import type { IconDefinition } from '@fortawesome/fontawesome-common-types';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
4
5
|
export interface IFAProps {
|
|
5
6
|
icon: IconDefinition;
|
|
6
7
|
size?: 'xs' | 'sm' | 'lg' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x';
|
|
@@ -62,8 +63,8 @@ export interface ISpinItem<T = number> {
|
|
|
62
63
|
classItem?: string | null;
|
|
63
64
|
}
|
|
64
65
|
export type TListGroupItem = {
|
|
65
|
-
title: string;
|
|
66
|
-
sub_title?: string;
|
|
66
|
+
title: string | Snippet;
|
|
67
|
+
sub_title?: string | Snippet;
|
|
67
68
|
hover_title?: string;
|
|
68
69
|
hidden?: boolean;
|
|
69
70
|
faProps?: IFAProps;
|
package/dist/DisplayHTML.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang='ts'>
|
|
2
2
|
import { IncludesHTML, ReplaceLinks, TextToHTML } from '@solidbasisventures/intelliwaketsfoundation'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
3
4
|
|
|
4
5
|
let {
|
|
5
6
|
value,
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
*/
|
|
10
11
|
noLinkReplace = false
|
|
11
12
|
}: {
|
|
12
|
-
value: string | null | undefined
|
|
13
|
+
value: string | null | undefined | Snippet
|
|
13
14
|
anchorClasses?: string
|
|
14
15
|
/**
|
|
15
16
|
* Use the noLinkReplace property to not try to change a URL into an anchor link
|
|
@@ -17,15 +18,23 @@
|
|
|
17
18
|
noLinkReplace?: boolean
|
|
18
19
|
} = $props()
|
|
19
20
|
|
|
20
|
-
let
|
|
21
|
+
let isSnippet = $derived(!!value && typeof value === 'function')
|
|
21
22
|
|
|
22
|
-
let
|
|
23
|
+
let valueLink = $derived(isSnippet ? null : ((noLinkReplace ? (value ?? '') : ReplaceLinks(TextToHTML((value ?? '').toString()), anchorClasses)) ?? '').toString())
|
|
24
|
+
|
|
25
|
+
let isHTML = $derived(!isSnippet && IncludesHTML((valueLink ?? '').toString()))
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
|
-
{#if
|
|
26
|
-
{#if
|
|
27
|
-
{@
|
|
28
|
+
{#if !!value}
|
|
29
|
+
{#if typeof value === 'function'}
|
|
30
|
+
{@render value()}
|
|
28
31
|
{:else}
|
|
29
|
-
{valueLink}
|
|
32
|
+
{#if valueLink}
|
|
33
|
+
{#if isHTML}
|
|
34
|
+
{@html valueLink}
|
|
35
|
+
{:else}
|
|
36
|
+
{valueLink}
|
|
37
|
+
{/if}
|
|
38
|
+
{/if}
|
|
30
39
|
{/if}
|
|
31
40
|
{/if}
|
|
@@ -130,19 +130,20 @@
|
|
|
130
130
|
{:else}
|
|
131
131
|
{#each subItems as listItem, idx (getKey(listItem))}
|
|
132
132
|
{#if listItem?.section && listItem.section !== subItems[idx - 1]?.section}
|
|
133
|
-
<li
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
133
|
+
<li
|
|
134
|
+
class='listGroupHeader block w-full select-none font-bold p-1 cursor-pointer sticky top-0 bg-primary-main text-white'
|
|
135
|
+
class:mt-4={rounded}
|
|
136
|
+
class:overflow-x-hidden={wrapText || ellipses}
|
|
137
|
+
class:whitespace-nowrap={!wrapText}
|
|
138
|
+
class:mt-1={idx > 0}
|
|
139
|
+
class:roundedListGroupItem={rounded}
|
|
140
|
+
class:rounded-lg={rounded}
|
|
141
|
+
class:px-2={rounded}
|
|
142
|
+
title={listItem.hover_title}
|
|
143
|
+
role='menuitem'
|
|
144
|
+
tabindex={-1}
|
|
145
|
+
onkeydown={e => doKeyExecute(e, () => sectionClick(listItem.section ?? ""))}
|
|
146
|
+
onclick={() => sectionClick(listItem?.section ?? "")}>
|
|
146
147
|
<DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
|
|
147
148
|
value={listItem.section} />
|
|
148
149
|
</li>
|
|
@@ -229,7 +230,7 @@
|
|
|
229
230
|
<Icon fw
|
|
230
231
|
scale={!listItem.bigIcon ? 1 : 2}
|
|
231
232
|
{...listItem.faProps}
|
|
232
|
-
class={`mr-2 inline-block ${!listItem.bigIcon ? '' : 'ml-2'} ${listItem.faProps.class ?? ''}`.trim()}/>
|
|
233
|
+
class={`mr-2 inline-block ${!listItem.bigIcon ? '' : 'ml-2'} ${listItem.faProps.class ?? ''}`.trim()} />
|
|
233
234
|
{/if}
|
|
234
235
|
{#if !!listItem.icon}
|
|
235
236
|
<Icon fw
|
|
@@ -241,7 +242,7 @@
|
|
|
241
242
|
<div class='overflow-hidden'
|
|
242
243
|
class:whitespace-nowrap={!wrapText}
|
|
243
244
|
class:text-ellipsis={!wrapText && ellipses}
|
|
244
|
-
title={!ellipses ? undefined : listItem.title}>
|
|
245
|
+
title={!ellipses ? undefined : typeof listItem.title === 'string' ? listItem.title : ''}>
|
|
245
246
|
<DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
|
|
246
247
|
value={listItem.title} />
|
|
247
248
|
{#if listItem.sub_title && !rounded}
|
|
@@ -313,7 +314,7 @@
|
|
|
313
314
|
<div class='overflow-hidden'
|
|
314
315
|
class:whitespace-nowrap={!wrapText}
|
|
315
316
|
class:text-ellipsis={!wrapText && ellipses}
|
|
316
|
-
title={!ellipses ? undefined : listItem.title}>
|
|
317
|
+
title={!ellipses ? undefined : typeof listItem.title === 'string' ? listItem.title : ''}>
|
|
317
318
|
<DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
|
|
318
319
|
value={listItem.title} />
|
|
319
320
|
{#if listItem.sub_title}
|