poe-svelte-ui-lib 1.2.22 → 1.2.23
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/Button/Button.svelte +1 -0
- package/dist/Button/ButtonProps.svelte +7 -0
- package/dist/ColorPicker/ColorPicker.svelte +1 -0
- package/dist/ColorPicker/ColorPickerProps.svelte +9 -0
- package/dist/Input/Input.svelte +1 -0
- package/dist/Input/InputProps.svelte +7 -0
- package/dist/Joystick/Joystick.svelte +27 -13
- package/dist/Select/Select.svelte +2 -0
- package/dist/Select/SelectProps.svelte +69 -9
- package/dist/Switch/Switch.svelte +8 -7
- package/dist/Switch/SwitchProps.svelte +19 -16
- package/dist/locales/translations.js +8 -0
- package/dist/options.d.ts +5 -0
- package/dist/options.js +5 -0
- package/package.json +2 -2
|
@@ -99,6 +99,13 @@
|
|
|
99
99
|
/>
|
|
100
100
|
</div>
|
|
101
101
|
<div class="flex w-1/3 flex-col px-2">
|
|
102
|
+
<UI.Select
|
|
103
|
+
label={{ name: $t('constructor.props.icon.access') }}
|
|
104
|
+
type="buttons"
|
|
105
|
+
options={$optionsStore.ACCESS_OPTION}
|
|
106
|
+
value={$optionsStore.ACCESS_OPTION.find((o) => o.value === component.properties.access)}
|
|
107
|
+
onUpdate={(option) => updateProperty('acces', option.value as string, component, onPropertyChange)}
|
|
108
|
+
/>
|
|
102
109
|
<UI.Input
|
|
103
110
|
label={{ name: $t('constructor.props.name') }}
|
|
104
111
|
value={component.properties.content.name}
|
|
@@ -49,6 +49,15 @@
|
|
|
49
49
|
}}
|
|
50
50
|
/>
|
|
51
51
|
</div>
|
|
52
|
+
<div class="flex w-1/3 flex-col items-center px-2">
|
|
53
|
+
<UI.Select
|
|
54
|
+
label={{ name: $t('constructor.props.icon.access') }}
|
|
55
|
+
type="buttons"
|
|
56
|
+
options={$optionsStore.ACCESS_OPTION}
|
|
57
|
+
value={$optionsStore.ACCESS_OPTION.find((o) => o.value === component.properties.access)}
|
|
58
|
+
onUpdate={(option) => updateProperty('acces', option.value as string, component, onPropertyChange)}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
52
61
|
<div class="flex w-1/3 flex-col px-2">
|
|
53
62
|
<UI.Input
|
|
54
63
|
label={{ name: $t('constructor.props.label') }}
|
package/dist/Input/Input.svelte
CHANGED
|
@@ -100,6 +100,13 @@
|
|
|
100
100
|
updateProperty('eventHandler.Variables', value.value as string)
|
|
101
101
|
}}
|
|
102
102
|
/>
|
|
103
|
+
<UI.Select
|
|
104
|
+
label={{ name: $t('constructor.props.icon.access') }}
|
|
105
|
+
type="buttons"
|
|
106
|
+
options={$optionsStore.ACCESS_OPTION}
|
|
107
|
+
value={$optionsStore.ACCESS_OPTION.find((o) => o.value === component.properties.access)}
|
|
108
|
+
onUpdate={(option) => updateProperty('acces', option.value as string)}
|
|
109
|
+
/>
|
|
103
110
|
<UI.Select
|
|
104
111
|
label={{ name: $t('constructor.props.type') }}
|
|
105
112
|
options={$optionsStore.INPUT_TYPE_OPTIONS}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
id = crypto.randomUUID(),
|
|
7
|
+
|
|
7
8
|
wrapperClass = '',
|
|
8
9
|
label = { name: '', class: '' },
|
|
9
10
|
value = $bindable([0, 0, 0]),
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
return
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
value[2]
|
|
31
|
+
value[2] = roundToClean(value[2] + sensitivity)
|
|
31
32
|
onUpdate(value)
|
|
32
33
|
},
|
|
33
34
|
},
|
|
@@ -40,14 +41,14 @@
|
|
|
40
41
|
value[2] = limits[2].maxNum
|
|
41
42
|
onUpdate(value)
|
|
42
43
|
} else {
|
|
43
|
-
value[2]
|
|
44
|
+
value[2] = roundToClean(value[2] + sensitivity)
|
|
44
45
|
onUpdate(value)
|
|
45
46
|
}
|
|
46
47
|
if (value[1] - sensitivity <= limits[1].minNum) {
|
|
47
48
|
value[1] = limits[1].minNum
|
|
48
49
|
onUpdate(value)
|
|
49
50
|
} else {
|
|
50
|
-
value[1]
|
|
51
|
+
value[1] = roundToClean(value[1] - sensitivity)
|
|
51
52
|
onUpdate(value)
|
|
52
53
|
}
|
|
53
54
|
},
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
onUpdate(value)
|
|
63
64
|
return
|
|
64
65
|
}
|
|
65
|
-
value[1]
|
|
66
|
+
value[1] = roundToClean(value[1] - sensitivity)
|
|
66
67
|
onUpdate(value)
|
|
67
68
|
},
|
|
68
69
|
},
|
|
@@ -75,14 +76,14 @@
|
|
|
75
76
|
value[2] = limits[2].minNum
|
|
76
77
|
onUpdate(value)
|
|
77
78
|
} else {
|
|
78
|
-
value[2]
|
|
79
|
+
value[2] = roundToClean(value[2] - sensitivity)
|
|
79
80
|
onUpdate(value)
|
|
80
81
|
}
|
|
81
82
|
if (value[1] - sensitivity <= limits[1].minNum) {
|
|
82
83
|
value[1] = limits[1].minNum
|
|
83
84
|
onUpdate(value)
|
|
84
85
|
} else {
|
|
85
|
-
value[1]
|
|
86
|
+
value[1] = roundToClean(value[1] - sensitivity)
|
|
86
87
|
onUpdate(value)
|
|
87
88
|
}
|
|
88
89
|
},
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
onUpdate(value)
|
|
98
99
|
return
|
|
99
100
|
}
|
|
100
|
-
value[2]
|
|
101
|
+
value[2] = roundToClean(value[2] - sensitivity)
|
|
101
102
|
onUpdate(value)
|
|
102
103
|
},
|
|
103
104
|
},
|
|
@@ -110,14 +111,14 @@
|
|
|
110
111
|
value[1] = limits[1].maxNum
|
|
111
112
|
onUpdate(value)
|
|
112
113
|
} else {
|
|
113
|
-
value[1]
|
|
114
|
+
value[1] = roundToClean(value[1] + sensitivity)
|
|
114
115
|
onUpdate(value)
|
|
115
116
|
}
|
|
116
117
|
if (value[2] - sensitivity <= limits[2].minNum) {
|
|
117
118
|
value[2] = limits[2].minNum
|
|
118
119
|
onUpdate(value)
|
|
119
120
|
} else {
|
|
120
|
-
value[2]
|
|
121
|
+
value[2] = roundToClean(value[2] - sensitivity)
|
|
121
122
|
onUpdate(value)
|
|
122
123
|
}
|
|
123
124
|
},
|
|
@@ -132,7 +133,7 @@
|
|
|
132
133
|
onUpdate(value)
|
|
133
134
|
return
|
|
134
135
|
}
|
|
135
|
-
value[1]
|
|
136
|
+
value[1] = roundToClean(value[1] + sensitivity)
|
|
136
137
|
onUpdate(value)
|
|
137
138
|
},
|
|
138
139
|
},
|
|
@@ -145,14 +146,14 @@
|
|
|
145
146
|
value[1] = limits[1].maxNum
|
|
146
147
|
onUpdate(value)
|
|
147
148
|
} else {
|
|
148
|
-
value[1]
|
|
149
|
+
value[1] = roundToClean(value[1] + sensitivity)
|
|
149
150
|
onUpdate(value)
|
|
150
151
|
}
|
|
151
152
|
if (value[2] + sensitivity >= limits[2].maxNum) {
|
|
152
153
|
value[2] = limits[2].maxNum
|
|
153
154
|
onUpdate(value)
|
|
154
155
|
} else {
|
|
155
|
-
value[2]
|
|
156
|
+
value[2] = roundToClean(value[2] + sensitivity)
|
|
156
157
|
onUpdate(value)
|
|
157
158
|
}
|
|
158
159
|
},
|
|
@@ -164,6 +165,18 @@
|
|
|
164
165
|
|
|
165
166
|
let clipPos = Math.cos(Math.PI / directions.length) * 100
|
|
166
167
|
let angle = 360 / directions.length
|
|
168
|
+
|
|
169
|
+
const roundToClean = (num: number): number => {
|
|
170
|
+
if (Number.isInteger(num)) return num
|
|
171
|
+
|
|
172
|
+
const rounded1 = Number(num.toFixed(1))
|
|
173
|
+
if (Math.abs(rounded1 - num) < 1e-10) return rounded1
|
|
174
|
+
|
|
175
|
+
const rounded2 = Number(num.toFixed(2))
|
|
176
|
+
if (Math.abs(rounded2 - num) < 1e-10) return rounded2
|
|
177
|
+
|
|
178
|
+
return rounded2
|
|
179
|
+
}
|
|
167
180
|
</script>
|
|
168
181
|
|
|
169
182
|
<div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class={twMerge(`bg-red relative flex w-full flex-col items-center`, wrapperClass)}>
|
|
@@ -331,7 +344,7 @@
|
|
|
331
344
|
[&::-webkit-inner-spin-button]:hidden
|
|
332
345
|
[&::-webkit-outer-spin-button]:hidden`}
|
|
333
346
|
style="background: color-mix(in srgb, var(--bg-color), var(--back-color) 70%);"
|
|
334
|
-
value={
|
|
347
|
+
value={value[num]}
|
|
335
348
|
id={`${id}-${crypto.randomUUID().slice(0, 6)}`}
|
|
336
349
|
readonly
|
|
337
350
|
/>
|
|
@@ -339,3 +352,4 @@
|
|
|
339
352
|
</div>
|
|
340
353
|
</div>
|
|
341
354
|
</div>
|
|
355
|
+
<!-- sensitivity == 0.01 ? value[num].toFixed(2) : sensitivity == 0.1 ? value[num].toFixed(1) : value[num].toFixed(0) -->
|
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
let {
|
|
16
16
|
id = crypto.randomUUID(),
|
|
17
|
+
|
|
17
18
|
wrapperClass = '',
|
|
18
19
|
disabled = false,
|
|
19
20
|
label = { name: '', class: '' },
|
|
20
21
|
type = 'select',
|
|
21
22
|
value = $bindable(),
|
|
23
|
+
bitMode = false,
|
|
22
24
|
options = [],
|
|
23
25
|
onUpdate,
|
|
24
26
|
}: ISelectProps<T> = $props()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getContext } from 'svelte'
|
|
2
|
+
import { getContext, onMount } from 'svelte'
|
|
3
3
|
import { t } from '../locales/i18n'
|
|
4
4
|
import { type UIComponent, type ISelectProps, type ISelectOption, updateProperty } from '../types'
|
|
5
5
|
import * as UI from '..'
|
|
@@ -46,11 +46,26 @@
|
|
|
46
46
|
|
|
47
47
|
let currentType = $derived($optionsStore.SELECT_TYPE_OPTIONS.find((t) => t.value === component.properties.type))
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
let range = $state({ start: 0, end: 0 })
|
|
50
|
+
|
|
51
|
+
const generateBitOptions = () => {
|
|
52
|
+
const bitsNeeded = range.end - range.start + 1
|
|
53
|
+
const count = Math.pow(2, bitsNeeded)
|
|
54
|
+
|
|
55
|
+
const options: ISelectOption<number>[] = []
|
|
56
|
+
|
|
57
|
+
for (let i = 0; i < count; i++) {
|
|
58
|
+
const binary = i.toString(2).padStart(bitsNeeded, '0')
|
|
59
|
+
|
|
60
|
+
options.push({
|
|
61
|
+
id: crypto.randomUUID(),
|
|
62
|
+
value: parseInt(binary, 2) << range.start,
|
|
63
|
+
name: binary,
|
|
64
|
+
class: 'bg-max',
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
updateProperty('options', options, component, onPropertyChange)
|
|
68
|
+
}
|
|
54
69
|
|
|
55
70
|
const initialAlign = $derived(
|
|
56
71
|
$optionsStore.TEXT_ALIGN_OPTIONS.find((a) =>
|
|
@@ -103,6 +118,7 @@
|
|
|
103
118
|
wrapperClass="h-14"
|
|
104
119
|
label={{ name: $t('constructor.props.valuetype') }}
|
|
105
120
|
type="buttons"
|
|
121
|
+
disabled={component.properties.bitMode}
|
|
106
122
|
options={$optionsStore.SELECT_VALUE_TYPE_OPTIONS}
|
|
107
123
|
value={currentValueType}
|
|
108
124
|
onUpdate={(value) => {
|
|
@@ -116,6 +132,32 @@
|
|
|
116
132
|
updateProperty('options', options, component, onPropertyChange)
|
|
117
133
|
}}
|
|
118
134
|
/>
|
|
135
|
+
{#if component.properties.bitMode}
|
|
136
|
+
<div class="flex w-full gap-4">
|
|
137
|
+
<UI.Input
|
|
138
|
+
label={{ name: $t('constructor.props.range.start') }}
|
|
139
|
+
value={range.start}
|
|
140
|
+
onUpdate={(value) => {
|
|
141
|
+
range.start = value as number
|
|
142
|
+
generateBitOptions()
|
|
143
|
+
}}
|
|
144
|
+
number={{ minNum: 0, maxNum: 31, step: 1 }}
|
|
145
|
+
help={{ info: $t('constructor.props.range.start.help') }}
|
|
146
|
+
type="number"
|
|
147
|
+
/>
|
|
148
|
+
<UI.Input
|
|
149
|
+
label={{ name: $t('constructor.props.range.end') }}
|
|
150
|
+
value={range.end}
|
|
151
|
+
onUpdate={(value) => {
|
|
152
|
+
range.end = value as number
|
|
153
|
+
generateBitOptions()
|
|
154
|
+
}}
|
|
155
|
+
number={{ minNum: 0, maxNum: 31, step: 1 }}
|
|
156
|
+
help={{ info: $t('constructor.props.range.end.help') }}
|
|
157
|
+
type="number"
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
{/if}
|
|
119
161
|
</div>
|
|
120
162
|
<div class="flex w-1/3 flex-col items-center px-2">
|
|
121
163
|
<UI.Input
|
|
@@ -130,6 +172,24 @@
|
|
|
130
172
|
options={$optionsStore.TEXT_ALIGN_OPTIONS}
|
|
131
173
|
onUpdate={(option) => updateProperty('label.class', twMerge(component.properties.label.class, option.value), component, onPropertyChange)}
|
|
132
174
|
/>
|
|
175
|
+
<UI.Switch
|
|
176
|
+
wrapperClass="bg-blue"
|
|
177
|
+
label={{ name: $t('constructor.props.bitmode') }}
|
|
178
|
+
value={component.properties.bitMode}
|
|
179
|
+
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
180
|
+
onChange={(value) => {
|
|
181
|
+
updateProperty('bitMode', value, component, onPropertyChange)
|
|
182
|
+
currentValueType = $optionsStore.SELECT_VALUE_TYPE_OPTIONS[1] as ValueTypeOption
|
|
183
|
+
const options = [...(component.properties?.options || [])]
|
|
184
|
+
const newType = $optionsStore.SELECT_VALUE_TYPE_OPTIONS[1].value
|
|
185
|
+
options.forEach((option) => {
|
|
186
|
+
if (newType === 'number') option.value = option.value !== undefined ? Number(option.value) : 0
|
|
187
|
+
else option.value = option.value !== undefined ? String(option.value) : ''
|
|
188
|
+
})
|
|
189
|
+
updateProperty('options', options, component, onPropertyChange)
|
|
190
|
+
if (value) generateBitOptions()
|
|
191
|
+
}}
|
|
192
|
+
/>
|
|
133
193
|
</div>
|
|
134
194
|
</div>
|
|
135
195
|
|
|
@@ -232,9 +292,9 @@
|
|
|
232
292
|
<UI.Switch
|
|
233
293
|
wrapperClass="bg-blue"
|
|
234
294
|
label={{ name: $t('constructor.props.disabled') }}
|
|
235
|
-
value={component.properties.disabled
|
|
236
|
-
|
|
237
|
-
onChange={(value) => updateProperty('disabled', value
|
|
295
|
+
value={component.properties.disabled}
|
|
296
|
+
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
297
|
+
onChange={(value) => updateProperty('disabled', value, component, onPropertyChange)}
|
|
238
298
|
/>
|
|
239
299
|
</div>
|
|
240
300
|
<div class="flex w-1/3 flex-col items-center px-2">
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
{/if}
|
|
75
75
|
|
|
76
76
|
<label
|
|
77
|
-
class="relative flex items-center justify-between rounded-full
|
|
78
|
-
{checkedOptions[index] ? 'border-(--bg-color)' : 'border-(--
|
|
77
|
+
class="relative flex items-center justify-between rounded-full shadow-md
|
|
78
|
+
{checkedOptions[index] ? 'border-(--bg-color)' : 'border-(--bg-color)'}
|
|
79
79
|
{option.disabled ? 'opacity-60' : ''}"
|
|
80
80
|
>
|
|
81
81
|
<input
|
|
@@ -87,13 +87,14 @@
|
|
|
87
87
|
onchange={() => handleToggle(index)}
|
|
88
88
|
/>
|
|
89
89
|
<span
|
|
90
|
-
class="relative flex items-center rounded-full transition-all duration-250
|
|
91
|
-
{checkedOptions[index] ? 'bg-(--bg-color)' : 'bg-(--
|
|
90
|
+
class="relative flex items-center rounded-full border-(--bg-color) transition-all duration-250
|
|
91
|
+
{checkedOptions[index] ? 'bg-(--bg-color)' : 'bg-(--back-color)'}
|
|
92
92
|
{option.disabled ? '' : 'cursor-pointer'}"
|
|
93
93
|
style="{type === 'horizontal' ? 'width' : 'height'}: {`calc(${height} * 2)`}; {type === 'horizontal' ? 'height' : 'width'}: {height};"
|
|
94
94
|
>
|
|
95
95
|
<span
|
|
96
|
-
class="absolute rounded-full
|
|
96
|
+
class="absolute rounded-full transition-all duration-250
|
|
97
|
+
{checkedOptions[index] ? 'bg-(--back-color)' : 'bg-(--bg-color)'}
|
|
97
98
|
{option.disabled ? 'opacity-60' : 'cursor-pointer'}"
|
|
98
99
|
style="width: {`calc(${height} * 0.8)`}; height: {`calc(${height} * 0.8)`}; margin: 0 {`calc(${height} * 0.1)`}; transform: {checkedOptions[
|
|
99
100
|
index
|
|
@@ -121,13 +122,13 @@
|
|
|
121
122
|
<input
|
|
122
123
|
id={ID}
|
|
123
124
|
type="checkbox"
|
|
124
|
-
|
|
125
|
+
checked={checkedOptions[0]}
|
|
125
126
|
disabled={localOptions[0].disabled}
|
|
126
127
|
class="
|
|
127
128
|
relative size-8 cursor-pointer appearance-none rounded-2xl border border-(--bg-color)
|
|
128
129
|
bg-white transition duration-300 after:origin-bottom-left after:opacity-0
|
|
129
130
|
checked:border-(--bg-color)
|
|
130
|
-
checked:bg-(--bg-color) checked:after:absolute checked:after:-top-px checked:after:left-[
|
|
131
|
+
checked:bg-(--bg-color) checked:after:absolute checked:after:-top-px checked:after:left-[5px]
|
|
131
132
|
checked:after:h-[13.5px] checked:after:w-[7.5px] checked:after:rotate-43
|
|
132
133
|
checked:after:border-2 checked:after:border-t-0
|
|
133
134
|
checked:after:border-l-0 checked:after:border-solid
|
|
@@ -49,16 +49,15 @@
|
|
|
49
49
|
updateProperty('eventHandler.Argument', option.value as string, component, onPropertyChange)
|
|
50
50
|
}}
|
|
51
51
|
/>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{/if}
|
|
52
|
+
<UI.Select
|
|
53
|
+
wrapperClass="!h-14"
|
|
54
|
+
label={{ name: $t('constructor.props.type') }}
|
|
55
|
+
disabled={component.properties.bitMode}
|
|
56
|
+
type="buttons"
|
|
57
|
+
options={$optionsStore.SWITCH_OPTIONS}
|
|
58
|
+
value={$optionsStore.SWITCH_OPTIONS.find((option) => option.value == component.properties.type)}
|
|
59
|
+
onUpdate={(option) => updateProperty('type', option.value as string, component, onPropertyChange)}
|
|
60
|
+
/>
|
|
62
61
|
</div>
|
|
63
62
|
{#if !component.properties.bitMode}
|
|
64
63
|
<div class="flex w-1/3 flex-col px-2">
|
|
@@ -98,7 +97,9 @@
|
|
|
98
97
|
label={{ name: $t('constructor.props.colors') }}
|
|
99
98
|
type="buttons"
|
|
100
99
|
options={$optionsStore.COLOR_OPTIONS.filter((option) => option.value !== 'bg-max' && option.value !== 'bg-gray')}
|
|
101
|
-
value={
|
|
100
|
+
value={$optionsStore.COLOR_OPTIONS.find((c) =>
|
|
101
|
+
(c.value as string).includes(component.properties.options[0].class.split(' ').find((cls: string) => cls.startsWith('bg-'))),
|
|
102
|
+
)}
|
|
102
103
|
onUpdate={(option) => {
|
|
103
104
|
const options = [...(component.properties?.options || [])]
|
|
104
105
|
options[0]['class'] = option.value
|
|
@@ -113,7 +114,8 @@
|
|
|
113
114
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
114
115
|
onChange={(value) => {
|
|
115
116
|
updateProperty('bitMode', value, component, onPropertyChange)
|
|
116
|
-
updateProperty('value', 1, component, onPropertyChange)
|
|
117
|
+
if (!component.properties.bitMode) updateProperty('value', 1, component, onPropertyChange)
|
|
118
|
+
if (component.properties.bitMode) updateProperty('type', 'vertical', component, onPropertyChange)
|
|
117
119
|
}}
|
|
118
120
|
/>
|
|
119
121
|
</div>
|
|
@@ -131,7 +133,7 @@
|
|
|
131
133
|
onClick={() => {
|
|
132
134
|
const newOption: ISelectOption = {
|
|
133
135
|
id: crypto.randomUUID(),
|
|
134
|
-
name:
|
|
136
|
+
name: ``,
|
|
135
137
|
value: component.properties?.options.length,
|
|
136
138
|
class: 'bg-blue',
|
|
137
139
|
}
|
|
@@ -154,7 +156,7 @@
|
|
|
154
156
|
}}
|
|
155
157
|
/>
|
|
156
158
|
<UI.Input
|
|
157
|
-
label={{ name: $t('constructor.props.
|
|
159
|
+
label={{ name: $t('constructor.props.optionposition') }}
|
|
158
160
|
wrapperClass="!w-3/10"
|
|
159
161
|
value={option.value}
|
|
160
162
|
type="number"
|
|
@@ -222,7 +224,7 @@
|
|
|
222
224
|
label={{ name: $t('constructor.props.colors') }}
|
|
223
225
|
type="buttons"
|
|
224
226
|
options={$optionsStore.COLOR_OPTIONS.filter((option) => option.value !== 'bg-max' && option.value !== 'bg-gray')}
|
|
225
|
-
value={
|
|
227
|
+
value={component.properties.options[0].class.split(' ').find((cls: string) => cls.startsWith('bg-'))}
|
|
226
228
|
onUpdate={(option) => {
|
|
227
229
|
updateProperty('wrapperClass', twMerge(component.properties.wrapperClass, option.value), component, onPropertyChange)
|
|
228
230
|
const options = [...(component.properties?.options || [])]
|
|
@@ -285,7 +287,8 @@
|
|
|
285
287
|
options={[{ id: crypto.randomUUID(), value: 0, class: '' }]}
|
|
286
288
|
onChange={(value) => {
|
|
287
289
|
updateProperty('bitMode', value, component, onPropertyChange)
|
|
288
|
-
updateProperty('value', 1, component, onPropertyChange)
|
|
290
|
+
if (!component.properties.bitMode) updateProperty('value', 1, component, onPropertyChange)
|
|
291
|
+
if (component.properties.bitMode) updateProperty('type', 'vertical', component, onPropertyChange)
|
|
289
292
|
}}
|
|
290
293
|
/>
|
|
291
294
|
</div>
|
|
@@ -40,6 +40,9 @@ const translations = {
|
|
|
40
40
|
'constructor.props.type.horizontal': 'Горизонтально',
|
|
41
41
|
'constructor.props.type.vertical': 'Вертикально',
|
|
42
42
|
'constructor.props.type.checkbox': 'Галочка',
|
|
43
|
+
'constructor.props.type.full': 'Полный',
|
|
44
|
+
'constructor.props.type.viewOnly': 'Только просмотр',
|
|
45
|
+
'constructor.props.type.hidden': 'Скрыто',
|
|
43
46
|
/* Общие для редактора свойств */
|
|
44
47
|
'constructor.props.id': 'Идентификатор',
|
|
45
48
|
'constructor.props.label': 'Текст надписи',
|
|
@@ -112,10 +115,15 @@ const translations = {
|
|
|
112
115
|
'constructor.props.units': 'Единица измерения',
|
|
113
116
|
'constructor.props.optionclass': 'Стили кнопки',
|
|
114
117
|
'constructor.props.optionvalue': 'Значение',
|
|
118
|
+
'constructor.props.optionposition': 'Позиция',
|
|
115
119
|
'constructor.props.optionname': 'Текст',
|
|
116
120
|
'constructor.props.copy': 'Копирование',
|
|
117
121
|
'constructor.props.size.height': 'Высота сетки',
|
|
118
122
|
'constructor.props.size.width': 'Ширина сетки',
|
|
123
|
+
'constructor.props.range.start': 'Начальный бит ',
|
|
124
|
+
'constructor.props.range.end': 'Последний бит',
|
|
125
|
+
'constructor.props.range.start.help': 'Позиция начального бита диапазона ',
|
|
126
|
+
'constructor.props.range.end.help': 'Позиция последнего бита диапазона',
|
|
119
127
|
'constructor.props.icon.text.position': 'Положение иконки',
|
|
120
128
|
'constructor.props.equal': 'Равные',
|
|
121
129
|
'constructor.props.bitmode': 'Битовый режим',
|
package/dist/options.d.ts
CHANGED
package/dist/options.js
CHANGED
|
@@ -22,6 +22,11 @@ export const optionsStore = derived(t, ($t) => {
|
|
|
22
22
|
{ id: id(), value: 'Save', name: $t('constructor.props.action.save') },
|
|
23
23
|
{ id: id(), value: '', name: $t('constructor.props.action.custom') },
|
|
24
24
|
],
|
|
25
|
+
ACCESS_OPTION: [
|
|
26
|
+
{ id: id(), value: 'full', name: $t('constructor.props.type.full') },
|
|
27
|
+
{ id: id(), value: 'viewOnly', name: $t('constructor.props.type.viewOnly') },
|
|
28
|
+
{ id: id(), value: 'hidden', name: $t('constructor.props.type.hidden') },
|
|
29
|
+
],
|
|
25
30
|
INPUT_TYPE_OPTIONS: [
|
|
26
31
|
{ id: id(), value: 'text', name: $t('constructor.props.type.text') },
|
|
27
32
|
{ id: id(), value: 'password', name: $t('constructor.props.type.password') },
|
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.23",
|
|
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.10",
|
|
52
52
|
"svelte-preprocess": "^6.0.3",
|
|
53
53
|
"vite": "^7.2.2",
|
|
54
54
|
"vite-plugin-compression": "^0.5.1"
|