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.
Files changed (54) hide show
  1. package/dist/Accordion/AccordionProps.svelte +7 -7
  2. package/dist/Accordion/README.md +1 -1
  3. package/dist/Button/ButtonProps.svelte +17 -17
  4. package/dist/Button/README.md +1 -1
  5. package/dist/ColorPicker/ColorPickerProps.svelte +2 -2
  6. package/dist/ColorPicker/README.md +1 -1
  7. package/dist/CommonSnippets.svelte +31 -16
  8. package/dist/CommonSnippets.svelte.d.ts +1 -1
  9. package/dist/ComponentExample.svelte +5 -5
  10. package/dist/FileAttach/FileAttach.svelte +3 -3
  11. package/dist/FileAttach/FileAttachProps.svelte +8 -8
  12. package/dist/FileAttach/README.md +1 -1
  13. package/dist/Graph/GraphProps.svelte +2 -2
  14. package/dist/Graph/README.md +1 -1
  15. package/dist/Input/InputProps.svelte +36 -28
  16. package/dist/Joystick/JoystickProps.svelte +6 -6
  17. package/dist/Joystick/README.md +1 -1
  18. package/dist/Map/Map.svelte +2 -2
  19. package/dist/Map/MapProps.svelte +3 -3
  20. package/dist/Map/README.md +1 -1
  21. package/dist/Map/mapWrapper/MapLibre.svelte +2 -2
  22. package/dist/ModalStackStore.d.ts +0 -2
  23. package/dist/ModalStackStore.js +1 -9
  24. package/dist/ProgressBar/ProgressBarProps.svelte +8 -8
  25. package/dist/ProgressBar/README.md +1 -1
  26. package/dist/Select/README.md +1 -1
  27. package/dist/Select/Select.svelte +2 -2
  28. package/dist/Select/SelectProps.svelte +15 -14
  29. package/dist/Slider/README.md +1 -1
  30. package/dist/Slider/SliderProps.svelte +3 -3
  31. package/dist/Switch/README.md +1 -1
  32. package/dist/Switch/SwitchProps.svelte +13 -13
  33. package/dist/Table/README.md +1 -1
  34. package/dist/Table/Table.svelte +6 -6
  35. package/dist/Table/TableProps.svelte +33 -33
  36. package/dist/Tabs/README.md +1 -1
  37. package/dist/Tabs/TabsProps.svelte +11 -11
  38. package/dist/TextField/README.md +1 -1
  39. package/dist/TextField/TextField.svelte +1 -1
  40. package/dist/TextField/TextFieldProps.svelte +6 -6
  41. package/dist/VideoViewer/VideoViewer.svelte +147 -0
  42. package/dist/VideoViewer/VideoViewer.svelte.d.ts +4 -0
  43. package/dist/Widget/README.md +1 -1
  44. package/dist/Widget/WidgetProps.svelte +10 -10
  45. package/dist/index.d.ts +2 -1
  46. package/dist/index.js +2 -0
  47. package/dist/libIcons/Error.svelte +8 -0
  48. package/dist/libIcons/Error.svelte.d.ts +18 -0
  49. package/dist/locales/i18n.d.ts +1 -1
  50. package/dist/locales/i18n.js +1 -1
  51. package/dist/locales/translations.js +5 -0
  52. package/dist/options.js +161 -161
  53. package/dist/types.d.ts +8 -2
  54. package/package.json +9 -9
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { getContext } from "svelte"
3
- import { t } from "../locales/i18n"
3
+ import { T } from "../locales/i18n"
4
4
  import type { IInputProps, UIComponent, IOption, IUIComponentHandler } from "../types"
5
5
  import * as UI from ".."
6
6
  import { optionsStore } from "../options"
7
7
  import { twMerge } from "tailwind-merge"
8
8
  import Library from "../libIcons/Library.svelte"
9
+ import CommonSnippets from "../CommonSnippets.svelte"
9
10
 
10
11
  const {
11
12
  component,
@@ -91,7 +92,7 @@
91
92
 
92
93
  {#snippet InputVariable()}
93
94
  <UI.Select
94
- label={{ name: $t("constructor.props.variable") }}
95
+ label={{ name: $T("constructor.props.variable") }}
95
96
  type="input"
96
97
  options={VARIABLE_OPTIONS}
97
98
  value={VARIABLE_OPTIONS.find((opt) => opt.value === component.properties.id)}
@@ -104,7 +105,7 @@
104
105
 
105
106
  {#snippet InputAccess()}
106
107
  <UI.Select
107
- label={{ name: $t("constructor.props.access") }}
108
+ label={{ name: $T("constructor.props.access") }}
108
109
  type="buttons"
109
110
  options={$optionsStore.ACCESS_OPTION}
110
111
  value={$optionsStore.ACCESS_OPTION.find((o) => o.value === component.access)}
@@ -114,7 +115,7 @@
114
115
 
115
116
  {#snippet InputLabel()}
116
117
  <UI.Input
117
- label={{ name: $t("constructor.props.label") }}
118
+ label={{ name: $T("constructor.props.label") }}
118
119
  value={component.properties.label.name}
119
120
  onUpdate={(value) => updateProperty("label.name", value as string)}
120
121
  />
@@ -122,7 +123,7 @@
122
123
 
123
124
  {#snippet InputLabelAlign()}
124
125
  <UI.Select
125
- label={{ name: $t("constructor.props.align") }}
126
+ label={{ name: $T("constructor.props.align") }}
126
127
  type="buttons"
127
128
  value={initialAlign}
128
129
  options={$optionsStore.TEXT_ALIGN_OPTIONS}
@@ -132,7 +133,7 @@
132
133
 
133
134
  {#snippet InputType()}
134
135
  <UI.Select
135
- label={{ name: $t("constructor.props.type") }}
136
+ label={{ name: $T("constructor.props.type") }}
136
137
  options={$optionsStore.INPUT_TYPE_OPTIONS}
137
138
  type="buttons"
138
139
  value={$optionsStore.INPUT_TYPE_OPTIONS.find((opt) => opt.value === (component.properties.type || "text"))}
@@ -143,7 +144,7 @@
143
144
  updateProperty("number.minNum", 0)
144
145
  updateProperty("number.maxNum", Math.pow(2, component.properties.range.end - component.properties.range.start + 1) - 1)
145
146
  updateProperty("number.step", 1)
146
- updateProperty("help.info", `${$t("constructor.props.maxnum")}: ${component.properties.number.maxNum}`)
147
+ updateProperty("help.info", `${$T("constructor.props.maxnum")}: ${component.properties.number.maxNum}`)
147
148
  } else {
148
149
  updateProperty("help.info", "")
149
150
  }
@@ -153,7 +154,7 @@
153
154
  />
154
155
  {#if component.properties.type === "text" || component.properties.type === "password" || component.properties.type === "text-area"}
155
156
  <UI.Input
156
- label={{ name: $t("constructor.props.maxlength") }}
157
+ label={{ name: $T("constructor.props.maxlength") }}
157
158
  type="number"
158
159
  number={{ minNum: 1, maxNum: 1000000, step: 1 }}
159
160
  value={component.properties.maxlength}
@@ -161,7 +162,7 @@
161
162
  />
162
163
  <div class="flex items-end">
163
164
  <UI.Input
164
- label={{ name: $t("constructor.props.regexp") }}
165
+ label={{ name: $T("constructor.props.regexp") }}
165
166
  value={component.properties.help.regExp}
166
167
  maxlength={150}
167
168
  componentClass={isValidRegExp === false ? "!border-2 !border-red-400" : ""}
@@ -169,13 +170,13 @@
169
170
  />
170
171
  <UI.Button
171
172
  wrapperClass="w-8"
172
- content={{ icon: Library, info: { text: $t("constructor.props.regexp.library.info"), side: "top" } }}
173
+ content={{ icon: Library, info: { text: $T("constructor.props.regexp.library.info"), side: "top" } }}
173
174
  onClick={() => {
174
175
  showRegExpLibrary = !showRegExpLibrary
175
176
  }}
176
177
  />
177
178
  {#if showRegExpLibrary}
178
- <UI.Modal title={$t("constructor.props.regexp.library.info")} bind:isOpen={showRegExpLibrary} wrapperClass="w-200 h-[80%]">
179
+ <UI.Modal title={$T("constructor.props.regexp.library.info")} bind:isOpen={showRegExpLibrary} wrapperClass="w-200 h-[80%]">
179
180
  {#snippet main()}
180
181
  {#each $optionsStore.INPUT_REGEXP_OPTIONS as regexp}
181
182
  <div
@@ -196,14 +197,14 @@
196
197
 
197
198
  {#if component.properties.type === "text-area"}
198
199
  <UI.Input
199
- label={{ name: $t("constructor.props.textarea.rows") }}
200
+ label={{ name: $T("constructor.props.textarea.rows") }}
200
201
  value={component.properties.textareaRows}
201
202
  onUpdate={(value) => updateProperty("textareaRows", value as string)}
202
203
  />
203
204
  {/if}
204
205
  {#if component.properties.type === "text" || component.properties.type === "text-area"}
205
206
  <UI.Select
206
- label={{ name: $t("constructor.props.align.content") }}
207
+ label={{ name: $T("constructor.props.align.content") }}
207
208
  options={$optionsStore.TEXT_ALIGN_OPTIONS}
208
209
  type="buttons"
209
210
  value={$optionsStore.TEXT_ALIGN_OPTIONS.find(
@@ -217,7 +218,7 @@
217
218
  {:else if component.properties.type === "number" && !component.properties.readonly && !component.properties.disabled}
218
219
  <div class="flex">
219
220
  <UI.Input
220
- label={{ name: $t("constructor.props.min") }}
221
+ label={{ name: $T("constructor.props.min") }}
221
222
  value={component.properties.number.minNum as number}
222
223
  type="number"
223
224
  onUpdate={(value) => {
@@ -225,7 +226,7 @@
225
226
  }}
226
227
  />
227
228
  <UI.Input
228
- label={{ name: $t("constructor.props.max") }}
229
+ label={{ name: $T("constructor.props.max") }}
229
230
  value={component.properties.number.maxNum as number}
230
231
  type="number"
231
232
  onUpdate={(value) => {
@@ -233,7 +234,7 @@
233
234
  }}
234
235
  />
235
236
  <UI.Input
236
- label={{ name: $t("constructor.props.step") }}
237
+ label={{ name: $T("constructor.props.step") }}
237
238
  value={component.properties.number.step as number}
238
239
  type="number"
239
240
  onUpdate={(value) => updateProperty("number.step", Number(value))}
@@ -241,7 +242,7 @@
241
242
  </div>
242
243
  {:else if component.properties.type === "bitMode"}
243
244
  <UI.Slider
244
- label={{ name: $t("constructor.props.range") }}
245
+ label={{ name: $T("constructor.props.range") }}
245
246
  type="range"
246
247
  number={{ minNum: 0, maxNum: 31, step: 1 }}
247
248
  value={[component.properties.range.start, component.properties.range.end]}
@@ -252,7 +253,7 @@
252
253
  updateProperty("number.minNum", 0)
253
254
  updateProperty("number.maxNum", Math.pow(2, component.properties.range.end - component.properties.range.start + 1) - 1)
254
255
  updateProperty("number.step", 1)
255
- updateProperty("help.info", `${$t("constructor.props.maxnum")}: ${component.properties.number.maxNum}`)
256
+ updateProperty("help.info", `${$T("constructor.props.maxnum")}: ${component.properties.number.maxNum}`)
256
257
  }
257
258
  }}
258
259
  />
@@ -261,7 +262,7 @@
261
262
 
262
263
  {#snippet InputPlaceholder()}
263
264
  <UI.Input
264
- label={{ name: $t("constructor.props.placeholder") }}
265
+ label={{ name: $T("constructor.props.placeholder") }}
265
266
  value={component.properties.placeholder as string}
266
267
  onUpdate={(value) => updateProperty("placeholder", value)}
267
268
  />
@@ -269,7 +270,7 @@
269
270
 
270
271
  {#snippet InputInfo()}
271
272
  <UI.Input
272
- label={{ name: $t("constructor.props.info") }}
273
+ label={{ name: $T("constructor.props.info") }}
273
274
  value={component.properties.help.info as string}
274
275
  onUpdate={(value) => updateProperty("help.info", value)}
275
276
  />
@@ -311,7 +312,7 @@
311
312
 
312
313
  {#snippet InputAutocomplete()}
313
314
  <UI.Select
314
- label={{ name: $t("constructor.props.autocomplete") }}
315
+ label={{ name: $T("constructor.props.autocomplete") }}
315
316
  options={$optionsStore.AUTOCOMPLETE_CONSTRUCTOR_OPTIONS}
316
317
  value={$optionsStore.AUTOCOMPLETE_CONSTRUCTOR_OPTIONS.find((opt) => opt.value === (component.properties.help.autocomplete || "off"))}
317
318
  onUpdate={(option) => updateProperty("help.autocomplete", (option as UI.IOption).value as string)}
@@ -321,7 +322,7 @@
321
322
  {#snippet InputColors()}
322
323
  <UI.Select
323
324
  wrapperClass="h-14"
324
- label={{ name: $t("constructor.props.colors") }}
325
+ label={{ name: $T("constructor.props.colors") }}
325
326
  type="buttons"
326
327
  options={$optionsStore.COLOR_OPTIONS}
327
328
  value={initialColor}
@@ -330,12 +331,12 @@
330
331
  {/snippet}
331
332
 
332
333
  {#snippet InputIdentificator()}
333
- <UI.Input label={{ name: $t("constructor.props.id") }} value={component.properties.id} onUpdate={(value) => updateProperty("id", value as string)} />
334
+ <UI.Input label={{ name: $T("constructor.props.id") }} value={component.properties.id} onUpdate={(value) => updateProperty("id", value as string)} />
334
335
  {/snippet}
335
336
 
336
337
  {#snippet InputWrapperClass()}
337
338
  <UI.Input
338
- label={{ name: $t("constructor.props.wrapperclass") }}
339
+ label={{ name: $T("constructor.props.wrapperclass") }}
339
340
  value={component.properties.wrapperClass}
340
341
  onUpdate={(value) => updateProperty("wrapperClass", value as string)}
341
342
  />
@@ -343,7 +344,7 @@
343
344
 
344
345
  {#snippet InputLabelClass()}
345
346
  <UI.Input
346
- label={{ name: $t("constructor.props.label.class") }}
347
+ label={{ name: $T("constructor.props.label.class") }}
347
348
  value={component.properties.label.class}
348
349
  onUpdate={(value) => updateProperty("label.class", value as string)}
349
350
  />
@@ -351,19 +352,23 @@
351
352
 
352
353
  {#snippet InputComponentClass()}
353
354
  <UI.Input
354
- label={{ name: $t("constructor.props.componentclass") }}
355
+ label={{ name: $T("constructor.props.componentclass") }}
355
356
  value={component.properties.componentClass}
356
357
  onUpdate={(value) => updateProperty("componentClass", twMerge(component.properties.componentClass, value as string))}
357
358
  />
358
359
  {/snippet}
359
360
 
360
361
  {#snippet InputValue()}
361
- <UI.Input label={{ name: $t("constructor.props.value") }} value={component.properties.value} onUpdate={(value) => updateProperty("value", value as string)} />
362
+ <UI.Input
363
+ label={{ name: $T("constructor.props.defaultvalue") }}
364
+ value={component.properties.value}
365
+ onUpdate={(value) => updateProperty("value", value as string)}
366
+ />
362
367
  {/snippet}
363
368
 
364
369
  {#snippet InputDisabled()}
365
370
  <UI.Switch
366
- label={{ name: $t("constructor.props.disabled") }}
371
+ label={{ name: $T("constructor.props.disabled") }}
367
372
  value={component.properties.disabled}
368
373
  options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
369
374
  onChange={(value) => updateProperty("disabled", value)}
@@ -378,9 +383,11 @@
378
383
  {@render InputType()}
379
384
  </div>
380
385
  <div class="flex w-1/3 flex-col px-2">
386
+ {@render InputValue()}
381
387
  {@render InputPlaceholder()}
382
388
  {@render InputInfo()}
383
389
  {@render InputSettings()}
390
+ <CommonSnippets snippet="BitModeInfo" {component} {onPropertyChange} />
384
391
  </div>
385
392
  <div class="flex w-1/3 flex-col px-2">
386
393
  {@render InputLabel()}
@@ -403,6 +410,7 @@
403
410
  {@render InputAccess()}
404
411
  {@render InputValue()}
405
412
  {@render InputType()}
413
+ <CommonSnippets snippet="BitModeInfo" {component} {onPropertyChange} />
406
414
  </div>
407
415
  <div class="flex w-1/3 flex-col px-2">
408
416
  {@render InputPlaceholder()}
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { getContext } from "svelte"
3
- import { t } from "../locales/i18n"
3
+ import { T } from "../locales/i18n"
4
4
  import { type UIComponent, type IGraphProps, updateProperty, type IOption, type IUIComponentHandler } from "../types"
5
5
  import * as UI from ".."
6
6
  import { ICONS } from "../icons"
@@ -37,9 +37,9 @@
37
37
  <div class="mt-2 flex w-full justify-around gap-2">
38
38
  {#each component.properties.axes as axe, index}
39
39
  {@const axesOptions = [
40
- { name: $t("constructor.props.joystick.pitch.axe"), info: "", regExp: /^[\p{L}0-9\-_"':{}]+$/u },
41
- { name: $t("constructor.props.joystick.yaw.axe"), info: "", regExp: /^[\p{L}0-9\-_"':{}]+$/u },
42
- { name: $t("constructor.props.joystick.roll.axe"), info: $t("constructor.props.joystick.axes.info"), regExp: /^[\p{L}0-9\-_"':{}]*$/u },
40
+ { name: $T("constructor.props.joystick.pitch.axe"), info: "", regExp: /^[\p{L}0-9\-_"':{}]+$/u },
41
+ { name: $T("constructor.props.joystick.yaw.axe"), info: "", regExp: /^[\p{L}0-9\-_"':{}]+$/u },
42
+ { name: $T("constructor.props.joystick.roll.axe"), info: $T("constructor.props.joystick.axes.info"), regExp: /^[\p{L}0-9\-_"':{}]*$/u },
43
43
  ]}
44
44
  <div class="flex flex-col gap-1">
45
45
  <UI.Input
@@ -95,7 +95,7 @@
95
95
  <CommonSnippets
96
96
  snippet="IconsLib"
97
97
  initialValue={{
98
- name: $t("constructor.props.buttonIcon"),
98
+ name: $T("constructor.props.buttonIcon"),
99
99
  icon: component.properties.buttonIcon,
100
100
  updateProperty: (icon: string) => updateProperty("buttonIcon", icon as string, component, onPropertyChange),
101
101
  icons: { array: ICONS },
@@ -124,7 +124,7 @@
124
124
  <CommonSnippets
125
125
  snippet="IconsLib"
126
126
  initialValue={{
127
- name: $t("constructor.props.buttonIcon"),
127
+ name: $T("constructor.props.buttonIcon"),
128
128
  icon: component.properties.buttonIcon,
129
129
  updateProperty: (icon: string) => updateProperty("buttonIcon", icon as string, component, onPropertyChange),
130
130
  icons: { array: ICONS },
@@ -124,7 +124,7 @@
124
124
  - Поддерживает настройку осей управления (названия, диапазоны значений)
125
125
  - Включает настройки чувствительности и иконки центральной кнопки
126
126
  - Имеет различные наборы полей в зависимости от режима (`forConstructor`)
127
- - Использует систему локализации через `$t('constructor.props.*')`
127
+ - Использует систему локализации через `$T('constructor.props.*')`
128
128
 
129
129
  ## Заметки
130
130
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { t } from "../locales/i18n"
2
+ import { T } from "../locales/i18n"
3
3
  import type { IDeviceGNSS, IMapProps } from "../types"
4
4
  import { onDestroy, onMount } from "svelte"
5
5
  import { fade } from "svelte/transition"
@@ -112,7 +112,7 @@
112
112
 
113
113
  <CustomControl position="top-left">
114
114
  <div class="flex items-center gap-2 px-2 py-1 text-black">
115
- <label for="timeout" class="text-sm font-medium">{$t("constructor.props.map.timeout")}</label>
115
+ <label for="timeout" class="text-sm font-medium">{$T("constructor.props.map.timeout")}</label>
116
116
  <select
117
117
  id="timeout"
118
118
  class="rounded px-2 py-1 text-sm"
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { t } from "../locales/i18n"
2
+ import { T } from "../locales/i18n"
3
3
  import { type UIComponent, type IGraphProps, updateProperty, type IUIComponentHandler } from "../types"
4
4
  import { ICONS } from "../icons"
5
5
  import { optionsStore } from "../options"
@@ -40,7 +40,7 @@
40
40
  <CommonSnippets
41
41
  snippet="IconsLib"
42
42
  initialValue={{
43
- name: $t("constructor.props.markerIcon"),
43
+ name: $T("constructor.props.markerIcon"),
44
44
  icon: component.properties.markerIcon,
45
45
  updateProperty: (icon: string) => updateProperty("markerIcon", icon as string, component, onPropertyChange),
46
46
  icons: { array: ICONS },
@@ -65,7 +65,7 @@
65
65
  <CommonSnippets
66
66
  snippet="IconsLib"
67
67
  initialValue={{
68
- name: $t("constructor.props.markerIcon"),
68
+ name: $T("constructor.props.markerIcon"),
69
69
  icon: component.properties.markerIcon,
70
70
  updateProperty: (icon: string) => updateProperty("markerIcon", icon as string, component, onPropertyChange),
71
71
  icons: { array: ICONS },
@@ -129,7 +129,7 @@
129
129
  - Поддерживает выбор иконки для маркера устройства
130
130
  - Включает настройки доступа и переменной устройства
131
131
  - Имеет различные наборы полей в зависимости от режима (`forConstructor`)
132
- - Использует систему локализации через `$t('constructor.props.*')`
132
+ - Использует систему локализации через `$T('constructor.props.*')`
133
133
 
134
134
  ## Заметки
135
135
 
@@ -2,7 +2,7 @@
2
2
  import { onDestroy, onMount, type Snippet } from "svelte"
3
3
  import { prepareMapContext } from "./contexts.svelte.js"
4
4
  import { loadMapLibre } from "./utils.js"
5
- import { t } from "../../locales/i18n"
5
+ import { T } from "../../locales/i18n"
6
6
 
7
7
  interface Props {
8
8
  class?: string
@@ -72,7 +72,7 @@
72
72
  <div class="{className} {!hasConnection ? 'bg-(--border-color)/50' : ''}" bind:this={container}>
73
73
  {#if isLoading || !hasConnection}
74
74
  <div class="h-full w-full flex items-center justify-center">
75
- <h2>{isLoading ? $t("constructor.props.map.loading") : $t("constructor.props.map.noconnection")}</h2>
75
+ <h2>{isLoading ? $T("constructor.props.map.loading") : $T("constructor.props.map.noconnection")}</h2>
76
76
  </div>{/if}
77
77
 
78
78
  {#if map}
@@ -2,6 +2,4 @@ export declare const ModalStack: {
2
2
  subscribe: (this: void, run: import("svelte/store").Subscriber<string[]>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
3
3
  open: (id: string) => void;
4
4
  close: (id: string) => void;
5
- getTopmost: () => string;
6
- isInStack: (id: string) => boolean;
7
5
  };
@@ -1,4 +1,4 @@
1
- import { writable, get } from "svelte/store";
1
+ import { writable } from "svelte/store";
2
2
  const ModalStore = writable([]);
3
3
  export const ModalStack = {
4
4
  subscribe: ModalStore.subscribe,
@@ -8,12 +8,4 @@ export const ModalStack = {
8
8
  close: (id) => {
9
9
  ModalStore.update((state) => state.filter((item) => item !== id));
10
10
  },
11
- getTopmost: () => {
12
- const state = get(ModalStore);
13
- return state[state.length - 1];
14
- },
15
- isInStack: (id) => {
16
- const state = get(ModalStore);
17
- return state.includes(id);
18
- },
19
11
  };
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { getContext } from "svelte"
3
- import { t } from "../locales/i18n"
3
+ import { T } from "../locales/i18n"
4
4
  import { type UIComponent, type IProgressBarProps, updateProperty, type IUIComponentHandler } from "../types"
5
5
  import * as UI from ".."
6
6
  import { optionsStore } from "../options"
@@ -26,7 +26,7 @@
26
26
  {#snippet ProgressBarType()}
27
27
  <UI.Select
28
28
  wrapperClass="!h-14"
29
- label={{ name: $t("constructor.props.type") }}
29
+ label={{ name: $T("constructor.props.type") }}
30
30
  disabled={component.properties.bitMode}
31
31
  type="buttons"
32
32
  options={$optionsStore.SWITCH_OPTIONS.filter((o) => o.value !== "checkbox")}
@@ -37,7 +37,7 @@
37
37
 
38
38
  {#snippet ProgressBarUnits()}
39
39
  <UI.Input
40
- label={{ name: $t("constructor.props.units") }}
40
+ label={{ name: $T("constructor.props.units") }}
41
41
  value={component.properties.number.units}
42
42
  onUpdate={(value) => updateProperty("number.units", value, component, onPropertyChange)}
43
43
  />
@@ -46,7 +46,7 @@
46
46
  {#snippet ProgressBarOptions()}
47
47
  <div class="space-y-4" bind:this={itemsContainer}>
48
48
  <div class="m-0 flex items-center justify-center gap-2">
49
- <h4>{$t("constructor.props.progressbar.title")}</h4>
49
+ <h4>{$T("constructor.props.progressbar.title")}</h4>
50
50
  <UI.Button
51
51
  wrapperClass="w-8"
52
52
  content={{ icon: ButtonAdd }}
@@ -81,7 +81,7 @@
81
81
  }}
82
82
  />
83
83
  <UI.Input
84
- label={{ name: $t("constructor.props.optionname") }}
84
+ label={{ name: $T("constructor.props.optionname") }}
85
85
  wrapperClass="w-1/4"
86
86
  value={progress.name}
87
87
  onUpdate={(value) => {
@@ -92,7 +92,7 @@
92
92
  />
93
93
  {#if forConstructor}
94
94
  <UI.Select
95
- label={{ name: $t("constructor.props.colors") }}
95
+ label={{ name: $T("constructor.props.colors") }}
96
96
  wrapperClass="w-1/2 h-14.5"
97
97
  type="buttons"
98
98
  options={$optionsStore.COLOR_OPTIONS.filter((option) => option.value !== "bg-max")}
@@ -107,7 +107,7 @@
107
107
  />
108
108
  {:else}
109
109
  <UI.Input
110
- label={{ name: $t("constructor.props.optionvalue") }}
110
+ label={{ name: $T("constructor.props.optionvalue") }}
111
111
  wrapperClass="w-1/4"
112
112
  value={(component.properties.value || [])[index]?.Value}
113
113
  type="number"
@@ -126,7 +126,7 @@
126
126
  }}
127
127
  />
128
128
  <UI.Input
129
- label={{ name: $t("constructor.props.optionclass") }}
129
+ label={{ name: $T("constructor.props.optionclass") }}
130
130
  wrapperClass="w-1/3"
131
131
  value={progress.class}
132
132
  onUpdate={(value) => {
@@ -134,7 +134,7 @@
134
134
  - Поддерживает добавление и удаление элементов индикатора
135
135
  - Включает настройки типа, диапазона значений и единиц измерения
136
136
  - Имеет различные наборы полей в зависимости от режима (`forConstructor`)
137
- - Использует систему локализации через `$t('constructor.props.*')`
137
+ - Использует систему локализации через `$T('constructor.props.*')`
138
138
 
139
139
  ## Заметки
140
140
 
@@ -153,7 +153,7 @@
153
153
  - Поддерживает настройку типа отображения, значения и мультивыбора
154
154
  - Включает управление списком опций с возможностью добавления/удаления
155
155
  - Имеет различные наборы полей в зависимости от режима (`forConstructor`)
156
- - Использует систему локализации через `$t('constructor.props.*')`
156
+ - Использует систему локализации через `$T('constructor.props.*')`
157
157
 
158
158
  ## Заметки
159
159
 
@@ -4,7 +4,7 @@
4
4
  import { onMount } from "svelte"
5
5
  import type { IOption, ISelectProps } from "../types"
6
6
  import { twMerge } from "tailwind-merge"
7
- import { t } from "../locales/i18n"
7
+ import { T } from "../locales/i18n"
8
8
 
9
9
  let isDropdownOpen = $state(false)
10
10
  let dropdownElement: HTMLDivElement
@@ -120,7 +120,7 @@
120
120
  aria-expanded={isDropdownOpen}
121
121
  {disabled}
122
122
  >
123
- {value?.name || $t("common.select_tag")}
123
+ {value?.name || $T("common.select_tag")}
124
124
  </button>
125
125
 
126
126
  {#if isDropdownOpen}
@@ -1,12 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { getContext, onMount } from "svelte"
3
- import { t } from "../locales/i18n"
3
+ import { T } from "../locales/i18n"
4
4
  import { type UIComponent, type ISelectProps, type IOption, updateProperty, type IUIComponentHandler } from "../types"
5
5
  import * as UI from ".."
6
6
  import ButtonDelete from "../libIcons/ButtonDelete.svelte"
7
7
  import ButtonAdd from "../libIcons/ButtonAdd.svelte"
8
8
  import { optionsStore } from "../options.js"
9
- import { twMerge } from "tailwind-merge"
10
9
  import CommonSnippets from "../CommonSnippets.svelte"
11
10
 
12
11
  const {
@@ -58,7 +57,7 @@
58
57
 
59
58
  {#snippet SelectArgument()}
60
59
  <UI.Select
61
- label={{ name: $t("constructor.props.argument") }}
60
+ label={{ name: $T("constructor.props.argument") }}
62
61
  type="buttons"
63
62
  value={$optionsStore.FULL_ARGUMENT_OPTION.find((h) => h.value === component.eventHandler.Argument) ??
64
63
  $optionsStore.FULL_ARGUMENT_OPTION.find((h) => h.value === "")}
@@ -73,14 +72,14 @@
73
72
  value={component.eventHandler.Argument}
74
73
  maxlength={32}
75
74
  disabled={component.eventHandler.Argument == "Save" || component.eventHandler.Argument == "NoSave"}
76
- help={{ info: $t("constructor.props.argument.info"), autocomplete: "on", regExp: /^[a-zA-Z0-9\-_]{0,32}$/ }}
75
+ help={{ info: $T("constructor.props.argument.info"), autocomplete: "on", regExp: /^[a-zA-Z0-9\-_]{0,32}$/ }}
77
76
  onUpdate={(value) => onPropertyChange({ eventHandler: { Argument: value as string } })}
78
77
  />
79
78
  {/snippet}
80
79
 
81
80
  {#snippet SelectType()}
82
81
  <UI.Select
83
- label={{ name: $t("constructor.props.type") }}
82
+ label={{ name: $T("constructor.props.type") }}
84
83
  type="buttons"
85
84
  value={currentType}
86
85
  options={$optionsStore.SELECT_TYPE_OPTIONS}
@@ -96,7 +95,7 @@
96
95
  {#snippet SelectValueType()}
97
96
  <UI.Select
98
97
  wrapperClass="h-14"
99
- label={{ name: $t("constructor.props.valuetype") }}
98
+ label={{ name: $T("constructor.props.valuetype") }}
100
99
  type="buttons"
101
100
  disabled={component.properties.bitMode}
102
101
  options={$optionsStore.SELECT_VALUE_TYPE_OPTIONS}
@@ -116,7 +115,7 @@
116
115
 
117
116
  {#snippet SelectSettings()}
118
117
  <UI.Switch
119
- label={{ name: $t("constructor.props.bitMode") }}
118
+ label={{ name: $T("constructor.props.bitMode") }}
120
119
  value={component.properties.bitMode}
121
120
  options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
122
121
  onChange={(value) => {
@@ -132,7 +131,7 @@
132
131
 
133
132
  {#if component.properties.type === "buttons" && !component.properties.bitMode}
134
133
  <UI.Switch
135
- label={{ name: $t("constructor.props.multiselect") }}
134
+ label={{ name: $T("constructor.props.multiselect") }}
136
135
  value={component.properties.multiSelect}
137
136
  options={[{ id: crypto.randomUUID(), value: 0, class: "" }]}
138
137
  onChange={(value) => {
@@ -143,7 +142,7 @@
143
142
 
144
143
  {#if component.properties.bitMode}
145
144
  <UI.Slider
146
- label={{ name: $t("constructor.props.range") }}
145
+ label={{ name: $T("constructor.props.range") }}
147
146
  type="range"
148
147
  number={{ minNum: 0, maxNum: 31, step: 1 }}
149
148
  value={[component.properties.range.start, component.properties.range.end]}
@@ -162,7 +161,7 @@
162
161
 
163
162
  <div class="space-y-4" bind:this={itemsContainer}>
164
163
  <div class="m-0 flex items-center justify-center gap-2">
165
- <h4>{$t("constructor.props.options.title")}</h4>
164
+ <h4>{$T("constructor.props.options.title")}</h4>
166
165
  <UI.Button
167
166
  wrapperClass="w-8"
168
167
  content={{ icon: ButtonAdd }}
@@ -191,7 +190,7 @@
191
190
  }}
192
191
  />
193
192
  <UI.Input
194
- label={{ name: $t("constructor.props.optionname") }}
193
+ label={{ name: $T("constructor.props.optionname") }}
195
194
  wrapperClass="w-3/10"
196
195
  value={option.name}
197
196
  onUpdate={(value) => {
@@ -201,7 +200,7 @@
201
200
  }}
202
201
  />
203
202
  <UI.Input
204
- label={{ name: $t("constructor.props.optionvalue") }}
203
+ label={{ name: $T("constructor.props.optionvalue") }}
205
204
  wrapperClass="w-3/10"
206
205
  value={option.value}
207
206
  type={currentValueType.value}
@@ -217,7 +216,7 @@
217
216
  {#if forConstructor}
218
217
  <UI.Select
219
218
  wrapperClass="w-80 h-14.5"
220
- label={{ name: $t("constructor.props.colors") }}
219
+ label={{ name: $T("constructor.props.colors") }}
221
220
  type="buttons"
222
221
  options={$optionsStore.COLOR_OPTIONS}
223
222
  value={$optionsStore.COLOR_OPTIONS.find((c) => (c.value as string).includes(option.class.split(" ").find((cls: string) => cls.startsWith("bg-"))))}
@@ -229,7 +228,7 @@
229
228
  />
230
229
  {:else}
231
230
  <UI.Input
232
- label={{ name: $t("constructor.props.optionclass") }}
231
+ label={{ name: $T("constructor.props.optionclass") }}
233
232
  wrapperClass="w-3/10"
234
233
  value={option.class}
235
234
  onUpdate={(value) => {
@@ -265,6 +264,7 @@
265
264
  <div class="flex w-1/3 flex-col px-2">
266
265
  {@render SelectType()}
267
266
  {@render SelectValueType()}
267
+ <CommonSnippets snippet="BitModeInfo" {component} {onPropertyChange} />
268
268
  </div>
269
269
  <div class="flex w-1/3 flex-col px-2">
270
270
  <CommonSnippets snippet="Label" {component} {onPropertyChange} />
@@ -284,6 +284,7 @@
284
284
  <CommonSnippets snippet="Label" {component} {onPropertyChange} />
285
285
  <CommonSnippets snippet="LabelClass" {component} {onPropertyChange} />
286
286
  <CommonSnippets snippet="Disabled" {component} {onPropertyChange} />
287
+ <CommonSnippets snippet="BitModeInfo" {component} {onPropertyChange} />
287
288
  </div>
288
289
  <div class="flex w-1/3 flex-col items-center px-2">
289
290
  {@render SelectType()}
@@ -154,7 +154,7 @@
154
154
  - Поддерживает настройку типа слайдера (одиночный или диапазонный)
155
155
  - Включает настройки диапазона значений и шага
156
156
  - Имеет различные наборы полей в зависимости от режима (`forConstructor`)
157
- - Использует систему локализации через `$t('constructor.props.*')`
157
+ - Использует систему локализации через `$T('constructor.props.*')`
158
158
 
159
159
  ## Заметки
160
160