poe-svelte-ui-lib 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/AccordionProps.svelte +3 -3
- package/dist/FileAttach/FileAttach.svelte +0 -1
- package/dist/Graph/GraphProps.svelte +0 -2
- package/dist/{Accordion/IconsLib → IconsLib}/common.edit.svg +5 -4
- package/dist/{Accordion/IconsLib → IconsLib}/iconsLib.js +2 -2
- package/dist/{Accordion/IconsLib → IconsLib}/settings.debug.svg +1 -1
- package/dist/{Accordion/IconsLib → IconsLib}/settings.save.svg +5 -4
- package/dist/Input/Input.svelte +1 -1
- package/dist/ProgressBar/ProgressBar.svelte +4 -5
- package/dist/ProgressBar/ProgressBarProps.svelte +2 -0
- package/dist/Select/SelectProps.svelte +12 -41
- package/dist/Switch/Switch.svelte +2 -2
- package/dist/Table/Table.svelte +33 -14
- package/dist/Table/TableProps.svelte +240 -145
- package/dist/TextField/TextFieldProps.svelte +3 -9
- package/dist/{Accordion/icons.js → icons.js} +22 -22
- package/dist/locales/translations.js +66 -20
- package/dist/options.js +61 -9
- package/dist/types.d.ts +9 -4
- package/package.json +5 -5
- /package/dist/{Accordion/IconsLib → IconsLib}/access.card.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/access.key.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/access.lock.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/common.battery.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/common.block.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/common.list.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/common.search.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/common.trash.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/common.warning.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/iconsLib.d.ts +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/info.bell.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/info.clock.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/info.graph.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/info.info.svg +0 -0
- /package/dist/{Accordion/IconsLib/image.camera.svg → IconsLib/media.camera.svg} +0 -0
- /package/dist/{Accordion/IconsLib/image.movie.svg → IconsLib/media.movie.svg} +0 -0
- /package/dist/{Accordion/IconsLib/electronic.sound.svg → IconsLib/media.sound.svg} +0 -0
- /package/dist/{Accordion/IconsLib/image.webcam.svg → IconsLib/media.webcam.svg} +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.cellular.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.cloud.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.globe.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.link.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.radio.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.share.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/network.wifi.svg +0 -0
- /package/dist/{Accordion/IconsLib/electronic.board.svg → IconsLib/periphery.board.svg} +0 -0
- /package/dist/{Accordion/IconsLib/electronic.chip.svg → IconsLib/periphery.chip.svg} +0 -0
- /package/dist/{Accordion/IconsLib/electronic.magnit.svg → IconsLib/periphery.magnit.svg} +0 -0
- /package/dist/{Accordion/IconsLib/electronic.memory.svg → IconsLib/periphery.memory.svg} +0 -0
- /package/dist/{Accordion/IconsLib/electronic.volume.svg → IconsLib/periphery.volume.svg} +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/power.jeck.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/power.power.svg +0 -0
- /package/dist/{Accordion/IconsLib/control.point.svg → IconsLib/scenarios.point.svg} +0 -0
- /package/dist/{Accordion/IconsLib/control.speed.svg → IconsLib/scenarios.speed.svg} +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/settings.hammer.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/settings.list.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/settings.settings.svg +0 -0
- /package/dist/{Accordion/IconsLib → IconsLib}/settings.spanner.svg +0 -0
- /package/dist/{Accordion/IconsLib/electronic.terminal.svg → IconsLib/settings.terminal.svg} +0 -0
- /package/dist/{Accordion/icons.d.ts → icons.d.ts} +0 -0
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
import ButtonAdd from '../libIcons/ButtonAdd.svelte'
|
|
8
8
|
import { optionsStore } from '../options'
|
|
9
9
|
import { twMerge } from 'tailwind-merge'
|
|
10
|
+
import Modal from '../Modal.svelte'
|
|
11
|
+
import { ICONS } from '../icons'
|
|
12
|
+
import CrossIcon from '../libIcons/CrossIcon.svelte'
|
|
10
13
|
|
|
11
14
|
const {
|
|
12
15
|
component,
|
|
@@ -21,6 +24,8 @@
|
|
|
21
24
|
const DeviceVariables = getContext<{ id: string; value: string; name: string }[]>('DeviceVariables')
|
|
22
25
|
let VARIABLE_OPTIONS = $derived(DeviceVariables && Array.isArray(DeviceVariables) ? DeviceVariables : [])
|
|
23
26
|
|
|
27
|
+
let defaultIcon = $state({ isModalOpen: false, columnIndex: 0, column: component.properties.header[0] })
|
|
28
|
+
|
|
24
29
|
const initialColor = $derived(
|
|
25
30
|
$optionsStore.COLOR_OPTIONS.find((c) =>
|
|
26
31
|
(c.value as string).includes(component.properties.wrapperClass?.split(' ').find((cls: string) => cls.startsWith('bg-'))),
|
|
@@ -103,6 +108,11 @@
|
|
|
103
108
|
value={initialColor}
|
|
104
109
|
onUpdate={(option) => updateProperty('wrapperClass', twMerge(component.properties.wrapperClass, option.value), component, onPropertyChange)}
|
|
105
110
|
/>
|
|
111
|
+
<UI.Switch
|
|
112
|
+
label={{ name: $t('constructor.props.outline') }}
|
|
113
|
+
value={component.properties.outline ? 2 : 1}
|
|
114
|
+
onChange={(value) => updateProperty('outline', value === 2, component, onPropertyChange)}
|
|
115
|
+
/>
|
|
106
116
|
</div>
|
|
107
117
|
<div class="flex w-1/3 flex-col px-2">
|
|
108
118
|
<UI.Input
|
|
@@ -163,6 +173,7 @@
|
|
|
163
173
|
/>
|
|
164
174
|
<UI.Input
|
|
165
175
|
label={{ name: $t('constructor.props.table.columns.width') }}
|
|
176
|
+
wrapperClass="w-120"
|
|
166
177
|
type="number"
|
|
167
178
|
value={Number(column.width.replace('%', ''))}
|
|
168
179
|
onUpdate={(value) => updateTableHeader(columnIndex, 'width', `${value}%`)}
|
|
@@ -181,7 +192,7 @@
|
|
|
181
192
|
/>
|
|
182
193
|
<UI.Button
|
|
183
194
|
wrapperClass="w-8"
|
|
184
|
-
content={{ icon: ButtonAdd, info: $t('constructor.props.table.addaction') }}
|
|
195
|
+
content={{ icon: ButtonAdd, info: { text: $t('constructor.props.table.addaction'), side: 'top' } }}
|
|
185
196
|
onClick={() => {
|
|
186
197
|
const newButton = {
|
|
187
198
|
name: `button${(component.properties.header[columnIndex].buttons ? component.properties.header[columnIndex].buttons.length : 0) + 1}`,
|
|
@@ -204,9 +215,9 @@
|
|
|
204
215
|
/>
|
|
205
216
|
</div>
|
|
206
217
|
{#if column.buttons && column.buttons.length > 0}
|
|
207
|
-
<div class="mb-5 rounded-lg
|
|
218
|
+
<div class="mb-5 rounded-lg py-1">
|
|
208
219
|
{#each column.buttons as button, buttonIndex (buttonIndex)}
|
|
209
|
-
<div class="
|
|
220
|
+
<div class="ml-14 flex items-end justify-around gap-2">
|
|
210
221
|
<UI.Input
|
|
211
222
|
label={{ name: $t('constructor.props.name') }}
|
|
212
223
|
wrapperClass="!w-3/10"
|
|
@@ -294,11 +305,19 @@
|
|
|
294
305
|
value={component.properties.label.class}
|
|
295
306
|
onUpdate={(value) => updateProperty('label.class', value as string, component, onPropertyChange)}
|
|
296
307
|
/>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div class="flex w-1/3 flex-col px-2">
|
|
297
311
|
<UI.Input
|
|
298
312
|
label={{ name: $t('constructor.props.footer') }}
|
|
299
313
|
value={component.properties.footer}
|
|
300
314
|
onUpdate={(value) => updateProperty('footer', value as string, component, onPropertyChange)}
|
|
301
315
|
/>
|
|
316
|
+
<UI.Switch
|
|
317
|
+
label={{ name: $t('constructor.props.outline') }}
|
|
318
|
+
value={component.properties.outline ? 2 : 1}
|
|
319
|
+
onChange={(value) => updateProperty('outline', value === 2, component, onPropertyChange)}
|
|
320
|
+
/>
|
|
302
321
|
</div>
|
|
303
322
|
</div>
|
|
304
323
|
|
|
@@ -317,6 +336,7 @@
|
|
|
317
336
|
label: { name: `Column ${(component.properties.header?.length || 0) + 1}`, class: '' },
|
|
318
337
|
width: '10%',
|
|
319
338
|
sortable: false,
|
|
339
|
+
image: { width: '0rem', height: '0rem' },
|
|
320
340
|
}
|
|
321
341
|
const headers = [...(component.properties.header || []), newColumn]
|
|
322
342
|
updateProperty('header', headers, component, onPropertyChange)
|
|
@@ -324,164 +344,239 @@
|
|
|
324
344
|
}}
|
|
325
345
|
/>
|
|
326
346
|
</div>
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
-
|
|
436
|
-
{#if column.buttons && column.buttons.length > 0}
|
|
437
|
-
<div class="mb-5 rounded-lg p-1">
|
|
438
|
-
{#each column.buttons as button, buttonIndex (buttonIndex)}
|
|
439
|
-
<div class="mx-14 flex items-end justify-around gap-2">
|
|
347
|
+
<div class="flex flex-col gap-2">
|
|
348
|
+
{#each component.properties.header as column, columnIndex (columnIndex)}
|
|
349
|
+
<div class="rounded-2xl border border-(--border-color) p-2">
|
|
350
|
+
<div class="mb-5">
|
|
351
|
+
<div class="mr-2 flex items-end justify-around gap-6">
|
|
440
352
|
<UI.Input
|
|
441
|
-
label={{ name: $t('constructor.props.
|
|
442
|
-
wrapperClass="
|
|
443
|
-
value={
|
|
444
|
-
|
|
353
|
+
label={{ name: $t('constructor.props.table.columns.key') }}
|
|
354
|
+
wrapperClass="w-150"
|
|
355
|
+
value={column.key}
|
|
356
|
+
help={{ regExp: /^[0-9a-zA-Z_-]{0,16}$/ }}
|
|
357
|
+
onUpdate={(value) => {
|
|
358
|
+
updateTableHeader(columnIndex, 'key', value)
|
|
359
|
+
updateTableBody()
|
|
360
|
+
}}
|
|
361
|
+
/>
|
|
362
|
+
<UI.Input
|
|
363
|
+
label={{ name: $t('constructor.props.table.columns.label') }}
|
|
364
|
+
value={column.label.name}
|
|
365
|
+
onUpdate={(value) => {
|
|
366
|
+
updateTableHeader(columnIndex, 'label', { ['name']: value })
|
|
367
|
+
}}
|
|
368
|
+
/>
|
|
369
|
+
<UI.Input
|
|
370
|
+
label={{ name: $t('constructor.props.table.columns.width'), class: 'px-0' }}
|
|
371
|
+
wrapperClass="w-150"
|
|
372
|
+
type="number"
|
|
373
|
+
value={Number(column.width.replace('%', ''))}
|
|
374
|
+
onUpdate={(value) => updateTableHeader(columnIndex, 'width', `${value}%`)}
|
|
445
375
|
/>
|
|
446
376
|
<UI.Select
|
|
447
|
-
|
|
448
|
-
label={{ name: $t('constructor.props.header') }}
|
|
377
|
+
label={{ name: $t('constructor.props.align.header') }}
|
|
449
378
|
type="buttons"
|
|
450
|
-
value={$optionsStore.
|
|
451
|
-
options={$optionsStore.
|
|
452
|
-
onUpdate={(option) => {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
379
|
+
value={$optionsStore.ALIGN_OPTIONS.find((a) => (a.value as string).includes(column.align?.header) || 'left')}
|
|
380
|
+
options={$optionsStore.ALIGN_OPTIONS}
|
|
381
|
+
onUpdate={(option) => updateTableHeader(columnIndex, 'align', { header: option.value, content: column.align?.content })}
|
|
382
|
+
/>
|
|
383
|
+
<UI.Switch
|
|
384
|
+
label={{ name: $t('constructor.props.table.columns.sortable'), class: 'px-0' }}
|
|
385
|
+
wrapperClass="w-30"
|
|
386
|
+
value={column.sortable ? 2 : 1}
|
|
387
|
+
onChange={(value) => updateTableHeader(columnIndex, 'sortable', value === 2)}
|
|
388
|
+
/>
|
|
389
|
+
<UI.Switch
|
|
390
|
+
label={{ name: $t('constructor.props.copy'), class: 'px-0' }}
|
|
391
|
+
wrapperClass="w-30"
|
|
392
|
+
value={column.overflow?.copy ? 2 : 1}
|
|
393
|
+
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { copy: value === 2, truncated: column.overflow?.truncated })}
|
|
394
|
+
/>
|
|
395
|
+
<UI.Button
|
|
396
|
+
wrapperClass="w-8"
|
|
397
|
+
content={{ icon: ButtonAdd, info: { text: $t('constructor.props.table.addaction'), side: 'top' } }}
|
|
398
|
+
onClick={() => {
|
|
399
|
+
const newButton = {
|
|
400
|
+
name: `button${(component.properties.header[columnIndex].buttons ? component.properties.header[columnIndex].buttons.length : 0) + 1}`,
|
|
401
|
+
class: 'bg-blue',
|
|
402
|
+
eventHandler: { Header: 'SET', Argument: 'Save', Variables: [] },
|
|
403
|
+
onClick: () => {},
|
|
404
|
+
}
|
|
405
|
+
const buttons = [...(component.properties.header[columnIndex].buttons || []), newButton]
|
|
406
|
+
updateTableHeader(columnIndex, 'buttons', buttons)
|
|
456
407
|
}}
|
|
457
408
|
/>
|
|
409
|
+
<UI.Button
|
|
410
|
+
wrapperClass="w-8"
|
|
411
|
+
content={{ icon: ButtonDelete }}
|
|
412
|
+
onClick={() => {
|
|
413
|
+
const headers = [...(component.properties.header || [])]
|
|
414
|
+
headers.splice(columnIndex, 1)
|
|
415
|
+
updateProperty('header', headers, component, onPropertyChange)
|
|
416
|
+
}}
|
|
417
|
+
/>
|
|
418
|
+
</div>
|
|
419
|
+
<div class="mr-2 flex items-end justify-around gap-6">
|
|
420
|
+
<UI.Select
|
|
421
|
+
label={{ name: $t('constructor.props.align.content') }}
|
|
422
|
+
type="buttons"
|
|
423
|
+
value={$optionsStore.ALIGN_OPTIONS.find((a) => (a.value as string).includes(column.align?.content) || 'left')}
|
|
424
|
+
options={$optionsStore.ALIGN_OPTIONS}
|
|
425
|
+
onUpdate={(option) => updateTableHeader(columnIndex, 'align', { header: column.align?.header, content: option.value })}
|
|
426
|
+
/>
|
|
427
|
+
<UI.Switch
|
|
428
|
+
wrapperClass="w-2/10"
|
|
429
|
+
label={{ name: $t('constructor.props.table.columns.truncated') }}
|
|
430
|
+
value={column.overflow?.truncated ? 2 : 1}
|
|
431
|
+
onChange={(value) => updateTableHeader(columnIndex, 'overflow', { truncated: value === 2, copy: column.overflow?.copy })}
|
|
432
|
+
/>
|
|
433
|
+
<div class="relative mt-6 flex w-full gap-2">
|
|
434
|
+
<UI.Button
|
|
435
|
+
content={{ name: $t('constructor.props.table.columns.defaultIcon') }}
|
|
436
|
+
onClick={() => (defaultIcon = { isModalOpen: true, columnIndex: columnIndex, column: column })}
|
|
437
|
+
/>
|
|
438
|
+
{#if column.image?.defaultIcon}
|
|
439
|
+
<UI.Button
|
|
440
|
+
wrapperClass="w-8.5 "
|
|
441
|
+
componentClass="p-0.5 bg-red"
|
|
442
|
+
content={{ icon: CrossIcon }}
|
|
443
|
+
onClick={() => {
|
|
444
|
+
updateTableHeader(columnIndex, 'image', {
|
|
445
|
+
class: column.image?.class,
|
|
446
|
+
width: column.image?.width,
|
|
447
|
+
height: column.image?.height,
|
|
448
|
+
defaultIcon: '',
|
|
449
|
+
})
|
|
450
|
+
}}
|
|
451
|
+
/>
|
|
452
|
+
{/if}
|
|
453
|
+
</div>
|
|
458
454
|
<UI.Input
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
value={button.eventHandler?.Argument}
|
|
455
|
+
label={{ name: $t('constructor.props.table.columns.class') }}
|
|
456
|
+
value={column.image?.class}
|
|
462
457
|
onUpdate={(value) => {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
458
|
+
updateTableHeader(columnIndex, 'image', {
|
|
459
|
+
class: value,
|
|
460
|
+
width: column.image?.width,
|
|
461
|
+
height: column.image?.height,
|
|
462
|
+
defaultIcon: column.image.defaultIcon,
|
|
463
|
+
})
|
|
466
464
|
}}
|
|
467
465
|
/>
|
|
468
466
|
<UI.Input
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
467
|
+
label={{ name: $t('constructor.props.table.columns.image.width'), class: 'px-0' }}
|
|
468
|
+
type="number"
|
|
469
|
+
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
470
|
+
wrapperClass="w-150"
|
|
471
|
+
value={Number(column.image?.width.replace('rem', '')) ?? 0}
|
|
474
472
|
onUpdate={(value) => {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
473
|
+
updateTableHeader(columnIndex, 'image', {
|
|
474
|
+
class: column.image?.class,
|
|
475
|
+
width: `${value ?? 0}rem`,
|
|
476
|
+
height: column.image?.height,
|
|
477
|
+
defaultIcon: column.image.defaultIcon,
|
|
478
|
+
})
|
|
479
|
+
}}
|
|
480
|
+
/>
|
|
481
|
+
<UI.Input
|
|
482
|
+
label={{ name: $t('constructor.props.table.columns.image.height'), class: 'px-0' }}
|
|
483
|
+
type="number"
|
|
484
|
+
number={{ minNum: 0, maxNum: 1000, step: 1 }}
|
|
485
|
+
wrapperClass="w-150"
|
|
486
|
+
value={Number(column.image?.height.replace('rem', ''))}
|
|
487
|
+
onUpdate={(value) => {
|
|
488
|
+
updateTableHeader(columnIndex, 'image', {
|
|
489
|
+
class: column.image?.class,
|
|
490
|
+
width: column.image?.width,
|
|
491
|
+
height: `${value}rem`,
|
|
492
|
+
defaultIcon: column.image.defaultIcon,
|
|
493
|
+
})
|
|
478
494
|
}}
|
|
479
495
|
/>
|
|
480
|
-
<UI.Button wrapperClass="w-8" content={{ icon: ButtonDelete }} onClick={() => removeButtonFromColumn(columnIndex, buttonIndex)} />
|
|
481
496
|
</div>
|
|
482
|
-
|
|
497
|
+
</div>
|
|
498
|
+
|
|
499
|
+
{#if column.buttons && column.buttons.length > 0}
|
|
500
|
+
<hr class="border-(--border-color)" />
|
|
501
|
+
<div class="mb-5 rounded-lg p-1">
|
|
502
|
+
{#each column.buttons as button, buttonIndex (buttonIndex)}
|
|
503
|
+
<div class="ml-14 flex items-end justify-between gap-2">
|
|
504
|
+
<UI.Input
|
|
505
|
+
label={{ name: $t('constructor.props.name') }}
|
|
506
|
+
wrapperClass="!w-3/10"
|
|
507
|
+
value={button.name}
|
|
508
|
+
onUpdate={(value) => updateButtonProperty(columnIndex, buttonIndex, 'name', value)}
|
|
509
|
+
/>
|
|
510
|
+
<UI.Select
|
|
511
|
+
wrapperClass="!w-2/10"
|
|
512
|
+
label={{ name: $t('constructor.props.header') }}
|
|
513
|
+
type="buttons"
|
|
514
|
+
value={$optionsStore.HEADER_OPTIONS.find((h) => h.value === button.eventHandler?.Header)}
|
|
515
|
+
options={$optionsStore.HEADER_OPTIONS}
|
|
516
|
+
onUpdate={(option) => {
|
|
517
|
+
const handler = button.eventHandler
|
|
518
|
+
handler.Header = option.value as string
|
|
519
|
+
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
520
|
+
}}
|
|
521
|
+
/>
|
|
522
|
+
<UI.Input
|
|
523
|
+
wrapperClass="!w-2/10"
|
|
524
|
+
label={{ name: $t('constructor.props.argument') }}
|
|
525
|
+
value={button.eventHandler?.Argument}
|
|
526
|
+
onUpdate={(value) => {
|
|
527
|
+
const handler = button.eventHandler
|
|
528
|
+
handler.Argument = value as string
|
|
529
|
+
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
530
|
+
}}
|
|
531
|
+
/>
|
|
532
|
+
<UI.Input
|
|
533
|
+
wrapperClass="!w-2/10"
|
|
534
|
+
label={{ name: $t('constructor.props.table.keys') }}
|
|
535
|
+
value={button.eventHandler?.Variables.join(' ')}
|
|
536
|
+
maxlength={500}
|
|
537
|
+
help={{ info: $t('constructor.props.table.keys.info'), regExp: /^[a-zA-Z0-9\-_ ]{0,500}$/ }}
|
|
538
|
+
onUpdate={(value) => {
|
|
539
|
+
const handler = { ...button.eventHandler }
|
|
540
|
+
handler.Variables = (value as string).trim().split(/\s+/)
|
|
541
|
+
updateButtonProperty(columnIndex, buttonIndex, 'eventHandler', handler)
|
|
542
|
+
}}
|
|
543
|
+
/>
|
|
544
|
+
<UI.Button wrapperClass="w-8" content={{ icon: ButtonDelete }} onClick={() => removeButtonFromColumn(columnIndex, buttonIndex)} />
|
|
545
|
+
</div>
|
|
546
|
+
{/each}
|
|
547
|
+
</div>
|
|
548
|
+
{/if}
|
|
483
549
|
</div>
|
|
550
|
+
{/each}
|
|
551
|
+
{#if defaultIcon.isModalOpen}
|
|
552
|
+
<Modal bind:isOpen={defaultIcon.isModalOpen} wrapperClass="w-130">
|
|
553
|
+
{#snippet main()}
|
|
554
|
+
<div class="grid grid-cols-3">
|
|
555
|
+
{#each ICONS as category}
|
|
556
|
+
<div class="relative m-1.5 rounded-xl border-2 border-(--border-color) p-3">
|
|
557
|
+
<div class="absolute -top-3.5 bg-(--back-color) px-1">{$t(`constructor.props.icon.${category[0]}`)}</div>
|
|
558
|
+
<div class="grid grid-cols-3 place-items-center gap-2">
|
|
559
|
+
{#each category[1] as icon}
|
|
560
|
+
<button
|
|
561
|
+
class="h-8 w-8 cursor-pointer [&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full"
|
|
562
|
+
onclick={() => {
|
|
563
|
+
updateTableHeader(defaultIcon.columnIndex, 'image', {
|
|
564
|
+
class: defaultIcon.column.image?.class,
|
|
565
|
+
width: defaultIcon.column.image?.width,
|
|
566
|
+
height: defaultIcon.column.image?.height,
|
|
567
|
+
defaultIcon: icon as string,
|
|
568
|
+
})
|
|
569
|
+
}}
|
|
570
|
+
>
|
|
571
|
+
{@html icon}
|
|
572
|
+
</button>{/each}
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
{/each}
|
|
576
|
+
</div>
|
|
577
|
+
{/snippet}
|
|
578
|
+
</Modal>
|
|
484
579
|
{/if}
|
|
485
|
-
|
|
580
|
+
</div>
|
|
486
581
|
</div>
|
|
487
582
|
{/if}
|
|
@@ -115,11 +115,10 @@
|
|
|
115
115
|
onUpdate={(value) => updateProperty('id', value as string, component, onPropertyChange)}
|
|
116
116
|
/>
|
|
117
117
|
<UI.Input
|
|
118
|
-
label={{ name: $t('constructor.props.
|
|
119
|
-
value={component.properties.
|
|
120
|
-
onUpdate={(value) => updateProperty('
|
|
118
|
+
label={{ name: $t('constructor.props.label') }}
|
|
119
|
+
value={component.properties.content.name}
|
|
120
|
+
onUpdate={(value) => updateProperty('content.name', value as string, component, onPropertyChange)}
|
|
121
121
|
/>
|
|
122
|
-
|
|
123
122
|
<UI.Select
|
|
124
123
|
wrapperClass="!h-14"
|
|
125
124
|
label={{ name: $t('constructor.props.textcolors') }}
|
|
@@ -130,11 +129,6 @@
|
|
|
130
129
|
/>
|
|
131
130
|
</div>
|
|
132
131
|
<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
132
|
<UI.Select
|
|
139
133
|
label={{ name: $t('constructor.props.size') }}
|
|
140
134
|
type="buttons"
|