poe-svelte-ui-lib 1.0.5 → 1.0.7
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/Accordion.svelte +56 -34
- package/dist/Accordion/AccordionProps.svelte +76 -0
- package/dist/Accordion/AccordionProps.svelte.d.ts +10 -0
- package/dist/Button/Button.svelte +28 -34
- package/dist/Button/ButtonProps.svelte +113 -0
- package/dist/Button/ButtonProps.svelte.d.ts +10 -0
- package/dist/ColorPicker/ColorPicker.svelte +27 -14
- package/dist/ColorPicker/ColorPickerProps.svelte +71 -0
- package/dist/ColorPicker/ColorPickerProps.svelte.d.ts +10 -0
- package/dist/{FileAttach/FileAttach.svelte → FileAttach.svelte} +3 -11
- package/dist/{FileAttach/FileAttach.svelte.d.ts → FileAttach.svelte.d.ts} +1 -1
- package/dist/Graph/Graph.svelte +4 -6
- package/dist/Graph/GraphProps.svelte +41 -0
- package/dist/Graph/GraphProps.svelte.d.ts +10 -0
- package/dist/Input/Input.svelte +42 -48
- package/dist/Input/InputProps.svelte +205 -0
- package/dist/Input/InputProps.svelte.d.ts +10 -0
- package/dist/Modal.svelte +54 -0
- package/dist/Modal.svelte.d.ts +12 -0
- package/dist/ProgressBar/ProgressBar.svelte +23 -21
- package/dist/ProgressBar/ProgressBarProps.svelte +114 -0
- package/dist/ProgressBar/ProgressBarProps.svelte.d.ts +10 -0
- package/dist/Select/Select.svelte +38 -23
- package/dist/Select/SelectProps.svelte +216 -0
- package/dist/Select/SelectProps.svelte.d.ts +10 -0
- package/dist/Slider/Slider.svelte +74 -28
- package/dist/Slider/SliderProps.svelte +113 -0
- package/dist/Slider/SliderProps.svelte.d.ts +10 -0
- package/dist/Switch/Switch.svelte +22 -16
- package/dist/Switch/SwitchProps.svelte +99 -0
- package/dist/Switch/SwitchProps.svelte.d.ts +10 -0
- package/dist/Table/Table.svelte +58 -39
- package/dist/Table/Table.svelte.d.ts +1 -1
- package/dist/Table/TableProps.svelte +233 -0
- package/dist/Table/TableProps.svelte.d.ts +10 -0
- package/dist/TextField/TextField.svelte +18 -14
- package/dist/TextField/TextFieldProps.svelte +92 -0
- package/dist/TextField/TextFieldProps.svelte.d.ts +10 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/libIcons/ButtonAdd.svelte +5 -2
- package/dist/libIcons/ButtonDelete.svelte +1 -1
- package/dist/libIcons/CrossIcon.svelte +9 -0
- package/dist/libIcons/CrossIcon.svelte.d.ts +18 -0
- package/dist/libIcons/IconGripVerticalDual.svelte +12 -0
- package/dist/libIcons/IconGripVerticalDual.svelte.d.ts +18 -0
- package/dist/libIcons/IconGripVerticalLeft.svelte +9 -0
- package/dist/libIcons/IconGripVerticalLeft.svelte.d.ts +18 -0
- package/dist/libIcons/IconGripVerticalRight.svelte +9 -0
- package/dist/libIcons/IconGripVerticalRight.svelte.d.ts +18 -0
- package/dist/locales/i18n.d.ts +9 -0
- package/dist/locales/i18n.js +33 -0
- package/dist/locales/translations.d.ts +7 -0
- package/dist/locales/translations.js +93 -0
- package/dist/options.d.ts +18 -23
- package/dist/options.js +44 -33
- package/dist/types.d.ts +50 -91
- package/dist/types.js +13 -1
- package/package.json +10 -5
- package/dist/Loader.svelte +0 -12
- package/dist/Loader.svelte.d.ts +0 -5
- package/dist/MessageModal.svelte +0 -54
- package/dist/MessageModal.svelte.d.ts +0 -10
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Component, Snippet } from 'svelte';
|
|
2
2
|
import type { Writable } from 'svelte/store';
|
|
3
|
+
export declare const updateProperty: (path: string, value: string | number | boolean | object | string[], component: UIComponent & {
|
|
4
|
+
properties: Partial<UIComponent["properties"]>;
|
|
5
|
+
}, onPropertyChange: (value: string | object) => void) => void;
|
|
3
6
|
export interface UIComponent {
|
|
4
7
|
id: string;
|
|
5
8
|
type: 'Button' | 'Accordion' | 'Input' | 'Select' | 'Switch' | 'ColorPicker' | 'Slider' | 'TextField' | 'ProgressBar' | 'Graph' | 'Table';
|
|
@@ -21,22 +24,15 @@ export interface IUIComponentHandler {
|
|
|
21
24
|
Variables?: string[];
|
|
22
25
|
}
|
|
23
26
|
export interface IButtonProps {
|
|
24
|
-
id?:
|
|
25
|
-
value?: string;
|
|
26
|
-
name?: string;
|
|
27
|
-
};
|
|
27
|
+
id?: string;
|
|
28
28
|
wrapperClass?: string;
|
|
29
|
-
label?: {
|
|
30
|
-
name?: string;
|
|
31
|
-
class?: string;
|
|
32
|
-
};
|
|
33
29
|
componentClass?: string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
content?: {
|
|
32
|
+
name?: string;
|
|
33
|
+
info?: string;
|
|
34
|
+
icon?: ConstructorOfATypedSvelteComponent | null;
|
|
38
35
|
};
|
|
39
|
-
info?: string;
|
|
40
36
|
keyBind?: {
|
|
41
37
|
key?: string;
|
|
42
38
|
ctrlKey?: boolean;
|
|
@@ -44,77 +40,67 @@ export interface IButtonProps {
|
|
|
44
40
|
altKey?: boolean;
|
|
45
41
|
metaKey?: boolean;
|
|
46
42
|
};
|
|
47
|
-
disabled?: boolean;
|
|
48
43
|
eventHandler?: IUIComponentHandler;
|
|
49
44
|
onClick?: () => void;
|
|
50
45
|
}
|
|
51
46
|
export interface IAccordionProps {
|
|
52
|
-
id?:
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
id?: string;
|
|
48
|
+
isOpen: boolean;
|
|
49
|
+
outline?: boolean;
|
|
50
|
+
wrapperClass?: string;
|
|
51
|
+
size?: {
|
|
52
|
+
height?: number;
|
|
53
|
+
width?: number;
|
|
55
54
|
};
|
|
56
55
|
label?: {
|
|
57
56
|
name?: string;
|
|
58
57
|
class?: string;
|
|
58
|
+
icon?: ConstructorOfATypedSvelteComponent | null;
|
|
59
59
|
};
|
|
60
|
-
icon?: {
|
|
61
|
-
component?: ConstructorOfATypedSvelteComponent | null;
|
|
62
|
-
properties?: Record<string, unknown>;
|
|
63
|
-
};
|
|
64
|
-
isOpen: boolean;
|
|
65
|
-
componentClass?: string;
|
|
66
|
-
type?: 'main' | 'sub';
|
|
67
|
-
components?: UIComponent[];
|
|
68
|
-
image?: string;
|
|
69
60
|
children?: Snippet;
|
|
61
|
+
image?: string;
|
|
70
62
|
}
|
|
71
63
|
export interface IInputProps {
|
|
72
|
-
id?:
|
|
73
|
-
|
|
74
|
-
name?: string;
|
|
75
|
-
};
|
|
64
|
+
id?: string;
|
|
65
|
+
type?: 'text' | 'password' | 'number' | 'text-area';
|
|
76
66
|
wrapperClass?: string;
|
|
77
67
|
label?: {
|
|
78
68
|
name?: string;
|
|
79
69
|
class?: string;
|
|
80
70
|
};
|
|
71
|
+
componentClass?: string;
|
|
81
72
|
disabled?: boolean;
|
|
82
73
|
readonly?: boolean;
|
|
83
74
|
value?: string | number;
|
|
84
|
-
type?: 'text' | 'password' | 'number' | 'text-area';
|
|
85
|
-
autocomplete?: 'on' | 'off' | 'given-name' | 'family-name' | 'name' | 'email' | 'username' | 'new-password' | 'current-password' | 'tel' | 'country-name' | 'address-level1' | 'address-level2' | 'street-address' | 'postal-code' | null;
|
|
86
|
-
componentClass?: string;
|
|
87
75
|
maxlength?: number;
|
|
76
|
+
textareaRows?: number;
|
|
77
|
+
placeholder?: string;
|
|
88
78
|
number?: {
|
|
89
79
|
minNum?: number;
|
|
90
80
|
maxNum?: number;
|
|
91
81
|
step?: number;
|
|
92
82
|
};
|
|
93
|
-
textareaRows?: number;
|
|
94
|
-
regExp?: string | RegExp;
|
|
95
83
|
help?: {
|
|
96
|
-
placeholder?: string;
|
|
97
84
|
info?: string;
|
|
85
|
+
copyButton?: boolean;
|
|
86
|
+
regExp?: string | RegExp;
|
|
87
|
+
autocomplete?: 'on' | 'off' | 'given-name' | 'family-name' | 'name' | 'email' | 'username' | 'new-password' | 'current-password' | 'tel' | 'country-name' | 'address-level1' | 'address-level2' | 'street-address' | 'postal-code' | null;
|
|
98
88
|
};
|
|
99
|
-
copyButton?: boolean;
|
|
100
89
|
eventHandler?: IUIComponentHandler;
|
|
101
90
|
onUpdate?: (value: string | number) => void;
|
|
102
91
|
}
|
|
103
92
|
export interface ISelectProps<T = unknown> {
|
|
104
|
-
id?:
|
|
105
|
-
value?: string;
|
|
106
|
-
name?: string;
|
|
107
|
-
};
|
|
93
|
+
id?: string;
|
|
108
94
|
wrapperClass?: string;
|
|
109
95
|
disabled?: boolean;
|
|
110
96
|
label?: {
|
|
111
97
|
name?: string;
|
|
112
98
|
class?: string;
|
|
113
99
|
};
|
|
100
|
+
componentClass?: string;
|
|
114
101
|
type?: 'select' | 'buttons' | 'input';
|
|
115
102
|
value?: ISelectOption<T> | null;
|
|
116
103
|
options?: ISelectOption<T>[];
|
|
117
|
-
placeholder?: string;
|
|
118
104
|
eventHandler?: IUIComponentHandler;
|
|
119
105
|
onUpdate?: (value: ISelectOption<T>) => void;
|
|
120
106
|
}
|
|
@@ -123,35 +109,24 @@ export interface ISelectOption<T = unknown> {
|
|
|
123
109
|
value?: T;
|
|
124
110
|
name?: string;
|
|
125
111
|
class?: string;
|
|
126
|
-
icon?: {
|
|
127
|
-
component?: ConstructorOfATypedSvelteComponent | null;
|
|
128
|
-
properties?: Record<string, unknown>;
|
|
129
|
-
};
|
|
130
112
|
disabled?: boolean;
|
|
131
113
|
}
|
|
132
114
|
export interface ISwitchProps {
|
|
133
|
-
id?:
|
|
134
|
-
|
|
135
|
-
name?: string;
|
|
136
|
-
};
|
|
115
|
+
id?: string;
|
|
116
|
+
height?: string;
|
|
137
117
|
wrapperClass?: string;
|
|
138
118
|
disabled?: boolean;
|
|
139
119
|
label?: {
|
|
140
120
|
name?: string;
|
|
141
121
|
captionLeft?: string;
|
|
142
122
|
captionRight?: string;
|
|
143
|
-
class?: string;
|
|
144
123
|
};
|
|
145
|
-
height?: string;
|
|
146
124
|
value?: number;
|
|
147
125
|
eventHandler?: IUIComponentHandler;
|
|
148
126
|
onChange?: (value: number) => void;
|
|
149
127
|
}
|
|
150
128
|
export interface IColorPickerProps {
|
|
151
|
-
id?:
|
|
152
|
-
name?: string;
|
|
153
|
-
value?: string;
|
|
154
|
-
};
|
|
129
|
+
id?: string;
|
|
155
130
|
wrapperClass?: string;
|
|
156
131
|
label?: {
|
|
157
132
|
name?: string;
|
|
@@ -162,10 +137,7 @@ export interface IColorPickerProps {
|
|
|
162
137
|
onChange?: (value: number[]) => void;
|
|
163
138
|
}
|
|
164
139
|
export interface ISliderProps {
|
|
165
|
-
id?:
|
|
166
|
-
name?: string;
|
|
167
|
-
value?: string;
|
|
168
|
-
};
|
|
140
|
+
id?: string;
|
|
169
141
|
wrapperClass?: string;
|
|
170
142
|
label?: {
|
|
171
143
|
name?: string;
|
|
@@ -183,32 +155,25 @@ export interface ISliderProps {
|
|
|
183
155
|
onUpdate?: (value: number | [number, number]) => void;
|
|
184
156
|
}
|
|
185
157
|
export interface ITextFieldProps {
|
|
186
|
-
id?:
|
|
187
|
-
name?: string;
|
|
188
|
-
value?: string;
|
|
189
|
-
};
|
|
158
|
+
id?: string;
|
|
190
159
|
wrapperClass?: string;
|
|
191
|
-
|
|
160
|
+
background?: boolean;
|
|
161
|
+
content?: {
|
|
192
162
|
name?: string;
|
|
193
163
|
class?: string;
|
|
164
|
+
size?: 'small' | 'base' | 'large' | 'huge' | 'massive';
|
|
194
165
|
};
|
|
195
|
-
type?: 'small' | 'medium' | 'xlarge';
|
|
196
|
-
bold?: boolean;
|
|
197
|
-
italic?: boolean;
|
|
198
166
|
}
|
|
199
167
|
export interface IProgressBarProps {
|
|
200
|
-
id?:
|
|
201
|
-
name?: string;
|
|
202
|
-
value?: string;
|
|
203
|
-
};
|
|
168
|
+
id?: string;
|
|
204
169
|
label?: {
|
|
205
170
|
name?: string;
|
|
206
171
|
class?: string;
|
|
207
172
|
};
|
|
208
|
-
value?:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
173
|
+
value?: number | null;
|
|
174
|
+
number?: {
|
|
175
|
+
minNum?: number;
|
|
176
|
+
maxNum?: number;
|
|
212
177
|
units?: string;
|
|
213
178
|
};
|
|
214
179
|
wrapperClass?: string;
|
|
@@ -216,33 +181,30 @@ export interface IProgressBarProps {
|
|
|
216
181
|
export interface IGraphDataObject {
|
|
217
182
|
name: string;
|
|
218
183
|
value: number;
|
|
219
|
-
|
|
220
|
-
color?: string;
|
|
184
|
+
timestamp?: Date;
|
|
221
185
|
}
|
|
222
186
|
export interface IGraphProps {
|
|
223
|
-
id?:
|
|
224
|
-
value: string;
|
|
225
|
-
name?: string;
|
|
226
|
-
};
|
|
187
|
+
id?: string;
|
|
227
188
|
wrapperClass?: string;
|
|
228
189
|
label?: {
|
|
229
190
|
name?: string;
|
|
230
191
|
class?: string;
|
|
231
192
|
};
|
|
232
193
|
streamingData?: {
|
|
233
|
-
data: IGraphDataObject[] |
|
|
194
|
+
data: IGraphDataObject[] | null;
|
|
234
195
|
timestamp?: number;
|
|
235
196
|
};
|
|
236
197
|
isTest?: boolean;
|
|
237
198
|
}
|
|
238
199
|
export interface ITableHeader<T extends object> {
|
|
239
|
-
|
|
240
|
-
|
|
200
|
+
label?: {
|
|
201
|
+
name?: string;
|
|
202
|
+
class?: string;
|
|
203
|
+
};
|
|
241
204
|
key: keyof T;
|
|
242
|
-
width?: string;
|
|
243
205
|
sortable?: boolean;
|
|
206
|
+
width?: string;
|
|
244
207
|
align?: 'left' | 'center' | 'right';
|
|
245
|
-
cellClass?: string;
|
|
246
208
|
overflow?: {
|
|
247
209
|
truncated?: boolean;
|
|
248
210
|
formatting?: (text: string) => string;
|
|
@@ -265,10 +227,7 @@ export interface ITableHeader<T extends object> {
|
|
|
265
227
|
};
|
|
266
228
|
}
|
|
267
229
|
export interface ITableProps<T extends object> {
|
|
268
|
-
id?:
|
|
269
|
-
value?: string;
|
|
270
|
-
name?: string;
|
|
271
|
-
};
|
|
230
|
+
id?: string;
|
|
272
231
|
wrapperClass?: string;
|
|
273
232
|
label?: {
|
|
274
233
|
name?: string;
|
package/dist/types.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const updateProperty = (path, value, component, onPropertyChange) => {
|
|
2
|
+
const newProperties = JSON.parse(JSON.stringify(component.properties));
|
|
3
|
+
const parts = path.split('.');
|
|
4
|
+
let obj = newProperties;
|
|
5
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
6
|
+
const part = parts[i];
|
|
7
|
+
if (!obj[part])
|
|
8
|
+
obj[part] = {};
|
|
9
|
+
obj = obj[part];
|
|
10
|
+
}
|
|
11
|
+
obj[parts[parts.length - 1]] = value;
|
|
12
|
+
onPropertyChange(newProperties);
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -33,16 +33,21 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
35
35
|
"@tailwindcss/vite": "^4.1.14",
|
|
36
|
+
"prettier": "^3.6.2",
|
|
37
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
38
|
+
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
39
|
+
"tailwind-merge": "^3.3.1",
|
|
36
40
|
"tailwindcss": "^4.1.14",
|
|
37
41
|
"typescript": "^5.9.3"
|
|
38
42
|
},
|
|
39
43
|
"devDependencies": {
|
|
40
|
-
"@sveltejs/kit": "^2.
|
|
44
|
+
"@sveltejs/kit": "^2.46.4",
|
|
41
45
|
"@sveltejs/package": "^2.5.4",
|
|
42
46
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
43
|
-
"publint": "^0.3.
|
|
44
|
-
"svelte": "^5.39.
|
|
47
|
+
"publint": "^0.3.14",
|
|
48
|
+
"svelte": "^5.39.11",
|
|
45
49
|
"svelte-preprocess": "^6.0.3",
|
|
46
|
-
"vite": "^7.1.9"
|
|
50
|
+
"vite": "^7.1.9",
|
|
51
|
+
"vite-plugin-compression": "^0.5.1"
|
|
47
52
|
}
|
|
48
53
|
}
|
package/dist/Loader.svelte
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- $lib/ElementsUI/Loader.svelte -->
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import LoaderRotate from './libIcons/LoaderRotate.svelte'
|
|
4
|
-
|
|
5
|
-
let { show = false } = $props()
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
{#if show}
|
|
9
|
-
<div class="absolute inset-0 z-50 flex items-center justify-center">
|
|
10
|
-
<LoaderRotate />
|
|
11
|
-
</div>
|
|
12
|
-
{/if}
|
package/dist/Loader.svelte.d.ts
DELETED
package/dist/MessageModal.svelte
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!-- $lib/ElementsUI/MessageModal.svelte -->
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import { onMount } from 'svelte'
|
|
4
|
-
import { fly } from 'svelte/transition'
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
message: { id: number; text: string }
|
|
8
|
-
onCLick: (messageId: number) => {}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let { message, onCLick }: Props = $props()
|
|
12
|
-
|
|
13
|
-
const getMessageStyle = (text: string) => {
|
|
14
|
-
if (text.startsWith('ERR: ')) return 'text-red-500'
|
|
15
|
-
if (text.startsWith('OK: ')) return 'text-lime-500'
|
|
16
|
-
if (text.startsWith('WR: ')) return 'text-yellow-500'
|
|
17
|
-
return 'text-gray-400'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const getMessageText = (text: string) => {
|
|
21
|
-
if (text.startsWith('ERR: ')) return text.replace('ERR: ', '')
|
|
22
|
-
if (text.startsWith('OK: ')) return text.replace('OK: ', '')
|
|
23
|
-
if (text.startsWith('WR: ')) return text.replace('WR: ', '')
|
|
24
|
-
return text
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let progress = $state(100)
|
|
28
|
-
onMount(() => {
|
|
29
|
-
const duration = 5000
|
|
30
|
-
const interval = 50
|
|
31
|
-
const step = (interval / duration) * 100
|
|
32
|
-
const timer = setInterval(() => {
|
|
33
|
-
progress -= step
|
|
34
|
-
if (progress <= 0) {
|
|
35
|
-
clearInterval(timer)
|
|
36
|
-
onCLick(message.id)
|
|
37
|
-
}
|
|
38
|
-
}, interval)
|
|
39
|
-
})
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<div
|
|
43
|
-
transition:fly={{ y: 5, duration: 250 }}
|
|
44
|
-
class="my-1 flex flex-col rounded-2xl border border-[var(--border-color)] bg-[var(--back-color)] px-4 py-2 shadow-lg"
|
|
45
|
-
>
|
|
46
|
-
<div class="flex items-center justify-between">
|
|
47
|
-
<p class={`font-semibold ${getMessageStyle(message.text)}`}>{getMessageText(message.text)}</p>
|
|
48
|
-
<button class="ml-2 cursor-pointer text-2xl" onclick={() => onCLick(message.id)}>×</button>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<div class="mt-2 h-2 w-full overflow-hidden rounded bg-gray-200">
|
|
52
|
-
<div class="h-full bg-[var(--green-color)]" style={`width: ${progress}%`}></div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
message: {
|
|
3
|
-
id: number;
|
|
4
|
-
text: string;
|
|
5
|
-
};
|
|
6
|
-
onCLick: (messageId: number) => {};
|
|
7
|
-
}
|
|
8
|
-
declare const MessageModal: import("svelte").Component<Props, {}, "">;
|
|
9
|
-
type MessageModal = ReturnType<typeof MessageModal>;
|
|
10
|
-
export default MessageModal;
|