windmill-components 1.79.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/ArgInput.svelte +3 -0
- package/components/ArgInput.svelte.d.ts +1 -0
- package/components/DisplayResult.svelte +18 -15
- package/components/Multiselect.svelte.d.ts +2 -2
- package/components/SchemaEditor.svelte +15 -10
- package/components/SettingSection.svelte +1 -1
- package/components/Toggle.svelte +5 -2
- package/components/Toggle.svelte.d.ts +1 -0
- package/components/apps/components/buttons/AppButton.svelte +35 -56
- package/components/apps/components/buttons/AppButton.svelte.d.ts +2 -1
- package/components/apps/components/buttons/AppForm.svelte +24 -24
- package/components/apps/components/buttons/AppForm.svelte.d.ts +1 -1
- package/components/apps/components/buttons/AppFormButton.svelte +79 -94
- package/components/apps/components/buttons/AppFormButton.svelte.d.ts +1 -3
- package/components/apps/components/display/AppBarChart.svelte +2 -2
- package/components/apps/components/display/AppBarChart.svelte.d.ts +1 -1
- package/components/apps/components/display/AppDisplayComponent.svelte +2 -2
- package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +1 -1
- package/components/apps/components/display/AppHtml.svelte +10 -2
- package/components/apps/components/display/AppHtml.svelte.d.ts +1 -1
- package/components/apps/components/display/AppIcon.svelte +4 -1
- package/components/apps/components/display/AppIcon.svelte.d.ts +1 -1
- package/components/apps/components/display/AppImage.svelte +28 -15
- package/components/apps/components/display/AppImage.svelte.d.ts +1 -1
- package/components/apps/components/display/AppMap.svelte.d.ts +1 -1
- package/components/apps/components/display/AppPdf.svelte +3 -2
- package/components/apps/components/display/AppPdf.svelte.d.ts +1 -1
- package/components/apps/components/display/AppPieChart.svelte +2 -2
- package/components/apps/components/display/AppPieChart.svelte.d.ts +1 -1
- package/components/apps/components/display/AppScatterChart.svelte +2 -2
- package/components/apps/components/display/AppScatterChart.svelte.d.ts +1 -1
- package/components/apps/components/display/AppText.svelte +35 -22
- package/components/apps/components/display/AppText.svelte.d.ts +1 -1
- package/components/apps/components/display/AppTimeseries.svelte +2 -2
- package/components/apps/components/display/AppTimeseries.svelte.d.ts +1 -1
- package/components/apps/components/display/PlotlyHtml.svelte +3 -3
- package/components/apps/components/display/VegaLiteHtml.svelte +2 -2
- package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +40 -17
- package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
- package/components/apps/components/helpers/HiddenComponent.svelte +6 -3
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -1
- package/components/apps/components/helpers/InputValue.svelte +9 -9
- package/components/apps/components/helpers/Loader.svelte +18 -0
- package/components/apps/components/helpers/Loader.svelte.d.ts +18 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte +1 -12
- package/components/apps/components/helpers/ResolveConfig.svelte +29 -0
- package/components/apps/components/helpers/ResolveConfig.svelte.d.ts +21 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +117 -89
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +14 -3
- package/components/apps/components/helpers/RunnableWrapper.svelte +50 -9
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +27 -2
- package/components/apps/components/inputs/AppCheckbox.svelte +1 -1
- package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +1 -1
- package/components/apps/components/inputs/AppDateInput.svelte.d.ts +1 -1
- package/components/apps/components/inputs/AppFileInput.svelte.d.ts +1 -1
- package/components/apps/components/inputs/AppMultiSelect.svelte +0 -1
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +1 -1
- package/components/apps/components/inputs/AppNumberInput.svelte +1 -1
- package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +1 -3
- package/components/apps/components/inputs/AppRangeInput.svelte +7 -1
- package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +2 -1
- package/components/apps/components/inputs/AppSelect.svelte +8 -3
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +1 -1
- package/components/apps/components/inputs/AppSliderInputs.svelte +7 -1
- package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +2 -1
- package/components/apps/components/inputs/AppTextInput.svelte +4 -4
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -3
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +17 -19
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +1 -1
- package/components/apps/components/layout/AppContainer.svelte +7 -4
- package/components/apps/components/layout/AppContainer.svelte.d.ts +1 -1
- package/components/apps/components/layout/AppDivider.svelte +4 -1
- package/components/apps/components/layout/AppDivider.svelte.d.ts +1 -1
- package/components/apps/components/layout/AppDrawer.svelte +7 -4
- package/components/apps/components/layout/AppDrawer.svelte.d.ts +1 -1
- package/components/apps/components/layout/AppSplitpanes.svelte +34 -21
- package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +1 -3
- package/components/apps/components/layout/AppTabs.svelte +17 -34
- package/components/apps/components/layout/AppTabs.svelte.d.ts +1 -2
- package/components/apps/editor/AppEditor.svelte +17 -13
- package/components/apps/editor/AppEditorHeader.svelte +2 -3
- package/components/apps/editor/AppPreview.svelte +11 -17
- package/components/apps/editor/ComponentHeader.svelte +10 -8
- package/components/apps/editor/ComponentHeader.svelte.d.ts +0 -1
- package/components/apps/editor/GridEditor.svelte +21 -50
- package/components/apps/editor/GridEditor.svelte.d.ts +0 -2
- package/components/apps/editor/RecomputeAllComponents.svelte +13 -2
- package/components/apps/editor/SettingsPanel.svelte +103 -40
- package/components/apps/editor/SubGridEditor.svelte +32 -41
- package/components/apps/editor/SubGridEditor.svelte.d.ts +1 -2
- package/components/apps/editor/appUtils.d.ts +49 -7
- package/components/apps/editor/appUtils.js +133 -37
- package/components/apps/editor/component/Component.svelte +22 -11
- package/components/apps/editor/component/Component.svelte.d.ts +1 -2
- package/components/apps/editor/component/ComponentNavigation.svelte +19 -12
- package/components/apps/editor/component/README.md +4 -0
- package/components/apps/editor/component/components.d.ts +1550 -17
- package/components/apps/editor/component/components.js +295 -325
- package/components/apps/editor/component/default-codes.d.ts +1 -1
- package/components/apps/editor/component/default-codes.js +25 -25
- package/components/apps/editor/componentsPanel/ComponentList.svelte +18 -3
- package/components/apps/editor/componentsPanel/CssProperty.svelte +92 -50
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +8 -3
- package/components/apps/editor/componentsPanel/CssSettings.svelte +48 -90
- package/components/apps/editor/componentsPanel/ListItem.svelte +3 -0
- package/components/apps/editor/componentsPanel/ListItem.svelte.d.ts +2 -0
- 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/inlineScriptsPanel/EmptyInlineScript.svelte +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +146 -130
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +2 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +31 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +42 -76
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +67 -17
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte.d.ts +1 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +27 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte.d.ts +17 -0
- package/components/apps/editor/inlineScriptsPanel/utils.d.ts +2 -0
- package/components/apps/editor/inlineScriptsPanel/utils.js +6 -5
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +10 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +37 -31
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +4 -104
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +113 -67
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +5 -3
- package/components/apps/editor/settingsPanel/GridTab.svelte +0 -1
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +99 -80
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +8 -0
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +25 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +52 -0
- package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte.d.ts +28 -0
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +70 -26
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte.d.ts +2 -0
- 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/SubTypeEditor.svelte +7 -5
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +3 -2
- package/components/apps/editor/settingsPanel/TableActions.svelte +8 -63
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +3 -4
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +3 -1
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte.d.ts +2 -4
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +5 -5
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +2 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +48 -32
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +8 -2
- package/components/apps/editor/settingsPanel/inputEditor/TabSelectInput.svelte +46 -0
- package/components/apps/editor/settingsPanel/inputEditor/TabSelectInput.svelte.d.ts +20 -0
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +7 -0
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +1 -0
- 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/BackgroundScriptTriggerList.svelte +20 -70
- package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +14 -8
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +5 -1
- package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +85 -27
- package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +4 -6
- package/components/apps/gridUtils.js +1 -1
- package/components/apps/inputType.d.ts +12 -16
- package/components/apps/rx.d.ts +2 -0
- package/components/apps/rx.js +8 -2
- package/components/apps/svelte-grid/Grid.svelte +0 -4
- package/components/apps/svelte-grid/Grid.svelte.d.ts +1 -1
- package/components/apps/svelte-grid/MoveResize.svelte +24 -30
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +0 -4
- package/components/apps/svelte-grid/types.d.ts +1 -7
- package/components/apps/svelte-grid/utils/helper.js +6 -10
- package/components/apps/types.d.ts +22 -22
- package/components/apps/utils.d.ts +2 -2
- package/components/apps/utils.js +13 -11
- 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/components/common/skeleton/Skeleton.svelte +1 -1
- package/components/flows/flowStateUtils.js +8 -1
- package/package.json +672 -659
- package/utils.d.ts +1 -0
- package/utils.js +3 -0
- package/components/apps/editor/GridPanel.svelte +0 -31
- package/components/apps/editor/GridPanel.svelte.d.ts +0 -18
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +0 -12
- package/components/apps/editor/componentsPanel/componentStaticValues.js +0 -25
|
@@ -3,11 +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';
|
|
8
|
+
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
9
|
+
import { components } from '../../editor/component';
|
|
10
|
+
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
11
|
+
import AlwaysMountedModal, { getModal } from '../../../common/modal/AlwaysMountedModal.svelte';
|
|
11
12
|
export let id;
|
|
12
13
|
export let componentInput;
|
|
13
14
|
export let configuration;
|
|
@@ -17,125 +18,109 @@ export let horizontalAlignment = undefined;
|
|
|
17
18
|
export let verticalAlignment = undefined;
|
|
18
19
|
export let customCss = undefined;
|
|
19
20
|
export let render;
|
|
20
|
-
export const staticOutputs = ['loading', 'result'];
|
|
21
21
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
let outputs = initOutput($worldStore, id, {
|
|
23
|
+
result: undefined,
|
|
24
|
+
loading: false
|
|
25
|
+
});
|
|
26
|
+
let resolvedConfig = initConfig(components['formbuttoncomponent'].initialData.configuration, configuration);
|
|
25
27
|
let runnableComponent;
|
|
26
|
-
let disabled = undefined;
|
|
27
|
-
let isLoading = false;
|
|
28
|
-
let ownClick = false;
|
|
29
28
|
let errors = {};
|
|
30
|
-
let open = false;
|
|
31
29
|
$: errorsMessage = Object.values(errors)
|
|
32
30
|
.filter((x) => x != '')
|
|
33
31
|
.join('\n');
|
|
34
32
|
$: noInputs =
|
|
35
33
|
componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0;
|
|
36
|
-
$: outputs = $worldStore?.outputsById[id];
|
|
37
34
|
$: if (outputs?.loading != undefined) {
|
|
38
35
|
outputs.loading.set(false, true);
|
|
39
36
|
}
|
|
40
|
-
$: outputs?.loading.subscribe({
|
|
41
|
-
id: 'loading-' + id,
|
|
42
|
-
next: (value) => {
|
|
43
|
-
isLoading = value;
|
|
44
|
-
if (ownClick && !value) {
|
|
45
|
-
ownClick = false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
$: loading = isLoading && ownClick;
|
|
50
37
|
$: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
|
|
38
|
+
let runnableWrapper;
|
|
39
|
+
let loading = false;
|
|
51
40
|
</script>
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/>
|
|
42
|
+
{#each Object.keys(components['formbuttoncomponent'].initialData.configuration) as key (key)}
|
|
43
|
+
<ResolveConfig
|
|
44
|
+
{id}
|
|
45
|
+
{key}
|
|
46
|
+
bind:resolvedConfig={resolvedConfig[key]}
|
|
47
|
+
configuration={configuration[key]}
|
|
48
|
+
/>
|
|
49
|
+
{/each}
|
|
62
50
|
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
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}
|
|
75
69
|
>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<Button
|
|
103
|
-
{loading}
|
|
104
|
-
btnClasses="my-1"
|
|
105
|
-
on:pointerdown={(e) => {
|
|
106
|
-
e?.stopPropagation()
|
|
107
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
108
|
-
}}
|
|
109
|
-
on:click={async () => {
|
|
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 {
|
|
110
96
|
await runnableComponent?.runComponent()
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</div>
|
|
97
|
+
}
|
|
98
|
+
getModal().close()
|
|
99
|
+
}}
|
|
100
|
+
size="xs"
|
|
101
|
+
color="dark"
|
|
102
|
+
>
|
|
103
|
+
Submit
|
|
104
|
+
</Button>
|
|
120
105
|
</div>
|
|
121
|
-
</
|
|
122
|
-
</
|
|
123
|
-
</
|
|
106
|
+
</div>
|
|
107
|
+
</RunnableWrapper>
|
|
108
|
+
</AlwaysMountedModal>
|
|
124
109
|
|
|
125
110
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
126
111
|
{#if errorsMessage}
|
|
127
112
|
<div class="text-red-500 text-xs">{errorsMessage}</div>
|
|
128
113
|
{/if}
|
|
129
114
|
<Button
|
|
130
|
-
{disabled}
|
|
131
|
-
{size}
|
|
132
|
-
{color}
|
|
115
|
+
disabled={resolvedConfig.disabled ?? false}
|
|
116
|
+
size={resolvedConfig.size ?? 'md'}
|
|
117
|
+
color={resolvedConfig.color}
|
|
133
118
|
btnClasses={css?.button?.class ?? ''}
|
|
134
119
|
style={css?.button?.style ?? ''}
|
|
135
120
|
on:click={(e) => {
|
|
136
|
-
open
|
|
121
|
+
getModal().open()
|
|
137
122
|
}}
|
|
138
123
|
>
|
|
139
|
-
{
|
|
124
|
+
{resolvedConfig.label}
|
|
140
125
|
</Button>
|
|
141
126
|
</AlignWrapper>
|
|
@@ -10,9 +10,8 @@ declare const __propDef: {
|
|
|
10
10
|
extraQueryParams?: Record<string, any> | undefined;
|
|
11
11
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
12
12
|
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
13
|
-
customCss?: ComponentCustomCSS<'
|
|
13
|
+
customCss?: ComponentCustomCSS<'formbuttoncomponent'> | undefined;
|
|
14
14
|
render: boolean;
|
|
15
|
-
staticOutputs?: string[] | undefined;
|
|
16
15
|
};
|
|
17
16
|
events: {
|
|
18
17
|
[evt: string]: CustomEvent<any>;
|
|
@@ -23,6 +22,5 @@ export type AppFormButtonProps = typeof __propDef.props;
|
|
|
23
22
|
export type AppFormButtonEvents = typeof __propDef.events;
|
|
24
23
|
export type AppFormButtonSlots = typeof __propDef.slots;
|
|
25
24
|
export default class AppFormButton extends SvelteComponentTyped<AppFormButtonProps, AppFormButtonEvents, AppFormButtonSlots> {
|
|
26
|
-
get staticOutputs(): string[];
|
|
27
25
|
}
|
|
28
26
|
export {};
|
|
@@ -12,7 +12,7 @@ export let initializing = undefined;
|
|
|
12
12
|
export let customCss = undefined;
|
|
13
13
|
export let render;
|
|
14
14
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
15
|
-
initOutput($worldStore, id, {
|
|
15
|
+
let outputs = initOutput($worldStore, id, {
|
|
16
16
|
result: undefined,
|
|
17
17
|
loading: false
|
|
18
18
|
});
|
|
@@ -62,7 +62,7 @@ $: css = concatCustomCss($app.css?.barchartcomponent, customCss);
|
|
|
62
62
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
63
63
|
<InputValue {id} input={configuration.line} bind:value={lineChart} />
|
|
64
64
|
|
|
65
|
-
<RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
65
|
+
<RunnableWrapper {outputs} {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
66
66
|
<div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
|
|
67
67
|
{#if result}
|
|
68
68
|
{#if lineChart}
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
8
|
configuration: RichConfigurations;
|
|
9
9
|
initializing?: boolean | undefined;
|
|
10
|
-
customCss?: ComponentCustomCSS<'
|
|
10
|
+
customCss?: ComponentCustomCSS<'barchartcomponent'> | undefined;
|
|
11
11
|
render: boolean;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
@@ -12,13 +12,13 @@ export let render;
|
|
|
12
12
|
const requireHtmlApproval = getContext(IS_APP_PUBLIC_CONTEXT_KEY);
|
|
13
13
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
14
14
|
let result = undefined;
|
|
15
|
-
initOutput($worldStore, id, {
|
|
15
|
+
const outputs = initOutput($worldStore, id, {
|
|
16
16
|
result: undefined,
|
|
17
17
|
loading: false
|
|
18
18
|
});
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
|
|
21
|
+
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
22
22
|
<div
|
|
23
23
|
class={twMerge(
|
|
24
24
|
'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
8
|
initializing?: boolean | undefined;
|
|
9
|
-
customCss?: ComponentCustomCSS<'
|
|
9
|
+
customCss?: ComponentCustomCSS<'displaycomponent'> | undefined;
|
|
10
10
|
render: boolean;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
@@ -8,7 +8,7 @@ export let initializing = undefined;
|
|
|
8
8
|
export let customCss = undefined;
|
|
9
9
|
export let render;
|
|
10
10
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
11
|
-
initOutput($worldStore, id, {
|
|
11
|
+
const outputs = initOutput($worldStore, id, {
|
|
12
12
|
result: undefined,
|
|
13
13
|
loading: false
|
|
14
14
|
});
|
|
@@ -26,7 +26,15 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
|
|
|
26
26
|
bind:clientHeight={h}
|
|
27
27
|
bind:clientWidth={w}
|
|
28
28
|
>
|
|
29
|
-
<RunnableWrapper
|
|
29
|
+
<RunnableWrapper
|
|
30
|
+
{outputs}
|
|
31
|
+
{render}
|
|
32
|
+
autoRefresh
|
|
33
|
+
{componentInput}
|
|
34
|
+
{id}
|
|
35
|
+
bind:initializing
|
|
36
|
+
bind:result
|
|
37
|
+
>
|
|
30
38
|
{#key result}
|
|
31
39
|
<iframe
|
|
32
40
|
frameborder="0"
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
8
|
initializing?: boolean | undefined;
|
|
9
|
-
customCss?: ComponentCustomCSS<'
|
|
9
|
+
customCss?: ComponentCustomCSS<'htmlcomponent'> | undefined;
|
|
10
10
|
render: boolean;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { initOutput } from '../../editor/appUtils';
|
|
2
3
|
import { concatCustomCss } from '../../utils';
|
|
3
4
|
import { AlignWrapper, InputValue } from '../helpers';
|
|
4
5
|
import { loadIcon } from '../icon';
|
|
@@ -8,7 +9,9 @@ export let verticalAlignment = undefined;
|
|
|
8
9
|
export let configuration;
|
|
9
10
|
export let customCss = undefined;
|
|
10
11
|
export let render;
|
|
11
|
-
const { app } = getContext('AppViewerContext');
|
|
12
|
+
const { app, worldStore } = getContext('AppViewerContext');
|
|
13
|
+
//used so that we can count number of outputs setup for first refresh
|
|
14
|
+
initOutput($worldStore, id, {});
|
|
12
15
|
let icon = undefined;
|
|
13
16
|
let size;
|
|
14
17
|
let color;
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
7
7
|
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
8
8
|
configuration: RichConfigurations;
|
|
9
|
-
customCss?: ComponentCustomCSS<'
|
|
9
|
+
customCss?: ComponentCustomCSS<'iconcomponent'> | undefined;
|
|
10
10
|
render: boolean;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
@@ -1,33 +1,46 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
4
|
+
import { components, selectOptions } from '../../editor/component';
|
|
3
5
|
import { concatCustomCss } from '../../utils';
|
|
4
|
-
import
|
|
6
|
+
import Loader from '../helpers/Loader.svelte';
|
|
7
|
+
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
5
8
|
export let id;
|
|
6
9
|
export let configuration;
|
|
7
10
|
export let customCss = undefined;
|
|
8
11
|
export let render;
|
|
9
|
-
|
|
12
|
+
let resolvedConfig = initConfig(components['imagecomponent'].initialData.configuration, configuration);
|
|
13
|
+
const { app, worldStore } = getContext('AppViewerContext');
|
|
10
14
|
const fit = {
|
|
11
15
|
cover: 'object-cover',
|
|
12
16
|
contain: 'object-contain',
|
|
13
17
|
fill: 'object-fill'
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let altText = undefined;
|
|
19
|
+
//used so that we can count number of outputs setup for first refresh
|
|
20
|
+
initOutput($worldStore, id, {});
|
|
18
21
|
$: css = concatCustomCss($app.css?.imagecomponent, customCss);
|
|
19
22
|
</script>
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
+
{#each Object.keys(components['imagecomponent'].initialData.configuration) as key (key)}
|
|
25
|
+
<ResolveConfig
|
|
26
|
+
{id}
|
|
27
|
+
{key}
|
|
28
|
+
bind:resolvedConfig={resolvedConfig[key]}
|
|
29
|
+
configuration={configuration[key]}
|
|
30
|
+
/>
|
|
31
|
+
{/each}
|
|
24
32
|
|
|
25
33
|
{#if render}
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
<Loader loading={resolvedConfig.source == undefined}>
|
|
35
|
+
<img
|
|
36
|
+
on:pointerdown|preventDefault
|
|
37
|
+
src={resolvedConfig.source}
|
|
38
|
+
alt={resolvedConfig.altText}
|
|
39
|
+
style={css?.image?.style ?? ''}
|
|
40
|
+
class={twMerge(
|
|
41
|
+
`w-full h-full ${fit[resolvedConfig.imageFit || 'cover']}`,
|
|
42
|
+
css?.image?.class ?? ''
|
|
43
|
+
)}
|
|
44
|
+
/>
|
|
45
|
+
</Loader>
|
|
33
46
|
{/if}
|
|
@@ -14,8 +14,7 @@ export let configuration;
|
|
|
14
14
|
export let customCss = undefined;
|
|
15
15
|
export let render;
|
|
16
16
|
const { app, mode, worldStore, selectedComponent } = getContext('AppViewerContext');
|
|
17
|
-
initOutput($worldStore, id, {
|
|
18
|
-
result: undefined,
|
|
17
|
+
const outputs = initOutput($worldStore, id, {
|
|
19
18
|
loading: false
|
|
20
19
|
});
|
|
21
20
|
let source = undefined;
|
|
@@ -53,6 +52,7 @@ async function loadDocument(src) {
|
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
55
54
|
try {
|
|
55
|
+
outputs.loading.set(true);
|
|
56
56
|
await resetDoc();
|
|
57
57
|
doc = await getDocument(src).promise;
|
|
58
58
|
pageNumber = 1;
|
|
@@ -64,6 +64,7 @@ async function loadDocument(src) {
|
|
|
64
64
|
error = err?.message ?? (typeof err === 'string' ? err : 'Error loading PDF');
|
|
65
65
|
console.log(err);
|
|
66
66
|
}
|
|
67
|
+
outputs.loading.set(false);
|
|
67
68
|
}
|
|
68
69
|
async function renderPdf(scaleToViewport = true, resizing = false) {
|
|
69
70
|
if (!(doc && wrapper && zoom)) {
|
|
@@ -12,7 +12,7 @@ export let initializing = undefined;
|
|
|
12
12
|
export let customCss = undefined;
|
|
13
13
|
export let render;
|
|
14
14
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
15
|
-
initOutput($worldStore, id, {
|
|
15
|
+
const outputs = initOutput($worldStore, id, {
|
|
16
16
|
result: undefined,
|
|
17
17
|
loading: false
|
|
18
18
|
});
|
|
@@ -47,7 +47,7 @@ $: css = concatCustomCss($app.css?.piechartcomponent, customCss);
|
|
|
47
47
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
48
48
|
<InputValue {id} input={configuration.doughnutStyle} bind:value={doughnut} />
|
|
49
49
|
|
|
50
|
-
<RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
50
|
+
<RunnableWrapper {outputs} {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
51
51
|
<div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
|
|
52
52
|
{#if result}
|
|
53
53
|
{#if doughnut}
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
8
|
configuration: RichConfigurations;
|
|
9
9
|
initializing?: boolean | undefined;
|
|
10
|
-
customCss?: ComponentCustomCSS<'
|
|
10
|
+
customCss?: ComponentCustomCSS<'piechartcomponent'> | undefined;
|
|
11
11
|
render: boolean;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
@@ -15,7 +15,7 @@ export let render;
|
|
|
15
15
|
let zoomable = false;
|
|
16
16
|
let pannable = false;
|
|
17
17
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
18
|
-
initOutput($worldStore, id, {
|
|
18
|
+
const outputs = initOutput($worldStore, id, {
|
|
19
19
|
result: undefined,
|
|
20
20
|
loading: false
|
|
21
21
|
});
|
|
@@ -50,7 +50,7 @@ $: css = concatCustomCss($app.css?.scatterchartcomponent, customCss);
|
|
|
50
50
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
51
51
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
52
52
|
|
|
53
|
-
<RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
53
|
+
<RunnableWrapper {outputs} {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
54
54
|
<div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
|
|
55
55
|
{#if result}
|
|
56
56
|
<Scatter {data} {options} />
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
8
|
configuration: RichConfigurations;
|
|
9
9
|
initializing?: boolean | undefined;
|
|
10
|
-
customCss?: ComponentCustomCSS<'
|
|
10
|
+
customCss?: ComponentCustomCSS<'scatterchartcomponent'> | undefined;
|
|
11
11
|
render: boolean;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
@@ -3,12 +3,15 @@ import { copyToClipboard } from '../../../../utils';
|
|
|
3
3
|
import Button from '../../../common/button/Button.svelte';
|
|
4
4
|
import Popover from '../../../Popover.svelte';
|
|
5
5
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
6
|
-
import InputValue from '../helpers/InputValue.svelte';
|
|
7
6
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
8
7
|
import { twMerge } from 'tailwind-merge';
|
|
9
8
|
import { getContext } from 'svelte';
|
|
10
|
-
import { initOutput } from '../../editor/appUtils';
|
|
9
|
+
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
11
10
|
import Tooltip from '../../../Tooltip.svelte';
|
|
11
|
+
import { get } from 'svelte/store';
|
|
12
|
+
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
13
|
+
import { components } from '../../editor/component';
|
|
14
|
+
import { isCodeInjection } from '../../../flows/utils';
|
|
12
15
|
export let id;
|
|
13
16
|
export let componentInput;
|
|
14
17
|
export let horizontalAlignment = 'left';
|
|
@@ -17,18 +20,20 @@ export let configuration;
|
|
|
17
20
|
export let initializing = undefined;
|
|
18
21
|
export let customCss = undefined;
|
|
19
22
|
export let render;
|
|
23
|
+
let resolvedConfig = initConfig(components['textcomponent'].initialData.configuration, configuration);
|
|
20
24
|
const { app, worldStore, mode } = getContext('AppViewerContext');
|
|
21
|
-
const
|
|
22
|
-
initOutput($worldStore, id, {
|
|
23
|
-
result: undefined,
|
|
24
|
-
loading: false
|
|
25
|
-
});
|
|
25
|
+
const editorcontext = getContext('AppEditorContext');
|
|
26
26
|
let result = undefined;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if (componentInput?.type == 'template' && !isCodeInjection(componentInput.eval)) {
|
|
28
|
+
result = componentInput.eval;
|
|
29
|
+
initializing = false;
|
|
30
|
+
}
|
|
31
|
+
const outputs = initOutput($worldStore, id, {
|
|
32
|
+
result,
|
|
33
|
+
loading: initializing
|
|
34
|
+
});
|
|
30
35
|
function getComponent() {
|
|
31
|
-
switch (style) {
|
|
36
|
+
switch (resolvedConfig.style) {
|
|
32
37
|
case 'Title':
|
|
33
38
|
return 'h1';
|
|
34
39
|
case 'Subtitle':
|
|
@@ -44,7 +49,7 @@ function getComponent() {
|
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
function getClasses() {
|
|
47
|
-
switch (style) {
|
|
52
|
+
switch (resolvedConfig.style) {
|
|
48
53
|
case 'Caption':
|
|
49
54
|
return 'text-sm italic text-gray-500';
|
|
50
55
|
case 'Label':
|
|
@@ -55,15 +60,20 @@ function getClasses() {
|
|
|
55
60
|
}
|
|
56
61
|
let component = 'p';
|
|
57
62
|
let classes = '';
|
|
58
|
-
$: style && (component = getComponent());
|
|
59
|
-
$: style && (classes = getClasses());
|
|
63
|
+
$: resolvedConfig.style && (component = getComponent());
|
|
64
|
+
$: resolvedConfig.style && (classes = getClasses());
|
|
60
65
|
</script>
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
67
|
+
{#each Object.keys(components['textcomponent'].initialData.configuration) as key (key)}
|
|
68
|
+
<ResolveConfig
|
|
69
|
+
{id}
|
|
70
|
+
{key}
|
|
71
|
+
bind:resolvedConfig={resolvedConfig[key]}
|
|
72
|
+
configuration={configuration[key]}
|
|
73
|
+
/>
|
|
74
|
+
{/each}
|
|
65
75
|
|
|
66
|
-
<RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
|
|
76
|
+
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
67
77
|
<div class="h-full w-full overflow-hidden">
|
|
68
78
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
69
79
|
{#if !result || result === ''}
|
|
@@ -78,7 +88,10 @@ $: style && (classes = getClasses());
|
|
|
78
88
|
: ''}"
|
|
79
89
|
on:click={() => {
|
|
80
90
|
if ($mode === 'dnd' && componentInput?.type == 'template') {
|
|
81
|
-
|
|
91
|
+
let ontextfocus = editorcontext?.ontextfocus
|
|
92
|
+
if (ontextfocus) {
|
|
93
|
+
get(ontextfocus)?.()
|
|
94
|
+
}
|
|
82
95
|
}
|
|
83
96
|
}}
|
|
84
97
|
>
|
|
@@ -93,10 +106,10 @@ $: style && (classes = getClasses());
|
|
|
93
106
|
style={[$app.css?.['textcomponent']?.['text']?.style, customCss?.text?.style].join(';')}
|
|
94
107
|
>
|
|
95
108
|
{String(result)}
|
|
96
|
-
{#if tooltip != ''}
|
|
97
|
-
<Tooltip>{tooltip}</Tooltip>
|
|
109
|
+
{#if resolvedConfig.tooltip != ''}
|
|
110
|
+
<Tooltip>{resolvedConfig.tooltip}</Tooltip>
|
|
98
111
|
{/if}
|
|
99
|
-
{#if copyButton && result}
|
|
112
|
+
{#if resolvedConfig.copyButton && result}
|
|
100
113
|
<Popover notClickable>
|
|
101
114
|
<Button
|
|
102
115
|
variant="border"
|
|
@@ -9,7 +9,7 @@ declare const __propDef: {
|
|
|
9
9
|
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
10
10
|
configuration: RichConfigurations;
|
|
11
11
|
initializing?: boolean | undefined;
|
|
12
|
-
customCss?: ComponentCustomCSS<'
|
|
12
|
+
customCss?: ComponentCustomCSS<'textcomponent'> | undefined;
|
|
13
13
|
render: boolean;
|
|
14
14
|
};
|
|
15
15
|
events: {
|