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.
Files changed (43) hide show
  1. package/dist/Accordion/AccordionProps.svelte +3 -0
  2. package/dist/ArgumentSelect.svelte +23 -0
  3. package/dist/ArgumentSelect.svelte.d.ts +9 -0
  4. package/dist/Button/ButtonProps.svelte +6 -8
  5. package/dist/Button/README.md +1 -1
  6. package/dist/CommonSnippets.svelte +12 -1
  7. package/dist/Divider/DividerProps.svelte +4 -0
  8. package/dist/Graph/GraphProps.svelte +2 -0
  9. package/dist/InfoHint.svelte +4 -3
  10. package/dist/Input/InputProps.svelte +8 -1
  11. package/dist/Input/README.md +2 -1
  12. package/dist/ProgressBar/ProgressBarProps.svelte +1 -0
  13. package/dist/Select/README.md +1 -1
  14. package/dist/Select/SelectProps.svelte +9 -8
  15. package/dist/Slider/SliderProps.svelte +1 -0
  16. package/dist/Switch/SwitchProps.svelte +3 -0
  17. package/dist/Table/README.md +1 -1
  18. package/dist/Table/Table.svelte +8 -5
  19. package/dist/Table/TableProps.svelte +28 -13
  20. package/dist/Tabs/TabsProps.svelte +4 -0
  21. package/dist/TextField/TextFieldProps.svelte +2 -0
  22. package/dist/VideoViewer/VideoViewerProps.svelte +3 -0
  23. package/dist/Widget/WidgetProps.svelte +2 -0
  24. package/dist/WidgetDeviceInfo/WidgetDeviceInfoProps.svelte +12 -7
  25. package/dist/WidgetFileSystem/README.md +1 -1
  26. package/dist/WidgetFileSystem/WidgetFileSystemProps.svelte +11 -6
  27. package/dist/WidgetLoRa/WidgetLoRaProps.svelte +7 -1
  28. package/dist/WidgetMap/WidgetMapProps.svelte +11 -1
  29. package/dist/WidgetMap/mapWrapper/MapLibre.svelte.d.ts +1 -1
  30. package/dist/WidgetPFD/WidgetPFDProps.svelte +63 -9
  31. package/dist/WidgetRGBStrip/WidgetRGBStripProps.svelte +6 -1
  32. package/dist/WidgetStackInfo/README.md +1 -1
  33. package/dist/WidgetStackInfo/WidgetStackInfoProps.svelte +7 -3
  34. package/dist/WidgetWiFi/README.md +1 -1
  35. package/dist/WidgetWiFi/WidgetWiFiProps.svelte +19 -5
  36. package/dist/hints.d.ts +5 -0
  37. package/dist/hints.js +15 -1
  38. package/dist/locales/constructor.d.ts +495 -0
  39. package/dist/locales/constructor.js +513 -18
  40. package/dist/locales/translations.js +27 -27
  41. package/dist/options.d.ts +1 -2
  42. package/dist/options.js +3 -4
  43. package/package.json +1 -1
@@ -52,12 +52,14 @@
52
52
  <UI.Switch
53
53
  type="checkbox"
54
54
  label={{ name: $T("constructor.props.accordion.stripe") }}
55
+ help={{ info: $T("constructor.props.accordion.stripe.info") }}
55
56
  value={component.properties.stripe ? 1 : 0}
56
57
  onUpdate={(value) => edit.set("stripe", value === 1)}
57
58
  />
58
59
  <UI.Switch
59
60
  type="checkbox"
60
61
  label={{ name: $T("constructor.props.accordion.outline") }}
62
+ help={{ info: $T("constructor.props.accordion.outline.info") }}
61
63
  value={component.properties.outline === false ? 0 : 1}
62
64
  disabled={!!component.properties.stripe}
63
65
  onUpdate={(value) => edit.set("outline", value === 1)}
@@ -66,6 +68,7 @@
66
68
  <UI.FileAttach
67
69
  type="image"
68
70
  label={{ name: $T("constructor.props.image") }}
71
+ help={{ info: $T("constructor.props.accordion.image.info") }}
69
72
  accept="image/png, image/jpeg, image/webp"
70
73
  currentImage={component.properties.image ?? ""}
71
74
  onUpdate={setImage}
@@ -0,0 +1,23 @@
1
+ <!-- $lib/ArgumentSelect.svelte - аргумент команды в свойствах конструктора: выбор из словаря команд с поиском по имени, другое значение не сохраняется -->
2
+ <script lang="ts">
3
+ import Select from "./Select/Select.svelte"
4
+ import { T } from "./locales/i18n"
5
+ import { ARGUMENT_NAMES } from "./options"
6
+
7
+ let { value, label, wrapperClass = "", onUpdate }: { value?: string; label?: string; wrapperClass?: string; onUpdate: (argument: string) => void } = $props()
8
+
9
+ const options = ARGUMENT_NAMES.map((name) => ({ id: name, value: name, name }))
10
+ </script>
11
+
12
+ <Select
13
+ {wrapperClass}
14
+ type="input"
15
+ label={{ name: label ?? $T("constructor.props.argument") }}
16
+ help={{ info: $T("constructor.props.argument.info") }}
17
+ {value}
18
+ {options}
19
+ onUpdate={(selected) => {
20
+ const name = String(selected)
21
+ if (ARGUMENT_NAMES.includes(name)) onUpdate(name)
22
+ }}
23
+ />
@@ -0,0 +1,9 @@
1
+ type $$ComponentProps = {
2
+ value?: string;
3
+ label?: string;
4
+ wrapperClass?: string;
5
+ onUpdate: (argument: string) => void;
6
+ };
7
+ declare const ArgumentSelect: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ArgumentSelect = ReturnType<typeof ArgumentSelect>;
9
+ export default ArgumentSelect;
@@ -7,7 +7,8 @@
7
7
  import type { UIComponent, IButtonProps } from "../types"
8
8
  import { createPropsEditor, optionByClass, type PropertyChange } from "../propsEditor"
9
9
  import * as UI from ".."
10
- import { ARGUMENT_MAX_LENGTH, ARGUMENT_REGEXP, optionsStore } from "../options"
10
+ import { optionsStore } from "../options"
11
+ import ArgumentSelect from "../ArgumentSelect.svelte"
11
12
  import type { AccentColor } from "../accent"
12
13
  import { twMerge } from "tailwind-merge"
13
14
  import { ICONS } from "../icons"
@@ -59,18 +60,13 @@
59
60
  <CommonSnippets snippet="Access" {component} {onPropertyChange} />
60
61
  <UI.Select
61
62
  label={{ name: $T("constructor.props.header") }}
63
+ help={{ info: $T("constructor.props.button.header.info") }}
62
64
  type="buttons"
63
65
  value={component.eventHandler?.Header}
64
66
  options={$optionsStore.HEADER_OPTIONS}
65
67
  onUpdate={(Header) => onPropertyChange({ eventHandler: { Header } })}
66
68
  />
67
- <UI.Input
68
- label={{ name: $T("constructor.props.argument") }}
69
- value={component.eventHandler?.Argument || "ModCfg"}
70
- maxlength={ARGUMENT_MAX_LENGTH}
71
- help={{ info: $T("constructor.props.argument.info"), autocomplete: "on", regExp: ARGUMENT_REGEXP }}
72
- onUpdate={(value) => onPropertyChange({ eventHandler: { Argument: String(value) } })}
73
- />
69
+ <ArgumentSelect value={component.eventHandler?.Argument || "ModCfg"} onUpdate={(Argument) => onPropertyChange({ eventHandler: { Argument } })} />
74
70
  </PropsGroup>
75
71
  <PropsGroup label={$T("constructor.props.group.value")}>
76
72
  {#if component.eventHandler?.Argument !== "ModCfg" || component.eventHandler?.Header === "SET"}
@@ -94,6 +90,7 @@
94
90
  <UI.Button wrapperClass="w-8" content={{ icon: InfoIcon, info: { text: $T("constructor.props.button.colors.hint"), side: "right" } }} />
95
91
  <UI.Select
96
92
  label={{ name: $T("constructor.props.colors") }}
93
+ help={{ info: $T("constructor.props.button.colors.info") }}
97
94
  type="buttons"
98
95
  options={$optionsStore.ACCENT_OPTIONS}
99
96
  value={colorValue}
@@ -112,6 +109,7 @@
112
109
  {#if hasName || !properties.content?.icon}
113
110
  <UI.Select
114
111
  label={{ name: $T("constructor.props.height") }}
112
+ help={{ info: $T("constructor.props.button.height.info") }}
115
113
  type="buttons"
116
114
  options={$optionsStore.HEIGHT_OPTIONS}
117
115
  value={optionByClass($optionsStore.HEIGHT_OPTIONS, properties.componentClass)?.value}
@@ -31,7 +31,7 @@
31
31
  <details>
32
32
  <summary>📦 Что уходит на устройство</summary>
33
33
 
34
- - По нажатию уходит **Заголовок** и **Аргумент**, например `SET` и `Restart`. В конструкторе аргумент - только имя из словаря команд или `NoSend`, до 31 знака: опечатка подсвечивается и не сохраняется.
34
+ - По нажатию уходит **Заголовок** и **Аргумент**, например `SET` и `Restart`. В конструкторе аргумент выбирается из словаря команд с поиском по имени, есть и `NoSend`. Имя не из словаря не сохраняется.
35
35
  - **Переменные.** Текущие значения других компонентов кладутся в тот же пакет. Так делается кнопка «Сохранить» для полей с аргументом `NoSend`.
36
36
  - **Фиксированное значение** (JSON) отправляется как есть вместо переменных, например `{"Mode": 2}`.
37
37
  - Значение с устройства кнопка не показывает.
@@ -63,7 +63,12 @@
63
63
  </script>
64
64
 
65
65
  {#snippet Flag(name: string, key: "disabled" | "readonly")}
66
- <UI.Switch label={{ name }} value={properties[key] ? 1 : 0} onUpdate={(value) => edit.set(key, value === 1)} />
66
+ <UI.Switch
67
+ label={{ name }}
68
+ help={{ info: $T(`constructor.props.${key}.info`) }}
69
+ value={properties[key] ? 1 : 0}
70
+ onUpdate={(value) => edit.set(key, value === 1)}
71
+ />
67
72
  {/snippet}
68
73
 
69
74
  {#snippet MinMaxStep({ number, bitMode, onUpdate }: { number?: NumberRange; bitMode?: boolean; onUpdate: (number: NumberRange) => void })}
@@ -72,6 +77,7 @@
72
77
  {#if key !== "step" || (component.type !== "ProgressBar" && component.type !== "Joystick")}
73
78
  <UI.Input
74
79
  label={{ name: $T(`constructor.props.${caption}`) }}
80
+ help={{ info: $T(`constructor.props.${caption}.info`) }}
75
81
  value={number?.[key]}
76
82
  type="number"
77
83
  number={key === "step" ? { minNum: 0, maxNum: 1000000, step: 1 } : undefined}
@@ -145,6 +151,7 @@
145
151
  {#if snippet === "Variable"}
146
152
  <UI.Select
147
153
  label={{ name: $T("constructor.props.variable") }}
154
+ help={{ info: $T("constructor.props.variable.info") }}
148
155
  type="input"
149
156
  options={VARIABLE_OPTIONS}
150
157
  value={properties.id}
@@ -161,6 +168,7 @@
161
168
  {:else if snippet === "Access"}
162
169
  <UI.Select
163
170
  label={{ name: $T("constructor.props.access") }}
171
+ help={{ info: $T("constructor.props.access.info") }}
164
172
  type="buttons"
165
173
  options={["Accordion", "Tabs", "ProgressBar", "TextField", "Graph", "PeriodChart"].includes(component.type)
166
174
  ? $optionsStore.ACCESS_OPTION.filter((option) => option.value !== "viewOnly")
@@ -171,6 +179,7 @@
171
179
  {:else if snippet === "Accent"}
172
180
  <UI.Select
173
181
  label={{ name: $T("ui.accent") }}
182
+ help={{ info: $T("ui.accent.info") }}
174
183
  type="buttons"
175
184
  options={$optionsStore.ACCENT_OPTIONS.filter((option) => !initialValue?.exclude?.includes(option.value))}
176
185
  value={properties.accent}
@@ -181,6 +190,7 @@
181
190
  {:else if snippet === "LabelAlign"}
182
191
  <UI.Select
183
192
  label={{ name: $T("constructor.props.align") }}
193
+ help={{ info: $T("constructor.props.align.info") }}
184
194
  type="buttons"
185
195
  value={optionByClass(alignOptions, properties[alignKey]?.class)?.value}
186
196
  options={alignOptions}
@@ -193,6 +203,7 @@
193
203
  {:else if snippet === "EventHandlerArgument"}
194
204
  <UI.Select
195
205
  label={{ name: $T("constructor.props.action") }}
206
+ help={{ info: $T("constructor.props.action.info") }}
196
207
  type="buttons"
197
208
  value={component.eventHandler?.Argument}
198
209
  options={$optionsStore.SHORT_ARGUMENT_OPTION}
@@ -24,6 +24,7 @@
24
24
  <CommonSnippets snippet="Access" {component} {onPropertyChange} />
25
25
  <UI.Select
26
26
  label={{ name: $T("constructor.props.divider.type") }}
27
+ help={{ info: $T("constructor.props.divider.type.info") }}
27
28
  type="buttons"
28
29
  value={component.properties.type}
29
30
  options={$optionsStore.DIVIDER_TYPE_OPTIONS}
@@ -33,6 +34,7 @@
33
34
  <PropsGroup label={$T("constructor.props.group.layout")}>
34
35
  <UI.Select
35
36
  label={{ name: $T("constructor.props.orientation") }}
37
+ help={{ info: $T("constructor.props.divider.orientation.info") }}
36
38
  type="buttons"
37
39
  value={component.properties.orientation ?? "horizontal"}
38
40
  options={$optionsStore.ORIENTATION_OPTIONS}
@@ -40,6 +42,7 @@
40
42
  />
41
43
  <UI.Select
42
44
  label={{ name: $T("constructor.props.divider.anchor") }}
45
+ help={{ info: $T("constructor.props.divider.anchor.info") }}
43
46
  type="buttons"
44
47
  value={component.properties.anchor}
45
48
  options={component.properties.orientation === "vertical" ? $optionsStore.DIVIDER_ANCHOR_VERTICAL_OPTIONS : $optionsStore.DIVIDER_ANCHOR_OPTIONS}
@@ -47,6 +50,7 @@
47
50
  />
48
51
  <UI.Input
49
52
  label={{ name: $T("constructor.props.divider.width") }}
53
+ help={{ info: $T("constructor.props.divider.width.info") }}
50
54
  value={component.properties.width}
51
55
  onUpdate={(value) => edit.set("width", Number(value))}
52
56
  number={{ minNum: 1, maxNum: 20, step: 1 }}
@@ -26,6 +26,7 @@
26
26
  <PropsGroup>
27
27
  <UI.Switch
28
28
  label={{ name: $T("constructor.props.simulation") }}
29
+ help={{ info: $T("constructor.props.graph.simulation.info") }}
29
30
  value={component.properties.isTest ? 1 : 0}
30
31
  onUpdate={(value) => edit.set("isTest", value === 1)}
31
32
  />
@@ -43,6 +44,7 @@
43
44
  <PropsGroup label={$T("constructor.props.group.behavior")}>
44
45
  <UI.Select
45
46
  label={{ name: $T("constructor.props.refreshrate") }}
47
+ help={{ info: $T("constructor.props.graph.refreshrate.info") }}
46
48
  options={REFRESH_OPTIONS}
47
49
  value={component.properties.refreshRate ?? 0}
48
50
  onUpdate={(refreshRate) => edit.set("refreshRate", refreshRate)}
@@ -3,6 +3,7 @@
3
3
  import { fly } from "svelte/transition"
4
4
  import InfoIcon from "./libIcons/InfoIcon.svelte"
5
5
  import { isHoverPointer, isKeyboardFocus } from "./popup"
6
+ import { hintParts, hintPlain } from "./hints"
6
7
 
7
8
  let { text }: { text: string } = $props()
8
9
 
@@ -36,7 +37,7 @@
36
37
  bind:this={anchor}
37
38
  type="button"
38
39
  class="inline-flex size-(--icon-size-sm) shrink-0 cursor-help items-center justify-center border-none bg-transparent p-0 text-(--faint-color) hover:text-(--accent-text) [&_svg]:size-full"
39
- aria-label={text}
40
+ aria-label={hintPlain(text)}
40
41
  onpointerdown={(event) => (touch = !isHoverPointer(event))}
41
42
  onclick={(event) => {
42
43
  event.preventDefault()
@@ -58,8 +59,8 @@
58
59
  transition:fly={{ y: place.above ? -6 : 6, duration: 150 }}
59
60
  >
60
61
  <span
61
- class="w-max max-w-full rounded-lg border border-(--hairline-color) bg-(--back-color) px-2.5 py-1.5 text-left text-[12px] font-medium whitespace-normal text-(--font-color) normal-case shadow-(--elevation-2)"
62
- >{text}</span
62
+ class="w-max max-w-full rounded-lg border border-(--hairline-color) bg-(--back-color) px-2.5 py-1.5 text-left text-[12px] font-medium whitespace-pre-line text-(--font-color) normal-case shadow-(--elevation-2)"
63
+ >{#each hintParts(text) as part}{#if part.bold}<b class="font-bold">{part.text}</b>{:else}{part.text}{/if}{/each}</span
63
64
  >
64
65
  </div>
65
66
  {/if}
@@ -77,6 +77,7 @@
77
77
  <CommonSnippets snippet="Variable" {VARIABLE_OPTIONS} {component} {onPropertyChange} />
78
78
  <UI.Select
79
79
  label={{ name: $T("constructor.props.type") }}
80
+ help={{ info: $T("constructor.props.input.type.info") }}
80
81
  options={$optionsStore.INPUT_TYPE_OPTIONS}
81
82
  type="buttons"
82
83
  value={properties.type ?? "text"}
@@ -85,6 +86,7 @@
85
86
  {#if isText}
86
87
  <UI.Input
87
88
  label={{ name: $T("constructor.props.maxlength") }}
89
+ help={{ info: $T("constructor.props.maxlength.info") }}
88
90
  type="number"
89
91
  number={{ minNum: 1, maxNum: 1000000, step: 1 }}
90
92
  value={properties.maxlength}
@@ -93,6 +95,7 @@
93
95
  <div class="flex items-end">
94
96
  <UI.Input
95
97
  label={{ name: $T("constructor.props.regexp") }}
98
+ help={{ info: $T("constructor.props.regexp.info") }}
96
99
  value={properties.help?.regExp?.toString()}
97
100
  maxlength={150}
98
101
  accent={isValidRegExp ? undefined : "red"}
@@ -124,6 +127,7 @@
124
127
  {#if properties.type === "text-area"}
125
128
  <UI.Input
126
129
  label={{ name: $T("constructor.props.textarea.rows") }}
130
+ help={{ info: $T("constructor.props.textarea.rows.info") }}
127
131
  type="number"
128
132
  value={properties.textareaRows}
129
133
  onUpdate={(value) => edit.set("textareaRows", Number(value))}
@@ -132,6 +136,7 @@
132
136
  {#if properties.type !== "password"}
133
137
  <UI.Select
134
138
  label={{ name: $T("constructor.props.align.content") }}
139
+ help={{ info: $T("constructor.props.align.content.info") }}
135
140
  options={$optionsStore.TEXT_ALIGN_OPTIONS}
136
141
  type="buttons"
137
142
  value={optionByClass($optionsStore.TEXT_ALIGN_OPTIONS, properties.componentClass)?.value ?? "text-left"}
@@ -148,6 +153,7 @@
148
153
  {:else if properties.type === "bitMode"}
149
154
  <UI.Slider
150
155
  label={{ name: $T("constructor.props.range") }}
156
+ help={{ info: $T("constructor.props.range.info") }}
151
157
  type="range"
152
158
  number={{ minNum: 0, maxNum: 31, step: 1 }}
153
159
  value={[bitRange.start, bitRange.end]}
@@ -158,7 +164,7 @@
158
164
  <PropsGroup label={$T("constructor.props.group.value")}>
159
165
  <UI.Input
160
166
  label={{ name: $T("constructor.props.defaultvalue") }}
161
- help={{ regExp: properties.type === "number" ? /^-?\d*\.?\d+$/ : undefined }}
167
+ help={{ info: $T("constructor.props.defaultvalue.info"), regExp: properties.type === "number" ? /^-?\d*\.?\d+$/ : undefined }}
162
168
  value={properties.value}
163
169
  onUpdate={(value) => edit.set("value", value)}
164
170
  />
@@ -184,6 +190,7 @@
184
190
  <CommonSnippets snippet="LabelAlign" {component} {onPropertyChange} />
185
191
  <UI.Select
186
192
  label={{ name: $T("constructor.props.autocomplete") }}
193
+ help={{ info: $T("constructor.props.autocomplete.info") }}
187
194
  options={$optionsStore.AUTOCOMPLETE_CONSTRUCTOR_OPTIONS as IOption<string>[]}
188
195
  value={properties.help?.autocomplete || "off"}
189
196
  onUpdate={(autocomplete) => edit.patch("help", { autocomplete: autocomplete as NonNullable<IInputProps["help"]>["autocomplete"] })}
@@ -71,7 +71,8 @@
71
71
  - Стрелки есть у `number` и `bitMode`, кроме `readonly` и `disabled`. Пустое значение стрелка сначала ставит в `minNum`. Шаг за предел ставит ровно предел.
72
72
  - Числа округляются до 5 знаков после запятой, чтобы не было хвостов вида `0.30000000000000004`.
73
73
  - `readonly` превращает поле в отображение значения. Кнопка копирования (`help.copyButton`) работает у любого поля, кроме пароля и неактивного.
74
- - Подсказка `help.info` - значок ⓘ после заголовка, как у `Select` и `Switch`. Текст всплывает при наведении мышью и при фокусе с клавиатуры, на телефоне - по касанию значка, закрывается касанием в другом месте. Подсказка не выходит за край окна. Без заголовка значок стоит на его месте. Показывает только текст, без разметки.
74
+ - Подсказка `help.info` - значок ⓘ после заголовка, как у `Select` и `Switch`. Текст всплывает при наведении мышью и при фокусе с клавиатуры, на телефоне - по касанию значка, закрывается касанием в другом месте. Подсказка не выходит за край окна. Без заголовка значок стоит на его месте. Текст выводится как текст, без HTML: перенос строки (`
75
+ `) начинает новую строку, `**название**` выделяется жирным. Так пишутся подсказки свойств: строка - один вариант, его название жирным, например `**Таблица** - в строке`.
75
76
  - `error` - ошибка от приложения (например, ответ сервера «логин занят»). Рамка красная, текст под полем, у поля `aria-invalid` и `aria-describedby` на текст ошибки (`role="alert"`, диктор зачитает его при появлении). Ошибка приложения важнее ошибки формата.
76
77
  - `autofocus` ставит фокус после появления поля (атрибут браузера сработал бы только при загрузке страницы). Фокус извне: `bind:this={field}`, затем `field.focus()`. Сам элемент поля - `bind:ref`.
77
78
  - `fill` для `text-area`: обёртка, заголовок, поле и ошибка - колонка на всю высоту родителя, поле забирает остаток высоты, ручка растягивания убрана. Родитель - flex-колонка или блок с высотой. Поле сжимается вместе с родителем (`min-h-0`) и не вылезает за его рамку, даже если родитель ниже обычных 5rem.
@@ -41,6 +41,7 @@
41
41
  <UI.Select
42
42
  wrapperClass="!h-14"
43
43
  label={{ name: $T("constructor.props.type") }}
44
+ help={{ info: $T("constructor.props.progressbar.type.info") }}
44
45
  type="buttons"
45
46
  options={$optionsStore.SWITCH_OPTIONS.filter((option) => option.value !== "checkbox")}
46
47
  value={component.properties.type}
@@ -41,7 +41,7 @@
41
41
 
42
42
  - Читает и пишет одну переменную с выбранным значением.
43
43
  - Варианты задаются в настройках или приходят с устройства отдельной переменной `<имя>-S`. Так строится, например, список найденных WiFi-сетей. Список с устройства заменяет варианты из настроек.
44
- - Отправка настраивается в событии: **Заголовок** `SET` и **Аргумент** (по умолчанию `ModCfg`). С `NoSend` значение сразу не уходит, его отправит другой компонент. В конструкторе аргумент - только имя из словаря команд или `NoSend`, до 31 знака.
44
+ - Отправка настраивается в событии: **Заголовок** `SET` и **Аргумент** (по умолчанию `ModCfg`). С `NoSend` значение сразу не уходит, его отправит другой компонент. В конструкторе аргумент выбирается из словаря команд с поиском по имени, есть и `NoSend`.
45
45
  - В битовом режиме меняются только биты с N по M (`range`), остальные биты переменной сохраняются.
46
46
 
47
47
  | Ключ | Описание |
@@ -7,7 +7,8 @@
7
7
  import * as UI from ".."
8
8
  import ButtonDelete from "../libIcons/ButtonDelete.svelte"
9
9
  import ButtonAdd from "../libIcons/ButtonAdd.svelte"
10
- import { ARGUMENT_MAX_LENGTH, ARGUMENT_REGEXP, optionsStore } from "../options"
10
+ import { optionsStore } from "../options"
11
+ import ArgumentSelect from "../ArgumentSelect.svelte"
11
12
  import CommonSnippets from "../CommonSnippets.svelte"
12
13
  import PropsGroup from "../PropsGroup.svelte"
13
14
  import PropsListModal from "../PropsListModal.svelte"
@@ -47,17 +48,12 @@
47
48
  <PropsGroup label={$T("constructor.props.group.general")}>
48
49
  <CommonSnippets snippet="Access" {component} {onPropertyChange} />
49
50
  <CommonSnippets snippet="Variable" {VARIABLE_OPTIONS} {component} {onPropertyChange} />
50
- <UI.Input
51
- label={{ name: $T("constructor.props.argument") }}
52
- value={component.eventHandler?.Argument || "ModCfg"}
53
- maxlength={ARGUMENT_MAX_LENGTH}
54
- help={{ info: $T("constructor.props.argument.info"), autocomplete: "on", regExp: ARGUMENT_REGEXP }}
55
- onUpdate={(value) => onPropertyChange({ eventHandler: { Argument: String(value) } })}
56
- />
51
+ <ArgumentSelect value={component.eventHandler?.Argument || "ModCfg"} onUpdate={(Argument) => onPropertyChange({ eventHandler: { Argument } })} />
57
52
  </PropsGroup>
58
53
  <PropsGroup label={$T("constructor.props.group.value")}>
59
54
  <UI.Select
60
55
  label={{ name: $T("constructor.props.type") }}
56
+ help={{ info: $T("constructor.props.select.type.info") }}
61
57
  type="buttons"
62
58
  value={component.properties.type}
63
59
  options={$optionsStore.SELECT_TYPE_OPTIONS}
@@ -73,6 +69,7 @@
73
69
  <UI.Select
74
70
  wrapperClass="h-14"
75
71
  label={{ name: $T("constructor.props.valuetype") }}
72
+ help={{ info: $T("constructor.props.valuetype.info") }}
76
73
  type="buttons"
77
74
  disabled={component.properties.bitMode}
78
75
  options={$optionsStore.SELECT_VALUE_TYPE_OPTIONS}
@@ -90,6 +87,7 @@
90
87
  <CommonSnippets snippet="LabelAlign" {component} {onPropertyChange} />
91
88
  <UI.Select
92
89
  label={{ name: $T("constructor.props.align.content") }}
90
+ help={{ info: $T("constructor.props.select.align.info") }}
93
91
  type="buttons"
94
92
  value={optionByClass(contentAlignOptions, component.properties.componentClass)?.value ?? "text-left"}
95
93
  options={contentAlignOptions}
@@ -97,6 +95,7 @@
97
95
  />
98
96
  <UI.Switch
99
97
  label={{ name: $T("constructor.props.bitMode") }}
98
+ help={{ info: $T("constructor.props.bitMode.info") }}
100
99
  value={component.properties.bitMode ? 1 : 0}
101
100
  onUpdate={(value) =>
102
101
  onPropertyChange({
@@ -109,6 +108,7 @@
109
108
  {#if component.properties.type === "buttons" && !component.properties.bitMode}
110
109
  <UI.Switch
111
110
  label={{ name: $T("constructor.props.multiselect") }}
111
+ help={{ info: $T("constructor.props.multiselect.info") }}
112
112
  value={component.properties.multiSelect ? 1 : 0}
113
113
  onUpdate={(value) => edit.set("multiSelect", value === 1)}
114
114
  />
@@ -116,6 +116,7 @@
116
116
  {#if component.properties.bitMode}
117
117
  <UI.Slider
118
118
  label={{ name: $T("constructor.props.range") }}
119
+ help={{ info: $T("constructor.props.range.info") }}
119
120
  type="range"
120
121
  number={{ minNum: 0, maxNum: 31, step: 1 }}
121
122
  value={[bitRange.start, bitRange.end]}
@@ -29,6 +29,7 @@
29
29
  <PropsGroup label={$T("constructor.props.group.value")}>
30
30
  <UI.Select
31
31
  label={{ name: $T("constructor.props.type") }}
32
+ help={{ info: $T("constructor.props.slider.type.info") }}
32
33
  type="buttons"
33
34
  value={component.properties.type ?? "single"}
34
35
  options={$optionsStore.SLIDER_TYPE_OPTIONS}
@@ -39,6 +39,7 @@
39
39
  <UI.Select
40
40
  wrapperClass="!h-14"
41
41
  label={{ name: $T("constructor.props.type") }}
42
+ help={{ info: $T("constructor.props.switch.type.info") }}
42
43
  type="buttons"
43
44
  options={$optionsStore.SWITCH_OPTIONS.map((option) => ({ ...option, disabled: bitMode && option.value == "checkbox" }))}
44
45
  value={component.properties.type}
@@ -57,6 +58,7 @@
57
58
  {#if component.properties.type != "checkbox"}
58
59
  <UI.Switch
59
60
  label={{ name: $T("constructor.props.bitMode") }}
61
+ help={{ info: $T("constructor.props.switch.bitMode.info") }}
60
62
  value={bitMode ? 1 : 0}
61
63
  onUpdate={(value) => onPropertyChange({ properties: { bitMode: value === 1, value: 0 } })}
62
64
  />
@@ -102,6 +104,7 @@
102
104
  />
103
105
  <UI.Switch
104
106
  label={{ captionRight: $T("constructor.props.disabled") }}
107
+ help={{ info: $T("constructor.props.switch.bit.disabled.info") }}
105
108
  value={bit.disabled ? 1 : 0}
106
109
  onUpdate={(value) => edit.updateItem("options", index, { disabled: value === 1 })}
107
110
  />
@@ -13,7 +13,7 @@
13
13
  - ↕️ Сортирует строки по клику на стрелки в заголовке колонки.
14
14
  - 📋 Копирует значение ячейки одной кнопкой.
15
15
  - 🔍 Длинное значение открывается целиком в отдельном окне, а короткая подсказка всплывает при наведении.
16
- - 🔎 Широкую таблицу можно сузить: часть колонок показывается только в окне подробностей строки, оно открывается кнопкой «›» в конце строки. Кнопки, списки и полосы прогресса в окне работают так же, как в таблице, и обновляются вместе с ней. Колонка «По ширине» стоит в строке, пока таблице хватает места, и сама уходит в окно на узкой таблице (уже 640 px: телефон, узкая ячейка GUI).
16
+ - 🔎 Широкую таблицу можно сузить: часть колонок показывается только в окне подробностей строки, оно открывается кнопкой «›» в конце строки. В окне каждое поле - отдельная строка под чертой, название жирным, на узком окне название над значением. Кнопки, списки и полосы прогресса в окне работают так же, как в таблице, и обновляются вместе с ней. Колонка «По ширине» стоит в строке, пока таблице хватает места, и сама уходит в окно на узкой таблице (уже 640 px: телефон, узкая ячейка GUI).
17
17
  - 📜 Работает как журнал: новые строки не заменяют старые, а дописываются, старые уходят, когда буфер заполнен.
18
18
  - 🧹 В режиме журнала может показать кнопку очистки.
19
19
  - ⏬ Умеет подгружать данные порциями, когда таблицу прокрутили до конца.
@@ -621,12 +621,15 @@
621
621
  {#snippet main()}
622
622
  {#if detailsEntry}
623
623
  {@const row = withPicks(detailsEntry.row)}
624
- <div class="grid grid-cols-[minmax(6rem,max-content)_minmax(0,1fr)] items-center gap-x-4 gap-y-2.5 text-left">
624
+ <!-- Строки разделены чертой, название жирным; на узком окне название над значением -->
625
+ <div class="@container flex flex-col divide-y divide-(--border-color) text-left">
625
626
  {#each detailColumns as { column, index } (index)}
626
- <div class="text-[12px] font-semibold text-(--muted-color)">{$T(column.label?.name ?? "")}</div>
627
- <!-- Выпадающие списки окна - со своими номерами строк, чтобы не открывался список той же ячейки в таблице -->
628
- <div class="flex min-w-0 flex-wrap items-center gap-2 text-[13px] [&>*]:min-w-0">
629
- {@render items(row, detailsEntry.row, columnContent(column, row) as ITableContent<Row>[], true, -1 - detailsIndex, index)}
627
+ <div class="grid gap-1.5 py-3 first:pt-0 last:pb-0 @sm:grid-cols-[9rem_minmax(0,1fr)] @sm:items-center @sm:gap-4">
628
+ <div class="text-[13px] font-bold">{$T(column.label?.name ?? "")}</div>
629
+ <!-- Выпадающие списки окна - со своими номерами строк, чтобы не открывался список той же ячейки в таблице -->
630
+ <div class="flex min-w-0 flex-wrap items-center gap-2 text-[13px] [&>*]:min-w-0">
631
+ {@render items(row, detailsEntry.row, columnContent(column, row) as ITableContent<Row>[], true, -1 - detailsIndex, index)}
632
+ </div>
630
633
  </div>
631
634
  {/each}
632
635
  </div>