windmill-components 1.82.6 → 1.82.8
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/ArgInput.svelte +0 -6
- package/components/FlowBuilder.svelte +5 -0
- package/components/LightweightArgInput.svelte +0 -5
- package/components/Multiselect.svelte.d.ts +2 -2
- package/components/Toggle.svelte +1 -1
- package/components/Toggle.svelte.d.ts +0 -1
- package/components/apps/components/buttons/AppButton.svelte +3 -17
- package/components/apps/components/buttons/AppForm.svelte +2 -10
- package/components/apps/components/buttons/AppFormButton.svelte +58 -82
- package/components/apps/components/display/AppDisplayComponent.svelte +23 -17
- package/components/apps/components/display/AppHtml.svelte +7 -1
- package/components/apps/components/display/AppHtml.svelte.d.ts +2 -0
- package/components/apps/components/display/AppMap.svelte +1 -1
- package/components/apps/components/display/AppPdf.svelte +1 -1
- package/components/apps/components/display/PlotlyHtml.svelte +20 -3
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +2 -0
- package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +21 -14
- package/components/apps/components/helpers/HiddenComponent.svelte +3 -2
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +2 -1
- package/components/apps/components/helpers/RefreshButton.svelte +3 -10
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +1 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +17 -13
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +3 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/components/apps/components/inputs/AppCheckbox.svelte +0 -4
- package/components/apps/components/inputs/AppDateInput.svelte +2 -2
- package/components/apps/components/inputs/AppMultiSelect.svelte +7 -3
- package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
- package/components/apps/components/inputs/AppSelect.svelte +3 -4
- package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/inputs/AppTextInput.svelte +7 -10
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
- package/components/apps/components/layout/AppContainer.svelte +2 -2
- package/components/apps/components/layout/AppDrawer.svelte +1 -2
- package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +48 -20
- package/components/apps/editor/AppEditorHeader.svelte +5 -0
- package/components/apps/editor/AppPreview.svelte +18 -7
- package/components/apps/editor/ComponentHeader.svelte +1 -0
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +21 -11
- package/components/apps/editor/GridViewer.svelte +2 -2
- package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
- package/components/apps/editor/SettingsPanel.svelte +3 -3
- package/components/apps/editor/SubGridEditor.svelte +13 -12
- package/components/apps/editor/appUtils.d.ts +1 -0
- package/components/apps/editor/appUtils.js +19 -0
- package/components/apps/editor/component/Component.svelte +6 -7
- package/components/apps/editor/component/Component.svelte.d.ts +1 -1
- package/components/apps/editor/component/ComponentNavigation.svelte +57 -47
- package/components/apps/editor/component/README.md +4 -0
- package/components/apps/editor/component/components.d.ts +9 -26
- package/components/apps/editor/component/components.js +10 -26
- package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
- package/components/apps/editor/componentsPanel/CssProperty.svelte +62 -48
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +3 -2
- package/components/apps/editor/componentsPanel/CssSettings.svelte +1 -0
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +170 -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/contextPanel/ComponentOutput.svelte +2 -26
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +0 -1
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +8 -6
- package/components/apps/editor/contextPanel/ContextPanel.svelte +4 -11
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +2 -25
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +29 -40
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +1 -2
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +3 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +38 -12
- package/components/apps/editor/settingsPanel/StylePanel.svelte +61 -0
- package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
- 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 +2 -2
- 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/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
- package/components/apps/inputType.d.ts +2 -2
- package/components/apps/svelte-grid/Grid.svelte +50 -34
- package/components/apps/svelte-grid/Grid.svelte.d.ts +14 -9
- package/components/apps/svelte-grid/MoveResize.svelte +76 -55
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +15 -9
- package/components/apps/svelte-grid/utils/helper.d.ts +0 -1
- package/components/apps/svelte-grid/utils/helper.js +0 -3
- package/components/apps/types.d.ts +9 -5
- package/components/apps/utils.d.ts +2 -0
- package/components/apps/utils.js +30 -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/infer.js +3 -1
- package/package.json +11 -2
- package/utils.d.ts +1 -0
- package/utils.js +3 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +0 -25
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +0 -16
|
@@ -211,7 +211,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
211
211
|
<input
|
|
212
212
|
{autofocus}
|
|
213
213
|
on:focus={(e) => {
|
|
214
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
215
214
|
dispatch('focus')
|
|
216
215
|
}}
|
|
217
216
|
{disabled}
|
|
@@ -230,7 +229,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
230
229
|
<Toggle
|
|
231
230
|
on:pointerdown={(e) => {
|
|
232
231
|
e?.stopPropagation()
|
|
233
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
234
232
|
}}
|
|
235
233
|
{disabled}
|
|
236
234
|
class={valid
|
|
@@ -310,7 +308,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
310
308
|
<textarea
|
|
311
309
|
bind:this={el}
|
|
312
310
|
on:focus={(e) => {
|
|
313
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
314
311
|
dispatch('focus')
|
|
315
312
|
}}
|
|
316
313
|
{autofocus}
|
|
@@ -331,7 +328,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
331
328
|
{:else if inputCat == 'enum'}
|
|
332
329
|
<select
|
|
333
330
|
on:focus={(e) => {
|
|
334
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
335
331
|
dispatch('focus')
|
|
336
332
|
}}
|
|
337
333
|
{disabled}
|
|
@@ -348,7 +344,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
348
344
|
<div class="border my-1 mb-4 w-full border-gray-400">
|
|
349
345
|
<SimpleEditor
|
|
350
346
|
on:focus={(e) => {
|
|
351
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
352
347
|
dispatch('focus')
|
|
353
348
|
}}
|
|
354
349
|
on:blur={() => dispatch('blur')}
|
|
@@ -387,7 +382,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
387
382
|
rows="1"
|
|
388
383
|
bind:this={el}
|
|
389
384
|
on:focus={(e) => {
|
|
390
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
391
385
|
dispatch('focus')
|
|
392
386
|
}}
|
|
393
387
|
on:blur={() => dispatch('blur')}
|
|
@@ -175,6 +175,11 @@ $: selectedId && select(selectedId);
|
|
|
175
175
|
$: initialPath && $workspaceStore && loadSchedule();
|
|
176
176
|
loadHubScripts();
|
|
177
177
|
function onKeyDown(event) {
|
|
178
|
+
let classes = event.target?.['className'];
|
|
179
|
+
if ((typeof classes === 'string' && classes.includes('inputarea')) ||
|
|
180
|
+
['INPUT', 'TEXTAREA'].includes(document.activeElement?.tagName)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
178
183
|
switch (event.key) {
|
|
179
184
|
case 'Z':
|
|
180
185
|
if (event.ctrlKey) {
|
|
@@ -145,7 +145,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
145
145
|
{:else}
|
|
146
146
|
<input
|
|
147
147
|
on:focus={(e) => {
|
|
148
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
149
148
|
dispatch('focus')
|
|
150
149
|
}}
|
|
151
150
|
type="number"
|
|
@@ -163,7 +162,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
163
162
|
<Toggle
|
|
164
163
|
on:pointerdown={(e) => {
|
|
165
164
|
e?.stopPropagation()
|
|
166
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
167
165
|
}}
|
|
168
166
|
class={valid
|
|
169
167
|
? ''
|
|
@@ -240,7 +238,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
240
238
|
<textarea
|
|
241
239
|
bind:this={el}
|
|
242
240
|
on:focus={(e) => {
|
|
243
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
244
241
|
dispatch('focus')
|
|
245
242
|
}}
|
|
246
243
|
use:autosize
|
|
@@ -258,7 +255,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
258
255
|
{:else if inputCat == 'enum'}
|
|
259
256
|
<select
|
|
260
257
|
on:focus={(e) => {
|
|
261
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
262
258
|
dispatch('focus')
|
|
263
259
|
}}
|
|
264
260
|
class="px-6"
|
|
@@ -291,7 +287,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
291
287
|
rows="1"
|
|
292
288
|
bind:this={el}
|
|
293
289
|
on:focus={(e) => {
|
|
294
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
295
290
|
dispatch('focus')
|
|
296
291
|
}}
|
|
297
292
|
on:blur={() => dispatch('blur')}
|
|
@@ -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>;
|
package/components/Toggle.svelte
CHANGED
|
@@ -32,7 +32,7 @@ const dispatch = createEventDispatcher();
|
|
|
32
32
|
</span>
|
|
33
33
|
{/if}
|
|
34
34
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
35
|
-
<div class="relative" on:
|
|
35
|
+
<div class="relative" on:click|stopPropagation>
|
|
36
36
|
<input
|
|
37
37
|
on:focus
|
|
38
38
|
on:click
|
|
@@ -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 != '')
|
|
@@ -70,11 +55,10 @@ let runnableWrapper;
|
|
|
70
55
|
async function handleClick(event) {
|
|
71
56
|
event?.stopPropagation();
|
|
72
57
|
event?.preventDefault();
|
|
73
|
-
$selectedComponent = id;
|
|
58
|
+
$selectedComponent = [id];
|
|
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}
|
|
@@ -89,7 +82,6 @@ $: css = concatCustomCss($app.css?.formcomponent, customCss);
|
|
|
89
82
|
style={css?.button?.style ?? ''}
|
|
90
83
|
on:pointerdown={(e) => {
|
|
91
84
|
e?.stopPropagation()
|
|
92
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
93
85
|
}}
|
|
94
86
|
on:click={() => {
|
|
95
87
|
runnableComponent?.runComponent()
|
|
@@ -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,63 @@ 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
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
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
|
+
}}
|
|
91
|
+
on:click={async () => {
|
|
92
|
+
if (!runnableComponent) {
|
|
93
|
+
runnableWrapper.onSuccess()
|
|
94
|
+
} else {
|
|
95
|
+
await runnableComponent?.runComponent()
|
|
96
|
+
}
|
|
97
|
+
getModal().close()
|
|
98
|
+
}}
|
|
99
|
+
size="xs"
|
|
100
|
+
color="dark"
|
|
101
|
+
>
|
|
102
|
+
Submit
|
|
103
|
+
</Button>
|
|
128
104
|
</div>
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
</
|
|
105
|
+
</div>
|
|
106
|
+
</RunnableWrapper>
|
|
107
|
+
</AlwaysMountedModal>
|
|
132
108
|
|
|
133
109
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
134
110
|
{#if errorsMessage}
|
|
@@ -141,7 +117,7 @@ let runnableWrapper;
|
|
|
141
117
|
btnClasses={css?.button?.class ?? ''}
|
|
142
118
|
style={css?.button?.style ?? ''}
|
|
143
119
|
on:click={(e) => {
|
|
144
|
-
open
|
|
120
|
+
getModal().open()
|
|
145
121
|
}}
|
|
146
122
|
>
|
|
147
123
|
{resolvedConfig.label}
|
|
@@ -19,22 +19,28 @@ const outputs = initOutput($worldStore, id, {
|
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
22
|
-
<div
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
<div class="flex flex-col w-full h-full">
|
|
23
|
+
<div
|
|
24
|
+
class={twMerge(
|
|
25
|
+
'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
|
|
26
|
+
$app.css?.['displaycomponent']?.['header']?.class,
|
|
27
|
+
customCss?.header?.class
|
|
28
|
+
)}
|
|
29
|
+
>
|
|
30
|
+
Results
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
style={twMerge(
|
|
34
|
+
$app.css?.['displaycomponent']?.['container']?.style,
|
|
35
|
+
customCss?.container?.style
|
|
36
|
+
)}
|
|
37
|
+
class={twMerge(
|
|
38
|
+
'p-2 grow',
|
|
39
|
+
$app.css?.['displaycomponent']?.['container']?.class,
|
|
40
|
+
customCss?.container?.class
|
|
41
|
+
)}
|
|
42
|
+
>
|
|
43
|
+
<DisplayResult {result} {requireHtmlApproval} />
|
|
44
|
+
</div>
|
|
39
45
|
</div>
|
|
40
46
|
</RunnableWrapper>
|
|
@@ -7,7 +7,7 @@ export let componentInput;
|
|
|
7
7
|
export let initializing = undefined;
|
|
8
8
|
export let customCss = undefined;
|
|
9
9
|
export let render;
|
|
10
|
-
const { app, worldStore } = getContext('AppViewerContext');
|
|
10
|
+
const { app, worldStore, selectedComponent } = getContext('AppViewerContext');
|
|
11
11
|
const outputs = initOutput($worldStore, id, {
|
|
12
12
|
result: undefined,
|
|
13
13
|
loading: false
|
|
@@ -26,6 +26,10 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
|
|
|
26
26
|
bind:clientHeight={h}
|
|
27
27
|
bind:clientWidth={w}
|
|
28
28
|
>
|
|
29
|
+
<button
|
|
30
|
+
class="absolute bottom-0 left-0 text-xs border px-2 py-0.5 bg-white/80"
|
|
31
|
+
on:click={() => ($selectedComponent = [id])}>Select</button
|
|
32
|
+
>
|
|
29
33
|
<RunnableWrapper
|
|
30
34
|
{outputs}
|
|
31
35
|
{render}
|
|
@@ -46,5 +50,7 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
|
|
|
46
50
|
: 'No html'}
|
|
47
51
|
/>
|
|
48
52
|
{/key}
|
|
53
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
54
|
+
<div on:click|stopPropagation class="absolute top-0 h-full w-full" />
|
|
49
55
|
</RunnableWrapper>
|
|
50
56
|
</div>
|
|
@@ -289,7 +289,7 @@ $: css = concatCustomCss($app.css?.pdfcomponent, customCss);
|
|
|
289
289
|
style="padding-top: {controlsHeight ?? 0}px; {css?.container?.style ?? ''}"
|
|
290
290
|
/>
|
|
291
291
|
{/if}
|
|
292
|
-
{#if $mode !== 'preview' && $selectedComponent
|
|
292
|
+
{#if $mode !== 'preview' && $selectedComponent?.includes(id)}
|
|
293
293
|
<button
|
|
294
294
|
class="fixed z-10 bottom-0 left-0 px-2 py-0.5 bg-indigo-500/90
|
|
295
295
|
hover:bg-indigo-500 focus:bg-indigo-500 duration-200 text-white text-2xs"
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script>import { getContext, onMount } from 'svelte';
|
|
2
|
-
import { initOutput } from '../../editor/appUtils';
|
|
2
|
+
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
3
|
+
import { components } from '../../editor/component';
|
|
4
|
+
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
3
5
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
4
6
|
export let id;
|
|
5
7
|
export let componentInput;
|
|
6
|
-
|
|
8
|
+
export let configuration;
|
|
7
9
|
export let initializing = undefined;
|
|
8
10
|
export let render;
|
|
9
11
|
const { worldStore } = getContext('AppViewerContext');
|
|
12
|
+
let resolvedConfig = initConfig(components['plotlycomponent'].initialData.configuration, configuration);
|
|
10
13
|
const outputs = initOutput($worldStore, id, {
|
|
11
14
|
result: undefined,
|
|
12
15
|
loading: false
|
|
@@ -27,9 +30,23 @@ $: Plotly &&
|
|
|
27
30
|
divEl &&
|
|
28
31
|
h &&
|
|
29
32
|
w &&
|
|
30
|
-
Plotly.newPlot(divEl,
|
|
33
|
+
Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], {
|
|
34
|
+
width: w,
|
|
35
|
+
height: h,
|
|
36
|
+
margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 },
|
|
37
|
+
...resolvedConfig.layout
|
|
38
|
+
}, { responsive: true, displayModeBar: false });
|
|
31
39
|
</script>
|
|
32
40
|
|
|
41
|
+
{#each Object.keys(components['plotlycomponent'].initialData.configuration) as key (key)}
|
|
42
|
+
<ResolveConfig
|
|
43
|
+
{id}
|
|
44
|
+
{key}
|
|
45
|
+
bind:resolvedConfig={resolvedConfig[key]}
|
|
46
|
+
configuration={configuration[key]}
|
|
47
|
+
/>
|
|
48
|
+
{/each}
|
|
49
|
+
|
|
33
50
|
<div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
|
|
34
51
|
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
35
52
|
<div on:pointerdown bind:this={divEl} />
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
+
import type { RichConfigurations } from '../../types';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
id: string;
|
|
6
7
|
componentInput: AppInput | undefined;
|
|
8
|
+
configuration: RichConfigurations;
|
|
7
9
|
initializing?: boolean | undefined;
|
|
8
10
|
render: boolean;
|
|
9
11
|
};
|