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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script>import { allItems } from '../../../utils';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
export let componentInput;
|
|
4
|
+
const { app } = getContext('AppViewerContext');
|
|
5
|
+
const tabComponents = allItems($app.grid, $app.subgrids).filter((component) => component.data.type === 'tabscomponent');
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if componentInput.value && tabComponents.length > 0}
|
|
9
|
+
<div>
|
|
10
|
+
<div class="flex flex-row gap-2 w-full">
|
|
11
|
+
<div class="flex flex-col">
|
|
12
|
+
<label for="tabId" class="text-xs font-semibold">Tab ID</label>
|
|
13
|
+
|
|
14
|
+
<select
|
|
15
|
+
id="tabId"
|
|
16
|
+
bind:value={componentInput.value.id}
|
|
17
|
+
class="border border-gray-300 rounded-md p-1 !w-16"
|
|
18
|
+
>
|
|
19
|
+
{#each tabComponents as tabComponent}
|
|
20
|
+
<option value={tabComponent.data.id}>
|
|
21
|
+
{tabComponent.data.id}
|
|
22
|
+
</option>
|
|
23
|
+
{/each}
|
|
24
|
+
</select>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="flex flex-col">
|
|
27
|
+
<label for="tabIndex" class="text-xs font-semibold">Tab Index</label>
|
|
28
|
+
<select
|
|
29
|
+
id="tabIndex"
|
|
30
|
+
bind:value={componentInput.value.index}
|
|
31
|
+
class="border border-gray-300 rounded-md p-1 !w-16"
|
|
32
|
+
>
|
|
33
|
+
{#each tabComponents as tabComponent}
|
|
34
|
+
{#if tabComponent.data.id === componentInput.value.id}
|
|
35
|
+
{#each Array(tabComponent.data.numberOfSubgrids) as _, i}
|
|
36
|
+
<option value={i}>{i}</option>
|
|
37
|
+
{/each}
|
|
38
|
+
{/if}
|
|
39
|
+
{/each}
|
|
40
|
+
</select>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
{:else}
|
|
45
|
+
<div class="text-xs text-gray-500"> No tab component found in the app </div>
|
|
46
|
+
{/if}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { StaticInput } from '../../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
componentInput: StaticInput<{
|
|
6
|
+
id: string;
|
|
7
|
+
index: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type TabSelectInputProps = typeof __propDef.props;
|
|
16
|
+
export type TabSelectInputEvents = typeof __propDef.events;
|
|
17
|
+
export type TabSelectInputSlots = typeof __propDef.slots;
|
|
18
|
+
export default class TabSelectInput extends SvelteComponentTyped<TabSelectInputProps, TabSelectInputEvents, TabSelectInputSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -10,10 +10,12 @@ import { getAllScriptNames, loadSchema, schemaToInputsSpec } from '../../../util
|
|
|
10
10
|
import { emptySchema } from '../../../../../utils';
|
|
11
11
|
export let appInput;
|
|
12
12
|
export let defaultUserInput = false;
|
|
13
|
+
export let id;
|
|
13
14
|
let tab = 'inlinescripts';
|
|
14
15
|
let filter = '';
|
|
15
16
|
let picker;
|
|
16
17
|
const { app, workspace } = getContext('AppViewerContext');
|
|
18
|
+
const { selectedComponentInEditor } = getContext('AppEditorContext');
|
|
17
19
|
async function loadSchemaFromTriggerable(path, runType) {
|
|
18
20
|
return loadSchema(workspace, path, runType) ?? emptySchema();
|
|
19
21
|
}
|
|
@@ -28,6 +30,7 @@ async function pickScript(path) {
|
|
|
28
30
|
schema
|
|
29
31
|
};
|
|
30
32
|
appInput.fields = fields;
|
|
33
|
+
$selectedComponentInEditor = id;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
async function pickFlow(path) {
|
|
@@ -41,6 +44,7 @@ async function pickFlow(path) {
|
|
|
41
44
|
schema
|
|
42
45
|
};
|
|
43
46
|
appInput.fields = fields;
|
|
47
|
+
$selectedComponentInEditor = id;
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
async function pickHubScript(path) {
|
|
@@ -54,6 +58,7 @@ async function pickHubScript(path) {
|
|
|
54
58
|
schema
|
|
55
59
|
};
|
|
56
60
|
appInput.fields = fields;
|
|
61
|
+
$selectedComponentInEditor = id;
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
function pickInlineScript(name) {
|
|
@@ -67,6 +72,7 @@ function pickInlineScript(name) {
|
|
|
67
72
|
};
|
|
68
73
|
$app.unusedInlineScripts.splice(unusedInlineScriptIndex, 1);
|
|
69
74
|
}
|
|
75
|
+
$selectedComponentInEditor = id;
|
|
70
76
|
$app = $app;
|
|
71
77
|
}
|
|
72
78
|
function createScript() {
|
|
@@ -83,6 +89,7 @@ function createScript() {
|
|
|
83
89
|
inlineScript: undefined
|
|
84
90
|
};
|
|
85
91
|
appInput = appInput;
|
|
92
|
+
$selectedComponentInEditor = id;
|
|
86
93
|
return newScriptPath;
|
|
87
94
|
}
|
|
88
95
|
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>import { fly } from 'svelte/transition';
|
|
2
|
+
import { faChevronLeft } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { Badge, Button } from '../../../../common';
|
|
4
|
+
import { secondaryMenu, SECONDARY_MENU_ID } from './';
|
|
5
|
+
import { getContext } from 'svelte';
|
|
6
|
+
const { selectedComponent } = getContext('AppViewerContext');
|
|
7
|
+
let width;
|
|
8
|
+
let lastSelected = $selectedComponent;
|
|
9
|
+
$: if (lastSelected !== $selectedComponent) {
|
|
10
|
+
secondaryMenu.close();
|
|
11
|
+
lastSelected = $selectedComponent;
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div
|
|
16
|
+
bind:clientWidth={width}
|
|
17
|
+
class="absolute z-50 inset-0 overflow-hidden"
|
|
18
|
+
class:pointer-events-none={!$secondaryMenu.isOpen}
|
|
19
|
+
>
|
|
20
|
+
{#if $secondaryMenu.isOpen && $secondaryMenu.component}
|
|
21
|
+
<div
|
|
22
|
+
transition:fly|local={{ duration: 300, x: width, y: 0, opacity: 1 }}
|
|
23
|
+
id={SECONDARY_MENU_ID}
|
|
24
|
+
class="flex flex-col w-full h-full bg-white"
|
|
25
|
+
>
|
|
26
|
+
<div class="flex justify-between items-center bg-white gap-1 p-3">
|
|
27
|
+
<Button
|
|
28
|
+
color="light"
|
|
29
|
+
size="xs"
|
|
30
|
+
variant="border"
|
|
31
|
+
startIcon={{ icon: faChevronLeft }}
|
|
32
|
+
on:click={secondaryMenu.close}
|
|
33
|
+
>
|
|
34
|
+
Back
|
|
35
|
+
</Button>
|
|
36
|
+
<Badge color="blue">{$selectedComponent}</Badge>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="relative h-full overflow-y-auto px-3 pb-3">
|
|
39
|
+
{#if typeof $secondaryMenu.component === 'string'}
|
|
40
|
+
{@html $secondaryMenu.component}
|
|
41
|
+
{:else}
|
|
42
|
+
<svelte:component this={$secondaryMenu.component} {...$secondaryMenu.props} />
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type SecondaryMenuProps = typeof __propDef.props;
|
|
10
|
+
export type SecondaryMenuEvents = typeof __propDef.events;
|
|
11
|
+
export type SecondaryMenuSlots = typeof __propDef.slots;
|
|
12
|
+
export default class SecondaryMenu extends SvelteComponentTyped<SecondaryMenuProps, SecondaryMenuEvents, SecondaryMenuSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SvelteComponent } from 'svelte';
|
|
2
|
+
export declare const SECONDARY_MENU_ID: "app-secondary-menu";
|
|
3
|
+
export interface SecondaryMenuStore {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
component?: typeof SvelteComponent | string;
|
|
6
|
+
props: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export declare const secondaryMenu: {
|
|
9
|
+
readonly subscribe: (this: void, run: import("svelte/store").Subscriber<SecondaryMenuStore>, invalidate?: ((value?: SecondaryMenuStore | undefined) => void) | undefined) => import("svelte/store").Unsubscriber;
|
|
10
|
+
readonly open: (component: SecondaryMenuStore['component'], props?: SecondaryMenuStore['props']) => void;
|
|
11
|
+
readonly close: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { writable } from 'svelte/store';
|
|
2
|
+
export const SECONDARY_MENU_ID = 'app-secondary-menu';
|
|
3
|
+
const store = writable({ isOpen: false, component: undefined, props: {} });
|
|
4
|
+
export const secondaryMenu = {
|
|
5
|
+
subscribe: store.subscribe,
|
|
6
|
+
open: (component, props = {}) => {
|
|
7
|
+
store.set({ isOpen: true, component, props });
|
|
8
|
+
},
|
|
9
|
+
close: () => store.set({ isOpen: false, component: undefined, props: {} })
|
|
10
|
+
};
|
package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte
CHANGED
|
@@ -1,81 +1,31 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import
|
|
3
|
-
import { getContext } from 'svelte';
|
|
1
|
+
<script>import Toggle from '../../../../Toggle.svelte';
|
|
2
|
+
import Tooltip from '../../../../Tooltip.svelte';
|
|
4
3
|
import TriggerBadgesList from './TriggerBadgesList.svelte';
|
|
5
4
|
import { getDependencies } from './triggerListUtils';
|
|
6
5
|
export let fields;
|
|
7
6
|
export let autoRefresh = false;
|
|
8
7
|
export let id;
|
|
9
8
|
export let inlineScript;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function applyConnection() {
|
|
13
|
-
if (!$connectingInput.opened && $connectingInput.input !== undefined && addingDependency) {
|
|
14
|
-
if ($connectingInput.input.connection) {
|
|
15
|
-
const x = {
|
|
16
|
-
id: $connectingInput.input.connection.componentId,
|
|
17
|
-
key: $connectingInput.input.connection.path
|
|
18
|
-
};
|
|
19
|
-
if (!inlineScript) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (inlineScript.refreshOn?.find((y) => y.id === x.id && y.key === x.key)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (!inlineScript.refreshOn) {
|
|
26
|
-
inlineScript.refreshOn = [x];
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
inlineScript.refreshOn.push(x);
|
|
30
|
-
}
|
|
31
|
-
inlineScript = JSON.parse(JSON.stringify(inlineScript));
|
|
32
|
-
addingDependency = false;
|
|
33
|
-
}
|
|
34
|
-
$connectingInput = {
|
|
35
|
-
opened: false,
|
|
36
|
-
input: undefined,
|
|
37
|
-
hoveredComponent: undefined
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
$: $connectingInput && applyConnection();
|
|
9
|
+
export let doNotRecomputeOnInputChanged = false;
|
|
10
|
+
$: dependencies = getDependencies(fields);
|
|
42
11
|
</script>
|
|
43
12
|
|
|
13
|
+
{#if inlineScript.language !== 'frontend'}
|
|
14
|
+
<div class="flex items-center px-1">
|
|
15
|
+
<Toggle
|
|
16
|
+
size="xs"
|
|
17
|
+
color="red"
|
|
18
|
+
bind:checked={doNotRecomputeOnInputChanged}
|
|
19
|
+
options={{ right: 'do NOT recompute on input changes' }}
|
|
20
|
+
/>
|
|
21
|
+
<Tooltip>If not toggled, whenever an input is changed, the script will be re-run.</Tooltip>
|
|
22
|
+
</div>
|
|
23
|
+
{/if}
|
|
24
|
+
|
|
44
25
|
<TriggerBadgesList
|
|
26
|
+
bind:inlineScript
|
|
45
27
|
{id}
|
|
46
|
-
inputDependencies={
|
|
47
|
-
frontendDependencies={inlineScript?.language === 'frontend'
|
|
48
|
-
? inlineScript?.refreshOn?.map((x) => `${x.id} - ${x.key}`) ?? undefined
|
|
49
|
-
: undefined}
|
|
28
|
+
inputDependencies={dependencies}
|
|
50
29
|
onLoad={autoRefresh}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (inlineScript) {
|
|
54
|
-
inlineScript.refreshOn?.splice(index, 1)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
inlineScript = JSON.parse(JSON.stringify(inlineScript))
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
{#if inlineScript?.language === 'frontend'}
|
|
61
|
-
<Button
|
|
62
|
-
variant="border"
|
|
63
|
-
size="xs"
|
|
64
|
-
color="light"
|
|
65
|
-
btnClasses="!px-1 !py-0.5"
|
|
66
|
-
on:click={() => {
|
|
67
|
-
addingDependency = true
|
|
68
|
-
$connectingInput = {
|
|
69
|
-
opened: true,
|
|
70
|
-
input: undefined,
|
|
71
|
-
hoveredComponent: undefined
|
|
72
|
-
}
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<div class="flex flex-row gap-1 items-center">
|
|
76
|
-
Add dependency
|
|
77
|
-
<Plus size={14} />
|
|
78
|
-
</div>
|
|
79
|
-
</Button>
|
|
80
|
-
{/if}
|
|
81
|
-
</TriggerBadgesList>
|
|
30
|
+
{doNotRecomputeOnInputChanged}
|
|
31
|
+
/>
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
|
-
import { findGridItem } from '../../appUtils';
|
|
3
2
|
import TriggerBadgesList from './TriggerBadgesList.svelte';
|
|
4
3
|
import { getDependencies } from './triggerListUtils';
|
|
5
|
-
const { selectedComponent
|
|
4
|
+
const { selectedComponent } = getContext('AppViewerContext');
|
|
6
5
|
export let fields;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export let appComponent;
|
|
7
|
+
export let runnable;
|
|
8
|
+
export let doNotRecomputeOnInputChanged = false;
|
|
9
|
+
const onClick = ['buttoncomponent', 'formbuttoncomponent', 'formcomponent'].includes(appComponent.type);
|
|
10
|
+
$: onLoad =
|
|
11
|
+
!onClick ||
|
|
12
|
+
(appComponent?.configuration?.triggerOnAppLoad != undefined &&
|
|
13
|
+
appComponent.configuration.triggerOnAppLoad.type == 'static' &&
|
|
14
|
+
appComponent.configuration.triggerOnAppLoad.value);
|
|
11
15
|
</script>
|
|
12
16
|
|
|
13
17
|
<TriggerBadgesList
|
|
14
|
-
inputDependencies={getDependencies(fields)}
|
|
15
|
-
|
|
18
|
+
inputDependencies={onClick ? [] : getDependencies(fields)}
|
|
19
|
+
bind:inlineScript={runnable.inlineScript}
|
|
20
|
+
{onLoad}
|
|
21
|
+
{doNotRecomputeOnInputChanged}
|
|
16
22
|
id={$selectedComponent}
|
|
17
23
|
{onClick}
|
|
18
24
|
/>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { ConnectedAppInput, RowAppInput, StaticAppInput, UserAppInput } from '../../../inputType';
|
|
2
|
+
import type { ConnectedAppInput, RowAppInput, RunnableByName, StaticAppInput, UserAppInput } from '../../../inputType';
|
|
3
|
+
import type { AppComponent } from '../../component';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
7
|
+
appComponent: AppComponent;
|
|
8
|
+
runnable: RunnableByName;
|
|
9
|
+
doNotRecomputeOnInputChanged?: boolean | undefined;
|
|
6
10
|
};
|
|
7
11
|
events: {
|
|
8
12
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
<script>import { Button } from '../../../../common';
|
|
2
|
+
import { classNames } from '../../../../../utils';
|
|
3
|
+
import { Plus, X } from 'lucide-svelte';
|
|
4
|
+
import { getContext } from 'svelte';
|
|
4
5
|
import { getAllRecomputeIdsForComponent } from '../../appUtils';
|
|
5
6
|
export let inputDependencies = [];
|
|
6
|
-
export let
|
|
7
|
+
export let inlineScript;
|
|
7
8
|
export let onClick = false;
|
|
8
9
|
export let onLoad = false;
|
|
9
10
|
export let id = undefined;
|
|
11
|
+
export let doNotRecomputeOnInputChanged = false;
|
|
10
12
|
const colors = {
|
|
11
13
|
red: 'text-red-800 border-red-600 bg-red-100',
|
|
12
14
|
green: 'text-green-800 border-green-600 bg-green-100',
|
|
@@ -14,17 +16,52 @@ const colors = {
|
|
|
14
16
|
blue: 'text-blue-800 border-blue-600 bg-blue-100'
|
|
15
17
|
};
|
|
16
18
|
let badgeClass = 'inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium border';
|
|
17
|
-
const
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const { app, worldStore } = getContext('AppViewerContext');
|
|
20
|
+
const { connectingInput } = getContext('AppViewerContext');
|
|
21
|
+
let addingDependency = false;
|
|
22
|
+
function applyConnection() {
|
|
23
|
+
if (!$connectingInput.opened && $connectingInput.input !== undefined && addingDependency) {
|
|
24
|
+
if ($connectingInput.input.connection) {
|
|
25
|
+
const x = {
|
|
26
|
+
id: $connectingInput.input.connection.componentId,
|
|
27
|
+
key: $connectingInput.input.connection.path
|
|
28
|
+
};
|
|
29
|
+
if (!inlineScript) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (inlineScript.refreshOn?.find((y) => y.id === x.id && y.key === x.key)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!inlineScript.refreshOn) {
|
|
36
|
+
inlineScript.refreshOn = [x];
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
inlineScript.refreshOn.push(x);
|
|
40
|
+
}
|
|
41
|
+
inlineScript = JSON.parse(JSON.stringify(inlineScript));
|
|
42
|
+
addingDependency = false;
|
|
43
|
+
}
|
|
44
|
+
$connectingInput = {
|
|
45
|
+
opened: false,
|
|
46
|
+
input: undefined,
|
|
47
|
+
hoveredComponent: undefined
|
|
48
|
+
};
|
|
49
|
+
$app = $app;
|
|
50
|
+
$worldStore = $worldStore;
|
|
26
51
|
}
|
|
27
52
|
}
|
|
53
|
+
$: frontendDependencies =
|
|
54
|
+
inlineScript?.language === 'frontend'
|
|
55
|
+
? inlineScript?.refreshOn?.map((x) => `${x.id} - ${x.key}`) ?? []
|
|
56
|
+
: undefined;
|
|
57
|
+
$: $connectingInput && applyConnection();
|
|
58
|
+
$: recomputedBadges = getAllRecomputeIdsForComponent($app, id);
|
|
59
|
+
function deleteDep(index) {
|
|
60
|
+
if (inlineScript) {
|
|
61
|
+
inlineScript.refreshOn?.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
inlineScript = inlineScript;
|
|
64
|
+
}
|
|
28
65
|
</script>
|
|
29
66
|
|
|
30
67
|
<div class="flex w-full flex-col items-start gap-2 mt-2 mb-1">
|
|
@@ -33,28 +70,29 @@ $: if ($app && $selectedComponent && id) {
|
|
|
33
70
|
This script has no triggers. It will never run.
|
|
34
71
|
</p>
|
|
35
72
|
{:else}
|
|
36
|
-
<div class="text-sm font-semibold text-
|
|
73
|
+
<div class="text-sm font-semibold text-gray-800 ">Triggered by</div>
|
|
37
74
|
|
|
38
75
|
{#if onLoad || onClick}
|
|
39
76
|
<div class="w-full">
|
|
40
|
-
<div class="text-xs font-semibold text-slate-800 mb-1">
|
|
77
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Events</div>
|
|
41
78
|
<div class="flex flex-row gap-2 flex-wrap">
|
|
42
79
|
{#if onLoad}
|
|
43
|
-
<span class={classNames(badgeClass, colors['green'])}>
|
|
80
|
+
<span class={classNames(badgeClass, colors['green'])}>Start</span>
|
|
81
|
+
<span class={classNames(badgeClass, colors['green'])}>Refresh</span>
|
|
44
82
|
{/if}
|
|
45
83
|
{#if onClick}
|
|
46
|
-
<span class={classNames(badgeClass, colors['green'])}>
|
|
84
|
+
<span class={classNames(badgeClass, colors['green'])}>Click</span>
|
|
47
85
|
{/if}
|
|
48
86
|
</div>
|
|
49
87
|
</div>
|
|
50
88
|
{/if}
|
|
51
|
-
{#if inputDependencies.length > 0}
|
|
89
|
+
{#if inputDependencies.length > 0 && !doNotRecomputeOnInputChanged}
|
|
52
90
|
<div class="w-full">
|
|
53
|
-
<div class="flex justify-between items-center mb-
|
|
54
|
-
<div class="text-xs font-semibold text-slate-800
|
|
91
|
+
<div class="flex justify-between items-center mb-1">
|
|
92
|
+
<div class="text-xs font-semibold text-slate-800">Change on values</div>
|
|
55
93
|
</div>
|
|
56
94
|
<div class="flex flex-row gap-2 flex-wrap">
|
|
57
|
-
{#each inputDependencies as label
|
|
95
|
+
{#each inputDependencies as label}
|
|
58
96
|
<span class={classNames(badgeClass, colors['blue'])}>
|
|
59
97
|
{label}
|
|
60
98
|
</span>
|
|
@@ -65,7 +103,7 @@ $: if ($app && $selectedComponent && id) {
|
|
|
65
103
|
|
|
66
104
|
{#if recomputedBadges?.length > 0}
|
|
67
105
|
<div class="w-full">
|
|
68
|
-
<div class="text-xs font-semibold text-slate-800 mb-1">
|
|
106
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Computation of</div>
|
|
69
107
|
<div class="flex flex-row gap-2 flex-wrap">
|
|
70
108
|
{#each recomputedBadges as badge}
|
|
71
109
|
<span class={classNames(badgeClass, colors['indigo'])}>{badge}</span>
|
|
@@ -74,18 +112,38 @@ $: if ($app && $selectedComponent && id) {
|
|
|
74
112
|
</div>
|
|
75
113
|
{/if}
|
|
76
114
|
{/if}
|
|
77
|
-
{#if frontendDependencies}
|
|
115
|
+
{#if frontendDependencies && !doNotRecomputeOnInputChanged}
|
|
78
116
|
<div class="w-full">
|
|
79
|
-
<div class="flex justify-between items-center
|
|
80
|
-
<div class="text-xs font-semibold text-slate-800 mb-1">
|
|
81
|
-
|
|
117
|
+
<div class="flex justify-between items-center">
|
|
118
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Change on values</div>
|
|
119
|
+
{#if inlineScript?.language === 'frontend'}
|
|
120
|
+
<Button
|
|
121
|
+
variant="border"
|
|
122
|
+
size="xs"
|
|
123
|
+
color="light"
|
|
124
|
+
btnClasses="!px-1 !py-0.5"
|
|
125
|
+
on:click={() => {
|
|
126
|
+
addingDependency = true
|
|
127
|
+
$connectingInput = {
|
|
128
|
+
opened: true,
|
|
129
|
+
input: undefined,
|
|
130
|
+
hoveredComponent: undefined
|
|
131
|
+
}
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
<div class="flex flex-row gap-1 items-center">
|
|
135
|
+
Add dependency
|
|
136
|
+
<Plus size={14} />
|
|
137
|
+
</div>
|
|
138
|
+
</Button>
|
|
139
|
+
{/if}
|
|
82
140
|
</div>
|
|
83
141
|
<div class="flex flex-row gap-2 flex-wrap">
|
|
84
142
|
{#each frontendDependencies as label, index}
|
|
85
143
|
<span class={classNames(badgeClass, colors['red'])}>
|
|
86
144
|
{label}
|
|
87
145
|
<button
|
|
88
|
-
on:click={() =>
|
|
146
|
+
on:click={() => deleteDep(index)}
|
|
89
147
|
class="bg-red-300 cursor-pointer hover:bg-red-400 ml-1 rounded-md"
|
|
90
148
|
>
|
|
91
149
|
<X size={18} class="p-0.5" />
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { InlineScript } from '../../../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
inputDependencies?: string[] | undefined;
|
|
5
|
-
|
|
6
|
+
inlineScript: InlineScript | undefined;
|
|
6
7
|
onClick?: boolean | undefined;
|
|
7
8
|
onLoad?: boolean | undefined;
|
|
8
9
|
id?: string | undefined;
|
|
10
|
+
doNotRecomputeOnInputChanged?: boolean | undefined;
|
|
9
11
|
};
|
|
10
12
|
events: {
|
|
11
|
-
delete: CustomEvent<any>;
|
|
12
|
-
} & {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
14
14
|
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
};
|
|
15
|
+
slots: {};
|
|
18
16
|
};
|
|
19
17
|
export type TriggerBadgesListProps = typeof __propDef.props;
|
|
20
18
|
export type TriggerBadgesListEvents = typeof __propDef.events;
|
|
@@ -10,7 +10,7 @@ const columnConfiguration = [
|
|
|
10
10
|
];
|
|
11
11
|
const gridColumns = columnConfiguration.map((value) => value[1]);
|
|
12
12
|
function toggleFixed(component) {
|
|
13
|
-
const nValue = !component[gridColumns[0]]
|
|
13
|
+
const nValue = !(component[gridColumns[0]]?.fixed ?? false);
|
|
14
14
|
gridColumns.forEach((column) => {
|
|
15
15
|
component[column].fixed = nValue;
|
|
16
16
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReadFileAs } from '../common/fileInput/model';
|
|
2
|
-
import type { staticValues } from './editor/componentsPanel/componentStaticValues';
|
|
3
2
|
import type { InlineScript } from './types';
|
|
4
|
-
export type InputType = 'text' | 'textarea' | 'template' | 'number' | 'boolean' | 'select' | 'icon-select' | 'color' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any' | 'labeledresource';
|
|
3
|
+
export type InputType = 'text' | 'textarea' | 'template' | 'number' | 'boolean' | 'select' | 'icon-select' | 'color' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any' | 'labeledresource' | 'tab-select';
|
|
5
4
|
export type InputConnection = {
|
|
6
5
|
componentId: string;
|
|
7
6
|
path: string;
|
|
@@ -40,7 +39,7 @@ export type RunnableByPath = {
|
|
|
40
39
|
runType: 'script' | 'flow' | 'hubscript';
|
|
41
40
|
type: 'runnableByPath';
|
|
42
41
|
};
|
|
43
|
-
type RunnableByName = {
|
|
42
|
+
export type RunnableByName = {
|
|
44
43
|
name: string;
|
|
45
44
|
inlineScript: InlineScript | undefined;
|
|
46
45
|
type: 'runnableByName';
|
|
@@ -48,9 +47,13 @@ type RunnableByName = {
|
|
|
48
47
|
export type Runnable = RunnableByPath | RunnableByName | undefined;
|
|
49
48
|
export type ResultInput = {
|
|
50
49
|
runnable: Runnable;
|
|
50
|
+
transformer?: InlineScript & {
|
|
51
|
+
language: 'frontend';
|
|
52
|
+
};
|
|
51
53
|
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
52
54
|
type: 'runnable';
|
|
53
55
|
value?: any;
|
|
56
|
+
doNotRecomputeOnInputChanged?: boolean;
|
|
54
57
|
};
|
|
55
58
|
type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | RowInput | EvalInput | UploadInput | ResultInput | TemplateInput) & InputConfiguration<T, V>;
|
|
56
59
|
type InputConfiguration<T extends InputType, V extends InputType> = {
|
|
@@ -72,20 +75,13 @@ type InputConfiguration<T extends InputType, V extends InputType> = {
|
|
|
72
75
|
convertTo?: ReadFileAs;
|
|
73
76
|
};
|
|
74
77
|
};
|
|
75
|
-
type StaticOptions = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
export type StaticOptions = {
|
|
79
|
+
selectOptions: readonly string[] | readonly {
|
|
80
|
+
value: string;
|
|
81
|
+
label: string;
|
|
82
|
+
}[];
|
|
80
83
|
};
|
|
81
|
-
export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'template', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | AppInputSpec<'object', string> | (AppInputSpec<'select', string> &
|
|
82
|
-
/**
|
|
83
|
-
* One of the keys of `staticValues` from `lib/components/apps/editor/componentsPanel/componentStaticValues`
|
|
84
|
-
*/
|
|
85
|
-
optionValuesKey: keyof typeof staticValues;
|
|
86
|
-
}) | (AppInputSpec<'select', string> & StaticOptions) | AppInputSpec<'icon-select', string> | AppInputSpec<'color', string> | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & {
|
|
87
|
-
optionValuesKey: keyof typeof staticValues;
|
|
88
|
-
}) | (AppInputSpec<'array', string[], 'select'> & StaticOptions) | AppInputSpec<'array', object[], 'labeledresource'> | AppInputSpec<'labeledresource', object>;
|
|
84
|
+
export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'template', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | AppInputSpec<'object', string> | (AppInputSpec<'select', string> & StaticOptions) | AppInputSpec<'icon-select', string> | AppInputSpec<'color', string> | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & StaticOptions) | AppInputSpec<'array', object[], 'labeledresource'> | AppInputSpec<'labeledresource', object> | AppInputSpec<'array', object[], 'tab-select'>;
|
|
89
85
|
export type RowAppInput = Extract<AppInput, {
|
|
90
86
|
type: 'row';
|
|
91
87
|
}>;
|