windmill-components 1.79.0 → 1.82.0
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/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 +33 -40
- package/components/apps/components/buttons/AppButton.svelte.d.ts +2 -1
- package/components/apps/components/buttons/AppForm.svelte +22 -15
- package/components/apps/components/buttons/AppForm.svelte.d.ts +1 -1
- package/components/apps/components/buttons/AppFormButton.svelte +32 -24
- 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 +2 -2
- 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 +28 -12
- 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 +114 -89
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +13 -3
- package/components/apps/components/helpers/RunnableWrapper.svelte +48 -9
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +26 -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 +3 -1
- package/components/apps/editor/AppEditorHeader.svelte +2 -3
- package/components/apps/editor/AppPreview.svelte +10 -15
- 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 +21 -10
- package/components/apps/editor/component/Component.svelte.d.ts +1 -2
- package/components/apps/editor/component/ComponentNavigation.svelte +17 -11
- 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 +5 -3
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +3 -1
- 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/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 +90 -54
- 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/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.d.ts +2 -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 +47 -31
- 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/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 +21 -22
- package/components/apps/utils.d.ts +2 -2
- package/components/apps/utils.js +13 -11
- package/components/common/skeleton/Skeleton.svelte +1 -1
- package/components/flows/flowStateUtils.js +8 -1
- package/package.json +7 -4
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
|
-
import { faChevronDown, faChevronUp
|
|
2
|
+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
4
|
import PanelSection from './common/PanelSection.svelte';
|
|
5
5
|
import InputsSpecsEditor from './InputsSpecsEditor.svelte';
|
|
@@ -15,42 +15,48 @@ import ComponentInputTypeEditor from './ComponentInputTypeEditor.svelte';
|
|
|
15
15
|
import AlignmentEditor from './AlignmentEditor.svelte';
|
|
16
16
|
import RunnableInputEditor from './inputEditor/RunnableInputEditor.svelte';
|
|
17
17
|
import TemplateEditor from '../../../TemplateEditor.svelte';
|
|
18
|
+
import { ccomponents } from '../component';
|
|
18
19
|
import CssProperty from '../componentsPanel/CssProperty.svelte';
|
|
19
20
|
import GridTab from './GridTab.svelte';
|
|
20
|
-
import { deleteGridItem } from '../appUtils';
|
|
21
|
+
import { clearErrorByComponentId, clearJobsByComponentId, deleteGridItem } from '../appUtils';
|
|
21
22
|
import GridPane from './GridPane.svelte';
|
|
22
23
|
import { slide } from 'svelte/transition';
|
|
23
24
|
import { push } from '../../../../history';
|
|
24
25
|
import Kbd from '../../../common/kbd/Kbd.svelte';
|
|
25
|
-
export let
|
|
26
|
+
export let componentSettings = undefined;
|
|
26
27
|
export let rowColumns = false;
|
|
27
28
|
export let onDelete = undefined;
|
|
28
|
-
export let parent;
|
|
29
29
|
export let noGrid = false;
|
|
30
30
|
export let duplicateMoveAllowed = true;
|
|
31
31
|
let editor = undefined;
|
|
32
|
-
const { app, runnableComponents, selectedComponent, worldStore, focusedGrid, stateId, state } = getContext('AppViewerContext');
|
|
32
|
+
const { app, runnableComponents, selectedComponent, worldStore, focusedGrid, stateId, state, errorByComponent, jobs } = getContext('AppViewerContext');
|
|
33
33
|
const { history, ontextfocus } = getContext('AppEditorContext');
|
|
34
34
|
$: editor && ($ontextfocus = () => editor?.focus());
|
|
35
35
|
function removeGridElement() {
|
|
36
36
|
push(history, $app);
|
|
37
|
+
if (componentSettings?.item.id) {
|
|
38
|
+
$errorByComponent = clearErrorByComponentId(componentSettings?.item.id, $errorByComponent);
|
|
39
|
+
$jobs = clearJobsByComponentId(componentSettings?.item.id, $jobs);
|
|
40
|
+
}
|
|
37
41
|
$selectedComponent = undefined;
|
|
38
42
|
$focusedGrid = undefined;
|
|
39
|
-
if (
|
|
40
|
-
let ids = deleteGridItem($app,
|
|
43
|
+
if (componentSettings?.item && !noGrid) {
|
|
44
|
+
let ids = deleteGridItem($app, componentSettings?.item.data, componentSettings?.parent, false);
|
|
41
45
|
for (const key of ids) {
|
|
42
46
|
delete $runnableComponents[key];
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
|
-
|
|
49
|
+
if (componentSettings?.item?.data?.id) {
|
|
50
|
+
delete $runnableComponents[componentSettings?.item?.data?.id];
|
|
51
|
+
}
|
|
46
52
|
$app = $app;
|
|
47
53
|
$runnableComponents = $runnableComponents;
|
|
48
54
|
onDelete?.();
|
|
49
55
|
}
|
|
50
56
|
let viewCssOptions = false;
|
|
51
57
|
$: extraLib =
|
|
52
|
-
|
|
53
|
-
? buildExtraLib($worldStore?.outputsById ?? {},
|
|
58
|
+
componentSettings?.item?.data?.componentInput?.type === 'template' && $worldStore
|
|
59
|
+
? buildExtraLib($worldStore?.outputsById ?? {}, componentSettings?.item?.data?.id, false, $state, false)
|
|
54
60
|
: undefined;
|
|
55
61
|
function keydown(event) {
|
|
56
62
|
switch (event.key) {
|
|
@@ -61,14 +67,22 @@ function keydown(event) {
|
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
}
|
|
70
|
+
const initialConfiguration = componentSettings?.item?.data?.type
|
|
71
|
+
? ccomponents[componentSettings.item.data.type].initialData.configuration
|
|
72
|
+
: {};
|
|
73
|
+
const componentInput = componentSettings?.item?.data?.type
|
|
74
|
+
? ccomponents[componentSettings?.item?.data?.type].initialData.componentInput
|
|
75
|
+
: undefined;
|
|
76
|
+
$: componentSettings?.item?.data && ($app = $app);
|
|
64
77
|
</script>
|
|
65
78
|
|
|
66
79
|
<svelte:window on:keydown={keydown} />
|
|
67
80
|
|
|
68
|
-
{#if
|
|
81
|
+
{#if componentSettings?.item?.data}
|
|
82
|
+
{@const component = componentSettings.item.data}
|
|
69
83
|
<div class="flex min-h-full flex-col min-w-[150px] w-full divide-y">
|
|
70
84
|
{#if component.componentInput}
|
|
71
|
-
<PanelSection title=
|
|
85
|
+
<PanelSection title="Data Source">
|
|
72
86
|
<svelte:fragment slot="action">
|
|
73
87
|
<span
|
|
74
88
|
class={classNames(
|
|
@@ -88,37 +102,50 @@ function keydown(event) {
|
|
|
88
102
|
{/if}
|
|
89
103
|
</svelte:fragment>
|
|
90
104
|
|
|
91
|
-
|
|
105
|
+
{#if componentSettings.item.data.componentInput}
|
|
106
|
+
<ComponentInputTypeEditor
|
|
107
|
+
bind:componentInput={componentSettings.item.data.componentInput}
|
|
108
|
+
/>
|
|
92
109
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
bind:
|
|
100
|
-
|
|
101
|
-
bind:code={component.componentInput.eval}
|
|
102
|
-
{extraLib}
|
|
110
|
+
<div class="flex flex-col w-full gap-2 my-2">
|
|
111
|
+
{#if componentSettings.item.data.componentInput.type === 'static'}
|
|
112
|
+
<StaticInputEditor
|
|
113
|
+
fieldType={componentInput?.fieldType}
|
|
114
|
+
subFieldType={componentInput?.subFieldType}
|
|
115
|
+
format={componentInput?.format}
|
|
116
|
+
bind:componentInput={componentSettings.item.data.componentInput}
|
|
117
|
+
noVariablePicker
|
|
103
118
|
/>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
{:else if componentSettings.item.data.componentInput.type === 'template' && componentSettings.item.data.componentInput !== undefined}
|
|
120
|
+
<div class="py-1 min-h-[28px] rounded border border-1 border-gray-500">
|
|
121
|
+
<TemplateEditor
|
|
122
|
+
bind:this={editor}
|
|
123
|
+
fontSize={12}
|
|
124
|
+
bind:code={componentSettings.item.data.componentInput.eval}
|
|
125
|
+
{extraLib}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
{:else if componentSettings.item.data.componentInput.type === 'connected' && component.componentInput !== undefined}
|
|
129
|
+
<ConnectedInputEditor
|
|
130
|
+
bind:componentInput={componentSettings.item.data.componentInput}
|
|
131
|
+
/>
|
|
132
|
+
{:else if componentSettings.item.data.componentInput?.type === 'runnable' && component.componentInput !== undefined}
|
|
133
|
+
<RunnableInputEditor
|
|
134
|
+
appComponent={component}
|
|
135
|
+
bind:appInput={componentSettings.item.data.componentInput}
|
|
136
|
+
defaultUserInput={component.type == 'formcomponent' ||
|
|
137
|
+
component.type == 'formbuttoncomponent'}
|
|
138
|
+
/>
|
|
139
|
+
{/if}
|
|
140
|
+
</div>
|
|
141
|
+
{/if}
|
|
115
142
|
{#key $stateId}
|
|
116
|
-
{#if
|
|
117
|
-
{#if Object.keys(
|
|
143
|
+
{#if componentSettings.item.data.componentInput?.type === 'runnable'}
|
|
144
|
+
{#if Object.keys(componentSettings.item.data.componentInput.fields ?? {}).length > 0}
|
|
118
145
|
<div class="border w-full">
|
|
119
146
|
<PanelSection
|
|
120
147
|
title={`Runnable Inputs (${
|
|
121
|
-
Object.keys(
|
|
148
|
+
Object.keys(componentSettings.item.data.componentInput.fields ?? {}).length
|
|
122
149
|
})`}
|
|
123
150
|
>
|
|
124
151
|
<svelte:fragment slot="action">
|
|
@@ -131,7 +158,7 @@ function keydown(event) {
|
|
|
131
158
|
<InputsSpecsEditor
|
|
132
159
|
id={component.id}
|
|
133
160
|
shouldCapitalize={false}
|
|
134
|
-
bind:inputSpecs={
|
|
161
|
+
bind:inputSpecs={componentSettings.item.data.componentInput.fields}
|
|
135
162
|
userInputEnabled={component.type === 'formcomponent' ||
|
|
136
163
|
component.type === 'formbuttoncomponent'}
|
|
137
164
|
{rowColumns}
|
|
@@ -143,33 +170,37 @@ function keydown(event) {
|
|
|
143
170
|
{/key}
|
|
144
171
|
</PanelSection>
|
|
145
172
|
{/if}
|
|
146
|
-
{#if Object.values(
|
|
147
|
-
<PanelSection title={`Configuration (${Object.values(
|
|
173
|
+
{#if Object.values(initialConfiguration).length > 0}
|
|
174
|
+
<PanelSection title={`Configuration (${Object.values(initialConfiguration).length})`}>
|
|
148
175
|
<InputsSpecsEditor
|
|
149
176
|
{rowColumns}
|
|
150
177
|
id={component.id}
|
|
151
|
-
|
|
178
|
+
inputSpecsConfiguration={initialConfiguration}
|
|
179
|
+
bind:inputSpecs={componentSettings.item.data.configuration}
|
|
152
180
|
userInputEnabled={false}
|
|
153
181
|
/>
|
|
154
182
|
</PanelSection>
|
|
155
183
|
{/if}
|
|
156
184
|
|
|
157
|
-
{#if
|
|
158
|
-
<GridTab bind:tabs={
|
|
159
|
-
{:else if
|
|
160
|
-
<GridPane bind:panes={
|
|
161
|
-
{:else if
|
|
162
|
-
<TableActions id={component.id} bind:components={
|
|
185
|
+
{#if componentSettings.item.data.type === 'tabscomponent'}
|
|
186
|
+
<GridTab bind:tabs={componentSettings.item.data.tabs} {component} />
|
|
187
|
+
{:else if componentSettings.item.data.type === 'verticalsplitpanescomponent' || componentSettings.item.data.type === 'horizontalsplitpanescomponent'}
|
|
188
|
+
<GridPane bind:panes={componentSettings.item.data.panes} {component} />
|
|
189
|
+
{:else if componentSettings.item.data.type === 'tablecomponent' && Array.isArray(componentSettings.item.data.actionButtons)}
|
|
190
|
+
<TableActions id={component.id} bind:components={componentSettings.item.data.actionButtons} />
|
|
163
191
|
{/if}
|
|
164
192
|
|
|
165
|
-
<AlignmentEditor bind:component />
|
|
166
|
-
{#if
|
|
167
|
-
<Recompute
|
|
193
|
+
<AlignmentEditor bind:component={componentSettings.item.data} />
|
|
194
|
+
{#if componentSettings.item.data.type === 'buttoncomponent' || componentSettings.item.data.type === 'formcomponent' || componentSettings.item.data.type === 'formbuttoncomponent'}
|
|
195
|
+
<Recompute
|
|
196
|
+
bind:recomputeIds={componentSettings.item.data.recomputeIds}
|
|
197
|
+
ownId={component.id}
|
|
198
|
+
/>
|
|
168
199
|
{/if}
|
|
169
200
|
|
|
170
201
|
<div class="grow shrink" />
|
|
171
202
|
|
|
172
|
-
{#if Object.keys(component.customCss ?? {}).length > 0}
|
|
203
|
+
{#if Object.keys(ccomponents[component.type].customCss ?? {}).length > 0}
|
|
173
204
|
<PanelSection title="Custom CSS">
|
|
174
205
|
<div slot="action">
|
|
175
206
|
<Button
|
|
@@ -183,10 +214,15 @@ function keydown(event) {
|
|
|
183
214
|
</div>
|
|
184
215
|
{#if viewCssOptions}
|
|
185
216
|
<div transition:slide|local>
|
|
186
|
-
{#each Object.keys(component.customCss ?? {}) as name}
|
|
187
|
-
{#if
|
|
217
|
+
{#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
|
|
218
|
+
{#if componentSettings.item.data?.customCss != undefined}
|
|
188
219
|
<div class="w-full mb-2">
|
|
189
|
-
<CssProperty
|
|
220
|
+
<CssProperty
|
|
221
|
+
forceStyle={ccomponents[component.type].customCss[name].style != undefined}
|
|
222
|
+
forceClass={ccomponents[component.type].customCss[name].class != undefined}
|
|
223
|
+
{name}
|
|
224
|
+
bind:value={componentSettings.item.data.customCss[name]}
|
|
225
|
+
/>
|
|
190
226
|
</div>
|
|
191
227
|
{/if}
|
|
192
228
|
{/each}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { GridItem } from '../../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
|
|
5
|
+
componentSettings?: {
|
|
6
|
+
item: GridItem;
|
|
7
|
+
parent: string | undefined;
|
|
8
|
+
} | undefined;
|
|
6
9
|
rowColumns?: boolean | undefined;
|
|
7
10
|
onDelete?: (() => void) | undefined;
|
|
8
|
-
parent: string | undefined;
|
|
9
11
|
noGrid?: boolean | undefined;
|
|
10
12
|
duplicateMoveAllowed?: boolean | undefined;
|
|
11
13
|
};
|
|
@@ -21,7 +21,6 @@ function deleteSubgrid(index) {
|
|
|
21
21
|
let subgrid = `${component.id}-${index}`;
|
|
22
22
|
for (const item of $app.subgrids[subgrid]) {
|
|
23
23
|
const components = deleteGridItem($app, item.data, subgrid, false);
|
|
24
|
-
console.log(components);
|
|
25
24
|
for (const key in components) {
|
|
26
25
|
delete $runnableComponents[key];
|
|
27
26
|
}
|
|
@@ -17,104 +17,123 @@ export let hasRows = false;
|
|
|
17
17
|
export let userInputEnabled = false;
|
|
18
18
|
export let shouldCapitalize = true;
|
|
19
19
|
export let resourceOnly = false;
|
|
20
|
+
export let tooltip = undefined;
|
|
21
|
+
export let onlyStatic = false;
|
|
22
|
+
export let fieldType;
|
|
23
|
+
export let subFieldType;
|
|
24
|
+
export let format;
|
|
25
|
+
export let selectOptions;
|
|
26
|
+
export let placeholder;
|
|
20
27
|
const { connectingInput } = getContext('AppViewerContext');
|
|
28
|
+
$: if (componentInput == undefined) {
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
componentInput = {
|
|
31
|
+
type: 'static',
|
|
32
|
+
value: undefined
|
|
33
|
+
};
|
|
34
|
+
}
|
|
21
35
|
</script>
|
|
22
36
|
|
|
23
|
-
{#if
|
|
24
|
-
|
|
25
|
-
<div class="flex
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</span>
|
|
37
|
+
{#if !(resourceOnly && (fieldType !== 'object' || !format?.startsWith('resource-')))}
|
|
38
|
+
<div class="flex flex-col gap-1">
|
|
39
|
+
<div class="flex justify-between items-end gap-1">
|
|
40
|
+
<span class="text-sm font-semibold truncate">
|
|
41
|
+
{shouldCapitalize ? capitalize(addWhitespaceBeforeCapitals(key)) : key}
|
|
42
|
+
{#if tooltip}
|
|
43
|
+
<Tooltip>
|
|
44
|
+
{tooltip}
|
|
45
|
+
</Tooltip>
|
|
46
|
+
{/if}
|
|
47
|
+
</span>
|
|
35
48
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
<div class="flex gap-x-2 gap-y-1 flex-wrap justify-end items-center">
|
|
50
|
+
<Badge color="blue">
|
|
51
|
+
{fieldType === 'array' && subFieldType
|
|
52
|
+
? `${capitalize(fieldTypeToTsType(subFieldType))}[]`
|
|
53
|
+
: capitalize(fieldTypeToTsType(fieldType))}
|
|
54
|
+
</Badge>
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
56
|
+
{#if !onlyStatic && componentInput?.type && componentInput.type != 'eval'}
|
|
57
|
+
<ToggleButtonGroup
|
|
58
|
+
bind:selected={componentInput.type}
|
|
59
|
+
on:selected={(e) => {
|
|
60
|
+
if (e.detail == 'connected' && !componentInput['connection']) {
|
|
61
|
+
$connectingInput = {
|
|
62
|
+
opened: true,
|
|
63
|
+
input: undefined,
|
|
64
|
+
hoveredComponent: undefined
|
|
53
65
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
70
|
+
<ToggleButton
|
|
71
|
+
position="left"
|
|
72
|
+
value="static"
|
|
73
|
+
startIcon={{ icon: faPen }}
|
|
74
|
+
size="xs"
|
|
75
|
+
iconOnly
|
|
76
|
+
/>
|
|
77
|
+
<svelte:fragment slot="text">Static</svelte:fragment>
|
|
78
|
+
</Popover>
|
|
79
|
+
{#if userInputEnabled && !format?.startsWith('resource-')}
|
|
56
80
|
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
57
81
|
<ToggleButton
|
|
58
|
-
position="
|
|
59
|
-
value="
|
|
60
|
-
startIcon={{ icon:
|
|
82
|
+
position="center"
|
|
83
|
+
value="user"
|
|
84
|
+
startIcon={{ icon: faUser }}
|
|
61
85
|
size="xs"
|
|
62
86
|
iconOnly
|
|
63
87
|
/>
|
|
64
|
-
<svelte:fragment slot="text">
|
|
88
|
+
<svelte:fragment slot="text">User Input</svelte:fragment>
|
|
65
89
|
</Popover>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<ToggleButton
|
|
69
|
-
position="center"
|
|
70
|
-
value="user"
|
|
71
|
-
startIcon={{ icon: faUser }}
|
|
72
|
-
size="xs"
|
|
73
|
-
iconOnly
|
|
74
|
-
/>
|
|
75
|
-
<svelte:fragment slot="text">User Input</svelte:fragment>
|
|
76
|
-
</Popover>
|
|
77
|
-
{/if}
|
|
78
|
-
{#if 'fileUpload' in componentInput}
|
|
79
|
-
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
80
|
-
<ToggleButton
|
|
81
|
-
position="center"
|
|
82
|
-
value="upload"
|
|
83
|
-
startIcon={{ icon: faUpload }}
|
|
84
|
-
size="xs"
|
|
85
|
-
iconOnly
|
|
86
|
-
/>
|
|
87
|
-
<svelte:fragment slot="text">Upload</svelte:fragment>
|
|
88
|
-
</Popover>
|
|
89
|
-
{/if}
|
|
90
|
+
{/if}
|
|
91
|
+
{#if 'fileUpload' in componentInput}
|
|
90
92
|
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
91
93
|
<ToggleButton
|
|
92
|
-
position="
|
|
93
|
-
value="
|
|
94
|
-
startIcon={{ icon:
|
|
94
|
+
position="center"
|
|
95
|
+
value="upload"
|
|
96
|
+
startIcon={{ icon: faUpload }}
|
|
95
97
|
size="xs"
|
|
96
98
|
iconOnly
|
|
97
99
|
/>
|
|
98
|
-
<svelte:fragment slot="text">
|
|
100
|
+
<svelte:fragment slot="text">Upload</svelte:fragment>
|
|
99
101
|
</Popover>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
{/if}
|
|
103
|
+
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
104
|
+
<ToggleButton
|
|
105
|
+
position="right"
|
|
106
|
+
value="connected"
|
|
107
|
+
startIcon={{ icon: faArrowRight }}
|
|
108
|
+
size="xs"
|
|
109
|
+
iconOnly
|
|
110
|
+
/>
|
|
111
|
+
<svelte:fragment slot="text">Connect</svelte:fragment>
|
|
112
|
+
</Popover>
|
|
113
|
+
</ToggleButtonGroup>
|
|
114
|
+
{/if}
|
|
103
115
|
</div>
|
|
104
|
-
|
|
105
|
-
{#if componentInput.type === 'connected'}
|
|
106
|
-
<ConnectedInputEditor bind:componentInput />
|
|
107
|
-
{:else if componentInput.type === 'row'}
|
|
108
|
-
<RowInputEditor bind:componentInput />
|
|
109
|
-
{:else if componentInput.type === 'static'}
|
|
110
|
-
<StaticInputEditor bind:componentInput />
|
|
111
|
-
{:else if componentInput.type === 'eval'}
|
|
112
|
-
<EvalInputEditor {hasRows} {id} bind:componentInput />
|
|
113
|
-
{:else if componentInput.type === 'upload'}
|
|
114
|
-
<UploadInputEditor bind:componentInput />
|
|
115
|
-
{:else if componentInput.type === 'user'}
|
|
116
|
-
<span class="text-2xs italic text-gray-600">Field's value is set by the user</span>
|
|
117
|
-
{/if}
|
|
118
116
|
</div>
|
|
119
|
-
|
|
117
|
+
|
|
118
|
+
{#if componentInput?.type === 'connected'}
|
|
119
|
+
<ConnectedInputEditor bind:componentInput />
|
|
120
|
+
{:else if componentInput?.type === 'row'}
|
|
121
|
+
<RowInputEditor bind:componentInput />
|
|
122
|
+
{:else if componentInput?.type === 'static'}
|
|
123
|
+
<StaticInputEditor
|
|
124
|
+
{fieldType}
|
|
125
|
+
{subFieldType}
|
|
126
|
+
{selectOptions}
|
|
127
|
+
{format}
|
|
128
|
+
{placeholder}
|
|
129
|
+
bind:componentInput
|
|
130
|
+
/>
|
|
131
|
+
{:else if componentInput?.type === 'eval'}
|
|
132
|
+
<EvalInputEditor {hasRows} {id} bind:componentInput />
|
|
133
|
+
{:else if componentInput?.type === 'upload'}
|
|
134
|
+
<UploadInputEditor bind:componentInput />
|
|
135
|
+
{:else if componentInput?.type === 'user'}
|
|
136
|
+
<span class="text-2xs italic text-gray-600">Field's value is set by the user</span>
|
|
137
|
+
{/if}
|
|
138
|
+
</div>
|
|
120
139
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { RichConfiguration } from '../../types';
|
|
3
|
+
import type { InputType } from '../../inputType';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
id: string;
|
|
@@ -9,6 +10,13 @@ declare const __propDef: {
|
|
|
9
10
|
userInputEnabled?: boolean | undefined;
|
|
10
11
|
shouldCapitalize?: boolean | undefined;
|
|
11
12
|
resourceOnly?: boolean | undefined;
|
|
13
|
+
tooltip?: string | undefined;
|
|
14
|
+
onlyStatic?: boolean | undefined;
|
|
15
|
+
fieldType: InputType;
|
|
16
|
+
subFieldType: InputType | undefined;
|
|
17
|
+
format: string | undefined;
|
|
18
|
+
selectOptions: string[] | undefined;
|
|
19
|
+
placeholder: string | undefined;
|
|
12
20
|
};
|
|
13
21
|
events: {
|
|
14
22
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>import InputsSpecEditor from './InputsSpecEditor.svelte';
|
|
2
|
+
import OneOfInputSpecsEditor from './OneOfInputSpecsEditor.svelte';
|
|
2
3
|
export let id;
|
|
3
4
|
export let inputSpecs;
|
|
5
|
+
export let inputSpecsConfiguration = inputSpecs;
|
|
4
6
|
export let userInputEnabled = false;
|
|
5
7
|
export let shouldCapitalize = true;
|
|
6
8
|
export let rowColumns = false;
|
|
@@ -9,8 +11,22 @@ export let resourceOnly = false;
|
|
|
9
11
|
|
|
10
12
|
{#if inputSpecs}
|
|
11
13
|
<div class="w-full flex flex-col gap-4">
|
|
12
|
-
{#each Object.keys(
|
|
13
|
-
{#if inputSpecs[k]
|
|
14
|
+
{#each Object.keys(inputSpecsConfiguration) as k}
|
|
15
|
+
{#if inputSpecs[k] && inputSpecs[k]?.type == 'oneOf'}
|
|
16
|
+
<OneOfInputSpecsEditor
|
|
17
|
+
key={k}
|
|
18
|
+
bind:oneOf={inputSpecs[k]}
|
|
19
|
+
{id}
|
|
20
|
+
{shouldCapitalize}
|
|
21
|
+
{resourceOnly}
|
|
22
|
+
{rowColumns}
|
|
23
|
+
inputSpecsConfiguration={inputSpecsConfiguration?.[k]?.['configuration']}
|
|
24
|
+
labels={inputSpecsConfiguration?.[k]?.['labels']}
|
|
25
|
+
tooltip={inputSpecsConfiguration?.[k]?.['tooltip']}
|
|
26
|
+
/>
|
|
27
|
+
{:else}
|
|
28
|
+
{@const meta = inputSpecsConfiguration?.[k]}
|
|
29
|
+
<!-- {JSON.stringify(meta)} -->
|
|
14
30
|
<InputsSpecEditor
|
|
15
31
|
key={k}
|
|
16
32
|
bind:componentInput={inputSpecs[k]}
|
|
@@ -19,6 +35,13 @@ export let resourceOnly = false;
|
|
|
19
35
|
{shouldCapitalize}
|
|
20
36
|
{resourceOnly}
|
|
21
37
|
hasRows={rowColumns}
|
|
38
|
+
fieldType={meta?.['fieldType']}
|
|
39
|
+
subFieldType={meta?.['subFieldType']}
|
|
40
|
+
format={meta?.['format']}
|
|
41
|
+
selectOptions={meta?.['selectOptions']}
|
|
42
|
+
tooltip={meta?.['tooltip']}
|
|
43
|
+
onlyStatic={meta?.['onlyStatic']}
|
|
44
|
+
placeholder={meta?.['placeholder']}
|
|
22
45
|
/>
|
|
23
46
|
{/if}
|
|
24
47
|
{/each}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script>import Tooltip from '../../../Tooltip.svelte';
|
|
2
|
+
import InputsSpecEditor from './InputsSpecEditor.svelte';
|
|
3
|
+
export let key;
|
|
4
|
+
export let oneOf;
|
|
5
|
+
export let inputSpecsConfiguration;
|
|
6
|
+
export let labels;
|
|
7
|
+
export let shouldCapitalize;
|
|
8
|
+
export let id;
|
|
9
|
+
export let resourceOnly;
|
|
10
|
+
export let rowColumns;
|
|
11
|
+
export let tooltip;
|
|
12
|
+
$: if (oneOf.configuration[oneOf.selected] == undefined) {
|
|
13
|
+
oneOf.configuration[oneOf.selected] = {};
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="p-2 border">
|
|
18
|
+
<h4 class="mb-2">{key} <Tooltip>{tooltip}</Tooltip></h4>
|
|
19
|
+
<select
|
|
20
|
+
class="w-full border border-gray-300 rounded-md p-2"
|
|
21
|
+
value={oneOf.selected}
|
|
22
|
+
on:change={(e) => {
|
|
23
|
+
oneOf = { ...oneOf, selected: e?.target?.['value'] }
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
{#each Object.keys(inputSpecsConfiguration ?? {}) as choice}
|
|
27
|
+
<option value={choice}>{labels?.[choice] ?? choice}</option>
|
|
28
|
+
{/each}
|
|
29
|
+
</select>
|
|
30
|
+
<div class="mb-4" />
|
|
31
|
+
<div class="flex flex-col gap-4">
|
|
32
|
+
{#each Object.keys(inputSpecsConfiguration?.[oneOf.selected] ?? {}) as nestedKey}
|
|
33
|
+
{@const config = inputSpecsConfiguration?.[oneOf.selected]?.[nestedKey]}
|
|
34
|
+
{#if config && oneOf.configuration[oneOf.selected]}
|
|
35
|
+
<InputsSpecEditor
|
|
36
|
+
key={nestedKey}
|
|
37
|
+
bind:componentInput={oneOf.configuration[oneOf.selected][nestedKey]}
|
|
38
|
+
{id}
|
|
39
|
+
userInputEnabled={false}
|
|
40
|
+
{shouldCapitalize}
|
|
41
|
+
{resourceOnly}
|
|
42
|
+
hasRows={rowColumns}
|
|
43
|
+
fieldType={config?.['fieldType']}
|
|
44
|
+
subFieldType={config?.['subFieldType']}
|
|
45
|
+
format={config?.['format']}
|
|
46
|
+
selectOptions={config?.['selectOptions']}
|
|
47
|
+
placeholder={config?.['placeholder']}
|
|
48
|
+
/>
|
|
49
|
+
{/if}
|
|
50
|
+
{/each}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { RichConfiguration } from '../../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
key: string;
|
|
6
|
+
oneOf: {
|
|
7
|
+
selected: string;
|
|
8
|
+
configuration: RichConfiguration;
|
|
9
|
+
} | any;
|
|
10
|
+
inputSpecsConfiguration: RichConfiguration | any;
|
|
11
|
+
labels: Record<string, string> | undefined;
|
|
12
|
+
shouldCapitalize: boolean;
|
|
13
|
+
id: string;
|
|
14
|
+
resourceOnly: boolean;
|
|
15
|
+
rowColumns: boolean;
|
|
16
|
+
tooltip: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export type OneOfInputSpecsEditorProps = typeof __propDef.props;
|
|
24
|
+
export type OneOfInputSpecsEditorEvents = typeof __propDef.events;
|
|
25
|
+
export type OneOfInputSpecsEditorSlots = typeof __propDef.slots;
|
|
26
|
+
export default class OneOfInputSpecsEditor extends SvelteComponentTyped<OneOfInputSpecsEditorProps, OneOfInputSpecsEditorEvents, OneOfInputSpecsEditorSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|