poe-svelte-ui-lib 1.3.4 → 1.4.1
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.
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
let {
|
|
7
7
|
id = crypto.randomUUID(),
|
|
8
8
|
isOpen = false,
|
|
9
|
-
outline = false,
|
|
10
9
|
wrapperClass = '',
|
|
11
10
|
size = { width: 1, height: 1 },
|
|
12
11
|
label = { name: '', class: 'text-left', icon: null },
|
|
@@ -20,17 +19,13 @@
|
|
|
20
19
|
<div
|
|
21
20
|
id={`${id}-${crypto.randomUUID().slice(0, 6)}`}
|
|
22
21
|
class={twMerge(
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
`w-full rounded-xl bg-(--container-color) p-0
|
|
23
|
+
shadow-sm transition-shadow duration-250 hover:shadow-md`,
|
|
25
24
|
wrapperClass,
|
|
26
25
|
)}
|
|
27
26
|
transition:slide={{ duration: 250 }}
|
|
28
27
|
>
|
|
29
|
-
<button
|
|
30
|
-
class="flex w-full cursor-pointer items-center justify-between p-4 transition-shadow duration-250
|
|
31
|
-
{outline ? 'border-b border-(--border-color)' : ''}"
|
|
32
|
-
onclick={toggle}
|
|
33
|
-
>
|
|
28
|
+
<button class="flex w-full cursor-pointer items-center justify-between p-4 py-3.5 transition-shadow duration-250" onclick={toggle}>
|
|
34
29
|
<div class="flex w-full items-center">
|
|
35
30
|
<span
|
|
36
31
|
class={`flex h-7 w-7 shrink-0 items-center justify-center overflow-visible [&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full`}
|
|
@@ -45,13 +40,21 @@
|
|
|
45
40
|
{/if}
|
|
46
41
|
</span>
|
|
47
42
|
|
|
48
|
-
<
|
|
49
|
-
class="{twMerge(
|
|
50
|
-
|
|
51
|
-
: ''
|
|
43
|
+
<div
|
|
44
|
+
class="{twMerge(
|
|
45
|
+
'flex w-full justify-start ',
|
|
46
|
+
label.class?.split(' ').find((cls: string) => cls.startsWith('justify-')),
|
|
47
|
+
)} "
|
|
52
48
|
>
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
<span
|
|
50
|
+
class="{twMerge(
|
|
51
|
+
`m-0 origin-top-left cursor-pointer justify-end px-3 font-semibold transition duration-200 ${isOpen ? 'scale-110' : ''}`,
|
|
52
|
+
label.class,
|
|
53
|
+
)} text-lg"
|
|
54
|
+
>
|
|
55
|
+
{label?.name}
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
55
58
|
</div>
|
|
56
59
|
|
|
57
60
|
<div class="w-10 pl-4">
|
|
@@ -76,7 +79,7 @@
|
|
|
76
79
|
|
|
77
80
|
{#if isOpen}
|
|
78
81
|
<div
|
|
79
|
-
class="grid w-full p-4 sm:p-3 {image ? 'gap-x-2' : 'gap-2'}
|
|
82
|
+
class="grid w-full p-4 sm:p-3 {image ? 'gap-x-2' : 'gap-2'} inset-shadow-[0_10px_10px_-15px_rgb(0_0_0_/0.5)]"
|
|
80
83
|
transition:slide={{ duration: 250 }}
|
|
81
84
|
style="grid-template-columns: repeat({size.width || 10}, minmax(0, 1fr));
|
|
82
85
|
grid-template-rows: repeat({size.height || 2}, {image ? 'minmax(6.5rem, auto)' : 'auto'});
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
const initialType = $derived($optionsStore.ACCORDION_TYPE_OPTIONS.find((t) => t.value === component.properties.outline))
|
|
25
25
|
|
|
26
26
|
const initialAlign = $derived(
|
|
27
|
-
$optionsStore.
|
|
28
|
-
(a.value as string).includes(component.properties.label?.class?.split(' ').find((cls: string) => cls.startsWith('
|
|
27
|
+
$optionsStore.JUSTIFY_ALIGN_OPTIONS.find((a) =>
|
|
28
|
+
(a.value as string).includes(component.properties.label?.class?.split(' ').find((cls: string) => cls.startsWith('justify-'))),
|
|
29
29
|
),
|
|
30
30
|
)
|
|
31
31
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
label={{ name: $t('constructor.props.align') }}
|
|
65
65
|
type="buttons"
|
|
66
66
|
value={initialAlign}
|
|
67
|
-
options={$optionsStore.
|
|
67
|
+
options={$optionsStore.JUSTIFY_ALIGN_OPTIONS}
|
|
68
68
|
onUpdate={(option) => updateProperty('label.class', option.value as string, component, onPropertyChange)}
|
|
69
69
|
/>
|
|
70
70
|
</div>
|
|
@@ -106,13 +106,6 @@
|
|
|
106
106
|
/>
|
|
107
107
|
{/if}
|
|
108
108
|
</div>
|
|
109
|
-
<UI.Select
|
|
110
|
-
label={{ name: $t('constructor.props.type') }}
|
|
111
|
-
type="buttons"
|
|
112
|
-
value={initialType}
|
|
113
|
-
options={$optionsStore.ACCORDION_TYPE_OPTIONS}
|
|
114
|
-
onUpdate={(item) => updateProperty('outline', item.value as boolean, component, onPropertyChange)}
|
|
115
|
-
/>
|
|
116
109
|
</div>
|
|
117
110
|
<div class="flex w-1/3 flex-col items-center gap-2 px-2">
|
|
118
111
|
<div class="flex">
|
|
@@ -151,13 +144,6 @@
|
|
|
151
144
|
value={$optionsStore.ACCESS_OPTION.find((o) => o.value === component.access)}
|
|
152
145
|
onUpdate={(option) => onPropertyChange({ access: option.value })}
|
|
153
146
|
/>
|
|
154
|
-
<UI.Select
|
|
155
|
-
label={{ name: $t('constructor.props.type') }}
|
|
156
|
-
type="buttons"
|
|
157
|
-
value={initialType}
|
|
158
|
-
options={$optionsStore.ACCORDION_TYPE_OPTIONS}
|
|
159
|
-
onUpdate={(item) => updateProperty('outline', item.value as boolean, component, onPropertyChange)}
|
|
160
|
-
/>
|
|
161
147
|
<div class="flex w-full gap-4">
|
|
162
148
|
<UI.Input
|
|
163
149
|
label={{ name: $t('constructor.props.size.height') }}
|
package/dist/types.d.ts
CHANGED