poe-svelte-ui-lib 1.2.24 → 1.2.26
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/Accordion/AccordionProps.svelte +18 -4
- package/dist/Accordion/AccordionProps.svelte.d.ts +1 -1
- package/dist/Button/ButtonProps.svelte +15 -7
- package/dist/Button/ButtonProps.svelte.d.ts +1 -1
- package/dist/ColorPicker/ColorPickerProps.svelte +17 -9
- package/dist/ColorPicker/ColorPickerProps.svelte.d.ts +1 -1
- package/dist/FileAttach/FileAttach.svelte +4 -10
- package/dist/FileAttach/FileAttachProps.svelte +1 -1
- package/dist/FileAttach/FileAttachProps.svelte.d.ts +1 -1
- package/dist/Graph/GraphProps.svelte +3 -2
- package/dist/Graph/GraphProps.svelte.d.ts +1 -1
- package/dist/Input/InputProps.svelte +11 -4
- package/dist/Input/InputProps.svelte.d.ts +1 -1
- package/dist/Joystick/Joystick.svelte +1 -1
- package/dist/ProgressBar/ProgressBarProps.svelte +1 -1
- package/dist/ProgressBar/ProgressBarProps.svelte.d.ts +1 -1
- package/dist/Select/SelectProps.svelte +27 -25
- package/dist/Select/SelectProps.svelte.d.ts +1 -1
- package/dist/Slider/Slider.svelte +168 -128
- package/dist/Slider/SliderProps.svelte +17 -2
- package/dist/Slider/SliderProps.svelte.d.ts +1 -1
- package/dist/Switch/Switch.svelte +1 -1
- package/dist/Switch/SwitchProps.svelte +26 -8
- package/dist/Switch/SwitchProps.svelte.d.ts +1 -1
- package/dist/Table/Table.svelte +2 -2
- package/dist/Table/TableProps.svelte +33 -7
- package/dist/Table/TableProps.svelte.d.ts +1 -1
- package/dist/Tabs/TabsProps.svelte +1 -1
- package/dist/Tabs/TabsProps.svelte.d.ts +1 -1
- package/dist/TextField/TextFieldProps.svelte +13 -6
- package/dist/TextField/TextFieldProps.svelte.d.ts +1 -1
- package/dist/locales/translations.js +4 -6
- package/dist/types.d.ts +2 -1
- package/dist/types.js +2 -2
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
forConstructor = true,
|
|
18
18
|
} = $props<{
|
|
19
19
|
component: UIComponent & { properties: Partial<ITabsProps> }
|
|
20
|
-
onPropertyChange: (value
|
|
20
|
+
onPropertyChange: (value?: string | object, name?: string, access?: string) => void
|
|
21
21
|
forConstructor?: boolean
|
|
22
22
|
}>()
|
|
23
23
|
|
|
@@ -3,7 +3,7 @@ type $$ComponentProps = {
|
|
|
3
3
|
component: UIComponent & {
|
|
4
4
|
properties: Partial<ITabsProps>;
|
|
5
5
|
};
|
|
6
|
-
onPropertyChange: (value
|
|
6
|
+
onPropertyChange: (value?: string | object, name?: string, access?: string) => void;
|
|
7
7
|
forConstructor?: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare const TabsProps: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
forConstructor = true,
|
|
13
13
|
} = $props<{
|
|
14
14
|
component: UIComponent & { properties: Partial<ITextFieldProps> }
|
|
15
|
-
onPropertyChange: (value
|
|
15
|
+
onPropertyChange: (value?: string | object, name?: string, access?: string) => void
|
|
16
16
|
forConstructor?: boolean
|
|
17
17
|
}>()
|
|
18
18
|
const DeviceVariables = getContext<{ id: string; value: string; name: string }[]>('DeviceVariables')
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
(c.value as string).includes(component.properties.wrapperClass?.split(' ').find((cls: string) => cls.startsWith('text-'))),
|
|
31
31
|
),
|
|
32
32
|
)
|
|
33
|
-
const initialBold = $derived(component.properties.content?.class?.split(' ').
|
|
34
|
-
const initialItalic = $derived(component.properties.content?.class?.split(' ').
|
|
33
|
+
const initialBold = $derived(component.properties.content?.class?.split(' ').some((cls: string) => cls.includes('font-bold')))
|
|
34
|
+
const initialItalic = $derived(component.properties.content?.class?.split(' ').some((cls: string) => cls.startsWith('italic')))
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
{#if forConstructor}
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
options={VARIABLE_OPTIONS}
|
|
43
43
|
value={VARIABLE_OPTIONS.find((opt) => opt.value === component.properties.id)}
|
|
44
44
|
onUpdate={(value) => {
|
|
45
|
-
updateProperty('id', value.value as string, component, onPropertyChange
|
|
45
|
+
updateProperty('id', value.value as string, component, onPropertyChange)
|
|
46
46
|
updateProperty('eventHandler.Variables', value.value as string, component, onPropertyChange)
|
|
47
|
+
onPropertyChange(null, value.name?.split('—')[1].trim(), null)
|
|
47
48
|
}}
|
|
48
49
|
/>
|
|
49
50
|
<UI.Input
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
/>
|
|
78
79
|
</div>
|
|
79
80
|
<div class="flex w-1/3 flex-col px-2">
|
|
81
|
+
<!-- <p>{component.properties.content?.class?.split(' ').includes((cls: string) => cls.startsWith('font-bold'))}</p> -->
|
|
80
82
|
<UI.Switch
|
|
81
83
|
label={{ name: $t('constructor.props.bold') }}
|
|
82
84
|
value={initialBold}
|
|
@@ -84,7 +86,7 @@
|
|
|
84
86
|
onChange={(value) =>
|
|
85
87
|
updateProperty(
|
|
86
88
|
'content.class',
|
|
87
|
-
`${component.properties.content.class} ${value ? 'font-bold' : 'font-normal'}
|
|
89
|
+
twMerge(`${component.properties.content.class} ${value ? 'font-bold' : 'font-normal'}`),
|
|
88
90
|
component,
|
|
89
91
|
onPropertyChange,
|
|
90
92
|
)}
|
|
@@ -94,7 +96,12 @@
|
|
|
94
96
|
value={initialItalic}
|
|
95
97
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
96
98
|
onChange={(value) =>
|
|
97
|
-
updateProperty(
|
|
99
|
+
updateProperty(
|
|
100
|
+
'content.class',
|
|
101
|
+
twMerge(`${component.properties.content.class} ${value ? 'italic' : 'not-italic'}`),
|
|
102
|
+
component,
|
|
103
|
+
onPropertyChange,
|
|
104
|
+
)}
|
|
98
105
|
/>
|
|
99
106
|
<UI.Switch
|
|
100
107
|
label={{ name: $t('constructor.props.background') }}
|
|
@@ -3,7 +3,7 @@ type $$ComponentProps = {
|
|
|
3
3
|
component: UIComponent & {
|
|
4
4
|
properties: Partial<ITextFieldProps>;
|
|
5
5
|
};
|
|
6
|
-
onPropertyChange: (value
|
|
6
|
+
onPropertyChange: (value?: string | object, name?: string, access?: string) => void;
|
|
7
7
|
forConstructor?: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare const TextFieldProps: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -41,7 +41,7 @@ const translations = {
|
|
|
41
41
|
'constructor.props.type.vertical': 'Вертикально',
|
|
42
42
|
'constructor.props.type.checkbox': 'Галочка',
|
|
43
43
|
'constructor.props.type.full': 'Полный',
|
|
44
|
-
'constructor.props.type.viewOnly': '
|
|
44
|
+
'constructor.props.type.viewOnly': 'Просмотр',
|
|
45
45
|
'constructor.props.type.hidden': 'Скрыто',
|
|
46
46
|
/* Общие для редактора свойств */
|
|
47
47
|
'constructor.props.id': 'Идентификатор',
|
|
@@ -67,7 +67,7 @@ const translations = {
|
|
|
67
67
|
'constructor.props.variables.info': 'Поле для ввода имён переменных, разделенных пробелами',
|
|
68
68
|
'constructor.props.value': 'Значение',
|
|
69
69
|
'constructor.props.value.info': 'Поле для ввода Value пакета в формате JSON',
|
|
70
|
-
'constructor.props.align': 'Выравнивание',
|
|
70
|
+
'constructor.props.align': 'Выравнивание надписи',
|
|
71
71
|
'constructor.props.align.header': 'Выравнивание заголовка',
|
|
72
72
|
'constructor.props.align.content': 'Выравнивание контента',
|
|
73
73
|
'constructor.props.image': 'Фоновое изображение',
|
|
@@ -120,13 +120,11 @@ const translations = {
|
|
|
120
120
|
'constructor.props.copy': 'Копирование',
|
|
121
121
|
'constructor.props.size.height': 'Высота сетки',
|
|
122
122
|
'constructor.props.size.width': 'Ширина сетки',
|
|
123
|
-
'constructor.props.range
|
|
124
|
-
'constructor.props.range.end': 'Последний бит',
|
|
125
|
-
'constructor.props.range.start.help': 'Позиция начального бита диапазона ',
|
|
126
|
-
'constructor.props.range.end.help': 'Позиция последнего бита диапазона',
|
|
123
|
+
'constructor.props.range': 'Диапазон позиции битов ',
|
|
127
124
|
'constructor.props.icon.text.position': 'Положение иконки',
|
|
128
125
|
'constructor.props.equal': 'Равные',
|
|
129
126
|
'constructor.props.bitmode': 'Битовый режим',
|
|
127
|
+
'constructor.props.access': 'Доступ (не для владельца)',
|
|
130
128
|
'constructor.props.table.columns': 'Колонки таблицы',
|
|
131
129
|
'constructor.props.table.columns.key': 'Ключ',
|
|
132
130
|
'constructor.props.table.columns.label': 'Название колонки',
|
package/dist/types.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { Writable } from 'svelte/store';
|
|
|
3
3
|
import type { IFileInputProps } from './FileAttach/FileAttach.svelte';
|
|
4
4
|
export declare const updateProperty: (path: string, value: string | number | boolean | object | string[], component: UIComponent & {
|
|
5
5
|
properties: Partial<UIComponent["properties"]>;
|
|
6
|
-
}, onPropertyChange: (value
|
|
6
|
+
}, onPropertyChange: (value?: string | object, name?: string, access?: string) => void) => void;
|
|
7
7
|
export interface UIComponent {
|
|
8
8
|
id: string;
|
|
9
9
|
name?: string;
|
|
10
|
+
access?: 'full' | 'viewOnly' | 'hidden';
|
|
10
11
|
type: 'Button' | 'Accordion' | 'Input' | 'Select' | 'Switch' | 'ColorPicker' | 'Slider' | 'TextField' | 'Joystick' | 'ProgressBar' | 'Graph' | 'Table' | 'Tabs' | 'FileAttach';
|
|
11
12
|
properties: IAccordionProps | IButtonProps | IInputProps | ISelectProps | ISwitchProps | IColorPickerProps | ISliderProps | ITextFieldProps | IProgressBarProps | IGraphProps | ITableProps<object> | ITabsProps | IFileInputProps | IJoystickProps;
|
|
12
13
|
position: Position;
|
package/dist/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const updateProperty = (path, value, component, onPropertyChange
|
|
1
|
+
export const updateProperty = (path, value, component, onPropertyChange) => {
|
|
2
2
|
const newProperties = JSON.parse(JSON.stringify(component.properties));
|
|
3
3
|
const parts = path.split('.');
|
|
4
4
|
let obj = newProperties;
|
|
@@ -9,5 +9,5 @@ export const updateProperty = (path, value, component, onPropertyChange, name) =
|
|
|
9
9
|
obj = obj[part];
|
|
10
10
|
}
|
|
11
11
|
obj[parts[parts.length - 1]] = value;
|
|
12
|
-
onPropertyChange(newProperties
|
|
12
|
+
onPropertyChange(newProperties);
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
49
49
|
"@types/node": "^24.10.1",
|
|
50
50
|
"publint": "^0.3.15",
|
|
51
|
-
"svelte": "^5.43.
|
|
51
|
+
"svelte": "^5.43.12",
|
|
52
52
|
"svelte-preprocess": "^6.0.3",
|
|
53
53
|
"vite": "^7.2.2",
|
|
54
54
|
"vite-plugin-compression": "^0.5.1"
|