poe-svelte-ui-lib 2.17.1 → 2.17.3
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 +3 -0
- package/dist/ArgumentSelect.svelte +23 -0
- package/dist/ArgumentSelect.svelte.d.ts +9 -0
- package/dist/Button/ButtonProps.svelte +6 -8
- package/dist/Button/README.md +1 -1
- package/dist/CommonSnippets.svelte +12 -1
- package/dist/Divider/DividerProps.svelte +4 -0
- package/dist/Graph/GraphProps.svelte +2 -0
- package/dist/InfoHint.svelte +4 -3
- package/dist/Input/InputProps.svelte +8 -1
- package/dist/Input/README.md +2 -1
- package/dist/ProgressBar/ProgressBarProps.svelte +1 -0
- package/dist/Select/README.md +1 -1
- package/dist/Select/SelectProps.svelte +9 -8
- package/dist/Slider/SliderProps.svelte +1 -0
- package/dist/Switch/SwitchProps.svelte +3 -0
- package/dist/Table/README.md +1 -1
- package/dist/Table/Table.svelte +8 -5
- package/dist/Table/TableProps.svelte +28 -13
- package/dist/Tabs/TabsProps.svelte +4 -0
- package/dist/TextField/TextFieldProps.svelte +2 -0
- package/dist/VideoViewer/VideoViewerProps.svelte +3 -0
- package/dist/Widget/WidgetProps.svelte +2 -0
- package/dist/WidgetDeviceInfo/WidgetDeviceInfoProps.svelte +12 -7
- package/dist/WidgetFileSystem/README.md +1 -1
- package/dist/WidgetFileSystem/WidgetFileSystemProps.svelte +11 -6
- package/dist/WidgetLoRa/WidgetLoRaProps.svelte +7 -1
- package/dist/WidgetMap/WidgetMapProps.svelte +11 -1
- package/dist/WidgetMap/mapWrapper/MapLibre.svelte.d.ts +1 -1
- package/dist/WidgetPFD/WidgetPFDProps.svelte +63 -9
- package/dist/WidgetRGBStrip/WidgetRGBStripProps.svelte +6 -1
- package/dist/WidgetStackInfo/README.md +1 -1
- package/dist/WidgetStackInfo/WidgetStackInfoProps.svelte +7 -3
- package/dist/WidgetWiFi/README.md +1 -1
- package/dist/WidgetWiFi/WidgetWiFiProps.svelte +19 -5
- package/dist/hints.d.ts +5 -0
- package/dist/hints.js +15 -1
- package/dist/locales/constructor.d.ts +495 -0
- package/dist/locales/constructor.js +513 -18
- package/dist/locales/translations.js +27 -27
- package/dist/options.d.ts +1 -2
- package/dist/options.js +3 -4
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import * as UI from ".."
|
|
7
7
|
import ButtonDelete from "../libIcons/ButtonDelete.svelte"
|
|
8
8
|
import ButtonAdd from "../libIcons/ButtonAdd.svelte"
|
|
9
|
-
import {
|
|
9
|
+
import { optionsStore } from "../options"
|
|
10
|
+
import ArgumentSelect from "../ArgumentSelect.svelte"
|
|
10
11
|
import { isAccentColor, type AccentColor } from "../accent"
|
|
11
12
|
import { ICONS } from "../icons"
|
|
12
13
|
import CommonSnippets from "../CommonSnippets.svelte"
|
|
@@ -113,6 +114,7 @@
|
|
|
113
114
|
{#snippet TableOutline()}
|
|
114
115
|
<UI.Switch
|
|
115
116
|
label={{ name: $T("constructor.props.outline") }}
|
|
117
|
+
help={{ info: $T("constructor.props.table.outline.info") }}
|
|
116
118
|
value={component.properties.outline ? 1 : 0}
|
|
117
119
|
onUpdate={(value) => edit.set("outline", value === 1)}
|
|
118
120
|
/>
|
|
@@ -121,6 +123,7 @@
|
|
|
121
123
|
{#snippet TableBufferSize()}
|
|
122
124
|
<UI.Select
|
|
123
125
|
label={{ name: $T("constructor.props.table.buffersize") }}
|
|
126
|
+
help={{ info: $T("constructor.props.table.buffersize.info") }}
|
|
124
127
|
type="buttons"
|
|
125
128
|
options={$optionsStore.BUFFER_SIZE_OPTIONS as UI.IOption<number>[]}
|
|
126
129
|
value={component.properties.dataBuffer?.bufferSize}
|
|
@@ -131,6 +134,7 @@
|
|
|
131
134
|
{#snippet TableVisibleRows()}
|
|
132
135
|
<UI.Select
|
|
133
136
|
label={{ name: $T("constructor.props.table.visibleRows") }}
|
|
137
|
+
help={{ info: $T("constructor.props.table.visibleRows.info") }}
|
|
134
138
|
type="buttons"
|
|
135
139
|
options={$optionsStore.VISIBLE_ROWS_OPTIONS as UI.IOption<number>[]}
|
|
136
140
|
value={component.properties.dataBuffer?.visibleRows}
|
|
@@ -181,6 +185,7 @@
|
|
|
181
185
|
<div class="py-1.5 pl-9 grid grid-cols-[minmax(5rem,7rem)_minmax(18rem,22rem)_minmax(16rem,20rem)_2rem_2rem_1fr] items-end gap-1.5">
|
|
182
186
|
<UI.Input
|
|
183
187
|
label={{ name: $T("constructor.props.table.columns.width"), class: "px-0" }}
|
|
188
|
+
help={{ info: $T("constructor.props.table.columns.width.info") }}
|
|
184
189
|
type="number"
|
|
185
190
|
accent={(component.properties.header ?? []).some((h: ITableHeader<Record<string, unknown>>) => h.width === "fit") ||
|
|
186
191
|
(component.properties.header ?? []).reduce(
|
|
@@ -194,6 +199,7 @@
|
|
|
194
199
|
/>
|
|
195
200
|
<UI.Select
|
|
196
201
|
label={{ name: $T("constructor.props.align.content") }}
|
|
202
|
+
help={{ info: $T("constructor.props.table.align.info") }}
|
|
197
203
|
type="buttons"
|
|
198
204
|
value={column.align ?? "left"}
|
|
199
205
|
options={$optionsStore.ALIGN_OPTIONS}
|
|
@@ -201,6 +207,7 @@
|
|
|
201
207
|
/>
|
|
202
208
|
<UI.Select
|
|
203
209
|
label={{ name: $T("constructor.props.table.columns.place") }}
|
|
210
|
+
help={{ info: $T("constructor.props.table.columns.place.info") }}
|
|
204
211
|
type="buttons"
|
|
205
212
|
value={column.place ?? "table"}
|
|
206
213
|
options={$optionsStore.TABLE_PLACE_OPTIONS}
|
|
@@ -278,7 +285,7 @@
|
|
|
278
285
|
wrapperClass="min-w-32 flex-1"
|
|
279
286
|
label={{ name: $T("constructor.props.table.text.key") }}
|
|
280
287
|
value={text.key}
|
|
281
|
-
help={{ regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
288
|
+
help={{ info: $T("constructor.props.table.text.key.info"), regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
282
289
|
onUpdate={(value) => {
|
|
283
290
|
updateTableHeader(
|
|
284
291
|
columnIndex,
|
|
@@ -292,6 +299,7 @@
|
|
|
292
299
|
<UI.Select
|
|
293
300
|
wrapperClass="min-w-60 flex-[2]"
|
|
294
301
|
label={{ name: $T("constructor.props.tablecolumn.settings") }}
|
|
302
|
+
help={{ info: $T("constructor.props.tablecolumn.settings.info") }}
|
|
295
303
|
type="buttons"
|
|
296
304
|
multiSelect={true}
|
|
297
305
|
value={$optionsStore.TABLE_TEXT_SETTING_OPTIONS.map((option) => option.value).filter(
|
|
@@ -308,7 +316,7 @@
|
|
|
308
316
|
wrapperClass="min-w-32 flex-1"
|
|
309
317
|
label={{ name: $T("constructor.props.table.select.key") }}
|
|
310
318
|
value={select.key}
|
|
311
|
-
help={{ regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
319
|
+
help={{ info: $T("constructor.props.table.select.key.info"), regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
312
320
|
onUpdate={(value) => {
|
|
313
321
|
updateTableHeader(
|
|
314
322
|
columnIndex,
|
|
@@ -353,6 +361,7 @@
|
|
|
353
361
|
<UI.Select
|
|
354
362
|
wrapperClass="min-w-0 flex-1"
|
|
355
363
|
label={{ name: $T("constructor.props.colors") }}
|
|
364
|
+
help={{ info: $T("constructor.props.table.button.color.info") }}
|
|
356
365
|
type="buttons"
|
|
357
366
|
options={$optionsStore.ACCENT_OPTIONS}
|
|
358
367
|
value={roleOf(button.class as string, component.properties.accent)}
|
|
@@ -370,6 +379,7 @@
|
|
|
370
379
|
<UI.Select
|
|
371
380
|
wrapperClass="min-w-56 flex-1"
|
|
372
381
|
label={{ name: $T("constructor.props.header") }}
|
|
382
|
+
help={{ info: $T("constructor.props.table.button.header.info") }}
|
|
373
383
|
type="buttons"
|
|
374
384
|
value={button.eventHandler?.Header}
|
|
375
385
|
options={$optionsStore.HEADER_OPTIONS}
|
|
@@ -378,16 +388,10 @@
|
|
|
378
388
|
updateContentProperty(columnIndex, index, "eventHandler", handler)
|
|
379
389
|
}}
|
|
380
390
|
/>
|
|
381
|
-
<
|
|
391
|
+
<ArgumentSelect
|
|
382
392
|
wrapperClass="min-w-28 flex-1"
|
|
383
|
-
label={{ name: $T("constructor.props.argument") }}
|
|
384
393
|
value={button.eventHandler?.Argument}
|
|
385
|
-
|
|
386
|
-
help={{ info: $T("constructor.props.argument.info"), regExp: ARGUMENT_REGEXP }}
|
|
387
|
-
onUpdate={(value) => {
|
|
388
|
-
const handler = { ...button.eventHandler, Argument: value as string }
|
|
389
|
-
updateContentProperty(columnIndex, index, "eventHandler", handler)
|
|
390
|
-
}}
|
|
394
|
+
onUpdate={(Argument) => updateContentProperty(columnIndex, index, "eventHandler", { ...button.eventHandler, Argument })}
|
|
391
395
|
/>
|
|
392
396
|
<UI.Input
|
|
393
397
|
wrapperClass="min-w-40 flex-[2]"
|
|
@@ -420,6 +424,7 @@
|
|
|
420
424
|
<UI.Input
|
|
421
425
|
wrapperClass="min-w-28 flex-1"
|
|
422
426
|
label={{ name: $T("constructor.props.table.hideIf.value") }}
|
|
427
|
+
help={{ info: $T("constructor.props.table.hideIf.value.info") }}
|
|
423
428
|
value={button.hideIf?.value ?? ""}
|
|
424
429
|
maxlength={64}
|
|
425
430
|
onUpdate={(value) => {
|
|
@@ -434,7 +439,7 @@
|
|
|
434
439
|
wrapperClass="min-w-28 flex-1"
|
|
435
440
|
label={{ name: $T("constructor.props.table.progressBar.key") }}
|
|
436
441
|
value={progressBar.key}
|
|
437
|
-
help={{ regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
442
|
+
help={{ info: $T("constructor.props.table.progressBar.key.info"), regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
438
443
|
onUpdate={(value) => {
|
|
439
444
|
updateTableHeader(
|
|
440
445
|
columnIndex,
|
|
@@ -448,6 +453,7 @@
|
|
|
448
453
|
<UI.Input
|
|
449
454
|
wrapperClass="min-w-20 flex-1"
|
|
450
455
|
label={{ name: $T("constructor.props.min") }}
|
|
456
|
+
help={{ info: $T("constructor.props.table.progress.min.info") }}
|
|
451
457
|
value={(progressBar?.minNum as number) ?? 0}
|
|
452
458
|
type="number"
|
|
453
459
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "minNum", value as string)}
|
|
@@ -455,6 +461,7 @@
|
|
|
455
461
|
<UI.Input
|
|
456
462
|
wrapperClass="min-w-20 flex-1"
|
|
457
463
|
label={{ name: $T("constructor.props.max") }}
|
|
464
|
+
help={{ info: $T("constructor.props.table.progress.max.info") }}
|
|
458
465
|
value={(progressBar?.maxNum as number) ?? 100}
|
|
459
466
|
type="number"
|
|
460
467
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "maxNum", value as string)}
|
|
@@ -462,6 +469,7 @@
|
|
|
462
469
|
<UI.Input
|
|
463
470
|
wrapperClass="min-w-24 flex-1"
|
|
464
471
|
label={{ name: $T("constructor.props.units") }}
|
|
472
|
+
help={{ info: $T("constructor.props.table.progress.units.info") }}
|
|
465
473
|
value={progressBar?.units}
|
|
466
474
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "units", value as string)}
|
|
467
475
|
/>
|
|
@@ -489,12 +497,14 @@
|
|
|
489
497
|
<UI.Input
|
|
490
498
|
wrapperClass="min-w-32 flex-1"
|
|
491
499
|
label={{ name: $T("constructor.props.table.columns.class") }}
|
|
500
|
+
help={{ info: $T("constructor.props.table.image.class.info") }}
|
|
492
501
|
value={image?.class}
|
|
493
502
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "class", value)}
|
|
494
503
|
/>
|
|
495
504
|
<UI.Input
|
|
496
505
|
wrapperClass="min-w-20 flex-1"
|
|
497
506
|
label={{ name: $T("constructor.props.table.columns.image.width"), class: "px-0" }}
|
|
507
|
+
help={{ info: $T("constructor.props.table.image.width.info") }}
|
|
498
508
|
type="number"
|
|
499
509
|
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
500
510
|
value={Number(image?.width?.replace("rem", "") ?? 0)}
|
|
@@ -503,6 +513,7 @@
|
|
|
503
513
|
<UI.Input
|
|
504
514
|
wrapperClass="min-w-20 flex-1"
|
|
505
515
|
label={{ name: $T("constructor.props.table.columns.image.height"), class: "px-0" }}
|
|
516
|
+
help={{ info: $T("constructor.props.table.image.height.info") }}
|
|
506
517
|
type="number"
|
|
507
518
|
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
508
519
|
value={Number(image?.height?.replace("rem", "") ?? 0)}
|
|
@@ -511,8 +522,9 @@
|
|
|
511
522
|
</div>
|
|
512
523
|
{/if}
|
|
513
524
|
</div>
|
|
525
|
+
<!-- Удаление - по низу полей, а не по центру блока с подписями -->
|
|
514
526
|
<UI.Button
|
|
515
|
-
wrapperClass="w-8 shrink-0"
|
|
527
|
+
wrapperClass="w-8 shrink-0 self-end"
|
|
516
528
|
variant="primary"
|
|
517
529
|
accent="red"
|
|
518
530
|
content={{ icon: ButtonDelete }}
|
|
@@ -542,6 +554,7 @@
|
|
|
542
554
|
{#snippet TableStashData()}
|
|
543
555
|
<UI.Switch
|
|
544
556
|
label={{ name: $T("constructor.props.table.stashData") }}
|
|
557
|
+
help={{ info: $T("constructor.props.table.stashData.info") }}
|
|
545
558
|
value={component.properties.dataBuffer?.stashData ? 1 : 0}
|
|
546
559
|
onUpdate={(value) => edit.patch("dataBuffer", value === 1 ? { stashData: true } : { stashData: false, clearButton: false, logger: false })}
|
|
547
560
|
/>
|
|
@@ -552,6 +565,7 @@
|
|
|
552
565
|
label={{
|
|
553
566
|
name: $T("constructor.props.table.clearButton"),
|
|
554
567
|
}}
|
|
568
|
+
help={{ info: $T("constructor.props.table.clearButton.info") }}
|
|
555
569
|
value={component.properties.dataBuffer?.clearButton ? 1 : 0}
|
|
556
570
|
disabled={!component.properties.dataBuffer?.stashData}
|
|
557
571
|
onUpdate={(value) => edit.patch("dataBuffer", { clearButton: value === 1 })}
|
|
@@ -561,6 +575,7 @@
|
|
|
561
575
|
{#snippet TableLogger()}
|
|
562
576
|
<UI.Switch
|
|
563
577
|
label={{ name: $T("constructor.props.table.logger"), captionLeft: $T("constructor.props.info.bottom"), captionRight: $T("constructor.props.info.top") }}
|
|
578
|
+
help={{ info: $T("constructor.props.table.logger.info") }}
|
|
564
579
|
value={component.properties.dataBuffer?.logger ? 1 : 0}
|
|
565
580
|
disabled={!component.properties.dataBuffer?.stashData}
|
|
566
581
|
onUpdate={(value) => edit.patch("dataBuffer", { logger: value === 1 })}
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
<PropsGroup label={$T("constructor.props.group.appearance")}>
|
|
59
59
|
<UI.Select
|
|
60
60
|
label={{ name: $T("constructor.props.orientation") }}
|
|
61
|
+
help={{ info: $T("constructor.props.tabs.orientation.info") }}
|
|
61
62
|
type="buttons"
|
|
62
63
|
options={$optionsStore.ORIENTATION_OPTIONS}
|
|
63
64
|
value={component.properties.orientation ?? "horizontal"}
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
<UI.Select
|
|
67
68
|
wrapperClass="h-14"
|
|
68
69
|
label={{ name: $T("constructor.props.icon.text.position") }}
|
|
70
|
+
help={{ info: $T("constructor.props.tabs.iconpos.info") }}
|
|
69
71
|
type="buttons"
|
|
70
72
|
options={$optionsStore.ICON_TEXT_POSITION_OPTIONS}
|
|
71
73
|
value={position}
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
/>
|
|
74
76
|
<UI.Switch
|
|
75
77
|
label={{ name: $T("constructor.props.widthMode"), captionLeft: $T("constructor.props.height.small"), captionRight: $T("constructor.props.equal") }}
|
|
78
|
+
help={{ info: $T("constructor.props.tabs.widthMode.info") }}
|
|
76
79
|
value={equalWidth ? 1 : 0}
|
|
77
80
|
onUpdate={(value) => setItems(items, value === 1)}
|
|
78
81
|
/>
|
|
@@ -126,6 +129,7 @@
|
|
|
126
129
|
<UI.Switch
|
|
127
130
|
wrapperClass="w-auto"
|
|
128
131
|
label={{ captionRight: $T("constructor.props.disabled") }}
|
|
132
|
+
help={{ info: $T("constructor.props.tabs.tab.disabled.info") }}
|
|
129
133
|
value={tab.disabled ? 1 : 0}
|
|
130
134
|
onUpdate={(value) => edit.updateItem("items", index, { disabled: value === 1 })}
|
|
131
135
|
/>
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
<PropsGroup label={$T("constructor.props.group.appearance")}>
|
|
59
59
|
<UI.Select
|
|
60
60
|
label={{ name: $T("constructor.props.size") }}
|
|
61
|
+
help={{ info: $T("constructor.props.textfield.size.info") }}
|
|
61
62
|
type="buttons"
|
|
62
63
|
value={component.properties.content?.size}
|
|
63
64
|
options={$optionsStore.TEXTFIELD_SIZE_OPTIONS}
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
/>
|
|
66
67
|
<UI.Select
|
|
67
68
|
label={{ name: $T("constructor.props.textfield.settings") }}
|
|
69
|
+
help={{ info: $T("constructor.props.textfield.settings.info") }}
|
|
68
70
|
type="buttons"
|
|
69
71
|
multiSelect
|
|
70
72
|
value={settings}
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
captionLeft: $T("constructor.props.video.viewer.source.camera"),
|
|
31
31
|
captionRight: $T("constructor.props.video.viewer.source.remote"),
|
|
32
32
|
}}
|
|
33
|
+
help={{ info: $T("constructor.props.video.source.info") }}
|
|
33
34
|
value={component.properties.source === "remote" ? 1 : 0}
|
|
34
35
|
onUpdate={(value) => edit.set("source", value === 1 ? "remote" : "camera")}
|
|
35
36
|
/>
|
|
@@ -37,12 +38,14 @@
|
|
|
37
38
|
<PropsGroup label={$T("constructor.props.group.appearance")}>
|
|
38
39
|
<UI.Switch
|
|
39
40
|
label={{ name: $T("constructor.props.showSelect") }}
|
|
41
|
+
help={{ info: $T("constructor.props.video.showSelect.info") }}
|
|
40
42
|
value={component.properties.showSelect ? 1 : 0}
|
|
41
43
|
onUpdate={(value) => edit.set("showSelect", value === 1)}
|
|
42
44
|
/>
|
|
43
45
|
{#if component.properties.source === "remote"}
|
|
44
46
|
<UI.Input
|
|
45
47
|
label={{ name: $T("constructor.props.video.viewer.stream.key") }}
|
|
48
|
+
help={{ info: $T("constructor.props.video.streamKey.info") }}
|
|
46
49
|
value={component.properties.streamKey ?? ""}
|
|
47
50
|
onUpdate={(value) => edit.set("streamKey", String(value))}
|
|
48
51
|
/>
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
/>
|
|
45
45
|
<UI.Switch
|
|
46
46
|
label={{ name: $T("constructor.props.widget.mode") }}
|
|
47
|
+
help={{ info: $T("constructor.props.widget.cycling.info") }}
|
|
47
48
|
value={component.properties.icons?.cycling ? 1 : 0}
|
|
48
49
|
onUpdate={(value) => edit.set("icons", { array: [], ...component.properties.icons, cycling: value === 1 })}
|
|
49
50
|
/>
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
<CommonSnippets snippet="Accent" initialValue={{ exclude: [""] }} {component} {onPropertyChange} />
|
|
53
54
|
<UI.Select
|
|
54
55
|
label={{ name: $T("constructor.props.settings.type") }}
|
|
56
|
+
help={{ info: $T("constructor.props.widget.settings.type.info") }}
|
|
55
57
|
type="buttons"
|
|
56
58
|
options={$optionsStore.WIDGET_TYPE_OPTIONS}
|
|
57
59
|
value={settings?.type}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import { createPropsEditor, type PropertyChange } from "../propsEditor"
|
|
9
9
|
import PropsGroup from "../PropsGroup.svelte"
|
|
10
10
|
import CommonSnippets from "../CommonSnippets.svelte"
|
|
11
|
-
import {
|
|
11
|
+
import { optionsStore } from "../options"
|
|
12
|
+
import ArgumentSelect from "../ArgumentSelect.svelte"
|
|
12
13
|
|
|
13
14
|
const DEVICE_INFO_KEYS = Object.keys(WIDGET_FIELDS.WidgetDeviceInfo) as (keyof IWidgetDeviceInfoConfig)[]
|
|
14
15
|
|
|
@@ -56,24 +57,28 @@
|
|
|
56
57
|
{#snippet WidgetCommand(path: "restartCommand" | "resetCommand", defaultArgument: string)}
|
|
57
58
|
<UI.Select
|
|
58
59
|
label={{ name: $T("widget.common.packet_header") }}
|
|
60
|
+
help={{ info: $T("constructor.props.button.header.info") }}
|
|
59
61
|
type="buttons"
|
|
60
62
|
options={$optionsStore.HEADER_OPTIONS}
|
|
61
63
|
value={component.properties[path]?.header || "SET"}
|
|
62
64
|
onUpdate={(header) => edit.patch(path, { header })}
|
|
63
65
|
/>
|
|
64
|
-
<
|
|
65
|
-
label={
|
|
66
|
+
<ArgumentSelect
|
|
67
|
+
label={$T("widget.common.argument")}
|
|
66
68
|
value={component.properties[path]?.argument ?? defaultArgument}
|
|
67
|
-
|
|
68
|
-
help={{ info: $T("constructor.props.argument.info"), regExp: ARGUMENT_REGEXP }}
|
|
69
|
-
onUpdate={(value) => edit.patch(path, { argument: String(value) })}
|
|
69
|
+
onUpdate={(argument) => edit.patch(path, { argument })}
|
|
70
70
|
/>
|
|
71
71
|
{/snippet}
|
|
72
72
|
|
|
73
73
|
<div class="flex flex-col gap-2">
|
|
74
74
|
<PropsGroup label={$T("constructor.props.group.general")}>
|
|
75
75
|
<TextsEditor {component} {onPropertyChange} />
|
|
76
|
-
<UI.Input
|
|
76
|
+
<UI.Input
|
|
77
|
+
label={{ name: $T("widget.common.group_prefix") }}
|
|
78
|
+
help={{ info: $T("widget.common.group_prefix.info") }}
|
|
79
|
+
value={component.properties.id}
|
|
80
|
+
onUpdate={(value) => edit.set("id", value as string)}
|
|
81
|
+
/>
|
|
77
82
|
<CommonSnippets snippet="Accent" {component} {onPropertyChange} />
|
|
78
83
|
</PropsGroup>
|
|
79
84
|
<PropsGroup label={$T("widget.info.fields")}>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
|
|
147
147
|
- **Общие:** заголовок и переводы, префикс группы, мастер-цвет.
|
|
148
148
|
- **Закачка файлов:** допустимые файлы (`accept`), наибольшая длина имени (от 1 до 255, по умолчанию 31).
|
|
149
|
-
- **Устройство:** поле состояния ФС (`keys.FS`), аргумент команд (`argument
|
|
149
|
+
- **Устройство:** поле состояния ФС (`keys.FS`), аргумент команд (`argument`, выбор из словаря команд).
|
|
150
150
|
|
|
151
151
|
| Пропс | Тип | Описание |
|
|
152
152
|
| ------------------ | ---------------------------------- | ----------------------------------------------------- |
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { UIComponent, IWidgetFileSystemProps } from "../types"
|
|
7
7
|
import { createPropsEditor, type PropertyChange } from "../propsEditor"
|
|
8
8
|
import PropsGroup from "../PropsGroup.svelte"
|
|
9
|
+
import ArgumentSelect from "../ArgumentSelect.svelte"
|
|
9
10
|
import CommonSnippets from "../CommonSnippets.svelte"
|
|
10
11
|
|
|
11
12
|
const {
|
|
@@ -22,18 +23,25 @@
|
|
|
22
23
|
<div class="flex flex-col gap-2">
|
|
23
24
|
<PropsGroup label={$T("constructor.props.group.general")}>
|
|
24
25
|
<TextsEditor {component} {onPropertyChange} />
|
|
25
|
-
<UI.Input
|
|
26
|
+
<UI.Input
|
|
27
|
+
label={{ name: $T("widget.common.group_prefix") }}
|
|
28
|
+
help={{ info: $T("widget.common.group_prefix.info") }}
|
|
29
|
+
value={component.properties.id}
|
|
30
|
+
onUpdate={(value) => edit.set("id", value as string)}
|
|
31
|
+
/>
|
|
26
32
|
<CommonSnippets snippet="Accent" {component} {onPropertyChange} />
|
|
27
33
|
</PropsGroup>
|
|
28
34
|
<PropsGroup label={$T("widget.fs.upload_group")}>
|
|
29
35
|
<UI.Input
|
|
30
36
|
label={{ name: $T("widget.fs.accept") }}
|
|
37
|
+
help={{ info: $T("widget.fs.accept.info") }}
|
|
31
38
|
value={component.properties.accept ?? "*/*"}
|
|
32
39
|
placeholder=".bin, .txt, .pem"
|
|
33
40
|
onUpdate={(value) => edit.set("accept", value as string)}
|
|
34
41
|
/>
|
|
35
42
|
<UI.Input
|
|
36
43
|
label={{ name: $T("widget.fs.max_name") }}
|
|
44
|
+
help={{ info: $T("widget.fs.max_name.info") }}
|
|
37
45
|
type="number"
|
|
38
46
|
number={{ minNum: 1, maxNum: 255, step: 1 }}
|
|
39
47
|
value={component.properties.maxNameLength ?? 31}
|
|
@@ -43,13 +51,10 @@
|
|
|
43
51
|
<PropsGroup label={$T("widget.common.device")}>
|
|
44
52
|
<UI.Input
|
|
45
53
|
label={{ name: $T("widget.fs.state_field") }}
|
|
54
|
+
help={{ info: $T("widget.fs.state_field.info") }}
|
|
46
55
|
value={component.properties.keys?.FS ?? "FS"}
|
|
47
56
|
onUpdate={(value) => edit.patch("keys", { FS: value as string })}
|
|
48
57
|
/>
|
|
49
|
-
<
|
|
50
|
-
label={{ name: $T("widget.fs.command_arg") }}
|
|
51
|
-
value={component.properties.argument ?? "FS"}
|
|
52
|
-
onUpdate={(value) => edit.set("argument", value as string)}
|
|
53
|
-
/>
|
|
58
|
+
<ArgumentSelect label={$T("widget.fs.command_arg")} value={component.properties.argument ?? "FS"} onUpdate={(argument) => edit.set("argument", argument)} />
|
|
54
59
|
</PropsGroup>
|
|
55
60
|
</div>
|
|
@@ -165,12 +165,18 @@
|
|
|
165
165
|
<div class="flex flex-col gap-2">
|
|
166
166
|
<PropsGroup label={$T("constructor.props.group.general")}>
|
|
167
167
|
<TextsEditor {component} {onPropertyChange} />
|
|
168
|
-
<UI.Input
|
|
168
|
+
<UI.Input
|
|
169
|
+
label={{ name: $T("widget.common.group_prefix") }}
|
|
170
|
+
help={{ info: $T("widget.common.group_prefix.info") }}
|
|
171
|
+
value={component.properties.id}
|
|
172
|
+
onUpdate={(value) => edit.set("id", value as string)}
|
|
173
|
+
/>
|
|
169
174
|
<CommonSnippets snippet="Accent" {component} {onPropertyChange} />
|
|
170
175
|
</PropsGroup>
|
|
171
176
|
<PropsGroup label={$T("widget.lora.props.params")}>
|
|
172
177
|
<UI.Select
|
|
173
178
|
label={{ name: $T("widget.lora.props.preset") }}
|
|
179
|
+
help={{ info: $T("widget.lora.props.preset.info") }}
|
|
174
180
|
type="buttons"
|
|
175
181
|
options={PRESET_OPTIONS}
|
|
176
182
|
value={component.properties.preset}
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
<PropsGroup>
|
|
46
46
|
<UI.Select
|
|
47
47
|
label={{ name: $T("widget.map.mode") }}
|
|
48
|
+
help={{ info: $T("widget.map.mode.info") }}
|
|
48
49
|
type="buttons"
|
|
49
50
|
options={MODE_OPTIONS}
|
|
50
51
|
value={component.properties.mode ?? "objects"}
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
<PropsGroup>
|
|
55
56
|
<UI.Switch
|
|
56
57
|
label={{ name: $T("constructor.props.simulation") }}
|
|
58
|
+
help={{ info: $T("widget.map.simulation.info") }}
|
|
57
59
|
value={component.properties.isTest ? 1 : 0}
|
|
58
60
|
onUpdate={(value) => edit.set("isTest", value === 1)}
|
|
59
61
|
/>
|
|
@@ -62,12 +64,18 @@
|
|
|
62
64
|
<div class={twMerge("flex flex-col gap-2 transition-opacity", component.properties.isTest && "opacity-40 grayscale")} inert={component.properties.isTest}>
|
|
63
65
|
<PropsGroup label={$T("constructor.props.group.general")}>
|
|
64
66
|
<TextsEditor {component} {onPropertyChange} />
|
|
65
|
-
<UI.Input
|
|
67
|
+
<UI.Input
|
|
68
|
+
label={{ name: $T("widget.map.groups") }}
|
|
69
|
+
help={{ info: $T("widget.map.groups.info") }}
|
|
70
|
+
value={(component.properties.groups ?? ["MAV"]).join(" ")}
|
|
71
|
+
onUpdate={setGroups}
|
|
72
|
+
/>
|
|
66
73
|
<CommonSnippets snippet="Accent" {component} {onPropertyChange} />
|
|
67
74
|
</PropsGroup>
|
|
68
75
|
<PropsGroup label={$T("constructor.props.group.appearance")}>
|
|
69
76
|
<UI.Select
|
|
70
77
|
label={{ name: $T("widget.map.height") }}
|
|
78
|
+
help={{ info: $T("widget.map.height.info") }}
|
|
71
79
|
type="buttons"
|
|
72
80
|
options={HEIGHT_OPTIONS}
|
|
73
81
|
value={component.properties.height ?? 400}
|
|
@@ -88,11 +96,13 @@
|
|
|
88
96
|
<PropsGroup label={$T("widget.map.defaults")}>
|
|
89
97
|
<UI.Switch
|
|
90
98
|
label={{ name: $T("constructor.props.map.track") }}
|
|
99
|
+
help={{ info: $T("widget.map.track.info") }}
|
|
91
100
|
value={component.properties.trackEnabled ? 1 : 0}
|
|
92
101
|
onUpdate={(value) => edit.set("trackEnabled", Boolean(value))}
|
|
93
102
|
/>
|
|
94
103
|
<UI.Select
|
|
95
104
|
label={{ name: $T("constructor.props.map.trackLength") }}
|
|
105
|
+
help={{ info: $T("widget.map.track_length.info") }}
|
|
96
106
|
type="input"
|
|
97
107
|
options={TRACK_LENGTH_OPTIONS}
|
|
98
108
|
value={component.properties.trackLength ?? 1000}
|
|
@@ -9,6 +9,6 @@ interface Props {
|
|
|
9
9
|
map?: any;
|
|
10
10
|
children?: Snippet<[any]>;
|
|
11
11
|
}
|
|
12
|
-
declare const MapLibre: import("svelte").Component<Props, {}, "map" | "
|
|
12
|
+
declare const MapLibre: import("svelte").Component<Props, {}, "map" | "center" | "zoom">;
|
|
13
13
|
type MapLibre = ReturnType<typeof MapLibre>;
|
|
14
14
|
export default MapLibre;
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
<PropsGroup>
|
|
35
35
|
<UI.Switch
|
|
36
36
|
label={{ name: $T("constructor.props.simulation") }}
|
|
37
|
+
help={{ info: $T("pfd.simulation.info") }}
|
|
37
38
|
value={component.properties.isTest ? 1 : 0}
|
|
38
39
|
onUpdate={(value) => edit.set("isTest", value === 1)}
|
|
39
40
|
/>
|
|
@@ -42,19 +43,72 @@
|
|
|
42
43
|
<div class={twMerge("flex flex-col gap-2 transition-opacity", component.properties.isTest && "opacity-40 grayscale")} inert={component.properties.isTest}>
|
|
43
44
|
<PropsGroup label={$T("constructor.props.group.general")}>
|
|
44
45
|
<TextsEditor {component} {onPropertyChange} />
|
|
45
|
-
<UI.Input
|
|
46
|
+
<UI.Input
|
|
47
|
+
label={{ name: $T("pfd.props.group") }}
|
|
48
|
+
help={{ info: $T("pfd.props.group.info") }}
|
|
49
|
+
value={component.properties.id ?? "MAV"}
|
|
50
|
+
onUpdate={(value) => edit.set("id", value as string)}
|
|
51
|
+
/>
|
|
46
52
|
<CommonSnippets snippet="Accent" {component} {onPropertyChange} />
|
|
47
53
|
</PropsGroup>
|
|
48
54
|
<PropsGroup label={$T("pfd.limits")}>
|
|
49
55
|
<div class="grid grid-cols-2 gap-2">
|
|
50
|
-
<UI.Input
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<UI.Input
|
|
56
|
+
<UI.Input
|
|
57
|
+
label={{ name: $T("pfd.props.speed_min") }}
|
|
58
|
+
help={{ info: $T("pfd.props.speed.info") }}
|
|
59
|
+
type="number"
|
|
60
|
+
value={limits.speedMin}
|
|
61
|
+
onUpdate={(v) => setLimit("speedMin", v)}
|
|
62
|
+
/>
|
|
63
|
+
<UI.Input
|
|
64
|
+
label={{ name: $T("pfd.props.speed_max") }}
|
|
65
|
+
help={{ info: $T("pfd.props.speed.info") }}
|
|
66
|
+
type="number"
|
|
67
|
+
value={limits.speedMax}
|
|
68
|
+
onUpdate={(v) => setLimit("speedMax", v)}
|
|
69
|
+
/>
|
|
70
|
+
<UI.Input
|
|
71
|
+
label={{ name: $T("pfd.props.bank_max") }}
|
|
72
|
+
help={{ info: $T("pfd.props.bank_max.info") }}
|
|
73
|
+
type="number"
|
|
74
|
+
value={limits.bankMax}
|
|
75
|
+
onUpdate={(v) => setLimit("bankMax", v)}
|
|
76
|
+
/>
|
|
77
|
+
<UI.Input
|
|
78
|
+
label={{ name: $T("pfd.props.alt_max") }}
|
|
79
|
+
help={{ info: $T("pfd.props.alt_max.info") }}
|
|
80
|
+
type="number"
|
|
81
|
+
value={limits.altMax}
|
|
82
|
+
onUpdate={(v) => setLimit("altMax", v)}
|
|
83
|
+
/>
|
|
84
|
+
<UI.Input
|
|
85
|
+
label={{ name: $T("pfd.props.g_min") }}
|
|
86
|
+
help={{ info: $T("pfd.props.g.info") }}
|
|
87
|
+
type="number"
|
|
88
|
+
value={limits.gMin}
|
|
89
|
+
onUpdate={(v) => setLimit("gMin", v)}
|
|
90
|
+
/>
|
|
91
|
+
<UI.Input
|
|
92
|
+
label={{ name: $T("pfd.props.g_max") }}
|
|
93
|
+
help={{ info: $T("pfd.props.g.info") }}
|
|
94
|
+
type="number"
|
|
95
|
+
value={limits.gMax}
|
|
96
|
+
onUpdate={(v) => setLimit("gMax", v)}
|
|
97
|
+
/>
|
|
98
|
+
<UI.Input
|
|
99
|
+
label={{ name: $T("pfd.props.batt_low") }}
|
|
100
|
+
help={{ info: $T("pfd.props.batt_low.info") }}
|
|
101
|
+
type="number"
|
|
102
|
+
value={limits.battLow}
|
|
103
|
+
onUpdate={(v) => setLimit("battLow", v)}
|
|
104
|
+
/>
|
|
105
|
+
<UI.Input
|
|
106
|
+
label={{ name: $T("pfd.props.stale") }}
|
|
107
|
+
help={{ info: $T("pfd.props.stale.info") }}
|
|
108
|
+
type="number"
|
|
109
|
+
value={limits.staleMs ?? 2000}
|
|
110
|
+
onUpdate={(v) => setLimit("staleMs", v)}
|
|
111
|
+
/>
|
|
58
112
|
</div>
|
|
59
113
|
</PropsGroup>
|
|
60
114
|
</div>
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
<div class="flex flex-col gap-2">
|
|
23
23
|
<PropsGroup label={$T("constructor.props.group.general")}>
|
|
24
24
|
<TextsEditor {component} {onPropertyChange} />
|
|
25
|
-
<UI.Input
|
|
25
|
+
<UI.Input
|
|
26
|
+
label={{ name: $T("widget.rgb.group") }}
|
|
27
|
+
help={{ info: $T("widget.rgb.group.info") }}
|
|
28
|
+
value={component.properties.id ?? "LST"}
|
|
29
|
+
onUpdate={(value) => edit.set("id", value as string)}
|
|
30
|
+
/>
|
|
26
31
|
<CommonSnippets snippet="Accent" {component} {onPropertyChange} />
|
|
27
32
|
</PropsGroup>
|
|
28
33
|
</div>
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
|
|
128
128
|
- **Общие:** заголовок и переводы, мастер-цвет.
|
|
129
129
|
- **Отображение:** порог запаса стека (0-65535 байт, шаг 64), автоопрос по умолчанию (0-60000 мс, шаг 1000, `0` - выключен).
|
|
130
|
-
- **Устройство:** имя объекта ответа (`keys.StackInfo`), аргумент запроса (`argument
|
|
130
|
+
- **Устройство:** имя объекта ответа (`keys.StackInfo`), аргумент запроса (`argument`, выбор из словаря команд).
|
|
131
131
|
|
|
132
132
|
| Пропс | Тип | Описание |
|
|
133
133
|
| ------------------ | ---------------------------------- | ----------------------------------------------------- |
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { UIComponent, IWidgetStackInfoProps } from "../types"
|
|
7
7
|
import { createPropsEditor, type PropertyChange } from "../propsEditor"
|
|
8
8
|
import PropsGroup from "../PropsGroup.svelte"
|
|
9
|
+
import ArgumentSelect from "../ArgumentSelect.svelte"
|
|
9
10
|
import CommonSnippets from "../CommonSnippets.svelte"
|
|
10
11
|
|
|
11
12
|
const {
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
<PropsGroup label={$T("widget.stack.display")}>
|
|
28
29
|
<UI.Input
|
|
29
30
|
label={{ name: $T("widget.stack.warn_bytes") }}
|
|
31
|
+
help={{ info: $T("widget.stack.warn_bytes.info") }}
|
|
30
32
|
type="number"
|
|
31
33
|
number={{ minNum: 0, maxNum: 65535, step: 64 }}
|
|
32
34
|
value={component.properties.warnBytes ?? 512}
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
/>
|
|
35
37
|
<UI.Input
|
|
36
38
|
label={{ name: $T("widget.stack.period") }}
|
|
39
|
+
help={{ info: $T("widget.stack.period.info") }}
|
|
37
40
|
type="number"
|
|
38
41
|
number={{ minNum: 0, maxNum: 60000, step: 1000 }}
|
|
39
42
|
value={component.properties.period ?? 0}
|
|
@@ -43,13 +46,14 @@
|
|
|
43
46
|
<PropsGroup label={$T("widget.common.device")}>
|
|
44
47
|
<UI.Input
|
|
45
48
|
label={{ name: $T("widget.stack.response") }}
|
|
49
|
+
help={{ info: $T("widget.stack.response.info") }}
|
|
46
50
|
value={component.properties.keys?.StackInfo ?? "StackInfo"}
|
|
47
51
|
onUpdate={(value) => edit.patch("keys", { StackInfo: value as string })}
|
|
48
52
|
/>
|
|
49
|
-
<
|
|
50
|
-
label={
|
|
53
|
+
<ArgumentSelect
|
|
54
|
+
label={$T("widget.stack.request")}
|
|
51
55
|
value={component.properties.argument ?? "StackInfo"}
|
|
52
|
-
onUpdate={(
|
|
56
|
+
onUpdate={(argument) => edit.set("argument", argument)}
|
|
53
57
|
/>
|
|
54
58
|
</PropsGroup>
|
|
55
59
|
</div>
|