poe-svelte-ui-lib 1.1.15 → 1.1.17
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/Accordion.svelte +3 -3
- package/dist/Accordion/AccordionProps.svelte +6 -6
- package/dist/Button/Button.svelte +37 -11
- package/dist/Button/ButtonProps.svelte +3 -3
- package/dist/ColorPicker/ColorPicker.svelte +1 -1
- package/dist/ColorPicker/ColorPickerProps.svelte +2 -2
- package/dist/ComponentExample.svelte +3 -3
- package/dist/FileAttach/FileAttach.svelte +4 -4
- package/dist/Graph/Graph.svelte +2 -2
- package/dist/Graph/GraphProps.svelte +0 -2
- package/dist/Input/Input.svelte +8 -8
- package/dist/Input/InputProps.svelte +135 -3
- package/dist/Modal.svelte +3 -3
- package/dist/ProgressBar/ProgressBar.svelte +3 -2
- package/dist/ProgressBar/ProgressBarProps.svelte +67 -3
- package/dist/Select/Select.svelte +8 -8
- package/dist/Select/SelectProps.svelte +160 -13
- package/dist/Slider/Slider.svelte +6 -6
- package/dist/Slider/SliderProps.svelte +86 -3
- package/dist/Switch/Switch.svelte +5 -5
- package/dist/Switch/SwitchProps.svelte +69 -4
- package/dist/Table/Table.svelte +9 -9
- package/dist/Table/TableProps.svelte +264 -13
- package/dist/TextField/TextField.svelte +1 -4
- package/dist/TextField/TextFieldProps.svelte +82 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/locales/translations.js +24 -1
- package/dist/options.d.ts +10 -0
- package/dist/options.js +23 -1
- package/dist/types.d.ts +4 -1
- package/package.json +3 -3
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
const initialAlign = $derived(
|
|
31
|
-
$optionsStore.
|
|
31
|
+
$optionsStore.TEXT_ALIGN_OPTIONS.find((a) =>
|
|
32
32
|
(a.value as string).includes(component.properties.label?.class?.split(' ').find((cls: string) => cls.startsWith('text-'))),
|
|
33
33
|
),
|
|
34
34
|
)
|
|
@@ -51,6 +51,19 @@
|
|
|
51
51
|
updateProperty('body', newBody, component, onPropertyChange)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
const handleImageUpload = (columnIndex: number, event: Event) => {
|
|
55
|
+
const target = event.target as HTMLInputElement
|
|
56
|
+
const file = target.files?.[0]
|
|
57
|
+
if (!file) return
|
|
58
|
+
|
|
59
|
+
const reader = new FileReader()
|
|
60
|
+
reader.onload = () => {
|
|
61
|
+
const base64WithPrefix = reader.result as string
|
|
62
|
+
updateTableHeader(columnIndex, 'image', { ['src']: base64WithPrefix })
|
|
63
|
+
}
|
|
64
|
+
reader.readAsDataURL(file)
|
|
65
|
+
}
|
|
66
|
+
|
|
54
67
|
const updateButtonProperty = (columnIndex: number, buttonIndex: number, field: string, value: any) => {
|
|
55
68
|
const headers = [...component.properties.header]
|
|
56
69
|
const buttons = [...headers[columnIndex].buttons]
|
|
@@ -68,17 +81,19 @@
|
|
|
68
81
|
}
|
|
69
82
|
</script>
|
|
70
83
|
|
|
71
|
-
{#if
|
|
84
|
+
{#if forConstructor}
|
|
72
85
|
<div class="relative flex flex-row items-start justify-center">
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
87
|
+
<UI.Select
|
|
88
|
+
label={{ name: $t('constructor.props.variable') }}
|
|
89
|
+
options={VARIABLE_OPTIONS}
|
|
90
|
+
value={VARIABLE_OPTIONS.find((opt) => opt.value === component.properties.id)}
|
|
91
|
+
onUpdate={(value) => {
|
|
92
|
+
updateProperty('id', value.value as string, component, onPropertyChange, value.name?.split('—')[1].trim())
|
|
93
|
+
updateProperty('eventHandler.Variables', value.value as string, component, onPropertyChange)
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
82
97
|
<div class="flex w-1/3 flex-col px-2">
|
|
83
98
|
<UI.Select
|
|
84
99
|
wrapperClass="!h-14"
|
|
@@ -99,13 +114,13 @@
|
|
|
99
114
|
label={{ name: $t('constructor.props.align') }}
|
|
100
115
|
type="buttons"
|
|
101
116
|
value={initialAlign}
|
|
102
|
-
options={$optionsStore.
|
|
117
|
+
options={$optionsStore.TEXT_ALIGN_OPTIONS}
|
|
103
118
|
onUpdate={(option) => updateProperty('label.class', twMerge(component.properties.label.class, option.value), component, onPropertyChange)}
|
|
104
119
|
/>
|
|
105
120
|
</div>
|
|
106
121
|
</div>
|
|
107
122
|
|
|
108
|
-
<hr class="border-
|
|
123
|
+
<hr class="border-(--border-color)" />
|
|
109
124
|
|
|
110
125
|
<!-- Настройки столбцов таблицы -->
|
|
111
126
|
<div>
|
|
@@ -158,6 +173,12 @@
|
|
|
158
173
|
value={column.sortable ? 2 : 1}
|
|
159
174
|
onChange={(value) => updateTableHeader(columnIndex, 'sortable', value === 2)}
|
|
160
175
|
/>
|
|
176
|
+
<UI.Switch
|
|
177
|
+
wrapperClass="w-2/10"
|
|
178
|
+
label={{ name: $t('constructor.props.copy') }}
|
|
179
|
+
value={column.overflow?.copy ? 2 : 1}
|
|
180
|
+
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { copy: value === 2 })}
|
|
181
|
+
/>
|
|
161
182
|
<UI.Button
|
|
162
183
|
wrapperClass="w-8"
|
|
163
184
|
content={{ icon: ButtonAdd, info: $t('constructor.props.table.addaction') }}
|
|
@@ -182,6 +203,236 @@
|
|
|
182
203
|
}}
|
|
183
204
|
/>
|
|
184
205
|
</div>
|
|
206
|
+
{#if column.buttons && column.buttons.length > 0}
|
|
207
|
+
<div class="mb-5 rounded-lg p-1">
|
|
208
|
+
{#each column.buttons as button, buttonIndex (buttonIndex)}
|
|
209
|
+
<div class="mx-14 flex items-end justify-around gap-2">
|
|
210
|
+
<UI.Input
|
|
211
|
+
label={{ name: $t('constructor.props.name') }}
|
|
212
|
+
wrapperClass="!w-3/10"
|
|
213
|
+
value={button.name}
|
|
214
|
+
onUpdate={(value) => updateButtonProperty(columnIndex, buttonIndex, 'name', value)}
|
|
215
|
+
/>
|
|
216
|
+
<UI.Select
|
|
217
|
+
wrapperClass="!w-2/10"
|
|
218
|
+
label={{ name: $t('constructor.props.header') }}
|
|
219
|
+
type="buttons"
|
|
220
|
+
value={$optionsStore.HEADER_OPTIONS.find((h) => h.value === button.eventHandler?.Header)}
|
|
221
|
+
options={$optionsStore.HEADER_OPTIONS}
|
|
222
|
+
onUpdate={(option) => {
|
|
223
|
+
const handler = button.eventHandler
|
|
224
|
+
handler.Header = option.value as string
|
|
225
|
+
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
226
|
+
}}
|
|
227
|
+
/>
|
|
228
|
+
<UI.Input
|
|
229
|
+
wrapperClass="!w-2/10"
|
|
230
|
+
label={{ name: $t('constructor.props.argument') }}
|
|
231
|
+
value={button.eventHandler?.Argument}
|
|
232
|
+
onUpdate={(value) => {
|
|
233
|
+
const handler = button.eventHandler
|
|
234
|
+
handler.Argument = value as string
|
|
235
|
+
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
236
|
+
}}
|
|
237
|
+
/>
|
|
238
|
+
<UI.Input
|
|
239
|
+
wrapperClass="!w-2/10"
|
|
240
|
+
label={{ name: $t('constructor.props.table.keys') }}
|
|
241
|
+
value={button.eventHandler?.Variables.join(' ')}
|
|
242
|
+
maxlength={500}
|
|
243
|
+
help={{ info: $t('constructor.props.table.keys.info'), regExp: /^[a-zA-Z0-9\-_ ]{0,500}$/ }}
|
|
244
|
+
onUpdate={(value) => {
|
|
245
|
+
const handler = { ...button.eventHandler }
|
|
246
|
+
handler.Variables = (value as string).trim().split(/\s+/)
|
|
247
|
+
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
248
|
+
}}
|
|
249
|
+
/>
|
|
250
|
+
<UI.Button wrapperClass="w-8" content={{ icon: ButtonDelete }} onClick={() => removeButtonFromColumn(columnIndex, buttonIndex)} />
|
|
251
|
+
</div>
|
|
252
|
+
{/each}
|
|
253
|
+
</div>
|
|
254
|
+
{/if}
|
|
255
|
+
{/each}
|
|
256
|
+
</div>
|
|
257
|
+
{:else}
|
|
258
|
+
<div class="relative flex flex-row items-start justify-center">
|
|
259
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
260
|
+
<UI.Input
|
|
261
|
+
label={{ name: $t('constructor.props.id') }}
|
|
262
|
+
value={component.properties.id}
|
|
263
|
+
onUpdate={(value) => updateProperty('id', value as string, component, onPropertyChange)}
|
|
264
|
+
/>
|
|
265
|
+
<UI.Input
|
|
266
|
+
label={{ name: $t('constructor.props.wrapperclass') }}
|
|
267
|
+
value={component.properties.wrapperClass}
|
|
268
|
+
onUpdate={(value) => updateProperty('wrapperClass', value as string, component, onPropertyChange)}
|
|
269
|
+
/>
|
|
270
|
+
<UI.Select
|
|
271
|
+
wrapperClass=" h-14"
|
|
272
|
+
label={{ name: $t('constructor.props.colors') }}
|
|
273
|
+
type="buttons"
|
|
274
|
+
options={$optionsStore.COLOR_OPTIONS}
|
|
275
|
+
value={initialColor}
|
|
276
|
+
onUpdate={(option) => {
|
|
277
|
+
updateProperty('wrapperClass', twMerge(component.properties.wrapperClass, option.value), component, onPropertyChange)
|
|
278
|
+
const options = [...(component.properties?.options || [])]
|
|
279
|
+
options.forEach((o) => {
|
|
280
|
+
o['class'] = option.value
|
|
281
|
+
})
|
|
282
|
+
updateProperty('options', options, component, onPropertyChange)
|
|
283
|
+
}}
|
|
284
|
+
/>
|
|
285
|
+
</div>
|
|
286
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
287
|
+
<UI.Input
|
|
288
|
+
label={{ name: $t('constructor.props.label') }}
|
|
289
|
+
value={component.properties.label.name}
|
|
290
|
+
onUpdate={(value) => updateProperty('label.name', value as string, component, onPropertyChange)}
|
|
291
|
+
/>
|
|
292
|
+
<UI.Input
|
|
293
|
+
label={{ name: $t('constructor.props.label.class') }}
|
|
294
|
+
value={component.properties.label.class}
|
|
295
|
+
onUpdate={(value) => updateProperty('label.class', value as string, component, onPropertyChange)}
|
|
296
|
+
/>
|
|
297
|
+
<UI.Input
|
|
298
|
+
label={{ name: $t('constructor.props.footer') }}
|
|
299
|
+
value={component.properties.footer}
|
|
300
|
+
onUpdate={(value) => updateProperty('footer', value as string, component, onPropertyChange)}
|
|
301
|
+
/>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<hr class="border-(--border-color)" />
|
|
306
|
+
|
|
307
|
+
<!-- Настройки столбцов таблицы -->
|
|
308
|
+
<div>
|
|
309
|
+
<div class=" flex items-center justify-center gap-2">
|
|
310
|
+
<h4>{$t('constructor.props.table.columns')}</h4>
|
|
311
|
+
<UI.Button
|
|
312
|
+
wrapperClass="w-8"
|
|
313
|
+
content={{ icon: ButtonAdd }}
|
|
314
|
+
onClick={() => {
|
|
315
|
+
const newColumn: ITableHeader<any> = {
|
|
316
|
+
key: `column${(component.properties.header?.length || 0) + 1}`,
|
|
317
|
+
label: { name: `Column ${(component.properties.header?.length || 0) + 1}`, class: '' },
|
|
318
|
+
width: '10%',
|
|
319
|
+
sortable: false,
|
|
320
|
+
}
|
|
321
|
+
const headers = [...(component.properties.header || []), newColumn]
|
|
322
|
+
updateProperty('header', headers, component, onPropertyChange)
|
|
323
|
+
updateTableBody()
|
|
324
|
+
}}
|
|
325
|
+
/>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
{#each component.properties.header as column, columnIndex (columnIndex)}
|
|
329
|
+
<div class="mb-5">
|
|
330
|
+
<div class="mr-2 flex items-end justify-around gap-6">
|
|
331
|
+
<UI.Input
|
|
332
|
+
label={{ name: $t('constructor.props.table.columns.key') }}
|
|
333
|
+
value={column.key}
|
|
334
|
+
help={{ regExp: /^[0-9a-zA-Z_-]{0,16}$/ }}
|
|
335
|
+
onUpdate={(value) => {
|
|
336
|
+
updateTableHeader(columnIndex, 'key', value)
|
|
337
|
+
updateTableBody()
|
|
338
|
+
}}
|
|
339
|
+
/>
|
|
340
|
+
<UI.Input
|
|
341
|
+
label={{ name: $t('constructor.props.table.columns.label') }}
|
|
342
|
+
value={column.label.name}
|
|
343
|
+
onUpdate={(value) => {
|
|
344
|
+
updateTableHeader(columnIndex, 'label', { ['name']: value })
|
|
345
|
+
}}
|
|
346
|
+
/>
|
|
347
|
+
<UI.Input
|
|
348
|
+
label={{ name: $t('constructor.props.table.columns.width') }}
|
|
349
|
+
type="number"
|
|
350
|
+
value={Number(column.width.replace('%', ''))}
|
|
351
|
+
onUpdate={(value) => updateTableHeader(columnIndex, 'width', `${value}%`)}
|
|
352
|
+
/>
|
|
353
|
+
<UI.Switch
|
|
354
|
+
wrapperClass="w-2/10"
|
|
355
|
+
label={{ name: $t('constructor.props.table.columns.sortable') }}
|
|
356
|
+
value={column.sortable ? 2 : 1}
|
|
357
|
+
onChange={(value) => updateTableHeader(columnIndex, 'sortable', value === 2)}
|
|
358
|
+
/>
|
|
359
|
+
<UI.Switch
|
|
360
|
+
wrapperClass="w-2/10"
|
|
361
|
+
label={{ name: $t('constructor.props.copy') }}
|
|
362
|
+
value={column.overflow?.copy ? 2 : 1}
|
|
363
|
+
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { copy: value === 2 })}
|
|
364
|
+
/>
|
|
365
|
+
<UI.Button
|
|
366
|
+
wrapperClass="w-8"
|
|
367
|
+
content={{ icon: ButtonAdd, info: $t('constructor.props.table.addaction') }}
|
|
368
|
+
onClick={() => {
|
|
369
|
+
const newButton = {
|
|
370
|
+
name: `button${(component.properties.header[columnIndex].buttons ? component.properties.header[columnIndex].buttons.length : 0) + 1}`,
|
|
371
|
+
class: 'bg-blue',
|
|
372
|
+
eventHandler: { Header: 'SET', Argument: 'Save', Variables: [] },
|
|
373
|
+
onClick: () => {},
|
|
374
|
+
}
|
|
375
|
+
const buttons = [...(component.properties.header[columnIndex].buttons || []), newButton]
|
|
376
|
+
updateTableHeader(columnIndex, 'buttons', buttons)
|
|
377
|
+
}}
|
|
378
|
+
/>
|
|
379
|
+
<UI.Button
|
|
380
|
+
wrapperClass="w-8"
|
|
381
|
+
content={{ icon: ButtonDelete }}
|
|
382
|
+
onClick={() => {
|
|
383
|
+
const headers = [...(component.properties.header || [])]
|
|
384
|
+
headers.splice(columnIndex, 1)
|
|
385
|
+
updateProperty('header', headers, component, onPropertyChange)
|
|
386
|
+
}}
|
|
387
|
+
/>
|
|
388
|
+
</div>
|
|
389
|
+
<div class="mr-2 flex items-end justify-around gap-6">
|
|
390
|
+
<UI.Select
|
|
391
|
+
label={{ name: $t('constructor.props.align') }}
|
|
392
|
+
type="buttons"
|
|
393
|
+
value={$optionsStore.ALIGN_OPTIONS.find((a) => (a.value as string).includes(column.align) || 'left')}
|
|
394
|
+
options={$optionsStore.ALIGN_OPTIONS}
|
|
395
|
+
onUpdate={(option) => updateTableHeader(columnIndex, 'align', option.value)}
|
|
396
|
+
/>
|
|
397
|
+
<UI.Switch
|
|
398
|
+
wrapperClass="w-2/10"
|
|
399
|
+
label={{ name: $t('constructor.props.table.columns.truncated') }}
|
|
400
|
+
value={column.overflow?.truncated ? 2 : 1}
|
|
401
|
+
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { ['truncated']: value === 2 })}
|
|
402
|
+
/>
|
|
403
|
+
<UI.Input
|
|
404
|
+
label={{ name: $t('constructor.props.table.columns.alt') }}
|
|
405
|
+
value={column.image?.alt}
|
|
406
|
+
onUpdate={(value) => {
|
|
407
|
+
updateTableHeader(columnIndex, 'image', { ['alt']: value })
|
|
408
|
+
}}
|
|
409
|
+
/>
|
|
410
|
+
<UI.Input
|
|
411
|
+
label={{ name: $t('constructor.props.table.columns.class') }}
|
|
412
|
+
value={column.image?.class}
|
|
413
|
+
onUpdate={(value) => {
|
|
414
|
+
updateTableHeader(columnIndex, 'image', { ['class']: value })
|
|
415
|
+
}}
|
|
416
|
+
/>
|
|
417
|
+
<UI.Input
|
|
418
|
+
label={{ name: $t('constructor.props.table.columns.image.width'), class: 'px-0' }}
|
|
419
|
+
wrapperClass="w-150"
|
|
420
|
+
value={column.image?.width}
|
|
421
|
+
onUpdate={(value) => {
|
|
422
|
+
updateTableHeader(columnIndex, 'image', { ['width']: value })
|
|
423
|
+
}}
|
|
424
|
+
/>
|
|
425
|
+
<UI.Input
|
|
426
|
+
label={{ name: $t('constructor.props.table.columns.image.height'), class: 'px-0' }}
|
|
427
|
+
wrapperClass="w-150"
|
|
428
|
+
value={column.image?.height}
|
|
429
|
+
onUpdate={(value) => {
|
|
430
|
+
updateTableHeader(columnIndex, 'image', { ['height']: value })
|
|
431
|
+
}}
|
|
432
|
+
/>
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
|
|
185
436
|
{#if column.buttons && column.buttons.length > 0}
|
|
186
437
|
<div class="mb-5 rounded-lg p-1">
|
|
187
438
|
{#each column.buttons as button, buttonIndex (buttonIndex)}
|
|
@@ -15,10 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<div
|
|
17
17
|
{id}
|
|
18
|
-
class=
|
|
19
|
-
`relative flex w-full flex-col items-center ${background ? 'rounded-2xl bg-[var(--container-color)] px-6 py-2' : ''}`,
|
|
20
|
-
wrapperClass,
|
|
21
|
-
)} "
|
|
18
|
+
class={twMerge(`relative flex w-full flex-col items-center ${background ? 'rounded-2xl bg-(--container-color) px-6 py-2' : ''}`, wrapperClass)}
|
|
22
19
|
>
|
|
23
20
|
<p class={twMerge(`w-full text-center ${textSize[content.size ?? 'base']}`, content.class)}>
|
|
24
21
|
{content.name}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
let currentType = $derived($optionsStore.TEXTFIELD_SIZE_OPTIONS.find((t) => t.value === component.properties.content.size))
|
|
22
22
|
|
|
23
23
|
const initialAlign = $derived(
|
|
24
|
-
$optionsStore.
|
|
24
|
+
$optionsStore.TEXT_ALIGN_OPTIONS.find((a) =>
|
|
25
25
|
(a.value as string).includes(component.properties.content?.class?.split(' ').find((cls: string) => cls.startsWith('text-'))),
|
|
26
26
|
),
|
|
27
27
|
)
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
const initialItalic = $derived(component.properties.content?.class?.split(' ').find((cls: string) => cls.startsWith('italic')))
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
|
-
{#if
|
|
37
|
+
{#if forConstructor}
|
|
38
38
|
<div class="relative flex flex-row items-start justify-center">
|
|
39
39
|
<div class="flex w-1/3 flex-col px-2">
|
|
40
40
|
<UI.Select
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
label={{ name: $t('constructor.props.align') }}
|
|
65
65
|
type="buttons"
|
|
66
66
|
value={initialAlign}
|
|
67
|
-
options={$optionsStore.
|
|
67
|
+
options={$optionsStore.TEXT_ALIGN_OPTIONS}
|
|
68
68
|
onUpdate={(option) => updateProperty('content.class', twMerge(component.properties.content.class, option.value), component, onPropertyChange)}
|
|
69
69
|
/>
|
|
70
70
|
<UI.Select
|
|
@@ -106,4 +106,83 @@
|
|
|
106
106
|
/>
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
|
+
{:else}
|
|
110
|
+
<div class="relative flex flex-row items-start justify-center">
|
|
111
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
112
|
+
<UI.Input
|
|
113
|
+
label={{ name: $t('constructor.props.id') }}
|
|
114
|
+
value={component.properties.id}
|
|
115
|
+
onUpdate={(value) => updateProperty('id', value as string, component, onPropertyChange)}
|
|
116
|
+
/>
|
|
117
|
+
<UI.Input
|
|
118
|
+
label={{ name: $t('constructor.props.wrapperclass') }}
|
|
119
|
+
value={component.properties.wrapperClass}
|
|
120
|
+
onUpdate={(value) => updateProperty('wrapperClass', value as string, component, onPropertyChange)}
|
|
121
|
+
/>
|
|
122
|
+
|
|
123
|
+
<UI.Select
|
|
124
|
+
wrapperClass="!h-14"
|
|
125
|
+
label={{ name: $t('constructor.props.textcolors') }}
|
|
126
|
+
type="buttons"
|
|
127
|
+
options={$optionsStore.TEXT_COLOR_OPTIONS}
|
|
128
|
+
value={initialColor}
|
|
129
|
+
onUpdate={(option) => updateProperty('wrapperClass', twMerge(component.properties.wrapperClass, option.value), component, onPropertyChange)}
|
|
130
|
+
/>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
133
|
+
<UI.Input
|
|
134
|
+
label={{ name: $t('constructor.props.label') }}
|
|
135
|
+
value={component.properties.content.name}
|
|
136
|
+
onUpdate={(value) => updateProperty('content.name', value as string, component, onPropertyChange)}
|
|
137
|
+
/>
|
|
138
|
+
<UI.Select
|
|
139
|
+
label={{ name: $t('constructor.props.size') }}
|
|
140
|
+
type="buttons"
|
|
141
|
+
value={currentType}
|
|
142
|
+
options={$optionsStore.TEXTFIELD_SIZE_OPTIONS}
|
|
143
|
+
onUpdate={(item) => updateProperty('content.size', item.value as string, component, onPropertyChange)}
|
|
144
|
+
/>
|
|
145
|
+
<UI.Input
|
|
146
|
+
label={{ name: $t('constructor.props.componentclass') }}
|
|
147
|
+
value={component.properties.content.class}
|
|
148
|
+
onUpdate={(value) => updateProperty('content.class', value as string, component, onPropertyChange)}
|
|
149
|
+
/>
|
|
150
|
+
<UI.Select
|
|
151
|
+
label={{ name: $t('constructor.props.align') }}
|
|
152
|
+
type="buttons"
|
|
153
|
+
value={initialAlign}
|
|
154
|
+
options={$optionsStore.TEXT_ALIGN_OPTIONS}
|
|
155
|
+
onUpdate={(option) => updateProperty('content.class', twMerge(component.properties.content.class, option.value), component, onPropertyChange)}
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
159
|
+
<UI.Switch
|
|
160
|
+
label={{ name: $t('constructor.props.bold') }}
|
|
161
|
+
value={initialBold ? 2 : 1}
|
|
162
|
+
onChange={(value) =>
|
|
163
|
+
updateProperty(
|
|
164
|
+
'content.class',
|
|
165
|
+
twMerge(`${component.properties.content.class} ${value === 2 ? 'font-bold' : 'font-normal'}`),
|
|
166
|
+
component,
|
|
167
|
+
onPropertyChange,
|
|
168
|
+
)}
|
|
169
|
+
/>
|
|
170
|
+
<UI.Switch
|
|
171
|
+
label={{ name: $t('constructor.props.italic') }}
|
|
172
|
+
value={initialItalic ? 2 : 1}
|
|
173
|
+
onChange={(value) =>
|
|
174
|
+
updateProperty(
|
|
175
|
+
'content.class',
|
|
176
|
+
twMerge(`${component.properties.content.class} ${value === 2 ? 'italic' : 'not-italic'}`),
|
|
177
|
+
component,
|
|
178
|
+
onPropertyChange,
|
|
179
|
+
)}
|
|
180
|
+
/>
|
|
181
|
+
<UI.Switch
|
|
182
|
+
label={{ name: $t('constructor.props.background') }}
|
|
183
|
+
value={component.properties.background ? 2 : 1}
|
|
184
|
+
onChange={(value) => updateProperty('background', value === 2, component, onPropertyChange)}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
109
188
|
{/if}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,4 +22,6 @@ export { default as Table } from './Table/Table.svelte';
|
|
|
22
22
|
export { default as TableProps } from './Table/TableProps.svelte';
|
|
23
23
|
export { default as TextField } from './TextField/TextField.svelte';
|
|
24
24
|
export { default as TextFieldProps } from './TextField/TextFieldProps.svelte';
|
|
25
|
+
export * from './locales/i18n';
|
|
26
|
+
export * from './locales/translations';
|
|
25
27
|
export { type UIComponent, type Position, type IUIComponentHandler, type IButtonProps, type IAccordionProps, type IInputProps, type ISelectProps, type ISelectOption, type ISwitchProps, type IColorPickerProps, type ISliderProps, type ITextFieldProps, type IProgressBarProps, type IGraphProps, type IGraphDataObject, type ITableHeader, type ITableProps, } from './types';
|
package/dist/index.js
CHANGED
|
@@ -23,4 +23,6 @@ export { default as Table } from './Table/Table.svelte';
|
|
|
23
23
|
export { default as TableProps } from './Table/TableProps.svelte';
|
|
24
24
|
export { default as TextField } from './TextField/TextField.svelte';
|
|
25
25
|
export { default as TextFieldProps } from './TextField/TextFieldProps.svelte';
|
|
26
|
+
export * from './locales/i18n';
|
|
27
|
+
export * from './locales/translations';
|
|
26
28
|
export {} from './types';
|
|
@@ -53,6 +53,7 @@ const translations = {
|
|
|
53
53
|
'constructor.props.form': 'Форма',
|
|
54
54
|
'constructor.props.type': 'Тип',
|
|
55
55
|
'constructor.props.size': 'Размер',
|
|
56
|
+
'constructor.props.footer': 'Нижняя панель',
|
|
56
57
|
'constructor.props.header': 'Заголовок пакета',
|
|
57
58
|
'constructor.props.argument': 'Аргумент',
|
|
58
59
|
'constructor.props.argument.info': 'Пользовательский аргумент (a-z, A-Z, 0-9, -_!)',
|
|
@@ -68,6 +69,8 @@ const translations = {
|
|
|
68
69
|
'constructor.props.height': 'Высота',
|
|
69
70
|
'constructor.props.colors': 'Цвет фона',
|
|
70
71
|
'constructor.props.textcolors': 'Цвет текста',
|
|
72
|
+
'constructor.props.textarea.rows': 'Количество строк',
|
|
73
|
+
'constructor.props.autocomplete': 'Автозаполнение',
|
|
71
74
|
'constructor.props.maxlenght': 'Максимальная длина',
|
|
72
75
|
'constructor.props.regexp': 'Выражение валидации',
|
|
73
76
|
'constructor.props.regexp.info': 'Введите RegExp без /.../ (например: ^\\d+$)',
|
|
@@ -82,7 +85,7 @@ const translations = {
|
|
|
82
85
|
'constructor.props.istest': 'Тестовые данные',
|
|
83
86
|
'constructor.props.variable': 'Имя переменной',
|
|
84
87
|
'constructor.props.widthMode': 'Ширина кнопок',
|
|
85
|
-
'constructor.props.graphdata.title': 'Начальные данные',
|
|
88
|
+
'constructor.props.graphdata.title': 'Начальные данные ',
|
|
86
89
|
'constructor.props.options.title': 'Опции компонента',
|
|
87
90
|
'constructor.props.valuetype': 'Тип значения',
|
|
88
91
|
'constructor.props.action': 'Действие при переключении',
|
|
@@ -105,6 +108,11 @@ const translations = {
|
|
|
105
108
|
'constructor.props.table.columns.label': 'Название',
|
|
106
109
|
'constructor.props.table.columns.width': 'Ширина',
|
|
107
110
|
'constructor.props.table.columns.sortable': 'Сортировка',
|
|
111
|
+
'constructor.props.table.columns.truncated': 'Скрыть',
|
|
112
|
+
'constructor.props.table.columns.alt': 'Альтернативное название иконок',
|
|
113
|
+
'constructor.props.table.columns.class': 'Стили иконки',
|
|
114
|
+
'constructor.props.table.columns.image.width': 'Ширина иконки',
|
|
115
|
+
'constructor.props.table.columns.image.height': 'Высота иконки',
|
|
108
116
|
'constructor.props.table.deletecolumn': 'Удалить колонку',
|
|
109
117
|
'constructor.props.table.deletebutton': 'Удалить кнопку',
|
|
110
118
|
'constructor.props.table.addaction': 'Добавить кнопку',
|
|
@@ -119,6 +127,21 @@ const translations = {
|
|
|
119
127
|
'constructor.props.icon.network': 'Сеть',
|
|
120
128
|
'constructor.props.icon.power': 'Питание',
|
|
121
129
|
'constructor.props.icon.settings': 'Настройки',
|
|
130
|
+
'constructor.props.autocomplete.on': 'on',
|
|
131
|
+
'constructor.props.autocomplete.off': 'off',
|
|
132
|
+
'constructor.props.autocomplete.given-name': 'given-name',
|
|
133
|
+
'constructor.props.autocomplete.family-name': 'family-name',
|
|
134
|
+
'constructor.props.autocomplete.name': 'name',
|
|
135
|
+
'constructor.props.autocomplete.email': 'email',
|
|
136
|
+
'constructor.props.autocomplete.username': 'username',
|
|
137
|
+
'constructor.props.autocomplete.new-password': 'new-password',
|
|
138
|
+
'constructor.props.autocomplete.current-password': 'current-password',
|
|
139
|
+
'constructor.props.autocomplete.tel': 'tel',
|
|
140
|
+
'constructor.props.autocomplete.country-name': 'country-name',
|
|
141
|
+
'constructor.props.autocomplete.address-level1': 'address-level1',
|
|
142
|
+
'constructor.props.autocomplete.address-level2': 'address-level2',
|
|
143
|
+
'constructor.props.autocomplete.street-address': 'street-address',
|
|
144
|
+
'constructor.props.autocomplete.postal-code': 'postal-code',
|
|
122
145
|
},
|
|
123
146
|
en: {},
|
|
124
147
|
zh: {},
|
package/dist/options.d.ts
CHANGED
|
@@ -55,6 +55,11 @@ export declare const optionsStore: import("svelte/store").Readable<{
|
|
|
55
55
|
value: string;
|
|
56
56
|
class: string;
|
|
57
57
|
}[];
|
|
58
|
+
TEXT_ALIGN_OPTIONS: {
|
|
59
|
+
id: string;
|
|
60
|
+
value: string;
|
|
61
|
+
name: string;
|
|
62
|
+
}[];
|
|
58
63
|
ALIGN_OPTIONS: {
|
|
59
64
|
id: string;
|
|
60
65
|
value: string;
|
|
@@ -85,4 +90,9 @@ export declare const optionsStore: import("svelte/store").Readable<{
|
|
|
85
90
|
value: string;
|
|
86
91
|
name: string;
|
|
87
92
|
}[];
|
|
93
|
+
AUTOCOMPLETE_OPTIONS: {
|
|
94
|
+
id: string;
|
|
95
|
+
value: string;
|
|
96
|
+
name: string;
|
|
97
|
+
}[];
|
|
88
98
|
}>;
|
package/dist/options.js
CHANGED
|
@@ -66,11 +66,16 @@ export const optionsStore = derived(t, ($t) => {
|
|
|
66
66
|
{ id: id(), name: '', value: 'text-purple-500 dark:text-purple-400', class: 'bg-purple-500 dark:bg-purple-400' },
|
|
67
67
|
{ id: id(), name: '', value: 'text-gray-500 dark:text-gray-400', class: 'bg-gray-500 dark:bg-gray-400' },
|
|
68
68
|
],
|
|
69
|
-
|
|
69
|
+
TEXT_ALIGN_OPTIONS: [
|
|
70
70
|
{ id: id(), value: 'text-left', name: $t('constructor.props.align.left') },
|
|
71
71
|
{ id: id(), value: 'text-center', name: $t('constructor.props.align.center') },
|
|
72
72
|
{ id: id(), value: 'text-right', name: $t('constructor.props.align.right') },
|
|
73
73
|
],
|
|
74
|
+
ALIGN_OPTIONS: [
|
|
75
|
+
{ id: id(), value: 'left', name: $t('constructor.props.align.left') },
|
|
76
|
+
{ id: id(), value: 'center', name: $t('constructor.props.align.center') },
|
|
77
|
+
{ id: id(), value: 'right', name: $t('constructor.props.align.right') },
|
|
78
|
+
],
|
|
74
79
|
HEIGHT_OPTIONS: [
|
|
75
80
|
{ id: id(), value: 'py-1', name: $t('constructor.props.height.small') },
|
|
76
81
|
{ id: id(), value: 'py-2', name: $t('constructor.props.height.medium') },
|
|
@@ -92,5 +97,22 @@ export const optionsStore = derived(t, ($t) => {
|
|
|
92
97
|
{ id: id(), value: 'square', name: $t('constructor.props.type.square') },
|
|
93
98
|
{ id: id(), value: 'circle', name: $t('constructor.props.type.circle') },
|
|
94
99
|
],
|
|
100
|
+
AUTOCOMPLETE_OPTIONS: [
|
|
101
|
+
{ id: id(), value: 'on', name: $t('constructor.props.autocomplete.on') },
|
|
102
|
+
{ id: id(), value: 'off', name: $t('constructor.props.autocomplete.off') },
|
|
103
|
+
{ id: id(), value: 'given-name', name: $t('constructor.props.autocomplete.given-name') },
|
|
104
|
+
{ id: id(), value: 'family-name', name: $t('constructor.props.autocomplete.family-name') },
|
|
105
|
+
{ id: id(), value: 'name', name: $t('constructor.props.autocomplete.name') },
|
|
106
|
+
{ id: id(), value: 'email', name: $t('constructor.props.autocomplete.email') },
|
|
107
|
+
{ id: id(), value: 'username', name: $t('constructor.props.autocomplete.username') },
|
|
108
|
+
{ id: id(), value: 'new-password', name: $t('constructor.props.autocomplete.new-password') },
|
|
109
|
+
{ id: id(), value: 'current-password', name: $t('constructor.props.autocomplete.current-password') },
|
|
110
|
+
{ id: id(), value: 'tel', name: $t('constructor.props.autocomplete.tel') },
|
|
111
|
+
{ id: id(), value: 'country-name', name: $t('constructor.props.autocomplete.country-name') },
|
|
112
|
+
{ id: id(), value: 'address-level1', name: $t('constructor.props.autocomplete.address-level1') },
|
|
113
|
+
{ id: id(), value: 'address-level2', name: $t('constructor.props.autocomplete.address-level2') },
|
|
114
|
+
{ id: id(), value: 'street-address', name: $t('constructor.props.autocomplete.street-address') },
|
|
115
|
+
{ id: id(), value: 'postal-code', name: $t('constructor.props.autocomplete.postal-code') },
|
|
116
|
+
],
|
|
95
117
|
};
|
|
96
118
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -32,7 +32,10 @@ export interface IButtonProps {
|
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
content?: {
|
|
34
34
|
name?: string;
|
|
35
|
-
info?:
|
|
35
|
+
info?: {
|
|
36
|
+
text: string;
|
|
37
|
+
side: 'top' | 'bottom' | 'left' | 'right';
|
|
38
|
+
};
|
|
36
39
|
icon?: ConstructorOfATypedSvelteComponent | string | null;
|
|
37
40
|
};
|
|
38
41
|
keyBind?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-svelte-ui-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"typescript": "^5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@sveltejs/kit": "^2.47.
|
|
46
|
+
"@sveltejs/kit": "^2.47.3",
|
|
47
47
|
"@sveltejs/package": "^2.5.4",
|
|
48
48
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
49
49
|
"@types/node": "^24.9.1",
|
|
50
50
|
"publint": "^0.3.15",
|
|
51
|
-
"svelte": "^5.41.
|
|
51
|
+
"svelte": "^5.41.2",
|
|
52
52
|
"svelte-preprocess": "^6.0.3",
|
|
53
53
|
"vite": "^7.1.11",
|
|
54
54
|
"vite-plugin-compression": "^0.5.1"
|