windmill-components 1.56.2 → 1.57.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/assets/app.css +5 -1
- package/components/ArgInput.svelte +6 -6
- package/components/CenteredModal.svelte +15 -14
- package/components/CenteredModal.svelte.d.ts +1 -0
- package/components/DisplayResult.svelte +1 -1
- package/components/Dropdown.svelte +4 -3
- package/components/Dropdown.svelte.d.ts +2 -0
- package/components/Editor.svelte +6 -4
- package/components/Editor.svelte.d.ts +2 -0
- package/components/EditorBar.svelte +15 -1
- package/components/FlowBuilder.svelte +18 -10
- package/components/FlowPreviewContent.svelte +1 -1
- package/components/GroupEditor.svelte +1 -0
- package/components/IconedResourceType.svelte +2 -2
- package/components/InputTransformForm.svelte +50 -40
- package/components/InputTransformForm.svelte.d.ts +1 -0
- package/components/ItemPicker.svelte +63 -57
- package/components/ItemPicker.svelte.d.ts +1 -2
- package/components/LogViewer.svelte +6 -5
- package/components/ModulePreview.svelte +20 -22
- package/components/MoveDrawer.svelte +40 -16
- package/components/MoveDrawer.svelte.d.ts +2 -2
- package/components/PageHeader.svelte +1 -1
- package/components/Path.svelte +5 -2
- package/components/Popover.svelte +14 -20
- package/components/Popover.svelte.d.ts +5 -0
- package/components/RadioButton.svelte +5 -3
- package/components/RadioButton.svelte.d.ts +2 -0
- package/components/ResourceEditor.svelte +2 -1
- package/components/ResourcePicker.svelte +1 -0
- package/components/RunChart.svelte +0 -1
- package/components/SchemaEditor.svelte +3 -0
- package/components/SchemaForm.svelte +86 -77
- package/components/SchemaForm.svelte.d.ts +4 -0
- package/components/ScriptBuilder.svelte +2 -1
- package/components/ScriptEditor.svelte +88 -77
- package/components/ShareModal.svelte.d.ts +2 -2
- package/components/SimpleEditor.svelte +17 -0
- package/components/Star.svelte +15 -9
- package/components/StringTypeNarrowing.svelte +30 -8
- package/components/TemplateEditor.svelte +21 -11
- package/components/TestJobLoader.svelte +94 -68
- package/components/TestJobLoader.svelte.d.ts +10 -8
- package/components/Toggle.svelte +30 -7
- package/components/Toggle.svelte.d.ts +4 -0
- package/components/Tooltip.svelte +1 -1
- package/components/VariableEditor.svelte +4 -3
- package/components/VariableEditor.svelte.d.ts +2 -2
- package/components/apps/components/DisplayComponent.svelte +1 -1
- package/components/apps/components/buttons/AppButton.svelte +16 -10
- package/components/apps/components/buttons/AppButton.svelte.d.ts +1 -0
- package/components/apps/components/dataDisplay/AppBarChart.svelte +17 -8
- package/components/apps/components/dataDisplay/AppHtml.svelte +23 -0
- package/components/apps/components/dataDisplay/AppHtml.svelte.d.ts +23 -0
- package/components/apps/components/dataDisplay/AppPieChart.svelte +11 -7
- package/components/apps/components/dataDisplay/AppScatterChart.svelte +46 -0
- package/components/apps/components/dataDisplay/AppScatterChart.svelte.d.ts +21 -0
- package/components/apps/components/dataDisplay/AppText.svelte +44 -7
- package/components/apps/components/dataDisplay/AppText.svelte.d.ts +1 -0
- package/components/apps/components/dataDisplay/AppTimeseries.svelte +57 -0
- package/components/apps/components/dataDisplay/AppTimeseries.svelte.d.ts +22 -0
- package/components/apps/components/form/AppForm.svelte +35 -18
- package/components/apps/components/helpers/AlignWrapper.svelte +2 -1
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +1 -0
- package/components/apps/components/helpers/InputValue.svelte +20 -14
- package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte +7 -6
- package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +1 -1
- package/components/apps/components/helpers/RefreshButton.svelte +16 -11
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +2 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +119 -102
- package/components/apps/components/helpers/RunnableWrapper.svelte +6 -1
- package/components/apps/components/selectInputs/AppCheckbox.svelte +4 -0
- package/components/apps/components/selectInputs/AppSelect.svelte +2 -0
- package/components/apps/components/table/AppTable.svelte +64 -35
- package/components/apps/components/table/AppTableFooter.svelte +2 -1
- package/components/apps/components/table/tableOptions.d.ts +2 -9
- package/components/apps/components/table/tableOptions.js +5 -2
- package/components/apps/components/textInputs/AppTextInput.svelte +7 -4
- package/components/apps/editor/AppEditor.svelte +136 -65
- package/components/apps/editor/AppEditor.svelte.d.ts +3 -0
- package/components/apps/editor/AppEditorHeader.svelte +349 -51
- package/components/apps/editor/AppEditorHeader.svelte.d.ts +2 -4
- package/components/apps/editor/AppExportButton.svelte +34 -0
- package/components/apps/editor/AppExportButton.svelte.d.ts +17 -0
- package/components/apps/editor/AppPreview.svelte +20 -7
- package/components/apps/editor/AppPreview.svelte.d.ts +6 -0
- package/components/apps/editor/AppPublishButton.svelte +53 -0
- package/components/apps/editor/AppPublishButton.svelte.d.ts +18 -0
- package/components/apps/editor/ComponentEditor.svelte +39 -8
- package/components/apps/editor/ComponentEditor.svelte.d.ts +1 -0
- package/components/apps/editor/ComponentHeader.svelte +38 -29
- package/components/apps/editor/ComponentHeader.svelte.d.ts +3 -1
- package/components/apps/editor/GridEditor.svelte +105 -67
- package/components/apps/editor/GridEditor.svelte.d.ts +6 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +80 -19
- package/components/apps/editor/SettingsPanel.svelte +2 -2
- package/components/apps/editor/TablePanel.svelte +1 -0
- package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -39
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +2 -1
- package/components/apps/editor/componentsPanel/componentStaticValues.js +3 -2
- package/components/apps/editor/componentsPanel/data.js +201 -91
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +1 -0
- package/components/apps/editor/contextPanel/ContextPanel.svelte +69 -47
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +6 -2
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +56 -20
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +5 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +2 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +72 -23
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +30 -22
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +78 -77
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +38 -33
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +4 -4
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +1 -11
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +27 -9
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +19 -24
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +12 -5
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +2 -3
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +59 -33
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +5 -2
- package/components/apps/editor/settingsPanel/Recompute.svelte +2 -2
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +21 -3
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +1 -3
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/TableActions.svelte +27 -18
- package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +10 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +3 -0
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +6 -4
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +24 -0
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte +6 -0
- package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +11 -21
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +1 -2
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +42 -13
- package/components/apps/editorUtils.d.ts +1 -0
- package/components/apps/editorUtils.js +11 -0
- package/components/apps/gridUtils.js +2 -1
- package/components/apps/inputType.d.ts +12 -6
- package/components/apps/rx.d.ts +3 -3
- package/components/apps/rx.js +9 -4
- package/components/apps/store.d.ts +2 -0
- package/components/apps/store.js +2 -0
- package/components/apps/types.d.ts +20 -4
- package/components/apps/utils.d.ts +2 -2
- package/components/apps/utils.js +25 -9
- package/components/common/button/Button.svelte +8 -8
- package/components/common/button/Button.svelte.d.ts +2 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte +1 -0
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +4 -1
- package/components/common/popup/Popup.svelte +1 -1
- package/components/common/table/AppRow.svelte +31 -4
- package/components/common/table/AppRow.svelte.d.ts +4 -0
- package/components/common/table/FlowRow.svelte +9 -5
- package/components/common/table/Row.svelte +10 -8
- package/components/common/table/ScriptRow.svelte +15 -13
- package/components/common/tabs/Tabs.svelte +1 -1
- package/components/common/toggleButton/ToggleButton.svelte +2 -0
- package/components/common/toggleButton/ToggleButton.svelte.d.ts +1 -0
- package/components/flows/CreateActionsApp.svelte +43 -0
- package/components/flows/CreateActionsApp.svelte.d.ts +14 -0
- package/components/flows/CreateActionsFlow.svelte +6 -1
- package/components/flows/content/DynamicInputHelpBox.svelte +1 -1
- package/components/flows/content/FlowConstants.svelte +82 -0
- package/components/flows/content/FlowConstants.svelte.d.ts +14 -0
- package/components/flows/content/FlowEditorPanel.svelte +3 -0
- package/components/flows/content/FlowInputs.svelte +2 -2
- package/components/flows/content/FlowModuleComponent.svelte +4 -1
- package/components/flows/content/FlowModuleHeader.svelte +41 -89
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +2 -2
- package/components/flows/content/FlowSettings.svelte +1 -1
- package/components/flows/flowStore.d.ts +1 -1
- package/components/flows/flowStore.js +8 -8
- package/components/flows/header/FlowImportExportMenu.svelte +1 -1
- package/components/flows/header/FlowPreviewButtons.svelte +2 -1
- package/components/flows/map/FlowConstantsItem.svelte +13 -0
- package/components/flows/map/FlowConstantsItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowInputsItem.svelte +1 -2
- package/components/flows/map/FlowModuleSchemaItem.svelte +34 -25
- package/components/flows/map/FlowModuleSchemaMap.svelte +9 -3
- package/components/flows/map/FlowSettingsItem.svelte +6 -8
- package/components/flows/pickers/PickHubScript.svelte +1 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte +42 -31
- package/components/home/ItemsList.svelte +6 -4
- package/components/icons/ClickhouseIcon.svelte +22 -0
- package/components/icons/ClickhouseIcon.svelte.d.ts +17 -0
- package/components/icons/FaunadbIcon.svelte +19 -0
- package/components/icons/FaunadbIcon.svelte.d.ts +17 -0
- package/components/icons/OpenaiIcon.svelte +18 -0
- package/components/icons/OpenaiIcon.svelte.d.ts +17 -0
- package/components/icons/index.d.ts +7 -1
- package/components/icons/index.js +8 -2
- package/components/propertyPicker/ObjectViewer.svelte +11 -4
- package/components/propertyPicker/PropPicker.svelte +1 -1
- package/components/scriptEditor/LogPanel.svelte +26 -22
- package/components/sidebar/FavoriteMenu.svelte +23 -19
- package/components/sidebar/SidebarContent.svelte +16 -16
- package/components/sidebar/WorkspaceMenu.svelte +18 -17
- package/components/splitPanes/SplitPanesWrapper.svelte +1 -5
- package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +0 -1
- package/editorUtils.js +2 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/models/Policy.d.ts +1 -0
- package/gen/services/AppService.d.ts +18 -0
- package/gen/services/AppService.js +30 -0
- package/gen/services/GranularAclService.d.ts +3 -3
- package/gen/services/ResourceService.d.ts +15 -0
- package/gen/services/ResourceService.js +17 -0
- package/infer.js +4 -0
- package/logout.d.ts +1 -0
- package/logout.js +5 -3
- package/package.json +502 -489
- package/stores.d.ts +1 -0
- package/stores.js +13 -5
- package/utils.d.ts +1 -1
- package/utils.js +17 -10
- package/components/apps/CreateApp.svelte +0 -68
- package/components/apps/CreateApp.svelte.d.ts +0 -14
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { faPlus, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { staticValues } from '../componentsPanel/componentStaticValues';
|
|
4
4
|
import SubTypeEditor from './SubTypeEditor.svelte';
|
|
5
|
-
export let canHide = false;
|
|
6
5
|
export let componentInput;
|
|
7
6
|
function addElementByType() {
|
|
8
7
|
if (componentInput.subFieldType && componentInput.value) {
|
|
@@ -40,16 +39,17 @@ function deleteElementByType(index) {
|
|
|
40
39
|
<div class="flex gap-2 flex-col mt-2">
|
|
41
40
|
{#if componentInput.value}
|
|
42
41
|
{#each componentInput.value as value, index (index)}
|
|
43
|
-
<div class="flex flex-row gap-2 items-center">
|
|
44
|
-
<SubTypeEditor bind:componentInput bind:value
|
|
42
|
+
<div class="flex flex-row gap-2 items-center relative">
|
|
43
|
+
<SubTypeEditor bind:componentInput bind:value />
|
|
45
44
|
|
|
46
|
-
<div>
|
|
45
|
+
<div class="absolute top-4 right-4">
|
|
47
46
|
<Button
|
|
48
47
|
size="xs"
|
|
49
48
|
color="light"
|
|
50
49
|
variant="border"
|
|
51
50
|
on:click={() => deleteElementByType(index)}
|
|
52
51
|
iconOnly
|
|
52
|
+
btnClasses="!text-red-500"
|
|
53
53
|
startIcon={{ icon: faTrashAlt }}
|
|
54
54
|
/>
|
|
55
55
|
</div>
|
|
@@ -1,54 +1,44 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
canHide?: boolean | undefined;
|
|
5
4
|
componentInput: (import("../../inputType").StaticInput<string[]> & {
|
|
6
5
|
fieldType: "array";
|
|
7
|
-
defaultValue: string[];
|
|
8
6
|
subFieldType?: "text" | undefined;
|
|
9
7
|
format?: string | undefined;
|
|
10
8
|
}) | (import("../../inputType").StaticInput<string[]> & {
|
|
11
9
|
fieldType: "array";
|
|
12
|
-
defaultValue: string[];
|
|
13
10
|
subFieldType?: "textarea" | undefined;
|
|
14
11
|
format?: string | undefined;
|
|
15
12
|
}) | (import("../../inputType").StaticInput<number[]> & {
|
|
16
13
|
fieldType: "array";
|
|
17
|
-
defaultValue: number[];
|
|
18
14
|
subFieldType?: "number" | undefined;
|
|
19
15
|
format?: string | undefined;
|
|
20
16
|
}) | (import("../../inputType").StaticInput<boolean[]> & {
|
|
21
17
|
fieldType: "array";
|
|
22
|
-
defaultValue: boolean[];
|
|
23
18
|
subFieldType?: "boolean" | undefined;
|
|
24
19
|
format?: string | undefined;
|
|
25
20
|
}) | (import("../../inputType").StaticInput<string[]> & {
|
|
26
21
|
fieldType: "array";
|
|
27
|
-
defaultValue: string[];
|
|
28
22
|
subFieldType?: "date" | undefined;
|
|
29
23
|
format?: string | undefined;
|
|
30
24
|
}) | (import("../../inputType").StaticInput<string[]> & {
|
|
31
25
|
fieldType: "array";
|
|
32
|
-
defaultValue: string[];
|
|
33
26
|
subFieldType?: "time" | undefined;
|
|
34
27
|
format?: string | undefined;
|
|
35
28
|
}) | (import("../../inputType").StaticInput<string[]> & {
|
|
36
29
|
fieldType: "array";
|
|
37
|
-
defaultValue: string[];
|
|
38
30
|
subFieldType?: "datetime" | undefined;
|
|
39
31
|
format?: string | undefined;
|
|
40
32
|
}) | (import("../../inputType").StaticInput<object[]> & {
|
|
41
33
|
fieldType: "array";
|
|
42
|
-
defaultValue: object[];
|
|
43
34
|
subFieldType?: "object" | undefined;
|
|
44
35
|
format?: string | undefined;
|
|
45
36
|
}) | (import("../../inputType").StaticInput<string[]> & {
|
|
46
37
|
fieldType: "array";
|
|
47
|
-
defaultValue: string[];
|
|
48
38
|
subFieldType?: "select" | undefined;
|
|
49
39
|
format?: string | undefined;
|
|
50
40
|
} & {
|
|
51
|
-
optionValuesKey: "buttonColorOptions" | "buttonSizeOptions" | "tableSearchOptions" | "chartThemeOptions";
|
|
41
|
+
optionValuesKey: "buttonColorOptions" | "buttonSizeOptions" | "tableSearchOptions" | "chartThemeOptions" | "textStyleOptions";
|
|
52
42
|
});
|
|
53
43
|
};
|
|
54
44
|
events: {
|
|
@@ -1,43 +1,61 @@
|
|
|
1
1
|
<script>import { ToggleButton, ToggleButtonGroup } from '../../../common';
|
|
2
2
|
import { faArrowRight, faCode, faPen } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { getContext } from 'svelte';
|
|
3
4
|
export let componentInput;
|
|
4
5
|
export let disableStatic = false;
|
|
5
|
-
|
|
6
|
+
const { onchange } = getContext('AppEditorContext');
|
|
7
|
+
$: if (componentInput.fieldType == 'template' && componentInput.type == 'static') {
|
|
6
8
|
//@ts-ignore
|
|
7
9
|
componentInput.type = 'template';
|
|
10
|
+
componentInput['eval'] = componentInput.value;
|
|
8
11
|
}
|
|
9
12
|
const brackets = '${}';
|
|
13
|
+
let clientWidth;
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
{#if componentInput.fieldType !== 'any'}
|
|
13
|
-
<div class="w-full">
|
|
14
|
-
<ToggleButtonGroup bind:selected={componentInput.type}>
|
|
15
|
-
{#if componentInput.fieldType === '
|
|
17
|
+
<div class="w-full overflow-x-auto" bind:clientWidth>
|
|
18
|
+
<ToggleButtonGroup on:selected={() => onchange?.()} bind:selected={componentInput.type}>
|
|
19
|
+
{#if componentInput.fieldType === 'template'}
|
|
16
20
|
<ToggleButton position="left" value="template" size="xs" disable={disableStatic}>
|
|
17
|
-
{brackets}
|
|
21
|
+
{brackets} <span class="hidden lg:block">Template</span>
|
|
18
22
|
</ToggleButton>
|
|
19
23
|
{:else}
|
|
20
24
|
<ToggleButton
|
|
25
|
+
title="Static"
|
|
21
26
|
position="left"
|
|
22
27
|
value="static"
|
|
23
28
|
startIcon={{ icon: faPen }}
|
|
24
29
|
size="xs"
|
|
25
30
|
disable={disableStatic}
|
|
26
31
|
>
|
|
27
|
-
|
|
32
|
+
{#if clientWidth > 250}
|
|
33
|
+
<span class="hidden lg:block">Static</span>
|
|
34
|
+
{/if}
|
|
28
35
|
</ToggleButton>
|
|
29
36
|
{/if}
|
|
30
37
|
|
|
31
38
|
<ToggleButton
|
|
39
|
+
title="Connect"
|
|
32
40
|
value="connected"
|
|
33
41
|
position="center"
|
|
34
42
|
startIcon={{ icon: faArrowRight }}
|
|
35
43
|
size="xs"
|
|
36
44
|
>
|
|
37
|
-
|
|
45
|
+
{#if clientWidth > 250}
|
|
46
|
+
<span class="hidden lg:block">Connect</span>
|
|
47
|
+
{/if}
|
|
38
48
|
</ToggleButton>
|
|
39
|
-
<ToggleButton
|
|
40
|
-
|
|
49
|
+
<ToggleButton
|
|
50
|
+
title="Compute"
|
|
51
|
+
position="right"
|
|
52
|
+
value="runnable"
|
|
53
|
+
startIcon={{ icon: faCode }}
|
|
54
|
+
size="xs"
|
|
55
|
+
>
|
|
56
|
+
{#if clientWidth > 250}
|
|
57
|
+
<span class="hidden lg:block">Compute</span>
|
|
58
|
+
{/if}
|
|
41
59
|
</ToggleButton>
|
|
42
60
|
</ToggleButtonGroup>
|
|
43
61
|
</div>
|
|
@@ -15,11 +15,12 @@ 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 { Alert } from '../../../common';
|
|
19
18
|
export let component;
|
|
20
19
|
export let onDelete = undefined;
|
|
21
|
-
|
|
20
|
+
export let rowColumns = false;
|
|
21
|
+
const { app, staticOutputs, runnableComponents, selectedComponent, worldStore } = getContext('AppEditorContext');
|
|
22
22
|
function removeGridElement() {
|
|
23
|
+
$selectedComponent = undefined;
|
|
23
24
|
if (onDelete && component) {
|
|
24
25
|
delete $staticOutputs[component.id];
|
|
25
26
|
$staticOutputs = $staticOutputs;
|
|
@@ -71,12 +72,21 @@ $: extraLib =
|
|
|
71
72
|
</script>
|
|
72
73
|
|
|
73
74
|
{#if component}
|
|
74
|
-
<div class="flex flex-col w-full divide-y">
|
|
75
|
+
<div class="flex flex-col min-w-[150px] w-full divide-y">
|
|
75
76
|
{#if component.componentInput}
|
|
76
77
|
<PanelSection
|
|
77
|
-
|
|
78
|
+
smallPadding
|
|
79
|
+
title={component.componentInput.fieldType === 'any' ? 'By Runnable' : 'Input'}
|
|
78
80
|
>
|
|
79
81
|
<svelte:fragment slot="action">
|
|
82
|
+
<span
|
|
83
|
+
class={classNames(
|
|
84
|
+
'text-white px-2 text-2xs py-0.5 font-bold rounded-sm w-fit',
|
|
85
|
+
'bg-indigo-500'
|
|
86
|
+
)}
|
|
87
|
+
>
|
|
88
|
+
{`${component.id}`}
|
|
89
|
+
</span>
|
|
80
90
|
{#if component.componentInput.fieldType !== 'any'}
|
|
81
91
|
<Badge color="blue">
|
|
82
92
|
{component.componentInput.fieldType === 'array' &&
|
|
@@ -86,31 +96,15 @@ $: extraLib =
|
|
|
86
96
|
</Badge>
|
|
87
97
|
{/if}
|
|
88
98
|
</svelte:fragment>
|
|
89
|
-
<span
|
|
90
|
-
class={classNames(
|
|
91
|
-
'text-white px-2 text-2xs py-0.5 font-bold rounded-sm w-fit',
|
|
92
|
-
'bg-indigo-500'
|
|
93
|
-
)}
|
|
94
|
-
>
|
|
95
|
-
{`Selected component: ${component.id}`}
|
|
96
|
-
</span>
|
|
97
99
|
|
|
98
100
|
<ComponentInputTypeEditor bind:componentInput={component.componentInput} />
|
|
99
101
|
|
|
100
|
-
{#if onDelete}
|
|
101
|
-
<div class="w-full">
|
|
102
|
-
<Alert title="Special arguments" size="xs">
|
|
103
|
-
The row and the rowIndex are passed as arguments to the runnable.
|
|
104
|
-
</Alert>
|
|
105
|
-
</div>
|
|
106
|
-
{/if}
|
|
107
|
-
|
|
108
102
|
<div class="flex flex-col w-full gap-2 my-2">
|
|
109
103
|
{#if component.componentInput.type === 'static'}
|
|
110
104
|
<StaticInputEditor bind:componentInput={component.componentInput} />
|
|
111
105
|
{:else if component.componentInput.type === 'template' && component.componentInput !== undefined}
|
|
112
|
-
<div class="py-1 rounded border border-1 border-gray-500">
|
|
113
|
-
<TemplateEditor bind:code={component.componentInput.eval} {extraLib} />
|
|
106
|
+
<div class="py-1 min-h-[28px] rounded border border-1 border-gray-500">
|
|
107
|
+
<TemplateEditor fontSize={12} bind:code={component.componentInput.eval} {extraLib} />
|
|
114
108
|
</div>
|
|
115
109
|
{:else if component.componentInput.type === 'connected' && component.componentInput !== undefined}
|
|
116
110
|
<ConnectedInputEditor bind:componentInput={component.componentInput} />
|
|
@@ -122,7 +116,7 @@ $: extraLib =
|
|
|
122
116
|
<div class="border w-full">
|
|
123
117
|
<PanelSection
|
|
124
118
|
smallPadding
|
|
125
|
-
title={`Runnable
|
|
119
|
+
title={`Runnable Inputs (${
|
|
126
120
|
Object.keys(component.componentInput.fields ?? {}).length
|
|
127
121
|
})`}
|
|
128
122
|
>
|
|
@@ -137,6 +131,7 @@ $: extraLib =
|
|
|
137
131
|
shouldCapitalize={false}
|
|
138
132
|
bind:inputSpecs={component.componentInput.fields}
|
|
139
133
|
userInputEnabled={component.type !== 'buttoncomponent'}
|
|
134
|
+
{rowColumns}
|
|
140
135
|
/>
|
|
141
136
|
</PanelSection>
|
|
142
137
|
</div>
|
|
@@ -151,7 +146,7 @@ $: extraLib =
|
|
|
151
146
|
{/if}
|
|
152
147
|
|
|
153
148
|
{#if component.type === 'tablecomponent' && Array.isArray(component.actionButtons)}
|
|
154
|
-
<TableActions bind:components={component.actionButtons} />
|
|
149
|
+
<TableActions id={component.id} bind:components={component.actionButtons} />
|
|
155
150
|
{/if}
|
|
156
151
|
|
|
157
152
|
<AlignmentEditor bind:component />
|
|
@@ -5,6 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
props: {
|
|
6
6
|
component: AppComponent | undefined;
|
|
7
7
|
onDelete?: (() => void) | undefined;
|
|
8
|
+
rowColumns?: boolean | undefined;
|
|
8
9
|
buildExtraLib?: ((components: Record<string, Record<string, Output<any>>>) => string) | undefined;
|
|
9
10
|
};
|
|
10
11
|
events: {
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import Toggle from '../../../Toggle.svelte';
|
|
2
|
+
import ConnectedInputEditor from './inputEditor/ConnectedInputEditor.svelte';
|
|
3
|
+
import RowInputEditor from './inputEditor/RowInputEditor.svelte';
|
|
2
4
|
import StaticInputEditor from './inputEditor/StaticInputEditor.svelte';
|
|
3
5
|
export let componentInput;
|
|
4
|
-
export let canHide = false;
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
|
-
{#if componentInput.type === '
|
|
8
|
-
<StaticInputEditor bind:componentInput {canHide} />
|
|
9
|
-
{:else if componentInput.type === 'connected'}
|
|
8
|
+
{#if componentInput.type === 'connected'}
|
|
10
9
|
<ConnectedInputEditor bind:componentInput />
|
|
10
|
+
{:else if componentInput.type === 'row'}
|
|
11
|
+
<RowInputEditor bind:componentInput />
|
|
12
|
+
{:else if componentInput.type === 'static'}
|
|
13
|
+
<StaticInputEditor bind:componentInput />
|
|
14
|
+
{:else if componentInput.type === 'user'}
|
|
15
|
+
<span class="text-2xs italic text-gray-6f00"
|
|
16
|
+
>Field's value is set by the user in the visible field</span
|
|
17
|
+
>
|
|
11
18
|
{/if}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { ConnectedAppInput, StaticAppInput, UserAppInput } from '../../inputType';
|
|
2
|
+
import type { ConnectedAppInput, RowAppInput, StaticAppInput, UserAppInput } from '../../inputType';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
componentInput: StaticAppInput | ConnectedAppInput | UserAppInput;
|
|
6
|
-
canHide?: boolean | undefined;
|
|
5
|
+
componentInput: StaticAppInput | ConnectedAppInput | UserAppInput | RowAppInput;
|
|
7
6
|
};
|
|
8
7
|
events: {
|
|
9
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,68 +1,94 @@
|
|
|
1
1
|
<script>import { Badge, ToggleButton, ToggleButtonGroup } from '../../../common';
|
|
2
2
|
import { capitalize } from '../../../../utils';
|
|
3
|
-
import { faArrowRight, faPen, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { faArrowRight, faPen, faTableCells, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { fieldTypeToTsType } from '../../utils';
|
|
5
5
|
import InputsSpecEditor from './InputsSpecEditor.svelte';
|
|
6
|
+
import { getContext } from 'svelte';
|
|
6
7
|
export let inputSpecs;
|
|
7
8
|
export let userInputEnabled = true;
|
|
8
9
|
export let staticOnly = false;
|
|
9
10
|
export let shouldCapitalize = true;
|
|
11
|
+
export let rowColumns = false;
|
|
12
|
+
const { connectingInput } = getContext('AppEditorContext');
|
|
10
13
|
</script>
|
|
11
14
|
|
|
12
15
|
{#if inputSpecs}
|
|
13
16
|
<div class="w-full flex flex-col gap-4">
|
|
14
|
-
{#each Object.keys(inputSpecs) as inputSpecKey
|
|
17
|
+
{#each Object.keys(inputSpecs) as inputSpecKey (inputSpecKey)}
|
|
15
18
|
{@const input = inputSpecs[inputSpecKey]}
|
|
16
|
-
|
|
17
|
-
<div class="flex
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</span>
|
|
19
|
+
<div class="flex flex-col gap-1">
|
|
20
|
+
<div class="flex justify-between items-end gap-1">
|
|
21
|
+
<span class="text-sm font-semibold truncate">
|
|
22
|
+
{shouldCapitalize ? capitalize(inputSpecKey) : inputSpecKey}
|
|
23
|
+
</span>
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
<div class="flex gap-2 flex-wrap items-center">
|
|
26
|
+
<Badge color="blue">
|
|
27
|
+
{input.fieldType === 'array' && input.subFieldType
|
|
28
|
+
? `${capitalize(fieldTypeToTsType(input.subFieldType))}[]`
|
|
29
|
+
: capitalize(fieldTypeToTsType(input.fieldType))}
|
|
30
|
+
</Badge>
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
{#if !inputSpecs[inputSpecKey].onlyStatic}
|
|
33
|
+
<ToggleButtonGroup
|
|
34
|
+
bind:selected={inputSpecs[inputSpecKey].type}
|
|
35
|
+
on:selected={(e) => {
|
|
36
|
+
console.log(inputSpecs[inputSpecKey])
|
|
37
|
+
if (e.detail == 'connected' && !inputSpecs[inputSpecKey]['connection']) {
|
|
38
|
+
$connectingInput = {
|
|
39
|
+
opened: true,
|
|
40
|
+
input: undefined,
|
|
41
|
+
hoveredComponent: undefined
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
31
46
|
<ToggleButton
|
|
47
|
+
title="Static"
|
|
32
48
|
position="left"
|
|
33
49
|
value="static"
|
|
34
50
|
startIcon={{ icon: faPen }}
|
|
35
51
|
size="xs"
|
|
36
52
|
iconOnly
|
|
37
53
|
/>
|
|
38
|
-
|
|
39
|
-
position={userInputEnabled && input.format === undefined ? 'center' : 'right'}
|
|
40
|
-
value="connected"
|
|
41
|
-
startIcon={{ icon: faArrowRight }}
|
|
42
|
-
size="xs"
|
|
43
|
-
iconOnly
|
|
44
|
-
disabled={staticOnly}
|
|
45
|
-
/>
|
|
46
|
-
{#if userInputEnabled && input.format === undefined}
|
|
54
|
+
{#if rowColumns}
|
|
47
55
|
<ToggleButton
|
|
48
|
-
|
|
56
|
+
title="From Row"
|
|
57
|
+
position="center"
|
|
58
|
+
value="row"
|
|
59
|
+
startIcon={{ icon: faTableCells }}
|
|
60
|
+
size="xs"
|
|
61
|
+
iconOnly
|
|
62
|
+
disabled={staticOnly}
|
|
63
|
+
/>
|
|
64
|
+
{/if}
|
|
65
|
+
{#if userInputEnabled && (!input.format?.startsWith('resource-') || true)}
|
|
66
|
+
<ToggleButton
|
|
67
|
+
title="User Input"
|
|
68
|
+
position="center"
|
|
49
69
|
value="user"
|
|
50
70
|
startIcon={{ icon: faUser }}
|
|
51
71
|
size="xs"
|
|
52
72
|
iconOnly
|
|
53
|
-
disabled={staticOnly
|
|
73
|
+
disabled={staticOnly}
|
|
54
74
|
/>
|
|
55
75
|
{/if}
|
|
76
|
+
<ToggleButton
|
|
77
|
+
title="Connect"
|
|
78
|
+
position="right"
|
|
79
|
+
value="connected"
|
|
80
|
+
startIcon={{ icon: faArrowRight }}
|
|
81
|
+
size="xs"
|
|
82
|
+
iconOnly
|
|
83
|
+
disabled={staticOnly}
|
|
84
|
+
/>
|
|
56
85
|
</ToggleButtonGroup>
|
|
57
|
-
|
|
86
|
+
{/if}
|
|
58
87
|
</div>
|
|
59
|
-
|
|
60
|
-
<InputsSpecEditor
|
|
61
|
-
bind:componentInput={inputSpecs[inputSpecKey]}
|
|
62
|
-
canHide={userInputEnabled && input.format === undefined}
|
|
63
|
-
/>
|
|
64
88
|
</div>
|
|
65
|
-
|
|
89
|
+
|
|
90
|
+
<InputsSpecEditor bind:componentInput={inputSpecs[inputSpecKey]} />
|
|
91
|
+
</div>
|
|
66
92
|
{/each}
|
|
67
93
|
</div>
|
|
68
94
|
{:else}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { ConnectedAppInput, StaticAppInput, UserAppInput } from '../../inputType';
|
|
2
|
+
import type { ConnectedAppInput, RowAppInput, StaticAppInput, UserAppInput } from '../../inputType';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
inputSpecs: Record<string, StaticAppInput | ConnectedAppInput | UserAppInput
|
|
5
|
+
inputSpecs: Record<string, (StaticAppInput | ConnectedAppInput | UserAppInput | RowAppInput) & {
|
|
6
|
+
onlyStatic?: boolean;
|
|
7
|
+
}>;
|
|
6
8
|
userInputEnabled?: boolean | undefined;
|
|
7
9
|
staticOnly?: boolean | undefined;
|
|
8
10
|
shouldCapitalize?: boolean | undefined;
|
|
11
|
+
rowColumns?: boolean | undefined;
|
|
9
12
|
};
|
|
10
13
|
events: {
|
|
11
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -14,7 +14,7 @@ function onChange(event, id) {
|
|
|
14
14
|
}
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
<PanelSection title="Recompute">
|
|
17
|
+
<PanelSection title="Recompute after this compute">
|
|
18
18
|
{#if Object.keys($runnableComponents ?? {}).filter((id) => id !== ownId).length > 0}
|
|
19
19
|
<table class="divide-y divide-gray-300 border w-full">
|
|
20
20
|
<thead class="bg-gray-50">
|
|
@@ -31,7 +31,7 @@ function onChange(event, id) {
|
|
|
31
31
|
{#each Object.keys($runnableComponents ?? {}).filter((id) => id !== ownId) as id}
|
|
32
32
|
<tr>
|
|
33
33
|
<td class="whitespace-nowrap px-4 py-2 text-xs">
|
|
34
|
-
<Badge color="
|
|
34
|
+
<Badge color="dark-indigo">{id}</Badge>
|
|
35
35
|
</td>
|
|
36
36
|
<td class="relative whitespace-nowrap px-4 py-2 ">
|
|
37
37
|
<input
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
|
+
import Tooltip from '../../../Tooltip.svelte';
|
|
2
3
|
import { faClose, faEdit } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { getContext } from 'svelte';
|
|
3
5
|
import { clearResultAppInput } from '../../utils';
|
|
4
6
|
import InlineScriptEditorDrawer from '../inlineScriptsPanel/InlineScriptEditorDrawer.svelte';
|
|
7
|
+
const { app } = getContext('AppEditorContext');
|
|
5
8
|
export let appInput;
|
|
6
9
|
let inlineScriptEditorDrawer;
|
|
7
10
|
function edit() {
|
|
@@ -9,6 +12,16 @@ function edit() {
|
|
|
9
12
|
inlineScriptEditorDrawer?.openDrawer();
|
|
10
13
|
}
|
|
11
14
|
}
|
|
15
|
+
function detach() {
|
|
16
|
+
if (appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript) {
|
|
17
|
+
$app.unusedInlineScripts.push({
|
|
18
|
+
name: appInput.runnable.name,
|
|
19
|
+
inlineScript: appInput.runnable.inlineScript
|
|
20
|
+
});
|
|
21
|
+
$app = $app;
|
|
22
|
+
appInput = clearResultAppInput(appInput);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
12
25
|
function clear() {
|
|
13
26
|
appInput = clearResultAppInput(appInput);
|
|
14
27
|
}
|
|
@@ -20,19 +33,24 @@ function clear() {
|
|
|
20
33
|
bind:inlineScript={appInput.runnable.inlineScript}
|
|
21
34
|
/>
|
|
22
35
|
{/if}
|
|
23
|
-
<div class="flex justify-between w-full items-center gap-1">
|
|
24
|
-
<span class="text-xs font-semibold">
|
|
36
|
+
<div class="flex flex-col xl:flex-row justify-between w-full flex-wrap items-center gap-1">
|
|
37
|
+
<span class="text-xs font-semibold truncate">
|
|
25
38
|
{#if appInput.runnable?.type === 'runnableByName'}
|
|
26
39
|
{appInput.runnable.name}
|
|
27
40
|
{:else if appInput.runnable?.type === 'runnableByPath'}
|
|
28
41
|
{appInput.runnable.path}
|
|
29
42
|
{/if}
|
|
30
43
|
</span>
|
|
31
|
-
<div class="flex flex-wrap
|
|
44
|
+
<div class="flex gap-1 flex-wrap justify-center">
|
|
32
45
|
{#if appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript}
|
|
33
46
|
<Button size="xs" color="light" variant="border" startIcon={{ icon: faEdit }} on:click={edit}>
|
|
34
47
|
Edit
|
|
35
48
|
</Button>
|
|
49
|
+
<Button size="xs" color="light" variant="border" on:click={detach}
|
|
50
|
+
>Detach <Tooltip
|
|
51
|
+
>Detaching an inline script keep it for later to be reused by another component</Tooltip
|
|
52
|
+
></Button
|
|
53
|
+
>
|
|
36
54
|
{/if}
|
|
37
55
|
<Button size="xs" color="red" variant="border" startIcon={{ icon: faClose }} on:click={clear}>
|
|
38
56
|
Clear
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<script>import StaticInputEditor from './inputEditor/StaticInputEditor.svelte';
|
|
2
2
|
export let value;
|
|
3
|
-
export let canHide = false;
|
|
4
3
|
export let componentInput;
|
|
5
4
|
let fakeComponentInput = {
|
|
6
5
|
...componentInput,
|
|
7
6
|
value,
|
|
8
|
-
visible: componentInput.visible,
|
|
9
7
|
// We don't support array of arrays
|
|
10
8
|
// @ts-ignore
|
|
11
9
|
fieldType: componentInput.subFieldType
|
|
@@ -14,4 +12,4 @@ let fakeComponentInput = {
|
|
|
14
12
|
$: fakeComponentInput && (value = fakeComponentInput.value);
|
|
15
13
|
</script>
|
|
16
14
|
|
|
17
|
-
<StaticInputEditor bind:componentInput={fakeComponentInput}
|
|
15
|
+
<StaticInputEditor bind:componentInput={fakeComponentInput} />
|
|
@@ -2,41 +2,36 @@
|
|
|
2
2
|
import Button from '../../../common/button/Button.svelte';
|
|
3
3
|
import { getNextId } from '../../../flows/flowStateUtils';
|
|
4
4
|
import { classNames } from '../../../../utils';
|
|
5
|
-
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { faPlus, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
|
6
6
|
import { getContext } from 'svelte';
|
|
7
|
+
import { Icon } from 'svelte-awesome';
|
|
7
8
|
import PanelSection from './common/PanelSection.svelte';
|
|
8
9
|
import TableActionLabel from './TableActionLabel.svelte';
|
|
9
10
|
export let components;
|
|
10
|
-
|
|
11
|
+
export let id;
|
|
12
|
+
const { selectedComponent, staticOutputs } = getContext('AppEditorContext');
|
|
11
13
|
function addComponent() {
|
|
12
|
-
const
|
|
13
|
-
const id = getNextId(grid.map((gridItem) => gridItem.data.id));
|
|
14
|
+
const actionId = getNextId(components.map((x) => x.id.split('-')[1]));
|
|
14
15
|
const newComponent = {
|
|
15
|
-
id
|
|
16
|
+
id: `${id}-${actionId}`,
|
|
16
17
|
type: 'buttoncomponent',
|
|
17
18
|
configuration: {
|
|
18
19
|
label: {
|
|
19
20
|
type: 'static',
|
|
20
|
-
visible: true,
|
|
21
21
|
value: 'Action',
|
|
22
|
-
fieldType: '
|
|
23
|
-
defaultValue: 'Action'
|
|
22
|
+
fieldType: 'text'
|
|
24
23
|
},
|
|
25
24
|
color: {
|
|
26
25
|
fieldType: 'select',
|
|
27
26
|
type: 'static',
|
|
28
|
-
visible: true,
|
|
29
27
|
value: 'dark',
|
|
30
|
-
optionValuesKey: 'buttonColorOptions'
|
|
31
|
-
defaultValue: 'dark'
|
|
28
|
+
optionValuesKey: 'buttonColorOptions'
|
|
32
29
|
},
|
|
33
30
|
size: {
|
|
34
31
|
fieldType: 'select',
|
|
35
32
|
type: 'static',
|
|
36
|
-
visible: true,
|
|
37
33
|
value: 'xs',
|
|
38
|
-
optionValuesKey: 'buttonSizeOptions'
|
|
39
|
-
defaultValue: 'xs'
|
|
34
|
+
optionValuesKey: 'buttonSizeOptions'
|
|
40
35
|
}
|
|
41
36
|
},
|
|
42
37
|
componentInput: {
|
|
@@ -44,13 +39,19 @@ function addComponent() {
|
|
|
44
39
|
fieldType: 'any',
|
|
45
40
|
fields: {},
|
|
46
41
|
runnable: undefined,
|
|
47
|
-
|
|
42
|
+
value: undefined
|
|
48
43
|
},
|
|
49
44
|
recomputeIds: undefined,
|
|
50
45
|
card: false
|
|
51
46
|
};
|
|
52
47
|
components = [...components, newComponent];
|
|
53
48
|
}
|
|
49
|
+
function deleteComponent(cid) {
|
|
50
|
+
components = components.filter((x) => x.id !== cid);
|
|
51
|
+
delete $staticOutputs[cid];
|
|
52
|
+
$staticOutputs = $staticOutputs;
|
|
53
|
+
$selectedComponent = id;
|
|
54
|
+
}
|
|
54
55
|
</script>
|
|
55
56
|
|
|
56
57
|
<PanelSection title={`Table actions ${components.length > 0 ? `(${components.length})` : ''}`}>
|
|
@@ -65,10 +66,13 @@ function addComponent() {
|
|
|
65
66
|
/>
|
|
66
67
|
</svelte:fragment>
|
|
67
68
|
|
|
69
|
+
{#if components.length == 0}
|
|
70
|
+
<span class="text-xs text-gray-500">No action buttons</span>
|
|
71
|
+
{/if}
|
|
68
72
|
{#each components as component}
|
|
69
73
|
<div
|
|
70
74
|
class={classNames(
|
|
71
|
-
'w-full text-xs font-bold py-1.5 px-2 cursor-pointer transition-all justify-between flex items-center border border-gray-3 rounded-md',
|
|
75
|
+
'w-full text-xs font-bold gap-1 py-1.5 px-2 cursor-pointer transition-all justify-between flex items-center border border-gray-3 rounded-md',
|
|
72
76
|
'bg-white border-gray-300 hover:bg-gray-100 focus:bg-gray-100 text-gray-700',
|
|
73
77
|
$selectedComponent === component.id ? 'outline outline-blue-500 bg-red-400' : ''
|
|
74
78
|
)}
|
|
@@ -77,11 +81,16 @@ function addComponent() {
|
|
|
77
81
|
}}
|
|
78
82
|
on:keypress
|
|
79
83
|
>
|
|
84
|
+
<div>
|
|
85
|
+
<Button variant="border" color="red" on:click={() => deleteComponent(component.id)}>
|
|
86
|
+
<Icon class="h-3" data={faTrashAlt} />
|
|
87
|
+
</Button>
|
|
88
|
+
</div>
|
|
80
89
|
<div>
|
|
81
90
|
<TableActionLabel componentInput={component.configuration.label} />
|
|
82
91
|
</div>
|
|
83
|
-
<Badge color="dark-
|
|
84
|
-
|
|
92
|
+
<Badge color="dark-indigo">
|
|
93
|
+
{component.id}
|
|
85
94
|
</Badge>
|
|
86
95
|
</div>
|
|
87
96
|
{/each}
|