poe-svelte-ui-lib 1.5.1 → 1.5.3
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/Select/Select.svelte +4 -1
- package/dist/Table/Table.svelte +6 -1
- package/dist/Table/TableProps.svelte +22 -20
- package/dist/Tabs/Tabs.svelte +4 -4
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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
|
@@ -311,7 +311,12 @@
|
|
|
311
311
|
</div>
|
|
312
312
|
|
|
313
313
|
{#if body || dataBuffer}
|
|
314
|
-
{@const rows =
|
|
314
|
+
{@const rows =
|
|
315
|
+
type == 'logger'
|
|
316
|
+
? dataBuffer.filter((str) => logType.includes(str.type)).slice(-rowsAmmount)
|
|
317
|
+
: stashData
|
|
318
|
+
? dataBuffer.slice(-rowsAmmount)
|
|
319
|
+
: body}
|
|
315
320
|
<!-- Table Body с прокруткой -->
|
|
316
321
|
<div class="flex-1 overflow-y-auto bg-(--container-color)/50" bind:this={container} onscroll={handleScroll}>
|
|
317
322
|
<div class="grid min-w-0" style={`grid-template-columns: ${header.map((c) => c.width || 'minmax(0, 1fr)').join(' ')};`}>
|
|
@@ -57,14 +57,11 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const updateButtonProperty = (columnIndex: number, buttonIndex: number, field: string, value: any) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
headers[columnIndex].buttons = buttons
|
|
66
|
-
updateProperty('header', headers, component, onPropertyChange)
|
|
67
|
-
}
|
|
60
|
+
const headers = [...component.properties.header]
|
|
61
|
+
const buttons = [...headers[columnIndex].buttons]
|
|
62
|
+
buttons[buttonIndex] = { ...buttons[buttonIndex], [field]: value }
|
|
63
|
+
headers[columnIndex].buttons = buttons
|
|
64
|
+
updateProperty('header', headers, component, onPropertyChange)
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
const removeButtonFromColumn = (columnIndex: number, buttonIndex: number) => {
|
|
@@ -143,12 +140,14 @@
|
|
|
143
140
|
options={$optionsStore.TEXT_ALIGN_OPTIONS}
|
|
144
141
|
onUpdate={(option) => updateProperty('label.class', twMerge(component.properties.label.class, option.value), component, onPropertyChange)}
|
|
145
142
|
/>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
{#if component.properties.stashData}
|
|
144
|
+
<UI.Input
|
|
145
|
+
label={{ name: $t('constructor.props.table.buffersize') }}
|
|
146
|
+
type="number"
|
|
147
|
+
value={component.properties.rowsAmmount}
|
|
148
|
+
onUpdate={(value) => updateProperty('rowsAmmount', value as string, component, onPropertyChange)}
|
|
149
|
+
/>
|
|
150
|
+
{/if}
|
|
152
151
|
</div>
|
|
153
152
|
</div>
|
|
154
153
|
|
|
@@ -385,12 +384,14 @@
|
|
|
385
384
|
updateProperty('stashData', value, component, onPropertyChange)
|
|
386
385
|
}}
|
|
387
386
|
/>
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
{#if component.properties.stashData}
|
|
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)}
|
|
393
|
+
/>
|
|
394
|
+
{/if}
|
|
394
395
|
</div>
|
|
395
396
|
</div>
|
|
396
397
|
|
|
@@ -606,6 +607,7 @@
|
|
|
606
607
|
onUpdate={(value) => {
|
|
607
608
|
const handler = { ...button.eventHandler }
|
|
608
609
|
handler.Variables = (value as string).trim().split(/\s+/)
|
|
610
|
+
console.log(handler)
|
|
609
611
|
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
610
612
|
}}
|
|
611
613
|
/>
|
package/dist/Tabs/Tabs.svelte
CHANGED
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
let currentTabIndex: number = $derived(activeTab)
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
|
-
<div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="w-full rounded-2xl bg-(--back-color)">
|
|
29
|
+
<div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="w-full h-full flex flex-col rounded-2xl bg-(--back-color) overflow-hidden">
|
|
30
30
|
<!-- Вкладки -->
|
|
31
31
|
<div
|
|
32
|
-
class="{twMerge('bg-blue
|
|
32
|
+
class="{twMerge('bg-blue z-50 flex h-fit items-center rounded-t-2xl overflow-x-auto px-1', wrapperClass)}
|
|
33
33
|
bg-(--bg-color)"
|
|
34
34
|
>
|
|
35
35
|
{#each items as item, index}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
<!-- Контент вкладки -->
|
|
74
74
|
<div
|
|
75
|
-
class="grid w-full gap-2 rounded-2xl bg-(--back-color) p-4"
|
|
75
|
+
class="grid flex-1 overflow-y-scroll w-full gap-2 rounded-2xl bg-(--back-color) p-4"
|
|
76
76
|
style="grid-template-columns: repeat({size.width || 1}, minmax(0, 1fr)); grid-template-rows: repeat({size.height || 1}, auto);"
|
|
77
77
|
>
|
|
78
78
|
{#if Components}
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
|
|
90
90
|
<style>
|
|
91
91
|
::-webkit-scrollbar-track {
|
|
92
|
-
background: var(--
|
|
92
|
+
background: var(--red-color);
|
|
93
93
|
}
|
|
94
94
|
::-webkit-scrollbar-thumb {
|
|
95
95
|
background-color: color-mix(in srgb, var(--bg-color), var(--back-color) 20%);
|
package/dist/types.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const updateComponent: (component: UIComponent, updates: Partial<
|
|
|
20
20
|
eventHandler: IUIComponentHandler | undefined;
|
|
21
21
|
id: string;
|
|
22
22
|
type: "Button" | "Accordion" | "Input" | "Select" | "Switch" | "ColorPicker" | "Slider" | "TextField" | "Joystick" | "ProgressBar" | "Graph" | "Table" | "Tabs" | "FileAttach" | "Map";
|
|
23
|
-
position: Position
|
|
23
|
+
position: Required<Position>;
|
|
24
24
|
parentId: string;
|
|
25
25
|
};
|
|
26
26
|
export interface UIComponent {
|
|
@@ -29,7 +29,7 @@ export interface UIComponent {
|
|
|
29
29
|
access?: 'full' | 'viewOnly' | 'hidden';
|
|
30
30
|
type: 'Button' | 'Accordion' | 'Input' | 'Select' | 'Switch' | 'ColorPicker' | 'Slider' | 'TextField' | 'Joystick' | 'ProgressBar' | 'Graph' | 'Table' | 'Tabs' | 'FileAttach' | 'Map';
|
|
31
31
|
properties: IAccordionProps | IButtonProps | IInputProps | ISelectProps | ISwitchProps | IColorPickerProps | ISliderProps | ITextFieldProps | IProgressBarProps | IGraphProps | ITableProps<object> | ITabsProps | IFileAttachProps | IJoystickProps | IMapProps;
|
|
32
|
-
position: Position
|
|
32
|
+
position: Required<Position>;
|
|
33
33
|
parentId: string;
|
|
34
34
|
eventHandler?: IUIComponentHandler;
|
|
35
35
|
}
|