windmill-components 1.82.0 → 1.82.1
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/AppButton.svelte +2 -16
- package/components/apps/components/buttons/AppForm.svelte +2 -9
- package/components/apps/components/buttons/AppFormButton.svelte +59 -82
- package/components/apps/components/display/PlotlyHtml.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +15 -8
- package/components/apps/components/helpers/RunnableComponent.svelte +9 -6
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte +2 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/components/apps/editor/AppEditor.svelte +14 -12
- package/components/apps/editor/AppPreview.svelte +1 -2
- package/components/apps/editor/component/Component.svelte +1 -1
- 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
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
export default class Multiselect extends SvelteComponentTyped<{
|
|
5
5
|
value?: any[] | undefined;
|
|
6
6
|
id?: string | undefined;
|
|
7
|
-
readonly?: boolean | undefined;
|
|
8
7
|
placeholder?: string | undefined;
|
|
8
|
+
readonly?: boolean | undefined;
|
|
9
9
|
}, {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
11
11
|
}, {
|
|
@@ -20,8 +20,8 @@ declare const __propDef: {
|
|
|
20
20
|
props: {
|
|
21
21
|
value?: any[] | undefined;
|
|
22
22
|
id?: string | undefined;
|
|
23
|
-
readonly?: boolean | undefined;
|
|
24
23
|
placeholder?: string | undefined;
|
|
24
|
+
readonly?: boolean | undefined;
|
|
25
25
|
};
|
|
26
26
|
events: {
|
|
27
27
|
[evt: string]: CustomEvent<any>;
|
|
@@ -32,8 +32,6 @@ if (controls) {
|
|
|
32
32
|
$componentControl[id] = controls;
|
|
33
33
|
}
|
|
34
34
|
let runnableComponent;
|
|
35
|
-
let isLoading = false;
|
|
36
|
-
let ownClick = false;
|
|
37
35
|
let beforeIconComponent;
|
|
38
36
|
let afterIconComponent;
|
|
39
37
|
$: resolvedConfig.beforeIcon && handleBeforeIcon();
|
|
@@ -49,19 +47,6 @@ async function handleAfterIcon() {
|
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
$: resolvedConfig?.triggerOnAppLoad && runnableComponent?.runComponent();
|
|
52
|
-
$: if (outputs?.loading != undefined) {
|
|
53
|
-
outputs.loading.set(false, true);
|
|
54
|
-
}
|
|
55
|
-
$: outputs?.loading.subscribe({
|
|
56
|
-
id: 'loading-' + id,
|
|
57
|
-
next: (value) => {
|
|
58
|
-
isLoading = value;
|
|
59
|
-
if (ownClick && !value) {
|
|
60
|
-
ownClick = false;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
$: loading = isLoading && ownClick;
|
|
65
50
|
let errors = {};
|
|
66
51
|
$: errorsMessage = Object.values(errors)
|
|
67
52
|
.filter((x) => x != '')
|
|
@@ -74,7 +59,6 @@ async function handleClick(event) {
|
|
|
74
59
|
if (preclickAction) {
|
|
75
60
|
await preclickAction();
|
|
76
61
|
}
|
|
77
|
-
ownClick = true;
|
|
78
62
|
if (!runnableComponent) {
|
|
79
63
|
runnableWrapper.onSuccess();
|
|
80
64
|
}
|
|
@@ -82,6 +66,7 @@ async function handleClick(event) {
|
|
|
82
66
|
await runnableComponent?.runComponent();
|
|
83
67
|
}
|
|
84
68
|
}
|
|
69
|
+
let loading = false;
|
|
85
70
|
</script>
|
|
86
71
|
|
|
87
72
|
{#each Object.keys(components['buttoncomponent'].initialData.configuration) as key (key)}
|
|
@@ -100,6 +85,7 @@ async function handleClick(event) {
|
|
|
100
85
|
bind:this={runnableWrapper}
|
|
101
86
|
{recomputeIds}
|
|
102
87
|
bind:runnableComponent
|
|
88
|
+
bind:loading
|
|
103
89
|
{componentInput}
|
|
104
90
|
doOnSuccess={resolvedConfig.onSuccess}
|
|
105
91
|
{id}
|
|
@@ -28,16 +28,8 @@ let isLoading = false;
|
|
|
28
28
|
$: noInputs =
|
|
29
29
|
$stateId != undefined &&
|
|
30
30
|
(componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0);
|
|
31
|
-
$: if (outputs?.loading != undefined) {
|
|
32
|
-
outputs.loading.set(false, true);
|
|
33
|
-
}
|
|
34
|
-
$: outputs?.loading.subscribe({
|
|
35
|
-
id: 'loading-' + id,
|
|
36
|
-
next: (value) => {
|
|
37
|
-
isLoading = value;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
31
|
$: css = concatCustomCss($app.css?.formcomponent, customCss);
|
|
32
|
+
let loading = false;
|
|
41
33
|
</script>
|
|
42
34
|
|
|
43
35
|
{#each Object.keys(components['formcomponent'].initialData.configuration) as key (key)}
|
|
@@ -53,6 +45,7 @@ $: css = concatCustomCss($app.css?.formcomponent, customCss);
|
|
|
53
45
|
{recomputeIds}
|
|
54
46
|
{render}
|
|
55
47
|
bind:runnableComponent
|
|
48
|
+
bind:loading
|
|
56
49
|
{componentInput}
|
|
57
50
|
{id}
|
|
58
51
|
doOnSuccess={resolvedConfig.onSuccess}
|
|
@@ -3,14 +3,12 @@ import { faUser } from '@fortawesome/free-solid-svg-icons';
|
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
4
|
import { Icon } from 'svelte-awesome';
|
|
5
5
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
6
|
-
import InputValue from '../helpers/InputValue.svelte';
|
|
7
6
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
8
|
-
import Portal from 'svelte-portal';
|
|
9
|
-
import Modal from '../../../common/modal/Modal.svelte';
|
|
10
7
|
import { concatCustomCss } from '../../utils';
|
|
11
8
|
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
12
9
|
import { components } from '../../editor/component';
|
|
13
10
|
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
11
|
+
import AlwaysMountedModal, { getModal } from '../../../common/modal/AlwaysMountedModal.svelte';
|
|
14
12
|
export let id;
|
|
15
13
|
export let componentInput;
|
|
16
14
|
export let configuration;
|
|
@@ -27,10 +25,7 @@ let outputs = initOutput($worldStore, id, {
|
|
|
27
25
|
});
|
|
28
26
|
let resolvedConfig = initConfig(components['formbuttoncomponent'].initialData.configuration, configuration);
|
|
29
27
|
let runnableComponent;
|
|
30
|
-
let isLoading = false;
|
|
31
|
-
let ownClick = false;
|
|
32
28
|
let errors = {};
|
|
33
|
-
let open = false;
|
|
34
29
|
$: errorsMessage = Object.values(errors)
|
|
35
30
|
.filter((x) => x != '')
|
|
36
31
|
.join('\n');
|
|
@@ -39,18 +34,9 @@ $: noInputs =
|
|
|
39
34
|
$: if (outputs?.loading != undefined) {
|
|
40
35
|
outputs.loading.set(false, true);
|
|
41
36
|
}
|
|
42
|
-
$: outputs?.loading.subscribe({
|
|
43
|
-
id: 'loading-' + id,
|
|
44
|
-
next: (value) => {
|
|
45
|
-
isLoading = value;
|
|
46
|
-
if (ownClick && !value) {
|
|
47
|
-
ownClick = false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
$: loading = isLoading && ownClick;
|
|
52
37
|
$: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
|
|
53
38
|
let runnableWrapper;
|
|
39
|
+
let loading = false;
|
|
54
40
|
</script>
|
|
55
41
|
|
|
56
42
|
{#each Object.keys(components['formbuttoncomponent'].initialData.configuration) as key (key)}
|
|
@@ -62,73 +48,64 @@ let runnableWrapper;
|
|
|
62
48
|
/>
|
|
63
49
|
{/each}
|
|
64
50
|
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
51
|
+
<AlwaysMountedModal
|
|
52
|
+
title={resolvedConfig.label ?? ''}
|
|
53
|
+
class={css?.popup?.class}
|
|
54
|
+
style={css?.popup?.style}
|
|
55
|
+
>
|
|
56
|
+
<RunnableWrapper
|
|
57
|
+
bind:this={runnableWrapper}
|
|
58
|
+
{recomputeIds}
|
|
59
|
+
{render}
|
|
60
|
+
bind:runnableComponent
|
|
61
|
+
{componentInput}
|
|
62
|
+
{id}
|
|
63
|
+
{extraQueryParams}
|
|
64
|
+
autoRefresh={false}
|
|
65
|
+
forceSchemaDisplay={true}
|
|
66
|
+
runnableClass="!block"
|
|
67
|
+
{outputs}
|
|
68
|
+
doOnSuccess={resolvedConfig.onSuccess}
|
|
77
69
|
>
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<div class="flex
|
|
93
|
-
<
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}}
|
|
114
|
-
on:click={async () => {
|
|
115
|
-
if (!runnableComponent) {
|
|
116
|
-
runnableWrapper.onSuccess()
|
|
117
|
-
} else {
|
|
118
|
-
await runnableComponent?.runComponent()
|
|
119
|
-
}
|
|
120
|
-
open = false
|
|
121
|
-
}}
|
|
122
|
-
size="xs"
|
|
123
|
-
color="dark"
|
|
124
|
-
>
|
|
125
|
-
Submit
|
|
126
|
-
</Button>
|
|
127
|
-
</div>
|
|
70
|
+
<div class="flex flex-col gap-2 px-4 w-full">
|
|
71
|
+
<div>
|
|
72
|
+
{#if noInputs}
|
|
73
|
+
<div class="text-gray-600 italic text-sm my-4">
|
|
74
|
+
Run forms are associated with a runnable that has user inputs.
|
|
75
|
+
<br />
|
|
76
|
+
Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
|
|
77
|
+
<strong>
|
|
78
|
+
User Input
|
|
79
|
+
<Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
|
|
80
|
+
</strong>
|
|
81
|
+
</div>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
84
|
+
<div class="flex justify-end">
|
|
85
|
+
<Button
|
|
86
|
+
{loading}
|
|
87
|
+
btnClasses="my-1"
|
|
88
|
+
on:pointerdown={(e) => {
|
|
89
|
+
e?.stopPropagation()
|
|
90
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
91
|
+
}}
|
|
92
|
+
on:click={async () => {
|
|
93
|
+
if (!runnableComponent) {
|
|
94
|
+
runnableWrapper.onSuccess()
|
|
95
|
+
} else {
|
|
96
|
+
await runnableComponent?.runComponent()
|
|
97
|
+
}
|
|
98
|
+
getModal().close()
|
|
99
|
+
}}
|
|
100
|
+
size="xs"
|
|
101
|
+
color="dark"
|
|
102
|
+
>
|
|
103
|
+
Submit
|
|
104
|
+
</Button>
|
|
128
105
|
</div>
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
</
|
|
106
|
+
</div>
|
|
107
|
+
</RunnableWrapper>
|
|
108
|
+
</AlwaysMountedModal>
|
|
132
109
|
|
|
133
110
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
134
111
|
{#if errorsMessage}
|
|
@@ -141,7 +118,7 @@ let runnableWrapper;
|
|
|
141
118
|
btnClasses={css?.button?.class ?? ''}
|
|
142
119
|
style={css?.button?.style ?? ''}
|
|
143
120
|
on:click={(e) => {
|
|
144
|
-
open
|
|
121
|
+
getModal().open()
|
|
145
122
|
}}
|
|
146
123
|
>
|
|
147
124
|
{resolvedConfig.label}
|
|
@@ -27,7 +27,7 @@ $: Plotly &&
|
|
|
27
27
|
divEl &&
|
|
28
28
|
h &&
|
|
29
29
|
w &&
|
|
30
|
-
Plotly.newPlot(divEl, [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
|
|
30
|
+
Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
|
|
@@ -221,7 +221,8 @@ $componentControl[id] = {
|
|
|
221
221
|
on:click={() => toggleRow(row, rowIndex)}
|
|
222
222
|
>
|
|
223
223
|
<div class="center-center h-full w-full flex-wrap gap-1 ">
|
|
224
|
-
{#each actionButtons as actionButton, actionIndex (
|
|
224
|
+
{#each actionButtons as actionButton, actionIndex (actionButton?.id)}
|
|
225
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
225
226
|
<div
|
|
226
227
|
on:mouseover|stopPropagation={() => {
|
|
227
228
|
if (actionButton.id !== $hoverStore) {
|
|
@@ -255,12 +256,15 @@ $componentControl[id] = {
|
|
|
255
256
|
extraKey={'idx' + rowIndex}
|
|
256
257
|
{render}
|
|
257
258
|
noWFull
|
|
258
|
-
{...actionButton}
|
|
259
259
|
preclickAction={async () => {
|
|
260
260
|
toggleRow(row, rowIndex)
|
|
261
261
|
}}
|
|
262
|
+
id={actionButton.id}
|
|
263
|
+
customCss={actionButton.customCss}
|
|
264
|
+
configuration={actionButton.configuration}
|
|
265
|
+
recomputeIds={actionButton.recomputeIds}
|
|
262
266
|
extraQueryParams={{ row: row.original }}
|
|
263
|
-
|
|
267
|
+
componentInput={actionButton.componentInput}
|
|
264
268
|
controls={{
|
|
265
269
|
left: () => {
|
|
266
270
|
if (actionIndex === 0) {
|
|
@@ -288,12 +292,15 @@ $componentControl[id] = {
|
|
|
288
292
|
extraKey={'idx' + rowIndex}
|
|
289
293
|
{render}
|
|
290
294
|
noWFull
|
|
291
|
-
{
|
|
295
|
+
id={actionButton.id}
|
|
296
|
+
customCss={actionButton.customCss}
|
|
297
|
+
configuration={actionButton.configuration}
|
|
298
|
+
recomputeIds={actionButton.recomputeIds}
|
|
292
299
|
preclickAction={async () => {
|
|
293
300
|
toggleRow(row, rowIndex)
|
|
294
301
|
}}
|
|
295
302
|
extraQueryParams={{ row: row.original }}
|
|
296
|
-
|
|
303
|
+
componentInput={actionButton.componentInput}
|
|
297
304
|
/>
|
|
298
305
|
{/if}
|
|
299
306
|
</div>
|
|
@@ -319,9 +326,9 @@ $componentControl[id] = {
|
|
|
319
326
|
<div class="flex flex-col h-full w-full overflow-auto">
|
|
320
327
|
<Alert title="Parsing issues" type="error" size="xs" class="h-full w-full ">
|
|
321
328
|
The result should be an array of objects. Received:
|
|
322
|
-
<pre class="w-full bg-white p-2 rounded-md"
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
<pre class="w-full bg-white p-2 rounded-md whitespace-pre-wrap"
|
|
330
|
+
>{JSON.stringify(result, null, 4)}</pre
|
|
331
|
+
>
|
|
325
332
|
</Alert>
|
|
326
333
|
</div>
|
|
327
334
|
{/if}
|
|
@@ -27,6 +27,7 @@ export let recomputable = false;
|
|
|
27
27
|
export let outputs;
|
|
28
28
|
export let extraKey = '';
|
|
29
29
|
export let doNotRecomputeOnInputChanged = false;
|
|
30
|
+
export let loading = false;
|
|
30
31
|
const { worldStore, runnableComponents, workspace, appPath, isEditor, jobs, noBackend, errorByComponent, mode, stateId, state, componentControl } = getContext('AppViewerContext');
|
|
31
32
|
const dispatch = createEventDispatcher();
|
|
32
33
|
if (recomputable || autoRefresh) {
|
|
@@ -39,6 +40,7 @@ let args = undefined;
|
|
|
39
40
|
let testIsLoading = false;
|
|
40
41
|
let runnableInputValues = {};
|
|
41
42
|
let executeTimeout = undefined;
|
|
43
|
+
$: outputs.loading?.set(loading);
|
|
42
44
|
function setDebouncedExecute() {
|
|
43
45
|
executeTimeout && clearTimeout(executeTimeout);
|
|
44
46
|
executeTimeout = setTimeout(() => {
|
|
@@ -103,7 +105,7 @@ function stripSchema(inputs, s) {
|
|
|
103
105
|
}
|
|
104
106
|
async function executeComponent(noToast = false, inlineScriptOverride) {
|
|
105
107
|
if (runnable?.type === 'runnableByName' && runnable.inlineScript?.language === 'frontend') {
|
|
106
|
-
|
|
108
|
+
loading = true;
|
|
107
109
|
try {
|
|
108
110
|
const r = await eval_like(runnable.inlineScript?.content, computeGlobalContext($worldStore, id, {}), false, $state, $mode == 'dnd', $componentControl, $worldStore);
|
|
109
111
|
await setResult(r);
|
|
@@ -112,7 +114,7 @@ async function executeComponent(noToast = false, inlineScriptOverride) {
|
|
|
112
114
|
catch (e) {
|
|
113
115
|
sendUserToast('Error running frontend script: ' + e.message, true);
|
|
114
116
|
}
|
|
115
|
-
|
|
117
|
+
loading = false;
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
120
|
if (noBackend) {
|
|
@@ -124,7 +126,7 @@ async function executeComponent(noToast = false, inlineScriptOverride) {
|
|
|
124
126
|
if (runnable?.type === 'runnableByName' && !runnable.inlineScript) {
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
|
-
|
|
129
|
+
loading = true;
|
|
128
130
|
try {
|
|
129
131
|
let njob = await testJobLoader?.abstractRun(() => {
|
|
130
132
|
const nonStaticRunnableInputs = {};
|
|
@@ -172,7 +174,8 @@ async function executeComponent(noToast = false, inlineScriptOverride) {
|
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
catch (e) {
|
|
175
|
-
|
|
177
|
+
setResult({ error: e.body ?? e.message });
|
|
178
|
+
loading = false;
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
181
|
export async function runComponent() {
|
|
@@ -180,7 +183,7 @@ export async function runComponent() {
|
|
|
180
183
|
await executeComponent();
|
|
181
184
|
}
|
|
182
185
|
catch (e) {
|
|
183
|
-
|
|
186
|
+
setResult({ error: e.body ?? e.message });
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
let lastStartedAt = Date.now();
|
|
@@ -256,7 +259,7 @@ async function setResult(res) {
|
|
|
256
259
|
setResult(e.detail.result)
|
|
257
260
|
}
|
|
258
261
|
}
|
|
259
|
-
|
|
262
|
+
loading = false
|
|
260
263
|
}}
|
|
261
264
|
bind:isLoading={testIsLoading}
|
|
262
265
|
bind:job={testJob}
|
|
@@ -8,6 +8,7 @@ export let componentInput;
|
|
|
8
8
|
export let id;
|
|
9
9
|
export let result = undefined;
|
|
10
10
|
export let initializing = true;
|
|
11
|
+
export let loading = false;
|
|
11
12
|
export let extraQueryParams = {};
|
|
12
13
|
export let autoRefresh = true;
|
|
13
14
|
export let runnableComponent = undefined;
|
|
@@ -73,6 +74,7 @@ export function onSuccess() {
|
|
|
73
74
|
{:else if componentInput.type === 'runnable' && isRunnableDefined(componentInput)}
|
|
74
75
|
<RunnableComponent
|
|
75
76
|
{extraKey}
|
|
77
|
+
bind:loading
|
|
76
78
|
bind:this={runnableComponent}
|
|
77
79
|
fields={componentInput.fields}
|
|
78
80
|
bind:result
|
|
@@ -8,6 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
id: string;
|
|
9
9
|
result?: any;
|
|
10
10
|
initializing?: boolean | undefined;
|
|
11
|
+
loading?: boolean | undefined;
|
|
11
12
|
extraQueryParams?: Record<string, any> | undefined;
|
|
12
13
|
autoRefresh?: boolean | undefined;
|
|
13
14
|
runnableComponent?: RunnableComponent | undefined;
|
|
@@ -10,8 +10,7 @@ import Tabs from '../../common/tabs/Tabs.svelte';
|
|
|
10
10
|
import TabContent from '../../common/tabs/TabContent.svelte';
|
|
11
11
|
import { Alert, Button, Tab } from '../../common';
|
|
12
12
|
import ComponentList from './componentsPanel/ComponentList.svelte';
|
|
13
|
-
import
|
|
14
|
-
import { faCode, faPlus, faSliders } from '@fortawesome/free-solid-svg-icons';
|
|
13
|
+
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
15
14
|
import ContextPanel from './contextPanel/ContextPanel.svelte';
|
|
16
15
|
import { classNames, encodeState } from '../../../utils';
|
|
17
16
|
import AppPreview from './AppPreview.svelte';
|
|
@@ -26,6 +25,8 @@ import { initHistory } from '../../../history';
|
|
|
26
25
|
import ComponentNavigation from './component/ComponentNavigation.svelte';
|
|
27
26
|
import ItemPicker from '../../ItemPicker.svelte';
|
|
28
27
|
import VariableEditor from '../../VariableEditor.svelte';
|
|
28
|
+
import { SecondaryMenu } from './settingsPanel/secondaryMenu';
|
|
29
|
+
import { Component, Paintbrush, Plus } from 'lucide-svelte';
|
|
29
30
|
export let app;
|
|
30
31
|
export let path;
|
|
31
32
|
export let initialMode = 'dnd';
|
|
@@ -160,7 +161,7 @@ let variableEditor = undefined;
|
|
|
160
161
|
<Pane size={15} minSize={5} maxSize={33}>
|
|
161
162
|
<ContextPanel />
|
|
162
163
|
</Pane>
|
|
163
|
-
<Pane size={
|
|
164
|
+
<Pane size={63}>
|
|
164
165
|
<SplitPanesWrapper>
|
|
165
166
|
<Splitpanes horizontal>
|
|
166
167
|
<Pane size={70}>
|
|
@@ -201,31 +202,32 @@ let variableEditor = undefined;
|
|
|
201
202
|
</Splitpanes>
|
|
202
203
|
</SplitPanesWrapper>
|
|
203
204
|
</Pane>
|
|
204
|
-
<Pane size={
|
|
205
|
+
<Pane size={22} minSize={5} maxSize={33}>
|
|
205
206
|
<div class="relative flex flex-col h-full">
|
|
206
207
|
<Tabs bind:selected={selectedTab} wrapperClass="!h-[40px]" class="!h-full">
|
|
207
208
|
<Tab value="insert" size="xs">
|
|
208
|
-
<div class="m-1 center-center gap-
|
|
209
|
-
<
|
|
209
|
+
<div class="m-1 center-center gap-1">
|
|
210
|
+
<Plus size={18} />
|
|
210
211
|
<span>Insert</span>
|
|
211
212
|
</div>
|
|
212
213
|
</Tab>
|
|
213
214
|
<Tab value="settings" size="xs">
|
|
214
|
-
<div class="m-1 center-center gap-
|
|
215
|
-
<
|
|
216
|
-
<span>
|
|
215
|
+
<div class="m-1 center-center gap-1">
|
|
216
|
+
<Component size={18} />
|
|
217
|
+
<span>Component</span>
|
|
217
218
|
</div>
|
|
218
219
|
</Tab>
|
|
219
220
|
<Tab value="css" size="xs">
|
|
220
|
-
<div class="m-1 center-center gap-
|
|
221
|
-
<
|
|
222
|
-
<span>
|
|
221
|
+
<div class="m-1 center-center gap-1">
|
|
222
|
+
<Paintbrush size={18} />
|
|
223
|
+
<span>Styling</span>
|
|
223
224
|
</div>
|
|
224
225
|
</Tab>
|
|
225
226
|
<div slot="content" class="h-full overflow-y-auto">
|
|
226
227
|
<TabContent class="overflow-auto h-full" value="settings">
|
|
227
228
|
{#if $selectedComponent !== undefined}
|
|
228
229
|
<SettingsPanel />
|
|
230
|
+
<SecondaryMenu />
|
|
229
231
|
{:else}
|
|
230
232
|
<div class="min-w-[150px] text-sm text-gray-500 text-center py-8 px-2">
|
|
231
233
|
Select a component to see the settings for it
|
|
@@ -82,8 +82,7 @@ $: lockedClasses = isLocked ? '!max-h-[400px] overflow-hidden pointer-events-non
|
|
|
82
82
|
)}
|
|
83
83
|
>
|
|
84
84
|
<div
|
|
85
|
-
class="w-full sticky top-0 flex justify-between border-b bg-gray-50 px-4 py-1 items-center gap-4"
|
|
86
|
-
style="z-index: 1000;"
|
|
85
|
+
class="w-full sticky z-[1001] top-0 flex justify-between border-b bg-gray-50 px-4 py-1 items-center gap-4"
|
|
87
86
|
>
|
|
88
87
|
<h2 class="truncate">{summary}</h2>
|
|
89
88
|
<RecomputeAllComponents />
|
|
@@ -143,7 +143,7 @@ $: hasError = componentWithErrors.includes(component.id);
|
|
|
143
143
|
customCss={component.customCss}
|
|
144
144
|
bind:initializing
|
|
145
145
|
componentInput={component.componentInput}
|
|
146
|
-
|
|
146
|
+
actionButtons={component.actionButtons}
|
|
147
147
|
{render}
|
|
148
148
|
/>
|
|
149
149
|
{:else if component.type === 'aggridcomponent'}
|
|
@@ -144,7 +144,8 @@ function handlePaste(event) {
|
|
|
144
144
|
function keydown(event) {
|
|
145
145
|
// Ignore keydown events if the user is typing in monaco
|
|
146
146
|
let classes = event.target?.['className'];
|
|
147
|
-
if (typeof classes === 'string' && classes.includes('inputarea'))
|
|
147
|
+
if ((typeof classes === 'string' && classes.includes('inputarea')) ||
|
|
148
|
+
['INPUT', 'TEXTAREA'].includes(document.activeElement?.tagName)) {
|
|
148
149
|
return;
|
|
149
150
|
}
|
|
150
151
|
switch (event.key) {
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
1. Add the component to one of the component sets: `layout`, `buttons`,
|
|
9
9
|
`inputs` or `display` _(this controls which group the component will be
|
|
10
10
|
placed in in the **Insert** menu)_
|
|
11
|
+
1. [**`quickStyleProperties.ts`**](../componentsPanel/quickStyleProperties.ts):
|
|
12
|
+
1. Add the component to the `quickStyleProperties` record
|
|
13
|
+
1. _(optional)_ Add the CSS properties that could be applied to the component
|
|
14
|
+
parts
|
|
11
15
|
1. [**`Component.svelte`**](./Component.svelte):
|
|
12
16
|
1. Add the new component in the Svelte `if` statement
|
|
13
17
|
1. [**`default-codes.ts`**](./default-codes.ts):
|