poe-svelte-ui-lib 1.9.5 → 1.9.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/Input/InputProps.svelte +38 -8
- package/dist/Joystick/Joystick.svelte +28 -18
- package/dist/Joystick/JoystickProps.svelte +36 -45
- package/dist/Modal.svelte +15 -1
- package/dist/Widget/Widget.svelte +5 -4
- package/dist/libIcons/Library.svelte +8 -0
- package/dist/libIcons/Library.svelte.d.ts +18 -0
- package/dist/locales/translations.js +18 -3
- package/dist/options.d.ts +5 -0
- package/dist/options.js +18 -0
- package/dist/types.d.ts +1 -0
- package/package.json +4 -4
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as UI from ".."
|
|
6
6
|
import { optionsStore } from "../options"
|
|
7
7
|
import { twMerge } from "tailwind-merge"
|
|
8
|
+
import Library from "../libIcons/Library.svelte"
|
|
8
9
|
|
|
9
10
|
const {
|
|
10
11
|
component,
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
}>()
|
|
18
19
|
|
|
19
20
|
let isValidRegExp = $state(true)
|
|
21
|
+
let showRegExpLibrary = $state(true)
|
|
20
22
|
const DeviceVariables = getContext<{ id: string; value: string; name: string }[]>("DeviceVariables")
|
|
21
23
|
let VARIABLE_OPTIONS = $derived(DeviceVariables && Array.isArray(DeviceVariables) ? DeviceVariables : [])
|
|
22
24
|
|
|
@@ -146,14 +148,42 @@
|
|
|
146
148
|
value={component.properties.maxlength}
|
|
147
149
|
onUpdate={(value) => updateProperty("maxlength", value as string)}
|
|
148
150
|
/>
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
<div class="flex items-end">
|
|
152
|
+
<UI.Input
|
|
153
|
+
label={{ name: $t("constructor.props.regexp") }}
|
|
154
|
+
value={component.properties.help.regExp}
|
|
155
|
+
maxlength={150}
|
|
156
|
+
help={{ info: $t("constructor.props.regexp.info") }}
|
|
157
|
+
componentClass={isValidRegExp === false ? "!border-2 !border-red-400" : ""}
|
|
158
|
+
onUpdate={(value) => updateProperty("help.regExp", value as string)}
|
|
159
|
+
/>
|
|
160
|
+
<UI.Button
|
|
161
|
+
wrapperClass="w-8"
|
|
162
|
+
content={{ icon: Library, info: { text: $t("constructor.props.regexp.library.info"), side: "top" } }}
|
|
163
|
+
onClick={() => {
|
|
164
|
+
showRegExpLibrary = !showRegExpLibrary
|
|
165
|
+
}}
|
|
166
|
+
/>
|
|
167
|
+
{#if showRegExpLibrary}
|
|
168
|
+
<UI.Modal bind:isOpen={showRegExpLibrary} wrapperClass="w-200 h-[80%]">
|
|
169
|
+
{#snippet main()}
|
|
170
|
+
{#each $optionsStore.INPUT_REGEXP_OPTIONS as regexp}
|
|
171
|
+
<div
|
|
172
|
+
class="flex flex-col items-start justify-start m-1.5 rounded-xl border-2 border-(--border-color) p-3 cursor-pointer hover:bg-(--gray-color)/30 transition duration-150"
|
|
173
|
+
role="button"
|
|
174
|
+
tabindex={null}
|
|
175
|
+
onkeydown={null}
|
|
176
|
+
onclick={() => (component.properties.help.regExp = regexp.value)}
|
|
177
|
+
>
|
|
178
|
+
<h5>{regexp.name}</h5>
|
|
179
|
+
<span>{regexp.value}</span>
|
|
180
|
+
</div>
|
|
181
|
+
{/each}
|
|
182
|
+
{/snippet}
|
|
183
|
+
</UI.Modal>
|
|
184
|
+
{/if}
|
|
185
|
+
</div>
|
|
186
|
+
|
|
157
187
|
{#if component.properties.type === "text-area"}
|
|
158
188
|
<UI.Input
|
|
159
189
|
label={{ name: $t("constructor.props.textarea.rows") }}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
id = crypto.randomUUID(),
|
|
7
7
|
wrapperClass = "",
|
|
8
8
|
label = { name: "", class: "" },
|
|
9
|
-
value = $bindable([0, 0, 0
|
|
9
|
+
value = $bindable([0, 0, 0]),
|
|
10
|
+
isHomeButton = false,
|
|
10
11
|
readonly = false,
|
|
11
12
|
axes = [
|
|
12
13
|
{ name: "Pitch", minNum: -360, maxNum: 360 },
|
|
@@ -176,11 +177,18 @@
|
|
|
176
177
|
{/each}
|
|
177
178
|
</div>
|
|
178
179
|
<!-- Кнопка по центру -->
|
|
179
|
-
<div class="
|
|
180
|
+
<div class="z-20 flex size-20 items-center justify-center rounded-full bg-(--bg-color) shadow-[0_0_15px_rgb(0_0_0_/0.25)]">
|
|
180
181
|
<button
|
|
181
|
-
class="flex size-
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
class="flex size-17 cursor-pointer rounded-full p-2 origin-center active:scale-95
|
|
183
|
+
[&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full"
|
|
184
|
+
style="background: {!isHomeButton && value[3] == 1 ? 'color-mix(in srgb, var(--bg-color), var(--shadow-color) 10%)' : 'var(--bg-color)'}"
|
|
185
|
+
onmouseenter={(e) => {
|
|
186
|
+
if (isHomeButton) e.currentTarget.style.backgroundColor = "color-mix(in srgb, var(--bg-color), var(--shadow-color) 20%)"
|
|
187
|
+
}}
|
|
188
|
+
onmouseleave={(e) => {
|
|
189
|
+
if (isHomeButton) e.currentTarget.style.backgroundColor = "var(--bg-color)"
|
|
190
|
+
}}
|
|
191
|
+
onclick={() => (isHomeButton ? (value = [0, 0, 0]) : (value[3] = value[3] == 0 ? 1 : 0))}
|
|
184
192
|
>
|
|
185
193
|
{#if buttonIcon}
|
|
186
194
|
{#if typeof buttonIcon === "string"}
|
|
@@ -190,7 +198,7 @@
|
|
|
190
198
|
<IconComponent />
|
|
191
199
|
{/if}
|
|
192
200
|
{:else}
|
|
193
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
|
201
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"
|
|
194
202
|
><path
|
|
195
203
|
fill="currentColor"
|
|
196
204
|
d="M6 19h3v-5q0-.425.288-.712T10 13h4q.425 0 .713.288T15 14v5h3v-9l-6-4.5L6 10zm-2 0v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-4q-.425 0-.712-.288T13 20v-5h-2v5q0 .425-.288.713T10 21H6q-.825 0-1.412-.587T4 19m8-6.75"
|
|
@@ -201,7 +209,7 @@
|
|
|
201
209
|
</div>
|
|
202
210
|
</div>
|
|
203
211
|
<!-- Боковые кнопки (ось roll) -->
|
|
204
|
-
{#if axes.
|
|
212
|
+
{#if axes[1].name !== ""}
|
|
205
213
|
<div
|
|
206
214
|
class="absolute flex h-15 w-65 items-center justify-between rounded-full shadow-[0_0_15px_rgb(0_0_0_/0.25)]"
|
|
207
215
|
style="background: color-mix(in srgb, var(--bg-color), var(--shadow-color) 10%)"
|
|
@@ -292,21 +300,23 @@
|
|
|
292
300
|
</div>
|
|
293
301
|
{/if}
|
|
294
302
|
|
|
295
|
-
<div class="flex justify-around">
|
|
303
|
+
<div class="flex justify-around items-end gap-2">
|
|
296
304
|
{#each axes as axe, index}
|
|
297
|
-
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
305
|
+
{#if axe.name !== "" || index !== 1}
|
|
306
|
+
<div>
|
|
307
|
+
<h5 class="px-2 text-center">{axe.name}</h5>
|
|
308
|
+
<input
|
|
309
|
+
class={`w-20 rounded-2xl border border-(--border-color) px-4 py-1 text-center transition-all duration-300 outline-none
|
|
301
310
|
hover:shadow-md
|
|
302
311
|
[&::-webkit-inner-spin-button]:hidden
|
|
303
312
|
[&::-webkit-outer-spin-button]:hidden`}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
313
|
+
style="background: color-mix(in srgb, var(--bg-color), var(--back-color) 70%);"
|
|
314
|
+
value={value[index]}
|
|
315
|
+
id={`${id}-${crypto.randomUUID().slice(0, 6)}`}
|
|
316
|
+
readonly
|
|
317
|
+
/>
|
|
318
|
+
</div>
|
|
319
|
+
{/if}
|
|
310
320
|
{/each}
|
|
311
321
|
</div>
|
|
312
322
|
</div>
|
|
@@ -3,12 +3,8 @@
|
|
|
3
3
|
import { t } from "../locales/i18n"
|
|
4
4
|
import { type UIComponent, type IGraphProps, updateProperty, type IOption, type IUIComponentHandler } from "../types"
|
|
5
5
|
import * as UI from ".."
|
|
6
|
-
import Modal from "../Modal.svelte"
|
|
7
6
|
import { ICONS } from "../icons"
|
|
8
|
-
import Button from "../Button/Button.svelte"
|
|
9
|
-
import CrossIcon from "../libIcons/CrossIcon.svelte"
|
|
10
7
|
import { optionsStore } from "../options"
|
|
11
|
-
import { twMerge } from "tailwind-merge"
|
|
12
8
|
import CommonSnippets from "../CommonSnippets.svelte"
|
|
13
9
|
|
|
14
10
|
const {
|
|
@@ -21,8 +17,6 @@
|
|
|
21
17
|
forConstructor?: boolean
|
|
22
18
|
}>()
|
|
23
19
|
|
|
24
|
-
let showIconLib = $state(false)
|
|
25
|
-
|
|
26
20
|
const DeviceVariables = getContext<{ id: string; value: string; name: string }[]>("DeviceVariables")
|
|
27
21
|
let VARIABLE_OPTIONS = $derived(DeviceVariables && Array.isArray(DeviceVariables) ? DeviceVariables : [])
|
|
28
22
|
|
|
@@ -39,56 +33,43 @@
|
|
|
39
33
|
)
|
|
40
34
|
</script>
|
|
41
35
|
|
|
42
|
-
{#snippet JoystickAxesNames()}
|
|
43
|
-
<UI.Input
|
|
44
|
-
label={{ name: $t("constructor.props.joystick.axes") }}
|
|
45
|
-
value={component.properties.axes.map((axe: any) => axe.name).join(" ")}
|
|
46
|
-
help={{ info: $t("constructor.props.joystick.axes.info"), regExp: /^[\p{L}0-9\-_":{}]+ +[\p{L}0-9\-_":{}]+(?: +[\p{L}0-9\-_":{}]+)?$/u }}
|
|
47
|
-
maxlength={100}
|
|
48
|
-
onUpdate={(value) => {
|
|
49
|
-
const stringValue = value as string
|
|
50
|
-
const spaceCount = (stringValue.match(/\s/g) || []).length
|
|
51
|
-
if (spaceCount > 2) {
|
|
52
|
-
return
|
|
53
|
-
}
|
|
54
|
-
const parts = stringValue.trim().split(/\s+/)
|
|
55
|
-
updateProperty(
|
|
56
|
-
"axes",
|
|
57
|
-
parts.map((a: any, index: number) => {
|
|
58
|
-
let axeIndex = parts.length == 2 && component.properties.axes.length === 3 ? index + 1 : index
|
|
59
|
-
return {
|
|
60
|
-
name: a,
|
|
61
|
-
minNum: component.properties.axes[axeIndex] ? component.properties.axes[axeIndex].minNum : -100,
|
|
62
|
-
maxNum: component.properties.axes[axeIndex] ? component.properties.axes[axeIndex].maxNum : 100,
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
65
|
-
component,
|
|
66
|
-
onPropertyChange,
|
|
67
|
-
)
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
{/snippet}
|
|
71
|
-
|
|
72
36
|
{#snippet JoystickAxesMinMax()}
|
|
73
37
|
<div class="mt-2 flex w-full justify-around gap-2">
|
|
74
38
|
{#each component.properties.axes as axe, index}
|
|
75
|
-
|
|
76
|
-
|
|
39
|
+
{@const axesOptions = [
|
|
40
|
+
{ name: $t("constructor.props.joystick.pitch.axe"), info: "", regExp: /^[\p{L}0-9\-_"':{}]+$/u },
|
|
41
|
+
{ name: $t("constructor.props.joystick.roll.axe"), info: $t("constructor.props.joystick.axes.info"), regExp: /^[\p{L}0-9\-_"':{}]*$/u },
|
|
42
|
+
{ name: $t("constructor.props.joystick.yaw.axe"), info: "", regExp: /^[\p{L}0-9\-_"':{}]+$/u },
|
|
43
|
+
]}
|
|
44
|
+
<div class="flex flex-col gap-1">
|
|
45
|
+
<UI.Input
|
|
46
|
+
label={{ name: axesOptions[index].name }}
|
|
47
|
+
value={component.properties.axes[index].name}
|
|
48
|
+
help={{ info: axesOptions[index].info, regExp: axesOptions[index].regExp }}
|
|
49
|
+
maxlength={20}
|
|
50
|
+
onUpdate={(value) => {
|
|
51
|
+
updateProperty(
|
|
52
|
+
"axes",
|
|
53
|
+
component.properties.axes.map((a: any, i: number) => (i === index ? { ...a, name: value } : a)),
|
|
54
|
+
component,
|
|
55
|
+
onPropertyChange,
|
|
56
|
+
)
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
|
|
77
60
|
<UI.Slider
|
|
78
61
|
type="range"
|
|
79
62
|
number={{ minNum: -360, maxNum: 360, step: 10 }}
|
|
63
|
+
disabled={index == 1 && axe.name == ""}
|
|
80
64
|
value={[component.properties.axes[index].minNum, component.properties.axes[index].maxNum]}
|
|
81
65
|
onUpdate={(value) => {
|
|
82
|
-
if (Array.isArray(value))
|
|
83
|
-
const axes = component.properties.axes
|
|
84
|
-
|
|
66
|
+
if (Array.isArray(value))
|
|
85
67
|
updateProperty(
|
|
86
68
|
"axes",
|
|
87
|
-
axes.map((a: any, i: number) => (i === index ? { ...a, minNum: value[0], maxNum: value[1] } : a)),
|
|
69
|
+
component.properties.axes.map((a: any, i: number) => (i === index ? { ...a, minNum: value[0], maxNum: value[1] } : a)),
|
|
88
70
|
component,
|
|
89
71
|
onPropertyChange,
|
|
90
72
|
)
|
|
91
|
-
}
|
|
92
73
|
}}
|
|
93
74
|
/>
|
|
94
75
|
</div>
|
|
@@ -96,6 +77,16 @@
|
|
|
96
77
|
</div>
|
|
97
78
|
{/snippet}
|
|
98
79
|
|
|
80
|
+
{#snippet JoystickHomeButton()}
|
|
81
|
+
<UI.Switch
|
|
82
|
+
label={{ name: $t("constructor.props.joystick.homebutton") }}
|
|
83
|
+
value={component.properties.isHomeButton}
|
|
84
|
+
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
85
|
+
onChange={(value) => {
|
|
86
|
+
updateProperty("isHomeButton", value, component, onPropertyChange)
|
|
87
|
+
}}
|
|
88
|
+
/>{/snippet}
|
|
89
|
+
|
|
99
90
|
{#if forConstructor}
|
|
100
91
|
<div>
|
|
101
92
|
<div class="relative flex flex-row items-start justify-center">
|
|
@@ -107,6 +98,7 @@
|
|
|
107
98
|
<div class="flex w-1/3 flex-col px-2">
|
|
108
99
|
<CommonSnippets snippet="Label" {component} {onPropertyChange} />
|
|
109
100
|
<CommonSnippets snippet="LabelAlign" initialValue={initialAlign} {component} {onPropertyChange} />
|
|
101
|
+
{@render JoystickHomeButton()}
|
|
110
102
|
</div>
|
|
111
103
|
<div class="flex w-1/3 flex-col px-2">
|
|
112
104
|
<CommonSnippets
|
|
@@ -120,7 +112,6 @@
|
|
|
120
112
|
{component}
|
|
121
113
|
{onPropertyChange}
|
|
122
114
|
/>
|
|
123
|
-
{@render JoystickAxesNames()}
|
|
124
115
|
<CommonSnippets snippet="Colors" initialValue={{ color: initialColor }} {component} {onPropertyChange} />
|
|
125
116
|
</div>
|
|
126
117
|
</div>
|
|
@@ -137,6 +128,7 @@
|
|
|
137
128
|
<div class="flex w-1/3 flex-col px-2">
|
|
138
129
|
<CommonSnippets snippet="Label" {component} {onPropertyChange} />
|
|
139
130
|
<CommonSnippets snippet="LabelClass" {component} {onPropertyChange} />
|
|
131
|
+
{@render JoystickHomeButton()}
|
|
140
132
|
</div>
|
|
141
133
|
<div class="flex w-1/3 flex-col px-2">
|
|
142
134
|
<CommonSnippets
|
|
@@ -150,7 +142,6 @@
|
|
|
150
142
|
{component}
|
|
151
143
|
{onPropertyChange}
|
|
152
144
|
/>
|
|
153
|
-
{@render JoystickAxesNames()}
|
|
154
145
|
<CommonSnippets snippet="Colors" initialValue={{ color: initialColor }} {component} {onPropertyChange} />
|
|
155
146
|
</div>
|
|
156
147
|
</div>
|
package/dist/Modal.svelte
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
onCancel?: () => void
|
|
25
25
|
} = $props()
|
|
26
26
|
|
|
27
|
+
let modalWrapper: HTMLDivElement | null = $state(null)
|
|
28
|
+
|
|
27
29
|
const handleKeyDown = (event: KeyboardEvent) => {
|
|
28
30
|
if (event.key === "Escape") {
|
|
29
31
|
isOpen = false
|
|
@@ -31,15 +33,27 @@
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
37
|
+
if (modalWrapper && !modalWrapper.contains(event.target as Node)) {
|
|
38
|
+
isOpen = false
|
|
39
|
+
onCancel()
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
34
43
|
onMount(() => {
|
|
35
44
|
document.addEventListener("keydown", handleKeyDown)
|
|
36
|
-
|
|
45
|
+
document.addEventListener("mousedown", handleClickOutside)
|
|
46
|
+
return () => {
|
|
47
|
+
document.removeEventListener("keydown", handleKeyDown)
|
|
48
|
+
document.removeEventListener("mousedown", handleClickOutside)
|
|
49
|
+
}
|
|
37
50
|
})
|
|
38
51
|
</script>
|
|
39
52
|
|
|
40
53
|
{#if isOpen}
|
|
41
54
|
<div class="fixed inset-0 z-100 flex items-center justify-center bg-black/50" transition:fade={{ duration: 200, delay: 1 }}>
|
|
42
55
|
<div
|
|
56
|
+
bind:this={modalWrapper}
|
|
43
57
|
class={twMerge(`flex w-300 flex-col overflow-hidden rounded-2xl bg-(--back-color) text-center`, wrapperClass)}
|
|
44
58
|
style="width: {width};"
|
|
45
59
|
transition:scale={{ duration: 250, start: 0.8 }}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
id = crypto.randomUUID(),
|
|
7
|
+
wrapperClass,
|
|
7
8
|
label = { name: "", class: "" },
|
|
8
9
|
readonly = false,
|
|
9
10
|
settings = { label: "", number: { minNum: 0, maxNum: 1000, step: 1 } },
|
|
@@ -101,14 +102,14 @@
|
|
|
101
102
|
}
|
|
102
103
|
</script>
|
|
103
104
|
|
|
104
|
-
<div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class="w-full h-full p-1">
|
|
105
|
+
<div id={`${id}-${crypto.randomUUID().slice(0, 6)}`} class={twMerge("w-full h-full p-1", wrapperClass)}>
|
|
105
106
|
<div
|
|
106
107
|
class={`h-full grid grid-rows-[4fr_9fr_5fr] rounded-xl bg-(--container-color)
|
|
107
108
|
transition-shadow duration-250 p-1
|
|
108
109
|
shadow-[0_0_3px_rgb(0_0_0_/0.25)] hover:shadow-[0_0_6px_rgb(0_0_0_/0.25)]`}
|
|
109
110
|
>
|
|
110
|
-
<div class="grid gap-2 overflow-hidden items-center" style="grid-template-columns:{icons.array ? '3.5rem' : ''} 1fr;">
|
|
111
|
-
{#if icons.array}
|
|
111
|
+
<div class="grid gap-2 overflow-hidden items-center" style="grid-template-columns:{icons.array && icons.array.length !== 0 ? '3.5rem' : ''} 1fr;">
|
|
112
|
+
{#if icons.array && icons.array.length !== 0}
|
|
112
113
|
<div class="size-14 p-0.5 [&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full {icons.class}">
|
|
113
114
|
{@html currentImage}
|
|
114
115
|
</div>
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
<span class="text-5xl">{currentValue === 0 ? (settings.switch?.captionLeft ?? "Off") : (settings.switch?.captionRight ?? "On")}</span>
|
|
128
129
|
{/if}
|
|
129
130
|
</div>
|
|
130
|
-
<div class="px-2">
|
|
131
|
+
<div class="flex flex-col items-center justify-center px-2">
|
|
131
132
|
{#if settings.label}
|
|
132
133
|
<h5>{settings.label}</h5>
|
|
133
134
|
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts"></script>
|
|
2
|
+
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 16 16"
|
|
4
|
+
><path
|
|
5
|
+
fill="currentColor"
|
|
6
|
+
d="M1 3.25C1 2.56 1.56 2 2.249 2h.5c.69 0 1.248.56 1.248 1.25v9.495c0 .69-.559 1.25-1.248 1.25h-.5A1.25 1.25 0 0 1 1 12.744zM2.249 3a.25.25 0 0 0-.25.25v9.495c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25V3.249a.25.25 0 0 0-.25-.25zm2.748.25c0-.69.559-1.25 1.249-1.25h.5c.689 0 1.248.56 1.248 1.25v9.495c0 .69-.56 1.25-1.249 1.25h-.5a1.25 1.25 0 0 1-1.248-1.25zM6.246 3a.25.25 0 0 0-.25.25v9.495c0 .138.112.25.25.25h.5a.25.25 0 0 0 .249-.25V3.249a.25.25 0 0 0-.25-.25zm5.726 1.777a1.25 1.25 0 0 0-1.57-.713l-.583.204a1.25 1.25 0 0 0-.746 1.645l2.937 7.304c.249.62.94.933 1.571.713l.582-.204a1.25 1.25 0 0 0 .746-1.646zm-1.24.23a.25.25 0 0 1 .313.143l2.937 7.303a.25.25 0 0 1-.149.33l-.582.203a.25.25 0 0 1-.314-.142L10 5.54a.25.25 0 0 1 .149-.329z"
|
|
7
|
+
/></svg
|
|
8
|
+
>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Library: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Library = InstanceType<typeof Library>;
|
|
18
|
+
export default Library;
|
|
@@ -98,7 +98,19 @@ const translations = {
|
|
|
98
98
|
"constructor.props.autocomplete": "Автозаполнение",
|
|
99
99
|
"constructor.props.maxlength": "Максимальная длина",
|
|
100
100
|
"constructor.props.regexp": "Выражение валидации",
|
|
101
|
-
"constructor.props.regexp.info": "
|
|
101
|
+
"constructor.props.regexp.library.info": "Библиотека выражений",
|
|
102
|
+
"constructor.props.regexp.latin10": "Строка латинских символов с максимальной длиной 10",
|
|
103
|
+
"constructor.props.regexp.kiril10": "Строка букв русского алфавита с максимальной длиной 10",
|
|
104
|
+
"constructor.props.regexp.ipv4": "IPv4",
|
|
105
|
+
"constructor.props.regexp.ipv6": "IPv6",
|
|
106
|
+
"constructor.props.regexp.date": "Дата в формате ДД.ММ.ГГГГ",
|
|
107
|
+
"constructor.props.regexp.time": "Время (24-часовой формат)",
|
|
108
|
+
"constructor.props.regexp.email": "Электронная почта",
|
|
109
|
+
"constructor.props.regexp.url": "URL",
|
|
110
|
+
"constructor.props.regexp.numbers": "Целые числа и числа с плавающей точкой (разделитель точка)",
|
|
111
|
+
"constructor.props.regexp.colorhex": "Цвет HEX",
|
|
112
|
+
"constructor.props.regexp.devid": "ID устройства",
|
|
113
|
+
"constructor.props.regexp.serialnum": "Серийный номер устройства",
|
|
102
114
|
"constructor.props.min": "Мин.",
|
|
103
115
|
"constructor.props.max": "Макс.",
|
|
104
116
|
"constructor.props.units": "Единица измерения",
|
|
@@ -142,8 +154,11 @@ const translations = {
|
|
|
142
154
|
"constructor.props.multiselect": "Мультивыбор",
|
|
143
155
|
"constructor.props.access": "Доступ (не для владельца)",
|
|
144
156
|
"constructor.props.map.timeout": "Таймаут маркеров:",
|
|
145
|
-
"constructor.props.joystick.
|
|
146
|
-
"constructor.props.joystick.
|
|
157
|
+
"constructor.props.joystick.pitch.axe": "Ocь ⮃",
|
|
158
|
+
"constructor.props.joystick.roll.axe": "Ось ↶ ↷",
|
|
159
|
+
"constructor.props.joystick.yaw.axe": "Ось ⮂",
|
|
160
|
+
"constructor.props.joystick.axes.info": "Если поле пустое - ось не видна",
|
|
161
|
+
"constructor.props.joystick.homebutton": "Центральная кнопка сброса",
|
|
147
162
|
"constructor.props.file.select": "Выберите файл",
|
|
148
163
|
"constructor.props.file.notselected": "Файл не выбран",
|
|
149
164
|
"constructor.props.map.loading": "Загрузка карты...",
|
package/dist/options.d.ts
CHANGED
|
@@ -155,6 +155,11 @@ export declare const optionsStore: import("svelte/store").Readable<{
|
|
|
155
155
|
value: string;
|
|
156
156
|
name: string;
|
|
157
157
|
}[];
|
|
158
|
+
INPUT_REGEXP_OPTIONS: {
|
|
159
|
+
id: string;
|
|
160
|
+
value: string;
|
|
161
|
+
name: string;
|
|
162
|
+
}[];
|
|
158
163
|
AUTOCOMPLETE_CONSTRUCTOR_OPTIONS: {
|
|
159
164
|
id: string;
|
|
160
165
|
value: string;
|
package/dist/options.js
CHANGED
|
@@ -199,6 +199,24 @@ export const optionsStore = derived(t, ($t) => {
|
|
|
199
199
|
{ id: id(), value: "slider", name: $t("constructor.props.slider") },
|
|
200
200
|
{ id: id(), value: "switch", name: $t("constructor.props.switch") },
|
|
201
201
|
],
|
|
202
|
+
INPUT_REGEXP_OPTIONS: [
|
|
203
|
+
{ id: id(), value: "/^[0-9a-z]{0,10}$/", name: $t("constructor.props.regexp.latin10") },
|
|
204
|
+
{ id: id(), value: "/^[а-яА-яЁё]{0,10}$/", name: $t("constructor.props.regexp.kiril10") },
|
|
205
|
+
{
|
|
206
|
+
id: id(),
|
|
207
|
+
value: "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/",
|
|
208
|
+
name: $t("constructor.props.regexp.ipv4"),
|
|
209
|
+
},
|
|
210
|
+
{ id: id(), value: "/((^|:)([0-9a-fA-F]{0,4})){1,8}$/", name: $t("constructor.props.regexp.ipv6") },
|
|
211
|
+
{ id: id(), value: "/(0[1-9]|[12][0-9]|3[01])[.](0[1-9]|1[012])[.](19|20)\\d\\d/", name: $t("constructor.props.regexp.date") },
|
|
212
|
+
{ id: id(), value: "/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/", name: $t("constructor.props.regexp.time") },
|
|
213
|
+
{ id: id(), value: "/^[a-zA-Z0-9.!#$%&'*+/=?^_{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)\\*$/", name: $t("constructor.props.regexp.email") },
|
|
214
|
+
{ id: id(), value: "/(https?):((//)|(\\\\))+[\\w\\d:#@%/$()~_?\\+-=\\\\\\.&]*/", name: $t("constructor.props.regexp.url") },
|
|
215
|
+
{ id: id(), value: "/^-?\\d+(\\.\\d+)?$/", name: $t("constructor.props.regexp.numbers") },
|
|
216
|
+
{ id: id(), value: "/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/", name: $t("constructor.props.regexp.colorhex") },
|
|
217
|
+
{ id: id(), value: "/^[0-9A-F]{0,4}$/", name: $t("constructor.props.regexp.devid") },
|
|
218
|
+
{ id: id(), value: "/^[0-9a-fA-F]{4}-[0-9a-fA-F]{24}[:][0-9a-fA-F]{2}$|^$/", name: $t("constructor.props.regexp.serialnum") },
|
|
219
|
+
],
|
|
202
220
|
AUTOCOMPLETE_CONSTRUCTOR_OPTIONS: [
|
|
203
221
|
{ id: id(), value: "on", name: $t("constructor.props.autocomplete.on") },
|
|
204
222
|
{ id: id(), value: "off", name: $t("constructor.props.autocomplete.off") },
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
40
|
-
"@sveltejs/kit": "^2.
|
|
40
|
+
"@sveltejs/kit": "^2.57.0",
|
|
41
41
|
"@sveltejs/package": "^2.5.7",
|
|
42
42
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
43
43
|
"@tailwindcss/vite": "^4.2.2",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"prettier-plugin-svelte": "^3.5.1",
|
|
48
48
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
49
49
|
"publint": "^0.3.18",
|
|
50
|
-
"svelte": "^5.55.
|
|
50
|
+
"svelte": "^5.55.2",
|
|
51
51
|
"tailwindcss": "^4.2.2",
|
|
52
52
|
"tsx": "^4.21.0",
|
|
53
53
|
"typescript": "^6.0.2",
|
|
54
|
-
"vite": "^8.0.
|
|
54
|
+
"vite": "^8.0.8",
|
|
55
55
|
"vite-plugin-compression": "^0.5.1"
|
|
56
56
|
}
|
|
57
57
|
}
|