windmill-components 1.82.0 → 1.82.2
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/components/Multiselect.svelte.d.ts +2 -2
- package/components/apps/components/buttons/AppFormButton.svelte +58 -70
- package/components/apps/editor/AppEditor.svelte +14 -12
- package/components/apps/editor/AppPreview.svelte +1 -2
- package/components/apps/editor/component/ComponentNavigation.svelte +2 -1
- package/components/apps/editor/component/README.md +4 -0
- package/components/apps/editor/componentsPanel/CssProperty.svelte +87 -47
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +5 -2
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +167 -0
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +18 -0
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +130 -0
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +21 -0
- package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +535 -0
- package/components/apps/editor/componentsPanel/quickStyleProperties.js +595 -0
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +24 -14
- package/components/apps/editor/settingsPanel/StylePanel.svelte +23 -0
- package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +3 -2
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +47 -0
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +14 -0
- package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +2 -0
- package/components/apps/editor/settingsPanel/secondaryMenu/index.js +2 -0
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +12 -0
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +10 -0
- package/components/apps/types.d.ts +2 -1
- package/components/common/button/ButtonPopup.svelte +5 -2
- package/components/common/button/ButtonPopup.svelte.d.ts +5 -1
- package/components/common/button/ButtonPopupItem.svelte +2 -1
- package/components/common/button/ButtonPopupItem.svelte.d.ts +1 -0
- package/components/common/clearableInput/ClearableInput.svelte +56 -0
- package/components/common/clearableInput/ClearableInput.svelte.d.ts +28 -0
- package/components/common/index.d.ts +1 -0
- package/components/common/index.js +1 -0
- package/components/common/kbd/Kbd.svelte +4 -1
- package/components/common/kbd/Kbd.svelte.d.ts +6 -14
- package/components/common/menu/Menu.svelte +8 -2
- package/components/common/menu/Menu.svelte.d.ts +4 -1
- package/components/common/modal/AlwaysMountedModal.svelte +109 -0
- package/components/common/modal/AlwaysMountedModal.svelte.d.ts +22 -0
- package/package.json +672 -662
- package/utils.d.ts +1 -0
- package/utils.js +3 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
import { get, writable } from 'svelte/store';
|
|
2
|
+
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, Asterisk, Eye, EyeOff, Grid, Italic, Mouse, MousePointer, Pointer, RectangleHorizontal, Slash, Square, StretchVertical, Strikethrough, Type, Underline } from 'lucide-svelte';
|
|
3
|
+
export const STYLE_STORE_KEY = 'style_store';
|
|
4
|
+
export function createStyleStore(properties) {
|
|
5
|
+
const style = StyleProperty.filter((p) => properties.includes(p.key)).map((p) => ({
|
|
6
|
+
prop: p,
|
|
7
|
+
value: ''
|
|
8
|
+
}));
|
|
9
|
+
const store = writable({
|
|
10
|
+
style: [...style],
|
|
11
|
+
topColors: []
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
subscribe: store.subscribe,
|
|
15
|
+
set: store.set,
|
|
16
|
+
update: store.update,
|
|
17
|
+
updatePropValue: (key, value) => {
|
|
18
|
+
if (!key) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
store.update((s) => {
|
|
22
|
+
const index = s.style.findIndex((p) => p.prop.key === key);
|
|
23
|
+
if (index !== -1) {
|
|
24
|
+
s.style[index].value = value || '';
|
|
25
|
+
}
|
|
26
|
+
return s;
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
getProp(key) {
|
|
30
|
+
const s = get(store);
|
|
31
|
+
const index = s.style.findIndex((p) => p.prop.key === key);
|
|
32
|
+
return {
|
|
33
|
+
prop: s.style[index],
|
|
34
|
+
index: index === -1 ? undefined : index
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
resetStyle: () => {
|
|
38
|
+
store.update((s) => {
|
|
39
|
+
s.style = style.map((s) => ({ ...s, value: '' }));
|
|
40
|
+
return s;
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
setTopColors: (colors) => {
|
|
44
|
+
store.update((s) => {
|
|
45
|
+
s.topColors = colors;
|
|
46
|
+
return s;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export var StylePropertyType;
|
|
52
|
+
(function (StylePropertyType) {
|
|
53
|
+
StylePropertyType["color"] = "color";
|
|
54
|
+
StylePropertyType["unit"] = "unit";
|
|
55
|
+
StylePropertyType["number"] = "number";
|
|
56
|
+
StylePropertyType["text"] = "text"; // text like the value of 'display'
|
|
57
|
+
})(StylePropertyType || (StylePropertyType = {}));
|
|
58
|
+
export const StylePropertyUnits = ['px', 'em', 'rem', '%', 'vh', 'vw'];
|
|
59
|
+
// Using an array instead of an object to preserve the order of the properties
|
|
60
|
+
export const StyleProperty = [
|
|
61
|
+
{
|
|
62
|
+
key: 'display',
|
|
63
|
+
value: {
|
|
64
|
+
type: StylePropertyType.text,
|
|
65
|
+
options: [
|
|
66
|
+
{
|
|
67
|
+
text: 'block',
|
|
68
|
+
icon: Square
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
text: 'inline-block',
|
|
72
|
+
icon: RectangleHorizontal
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
text: 'flex',
|
|
76
|
+
icon: StretchVertical
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
text: 'grid',
|
|
80
|
+
icon: Grid
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: 'padding',
|
|
87
|
+
value: [
|
|
88
|
+
{
|
|
89
|
+
type: StylePropertyType.unit,
|
|
90
|
+
title: 'top'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: StylePropertyType.unit,
|
|
94
|
+
title: 'right'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: StylePropertyType.unit,
|
|
98
|
+
title: 'bottom'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: StylePropertyType.unit,
|
|
102
|
+
title: 'left'
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: 'opacity',
|
|
108
|
+
value: {
|
|
109
|
+
type: StylePropertyType.number,
|
|
110
|
+
step: 0.1,
|
|
111
|
+
min: 0,
|
|
112
|
+
max: 1
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: 'cursor',
|
|
117
|
+
value: {
|
|
118
|
+
type: StylePropertyType.text,
|
|
119
|
+
options: [
|
|
120
|
+
{
|
|
121
|
+
text: 'default',
|
|
122
|
+
icon: MousePointer
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
text: 'pointer',
|
|
126
|
+
icon: Pointer
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
key: 'width',
|
|
133
|
+
value: {
|
|
134
|
+
type: StylePropertyType.unit
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: 'min-width',
|
|
139
|
+
value: {
|
|
140
|
+
type: StylePropertyType.unit
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: 'max-width',
|
|
145
|
+
value: {
|
|
146
|
+
type: StylePropertyType.unit
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: 'height',
|
|
151
|
+
value: {
|
|
152
|
+
type: StylePropertyType.unit
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
key: 'min-height',
|
|
157
|
+
value: {
|
|
158
|
+
type: StylePropertyType.unit
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: 'max-height',
|
|
163
|
+
value: {
|
|
164
|
+
type: StylePropertyType.unit
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: 'border',
|
|
169
|
+
value: [
|
|
170
|
+
{
|
|
171
|
+
type: StylePropertyType.unit,
|
|
172
|
+
title: 'width'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: StylePropertyType.text,
|
|
176
|
+
title: 'style',
|
|
177
|
+
options: [
|
|
178
|
+
{
|
|
179
|
+
text: 'solid',
|
|
180
|
+
icon: '___'
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
text: 'dashed',
|
|
184
|
+
icon: '_ _'
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
text: 'dotted',
|
|
188
|
+
icon: '. .'
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: StylePropertyType.color,
|
|
194
|
+
title: 'color'
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
key: 'border-radius',
|
|
200
|
+
value: {
|
|
201
|
+
type: StylePropertyType.unit
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
key: 'box-shadow',
|
|
206
|
+
value: [
|
|
207
|
+
{
|
|
208
|
+
type: StylePropertyType.unit,
|
|
209
|
+
title: 'offset-x'
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: StylePropertyType.unit,
|
|
213
|
+
title: 'offset-y'
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
type: StylePropertyType.unit,
|
|
217
|
+
title: 'blur'
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: StylePropertyType.unit,
|
|
221
|
+
title: 'spread'
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: StylePropertyType.color,
|
|
225
|
+
title: 'color'
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
key: 'background-color',
|
|
231
|
+
value: {
|
|
232
|
+
type: StylePropertyType.color
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: 'color',
|
|
237
|
+
value: {
|
|
238
|
+
type: StylePropertyType.color
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
key: 'font-size',
|
|
243
|
+
value: {
|
|
244
|
+
type: StylePropertyType.unit
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: 'font-family',
|
|
249
|
+
value: {
|
|
250
|
+
type: StylePropertyType.text
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
key: 'font-weight',
|
|
255
|
+
value: {
|
|
256
|
+
type: StylePropertyType.number
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
key: 'font-style',
|
|
261
|
+
value: {
|
|
262
|
+
type: StylePropertyType.text,
|
|
263
|
+
options: [
|
|
264
|
+
{
|
|
265
|
+
text: 'normal',
|
|
266
|
+
icon: Type
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
text: 'italic',
|
|
270
|
+
icon: Italic
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
key: 'text-align',
|
|
277
|
+
value: {
|
|
278
|
+
type: StylePropertyType.text,
|
|
279
|
+
options: [
|
|
280
|
+
{
|
|
281
|
+
text: 'left',
|
|
282
|
+
icon: AlignLeft
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
text: 'center',
|
|
286
|
+
icon: AlignCenter
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
text: 'right',
|
|
290
|
+
icon: AlignRight
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
text: 'justify',
|
|
294
|
+
icon: AlignJustify
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
key: 'text-decoration',
|
|
301
|
+
value: {
|
|
302
|
+
type: StylePropertyType.text,
|
|
303
|
+
options: [
|
|
304
|
+
{
|
|
305
|
+
text: 'none',
|
|
306
|
+
icon: Slash
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
text: 'underline',
|
|
310
|
+
icon: Underline
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
text: 'line-through',
|
|
314
|
+
icon: Strikethrough
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
key: 'text-transform',
|
|
321
|
+
value: {
|
|
322
|
+
type: StylePropertyType.text,
|
|
323
|
+
options: [
|
|
324
|
+
{
|
|
325
|
+
text: 'none',
|
|
326
|
+
icon: Slash
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
text: 'capitalize',
|
|
330
|
+
icon: 'Aa'
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
text: 'uppercase',
|
|
334
|
+
icon: 'AA'
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
text: 'lowercase',
|
|
338
|
+
icon: 'aa'
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
key: 'line-height',
|
|
345
|
+
value: {
|
|
346
|
+
type: StylePropertyType.unit
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
key: 'letter-spacing',
|
|
351
|
+
value: {
|
|
352
|
+
type: StylePropertyType.unit
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
key: 'word-spacing',
|
|
357
|
+
value: {
|
|
358
|
+
type: StylePropertyType.unit
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
key: 'overflow',
|
|
363
|
+
value: {
|
|
364
|
+
type: StylePropertyType.text,
|
|
365
|
+
options: [
|
|
366
|
+
{
|
|
367
|
+
text: 'auto',
|
|
368
|
+
icon: Asterisk
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
text: 'visible',
|
|
372
|
+
icon: Eye
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
text: 'hidden',
|
|
376
|
+
icon: EyeOff
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
text: 'scroll',
|
|
380
|
+
icon: Mouse
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
];
|
|
386
|
+
const allDefaultProps = StyleProperty.map(({ key }) => key);
|
|
387
|
+
const containerDefaultProps = [
|
|
388
|
+
'padding',
|
|
389
|
+
'opacity',
|
|
390
|
+
'border',
|
|
391
|
+
'border-radius',
|
|
392
|
+
'box-shadow',
|
|
393
|
+
'background-color',
|
|
394
|
+
'overflow'
|
|
395
|
+
];
|
|
396
|
+
const textDefaultProps = [
|
|
397
|
+
'padding',
|
|
398
|
+
'opacity',
|
|
399
|
+
'background-color',
|
|
400
|
+
'color',
|
|
401
|
+
'font-size',
|
|
402
|
+
'font-family',
|
|
403
|
+
'font-weight',
|
|
404
|
+
'font-style',
|
|
405
|
+
'text-align',
|
|
406
|
+
'text-decoration',
|
|
407
|
+
'text-transform',
|
|
408
|
+
'line-height',
|
|
409
|
+
'letter-spacing',
|
|
410
|
+
'word-spacing'
|
|
411
|
+
];
|
|
412
|
+
const sizeDefaultProps = [
|
|
413
|
+
'width',
|
|
414
|
+
'min-width',
|
|
415
|
+
'max-width',
|
|
416
|
+
'height',
|
|
417
|
+
'min-height',
|
|
418
|
+
'max-height'
|
|
419
|
+
];
|
|
420
|
+
const buttonDefaultProps = [
|
|
421
|
+
'cursor',
|
|
422
|
+
'border',
|
|
423
|
+
'border-radius',
|
|
424
|
+
'box-shadow',
|
|
425
|
+
...textDefaultProps
|
|
426
|
+
];
|
|
427
|
+
const inputDefaultProps = [
|
|
428
|
+
'cursor',
|
|
429
|
+
'border',
|
|
430
|
+
'border-radius',
|
|
431
|
+
...textDefaultProps
|
|
432
|
+
];
|
|
433
|
+
export const quickStyleProperties = {
|
|
434
|
+
mapcomponent: {
|
|
435
|
+
map: containerDefaultProps
|
|
436
|
+
},
|
|
437
|
+
pdfcomponent: {
|
|
438
|
+
container: containerDefaultProps
|
|
439
|
+
},
|
|
440
|
+
formcomponent: {
|
|
441
|
+
container: containerDefaultProps,
|
|
442
|
+
button: buttonDefaultProps
|
|
443
|
+
},
|
|
444
|
+
htmlcomponent: {
|
|
445
|
+
container: allDefaultProps
|
|
446
|
+
},
|
|
447
|
+
iconcomponent: {
|
|
448
|
+
container: containerDefaultProps,
|
|
449
|
+
icon: [
|
|
450
|
+
'padding',
|
|
451
|
+
'opacity',
|
|
452
|
+
'cursor',
|
|
453
|
+
'width',
|
|
454
|
+
'min-width',
|
|
455
|
+
'max-width',
|
|
456
|
+
'height',
|
|
457
|
+
'min-height',
|
|
458
|
+
'max-height',
|
|
459
|
+
'color'
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
tabscomponent: {
|
|
463
|
+
tabRow: containerDefaultProps,
|
|
464
|
+
allTabs: [...textDefaultProps, ...sizeDefaultProps],
|
|
465
|
+
selectedTab: [...textDefaultProps, ...sizeDefaultProps],
|
|
466
|
+
container: containerDefaultProps
|
|
467
|
+
},
|
|
468
|
+
textcomponent: {
|
|
469
|
+
text: textDefaultProps
|
|
470
|
+
},
|
|
471
|
+
imagecomponent: {
|
|
472
|
+
image: containerDefaultProps
|
|
473
|
+
},
|
|
474
|
+
rangecomponent: {
|
|
475
|
+
handles: ['opacity', 'cursor', 'border', 'border-radius', 'background-color'],
|
|
476
|
+
bar: ['opacity', 'cursor', 'border', 'border-radius', 'background-color'],
|
|
477
|
+
limits: textDefaultProps,
|
|
478
|
+
values: textDefaultProps
|
|
479
|
+
},
|
|
480
|
+
tablecomponent: {
|
|
481
|
+
tableHeader: containerDefaultProps,
|
|
482
|
+
tableBody: containerDefaultProps,
|
|
483
|
+
tableFooter: containerDefaultProps,
|
|
484
|
+
container: containerDefaultProps
|
|
485
|
+
},
|
|
486
|
+
aggridcomponent: {},
|
|
487
|
+
buttoncomponent: {
|
|
488
|
+
button: buttonDefaultProps
|
|
489
|
+
},
|
|
490
|
+
drawercomponent: {
|
|
491
|
+
container: containerDefaultProps
|
|
492
|
+
},
|
|
493
|
+
plotlycomponent: {},
|
|
494
|
+
selectcomponent: {
|
|
495
|
+
input: inputDefaultProps
|
|
496
|
+
},
|
|
497
|
+
slidercomponent: {
|
|
498
|
+
handles: ['opacity', 'cursor', 'border', 'border-radius', 'background-color'],
|
|
499
|
+
bar: ['opacity', 'cursor', 'border', 'border-radius', 'background-color'],
|
|
500
|
+
limits: textDefaultProps,
|
|
501
|
+
values: textDefaultProps
|
|
502
|
+
},
|
|
503
|
+
displaycomponent: {
|
|
504
|
+
header: [...containerDefaultProps, ...textDefaultProps],
|
|
505
|
+
container: containerDefaultProps
|
|
506
|
+
},
|
|
507
|
+
barchartcomponent: {
|
|
508
|
+
container: containerDefaultProps
|
|
509
|
+
},
|
|
510
|
+
checkboxcomponent: {
|
|
511
|
+
text: textDefaultProps
|
|
512
|
+
},
|
|
513
|
+
currencycomponent: {
|
|
514
|
+
input: inputDefaultProps
|
|
515
|
+
},
|
|
516
|
+
piechartcomponent: {
|
|
517
|
+
container: containerDefaultProps
|
|
518
|
+
},
|
|
519
|
+
vegalitecomponent: {},
|
|
520
|
+
containercomponent: {
|
|
521
|
+
container: containerDefaultProps
|
|
522
|
+
},
|
|
523
|
+
dateinputcomponent: {
|
|
524
|
+
input: inputDefaultProps
|
|
525
|
+
},
|
|
526
|
+
fileinputcomponent: {
|
|
527
|
+
container: containerDefaultProps
|
|
528
|
+
},
|
|
529
|
+
textinputcomponent: {
|
|
530
|
+
input: inputDefaultProps
|
|
531
|
+
},
|
|
532
|
+
emailinputcomponent: {
|
|
533
|
+
input: inputDefaultProps
|
|
534
|
+
},
|
|
535
|
+
formbuttoncomponent: {
|
|
536
|
+
button: buttonDefaultProps,
|
|
537
|
+
popup: containerDefaultProps
|
|
538
|
+
},
|
|
539
|
+
timeseriescomponent: {
|
|
540
|
+
container: containerDefaultProps
|
|
541
|
+
},
|
|
542
|
+
multiselectcomponent: {
|
|
543
|
+
input: inputDefaultProps
|
|
544
|
+
},
|
|
545
|
+
numberinputcomponent: {
|
|
546
|
+
input: inputDefaultProps
|
|
547
|
+
},
|
|
548
|
+
scatterchartcomponent: {
|
|
549
|
+
container: containerDefaultProps
|
|
550
|
+
},
|
|
551
|
+
passwordinputcomponent: {
|
|
552
|
+
input: inputDefaultProps
|
|
553
|
+
},
|
|
554
|
+
resourceselectcomponent: {
|
|
555
|
+
input: inputDefaultProps
|
|
556
|
+
},
|
|
557
|
+
verticaldividercomponent: {
|
|
558
|
+
divider: [
|
|
559
|
+
'padding',
|
|
560
|
+
'opacity',
|
|
561
|
+
'width',
|
|
562
|
+
'min-width',
|
|
563
|
+
'max-width',
|
|
564
|
+
'height',
|
|
565
|
+
'min-height',
|
|
566
|
+
'max-height',
|
|
567
|
+
'border',
|
|
568
|
+
'border-radius',
|
|
569
|
+
'background-color'
|
|
570
|
+
],
|
|
571
|
+
container: containerDefaultProps
|
|
572
|
+
},
|
|
573
|
+
horizontaldividercomponent: {
|
|
574
|
+
divider: [
|
|
575
|
+
'padding',
|
|
576
|
+
'opacity',
|
|
577
|
+
'width',
|
|
578
|
+
'min-width',
|
|
579
|
+
'max-width',
|
|
580
|
+
'height',
|
|
581
|
+
'min-height',
|
|
582
|
+
'max-height',
|
|
583
|
+
'border',
|
|
584
|
+
'border-radius',
|
|
585
|
+
'background-color'
|
|
586
|
+
],
|
|
587
|
+
container: containerDefaultProps
|
|
588
|
+
},
|
|
589
|
+
verticalsplitpanescomponent: {
|
|
590
|
+
container: containerDefaultProps
|
|
591
|
+
},
|
|
592
|
+
horizontalsplitpanescomponent: {
|
|
593
|
+
container: containerDefaultProps
|
|
594
|
+
}
|
|
595
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
|
-
import {
|
|
2
|
+
import { faChevronRight } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
4
|
import PanelSection from './common/PanelSection.svelte';
|
|
5
5
|
import InputsSpecsEditor from './InputsSpecsEditor.svelte';
|
|
@@ -7,7 +7,7 @@ import TableActions from './TableActions.svelte';
|
|
|
7
7
|
import StaticInputEditor from './inputEditor/StaticInputEditor.svelte';
|
|
8
8
|
import ConnectedInputEditor from './inputEditor/ConnectedInputEditor.svelte';
|
|
9
9
|
import Badge from '../../../common/badge/Badge.svelte';
|
|
10
|
-
import { capitalize, classNames, getModifierKey } from '../../../../utils';
|
|
10
|
+
import { capitalize, classNames, getModifierKey, isMac } from '../../../../utils';
|
|
11
11
|
import { buildExtraLib, fieldTypeToTsType } from '../../utils';
|
|
12
12
|
import Recompute from './Recompute.svelte';
|
|
13
13
|
import Tooltip from '../../../Tooltip.svelte';
|
|
@@ -23,6 +23,9 @@ import GridPane from './GridPane.svelte';
|
|
|
23
23
|
import { slide } from 'svelte/transition';
|
|
24
24
|
import { push } from '../../../../history';
|
|
25
25
|
import Kbd from '../../../common/kbd/Kbd.svelte';
|
|
26
|
+
import { secondaryMenu } from './secondaryMenu';
|
|
27
|
+
import StylePanel from './StylePanel.svelte';
|
|
28
|
+
import { Delete } from 'lucide-svelte';
|
|
26
29
|
export let componentSettings = undefined;
|
|
27
30
|
export let rowColumns = false;
|
|
28
31
|
export let onDelete = undefined;
|
|
@@ -59,12 +62,10 @@ $: extraLib =
|
|
|
59
62
|
? buildExtraLib($worldStore?.outputsById ?? {}, componentSettings?.item?.data?.id, false, $state, false)
|
|
60
63
|
: undefined;
|
|
61
64
|
function keydown(event) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
65
|
+
const { key, metaKey } = event;
|
|
66
|
+
if (key === 'Delte' || (key === 'Backspace' && metaKey)) {
|
|
67
|
+
removeGridElement();
|
|
68
|
+
event.stopPropagation();
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
const initialConfiguration = componentSettings?.item?.data?.type
|
|
@@ -201,19 +202,20 @@ $: componentSettings?.item?.data && ($app = $app);
|
|
|
201
202
|
<div class="grow shrink" />
|
|
202
203
|
|
|
203
204
|
{#if Object.keys(ccomponents[component.type].customCss ?? {}).length > 0}
|
|
204
|
-
<PanelSection title="
|
|
205
|
+
<PanelSection title="Styling">
|
|
205
206
|
<div slot="action">
|
|
206
207
|
<Button
|
|
207
208
|
color="light"
|
|
208
209
|
size="xs"
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
variant="border"
|
|
211
|
+
endIcon={{ icon: faChevronRight }}
|
|
212
|
+
on:click={() => secondaryMenu.open(StylePanel, { component })}
|
|
211
213
|
>
|
|
212
|
-
|
|
214
|
+
Open
|
|
213
215
|
</Button>
|
|
214
216
|
</div>
|
|
215
217
|
{#if viewCssOptions}
|
|
216
|
-
<div transition:slide|local>
|
|
218
|
+
<div transition:slide|local class="w-full">
|
|
217
219
|
{#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
|
|
218
220
|
{#if componentSettings.item.data?.customCss != undefined}
|
|
219
221
|
<div class="w-full mb-2">
|
|
@@ -236,7 +238,15 @@ $: componentSettings?.item?.data && ($app = $app);
|
|
|
236
238
|
<div slot="action">
|
|
237
239
|
<Button size="xs" color="red" variant="border" on:click={removeGridElement}>
|
|
238
240
|
Delete
|
|
239
|
-
|
|
241
|
+
{#if isMac()}
|
|
242
|
+
<Kbd kbdClass="center-center">
|
|
243
|
+
<span class="text-lg leading-none">⌘</span>
|
|
244
|
+
<span class="px-0.5">+</span>
|
|
245
|
+
<Delete size={16} />
|
|
246
|
+
</Kbd>
|
|
247
|
+
{:else}
|
|
248
|
+
<Kbd>Del</Kbd>
|
|
249
|
+
{/if}
|
|
240
250
|
</Button>
|
|
241
251
|
</div>
|
|
242
252
|
<div class="flex flex-col gap-1">
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { ccomponents } from '../component';
|
|
3
|
+
import CssProperty from '../componentsPanel/CssProperty.svelte';
|
|
4
|
+
import { quickStyleProperties } from '../componentsPanel/quickStyleProperties';
|
|
5
|
+
export let component;
|
|
6
|
+
const { app } = getContext('AppViewerContext');
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
{#if component && component.customCss !== undefined}
|
|
10
|
+
{#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
|
|
11
|
+
<div class="w-full">
|
|
12
|
+
<CssProperty
|
|
13
|
+
quickStyleProperties={quickStyleProperties?.[component.type]?.[name]}
|
|
14
|
+
forceStyle={ccomponents[component.type].customCss[name].style !== undefined}
|
|
15
|
+
forceClass={ccomponents[component.type].customCss[name].class !== undefined}
|
|
16
|
+
{name}
|
|
17
|
+
componentType={component.type}
|
|
18
|
+
bind:value={component.customCss[name]}
|
|
19
|
+
on:change={() => app.set($app)}
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
{/each}
|
|
23
|
+
{/if}
|