windmill-components 1.82.4 → 1.82.6
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/common.d.ts +2 -2
- package/components/ArgInput.svelte +72 -52
- package/components/ArgInput.svelte.d.ts +3 -1
- package/components/DisplayResult.svelte +17 -17
- package/components/Editor.svelte +3 -0
- package/components/Editor.svelte.d.ts +1 -0
- package/components/FieldHeader.svelte +1 -0
- package/components/FieldHeader.svelte.d.ts +4 -0
- package/components/FlowBuilder.svelte +0 -6
- package/components/FlowStatusViewer.svelte +4 -7
- package/components/FlowStatusViewer.svelte.d.ts +0 -1
- package/components/FlowViewer.svelte +1 -0
- package/components/InputTransformForm.svelte +1 -0
- package/components/LightweightArgInput.svelte +14 -1
- package/components/LightweightArgInput.svelte.d.ts +3 -1
- package/components/Multiselect.svelte.d.ts +2 -2
- package/components/SimpleEditor.svelte +1 -0
- package/components/SimpleEditor.svelte.d.ts +1 -0
- package/components/TemplateEditor.svelte +1 -0
- package/components/Toggle.svelte +1 -1
- package/components/Toggle.svelte.d.ts +1 -0
- package/components/apps/components/buttons/AppButton.svelte +17 -3
- package/components/apps/components/buttons/AppForm.svelte +10 -2
- package/components/apps/components/buttons/AppFormButton.svelte +82 -58
- package/components/apps/components/display/AppDisplayComponent.svelte +17 -23
- package/components/apps/components/display/AppHtml.svelte +1 -7
- package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
- 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 +3 -20
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
- package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +49 -75
- package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
- package/components/apps/components/display/table/AppTableFooter.svelte +1 -2
- package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +0 -1
- package/components/apps/components/display/table/tableOptions.js +1 -1
- package/components/apps/components/helpers/DebouncedInput.svelte +0 -1
- package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +0 -2
- package/components/apps/components/helpers/HiddenComponent.svelte +2 -3
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -2
- package/components/apps/components/helpers/InputValue.svelte +3 -3
- package/components/apps/components/helpers/RefreshButton.svelte +10 -3
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +0 -1
- package/components/apps/components/helpers/RunnableComponent.svelte +15 -19
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -2
- package/components/apps/components/helpers/RunnableWrapper.svelte +1 -3
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +0 -1
- package/components/apps/components/helpers/eval.d.ts +2 -4
- package/components/apps/components/helpers/eval.js +4 -6
- package/components/apps/components/inputs/AppCheckbox.svelte +4 -0
- package/components/apps/components/inputs/AppDateInput.svelte +2 -2
- package/components/apps/components/inputs/AppMultiSelect.svelte +5 -13
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -0
- package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
- package/components/apps/components/inputs/AppSelect.svelte +4 -11
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -0
- package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/inputs/AppTextInput.svelte +43 -53
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -1
- 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 +2 -1
- package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +21 -49
- package/components/apps/editor/AppEditorHeader.svelte +0 -5
- package/components/apps/editor/AppPreview.svelte +7 -18
- package/components/apps/editor/ComponentHeader.svelte +0 -1
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +12 -22
- package/components/apps/editor/GridViewer.svelte +2 -2
- package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +7 -5
- package/components/apps/editor/SettingsPanel.svelte +4 -4
- package/components/apps/editor/SubGridEditor.svelte +12 -13
- package/components/apps/editor/appUtils.d.ts +0 -1
- package/components/apps/editor/appUtils.js +0 -19
- package/components/apps/editor/component/Component.svelte +8 -19
- package/components/apps/editor/component/Component.svelte.d.ts +1 -1
- package/components/apps/editor/component/ComponentNavigation.svelte +47 -57
- package/components/apps/editor/component/README.md +0 -4
- package/components/apps/editor/component/components.d.ts +28 -45
- package/components/apps/editor/component/components.js +27 -41
- package/components/apps/editor/component/sets.js +1 -2
- package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
- package/components/apps/editor/componentsPanel/CssProperty.svelte +48 -62
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -3
- package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -1
- package/components/apps/editor/componentsPanel/store.js +4 -4
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +26 -2
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +1 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +6 -8
- package/components/apps/editor/contextPanel/ContextPanel.svelte +14 -7
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +25 -2
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +40 -29
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +2 -1
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +7 -2
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +11 -10
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +3 -4
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +0 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +0 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +19 -22
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +13 -42
- package/components/apps/editor/settingsPanel/GridTab.svelte +2 -1
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +1 -2
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +0 -4
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +0 -1
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +2 -1
- 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 +2 -3
- package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +1 -5
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +2 -3
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +1 -4
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +3 -3
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
- package/components/apps/inputType.d.ts +2 -2
- package/components/apps/rx.d.ts +2 -2
- package/components/apps/svelte-grid/Grid.svelte +34 -50
- package/components/apps/svelte-grid/Grid.svelte.d.ts +9 -14
- package/components/apps/svelte-grid/MoveResize.svelte +55 -76
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +9 -15
- package/components/apps/svelte-grid/utils/helper.d.ts +1 -0
- package/components/apps/svelte-grid/utils/helper.js +3 -0
- package/components/apps/types.d.ts +5 -9
- package/components/apps/utils.d.ts +0 -2
- package/components/apps/utils.js +1 -33
- package/components/common/button/ButtonPopup.svelte +2 -5
- package/components/common/button/ButtonPopup.svelte.d.ts +1 -5
- package/components/common/button/ButtonPopupItem.svelte +1 -2
- package/components/common/button/ButtonPopupItem.svelte.d.ts +0 -1
- package/components/common/index.d.ts +0 -1
- package/components/common/index.js +0 -1
- package/components/common/kbd/Kbd.svelte +1 -4
- package/components/common/kbd/Kbd.svelte.d.ts +14 -6
- package/components/common/menu/Menu.svelte +2 -8
- package/components/common/menu/Menu.svelte.d.ts +1 -4
- package/components/flows/map/MapItem.svelte +3 -3
- package/components/propertyPicker/ObjectViewer.svelte +3 -0
- package/components/scriptEditor/LogPanel.svelte +3 -3
- package/infer.js +1 -6
- package/package.json +2 -11
- package/utils.d.ts +0 -1
- package/utils.js +0 -3
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +0 -170
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +0 -18
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +0 -130
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +0 -21
- package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +0 -535
- package/components/apps/editor/componentsPanel/quickStyleProperties.js +0 -598
- package/components/apps/editor/settingsPanel/StylePanel.svelte +0 -61
- package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +0 -17
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +0 -47
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +0 -14
- package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +0 -2
- package/components/apps/editor/settingsPanel/secondaryMenu/index.js +0 -2
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +0 -12
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +0 -10
- package/components/common/clearableInput/ClearableInput.svelte +0 -56
- package/components/common/clearableInput/ClearableInput.svelte.d.ts +0 -28
- package/components/common/modal/AlwaysMountedModal.svelte +0 -109
- package/components/common/modal/AlwaysMountedModal.svelte.d.ts +0 -22
|
@@ -32,6 +32,8 @@ if (controls) {
|
|
|
32
32
|
$componentControl[id] = controls;
|
|
33
33
|
}
|
|
34
34
|
let runnableComponent;
|
|
35
|
+
let isLoading = false;
|
|
36
|
+
let ownClick = false;
|
|
35
37
|
let beforeIconComponent;
|
|
36
38
|
let afterIconComponent;
|
|
37
39
|
$: resolvedConfig.beforeIcon && handleBeforeIcon();
|
|
@@ -47,6 +49,19 @@ async function handleAfterIcon() {
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
$: 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;
|
|
50
65
|
let errors = {};
|
|
51
66
|
$: errorsMessage = Object.values(errors)
|
|
52
67
|
.filter((x) => x != '')
|
|
@@ -55,10 +70,11 @@ let runnableWrapper;
|
|
|
55
70
|
async function handleClick(event) {
|
|
56
71
|
event?.stopPropagation();
|
|
57
72
|
event?.preventDefault();
|
|
58
|
-
$selectedComponent =
|
|
73
|
+
$selectedComponent = id;
|
|
59
74
|
if (preclickAction) {
|
|
60
75
|
await preclickAction();
|
|
61
76
|
}
|
|
77
|
+
ownClick = true;
|
|
62
78
|
if (!runnableComponent) {
|
|
63
79
|
runnableWrapper.onSuccess();
|
|
64
80
|
}
|
|
@@ -66,7 +82,6 @@ async function handleClick(event) {
|
|
|
66
82
|
await runnableComponent?.runComponent();
|
|
67
83
|
}
|
|
68
84
|
}
|
|
69
|
-
let loading = false;
|
|
70
85
|
</script>
|
|
71
86
|
|
|
72
87
|
{#each Object.keys(components['buttoncomponent'].initialData.configuration) as key (key)}
|
|
@@ -85,7 +100,6 @@ let loading = false;
|
|
|
85
100
|
bind:this={runnableWrapper}
|
|
86
101
|
{recomputeIds}
|
|
87
102
|
bind:runnableComponent
|
|
88
|
-
bind:loading
|
|
89
103
|
{componentInput}
|
|
90
104
|
doOnSuccess={resolvedConfig.onSuccess}
|
|
91
105
|
{id}
|
|
@@ -28,8 +28,16 @@ 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
|
+
});
|
|
31
40
|
$: css = concatCustomCss($app.css?.formcomponent, customCss);
|
|
32
|
-
let loading = false;
|
|
33
41
|
</script>
|
|
34
42
|
|
|
35
43
|
{#each Object.keys(components['formcomponent'].initialData.configuration) as key (key)}
|
|
@@ -45,7 +53,6 @@ let loading = false;
|
|
|
45
53
|
{recomputeIds}
|
|
46
54
|
{render}
|
|
47
55
|
bind:runnableComponent
|
|
48
|
-
bind:loading
|
|
49
56
|
{componentInput}
|
|
50
57
|
{id}
|
|
51
58
|
doOnSuccess={resolvedConfig.onSuccess}
|
|
@@ -82,6 +89,7 @@ let loading = false;
|
|
|
82
89
|
style={css?.button?.style ?? ''}
|
|
83
90
|
on:pointerdown={(e) => {
|
|
84
91
|
e?.stopPropagation()
|
|
92
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
85
93
|
}}
|
|
86
94
|
on:click={() => {
|
|
87
95
|
runnableComponent?.runComponent()
|
|
@@ -3,12 +3,14 @@ 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';
|
|
6
7
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
8
|
+
import Portal from 'svelte-portal';
|
|
9
|
+
import Modal from '../../../common/modal/Modal.svelte';
|
|
7
10
|
import { concatCustomCss } from '../../utils';
|
|
8
11
|
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
9
12
|
import { components } from '../../editor/component';
|
|
10
13
|
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
11
|
-
import AlwaysMountedModal, { getModal } from '../../../common/modal/AlwaysMountedModal.svelte';
|
|
12
14
|
export let id;
|
|
13
15
|
export let componentInput;
|
|
14
16
|
export let configuration;
|
|
@@ -25,7 +27,10 @@ let outputs = initOutput($worldStore, id, {
|
|
|
25
27
|
});
|
|
26
28
|
let resolvedConfig = initConfig(components['formbuttoncomponent'].initialData.configuration, configuration);
|
|
27
29
|
let runnableComponent;
|
|
30
|
+
let isLoading = false;
|
|
31
|
+
let ownClick = false;
|
|
28
32
|
let errors = {};
|
|
33
|
+
let open = false;
|
|
29
34
|
$: errorsMessage = Object.values(errors)
|
|
30
35
|
.filter((x) => x != '')
|
|
31
36
|
.join('\n');
|
|
@@ -34,9 +39,18 @@ $: noInputs =
|
|
|
34
39
|
$: if (outputs?.loading != undefined) {
|
|
35
40
|
outputs.loading.set(false, true);
|
|
36
41
|
}
|
|
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;
|
|
37
52
|
$: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
|
|
38
53
|
let runnableWrapper;
|
|
39
|
-
let loading = false;
|
|
40
54
|
</script>
|
|
41
55
|
|
|
42
56
|
{#each Object.keys(components['formbuttoncomponent'].initialData.configuration) as key (key)}
|
|
@@ -48,63 +62,73 @@ let loading = false;
|
|
|
48
62
|
/>
|
|
49
63
|
{/each}
|
|
50
64
|
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{extraQueryParams}
|
|
64
|
-
autoRefresh={false}
|
|
65
|
-
forceSchemaDisplay={true}
|
|
66
|
-
runnableClass="!block"
|
|
67
|
-
{outputs}
|
|
68
|
-
doOnSuccess={resolvedConfig.onSuccess}
|
|
65
|
+
<Portal>
|
|
66
|
+
<Modal
|
|
67
|
+
{open}
|
|
68
|
+
title={resolvedConfig.label ?? ''}
|
|
69
|
+
class={css?.popup?.class}
|
|
70
|
+
style={css?.popup?.style}
|
|
71
|
+
on:canceled={() => {
|
|
72
|
+
open = false
|
|
73
|
+
}}
|
|
74
|
+
on:confirmed={() => {
|
|
75
|
+
open = false
|
|
76
|
+
}}
|
|
69
77
|
>
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<div class="flex
|
|
85
|
-
<
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
78
|
+
<RunnableWrapper
|
|
79
|
+
bind:this={runnableWrapper}
|
|
80
|
+
{recomputeIds}
|
|
81
|
+
{render}
|
|
82
|
+
bind:runnableComponent
|
|
83
|
+
{componentInput}
|
|
84
|
+
{id}
|
|
85
|
+
{extraQueryParams}
|
|
86
|
+
autoRefresh={false}
|
|
87
|
+
forceSchemaDisplay={true}
|
|
88
|
+
runnableClass="!block"
|
|
89
|
+
{outputs}
|
|
90
|
+
doOnSuccess={resolvedConfig.onSuccess}
|
|
91
|
+
>
|
|
92
|
+
<div class="flex flex-col gap-2 px-4 w-full">
|
|
93
|
+
<div>
|
|
94
|
+
{#if noInputs}
|
|
95
|
+
<div class="text-gray-600 italic text-sm my-4">
|
|
96
|
+
Run forms are associated with a runnable that has user inputs.
|
|
97
|
+
<br />
|
|
98
|
+
Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
|
|
99
|
+
<strong>
|
|
100
|
+
User Input
|
|
101
|
+
<Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
|
|
102
|
+
</strong>
|
|
103
|
+
</div>
|
|
104
|
+
{/if}
|
|
105
|
+
</div>
|
|
106
|
+
<div class="flex justify-end">
|
|
107
|
+
<Button
|
|
108
|
+
{loading}
|
|
109
|
+
btnClasses="my-1"
|
|
110
|
+
on:pointerdown={(e) => {
|
|
111
|
+
e?.stopPropagation()
|
|
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>
|
|
104
128
|
</div>
|
|
105
|
-
</
|
|
106
|
-
</
|
|
107
|
-
</
|
|
129
|
+
</RunnableWrapper>
|
|
130
|
+
</Modal>
|
|
131
|
+
</Portal>
|
|
108
132
|
|
|
109
133
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
110
134
|
{#if errorsMessage}
|
|
@@ -117,7 +141,7 @@ let loading = false;
|
|
|
117
141
|
btnClasses={css?.button?.class ?? ''}
|
|
118
142
|
style={css?.button?.style ?? ''}
|
|
119
143
|
on:click={(e) => {
|
|
120
|
-
|
|
144
|
+
open = true
|
|
121
145
|
}}
|
|
122
146
|
>
|
|
123
147
|
{resolvedConfig.label}
|
|
@@ -19,28 +19,22 @@ 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
|
-
|
|
39
|
-
$app.css?.['displaycomponent']?.['container']?.class,
|
|
40
|
-
customCss?.container?.class
|
|
41
|
-
)}
|
|
42
|
-
>
|
|
43
|
-
<DisplayResult {result} {requireHtmlApproval} />
|
|
44
|
-
</div>
|
|
22
|
+
<div
|
|
23
|
+
class={twMerge(
|
|
24
|
+
'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
|
|
25
|
+
$app.css?.['displaycomponent']?.['header']?.class,
|
|
26
|
+
customCss?.header?.class
|
|
27
|
+
)}
|
|
28
|
+
>
|
|
29
|
+
Results
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
class={twMerge(
|
|
33
|
+
'p-2',
|
|
34
|
+
$app.css?.['displaycomponent']?.['container']?.class,
|
|
35
|
+
customCss?.container?.class
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
<DisplayResult {result} {requireHtmlApproval} />
|
|
45
39
|
</div>
|
|
46
40
|
</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
|
|
10
|
+
const { app, worldStore } = getContext('AppViewerContext');
|
|
11
11
|
const outputs = initOutput($worldStore, id, {
|
|
12
12
|
result: undefined,
|
|
13
13
|
loading: false
|
|
@@ -26,10 +26,6 @@ $: 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
|
-
>
|
|
33
29
|
<RunnableWrapper
|
|
34
30
|
{outputs}
|
|
35
31
|
{render}
|
|
@@ -50,7 +46,5 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
|
|
|
50
46
|
: 'No html'}
|
|
51
47
|
/>
|
|
52
48
|
{/key}
|
|
53
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
54
|
-
<div on:click|stopPropagation class="absolute top-0 h-full w-full" />
|
|
55
49
|
</RunnableWrapper>
|
|
56
50
|
</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 === 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,15 +1,12 @@
|
|
|
1
1
|
<script>import { getContext, onMount } from 'svelte';
|
|
2
|
-
import {
|
|
3
|
-
import { components } from '../../editor/component';
|
|
4
|
-
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
2
|
+
import { initOutput } from '../../editor/appUtils';
|
|
5
3
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
6
4
|
export let id;
|
|
7
5
|
export let componentInput;
|
|
8
|
-
export let configuration
|
|
6
|
+
// export let configuration: Record<string, AppInput>
|
|
9
7
|
export let initializing = undefined;
|
|
10
8
|
export let render;
|
|
11
9
|
const { worldStore } = getContext('AppViewerContext');
|
|
12
|
-
let resolvedConfig = initConfig(components['plotlycomponent'].initialData.configuration, configuration);
|
|
13
10
|
const outputs = initOutput($worldStore, id, {
|
|
14
11
|
result: undefined,
|
|
15
12
|
loading: false
|
|
@@ -30,23 +27,9 @@ $: Plotly &&
|
|
|
30
27
|
divEl &&
|
|
31
28
|
h &&
|
|
32
29
|
w &&
|
|
33
|
-
Plotly.newPlot(divEl,
|
|
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 });
|
|
30
|
+
Plotly.newPlot(divEl, [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
|
|
39
31
|
</script>
|
|
40
32
|
|
|
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
|
-
|
|
50
33
|
<div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
|
|
51
34
|
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
52
35
|
<div on:pointerdown bind:this={divEl} />
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { RichConfigurations } from '../../types';
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
5
|
id: string;
|
|
7
6
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration: RichConfigurations;
|
|
9
7
|
initializing?: boolean | undefined;
|
|
10
8
|
render: boolean;
|
|
11
9
|
};
|