poe-svelte-ui-lib 1.0.6 → 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 +51 -40
- 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 +3 -3
- 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 +17 -10
- package/dist/Slider/SliderProps.svelte +113 -0
- package/dist/Slider/SliderProps.svelte.d.ts +10 -0
- package/dist/Switch/Switch.svelte +15 -10
- package/dist/Switch/SwitchProps.svelte +99 -0
- package/dist/Switch/SwitchProps.svelte.d.ts +10 -0
- package/dist/Table/Table.svelte +62 -38
- 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 +15 -9
- package/dist/TextField/TextFieldProps.svelte +44 -44
- package/dist/TextField/TextFieldProps.svelte.d.ts +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -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/locales/translations.js +81 -6
- package/dist/options.d.ts +7 -12
- package/dist/options.js +44 -33
- package/dist/types.d.ts +50 -89
- package/dist/types.js +13 -1
- package/package.json +7 -3
- 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/options.d.ts
CHANGED
|
@@ -3,19 +3,16 @@ export declare const optionsStore: import("svelte/store").Readable<{
|
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
value: string;
|
|
6
|
-
class: string;
|
|
7
6
|
}[];
|
|
8
7
|
SHORT_ARGUMENT_OPTION: {
|
|
9
8
|
id: string;
|
|
10
9
|
value: string;
|
|
11
10
|
name: string;
|
|
12
|
-
class: string;
|
|
13
11
|
}[];
|
|
14
12
|
FULL_ARGUMENT_OPTION: {
|
|
15
13
|
id: string;
|
|
16
14
|
value: string;
|
|
17
15
|
name: string;
|
|
18
|
-
class: string;
|
|
19
16
|
}[];
|
|
20
17
|
INPUT_TYPE_OPTIONS: {
|
|
21
18
|
id: string;
|
|
@@ -26,30 +23,25 @@ export declare const optionsStore: import("svelte/store").Readable<{
|
|
|
26
23
|
id: string;
|
|
27
24
|
value: string;
|
|
28
25
|
name: string;
|
|
29
|
-
class: string;
|
|
30
26
|
}[];
|
|
31
27
|
SELECT_VALUE_TYPE_OPTIONS: ({
|
|
32
28
|
id: string;
|
|
33
29
|
value: "text";
|
|
34
30
|
name: string;
|
|
35
|
-
class: string;
|
|
36
31
|
} | {
|
|
37
32
|
id: string;
|
|
38
33
|
value: "number";
|
|
39
34
|
name: string;
|
|
40
|
-
class: string;
|
|
41
35
|
})[];
|
|
42
36
|
SLIDER_TYPE_OPTIONS: {
|
|
43
37
|
id: string;
|
|
44
38
|
value: string;
|
|
45
39
|
name: string;
|
|
46
|
-
class: string;
|
|
47
40
|
}[];
|
|
48
41
|
TEXTFIELD_SIZE_OPTIONS: {
|
|
49
42
|
id: string;
|
|
50
43
|
value: string;
|
|
51
44
|
name: string;
|
|
52
|
-
class: string;
|
|
53
45
|
}[];
|
|
54
46
|
COLOR_OPTIONS: {
|
|
55
47
|
id: string;
|
|
@@ -57,22 +49,25 @@ export declare const optionsStore: import("svelte/store").Readable<{
|
|
|
57
49
|
value: string;
|
|
58
50
|
class: string;
|
|
59
51
|
}[];
|
|
52
|
+
TEXT_COLOR_OPTIONS: {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
value: string;
|
|
56
|
+
class: string;
|
|
57
|
+
}[];
|
|
60
58
|
ALIGN_OPTIONS: {
|
|
61
59
|
id: string;
|
|
62
60
|
value: string;
|
|
63
61
|
name: string;
|
|
64
|
-
class: string;
|
|
65
62
|
}[];
|
|
66
63
|
HEIGHT_OPTIONS: {
|
|
67
64
|
id: string;
|
|
68
65
|
value: string;
|
|
69
66
|
name: string;
|
|
70
|
-
class: string;
|
|
71
67
|
}[];
|
|
72
68
|
ACCORDION_TYPE_OPTIONS: {
|
|
73
69
|
id: string;
|
|
74
|
-
value:
|
|
70
|
+
value: boolean;
|
|
75
71
|
name: string;
|
|
76
|
-
class: string;
|
|
77
72
|
}[];
|
|
78
73
|
}>;
|
package/dist/options.js
CHANGED
|
@@ -7,20 +7,20 @@ function id() {
|
|
|
7
7
|
export const optionsStore = derived(t, ($t) => {
|
|
8
8
|
return {
|
|
9
9
|
HEADER_OPTIONS: [
|
|
10
|
-
{ id: id(), name: 'GET', value: 'GET'
|
|
11
|
-
{ id: id(), name: 'SET', value: 'SET'
|
|
12
|
-
{ id: id(), name: 'OK!', value: 'OK!'
|
|
13
|
-
{ id: id(), name: 'ER!', value: 'ER!'
|
|
10
|
+
{ id: id(), name: 'GET', value: 'GET' },
|
|
11
|
+
{ id: id(), name: 'SET', value: 'SET' },
|
|
12
|
+
{ id: id(), name: 'OK!', value: 'OK!' },
|
|
13
|
+
{ id: id(), name: 'ER!', value: 'ER!' },
|
|
14
14
|
],
|
|
15
15
|
SHORT_ARGUMENT_OPTION: [
|
|
16
|
-
{ id: id(), value: 'NoSave', name: $t('constructor.props.action.update')
|
|
17
|
-
{ id: id(), value: 'Save', name: $t('constructor.props.action.save')
|
|
18
|
-
{ id: id(), value: 'NoSend', name: $t('constructor.props.action.nosend')
|
|
16
|
+
{ id: id(), value: 'NoSave', name: $t('constructor.props.action.update') },
|
|
17
|
+
{ id: id(), value: 'Save', name: $t('constructor.props.action.save') },
|
|
18
|
+
{ id: id(), value: 'NoSend', name: $t('constructor.props.action.nosend') },
|
|
19
19
|
],
|
|
20
20
|
FULL_ARGUMENT_OPTION: [
|
|
21
|
-
{ id: id(), value: 'NoSave', name: $t('constructor.props.action.update')
|
|
22
|
-
{ id: id(), value: 'Save', name: $t('constructor.props.action.save')
|
|
23
|
-
{ id: id(), value: '', name: $t('constructor.props.action.custom')
|
|
21
|
+
{ id: id(), value: 'NoSave', name: $t('constructor.props.action.update') },
|
|
22
|
+
{ id: id(), value: 'Save', name: $t('constructor.props.action.save') },
|
|
23
|
+
{ id: id(), value: '', name: $t('constructor.props.action.custom') },
|
|
24
24
|
],
|
|
25
25
|
INPUT_TYPE_OPTIONS: [
|
|
26
26
|
{ id: id(), value: 'text', name: $t('constructor.props.type.text') },
|
|
@@ -29,43 +29,54 @@ export const optionsStore = derived(t, ($t) => {
|
|
|
29
29
|
{ id: id(), value: 'text-area', name: $t('constructor.props.type.textarea') },
|
|
30
30
|
],
|
|
31
31
|
SELECT_TYPE_OPTIONS: [
|
|
32
|
-
{ id: id(), value: 'select', name: $t('constructor.props.type.select')
|
|
33
|
-
{ id: id(), value: 'buttons', name: $t('constructor.props.type.buttons')
|
|
32
|
+
{ id: id(), value: 'select', name: $t('constructor.props.type.select') },
|
|
33
|
+
{ id: id(), value: 'buttons', name: $t('constructor.props.type.buttons') },
|
|
34
|
+
{ id: id(), value: 'input', name: $t('constructor.props.type.selectput') },
|
|
34
35
|
],
|
|
35
36
|
SELECT_VALUE_TYPE_OPTIONS: [
|
|
36
|
-
{ id: id(), value: 'text', name: $t('constructor.props.valuetype.text')
|
|
37
|
-
{ id: id(), value: 'number', name: $t('constructor.props.valuetype.number')
|
|
37
|
+
{ id: id(), value: 'text', name: $t('constructor.props.valuetype.text') },
|
|
38
|
+
{ id: id(), value: 'number', name: $t('constructor.props.valuetype.number') },
|
|
38
39
|
],
|
|
39
40
|
SLIDER_TYPE_OPTIONS: [
|
|
40
|
-
{ id: id(), value: 'single', name: $t('constructor.props.type.single')
|
|
41
|
-
{ id: id(), value: 'range', name: $t('constructor.props.type.range')
|
|
41
|
+
{ id: id(), value: 'single', name: $t('constructor.props.type.single') },
|
|
42
|
+
{ id: id(), value: 'range', name: $t('constructor.props.type.range') },
|
|
42
43
|
],
|
|
43
44
|
TEXTFIELD_SIZE_OPTIONS: [
|
|
44
|
-
{ id: id(), value: 'small', name: $t('constructor.props.type.small')
|
|
45
|
-
{ id: id(), value: '
|
|
46
|
-
{ id: id(), value: '
|
|
45
|
+
{ id: id(), value: 'small', name: $t('constructor.props.type.small') },
|
|
46
|
+
{ id: id(), value: 'base', name: $t('constructor.props.type.base') },
|
|
47
|
+
{ id: id(), value: 'large', name: $t('constructor.props.type.large') },
|
|
48
|
+
{ id: id(), value: 'huge', name: $t('constructor.props.type.huge') },
|
|
49
|
+
{ id: id(), value: 'massive', name: $t('constructor.props.type.massive') },
|
|
47
50
|
],
|
|
48
51
|
COLOR_OPTIONS: [
|
|
49
|
-
{ id: id(), name: '', value: 'bg-gray', class: '
|
|
50
|
-
{ id: id(), name: '', value: 'bg-max', class: '
|
|
51
|
-
{ id: id(), name: '', value: 'bg-red', class: '
|
|
52
|
-
{ id: id(), name: '', value: 'bg-yellow', class: '
|
|
53
|
-
{ id: id(), name: '', value: 'bg-green', class: '
|
|
54
|
-
{ id: id(), name: '', value: 'bg-blue', class: '
|
|
52
|
+
{ id: id(), name: '', value: 'bg-gray', class: 'bg-gray' },
|
|
53
|
+
{ id: id(), name: '', value: 'bg-max', class: 'bg-max' },
|
|
54
|
+
{ id: id(), name: '', value: 'bg-red', class: 'bg-red' },
|
|
55
|
+
{ id: id(), name: '', value: 'bg-yellow', class: 'bg-yellow' },
|
|
56
|
+
{ id: id(), name: '', value: 'bg-green', class: 'bg-green' },
|
|
57
|
+
{ id: id(), name: '', value: 'bg-blue', class: 'bg-blue' },
|
|
58
|
+
],
|
|
59
|
+
TEXT_COLOR_OPTIONS: [
|
|
60
|
+
{ id: id(), name: '', value: 'text-[#333] dark:text-[#e2e3e7]', class: 'bg-[var(--shadow-color)] dark:bg-[#e2e3e7] ' },
|
|
61
|
+
{ id: id(), name: '', value: 'text-red-500 dark:text-red-400', class: 'bg-red-500 dark:bg-red-400' },
|
|
62
|
+
{ id: id(), name: '', value: 'text-yellow-500 dark:text-yellow-400', class: 'bg-yellow-500 dark:bg-yellow-400' },
|
|
63
|
+
{ id: id(), name: '', value: 'text-green-500 dark:text-green-400', class: 'bg-green-500 dark:bg-green-400' },
|
|
64
|
+
{ id: id(), name: '', value: 'text-blue-500 dark:text-blue-400', class: 'bg-blue-500 dark:bg-blue-400' },
|
|
65
|
+
{ id: id(), name: '', value: 'text-gray-500 dark:text-gray-400', class: 'bg-gray-500 dark:bg-gray-400' },
|
|
55
66
|
],
|
|
56
67
|
ALIGN_OPTIONS: [
|
|
57
|
-
{ id: id(), value: 'text-left', name: $t('constructor.props.align.left')
|
|
58
|
-
{ id: id(), value: 'text-center', name: $t('constructor.props.align.center')
|
|
59
|
-
{ id: id(), value: 'text-right', name: $t('constructor.props.align.right')
|
|
68
|
+
{ id: id(), value: 'text-left', name: $t('constructor.props.align.left') },
|
|
69
|
+
{ id: id(), value: 'text-center', name: $t('constructor.props.align.center') },
|
|
70
|
+
{ id: id(), value: 'text-right', name: $t('constructor.props.align.right') },
|
|
60
71
|
],
|
|
61
72
|
HEIGHT_OPTIONS: [
|
|
62
|
-
{ id: id(), value: 'py-1', name: $t('constructor.props.height.small')
|
|
63
|
-
{ id: id(), value: 'py-2', name: $t('constructor.props.height.medium')
|
|
64
|
-
{ id: id(), value: 'py-3', name: $t('constructor.props.height.large')
|
|
73
|
+
{ id: id(), value: 'py-1', name: $t('constructor.props.height.small') },
|
|
74
|
+
{ id: id(), value: 'py-2', name: $t('constructor.props.height.medium') },
|
|
75
|
+
{ id: id(), value: 'py-3', name: $t('constructor.props.height.large') },
|
|
65
76
|
],
|
|
66
77
|
ACCORDION_TYPE_OPTIONS: [
|
|
67
|
-
{ id: id(), value:
|
|
68
|
-
{ id: id(), value:
|
|
78
|
+
{ id: id(), value: false, name: $t('constructor.props.type.main') },
|
|
79
|
+
{ id: id(), value: true, name: $t('constructor.props.type.sub') },
|
|
69
80
|
],
|
|
70
81
|
};
|
|
71
82
|
});
|
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,78 +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;
|
|
59
|
-
|
|
58
|
+
icon?: ConstructorOfATypedSvelteComponent | null;
|
|
60
59
|
};
|
|
61
|
-
icon?: {
|
|
62
|
-
svg?: string;
|
|
63
|
-
component?: ConstructorOfATypedSvelteComponent | null;
|
|
64
|
-
};
|
|
65
|
-
isOpen: boolean;
|
|
66
|
-
componentClass?: string;
|
|
67
|
-
type?: 'main' | 'sub';
|
|
68
|
-
components?: UIComponent[];
|
|
69
|
-
image?: string;
|
|
70
60
|
children?: Snippet;
|
|
61
|
+
image?: string;
|
|
71
62
|
}
|
|
72
63
|
export interface IInputProps {
|
|
73
|
-
id?:
|
|
74
|
-
|
|
75
|
-
name?: string;
|
|
76
|
-
};
|
|
64
|
+
id?: string;
|
|
65
|
+
type?: 'text' | 'password' | 'number' | 'text-area';
|
|
77
66
|
wrapperClass?: string;
|
|
78
67
|
label?: {
|
|
79
68
|
name?: string;
|
|
80
69
|
class?: string;
|
|
81
70
|
};
|
|
71
|
+
componentClass?: string;
|
|
82
72
|
disabled?: boolean;
|
|
83
73
|
readonly?: boolean;
|
|
84
74
|
value?: string | number;
|
|
85
|
-
type?: 'text' | 'password' | 'number' | 'text-area';
|
|
86
|
-
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;
|
|
87
|
-
componentClass?: string;
|
|
88
75
|
maxlength?: number;
|
|
76
|
+
textareaRows?: number;
|
|
77
|
+
placeholder?: string;
|
|
89
78
|
number?: {
|
|
90
79
|
minNum?: number;
|
|
91
80
|
maxNum?: number;
|
|
92
81
|
step?: number;
|
|
93
82
|
};
|
|
94
|
-
textareaRows?: number;
|
|
95
|
-
regExp?: string | RegExp;
|
|
96
83
|
help?: {
|
|
97
|
-
placeholder?: string;
|
|
98
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;
|
|
99
88
|
};
|
|
100
|
-
copyButton?: boolean;
|
|
101
89
|
eventHandler?: IUIComponentHandler;
|
|
102
90
|
onUpdate?: (value: string | number) => void;
|
|
103
91
|
}
|
|
104
92
|
export interface ISelectProps<T = unknown> {
|
|
105
|
-
id?:
|
|
106
|
-
value?: string;
|
|
107
|
-
name?: string;
|
|
108
|
-
};
|
|
93
|
+
id?: string;
|
|
109
94
|
wrapperClass?: string;
|
|
110
95
|
disabled?: boolean;
|
|
111
96
|
label?: {
|
|
112
97
|
name?: string;
|
|
113
98
|
class?: string;
|
|
114
99
|
};
|
|
100
|
+
componentClass?: string;
|
|
115
101
|
type?: 'select' | 'buttons' | 'input';
|
|
116
102
|
value?: ISelectOption<T> | null;
|
|
117
103
|
options?: ISelectOption<T>[];
|
|
118
|
-
placeholder?: string;
|
|
119
104
|
eventHandler?: IUIComponentHandler;
|
|
120
105
|
onUpdate?: (value: ISelectOption<T>) => void;
|
|
121
106
|
}
|
|
@@ -124,35 +109,24 @@ export interface ISelectOption<T = unknown> {
|
|
|
124
109
|
value?: T;
|
|
125
110
|
name?: string;
|
|
126
111
|
class?: string;
|
|
127
|
-
icon?: {
|
|
128
|
-
component?: ConstructorOfATypedSvelteComponent | null;
|
|
129
|
-
properties?: Record<string, unknown>;
|
|
130
|
-
};
|
|
131
112
|
disabled?: boolean;
|
|
132
113
|
}
|
|
133
114
|
export interface ISwitchProps {
|
|
134
|
-
id?:
|
|
135
|
-
|
|
136
|
-
name?: string;
|
|
137
|
-
};
|
|
115
|
+
id?: string;
|
|
116
|
+
height?: string;
|
|
138
117
|
wrapperClass?: string;
|
|
139
118
|
disabled?: boolean;
|
|
140
119
|
label?: {
|
|
141
120
|
name?: string;
|
|
142
121
|
captionLeft?: string;
|
|
143
122
|
captionRight?: string;
|
|
144
|
-
class?: string;
|
|
145
123
|
};
|
|
146
|
-
height?: string;
|
|
147
124
|
value?: number;
|
|
148
125
|
eventHandler?: IUIComponentHandler;
|
|
149
126
|
onChange?: (value: number) => void;
|
|
150
127
|
}
|
|
151
128
|
export interface IColorPickerProps {
|
|
152
|
-
id?:
|
|
153
|
-
name?: string;
|
|
154
|
-
value?: string;
|
|
155
|
-
};
|
|
129
|
+
id?: string;
|
|
156
130
|
wrapperClass?: string;
|
|
157
131
|
label?: {
|
|
158
132
|
name?: string;
|
|
@@ -163,10 +137,7 @@ export interface IColorPickerProps {
|
|
|
163
137
|
onChange?: (value: number[]) => void;
|
|
164
138
|
}
|
|
165
139
|
export interface ISliderProps {
|
|
166
|
-
id?:
|
|
167
|
-
name?: string;
|
|
168
|
-
value?: string;
|
|
169
|
-
};
|
|
140
|
+
id?: string;
|
|
170
141
|
wrapperClass?: string;
|
|
171
142
|
label?: {
|
|
172
143
|
name?: string;
|
|
@@ -186,27 +157,23 @@ export interface ISliderProps {
|
|
|
186
157
|
export interface ITextFieldProps {
|
|
187
158
|
id?: string;
|
|
188
159
|
wrapperClass?: string;
|
|
189
|
-
|
|
160
|
+
background?: boolean;
|
|
161
|
+
content?: {
|
|
190
162
|
name?: string;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
color?: string;
|
|
163
|
+
class?: string;
|
|
164
|
+
size?: 'small' | 'base' | 'large' | 'huge' | 'massive';
|
|
194
165
|
};
|
|
195
|
-
type?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'huge' | 'massive';
|
|
196
166
|
}
|
|
197
167
|
export interface IProgressBarProps {
|
|
198
|
-
id?:
|
|
199
|
-
name?: string;
|
|
200
|
-
value?: string;
|
|
201
|
-
};
|
|
168
|
+
id?: string;
|
|
202
169
|
label?: {
|
|
203
170
|
name?: string;
|
|
204
171
|
class?: string;
|
|
205
172
|
};
|
|
206
|
-
value?:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
173
|
+
value?: number | null;
|
|
174
|
+
number?: {
|
|
175
|
+
minNum?: number;
|
|
176
|
+
maxNum?: number;
|
|
210
177
|
units?: string;
|
|
211
178
|
};
|
|
212
179
|
wrapperClass?: string;
|
|
@@ -214,33 +181,30 @@ export interface IProgressBarProps {
|
|
|
214
181
|
export interface IGraphDataObject {
|
|
215
182
|
name: string;
|
|
216
183
|
value: number;
|
|
217
|
-
|
|
218
|
-
color?: string;
|
|
184
|
+
timestamp?: Date;
|
|
219
185
|
}
|
|
220
186
|
export interface IGraphProps {
|
|
221
|
-
id?:
|
|
222
|
-
value: string;
|
|
223
|
-
name?: string;
|
|
224
|
-
};
|
|
187
|
+
id?: string;
|
|
225
188
|
wrapperClass?: string;
|
|
226
189
|
label?: {
|
|
227
190
|
name?: string;
|
|
228
191
|
class?: string;
|
|
229
192
|
};
|
|
230
193
|
streamingData?: {
|
|
231
|
-
data: IGraphDataObject[] |
|
|
194
|
+
data: IGraphDataObject[] | null;
|
|
232
195
|
timestamp?: number;
|
|
233
196
|
};
|
|
234
197
|
isTest?: boolean;
|
|
235
198
|
}
|
|
236
199
|
export interface ITableHeader<T extends object> {
|
|
237
|
-
|
|
238
|
-
|
|
200
|
+
label?: {
|
|
201
|
+
name?: string;
|
|
202
|
+
class?: string;
|
|
203
|
+
};
|
|
239
204
|
key: keyof T;
|
|
240
|
-
width?: string;
|
|
241
205
|
sortable?: boolean;
|
|
206
|
+
width?: string;
|
|
242
207
|
align?: 'left' | 'center' | 'right';
|
|
243
|
-
cellClass?: string;
|
|
244
208
|
overflow?: {
|
|
245
209
|
truncated?: boolean;
|
|
246
210
|
formatting?: (text: string) => string;
|
|
@@ -263,10 +227,7 @@ export interface ITableHeader<T extends object> {
|
|
|
263
227
|
};
|
|
264
228
|
}
|
|
265
229
|
export interface ITableProps<T extends object> {
|
|
266
|
-
id?:
|
|
267
|
-
value?: string;
|
|
268
|
-
name?: string;
|
|
269
|
-
};
|
|
230
|
+
id?: string;
|
|
270
231
|
wrapperClass?: string;
|
|
271
232
|
label?: {
|
|
272
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,15 +33,19 @@
|
|
|
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
47
|
"publint": "^0.3.14",
|
|
44
|
-
"svelte": "^5.39.
|
|
48
|
+
"svelte": "^5.39.11",
|
|
45
49
|
"svelte-preprocess": "^6.0.3",
|
|
46
50
|
"vite": "^7.1.9",
|
|
47
51
|
"vite-plugin-compression": "^0.5.1"
|
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;
|