intelliwaketssveltekitv25 0.1.104 → 0.1.106

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.
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
2
4
  let {
3
5
  text,
4
6
  prefix,
@@ -6,25 +8,30 @@
6
8
  class: clazz,
7
9
  hidden,
8
10
  noTruncate,
9
- print
11
+ print,
12
+ children
10
13
  }: {
11
- text: string | null | undefined
14
+ text: string | number | null | undefined
12
15
  prefix?: string | null
13
16
  suffix?: string | null
14
17
  class?: string
15
18
  hidden?: boolean
16
19
  noTruncate?: boolean
17
20
  print?: boolean
21
+ children?: Snippet
18
22
  } = $props()
19
23
  </script>
20
24
 
21
- {#if !hidden && !!text}
25
+ {#if !hidden && (!!text || !!children)}
22
26
  {prefix ?? ''}
23
- <div title={(!noTruncate && !!text) ? text : undefined}
27
+ <div title={(!noTruncate && !!text) ? text?.toString() : undefined}
24
28
  class="w-auto py-0 max-w-full {clazz ?? ''}"
25
29
  class:text-ellipsis={!noTruncate}
26
30
  class:print:text-ellipsis={!noTruncate && !!print}>
27
- {text}
31
+ {text ?? ''}
32
+ {#if children}
33
+ {@render children()}
34
+ {/if}
28
35
  </div>
29
36
  {suffix ?? ''}
30
37
  {/if}
@@ -1,11 +1,13 @@
1
+ import type { Snippet } from 'svelte';
1
2
  type $$ComponentProps = {
2
- text: string | null | undefined;
3
+ text: string | number | null | undefined;
3
4
  prefix?: string | null;
4
5
  suffix?: string | null;
5
6
  class?: string;
6
7
  hidden?: boolean;
7
8
  noTruncate?: boolean;
8
9
  print?: boolean;
10
+ children?: Snippet;
9
11
  };
10
12
  declare const EllipsesTruncate: import("svelte").Component<$$ComponentProps, {}, "">;
11
13
  type EllipsesTruncate = ReturnType<typeof EllipsesTruncate>;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { ModalPrompt } from './ModalPromptDefinition'
3
- import { Modal, Icon } from './index'
3
+ import { Icon, Modal } from './index'
4
4
 
5
5
  let width = $derived($ModalPrompt?.size === 'sm' ? '20em' : $ModalPrompt?.size === 'lg' ? '30em' : $ModalPrompt?.size === 'xl' ? '35em' : '25em')
6
6
  </script>
@@ -24,12 +24,24 @@
24
24
  <Icon
25
25
  {...$ModalPrompt.titleFAProps ?? $ModalPrompt?.faProps}
26
26
  fw />
27
+ {/if}
28
+ {#if !!$ModalPrompt.title}
29
+ {#if typeof $ModalPrompt.title === 'string'}
30
+ {$ModalPrompt.title ?? ''}
31
+ {:else}
32
+ {@render $ModalPrompt.title()}
27
33
  {/if}
28
- {$ModalPrompt.title ?? ''}
34
+ {/if}
29
35
  </span>
30
36
  {/if}
31
37
  {/snippet}
32
38
  {#snippet body()}
33
- {$ModalPrompt?.messageBody ?? ''}
39
+ {#if !!$ModalPrompt?.messageBody}
40
+ {#if typeof $ModalPrompt.messageBody === 'string'}
41
+ {$ModalPrompt.messageBody ?? ''}
42
+ {:else}
43
+ {@render $ModalPrompt.messageBody()}
44
+ {/if}
45
+ {/if}
34
46
  {/snippet}
35
47
  </Modal>
@@ -1,9 +1,10 @@
1
1
  import type { IFAProps } from './Definitions';
2
+ import type { Snippet } from 'svelte';
2
3
  export type TModalPromptProps<T = unknown> = {
3
4
  size?: 'sm' | 'lg' | 'xl';
4
- title?: string;
5
+ title?: string | Snippet;
5
6
  titleFAProps?: IFAProps;
6
- messageBody?: string;
7
+ messageBody?: string | Snippet;
7
8
  color?: string;
8
9
  okLabel?: string;
9
10
  faProps?: IFAProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.104",
3
+ "version": "0.1.106",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",