windmill-components 1.58.1 → 1.60.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/AddUser.svelte +66 -0
- package/components/AddUser.svelte.d.ts +16 -0
- package/components/AppConnect.svelte +6 -5
- package/components/ArgInput.svelte +39 -14
- package/components/Dropdown.svelte +2 -1
- package/components/EditorBar.svelte +3 -2
- package/components/FlowStatusViewer.svelte +24 -4
- package/components/IconedResourceType.svelte +3 -3
- package/components/InviteUser.svelte +0 -1
- package/components/ItemPicker.svelte +5 -5
- package/components/ModulePreview.svelte +1 -1
- package/components/MoveDrawer.svelte +2 -2
- package/components/Path.svelte +5 -3
- package/components/Popover.svelte +22 -11
- package/components/Popover.svelte.d.ts +1 -0
- package/components/ResourcePicker.svelte +9 -2
- package/components/RunForm.svelte +4 -2
- package/components/RunForm.svelte.d.ts +1 -0
- package/components/SchemaForm.svelte +7 -5
- package/components/SchemaModal.svelte +8 -0
- package/components/ScriptBuilder.svelte +0 -1
- package/components/Tooltip.svelte +2 -1
- package/components/Tooltip.svelte.d.ts +3 -1
- package/components/apps/components/DisplayComponent.svelte +1 -1
- package/components/apps/components/buttons/AppButton.svelte +2 -5
- package/components/apps/components/dataDisplay/AppBarChart.svelte +1 -1
- package/components/apps/components/dataDisplay/AppHtml.svelte +1 -1
- package/components/apps/components/dataDisplay/AppPieChart.svelte +1 -1
- package/components/apps/components/dataDisplay/AppScatterChart.svelte +1 -1
- package/components/apps/components/dataDisplay/AppText.svelte +32 -9
- package/components/apps/components/dataDisplay/AppTimeseries.svelte +1 -1
- package/components/apps/components/form/AppForm.svelte +39 -26
- package/components/apps/components/helpers/RunnableComponent.svelte +12 -7
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +3 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte +6 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +3 -0
- package/components/apps/components/numberInputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/table/AppTable.svelte +21 -15
- package/components/apps/components/table/AppTableFooter.svelte +7 -1
- package/components/apps/editor/AppEditorHeader.svelte +30 -25
- package/components/apps/editor/AppExportButton.svelte +4 -3
- package/components/apps/editor/AppExportButton.svelte.d.ts +2 -3
- package/components/apps/editor/GridEditor.svelte +0 -1
- package/components/apps/editor/GridEditor.svelte.d.ts +0 -2
- package/components/apps/editor/componentsPanel/data.js +9 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +7 -8
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +1 -1
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +4 -1
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +1 -3
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +52 -33
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -4
- package/components/apps/editor/settingsPanel/TableActions.svelte +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +2 -1
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +4 -3
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +1 -0
- package/components/apps/editorUtils.js +251 -9
- package/components/apps/inputType.d.ts +1 -1
- package/components/apps/types.d.ts +3 -2
- package/components/apps/utils.d.ts +6 -2
- package/components/apps/utils.js +16 -3
- package/components/common/button/Button.svelte +2 -2
- package/components/common/drawer/Drawer.svelte +1 -1
- package/components/common/table/AppRow.svelte +5 -0
- package/components/common/table/LanguageBadge.svelte +3 -1
- package/components/common/table/Row.svelte +5 -3
- package/components/flows/CreateActionsApp.svelte +1 -3
- package/components/flows/CreateActionsFlow.svelte +1 -1
- package/components/flows/content/CapturePayload.svelte +4 -4
- package/components/flows/content/FlowSettings.svelte +0 -1
- package/components/flows/utils.js +8 -6
- package/components/home/ItemsList.svelte +10 -4
- package/components/home/ListFilters.svelte +9 -1
- package/components/icons/AppwriteIcon.svelte +11 -13
- package/components/icons/AwsIcon.svelte +9 -0
- package/components/icons/AwsIcon.svelte.d.ts +17 -0
- package/components/icons/BcryptIcon.svelte +10 -0
- package/components/icons/BcryptIcon.svelte.d.ts +17 -0
- package/components/icons/{GItlabIcon.svelte → GitlabIcon.svelte} +0 -0
- package/components/icons/GitlabIcon.svelte.d.ts +17 -0
- package/components/icons/GoogleIcon.svelte +10 -0
- package/components/icons/GoogleIcon.svelte.d.ts +17 -0
- package/components/icons/HackernewsIcon.svelte +15 -0
- package/components/icons/HackernewsIcon.svelte.d.ts +17 -0
- package/components/icons/MongodbIcon.svelte +7 -0
- package/components/icons/MongodbIcon.svelte.d.ts +17 -0
- package/components/icons/RedditIcon.svelte +8 -0
- package/components/icons/RedditIcon.svelte.d.ts +17 -0
- package/components/icons/SupabaseIcon.svelte +19 -0
- package/components/icons/SupabaseIcon.svelte.d.ts +17 -0
- package/components/icons/WebdavIcon.svelte +7 -0
- package/components/icons/WebdavIcon.svelte.d.ts +17 -0
- package/components/icons/ZammadIcon.svelte +23 -0
- package/components/icons/ZammadIcon.svelte.d.ts +17 -0
- package/components/icons/index.d.ts +21 -3
- package/components/icons/index.js +22 -4
- package/components/jobs/JobDetail.svelte +33 -38
- package/components/preview/FlowPreviewStatus.svelte +1 -1
- package/components/scripts/CreateActionsScript.svelte +1 -1
- package/gen/core/OpenAPI.js +1 -1
- package/gen/services/AppService.js +2 -2
- package/gen/services/CaptureService.d.ts +8 -8
- package/gen/services/CaptureService.js +9 -9
- package/gen/services/FlowService.d.ts +8 -0
- package/gen/services/FlowService.js +14 -0
- package/gen/services/JobService.d.ts +9 -1
- package/gen/services/JobService.js +10 -8
- package/gen/services/ScriptService.d.ts +8 -0
- package/gen/services/ScriptService.js +14 -0
- package/gen/services/WorkspaceService.d.ts +17 -0
- package/gen/services/WorkspaceService.js +16 -0
- package/package.json +18 -9
- package/utils.d.ts +2 -1
- package/utils.js +9 -0
- package/components/icons/GItlabIcon.svelte.d.ts +0 -17
|
@@ -35,6 +35,12 @@ export let oldArgName = undefined;
|
|
|
35
35
|
let resource_type = undefined;
|
|
36
36
|
const dispatch = createEventDispatcher();
|
|
37
37
|
let drawer;
|
|
38
|
+
function handleKeyUp(event) {
|
|
39
|
+
const key = event.key;
|
|
40
|
+
if (key === 'Enter') {
|
|
41
|
+
dispatch('save');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
export function openDrawer() {
|
|
39
45
|
drawer.openDrawer();
|
|
40
46
|
resource_type = property.format?.substring(5);
|
|
@@ -66,6 +72,8 @@ else {
|
|
|
66
72
|
}
|
|
67
73
|
</script>
|
|
68
74
|
|
|
75
|
+
<svelte:window on:keyup={handleKeyUp} />
|
|
76
|
+
|
|
69
77
|
<Drawer bind:this={drawer} placement="right">
|
|
70
78
|
<DrawerContent on:close={clearModal} title="Add an argument">
|
|
71
79
|
<div class="flex flex-col gap-6">
|
|
@@ -174,7 +174,6 @@ $: kind = script.kind;
|
|
|
174
174
|
bind:this={summaryC}
|
|
175
175
|
bind:value={script.summary}
|
|
176
176
|
placeholder="A short summary of the script displayed when the script is listed"
|
|
177
|
-
rows="1"
|
|
178
177
|
/>
|
|
179
178
|
<h2 class="border-b pb-1 mt-8 mb-6">Language</h2>
|
|
180
179
|
<div class="flex flex-row gap-2 flex-wrap">
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script>import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
|
|
2
2
|
import Icon from 'svelte-awesome';
|
|
3
3
|
import Popover from './Popover.svelte';
|
|
4
|
+
export let light = false;
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<Popover notClickable>
|
|
7
8
|
<Icon
|
|
8
|
-
class="text-gray-500 font-thin inline-block align-middle w-4"
|
|
9
|
+
class="{light ? 'text-gray-300' : ' text-gray-500'} font-thin inline-block align-middle w-4"
|
|
9
10
|
data={faInfoCircle}
|
|
10
11
|
scale={0.8}
|
|
11
12
|
/>
|
|
@@ -6,7 +6,7 @@ let result = undefined;
|
|
|
6
6
|
export const staticOutputs = ['result', 'loading'];
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<RunnableWrapper bind:result bind:componentInput {id}>
|
|
9
|
+
<RunnableWrapper flexWrap bind:result bind:componentInput {id}>
|
|
10
10
|
<div class="w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm">
|
|
11
11
|
Results
|
|
12
12
|
</div>
|
|
@@ -40,6 +40,7 @@ $: loading = isLoading && ownClick;
|
|
|
40
40
|
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
41
41
|
|
|
42
42
|
<RunnableWrapper
|
|
43
|
+
flexWrap
|
|
43
44
|
bind:runnableComponent
|
|
44
45
|
bind:componentInput
|
|
45
46
|
{id}
|
|
@@ -66,13 +67,9 @@ $: loading = isLoading && ownClick;
|
|
|
66
67
|
}}
|
|
67
68
|
{size}
|
|
68
69
|
{color}
|
|
70
|
+
{loading}
|
|
69
71
|
>
|
|
70
72
|
{labelValue}
|
|
71
|
-
{#if !loading}
|
|
72
|
-
<span class="w-5" />
|
|
73
|
-
{:else}
|
|
74
|
-
<Loader2 class="animate-spin ml-1" size={14} />
|
|
75
|
-
{/if}
|
|
76
73
|
</Button>
|
|
77
74
|
</AlignWrapper>
|
|
78
75
|
</RunnableWrapper>
|
|
@@ -41,7 +41,7 @@ $: data = {
|
|
|
41
41
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
42
42
|
<InputValue {id} input={configuration.line} bind:value={lineChart} />
|
|
43
43
|
|
|
44
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
44
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
45
45
|
{#if result}
|
|
46
46
|
{#if lineChart}
|
|
47
47
|
<Line {data} {options} />
|
|
@@ -9,7 +9,7 @@ export const staticOutputs = ['result', 'loading'];
|
|
|
9
9
|
let result = undefined;
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
-
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
12
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
13
13
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
14
14
|
<div
|
|
15
15
|
on:pointerdown={(e) => {
|
|
@@ -36,7 +36,7 @@ $: data = {
|
|
|
36
36
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
37
37
|
<InputValue {id} input={configuration.doughnutStyle} bind:value={doughnut} />
|
|
38
38
|
|
|
39
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
39
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
40
40
|
{#if result}
|
|
41
41
|
{#if doughnut}
|
|
42
42
|
<Doughnut {data} {options} />
|
|
@@ -39,7 +39,7 @@ $: data = {
|
|
|
39
39
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
40
40
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
41
41
|
|
|
42
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
42
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
43
43
|
{#if result}
|
|
44
44
|
<Scatter {data} {options} />
|
|
45
45
|
{/if}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import { Clipboard } from 'lucide-svelte';
|
|
2
|
+
import { copyToClipboard } from '../../../../utils';
|
|
3
|
+
import Button from '../../../common/button/Button.svelte';
|
|
4
|
+
import Popover from '../../../Popover.svelte';
|
|
5
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
2
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
3
7
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
4
8
|
export let id;
|
|
@@ -10,6 +14,7 @@ export const staticOutputs = ['result', 'loading'];
|
|
|
10
14
|
let extraStyle = undefined;
|
|
11
15
|
let result = undefined;
|
|
12
16
|
let style = undefined;
|
|
17
|
+
let copyButton;
|
|
13
18
|
function getComponent() {
|
|
14
19
|
switch (style) {
|
|
15
20
|
case 'Title':
|
|
@@ -44,20 +49,38 @@ $: style && (classes = getClasses());
|
|
|
44
49
|
|
|
45
50
|
<InputValue {id} input={configuration.extraStyle} bind:value={extraStyle} />
|
|
46
51
|
<InputValue {id} input={configuration.style} bind:value={style} />
|
|
52
|
+
<InputValue {id} input={configuration.copyButton} bind:value={copyButton} />
|
|
47
53
|
|
|
48
|
-
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
54
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
49
55
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
50
56
|
{#if !result || result === ''}
|
|
51
57
|
<div class="text-gray-400 bg-gray-100 flex justify-center items-center h-full w-full">
|
|
52
58
|
No text
|
|
53
59
|
</div>
|
|
54
|
-
{:else}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
{:else}
|
|
61
|
+
<div class="flex flex-wrap gap-2">
|
|
62
|
+
<svelte:element
|
|
63
|
+
this={component}
|
|
64
|
+
class="whitespace-pre-wrap {classes}"
|
|
65
|
+
style={extraStyle}
|
|
66
|
+
>
|
|
67
|
+
{String(result)}
|
|
68
|
+
</svelte:element>
|
|
69
|
+
{#if copyButton && result}
|
|
70
|
+
<Popover notClickable>
|
|
71
|
+
<Button
|
|
72
|
+
size="xs"
|
|
73
|
+
btnClasses="!px-2"
|
|
74
|
+
on:click={() => copyToClipboard(result)}
|
|
75
|
+
>
|
|
76
|
+
<Clipboard size={14} strokeWidth={2} />
|
|
77
|
+
</Button>
|
|
78
|
+
<svelte:fragment slot="text">
|
|
79
|
+
Copy to clipboard
|
|
80
|
+
</svelte:fragment>
|
|
81
|
+
</Popover>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
61
84
|
{/if}
|
|
62
85
|
</AlignWrapper>
|
|
63
86
|
</RunnableWrapper>
|
|
@@ -50,7 +50,7 @@ $: data = {
|
|
|
50
50
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
51
51
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
52
52
|
|
|
53
|
-
<RunnableWrapper autoRefresh bind:componentInput {id} bind:result>
|
|
53
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
54
54
|
{#if result}
|
|
55
55
|
<Scatter {data} {options} />
|
|
56
56
|
{/if}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>import { Button } from '../../../common';
|
|
2
|
+
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
|
2
3
|
import { getContext } from 'svelte';
|
|
4
|
+
import { Icon } from 'svelte-awesome';
|
|
3
5
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
4
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
5
7
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
@@ -16,6 +18,8 @@ let color;
|
|
|
16
18
|
let size;
|
|
17
19
|
let runnableComponent;
|
|
18
20
|
let isLoading = false;
|
|
21
|
+
$: noInputs =
|
|
22
|
+
componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0;
|
|
19
23
|
$: outputs = $worldStore?.outputsById[id];
|
|
20
24
|
$: if (outputs?.loading != undefined) {
|
|
21
25
|
outputs.loading.set(false, true);
|
|
@@ -32,6 +36,7 @@ $: outputs?.loading.subscribe({
|
|
|
32
36
|
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
33
37
|
|
|
34
38
|
<RunnableWrapper
|
|
39
|
+
defaultUserInput
|
|
35
40
|
noMinH
|
|
36
41
|
bind:runnableComponent
|
|
37
42
|
bind:componentInput
|
|
@@ -39,39 +44,47 @@ $: outputs?.loading.subscribe({
|
|
|
39
44
|
{extraQueryParams}
|
|
40
45
|
autoRefresh={false}
|
|
41
46
|
forceSchemaDisplay={true}
|
|
47
|
+
runnableClass="!block"
|
|
42
48
|
>
|
|
43
49
|
<AlignWrapper {horizontalAlignment}>
|
|
44
|
-
<div class="flex flex-col gap-2 px-4 w-full
|
|
50
|
+
<div class="flex flex-col gap-2 px-4 w-full">
|
|
45
51
|
<div>
|
|
46
|
-
{#if
|
|
47
|
-
<
|
|
48
|
-
Run forms are
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
{#if noInputs}
|
|
53
|
+
<div class="text-gray-600 italic text-sm my-4">
|
|
54
|
+
Run forms are associated with a runnable that has user inputs.
|
|
55
|
+
<br />
|
|
56
|
+
Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
|
|
57
|
+
<strong>
|
|
58
|
+
User Input
|
|
59
|
+
<Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
|
|
60
|
+
</strong>
|
|
61
|
+
</div>
|
|
51
62
|
{/if}
|
|
52
63
|
</div>
|
|
53
64
|
<div class="flex justify-end">
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
e
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
{#if !noInputs}
|
|
66
|
+
<Button
|
|
67
|
+
loading={isLoading}
|
|
68
|
+
btnClasses="my-1"
|
|
69
|
+
on:pointerdown={(e) => {
|
|
70
|
+
e?.stopPropagation()
|
|
71
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
72
|
+
}}
|
|
73
|
+
on:click={() => {
|
|
74
|
+
runnableComponent?.runComponent()
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
if (recomputeIds) {
|
|
77
|
+
recomputeIds.forEach((id) => {
|
|
78
|
+
$runnableComponents[id]?.()
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
}}
|
|
82
|
+
{size}
|
|
83
|
+
{color}
|
|
84
|
+
>
|
|
85
|
+
{labelValue}
|
|
86
|
+
</Button>
|
|
87
|
+
{/if}
|
|
75
88
|
</div>
|
|
76
89
|
</div>
|
|
77
90
|
</AlignWrapper>
|
|
@@ -16,6 +16,9 @@ export let autoRefresh = true;
|
|
|
16
16
|
export let result = undefined;
|
|
17
17
|
export let forceSchemaDisplay = false;
|
|
18
18
|
export let noMinH = false;
|
|
19
|
+
export let defaultUserInput = false;
|
|
20
|
+
export let flexWrap = false;
|
|
21
|
+
export let wrapperClass = '';
|
|
19
22
|
const { worldStore, runnableComponents, workspace, appPath, isEditor, jobs, noBackend } = getContext('AppEditorContext');
|
|
20
23
|
onMount(() => {
|
|
21
24
|
if (autoRefresh) {
|
|
@@ -87,7 +90,7 @@ async function loadSchemaAndInputsByName() {
|
|
|
87
90
|
function reloadInputs(schema) {
|
|
88
91
|
let schemaCopy = JSON.parse(JSON.stringify(schema));
|
|
89
92
|
const result = {};
|
|
90
|
-
const newInputs = schemaToInputsSpec(schemaCopy);
|
|
93
|
+
const newInputs = schemaToInputsSpec(schemaCopy, defaultUserInput);
|
|
91
94
|
if (!fields) {
|
|
92
95
|
return newInputs;
|
|
93
96
|
}
|
|
@@ -99,7 +102,9 @@ function reloadInputs(schema) {
|
|
|
99
102
|
result[key] = newInput;
|
|
100
103
|
}
|
|
101
104
|
else {
|
|
102
|
-
if (fieldTypeToTsType(newInput.fieldType) !== fieldTypeToTsType(oldInput.fieldType)
|
|
105
|
+
if (fieldTypeToTsType(newInput.fieldType) !== fieldTypeToTsType(oldInput.fieldType) ||
|
|
106
|
+
newInput.format !== oldInput.format ||
|
|
107
|
+
newInput.subFieldType !== oldInput.subFieldType) {
|
|
103
108
|
result[key] = newInput;
|
|
104
109
|
}
|
|
105
110
|
else {
|
|
@@ -188,7 +193,7 @@ async function executeComponent(noToast = false) {
|
|
|
188
193
|
});
|
|
189
194
|
});
|
|
190
195
|
if (njob) {
|
|
191
|
-
$jobs = [
|
|
196
|
+
$jobs = [{ job: njob, component: id }, ...$jobs];
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
199
|
export async function runComponent() {
|
|
@@ -225,7 +230,7 @@ let lastStartedAt = Date.now();
|
|
|
225
230
|
bind:this={testJobLoader}
|
|
226
231
|
/>
|
|
227
232
|
|
|
228
|
-
<div class="h-full flex relative flex-row flex-wrap">
|
|
233
|
+
<div class="h-full flex relative flex-row flex-wrap {wrapperClass}">
|
|
229
234
|
{#if autoRefresh === true}
|
|
230
235
|
<div class="flex absolute top-1 right-1">
|
|
231
236
|
<RefreshButton componentId={id} />
|
|
@@ -234,8 +239,7 @@ let lastStartedAt = Date.now();
|
|
|
234
239
|
{#if schemaStripped && Object.keys(schemaStripped?.properties ?? {}).length > 0 && (autoRefresh || forceSchemaDisplay)}
|
|
235
240
|
<div class="px-2 h-fit min-h-0">
|
|
236
241
|
<SchemaForm
|
|
237
|
-
|
|
238
|
-
flexWrap
|
|
242
|
+
{flexWrap}
|
|
239
243
|
schema={schemaStripped}
|
|
240
244
|
bind:args
|
|
241
245
|
{disabledArgs}
|
|
@@ -252,7 +256,8 @@ let lastStartedAt = Date.now();
|
|
|
252
256
|
{:else if result?.error}
|
|
253
257
|
<div class="p-2">
|
|
254
258
|
<Alert type="error" title="Error during execution">
|
|
255
|
-
|
|
259
|
+
See "Debug Runs" on the top right for more details
|
|
260
|
+
<pre title={result.error} class=" mt-2 text-2xs whitespace-pre-wrap">{result.error}</pre>
|
|
256
261
|
</Alert>
|
|
257
262
|
<slot />
|
|
258
263
|
</div>
|
|
@@ -10,6 +10,9 @@ declare const __propDef: {
|
|
|
10
10
|
result?: any;
|
|
11
11
|
forceSchemaDisplay?: boolean | undefined;
|
|
12
12
|
noMinH?: boolean | undefined;
|
|
13
|
+
defaultUserInput?: boolean | undefined;
|
|
14
|
+
flexWrap?: boolean | undefined;
|
|
15
|
+
wrapperClass?: string | undefined;
|
|
13
16
|
runComponent?: (() => Promise<void>) | undefined;
|
|
14
17
|
};
|
|
15
18
|
events: {
|
|
@@ -10,6 +10,9 @@ export let extraQueryParams = {};
|
|
|
10
10
|
export let autoRefresh = true;
|
|
11
11
|
export let runnableComponent = undefined;
|
|
12
12
|
export let forceSchemaDisplay = false;
|
|
13
|
+
export let defaultUserInput = false;
|
|
14
|
+
export let flexWrap = false;
|
|
15
|
+
export let runnableClass = '';
|
|
13
16
|
const { staticExporter, noBackend } = getContext('AppEditorContext');
|
|
14
17
|
if (noBackend && componentInput?.type == 'runnable') {
|
|
15
18
|
result = componentInput?.['value'];
|
|
@@ -26,6 +29,8 @@ function isRunnableDefined() {
|
|
|
26
29
|
<slot />
|
|
27
30
|
{:else if componentInput.type === 'runnable' && isRunnableDefined()}
|
|
28
31
|
<RunnableComponent
|
|
32
|
+
{flexWrap}
|
|
33
|
+
{defaultUserInput}
|
|
29
34
|
bind:this={runnableComponent}
|
|
30
35
|
bind:fields={componentInput.fields}
|
|
31
36
|
bind:result
|
|
@@ -35,6 +40,7 @@ function isRunnableDefined() {
|
|
|
35
40
|
{extraQueryParams}
|
|
36
41
|
{forceSchemaDisplay}
|
|
37
42
|
{noMinH}
|
|
43
|
+
wrapperClass={runnableClass}
|
|
38
44
|
>
|
|
39
45
|
<slot />
|
|
40
46
|
</RunnableComponent>
|
|
@@ -11,6 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
autoRefresh?: boolean | undefined;
|
|
12
12
|
runnableComponent?: RunnableComponent | undefined;
|
|
13
13
|
forceSchemaDisplay?: boolean | undefined;
|
|
14
|
+
defaultUserInput?: boolean | undefined;
|
|
15
|
+
flexWrap?: boolean | undefined;
|
|
16
|
+
runnableClass?: string | undefined;
|
|
14
17
|
};
|
|
15
18
|
events: {
|
|
16
19
|
[evt: string]: CustomEvent<any>;
|
|
@@ -14,7 +14,7 @@ export let componentInput;
|
|
|
14
14
|
export let configuration;
|
|
15
15
|
export let actionButtons;
|
|
16
16
|
export const staticOutputs = ['selectedRow', 'loading', 'result', 'search'];
|
|
17
|
-
|
|
17
|
+
let result = undefined;
|
|
18
18
|
let search = undefined;
|
|
19
19
|
let searchValue = '';
|
|
20
20
|
let pagination = true;
|
|
@@ -75,8 +75,8 @@ function cellIsObject(x, props) {
|
|
|
75
75
|
}
|
|
76
76
|
let filteredResult = [];
|
|
77
77
|
$: filteredResult && setOptions(filteredResult);
|
|
78
|
-
$: search === 'By Component' && (filteredResult = searchInResult(result, searchValue));
|
|
79
|
-
$: (search === 'By Runnable' || search === 'Disabled') && (filteredResult = result);
|
|
78
|
+
$: search === 'By Component' && (filteredResult = searchInResult(result ?? [], searchValue));
|
|
79
|
+
$: (search === 'By Runnable' || search === 'Disabled') && (filteredResult = result ?? []);
|
|
80
80
|
$: outputs = $worldStore?.outputsById[id];
|
|
81
81
|
function rerender() {
|
|
82
82
|
table = createSvelteTable(options);
|
|
@@ -86,22 +86,22 @@ $: result && rerender();
|
|
|
86
86
|
|
|
87
87
|
<InputValue {id} input={configuration.search} bind:value={search} />
|
|
88
88
|
|
|
89
|
-
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
89
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
90
90
|
{#if Array.isArray(result) && result.every(isObject)}
|
|
91
91
|
<div class="border border-gray-300 shadow-sm divide-y divide-gray-300 flex flex-col h-full">
|
|
92
92
|
{#if search !== 'Disabled'}
|
|
93
|
-
<div class="px-
|
|
93
|
+
<div class="px-2 py-1">
|
|
94
94
|
<div class="flex items-center">
|
|
95
|
-
<div>
|
|
95
|
+
<div class="grow max-w-[300px]">
|
|
96
96
|
<DebouncedInput placeholder="Search..." bind:value={searchValue} />
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
{/if}
|
|
101
101
|
|
|
102
|
-
<div class="overflow-auto flex-1 w-full">
|
|
103
|
-
<table class="
|
|
104
|
-
<thead class="bg-gray-50 text-left">
|
|
102
|
+
<div class="overflow-x-auto flex-1 w-full">
|
|
103
|
+
<table class="relative w-full border-b border-b-gray-200">
|
|
104
|
+
<thead class="sticky top-0 bg-gray-50 text-left">
|
|
105
105
|
{#each $table.getHeaderGroups() as headerGroup}
|
|
106
106
|
<tr class="divide-x">
|
|
107
107
|
{#each headerGroup.headers as header}
|
|
@@ -109,16 +109,22 @@ $: result && rerender();
|
|
|
109
109
|
{@const context = header?.getContext()}
|
|
110
110
|
{#if context}
|
|
111
111
|
{@const component = renderCell(header.column.columnDef.header, context)}
|
|
112
|
-
<th class="
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
<th class="!p-0">
|
|
113
|
+
<span class="block px-4 py-4 text-sm font-semibold border-b">
|
|
114
|
+
{#if !header.isPlaceholder && component}
|
|
115
|
+
<svelte:component this={component} />
|
|
116
|
+
{/if}
|
|
117
|
+
</span>
|
|
116
118
|
</th>
|
|
117
119
|
{/if}
|
|
118
120
|
{/if}
|
|
119
121
|
{/each}
|
|
120
122
|
{#if actionButtons.length > 0}
|
|
121
|
-
<th class="
|
|
123
|
+
<th class="!p-0">
|
|
124
|
+
<span class="block px-4 py-4 text-sm font-semibold border-b">
|
|
125
|
+
Actions
|
|
126
|
+
</span>
|
|
127
|
+
</th>
|
|
122
128
|
{/if}
|
|
123
129
|
</tr>
|
|
124
130
|
{/each}
|
|
@@ -180,7 +186,7 @@ $: result && rerender();
|
|
|
180
186
|
|
|
181
187
|
<AppTableFooter paginationEnabled={pagination} {result} {table} />
|
|
182
188
|
</div>
|
|
183
|
-
{:else}
|
|
189
|
+
{:else if result != undefined}
|
|
184
190
|
<Alert title="Parsing issues" type="error" size="xs">
|
|
185
191
|
The result should be an array of objects
|
|
186
192
|
</Alert>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
2
|
import { faDownload } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { ChevronLeft, ChevronRight } from 'lucide-svelte';
|
|
3
4
|
import { tableOptions } from './tableOptions';
|
|
4
5
|
export let result;
|
|
5
6
|
export let paginationEnabled = false;
|
|
@@ -15,26 +16,30 @@ function downloadResultAsJSON() {
|
|
|
15
16
|
}
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
|
-
<div class="px-
|
|
19
|
+
<div class="px-2 py-1 text-xs flex flex-row gap-2 items-center justify-between">
|
|
19
20
|
{#if paginationEnabled && result.length > (tableOptions.initialState?.pagination?.pageSize ?? 25)}
|
|
20
21
|
<div class="flex items-center gap-2 flex-row">
|
|
21
22
|
<Button
|
|
22
23
|
size="xs"
|
|
23
24
|
variant="border"
|
|
24
25
|
color="light"
|
|
26
|
+
btnClasses="!py-1 !pl-1"
|
|
25
27
|
on:click={() => $table.previousPage()}
|
|
26
28
|
disabled={!$table.getCanPreviousPage()}
|
|
27
29
|
>
|
|
30
|
+
<ChevronLeft size={14} />
|
|
28
31
|
Previous
|
|
29
32
|
</Button>
|
|
30
33
|
<Button
|
|
31
34
|
size="xs"
|
|
32
35
|
variant="border"
|
|
33
36
|
color="light"
|
|
37
|
+
btnClasses="!py-1 !pr-1"
|
|
34
38
|
on:click={() => $table.nextPage()}
|
|
35
39
|
disabled={!$table.getCanNextPage()}
|
|
36
40
|
>
|
|
37
41
|
Next
|
|
42
|
+
<ChevronRight size={14} />
|
|
38
43
|
</Button>
|
|
39
44
|
{$table.getState().pagination.pageIndex + 1} of {$table.getPageCount()}
|
|
40
45
|
</div>
|
|
@@ -46,6 +51,7 @@ function downloadResultAsJSON() {
|
|
|
46
51
|
size="xs"
|
|
47
52
|
variant="border"
|
|
48
53
|
color="light"
|
|
54
|
+
btnClasses="!py-1"
|
|
49
55
|
on:click={downloadResultAsJSON}
|
|
50
56
|
startIcon={{ icon: faDownload }}
|
|
51
57
|
>
|