poe-svelte-ui-lib 1.4.1 → 1.4.2
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.
|
@@ -129,7 +129,14 @@
|
|
|
129
129
|
)}
|
|
130
130
|
onclick={(e) => selectOption(option, e)}
|
|
131
131
|
{disabled}
|
|
132
|
-
style="background: color-mix(in srgb, var(--bg-color), var(--back-color) 70%);
|
|
132
|
+
style="background: color-mix(in srgb, var(--bg-color), var(--back-color) 70%);
|
|
133
|
+
{option.class?.split(' ').find((cls: string) => cls.startsWith('border-'))
|
|
134
|
+
? `border-width: 1px;
|
|
135
|
+
border-color: var(--${option.class
|
|
136
|
+
?.split(' ')
|
|
137
|
+
.find((cls: string) => cls.startsWith('border-'))
|
|
138
|
+
?.replace('border-', '')}-color)`
|
|
139
|
+
: ''}"
|
|
133
140
|
>
|
|
134
141
|
{option.name}
|
|
135
142
|
</button>
|
|
@@ -197,7 +204,14 @@
|
|
|
197
204
|
)}
|
|
198
205
|
onclick={(e) => selectOption(option, e)}
|
|
199
206
|
{disabled}
|
|
200
|
-
style="background: color-mix(in srgb, var(--bg-color), var(--back-color) 70%);
|
|
207
|
+
style="background: color-mix(in srgb, var(--bg-color), var(--back-color) 70%);
|
|
208
|
+
{option.class?.split(' ').find((cls: string) => cls.startsWith('border-'))
|
|
209
|
+
? `border-width: 1px;
|
|
210
|
+
border-color: var(--${option.class
|
|
211
|
+
?.split(' ')
|
|
212
|
+
.find((cls: string) => cls.startsWith('border-'))
|
|
213
|
+
?.replace('border-', '')}-color)`
|
|
214
|
+
: ''}"
|
|
201
215
|
>
|
|
202
216
|
{option.name}
|
|
203
217
|
</button>
|
|
@@ -412,17 +412,14 @@
|
|
|
412
412
|
updateProperty('options', options, component, onPropertyChange)
|
|
413
413
|
}}
|
|
414
414
|
/>
|
|
415
|
-
<UI.
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
(c.value as string).includes(option.class.split(' ').find((cls: string) => cls.startsWith('bg-'))),
|
|
422
|
-
)}
|
|
423
|
-
onUpdate={(option) => {
|
|
415
|
+
<UI.Input
|
|
416
|
+
label={{ name: $t('constructor.props.optionclass') }}
|
|
417
|
+
wrapperClass="!w-3/10"
|
|
418
|
+
value={option.class}
|
|
419
|
+
type={currentValueType.value}
|
|
420
|
+
onUpdate={(value) => {
|
|
424
421
|
const options = [...(component.properties?.options || [])]
|
|
425
|
-
options[index]['class'] =
|
|
422
|
+
options[index]['class'] = value as string
|
|
426
423
|
updateProperty('options', options, component, onPropertyChange)
|
|
427
424
|
}}
|
|
428
425
|
/>
|
|
@@ -267,6 +267,7 @@
|
|
|
267
267
|
}}
|
|
268
268
|
/>
|
|
269
269
|
</div>
|
|
270
|
+
|
|
270
271
|
<div class="flex w-1/3 flex-col items-center px-2">
|
|
271
272
|
<UI.Select
|
|
272
273
|
wrapperClass="h-14"
|
|
@@ -282,6 +283,7 @@
|
|
|
282
283
|
})
|
|
283
284
|
}}
|
|
284
285
|
/>
|
|
286
|
+
|
|
285
287
|
<UI.Switch
|
|
286
288
|
label={{
|
|
287
289
|
name: $t('constructor.props.widthMode'),
|
|
@@ -291,20 +293,11 @@
|
|
|
291
293
|
value={initialWidth()}
|
|
292
294
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
293
295
|
onChange={(value) => {
|
|
294
|
-
|
|
295
|
-
component.properties
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
updateProperty('items', items, component, onPropertyChange)
|
|
300
|
-
})
|
|
301
|
-
} else {
|
|
302
|
-
component.properties.items.forEach((_item: any, index: number) => {
|
|
303
|
-
const items = [...(component.properties?.items || [])]
|
|
304
|
-
items[index]['class'] = twMerge(items[index].class, 'w-auto')
|
|
305
|
-
updateProperty('items', items, component, onPropertyChange)
|
|
306
|
-
})
|
|
307
|
-
}
|
|
296
|
+
component.properties.items.forEach((_item: any, index: number) => {
|
|
297
|
+
const items = [...(component.properties?.items || [])]
|
|
298
|
+
items[index]['class'] = twMerge(items[index].class, value ? `w-[${(1 / items.length) * 100}%]` : 'w-auto')
|
|
299
|
+
updateProperty('items', items, component, onPropertyChange)
|
|
300
|
+
})
|
|
308
301
|
}}
|
|
309
302
|
/>
|
|
310
303
|
</div>
|
|
@@ -115,7 +115,7 @@ const translations = {
|
|
|
115
115
|
'constructor.props.min': 'Минимальное значение',
|
|
116
116
|
'constructor.props.max': 'Максимальное значение',
|
|
117
117
|
'constructor.props.units': 'Единица измерения',
|
|
118
|
-
'constructor.props.optionclass': 'Стили
|
|
118
|
+
'constructor.props.optionclass': 'Стили опции',
|
|
119
119
|
'constructor.props.optionvalue': 'Значение',
|
|
120
120
|
'constructor.props.optionposition': 'Позиция',
|
|
121
121
|
'constructor.props.optionname': 'Текст',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@tailwindcss/vite": "^4.1.17",
|
|
36
|
-
"prettier": "^3.
|
|
36
|
+
"prettier": "^3.7.3",
|
|
37
37
|
"prettier-plugin-svelte": "^3.4.0",
|
|
38
38
|
"prettier-plugin-tailwindcss": "^0.7.1",
|
|
39
39
|
"svelte-maplibre-gl": "^1.0.2",
|
|
40
40
|
"tailwind-merge": "^3.4.0",
|
|
41
41
|
"tailwindcss": "^4.1.17",
|
|
42
|
-
"tsx": "^4.
|
|
42
|
+
"tsx": "^4.21.0",
|
|
43
43
|
"typescript": "^5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|