poe-svelte-ui-lib 1.5.0 → 1.5.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.
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
})
|
|
75
75
|
isDropdownOpen = filteredOptions.length > 0
|
|
76
76
|
|
|
77
|
-
const selectedFromList = options.
|
|
77
|
+
const selectedFromList = options.find((option) => option.name?.toString() === searchValue)
|
|
78
78
|
|
|
79
79
|
if (!selectedFromList) {
|
|
80
80
|
const newOption: ISelectOption<T> = {
|
|
@@ -85,6 +85,9 @@
|
|
|
85
85
|
|
|
86
86
|
value = newOption
|
|
87
87
|
onUpdate?.(newOption)
|
|
88
|
+
} else {
|
|
89
|
+
value = selectedFromList
|
|
90
|
+
onUpdate?.(selectedFromList)
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
}
|
package/dist/Table/Table.svelte
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
{ id: crypto.randomUUID(), name: 'Warning', value: 'warning', color: 'bg-(--yellow-color)' },
|
|
44
44
|
{ id: crypto.randomUUID(), name: 'Info', value: 'info', color: 'bg-(--gray-color)' },
|
|
45
45
|
]
|
|
46
|
-
let logType = $state(['error', '
|
|
46
|
+
let logType = $state(['error', 'warning'])
|
|
47
47
|
|
|
48
48
|
/* Сортировка столбцов */
|
|
49
49
|
const sortRows = (key: string) => {
|
|
@@ -179,10 +179,9 @@
|
|
|
179
179
|
</div>
|
|
180
180
|
|
|
181
181
|
{#each component.properties.header as column, columnIndex (columnIndex)}
|
|
182
|
-
<div class="mr-2
|
|
182
|
+
<div class="mr-2 grid grid-cols-[minmax(5rem,10rem)_1fr_minmax(5rem,10rem)_minmax(10rem,21rem)_6rem_6rem_2rem_2rem] items-end gap-6">
|
|
183
183
|
<UI.Input
|
|
184
184
|
label={{ name: $t('constructor.props.table.columns.key') }}
|
|
185
|
-
wrapperClass="w-170"
|
|
186
185
|
value={column.key}
|
|
187
186
|
help={{ regExp: /^[0-9a-zA-Z_-]{0,16}$/ }}
|
|
188
187
|
onUpdate={(value) => {
|
|
@@ -199,7 +198,6 @@
|
|
|
199
198
|
/>
|
|
200
199
|
<UI.Input
|
|
201
200
|
label={{ name: $t('constructor.props.table.columns.width') }}
|
|
202
|
-
wrapperClass="w-150"
|
|
203
201
|
type="number"
|
|
204
202
|
value={Number(column.width.replace('%', ''))}
|
|
205
203
|
onUpdate={(value) => updateTableHeader(columnIndex, 'width', `${value}%`)}
|
|
@@ -212,14 +210,12 @@
|
|
|
212
210
|
onUpdate={(option) => updateTableHeader(columnIndex, 'align', option.value)}
|
|
213
211
|
/>
|
|
214
212
|
<UI.Switch
|
|
215
|
-
wrapperClass="w-30"
|
|
216
213
|
label={{ name: $t('constructor.props.table.columns.sortable'), class: 'px-0' }}
|
|
217
214
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
218
215
|
value={column.sortable}
|
|
219
216
|
onChange={(value) => updateTableHeader(columnIndex, 'sortable', value)}
|
|
220
217
|
/>
|
|
221
218
|
<UI.Switch
|
|
222
|
-
wrapperClass="w-30"
|
|
223
219
|
label={{ name: $t('constructor.props.copy'), class: 'px-0' }}
|
|
224
220
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
225
221
|
value={column.overflow?.copy}
|
|
@@ -338,6 +334,12 @@
|
|
|
338
334
|
updateProperty('options', options, component, onPropertyChange)
|
|
339
335
|
}}
|
|
340
336
|
/>
|
|
337
|
+
<UI.Switch
|
|
338
|
+
label={{ name: $t('constructor.props.outline') }}
|
|
339
|
+
value={component.properties.outline}
|
|
340
|
+
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
341
|
+
onChange={(value) => updateProperty('outline', value, component, onPropertyChange)}
|
|
342
|
+
/>
|
|
341
343
|
</div>
|
|
342
344
|
<div class="flex w-1/3 flex-col px-2">
|
|
343
345
|
<UI.Select
|
|
@@ -357,19 +359,37 @@
|
|
|
357
359
|
value={component.properties.label.class}
|
|
358
360
|
onUpdate={(value) => updateProperty('label.class', value as string, component, onPropertyChange)}
|
|
359
361
|
/>
|
|
360
|
-
</div>
|
|
361
|
-
|
|
362
|
-
<div class="flex w-1/3 flex-col px-2">
|
|
363
362
|
<UI.Input
|
|
364
363
|
label={{ name: $t('constructor.props.footer') }}
|
|
365
364
|
value={component.properties.footer}
|
|
366
365
|
onUpdate={(value) => updateProperty('footer', value as string, component, onPropertyChange)}
|
|
367
366
|
/>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
370
|
+
<UI.Select
|
|
371
|
+
label={{ name: $t('constructor.props.table.type') }}
|
|
372
|
+
type="buttons"
|
|
373
|
+
options={$optionsStore.TABLE_TYPE_OPTIONS}
|
|
374
|
+
value={$optionsStore.TABLE_TYPE_OPTIONS.find((o) => o.value === component.properties.type)}
|
|
375
|
+
onUpdate={(option) => {
|
|
376
|
+
updateProperty('type', option.value as string, component, onPropertyChange)
|
|
377
|
+
if (option.value === 'logger') updateProperty('stashData', true, component, onPropertyChange)
|
|
378
|
+
}}
|
|
379
|
+
/>
|
|
368
380
|
<UI.Switch
|
|
369
|
-
label={{ name: $t('constructor.props.
|
|
370
|
-
value={component.properties.
|
|
371
|
-
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
372
|
-
onChange={(value) =>
|
|
381
|
+
label={{ name: $t('constructor.props.table.stashData') }}
|
|
382
|
+
value={component.properties.stashData}
|
|
383
|
+
options={[{ id: crypto.randomUUID(), value: 0, class: '', disabled: component.properties.type === 'logger' }]}
|
|
384
|
+
onChange={(value) => {
|
|
385
|
+
updateProperty('stashData', value, component, onPropertyChange)
|
|
386
|
+
}}
|
|
387
|
+
/>
|
|
388
|
+
<UI.Input
|
|
389
|
+
label={{ name: $t('constructor.props.table.buffersize') }}
|
|
390
|
+
type="number"
|
|
391
|
+
value={component.properties.rowsAmmount}
|
|
392
|
+
onUpdate={(value) => updateProperty('rowsAmmount', value as string, component, onPropertyChange)}
|
|
373
393
|
/>
|
|
374
394
|
</div>
|
|
375
395
|
</div>
|
|
@@ -404,10 +424,9 @@
|
|
|
404
424
|
{#each component.properties.header as column, columnIndex (columnIndex)}
|
|
405
425
|
<div class="rounded-2xl border border-(--border-color) p-2">
|
|
406
426
|
<div class="mb-5">
|
|
407
|
-
<div class="mr-2
|
|
427
|
+
<div class="mr-2 grid grid-cols-[minmax(5rem,10rem)_1fr_minmax(5rem,10rem)_minmax(10rem,21rem)_6rem_6rem_2rem_2rem] items-end gap-6">
|
|
408
428
|
<UI.Input
|
|
409
429
|
label={{ name: $t('constructor.props.table.columns.key') }}
|
|
410
|
-
wrapperClass="w-150"
|
|
411
430
|
value={column.key}
|
|
412
431
|
help={{ regExp: /^[0-9a-zA-Z_-]{0,16}$/ }}
|
|
413
432
|
onUpdate={(value) => {
|
|
@@ -424,21 +443,25 @@
|
|
|
424
443
|
/>
|
|
425
444
|
<UI.Input
|
|
426
445
|
label={{ name: $t('constructor.props.table.columns.width'), class: 'px-0' }}
|
|
427
|
-
wrapperClass="w-150"
|
|
428
446
|
type="number"
|
|
429
447
|
value={Number(column.width.replace('%', ''))}
|
|
430
448
|
onUpdate={(value) => updateTableHeader(columnIndex, 'width', `${value}%`)}
|
|
431
449
|
/>
|
|
450
|
+
<UI.Select
|
|
451
|
+
label={{ name: $t('constructor.props.align.content') }}
|
|
452
|
+
type="buttons"
|
|
453
|
+
value={$optionsStore.ALIGN_OPTIONS.find((a) => (a.value as string).includes(column.align))}
|
|
454
|
+
options={$optionsStore.ALIGN_OPTIONS}
|
|
455
|
+
onUpdate={(option) => updateTableHeader(columnIndex, 'align', option.value)}
|
|
456
|
+
/>
|
|
432
457
|
<UI.Switch
|
|
433
458
|
label={{ name: $t('constructor.props.table.columns.sortable'), class: 'px-0' }}
|
|
434
|
-
wrapperClass="w-30"
|
|
435
459
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
436
460
|
value={column.sortable}
|
|
437
461
|
onChange={(value) => updateTableHeader(columnIndex, 'sortable', value)}
|
|
438
462
|
/>
|
|
439
463
|
<UI.Switch
|
|
440
464
|
label={{ name: $t('constructor.props.copy'), class: 'px-0' }}
|
|
441
|
-
wrapperClass="w-30"
|
|
442
465
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
443
466
|
value={column.overflow?.copy}
|
|
444
467
|
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { copy: value, truncated: column.overflow?.truncated })}
|
|
@@ -470,22 +493,14 @@
|
|
|
470
493
|
}}
|
|
471
494
|
/>
|
|
472
495
|
</div>
|
|
473
|
-
<div class="mr-2
|
|
474
|
-
<UI.Select
|
|
475
|
-
label={{ name: $t('constructor.props.align.content') }}
|
|
476
|
-
type="buttons"
|
|
477
|
-
value={$optionsStore.ALIGN_OPTIONS.find((a) => (a.value as string).includes(column.align))}
|
|
478
|
-
options={$optionsStore.ALIGN_OPTIONS}
|
|
479
|
-
onUpdate={(option) => updateTableHeader(columnIndex, 'align', option.value)}
|
|
480
|
-
/>
|
|
496
|
+
<div class="mr-2 grid grid-cols-[5rem_minmax(8rem,16rem)_1fr_minmax(8rem,12rem)_minmax(8rem,12rem)] items-end justify-between gap-6">
|
|
481
497
|
<UI.Switch
|
|
482
|
-
|
|
483
|
-
label={{ name: $t('constructor.props.table.columns.truncated') }}
|
|
498
|
+
label={{ name: $t('constructor.props.table.columns.truncated'), class: 'px-0' }}
|
|
484
499
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
485
500
|
value={column.overflow?.truncated}
|
|
486
501
|
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { truncated: value, copy: column.overflow?.copy })}
|
|
487
502
|
/>
|
|
488
|
-
<div class="relative mt-6 flex w-full gap-2">
|
|
503
|
+
<div class="relative mt-6 flex items-center w-full gap-2">
|
|
489
504
|
<UI.Button
|
|
490
505
|
content={{ name: $t('constructor.props.table.columns.defaultIcon') }}
|
|
491
506
|
onClick={() => (defaultIcon = { isModalOpen: true, columnIndex: columnIndex, column: column })}
|
|
@@ -522,7 +537,6 @@
|
|
|
522
537
|
label={{ name: $t('constructor.props.table.columns.image.width'), class: 'px-0' }}
|
|
523
538
|
type="number"
|
|
524
539
|
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
525
|
-
wrapperClass="w-150"
|
|
526
540
|
value={Number(column.image?.width.replace('rem', '')) ?? 0}
|
|
527
541
|
onUpdate={(value) => {
|
|
528
542
|
updateTableHeader(columnIndex, 'image', {
|
|
@@ -537,7 +551,6 @@
|
|
|
537
551
|
label={{ name: $t('constructor.props.table.columns.image.height'), class: 'px-0' }}
|
|
538
552
|
type="number"
|
|
539
553
|
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
540
|
-
wrapperClass="w-150"
|
|
541
554
|
value={Number(column.image?.height.replace('rem', ''))}
|
|
542
555
|
onUpdate={(value) => {
|
|
543
556
|
updateTableHeader(columnIndex, 'image', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build": "vite build",
|
|
9
9
|
"preview": "vite preview",
|
|
10
10
|
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
11
|
-
"CheckUpdate": "npx npm-check-updates -u && npm install",
|
|
11
|
+
"CheckUpdate": "npx npm-check-updates -u && npm install && npm install prettier@3.6.2",
|
|
12
12
|
"UpdateIconsLib": "tsx src/lib/IconsCatalog/iconsLib.ts"
|
|
13
13
|
},
|
|
14
14
|
"svelte": "./dist/index.js",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
50
50
|
"@types/node": "^24.10.1",
|
|
51
51
|
"publint": "^0.3.15",
|
|
52
|
-
"svelte": "^5.45.
|
|
52
|
+
"svelte": "^5.45.6",
|
|
53
53
|
"svelte-preprocess": "^6.0.3",
|
|
54
|
-
"vite": "^7.2.
|
|
54
|
+
"vite": "^7.2.7",
|
|
55
55
|
"vite-plugin-compression": "^0.5.1"
|
|
56
56
|
}
|
|
57
57
|
}
|