@marianmeres/stuic 1.50.0 → 1.52.0
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/components/DismissibleMessage/DismissibleMessage.svelte +2 -1
- package/dist/components/DismissibleMessage/DismissibleMessage.svelte.d.ts +1 -0
- package/dist/components/Input/Field.svelte +12 -12
- package/dist/components/Input/FieldSelect.svelte +8 -1
- package/dist/components/Thc/Thc.svelte +7 -4
- package/dist/components/Thc/Thc.svelte.d.ts +2 -1
- package/package.json +1 -1
|
@@ -56,6 +56,7 @@ export let duration = 150;
|
|
|
56
56
|
export let message;
|
|
57
57
|
export let onDismiss = () => message = "";
|
|
58
58
|
export let theme = "primary";
|
|
59
|
+
export let forceAsHtml = false;
|
|
59
60
|
let show = false;
|
|
60
61
|
$:
|
|
61
62
|
if (isTHCNotEmpty(message)) {
|
|
@@ -83,7 +84,7 @@ $:
|
|
|
83
84
|
classContent
|
|
84
85
|
)}
|
|
85
86
|
>
|
|
86
|
-
<Thc thc={message} />
|
|
87
|
+
<Thc thc={message} {forceAsHtml} />
|
|
87
88
|
</div>
|
|
88
89
|
|
|
89
90
|
{#if typeof onDismiss === 'function'}
|
|
@@ -73,12 +73,12 @@ $:
|
|
|
73
73
|
{#if label || $$slots.label}
|
|
74
74
|
<label
|
|
75
75
|
for={id}
|
|
76
|
-
class={twMerge(
|
|
77
|
-
block flex-1
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
class={twMerge(
|
|
77
|
+
'block flex-1',
|
|
78
|
+
required ? "after:content-['*'] after:opacity-30 after:pl-1" : '',
|
|
79
|
+
labelSizePreset[size],
|
|
80
|
+
labelClass
|
|
81
|
+
)}
|
|
82
82
|
class:required
|
|
83
83
|
>
|
|
84
84
|
{#if $$slots.label}
|
|
@@ -91,16 +91,16 @@ $:
|
|
|
91
91
|
<slot name="right_of_label" />
|
|
92
92
|
</div>
|
|
93
93
|
<div
|
|
94
|
-
class={twMerge(
|
|
95
|
-
|
|
94
|
+
class={twMerge(
|
|
95
|
+
`rounded-md border border-gray-300
|
|
96
96
|
bg-gray-100
|
|
97
97
|
focus-within:border-stuic-primary
|
|
98
98
|
focus-within:ring-4
|
|
99
99
|
focus-within:ring-stuic-primary
|
|
100
|
-
focus-within:ring-opacity-20
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
focus-within:ring-opacity-20`,
|
|
101
|
+
wrapClass,
|
|
102
|
+
validation && !validation.valid ? invalidClass : ''
|
|
103
|
+
)}
|
|
104
104
|
class:cursor-not-allowed={disabled}
|
|
105
105
|
class:opacity-50={disabled}
|
|
106
106
|
>
|
|
@@ -65,7 +65,14 @@ $:
|
|
|
65
65
|
<div class={twMerge(`mb-4 ${_class}`)}>
|
|
66
66
|
<div class="flex items-end px-2 mb-1">
|
|
67
67
|
{#if label || $$slots.label}
|
|
68
|
-
<label
|
|
68
|
+
<label
|
|
69
|
+
for={id}
|
|
70
|
+
class={twMerge(
|
|
71
|
+
'block flex-1',
|
|
72
|
+
required ? "after:content-['*'] after:opacity-30 after:pl-1" : '',
|
|
73
|
+
labelSizePreset[size]
|
|
74
|
+
)}
|
|
75
|
+
>
|
|
69
76
|
{#if $$slots.label}
|
|
70
77
|
<slot name="label" />
|
|
71
78
|
{:else}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
export const isTHCNotEmpty = (m) => _is(m) || _is(m?.text) || _is(m?.html) || m?.component;
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<script>export let
|
|
6
|
-
export let
|
|
5
|
+
<script>export let thc;
|
|
6
|
+
export let forceAsHtml = false;
|
|
7
|
+
export let allowCastToStringFallback = true;
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
{#if typeof thc === 'string'}
|
|
@@ -14,7 +15,9 @@ export let thc;
|
|
|
14
15
|
{@html thc.html}
|
|
15
16
|
{:else if thc?.component}
|
|
16
17
|
<svelte:component this={thc.component} {...thc?.props || {}} {...$$restProps || {}} />
|
|
17
|
-
{:else}
|
|
18
|
-
<!-- cast to string as the last resort -->
|
|
18
|
+
{:else if allowCastToStringFallback}
|
|
19
|
+
<!-- cast to string as the last resort (if enabled) -->
|
|
19
20
|
{thc}
|
|
21
|
+
{:else}
|
|
22
|
+
<!-- silence -->
|
|
20
23
|
{/if}
|
|
@@ -14,8 +14,9 @@ export declare const isTHCNotEmpty: (m: any) => any;
|
|
|
14
14
|
declare const __propDef: {
|
|
15
15
|
props: {
|
|
16
16
|
[x: string]: any;
|
|
17
|
-
forceAsHtml?: boolean | undefined;
|
|
18
17
|
thc: THC;
|
|
18
|
+
forceAsHtml?: boolean | undefined;
|
|
19
|
+
allowCastToStringFallback?: boolean | undefined;
|
|
19
20
|
};
|
|
20
21
|
events: {
|
|
21
22
|
[evt: string]: CustomEvent<any>;
|