intelliwaketssveltekitv25 0.1.123 → 0.1.124

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,7 +1,6 @@
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';
5
4
  export interface IFAProps {
6
5
  icon: IconDefinition;
7
6
  size?: 'xs' | 'sm' | 'lg' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x';
@@ -63,8 +62,8 @@ export interface ISpinItem<T = number> {
63
62
  classItem?: string | null;
64
63
  }
65
64
  export type TListGroupItem = {
66
- title: string | Snippet;
67
- sub_title?: string | Snippet;
65
+ title: string;
66
+ sub_title?: string;
68
67
  hover_title?: string;
69
68
  hidden?: boolean;
70
69
  faProps?: IFAProps;
@@ -42,9 +42,13 @@
42
42
  empty?: Snippet
43
43
  } = $props()
44
44
 
45
+ function titleString(title: string | null | undefined | Snippet): string | null {
46
+ return (typeof title === 'string') ? title : null
47
+ }
48
+
45
49
  function pathFromItem(modalItem: TListGroupItem): string {
46
50
  return modalItem.href ??
47
- (ToPascalCase((modalItem.title ?? '').toString()) + (modalItem.value ? `:${modalItem.value}` : ''))
51
+ (ToPascalCase((titleString(modalItem.title) ?? '').toString()) + (modalItem.value ? `:${modalItem.value}` : ''))
48
52
  }
49
53
 
50
54
  type TGroupItemPath = TListGroupItem & {
@@ -96,7 +100,7 @@
96
100
  }
97
101
 
98
102
  function getKey(listItem: TListGroupItem) {
99
- return listItem.key ?? `${listItem.value ?? 'v'}:${listItem.title ?? listItem.paneName ?? 't'}:${listItem.sub_title ?? 'st'}:${listItem.badgeValue ?? 'bv'}:${listItem.rightText ?? 'rt'}}`
103
+ return listItem.key ?? `${listItem.value ?? 'v'}:${titleString(listItem.title) ?? listItem.paneName ?? 't'}:${titleString(listItem.sub_title) ?? 'st'}:${listItem.badgeValue ?? 'bv'}:${listItem.rightText ?? 'rt'}}`
100
104
  }
101
105
 
102
106
  function sectionClick(section: string) {
@@ -242,10 +246,10 @@
242
246
  <div class='overflow-hidden'
243
247
  class:whitespace-nowrap={!wrapText}
244
248
  class:text-ellipsis={!wrapText && ellipses}
245
- title={!ellipses ? undefined : typeof listItem.title === 'string' ? listItem.title : ''}>
249
+ title={!ellipses ? undefined : titleString(listItem.title) ?? undefined}>
246
250
  <DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
247
251
  value={listItem.title} />
248
- {#if listItem.sub_title && !rounded}
252
+ {#if !!titleString(listItem.sub_title) && !rounded}
249
253
  <div class='text-sm font-thin'>
250
254
  <DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
251
255
  value={listItem.sub_title} />
@@ -279,7 +283,7 @@
279
283
 
280
284
  <!-- row 2 -->
281
285
  <div class:col-span-3={!listItem.bigIcon} class:col-span-2={listItem.bigIcon}>
282
- {#if listItem.sub_title && rounded}
286
+ {#if !!titleString(listItem.sub_title) && rounded}
283
287
  <div class='text-sm font-light text-gray-700 text-justify mt-0.5'>
284
288
  <DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
285
289
  value={listItem.sub_title} />
@@ -314,10 +318,10 @@
314
318
  <div class='overflow-hidden'
315
319
  class:whitespace-nowrap={!wrapText}
316
320
  class:text-ellipsis={!wrapText && ellipses}
317
- title={!ellipses ? undefined : typeof listItem.title === 'string' ? listItem.title : ''}>
321
+ title={!ellipses ? undefined : titleString(listItem.title) ?? undefined}>
318
322
  <DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
319
323
  value={listItem.title} />
320
- {#if listItem.sub_title}
324
+ {#if !!titleString(listItem.sub_title)}
321
325
  <div class='text-sm font-thin'>
322
326
  <DisplayHTML noLinkReplace={listItem.noLinkReplace ?? noLinkReplace}
323
327
  value={listItem.sub_title} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.1.123",
3
+ "version": "0.1.124",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",