@softwareone/spi-sv5-library 1.5.7 → 1.5.9
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/Avatar/Avatar.svelte +19 -5
- package/dist/Avatar/Avatar.svelte.d.ts +1 -0
- package/dist/Form/FormController/Form.svelte +1 -1
- package/dist/Form/FormController/Form.svelte.d.ts +1 -1
- package/dist/Header/Header.svelte +7 -1
- package/dist/HighlightPanel/HighlightPanel.svelte +1 -1
- package/dist/HighlightPanel/highlightPanelState.svelte.d.ts +12 -2
- package/package.json +1 -1
|
@@ -6,15 +6,29 @@
|
|
|
6
6
|
text: string;
|
|
7
7
|
backgroundColor?: BackgroundColor;
|
|
8
8
|
textColor?: TextColor;
|
|
9
|
+
keepOrder?: boolean;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
let {
|
|
12
|
+
let {
|
|
13
|
+
text,
|
|
14
|
+
backgroundColor = '#25282D',
|
|
15
|
+
textColor = '#FFFFFF',
|
|
16
|
+
keepOrder = false
|
|
17
|
+
}: AvatarProps = $props();
|
|
12
18
|
|
|
13
|
-
const avatarSrc = (
|
|
19
|
+
const avatarSrc = (text: string): string => {
|
|
14
20
|
const defaultValue = 'SO';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
const trimmedText = text.trim();
|
|
22
|
+
|
|
23
|
+
if (!trimmedText) return defaultValue;
|
|
24
|
+
|
|
25
|
+
const [first, second] = trimmedText.split(/\s+/);
|
|
26
|
+
|
|
27
|
+
if (!second) return first[0].toUpperCase();
|
|
28
|
+
|
|
29
|
+
const initials = keepOrder ? `${first[0]}${second[0]}` : `${second[0]}${first[0]}`;
|
|
30
|
+
|
|
31
|
+
return initials.toUpperCase();
|
|
18
32
|
};
|
|
19
33
|
</script>
|
|
20
34
|
|
|
@@ -8,7 +8,7 @@ declare const Form: import("svelte").Component<{
|
|
|
8
8
|
extraData?: Record<string, string | number>;
|
|
9
9
|
onsuccess: (data?: Record<string, unknown>) => void;
|
|
10
10
|
onfailure?: (status: number | undefined, error: unknown) => void;
|
|
11
|
-
children
|
|
11
|
+
children?: Snippet;
|
|
12
12
|
}, {}, "">;
|
|
13
13
|
type Form = ReturnType<typeof Form>;
|
|
14
14
|
export default Form;
|
|
@@ -72,7 +72,13 @@
|
|
|
72
72
|
<Waffle items={waffleItems} bind:showWaffle />
|
|
73
73
|
{/if}
|
|
74
74
|
{#if menuItems}
|
|
75
|
-
<button
|
|
75
|
+
<button
|
|
76
|
+
type="button"
|
|
77
|
+
class={[showMenu && 'active', 'header-button']}
|
|
78
|
+
onclick={toggleMenu}
|
|
79
|
+
aria-label="menu button"
|
|
80
|
+
aria-expanded={showMenu}
|
|
81
|
+
>
|
|
76
82
|
<span class="material-icons icon-span menu-icon">menu</span>
|
|
77
83
|
</button>
|
|
78
84
|
<Menu {menuItems} bind:showMenu />
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
{#if iconType === ImageType.Default}
|
|
45
45
|
<img src={content} alt="icon" />
|
|
46
46
|
{:else if iconType === ImageType.Avatar}
|
|
47
|
-
<Avatar text={content} />
|
|
47
|
+
<Avatar text={content} keepOrder={column.keepOrder} />
|
|
48
48
|
{:else if iconType === ImageType.Material}
|
|
49
49
|
<span class="material-icons">{content}</span>
|
|
50
50
|
{/if}
|
|
@@ -22,12 +22,22 @@ type Link = BaseColumn & {
|
|
|
22
22
|
type: ColumnType.Link;
|
|
23
23
|
url: string;
|
|
24
24
|
};
|
|
25
|
-
type
|
|
25
|
+
type BaseIcon = BaseColumn & {
|
|
26
26
|
type: ColumnType.Image;
|
|
27
|
-
iconType: ImageType;
|
|
28
27
|
content: string;
|
|
29
28
|
alignTextRight?: boolean;
|
|
30
29
|
};
|
|
30
|
+
type AvatarIcon = BaseIcon & {
|
|
31
|
+
iconType: ImageType.Avatar;
|
|
32
|
+
keepOrder?: boolean;
|
|
33
|
+
};
|
|
34
|
+
type ImageIcon = BaseIcon & {
|
|
35
|
+
iconType: ImageType.Default;
|
|
36
|
+
};
|
|
37
|
+
type MaterialIcon = BaseIcon & {
|
|
38
|
+
iconType: ImageType.Material;
|
|
39
|
+
};
|
|
40
|
+
type Icon = AvatarIcon | ImageIcon | MaterialIcon;
|
|
31
41
|
type Status = BaseColumn & {
|
|
32
42
|
type: ColumnType.Status;
|
|
33
43
|
chipType: ChipType;
|