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
|
@@ -14,7 +14,7 @@ export let initializing = undefined;
|
|
|
14
14
|
export let customCss = undefined;
|
|
15
15
|
export let render;
|
|
16
16
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
17
|
-
initOutput($worldStore, id, {
|
|
17
|
+
const outputs = initOutput($worldStore, id, {
|
|
18
18
|
result: undefined,
|
|
19
19
|
loading: false
|
|
20
20
|
});
|
|
@@ -61,7 +61,7 @@ $: css = concatCustomCss($app.css?.timeseriescomponent, customCss);
|
|
|
61
61
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
62
62
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
63
63
|
|
|
64
|
-
<RunnableWrapper {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
64
|
+
<RunnableWrapper {outputs} {render} autoRefresh {componentInput} {id} bind:initializing bind:result>
|
|
65
65
|
<div class="w-full h-full {css?.container?.class ?? ''}" style={css?.container?.style ?? ''}>
|
|
66
66
|
{#if result}
|
|
67
67
|
<Scatter {data} {options} />
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
componentInput: AppInput | undefined;
|
|
9
9
|
configuration: RichConfigurations;
|
|
10
10
|
initializing?: boolean | undefined;
|
|
11
|
-
customCss?: ComponentCustomCSS<'
|
|
11
|
+
customCss?: ComponentCustomCSS<'timeseriescomponent'> | undefined;
|
|
12
12
|
render: boolean;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
@@ -7,7 +7,7 @@ export let componentInput;
|
|
|
7
7
|
export let initializing = undefined;
|
|
8
8
|
export let render;
|
|
9
9
|
const { worldStore } = getContext('AppViewerContext');
|
|
10
|
-
initOutput($worldStore, id, {
|
|
10
|
+
const outputs = initOutput($worldStore, id, {
|
|
11
11
|
result: undefined,
|
|
12
12
|
loading: false
|
|
13
13
|
});
|
|
@@ -27,11 +27,11 @@ $: Plotly &&
|
|
|
27
27
|
divEl &&
|
|
28
28
|
h &&
|
|
29
29
|
w &&
|
|
30
|
-
Plotly.newPlot(divEl, [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
|
|
30
|
+
Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
|
|
34
|
-
<RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
|
|
34
|
+
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
35
35
|
<div on:pointerdown bind:this={divEl} />
|
|
36
36
|
</RunnableWrapper>
|
|
37
37
|
</div>
|
|
@@ -10,7 +10,7 @@ export let render;
|
|
|
10
10
|
let result = undefined;
|
|
11
11
|
let divEl = null;
|
|
12
12
|
const { worldStore } = getContext('AppViewerContext');
|
|
13
|
-
initOutput($worldStore, id, {
|
|
13
|
+
const outputs = initOutput($worldStore, id, {
|
|
14
14
|
result: undefined,
|
|
15
15
|
loading: false
|
|
16
16
|
});
|
|
@@ -46,7 +46,7 @@ $: vegaEmbed &&
|
|
|
46
46
|
<InputValue {id} input={configuration.canvas} bind:value={canvas} />
|
|
47
47
|
|
|
48
48
|
<div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
|
|
49
|
-
<RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
|
|
49
|
+
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
50
50
|
<div on:pointerdown bind:this={divEl} />
|
|
51
51
|
</RunnableWrapper>
|
|
52
52
|
</div>
|
|
@@ -63,7 +63,7 @@ function onCellValueChanged(event) {
|
|
|
63
63
|
<InputValue {id} input={configuration.pagination} bind:value={pagination} />
|
|
64
64
|
<InputValue {id} input={configuration.pageSize} bind:value={pageSize} />
|
|
65
65
|
|
|
66
|
-
<RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
|
|
66
|
+
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
67
67
|
{#if Array.isArray(result) && result.every(isObject)}
|
|
68
68
|
<div
|
|
69
69
|
class="border border-gray-300 shadow-sm divide-y divide-gray-300 flex flex-col h-full"
|
|
@@ -33,7 +33,7 @@ const options = writable({
|
|
|
33
33
|
columns: []
|
|
34
34
|
});
|
|
35
35
|
let table = createSvelteTable(options);
|
|
36
|
-
const { app, worldStore, componentControl, selectedComponent } = getContext('AppViewerContext');
|
|
36
|
+
const { app, worldStore, componentControl, selectedComponent, hoverStore, mode } = getContext('AppViewerContext');
|
|
37
37
|
let selectedRowIndex = -1;
|
|
38
38
|
function toggleRow(row, rowIndex, force = false) {
|
|
39
39
|
if (selectedRowIndex !== rowIndex || force) {
|
|
@@ -122,7 +122,7 @@ $componentControl[id] = {
|
|
|
122
122
|
|
|
123
123
|
<InputValue {id} input={configuration.search} bind:value={search} />
|
|
124
124
|
|
|
125
|
-
<RunnableWrapper {render} {componentInput} {id} bind:initializing bind:result>
|
|
125
|
+
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
126
126
|
{#if Array.isArray(result) && result.every(isObject)}
|
|
127
127
|
<div
|
|
128
128
|
class={twMerge(
|
|
@@ -221,13 +221,26 @@ $componentControl[id] = {
|
|
|
221
221
|
on:click={() => toggleRow(row, rowIndex)}
|
|
222
222
|
>
|
|
223
223
|
<div class="center-center h-full w-full flex-wrap gap-1 ">
|
|
224
|
-
{#each actionButtons as actionButton, actionIndex (
|
|
224
|
+
{#each actionButtons as actionButton, actionIndex (actionButton?.id)}
|
|
225
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
225
226
|
<div
|
|
226
|
-
|
|
227
|
+
on:mouseover|stopPropagation={() => {
|
|
228
|
+
if (actionButton.id !== $hoverStore) {
|
|
229
|
+
$hoverStore = actionButton.id
|
|
230
|
+
}
|
|
231
|
+
}}
|
|
232
|
+
on:mouseout|stopPropagation={() => {
|
|
233
|
+
if ($hoverStore !== undefined) {
|
|
234
|
+
$hoverStore = undefined
|
|
235
|
+
}
|
|
236
|
+
}}
|
|
237
|
+
class={(actionButton.id === $selectedComponent ||
|
|
238
|
+
$hoverStore === actionButton.id) &&
|
|
239
|
+
$mode !== 'preview'
|
|
227
240
|
? 'outline outline-indigo-500 outline-1 outline-offset-1 relative '
|
|
228
241
|
: ''}
|
|
229
242
|
>
|
|
230
|
-
{#if actionButton.id === $selectedComponent}
|
|
243
|
+
{#if actionButton.id === $selectedComponent || $hoverStore === actionButton.id}
|
|
231
244
|
<span
|
|
232
245
|
title={`Id: ${actionButton.id}`}
|
|
233
246
|
class={classNames(
|
|
@@ -240,14 +253,18 @@ $componentControl[id] = {
|
|
|
240
253
|
{/if}
|
|
241
254
|
{#if rowIndex == 0}
|
|
242
255
|
<AppButton
|
|
256
|
+
extraKey={'idx' + rowIndex}
|
|
243
257
|
{render}
|
|
244
258
|
noWFull
|
|
245
|
-
{...actionButton}
|
|
246
259
|
preclickAction={async () => {
|
|
247
260
|
toggleRow(row, rowIndex)
|
|
248
261
|
}}
|
|
262
|
+
id={actionButton.id}
|
|
263
|
+
customCss={actionButton.customCss}
|
|
264
|
+
configuration={actionButton.configuration}
|
|
265
|
+
recomputeIds={actionButton.recomputeIds}
|
|
249
266
|
extraQueryParams={{ row: row.original }}
|
|
250
|
-
|
|
267
|
+
componentInput={actionButton.componentInput}
|
|
251
268
|
controls={{
|
|
252
269
|
left: () => {
|
|
253
270
|
if (actionIndex === 0) {
|
|
@@ -272,14 +289,18 @@ $componentControl[id] = {
|
|
|
272
289
|
/>
|
|
273
290
|
{:else}
|
|
274
291
|
<AppButton
|
|
292
|
+
extraKey={'idx' + rowIndex}
|
|
275
293
|
{render}
|
|
276
294
|
noWFull
|
|
277
|
-
{
|
|
295
|
+
id={actionButton.id}
|
|
296
|
+
customCss={actionButton.customCss}
|
|
297
|
+
configuration={actionButton.configuration}
|
|
298
|
+
recomputeIds={actionButton.recomputeIds}
|
|
278
299
|
preclickAction={async () => {
|
|
279
300
|
toggleRow(row, rowIndex)
|
|
280
301
|
}}
|
|
281
302
|
extraQueryParams={{ row: row.original }}
|
|
282
|
-
|
|
303
|
+
componentInput={actionButton.componentInput}
|
|
283
304
|
/>
|
|
284
305
|
{/if}
|
|
285
306
|
</div>
|
|
@@ -297,16 +318,18 @@ $componentControl[id] = {
|
|
|
297
318
|
paginationEnabled={pagination}
|
|
298
319
|
{result}
|
|
299
320
|
{table}
|
|
300
|
-
class={css?.tableFooter
|
|
301
|
-
style={css?.tableFooter
|
|
321
|
+
class={css?.tableFooter?.class}
|
|
322
|
+
style={css?.tableFooter?.style}
|
|
302
323
|
/>
|
|
303
324
|
</div>
|
|
304
325
|
{:else if result != undefined}
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
326
|
+
<div class="flex flex-col h-full w-full overflow-auto">
|
|
327
|
+
<Alert title="Parsing issues" type="error" size="xs" class="h-full w-full ">
|
|
328
|
+
The result should be an array of objects. Received:
|
|
329
|
+
<pre class="w-full bg-white p-2 rounded-md whitespace-pre-wrap"
|
|
330
|
+
>{JSON.stringify(result, null, 4)}</pre
|
|
331
|
+
>
|
|
332
|
+
</Alert>
|
|
333
|
+
</div>
|
|
311
334
|
{/if}
|
|
312
335
|
</RunnableWrapper>
|
|
@@ -9,7 +9,7 @@ declare const __propDef: {
|
|
|
9
9
|
configuration: RichConfigurations;
|
|
10
10
|
actionButtons: (BaseAppComponent & ButtonComponent)[];
|
|
11
11
|
initializing?: boolean | undefined;
|
|
12
|
-
customCss?: ComponentCustomCSS<'
|
|
12
|
+
customCss?: ComponentCustomCSS<'tablecomponent'> | undefined;
|
|
13
13
|
render: boolean;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
@@ -5,10 +5,10 @@ export let id;
|
|
|
5
5
|
export let name;
|
|
6
6
|
export let inlineScript;
|
|
7
7
|
export let fields;
|
|
8
|
-
export let
|
|
8
|
+
export let doNotRecomputeOnInputChanged = false;
|
|
9
9
|
let result = undefined;
|
|
10
10
|
const { worldStore } = getContext('AppViewerContext');
|
|
11
|
-
initOutput($worldStore, id, {
|
|
11
|
+
let outputs = initOutput($worldStore, id, {
|
|
12
12
|
result: undefined,
|
|
13
13
|
loading: false
|
|
14
14
|
});
|
|
@@ -18,8 +18,10 @@ initOutput($worldStore, id, {
|
|
|
18
18
|
render={false}
|
|
19
19
|
{id}
|
|
20
20
|
{fields}
|
|
21
|
-
{
|
|
21
|
+
autoRefresh={true}
|
|
22
|
+
{doNotRecomputeOnInputChanged}
|
|
22
23
|
bind:result
|
|
24
|
+
transformer={undefined}
|
|
23
25
|
runnable={{
|
|
24
26
|
name,
|
|
25
27
|
inlineScript,
|
|
@@ -27,6 +29,7 @@ initOutput($worldStore, id, {
|
|
|
27
29
|
}}
|
|
28
30
|
wrapperClass="hidden"
|
|
29
31
|
recomputable
|
|
32
|
+
{outputs}
|
|
30
33
|
>
|
|
31
34
|
<slot />
|
|
32
35
|
</RunnableComponent>
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
name: string;
|
|
8
8
|
inlineScript: InlineScript | undefined;
|
|
9
9
|
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
10
|
-
|
|
10
|
+
doNotRecomputeOnInputChanged?: boolean | undefined;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
13
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { isCodeInjection } from '../../../flows/utils';
|
|
2
2
|
import { deepEqual } from 'fast-equals';
|
|
3
|
-
import { createEventDispatcher, getContext } from 'svelte';
|
|
3
|
+
import { createEventDispatcher, getContext, onDestroy } from 'svelte';
|
|
4
4
|
import { accessPropertyByPath } from '../../utils';
|
|
5
5
|
import { computeGlobalContext, eval_like } from './eval';
|
|
6
6
|
export let input;
|
|
@@ -9,14 +9,13 @@ export let id = undefined;
|
|
|
9
9
|
export let error = '';
|
|
10
10
|
export let extraContext = {};
|
|
11
11
|
export let key = '';
|
|
12
|
-
$: console.log(value);
|
|
13
12
|
const { componentControl } = getContext('AppViewerContext');
|
|
14
13
|
const dispatch = createEventDispatcher();
|
|
15
14
|
if (input == undefined) {
|
|
16
15
|
dispatch('done');
|
|
17
16
|
}
|
|
18
17
|
let lastInput = input ? JSON.parse(JSON.stringify(input)) : undefined;
|
|
19
|
-
|
|
18
|
+
onDestroy(() => (lastInput = undefined));
|
|
20
19
|
$: if (input && !deepEqual(input, lastInput)) {
|
|
21
20
|
lastInput = JSON.parse(JSON.stringify(input));
|
|
22
21
|
// Needed because of file uploads
|
|
@@ -49,17 +48,16 @@ $: lastInput &&
|
|
|
49
48
|
$state &&
|
|
50
49
|
debounce(async () => (value = await evalExpr(lastInput)));
|
|
51
50
|
async function handleConnection() {
|
|
52
|
-
|
|
53
|
-
if (lastInput.type === 'connected') {
|
|
51
|
+
if (lastInput?.type === 'connected') {
|
|
54
52
|
$worldStore?.connect(lastInput, onValueChange, `${id}-${key}`);
|
|
55
53
|
}
|
|
56
|
-
else if (lastInput
|
|
54
|
+
else if (lastInput?.type === 'static' || lastInput?.type == 'template') {
|
|
57
55
|
value = await getValue(lastInput);
|
|
58
56
|
}
|
|
59
|
-
else if (lastInput
|
|
57
|
+
else if (lastInput?.type == 'eval') {
|
|
60
58
|
value = await evalExpr(lastInput);
|
|
61
59
|
}
|
|
62
|
-
else if (lastInput
|
|
60
|
+
else if (lastInput?.type == 'upload') {
|
|
63
61
|
value = lastInput.value;
|
|
64
62
|
}
|
|
65
63
|
else {
|
|
@@ -79,6 +77,8 @@ async function evalExpr(input) {
|
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
async function getValue(input) {
|
|
80
|
+
if (!input)
|
|
81
|
+
return;
|
|
82
82
|
if (input.type === 'template' && isCodeInjection(input.eval)) {
|
|
83
83
|
try {
|
|
84
84
|
const r = await eval_like('`' + input.eval + '`', computeGlobalContext($worldStore, id, extraContext), true, $state, $mode == 'dnd', $componentControl, $worldStore);
|
|
@@ -97,7 +97,7 @@ async function getValue(input) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
function onValueChange(newValue) {
|
|
100
|
-
if (lastInput
|
|
100
|
+
if (lastInput?.type === 'connected' && newValue !== undefined && newValue !== null) {
|
|
101
101
|
const { connection } = lastInput;
|
|
102
102
|
if (!connection) {
|
|
103
103
|
// No connection
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import { Loader2 } from 'lucide-svelte';
|
|
2
|
+
import { fade } from 'svelte/transition';
|
|
3
|
+
export let loading;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
{#if !loading}
|
|
7
|
+
<slot />
|
|
8
|
+
{:else}
|
|
9
|
+
<div class="w-full h-full">
|
|
10
|
+
<div
|
|
11
|
+
out:fade|local={{ duration: 50 }}
|
|
12
|
+
class="absolute inset-0 center-center flex-col bg-white text-gray-600 border"
|
|
13
|
+
>
|
|
14
|
+
<Loader2 class="animate-spin" size={16} />
|
|
15
|
+
<span class="text-xs mt-1">Loading</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
{/if}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type LoaderProps = typeof __propDef.props;
|
|
14
|
+
export type LoaderEvents = typeof __propDef.events;
|
|
15
|
+
export type LoaderSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Loader extends SvelteComponentTyped<LoaderProps, LoaderEvents, LoaderSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -9,9 +9,6 @@ export let render;
|
|
|
9
9
|
// Sync the result to the output
|
|
10
10
|
const { worldStore } = getContext('AppViewerContext');
|
|
11
11
|
$: outputs = $worldStore?.outputsById?.[id];
|
|
12
|
-
$: if (outputs?.loading != undefined) {
|
|
13
|
-
outputs.loading.set(false, true);
|
|
14
|
-
}
|
|
15
12
|
function setOutput(v) {
|
|
16
13
|
outputs?.result?.set(v, true);
|
|
17
14
|
}
|
|
@@ -25,13 +22,5 @@ $: result && outputs && setOutput(result);
|
|
|
25
22
|
{#if render}
|
|
26
23
|
<slot />
|
|
27
24
|
{:else}
|
|
28
|
-
<div class="w-full h-full"
|
|
29
|
-
<div
|
|
30
|
-
out:fade|local={{ duration: 50 }}
|
|
31
|
-
class="absolute inset-0 center-center flex-col bg-white text-gray-600 border"
|
|
32
|
-
>
|
|
33
|
-
<Loader2 class="animate-spin" size={16} />
|
|
34
|
-
<span class="text-xs mt-1">Loading</span>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
25
|
+
<div class="w-full h-full" />
|
|
37
26
|
{/if}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>import { InputValue } from '.';
|
|
2
|
+
export let id;
|
|
3
|
+
export let extraKey = '';
|
|
4
|
+
export let key;
|
|
5
|
+
export let resolvedConfig;
|
|
6
|
+
export let configuration;
|
|
7
|
+
$: configuration?.type == 'oneOf' && handleSelected(configuration.selected);
|
|
8
|
+
function handleSelected(selected) {
|
|
9
|
+
if (resolvedConfig?.selected != undefined && resolvedConfig?.selected != selected) {
|
|
10
|
+
resolvedConfig.selected = selected;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if configuration?.type == 'oneOf' && resolvedConfig?.type == 'oneOf'}
|
|
16
|
+
{@const choice = resolvedConfig.selected}
|
|
17
|
+
{#each Object.keys(configuration.configuration?.[choice] ?? {}) as nestedKey (nestedKey)}
|
|
18
|
+
{#if resolvedConfig.configuration?.[choice] != undefined}
|
|
19
|
+
<InputValue
|
|
20
|
+
key={key + choice + nestedKey + extraKey}
|
|
21
|
+
{id}
|
|
22
|
+
input={configuration?.configuration?.[choice]?.[nestedKey]}
|
|
23
|
+
bind:value={resolvedConfig.configuration[choice][nestedKey]}
|
|
24
|
+
/>
|
|
25
|
+
{/if}
|
|
26
|
+
{/each}
|
|
27
|
+
{:else}
|
|
28
|
+
<InputValue key={key + extraKey} {id} input={configuration} bind:value={resolvedConfig} />
|
|
29
|
+
{/if}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { RichConfiguration } from '../../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
extraKey?: string | undefined;
|
|
7
|
+
key: string;
|
|
8
|
+
resolvedConfig: any;
|
|
9
|
+
configuration: RichConfiguration;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type ResolveConfigProps = typeof __propDef.props;
|
|
17
|
+
export type ResolveConfigEvents = typeof __propDef.events;
|
|
18
|
+
export type ResolveConfigSlots = typeof __propDef.slots;
|
|
19
|
+
export default class ResolveConfig extends SvelteComponentTyped<ResolveConfigProps, ResolveConfigEvents, ResolveConfigSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|