poe-svelte-ui-lib 1.9.21 → 1.9.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/Accordion/AccordionProps.svelte +7 -7
- package/dist/Accordion/README.md +1 -1
- package/dist/Button/ButtonProps.svelte +17 -17
- package/dist/Button/README.md +1 -1
- package/dist/ColorPicker/ColorPickerProps.svelte +2 -2
- package/dist/ColorPicker/README.md +1 -1
- package/dist/CommonSnippets.svelte +31 -16
- package/dist/CommonSnippets.svelte.d.ts +1 -1
- package/dist/ComponentExample.svelte +5 -5
- package/dist/FileAttach/FileAttach.svelte +3 -3
- package/dist/FileAttach/FileAttachProps.svelte +8 -8
- package/dist/FileAttach/README.md +1 -1
- package/dist/Graph/GraphProps.svelte +2 -2
- package/dist/Graph/README.md +1 -1
- package/dist/Input/InputProps.svelte +36 -28
- package/dist/Joystick/JoystickProps.svelte +6 -6
- package/dist/Joystick/README.md +1 -1
- package/dist/Map/Map.svelte +2 -2
- package/dist/Map/MapProps.svelte +3 -3
- package/dist/Map/README.md +1 -1
- package/dist/Map/mapWrapper/MapLibre.svelte +2 -2
- package/dist/ModalStackStore.d.ts +0 -2
- package/dist/ModalStackStore.js +1 -9
- package/dist/ProgressBar/ProgressBarProps.svelte +8 -8
- package/dist/ProgressBar/README.md +1 -1
- package/dist/Select/README.md +1 -1
- package/dist/Select/Select.svelte +2 -2
- package/dist/Select/SelectProps.svelte +15 -14
- package/dist/Slider/README.md +1 -1
- package/dist/Slider/SliderProps.svelte +3 -3
- package/dist/Switch/README.md +1 -1
- package/dist/Switch/SwitchProps.svelte +13 -13
- package/dist/Table/README.md +1 -1
- package/dist/Table/Table.svelte +6 -6
- package/dist/Table/TableProps.svelte +33 -33
- package/dist/Tabs/README.md +1 -1
- package/dist/Tabs/TabsProps.svelte +11 -11
- package/dist/TextField/README.md +1 -1
- package/dist/TextField/TextField.svelte +1 -1
- package/dist/TextField/TextFieldProps.svelte +6 -6
- package/dist/VideoViewer/VideoViewer.svelte +147 -0
- package/dist/VideoViewer/VideoViewer.svelte.d.ts +4 -0
- package/dist/Widget/README.md +1 -1
- package/dist/Widget/WidgetProps.svelte +10 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -0
- package/dist/libIcons/Error.svelte +8 -0
- package/dist/libIcons/Error.svelte.d.ts +18 -0
- package/dist/locales/i18n.d.ts +1 -1
- package/dist/locales/i18n.js +1 -1
- package/dist/locales/translations.js +5 -0
- package/dist/options.js +161 -161
- package/dist/types.d.ts +8 -2
- package/package.json +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte"
|
|
3
|
-
import {
|
|
3
|
+
import { T } from "../locales/i18n"
|
|
4
4
|
import { type UIComponent, type ISliderProps, updateProperty, type IUIComponentHandler } from "../types"
|
|
5
5
|
import * as UI from ".."
|
|
6
6
|
import { optionsStore } from "../options"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
{#snippet SliderType()}
|
|
36
36
|
<UI.Select
|
|
37
|
-
label={{ name: $
|
|
37
|
+
label={{ name: $T("constructor.props.type") }}
|
|
38
38
|
type="buttons"
|
|
39
39
|
value={$optionsStore.SLIDER_TYPE_OPTIONS.find((opt) => opt.value === (component.properties.type || "single"))}
|
|
40
40
|
options={$optionsStore.SLIDER_TYPE_OPTIONS}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
{#snippet SliderValue()}
|
|
49
49
|
<UI.Input
|
|
50
|
-
label={{ name: $
|
|
50
|
+
label={{ name: $T("constructor.props.value") }}
|
|
51
51
|
value={component.properties.value}
|
|
52
52
|
onUpdate={(value) => updateProperty("value", value as string, component, onPropertyChange)}
|
|
53
53
|
/>
|
package/dist/Switch/README.md
CHANGED
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
- Поддерживает настройку типа переключателя, режима битов и подписей
|
|
164
164
|
- Включает управление списком опций с возможностью добавления/удаления
|
|
165
165
|
- Имеет различные наборы полей в зависимости от режима (`forConstructor`)
|
|
166
|
-
- Использует систему локализации через `$
|
|
166
|
+
- Использует систему локализации через `$T('constructor.props.*')`
|
|
167
167
|
|
|
168
168
|
## Заметки
|
|
169
169
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte"
|
|
3
|
-
import {
|
|
3
|
+
import { T } from "../locales/i18n"
|
|
4
4
|
import { type UIComponent, type ISwitchProps, updateProperty, type IOption, type IUIComponentHandler } from "../types"
|
|
5
5
|
import * as UI from ".."
|
|
6
6
|
import { optionsStore } from "../options"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{#snippet SwitchType()}
|
|
28
28
|
<UI.Select
|
|
29
29
|
wrapperClass="!h-14"
|
|
30
|
-
label={{ name: $
|
|
30
|
+
label={{ name: $T("constructor.props.type") }}
|
|
31
31
|
type="buttons"
|
|
32
32
|
options={$optionsStore.SWITCH_OPTIONS.map((o) => (component.properties.bitMode && o.value == "checkbox" ? { ...o, disabled: true } : o))}
|
|
33
33
|
value={$optionsStore.SWITCH_OPTIONS.find((option) => option.value == component.properties.type)}
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
{#snippet SwitchCaptions()}
|
|
39
39
|
{#if component.properties.type == "horizontal"}
|
|
40
40
|
<UI.Input
|
|
41
|
-
label={{ name: $
|
|
41
|
+
label={{ name: $T("constructor.props.caption.left") }}
|
|
42
42
|
value={component.properties.label.captionLeft}
|
|
43
43
|
onUpdate={(value) => updateProperty("label.captionLeft", value as string, component, onPropertyChange)}
|
|
44
44
|
/>
|
|
45
45
|
<UI.Input
|
|
46
|
-
label={{ name: $
|
|
46
|
+
label={{ name: $T("constructor.props.caption.right") }}
|
|
47
47
|
value={component.properties.label.captionRight}
|
|
48
48
|
onUpdate={(value) => updateProperty("label.captionRight", value as string, component, onPropertyChange)}
|
|
49
49
|
/>
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
{#snippet SwitchDisabled()}
|
|
54
54
|
<UI.Switch
|
|
55
55
|
wrapperClass="bg-blue"
|
|
56
|
-
label={{ name: $
|
|
56
|
+
label={{ name: $T("constructor.props.disabled") }}
|
|
57
57
|
value={component.properties.options[0].disabled}
|
|
58
58
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
59
59
|
onChange={(value) => {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
{#snippet SwitchBitmode()}
|
|
68
68
|
<UI.Switch
|
|
69
69
|
wrapperClass="bg-blue"
|
|
70
|
-
label={{ name: $
|
|
70
|
+
label={{ name: $T("constructor.props.bitMode") }}
|
|
71
71
|
value={component.properties.bitMode}
|
|
72
72
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
73
73
|
onChange={(value) => {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
<!-- Настройки опций -->
|
|
85
85
|
<div class="space-y-4">
|
|
86
86
|
<div class="m-0 flex items-center justify-center gap-2">
|
|
87
|
-
<h4>{$
|
|
87
|
+
<h4>{$T("constructor.props.bits.title")}</h4>
|
|
88
88
|
{#if component.properties.options.length < 32}
|
|
89
89
|
<UI.Button
|
|
90
90
|
wrapperClass="w-8"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
{#each component.properties.options || [] as option, index (option.id)}
|
|
107
107
|
<div class="m-0 flex items-end justify-around gap-2 border-gray-400">
|
|
108
108
|
<UI.Input
|
|
109
|
-
label={{ name: $
|
|
109
|
+
label={{ name: $T("constructor.props.optionname") }}
|
|
110
110
|
wrapperClass="!w-3/10"
|
|
111
111
|
value={option.name}
|
|
112
112
|
maxlength={4}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}}
|
|
118
118
|
/>
|
|
119
119
|
<UI.Input
|
|
120
|
-
label={{ name: $
|
|
120
|
+
label={{ name: $T("constructor.props.optionposition") }}
|
|
121
121
|
wrapperClass="!w-3/10"
|
|
122
122
|
value={option.value}
|
|
123
123
|
type="number"
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
/>
|
|
131
131
|
<UI.Select
|
|
132
132
|
wrapperClass="w-80 h-14.5"
|
|
133
|
-
label={{ name: $
|
|
133
|
+
label={{ name: $T("constructor.props.colors") }}
|
|
134
134
|
type="buttons"
|
|
135
135
|
options={$optionsStore.COLOR_OPTIONS.filter((option) => option.value !== "bg-max" && option.value !== "bg-gray")}
|
|
136
136
|
value={$optionsStore.COLOR_OPTIONS.find((c) => (c.value as string).includes(option.class.split(" ").find((cls: string) => cls.startsWith("bg-"))))}
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
/>
|
|
143
143
|
<UI.Switch
|
|
144
144
|
wrapperClass=" w-1/10 bg-blue"
|
|
145
|
-
label={{ name: $
|
|
145
|
+
label={{ name: $T("constructor.props.disabled") }}
|
|
146
146
|
value={option.disabled}
|
|
147
147
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
148
148
|
onChange={(value) => {
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
|
|
168
168
|
{#snippet SwitchHeight()}
|
|
169
169
|
<UI.Input
|
|
170
|
-
label={{ name: $
|
|
170
|
+
label={{ name: $T("constructor.props.height") }}
|
|
171
171
|
value={component.properties.height}
|
|
172
172
|
onUpdate={(value) => updateProperty("height", value as string, component, onPropertyChange)}
|
|
173
173
|
/>
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
|
|
176
176
|
{#snippet SwitchValue()}
|
|
177
177
|
<UI.Input
|
|
178
|
-
label={{ name: $
|
|
178
|
+
label={{ name: $T("constructor.props.value") }}
|
|
179
179
|
value={component.properties.value}
|
|
180
180
|
type="number"
|
|
181
181
|
number={{ minNum: 0, maxNum: component.properties.bitMode ? Math.pow(2, 32) : 1, step: 1 }}
|
package/dist/Table/README.md
CHANGED
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
- Поддерживает настройку столбцов таблицы с различными типами содержимого
|
|
201
201
|
- Включает настройки буфера данных, обводки и автопрокрутки
|
|
202
202
|
- Имеет различные наборы полей в зависимости от режима (`forConstructor`)
|
|
203
|
-
- Использует систему локализации через `$
|
|
203
|
+
- Использует систему локализации через `$T('constructor.props.*')`
|
|
204
204
|
|
|
205
205
|
## Заметки
|
|
206
206
|
|
package/dist/Table/Table.svelte
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { twMerge } from "tailwind-merge"
|
|
7
7
|
import { onMount, tick } from "svelte"
|
|
8
8
|
import ButtonClear from "../libIcons/ButtonClear.svelte"
|
|
9
|
-
import {
|
|
9
|
+
import { T } from "../locales/i18n"
|
|
10
10
|
import { Button, Modal } from ".."
|
|
11
11
|
|
|
12
12
|
let {
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
column.label?.class,
|
|
267
267
|
)}
|
|
268
268
|
>
|
|
269
|
-
<span>{column.label?.name}</span>
|
|
269
|
+
<span>{$T(column.label?.name ?? "")}</span>
|
|
270
270
|
|
|
271
271
|
{#if typeof column.content !== "function" && (column.content as ITableContent<any>[])?.some((c) => c.type === "text" && c.data.sortable)}
|
|
272
272
|
<button
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
{/if}
|
|
349
349
|
</span>
|
|
350
350
|
{/if}
|
|
351
|
-
{typeof button.name === "function" ? button.name(row) : button.name}
|
|
351
|
+
{typeof button.name === "function" ? $T(button.name(row)) : $T(button.name ?? "")}
|
|
352
352
|
</button>
|
|
353
353
|
{:else if content.type === "select"}
|
|
354
354
|
{@const select = content.data}
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
>
|
|
365
365
|
{options.some((o: IOption) => o.value === row[(select?.key as string).slice(0, -2)])
|
|
366
366
|
? row[select?.key].find((o: IOption) => o.value === row[(select?.key as string).slice(0, -2)]).name
|
|
367
|
-
: $
|
|
367
|
+
: $T("common.select_tag")}
|
|
368
368
|
</button>
|
|
369
369
|
|
|
370
370
|
{#if isDropdownOpen?.x === j && isDropdownOpen.y === i && isDropdownOpen.index === index}
|
|
@@ -524,7 +524,7 @@
|
|
|
524
524
|
</div>
|
|
525
525
|
</div>
|
|
526
526
|
|
|
527
|
-
<Modal isOpen={modalData.isOpen} title={$
|
|
527
|
+
<Modal isOpen={modalData.isOpen} title={$T("constructor.props.table.fulldata")} wrapperClass="max-h-[80%]" width="{0.8 * (container?.offsetWidth ?? 0)}px">
|
|
528
528
|
{#snippet main()}
|
|
529
529
|
<div class="text-left whitespace-pre">
|
|
530
530
|
{@html modalData.formattedData}
|
|
@@ -532,7 +532,7 @@
|
|
|
532
532
|
{/snippet}
|
|
533
533
|
{#snippet footer()}
|
|
534
534
|
<Button
|
|
535
|
-
content={{ name: $
|
|
535
|
+
content={{ name: $T("constructor.props.copy") }}
|
|
536
536
|
wrapperClass="w-50"
|
|
537
537
|
componentClass="bg-blue"
|
|
538
538
|
onClick={() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte"
|
|
3
|
-
import {
|
|
3
|
+
import { T } from "../locales/i18n"
|
|
4
4
|
import { type UIComponent, type ITableProps, type ITableHeader, updateProperty, type IUIComponentHandler, type ITableContent } from "../types"
|
|
5
5
|
import * as UI from ".."
|
|
6
6
|
import ButtonDelete from "../libIcons/ButtonDelete.svelte"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
{#snippet TableOutline()}
|
|
103
103
|
<UI.Switch
|
|
104
|
-
label={{ name: $
|
|
104
|
+
label={{ name: $T("constructor.props.outline") }}
|
|
105
105
|
value={component.properties.outline}
|
|
106
106
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
107
107
|
onChange={(value) => updateProperty("outline", value, component, onPropertyChange)}
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
|
|
111
111
|
{#snippet TableBufferSize()}
|
|
112
112
|
<UI.Select
|
|
113
|
-
label={{ name: $
|
|
113
|
+
label={{ name: $T("constructor.props.table.buffersize") }}
|
|
114
114
|
type="buttons"
|
|
115
115
|
options={$optionsStore.BUFFER_SIZE_OPTIONS}
|
|
116
116
|
value={$optionsStore.BUFFER_SIZE_OPTIONS.find((o) => o.value === component.properties.dataBuffer.bufferSize)}
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
{#snippet TableVisibleRows()}
|
|
122
122
|
<UI.Select
|
|
123
|
-
label={{ name: $
|
|
123
|
+
label={{ name: $T("constructor.props.table.visibleRows") }}
|
|
124
124
|
type="buttons"
|
|
125
125
|
options={$optionsStore.VISIBLE_ROWS_OPTIONS}
|
|
126
126
|
value={$optionsStore.VISIBLE_ROWS_OPTIONS.find((o) => o.value === component.properties.dataBuffer.visibleRows)}
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<!-- Настройки столбцов таблицы -->
|
|
135
135
|
<div class="flex flex-col gap-2" bind:this={columnContainer}>
|
|
136
136
|
<div class="flex items-center justify-center gap-2">
|
|
137
|
-
<h4>{$
|
|
137
|
+
<h4>{$T("constructor.props.table.columns")}</h4>
|
|
138
138
|
<UI.Button
|
|
139
139
|
wrapperClass="w-8"
|
|
140
140
|
content={{ icon: ButtonAdd }}
|
|
@@ -170,19 +170,19 @@
|
|
|
170
170
|
/>
|
|
171
171
|
<div class="py-2 pl-9 grid grid-cols-[1fr_minmax(5rem,10rem)_minmax(10rem,21rem)_2rem_2rem] items-end gap-2">
|
|
172
172
|
<UI.Input
|
|
173
|
-
label={{ name: $
|
|
173
|
+
label={{ name: $T("constructor.props.table.columns.label") }}
|
|
174
174
|
value={column.label?.name}
|
|
175
175
|
onUpdate={(value) => updateTableHeader(columnIndex, "label", { ["name"]: value })}
|
|
176
176
|
/>
|
|
177
177
|
<UI.Input
|
|
178
|
-
label={{ name: $
|
|
178
|
+
label={{ name: $T("constructor.props.table.columns.width"), class: "px-0" }}
|
|
179
179
|
type="number"
|
|
180
180
|
isValid={component.properties.header.reduce((width: number, h: ITableHeader<object>) => Number(h.width?.replace("%", "")) + width, 0) == 100}
|
|
181
181
|
value={Number(column.width.replace("%", ""))}
|
|
182
182
|
onUpdate={(value) => updateTableHeader(columnIndex, "width", `${value}%`)}
|
|
183
183
|
/>
|
|
184
184
|
<UI.Select
|
|
185
|
-
label={{ name: $
|
|
185
|
+
label={{ name: $T("constructor.props.align.content") }}
|
|
186
186
|
type="buttons"
|
|
187
187
|
value={$optionsStore.ALIGN_OPTIONS.find((a) => (a.value as string).includes(column.align ?? "left"))}
|
|
188
188
|
options={$optionsStore.ALIGN_OPTIONS}
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
<div class="flex gap-2 mx-auto items-end" style="width: {forConstructor ? '65%' : '90%'}; ">
|
|
238
238
|
<UI.Input
|
|
239
239
|
wrapperClass="w-1/4"
|
|
240
|
-
label={{ name: $
|
|
240
|
+
label={{ name: $T("constructor.props.table.text.key") }}
|
|
241
241
|
value={text.key}
|
|
242
242
|
help={{ regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
243
243
|
onUpdate={(value) => {
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
}}
|
|
250
250
|
/>
|
|
251
251
|
<UI.Select
|
|
252
|
-
label={{ name: $
|
|
252
|
+
label={{ name: $T("constructor.props.tablecolumn.settings") }}
|
|
253
253
|
type="buttons"
|
|
254
254
|
multiSelect={true}
|
|
255
255
|
value={$optionsStore.TABLE_TEXT_SETTING_OPTIONS.slice(0, forConstructor ? 3 : 5).filter((opt) => {
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
<div class="flex w-1/3 mx-auto gap-2">
|
|
265
265
|
<UI.Input
|
|
266
266
|
wrapperClass="w-1/2"
|
|
267
|
-
label={{ name: $
|
|
267
|
+
label={{ name: $T("constructor.props.table.select.key") }}
|
|
268
268
|
value={select.key}
|
|
269
269
|
help={{ regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
270
270
|
onUpdate={(value) => {
|
|
@@ -278,10 +278,10 @@
|
|
|
278
278
|
/>
|
|
279
279
|
<UI.Input
|
|
280
280
|
wrapperClass="w-1/2"
|
|
281
|
-
label={{ name: $
|
|
281
|
+
label={{ name: $T("constructor.props.table.select.keys") }}
|
|
282
282
|
value={select?.keyCol ?? ""}
|
|
283
283
|
maxlength={500}
|
|
284
|
-
help={{ info: $
|
|
284
|
+
help={{ info: $T("constructor.props.table.select.keys.info"), regExp: /^[a-zA-Z0-9\-_ ]{0,500}$/ }}
|
|
285
285
|
onUpdate={(value) => {
|
|
286
286
|
const headers = [...component.properties.header]
|
|
287
287
|
headers[columnIndex].content[index].data = { ...headers[columnIndex].content[index].data, keyCol: value }
|
|
@@ -293,17 +293,17 @@
|
|
|
293
293
|
{@const button = content.data}
|
|
294
294
|
<div class="flex w-[95%] mx-auto items-end justify-between gap-2">
|
|
295
295
|
<UI.Input
|
|
296
|
-
label={{ name: $
|
|
296
|
+
label={{ name: $T("constructor.props.name") }}
|
|
297
297
|
wrapperClass="w-2/10"
|
|
298
298
|
value={button.name}
|
|
299
299
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "name", value)}
|
|
300
300
|
/>
|
|
301
301
|
|
|
302
302
|
<div class="flex items-end gap-1">
|
|
303
|
-
<UI.Button wrapperClass="w-8" content={{ icon: InfoIcon, info: { text: $
|
|
303
|
+
<UI.Button wrapperClass="w-8" content={{ icon: InfoIcon, info: { text: $T("constructor.props.button.colors.hint"), side: "right" } }} />
|
|
304
304
|
<UI.Select
|
|
305
305
|
wrapperClass="w-80 h-14.5"
|
|
306
|
-
label={{ name: $
|
|
306
|
+
label={{ name: $T("constructor.props.colors") }}
|
|
307
307
|
type="buttons"
|
|
308
308
|
options={$optionsStore.COLOR_OPTIONS.filter((option) => option.value !== "bg-max")}
|
|
309
309
|
value={$optionsStore.COLOR_OPTIONS.find((c) =>
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
<CommonSnippets
|
|
323
323
|
snippet="IconsLib"
|
|
324
324
|
initialValue={{
|
|
325
|
-
name: $
|
|
325
|
+
name: $T("constructor.props.table.type.icon"),
|
|
326
326
|
icon: column.content[index].data.icon,
|
|
327
327
|
updateProperty: (icon: string) => updateContentProperty(columnIndex, index, "icon", icon),
|
|
328
328
|
icons: { array: ICONS },
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
|
|
335
335
|
<UI.Select
|
|
336
336
|
wrapperClass="w-1/4"
|
|
337
|
-
label={{ name: $
|
|
337
|
+
label={{ name: $T("constructor.props.header") }}
|
|
338
338
|
type="buttons"
|
|
339
339
|
value={$optionsStore.HEADER_OPTIONS.find((h) => h.value === button.eventHandler?.Header)}
|
|
340
340
|
options={$optionsStore.HEADER_OPTIONS}
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
/>
|
|
347
347
|
<UI.Input
|
|
348
348
|
wrapperClass="w-2/10"
|
|
349
|
-
label={{ name: $
|
|
349
|
+
label={{ name: $T("constructor.props.argument") }}
|
|
350
350
|
value={button.eventHandler?.Argument}
|
|
351
351
|
onUpdate={(value) => {
|
|
352
352
|
const handler = button.eventHandler
|
|
@@ -356,10 +356,10 @@
|
|
|
356
356
|
/>
|
|
357
357
|
<UI.Input
|
|
358
358
|
wrapperClass="w-2/10"
|
|
359
|
-
label={{ name: $
|
|
359
|
+
label={{ name: $T("constructor.props.table.keys") }}
|
|
360
360
|
value={button.eventHandler?.Variables.join(" ")}
|
|
361
361
|
maxlength={500}
|
|
362
|
-
help={{ info: $
|
|
362
|
+
help={{ info: $T("constructor.props.table.keys.info"), regExp: /^[a-zA-Z0-9\-._ ]{0,500}$/ }}
|
|
363
363
|
onUpdate={(value) => {
|
|
364
364
|
const handler = { ...button.eventHandler }
|
|
365
365
|
handler.Variables = (value as string).trim().split(/\s+/)
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
{@const progressBar = content.data}
|
|
372
372
|
<div class="w-3/5 flex mx-auto items-end gap-2">
|
|
373
373
|
<UI.Input
|
|
374
|
-
label={{ name: $
|
|
374
|
+
label={{ name: $T("constructor.props.table.progressBar.key") }}
|
|
375
375
|
value={progressBar.key}
|
|
376
376
|
help={{ regExp: /^[0-9a-zA-Z_.-]{0,16}$/ }}
|
|
377
377
|
onUpdate={(value) => {
|
|
@@ -385,20 +385,20 @@
|
|
|
385
385
|
/>
|
|
386
386
|
<UI.Input
|
|
387
387
|
wrapperClass="w-1/2"
|
|
388
|
-
label={{ name: $
|
|
388
|
+
label={{ name: $T("constructor.props.min") }}
|
|
389
389
|
value={(progressBar?.minNum as number) ?? 0}
|
|
390
390
|
type="number"
|
|
391
391
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "minNum", value as string)}
|
|
392
392
|
/>
|
|
393
393
|
<UI.Input
|
|
394
394
|
wrapperClass="w-1/2"
|
|
395
|
-
label={{ name: $
|
|
395
|
+
label={{ name: $T("constructor.props.max") }}
|
|
396
396
|
value={(progressBar?.maxNum as number) ?? 100}
|
|
397
397
|
type="number"
|
|
398
398
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "maxNum", value as string)}
|
|
399
399
|
/>
|
|
400
400
|
<UI.Input
|
|
401
|
-
label={{ name: $
|
|
401
|
+
label={{ name: $T("constructor.props.units") }}
|
|
402
402
|
value={progressBar?.units}
|
|
403
403
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "units", value as string)}
|
|
404
404
|
/>
|
|
@@ -409,7 +409,7 @@
|
|
|
409
409
|
<CommonSnippets
|
|
410
410
|
snippet="IconsLib"
|
|
411
411
|
initialValue={{
|
|
412
|
-
name: $
|
|
412
|
+
name: $T("constructor.props.table.columns.defaultIcon"),
|
|
413
413
|
icon: image?.defaultIcon ?? "",
|
|
414
414
|
updateProperty: (icon: string) => {
|
|
415
415
|
updateContentProperty(columnIndex, index, "defaultIcon", icon)
|
|
@@ -423,13 +423,13 @@
|
|
|
423
423
|
/>
|
|
424
424
|
|
|
425
425
|
<UI.Input
|
|
426
|
-
label={{ name: $
|
|
426
|
+
label={{ name: $T("constructor.props.table.columns.class") }}
|
|
427
427
|
value={image?.class}
|
|
428
428
|
onUpdate={(value) => updateContentProperty(columnIndex, index, "class", value)}
|
|
429
429
|
/>
|
|
430
430
|
<UI.Input
|
|
431
431
|
wrapperClass="w-4/10"
|
|
432
|
-
label={{ name: $
|
|
432
|
+
label={{ name: $T("constructor.props.table.columns.image.width"), class: "px-0" }}
|
|
433
433
|
type="number"
|
|
434
434
|
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
435
435
|
value={Number(image?.width?.replace("rem", "") ?? 0)}
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
/>
|
|
438
438
|
<UI.Input
|
|
439
439
|
wrapperClass="w-4/10"
|
|
440
|
-
label={{ name: $
|
|
440
|
+
label={{ name: $T("constructor.props.table.columns.image.height"), class: "px-0" }}
|
|
441
441
|
type="number"
|
|
442
442
|
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
443
443
|
value={Number(image?.height?.replace("rem", "") ?? 0)}
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
|
|
483
483
|
{#snippet TableFooter()}
|
|
484
484
|
<UI.Input
|
|
485
|
-
label={{ name: $
|
|
485
|
+
label={{ name: $T("constructor.props.footer") }}
|
|
486
486
|
value={component.properties.footer}
|
|
487
487
|
onUpdate={(value) => updateProperty("footer", value as string, component, onPropertyChange)}
|
|
488
488
|
/>
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
|
|
491
491
|
{#snippet TableStashData()}
|
|
492
492
|
<UI.Switch
|
|
493
|
-
label={{ name: $
|
|
493
|
+
label={{ name: $T("constructor.props.table.stashData") }}
|
|
494
494
|
value={component.properties.dataBuffer.stashData}
|
|
495
495
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
496
496
|
onChange={(value) => {
|
|
@@ -506,7 +506,7 @@
|
|
|
506
506
|
{#snippet TableClearButton()}
|
|
507
507
|
<UI.Switch
|
|
508
508
|
label={{
|
|
509
|
-
name: $
|
|
509
|
+
name: $T("constructor.props.table.clearButton"),
|
|
510
510
|
}}
|
|
511
511
|
value={component.properties.dataBuffer.clearButton}
|
|
512
512
|
options={[{ id: crypto.randomUUID(), value: 0, class: "", disabled: !component.properties.dataBuffer.stashData }]}
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
|
|
517
517
|
{#snippet TableLogger()}
|
|
518
518
|
<UI.Switch
|
|
519
|
-
label={{ name: $
|
|
519
|
+
label={{ name: $T("constructor.props.table.logger"), captionLeft: $T("constructor.props.info.bottom"), captionRight: $T("constructor.props.info.top") }}
|
|
520
520
|
value={component.properties.dataBuffer.logger}
|
|
521
521
|
options={[{ id: crypto.randomUUID(), value: 0, class: "", disabled: !component.properties.dataBuffer.stashData }]}
|
|
522
522
|
onChange={(value) => updateProperty("dataBuffer.logger", value, component, onPropertyChange)}
|
package/dist/Tabs/README.md
CHANGED
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
- Поддерживает настройку позиционирования иконки и текста
|
|
159
159
|
- Включает управление списком вкладок с возможностью добавления/удаления
|
|
160
160
|
- Имеет различные наборы полей в зависимости от режима (`forConstructor`)
|
|
161
|
-
- Использует систему локализации через `$
|
|
161
|
+
- Использует систему локализации через `$T('constructor.props.*')`
|
|
162
162
|
|
|
163
163
|
## Заметки
|
|
164
164
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { T } from "../locales/i18n"
|
|
3
3
|
import { updateProperty, type IOption, type ITabsProps, type IUIComponentHandler, type UIComponent } from "../types"
|
|
4
4
|
import * as UI from ".."
|
|
5
5
|
import { optionsStore } from "../options"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
{#snippet TabsIconPosition()}
|
|
51
51
|
<UI.Select
|
|
52
52
|
wrapperClass="h-14"
|
|
53
|
-
label={{ name: $
|
|
53
|
+
label={{ name: $T("constructor.props.icon.text.position") }}
|
|
54
54
|
type="buttons"
|
|
55
55
|
options={$optionsStore.ICON_TEXT_POSITION_OPTIONS}
|
|
56
56
|
value={initialPosition}
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
{#snippet TabsWidthMode()}
|
|
68
68
|
<UI.Switch
|
|
69
69
|
label={{
|
|
70
|
-
name: $
|
|
71
|
-
captionLeft: $
|
|
72
|
-
captionRight: $
|
|
70
|
+
name: $T("constructor.props.widthMode"),
|
|
71
|
+
captionLeft: $T("constructor.props.height.small"),
|
|
72
|
+
captionRight: $T("constructor.props.equal"),
|
|
73
73
|
}}
|
|
74
74
|
value={initialWidth()}
|
|
75
75
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
{#snippet TabsSettings()}
|
|
87
87
|
<div class="space-y-4" bind:this={itemsContainer}>
|
|
88
88
|
<div class="m-0 flex items-center justify-center gap-2">
|
|
89
|
-
<h4>{$
|
|
89
|
+
<h4>{$T("constructor.props.tabs.title")}</h4>
|
|
90
90
|
{#if component.properties?.items.length < 10}
|
|
91
91
|
<UI.Button
|
|
92
92
|
wrapperClass="w-8"
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
}}
|
|
120
120
|
/>
|
|
121
121
|
<UI.Input
|
|
122
|
-
label={{ name: $
|
|
122
|
+
label={{ name: $T("constructor.props.optionname") }}
|
|
123
123
|
wrapperClass="w-1/3"
|
|
124
124
|
value={tab.name}
|
|
125
125
|
onUpdate={(value) => {
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
<CommonSnippets
|
|
133
133
|
snippet="IconsLib"
|
|
134
134
|
initialValue={{
|
|
135
|
-
name: $
|
|
135
|
+
name: $T("constructor.props.table.type.icon"),
|
|
136
136
|
icon: component.properties.items[index].icon,
|
|
137
137
|
updateProperty: (icon: string) => {
|
|
138
138
|
const items = [...(component.properties?.items || [])]
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
|
|
149
149
|
<UI.Switch
|
|
150
150
|
wrapperClass="w-30"
|
|
151
|
-
label={{ name: $
|
|
151
|
+
label={{ name: $T("constructor.props.disabled") }}
|
|
152
152
|
value={tab?.disabled ? 1 : 0}
|
|
153
153
|
options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
|
|
154
154
|
onChange={(value) => {
|
|
@@ -182,14 +182,14 @@
|
|
|
182
182
|
{#snippet TabsSize()}
|
|
183
183
|
<div class="flex w-full gap-4">
|
|
184
184
|
<UI.Input
|
|
185
|
-
label={{ name: $
|
|
185
|
+
label={{ name: $T("constructor.props.size.height") }}
|
|
186
186
|
value={component.properties.size.height}
|
|
187
187
|
onUpdate={(value) => updateProperty("size.height", value as number, component, onPropertyChange)}
|
|
188
188
|
number={{ minNum: 1, maxNum: 1000, step: 1 }}
|
|
189
189
|
type="number"
|
|
190
190
|
/>
|
|
191
191
|
<UI.Input
|
|
192
|
-
label={{ name: $
|
|
192
|
+
label={{ name: $T("constructor.props.size.width") }}
|
|
193
193
|
value={component.properties.size.width}
|
|
194
194
|
onUpdate={(value) => updateProperty("size.width", value as number, component, onPropertyChange)}
|
|
195
195
|
number={{ minNum: 1, maxNum: 1000, step: 1 }}
|
package/dist/TextField/README.md
CHANGED
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
- Поддерживает настройку размера текста и цвета
|
|
100
100
|
- Включает настройки оформления (жирный, курсив, фон)
|
|
101
101
|
- Имеет различные наборы полей в зависимости от режима (`forConstructor`)
|
|
102
|
-
- Использует систему локализации через `$
|
|
102
|
+
- Использует систему локализации через `$T('constructor.props.*')`
|
|
103
103
|
|
|
104
104
|
## Заметки
|
|
105
105
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<div
|
|
17
17
|
id={`${id}-${crypto.randomUUID().slice(0, 6)}`}
|
|
18
|
-
class={twMerge(`relative flex w-full flex-col items-center
|
|
18
|
+
class={twMerge(`relative flex w-full flex-col items-center ${background ? "rounded-2xl bg-max px-6 py-2" : ""}`, wrapperClass)}
|
|
19
19
|
>
|
|
20
20
|
<p class={twMerge(`w-full text-center ${textSize[content.size ?? "base"]}`, content.class)}>
|
|
21
21
|
{content.name}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { T } from "../locales/i18n"
|
|
3
3
|
import { updateProperty, type ITextFieldProps, type IUIComponentHandler, type UIComponent } from "../types"
|
|
4
4
|
import * as UI from "../index"
|
|
5
5
|
import { optionsStore } from "../options"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
{#snippet TextFieldSize()}
|
|
37
37
|
<UI.Select
|
|
38
|
-
label={{ name: $
|
|
38
|
+
label={{ name: $T("constructor.props.size") }}
|
|
39
39
|
type="buttons"
|
|
40
40
|
value={currentType}
|
|
41
41
|
options={$optionsStore.TEXTFIELD_SIZE_OPTIONS}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
{#snippet TextFieldName()}
|
|
47
47
|
<UI.Input
|
|
48
|
-
label={{ name: $
|
|
48
|
+
label={{ name: $T("constructor.props.label") }}
|
|
49
49
|
value={component.properties.content.name}
|
|
50
50
|
onUpdate={(value) => updateProperty("content.name", value as string, component, onPropertyChange)}
|
|
51
51
|
/>
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
{#snippet TextFieldColors()}
|
|
55
55
|
<UI.Select
|
|
56
|
-
label={{ name: $
|
|
56
|
+
label={{ name: $T("constructor.props.textcolors") }}
|
|
57
57
|
type="buttons"
|
|
58
58
|
options={$optionsStore.TEXT_COLOR_OPTIONS}
|
|
59
59
|
value={initialColor}
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
{#snippet TextFieldSettings()}
|
|
66
66
|
<UI.Select
|
|
67
|
-
label={{ name: $
|
|
67
|
+
label={{ name: $T("constructor.props.textfield.settings") }}
|
|
68
68
|
type="buttons"
|
|
69
69
|
multiSelect={true}
|
|
70
70
|
value={$optionsStore.TEXTFIELD_SETTINGS_OPTIONS.filter((opt) => {
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
|
|
112
112
|
{#snippet TextFieldComponentClass()}
|
|
113
113
|
<UI.Input
|
|
114
|
-
label={{ name: $
|
|
114
|
+
label={{ name: $T("constructor.props.componentclass") }}
|
|
115
115
|
value={component.properties.content.class}
|
|
116
116
|
onUpdate={(value) => updateProperty("content.class", value as string, component, onPropertyChange)}
|
|
117
117
|
/>
|