windmill-components 1.78.0 → 1.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/apps/components/buttons/AppButton.svelte +40 -53
- package/components/apps/components/buttons/AppButton.svelte.d.ts +6 -2
- package/components/apps/components/buttons/AppForm.svelte.d.ts +2 -2
- package/components/apps/components/buttons/AppFormButton.svelte.d.ts +2 -2
- package/components/apps/components/display/AppBarChart.svelte.d.ts +2 -2
- package/components/apps/components/display/AppIcon.svelte.d.ts +2 -3
- package/components/apps/components/display/AppImage.svelte.d.ts +2 -3
- package/components/apps/components/display/AppMap.svelte +3 -3
- package/components/apps/components/display/AppMap.svelte.d.ts +2 -3
- package/components/apps/components/display/AppPdf.svelte.d.ts +2 -3
- package/components/apps/components/display/AppPieChart.svelte.d.ts +2 -2
- package/components/apps/components/display/AppScatterChart.svelte.d.ts +2 -2
- package/components/apps/components/display/AppText.svelte.d.ts +2 -2
- package/components/apps/components/display/AppTimeseries.svelte.d.ts +2 -2
- package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +2 -1
- package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +2 -1
- package/components/apps/components/display/table/AppTable.svelte +77 -25
- package/components/apps/components/display/table/AppTable.svelte.d.ts +2 -2
- package/components/apps/components/helpers/InputValue.svelte +5 -1
- package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -1
- package/components/apps/components/helpers/RunnableComponent.svelte +14 -6
- package/components/apps/components/helpers/eval.js +36 -1
- package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppDateInput.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppFileInput.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppSelect.svelte +1 -0
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +2 -3
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +2 -3
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +2 -3
- package/components/apps/components/layout/AppContainer.svelte +0 -1
- package/components/apps/components/layout/AppContainer.svelte.d.ts +0 -2
- package/components/apps/components/layout/AppDivider.svelte.d.ts +2 -3
- package/components/apps/components/layout/AppDrawer.svelte.d.ts +2 -3
- package/components/apps/components/layout/AppSplitpanes.svelte +1 -5
- package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +0 -2
- package/components/apps/components/layout/AppTabs.svelte +5 -3
- package/components/apps/components/layout/AppTabs.svelte.d.ts +2 -3
- package/components/apps/editor/AppEditor.svelte +3 -2
- package/components/apps/editor/AppEditorHeader.svelte +2 -2
- package/components/apps/editor/AppInputs.svelte +13 -14
- package/components/apps/editor/AppPreview.svelte +2 -1
- package/components/apps/editor/ComponentHeader.svelte +49 -50
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/SettingsPanel.svelte +11 -0
- package/components/apps/editor/SubGridEditor.svelte +2 -2
- package/components/apps/editor/SubGridEditor.svelte.d.ts +1 -1
- package/components/apps/editor/appUtils.d.ts +1 -0
- package/components/apps/editor/appUtils.js +12 -0
- package/components/apps/editor/component/Component.svelte +16 -12
- package/components/apps/editor/component/ComponentNavigation.svelte +11 -1
- package/components/apps/editor/component/components.d.ts +1 -0
- package/components/apps/editor/component/components.js +21 -0
- package/components/apps/editor/contextPanel/ContextPanel.svelte +4 -5
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +0 -1
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +1 -3
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +12 -2
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +14 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +4 -2
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +1 -1
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +19 -34
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +109 -13
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +6 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +12 -100
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +4 -0
- package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +12 -6
- package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte +81 -0
- package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +21 -0
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +18 -0
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +98 -0
- package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +24 -0
- package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.d.ts +2 -0
- package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.js +11 -0
- package/components/apps/inputType.d.ts +11 -2
- package/components/apps/rx.js +3 -2
- package/components/apps/svelte-grid/Grid.svelte +1 -1
- package/components/apps/types.d.ts +20 -2
- package/components/flows/flowStore.js +1 -1
- package/components/graph/FlowGraph.svelte +0 -2
- package/components/graph/FlowGraph.svelte.d.ts +0 -1
- package/components/graph/svelvet/container/views/GraphView.svelte +3 -28
- package/components/graph/svelvet/container/views/GraphView.svelte.d.ts +0 -3
- package/components/graph/svelvet/container/views/Svelvet.svelte +1 -17
- package/components/graph/svelvet/container/views/Svelvet.svelte.d.ts +0 -8
- package/components/graph/svelvet/customCss/controllers/getCss.js +0 -11
- package/components/graph/svelvet/edges/controllers/util.js +1 -2
- package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte.d.ts +2 -2
- package/components/graph/svelvet/nodes/controllers/util.js +1 -1
- package/components/graph/svelvet/nodes/models/Node.d.ts +0 -4
- package/components/graph/svelvet/nodes/models/Node.js +3 -41
- package/components/graph/svelvet/store/controllers/storeApi.js +2 -7
- package/components/graph/svelvet/store/controllers/util.d.ts +0 -7
- package/components/graph/svelvet/store/controllers/util.js +4 -36
- package/components/graph/svelvet/store/types/types.d.ts +0 -5
- package/components/home/ItemsList.svelte +1 -1
- package/package.json +7 -5
- package/utils.d.ts +2 -0
- package/utils.js +6 -0
- package/components/graph/svelvet/nodes/views/EditNode.svelte +0 -147
- package/components/graph/svelvet/nodes/views/EditNode.svelte.d.ts +0 -33
- package/components/graph/svelvet/resizableNodes/controllers/util.d.ts +0 -11
- package/components/graph/svelvet/resizableNodes/controllers/util.js +0 -24
- package/components/graph/svelvet/resizableNodes/models/ResizeNode.d.ts +0 -33
- package/components/graph/svelvet/resizableNodes/models/ResizeNode.js +0 -71
- package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte +0 -81
- package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte.d.ts +0 -20
|
@@ -7,6 +7,7 @@ import { loadIcon } from '../icon';
|
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import { goto } from '$app/navigation';
|
|
9
9
|
import { initOutput } from '../../editor/appUtils';
|
|
10
|
+
import { configurationKeys } from '../../editor/component';
|
|
10
11
|
export let id;
|
|
11
12
|
export let componentInput;
|
|
12
13
|
export let configuration;
|
|
@@ -19,39 +20,44 @@ export let preclickAction = undefined;
|
|
|
19
20
|
export let customCss = undefined;
|
|
20
21
|
export let render;
|
|
21
22
|
export let initializing = true;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export let controls = undefined;
|
|
24
|
+
const { worldStore, app, componentControl } = getContext('AppViewerContext');
|
|
25
|
+
if (controls) {
|
|
26
|
+
$componentControl[id] = controls;
|
|
27
|
+
}
|
|
26
28
|
let runnableComponent;
|
|
27
|
-
let
|
|
28
|
-
let
|
|
29
|
-
let
|
|
30
|
-
let
|
|
29
|
+
// let labelValue: string
|
|
30
|
+
// let color: ButtonType.Color
|
|
31
|
+
// let size: ButtonType.Size
|
|
32
|
+
// let disabled: boolean | undefined = undefined
|
|
33
|
+
// let fillContainer: boolean | undefined = undefined
|
|
34
|
+
// let gotoUrl: string | undefined = undefined
|
|
35
|
+
// let gotoNewTab: boolean | undefined = undefined
|
|
31
36
|
let isLoading = false;
|
|
32
37
|
let ownClick = false;
|
|
33
|
-
let
|
|
34
|
-
let
|
|
35
|
-
let
|
|
38
|
+
// let beforeIcon: undefined | string = undefined
|
|
39
|
+
// let afterIcon: undefined | string = undefined
|
|
40
|
+
let resolvedConfig = {};
|
|
41
|
+
$: initializing = resolvedConfig?.label == undefined;
|
|
36
42
|
let beforeIconComponent;
|
|
37
43
|
let afterIconComponent;
|
|
38
|
-
$: beforeIcon && handleBeforeIcon();
|
|
39
|
-
$: afterIcon && handleAfterIcon();
|
|
44
|
+
$: resolvedConfig.beforeIcon && handleBeforeIcon();
|
|
45
|
+
$: resolvedConfig.afterIcon && handleAfterIcon();
|
|
40
46
|
async function handleBeforeIcon() {
|
|
41
|
-
if (beforeIcon) {
|
|
42
|
-
beforeIconComponent = await loadIcon(beforeIcon);
|
|
47
|
+
if (resolvedConfig.beforeIcon) {
|
|
48
|
+
beforeIconComponent = await loadIcon(resolvedConfig.beforeIcon);
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
async function handleAfterIcon() {
|
|
46
|
-
if (afterIcon) {
|
|
47
|
-
afterIconComponent = await loadIcon(afterIcon);
|
|
52
|
+
if (resolvedConfig.afterIcon) {
|
|
53
|
+
afterIconComponent = await loadIcon(resolvedConfig.afterIcon);
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
let outputs = initOutput($worldStore, id, {
|
|
51
57
|
result: undefined,
|
|
52
58
|
loading: false
|
|
53
59
|
});
|
|
54
|
-
$: triggerOnAppLoad && runnableComponent?.runComponent();
|
|
60
|
+
$: resolvedConfig.triggerOnAppLoad && runnableComponent?.runComponent();
|
|
55
61
|
$: if (outputs?.loading != undefined) {
|
|
56
62
|
outputs.loading.set(false, true);
|
|
57
63
|
}
|
|
@@ -77,12 +83,12 @@ async function handleClick(event) {
|
|
|
77
83
|
}
|
|
78
84
|
ownClick = true;
|
|
79
85
|
if (!runnableComponent) {
|
|
80
|
-
if (gotoUrl) {
|
|
81
|
-
if (gotoNewTab) {
|
|
82
|
-
window.open(gotoUrl, '_blank');
|
|
86
|
+
if (resolvedConfig.gotoUrl) {
|
|
87
|
+
if (resolvedConfig.gotoNewTab) {
|
|
88
|
+
window.open(resolvedConfig.gotoUrl, '_blank');
|
|
83
89
|
}
|
|
84
90
|
else {
|
|
85
|
-
goto(gotoUrl);
|
|
91
|
+
goto(resolvedConfig.gotoUrl);
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
94
|
}
|
|
@@ -92,28 +98,9 @@ async function handleClick(event) {
|
|
|
92
98
|
}
|
|
93
99
|
</script>
|
|
94
100
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
input={configuration.label}
|
|
99
|
-
bind:value={labelValue}
|
|
100
|
-
/>
|
|
101
|
-
<InputValue {id} input={configuration.goto} bind:value={gotoUrl} />
|
|
102
|
-
<InputValue {id} input={configuration.color} bind:value={color} />
|
|
103
|
-
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
104
|
-
<InputValue {id} input={configuration.beforeIcon} bind:value={beforeIcon} />
|
|
105
|
-
<InputValue {id} input={configuration.afterIcon} bind:value={afterIcon} />
|
|
106
|
-
<InputValue {id} input={configuration.triggerOnAppLoad} bind:value={triggerOnAppLoad} />
|
|
107
|
-
|
|
108
|
-
<InputValue
|
|
109
|
-
{id}
|
|
110
|
-
input={configuration.disabled}
|
|
111
|
-
extraContext={extraQueryParams}
|
|
112
|
-
bind:value={disabled}
|
|
113
|
-
bind:error={errors.disabled}
|
|
114
|
-
/>
|
|
115
|
-
<InputValue {id} input={configuration.fillContainer} bind:value={fillContainer} />
|
|
116
|
-
<InputValue {id} input={configuration.gotoNewTab} bind:value={gotoNewTab} />
|
|
101
|
+
{#each configurationKeys['buttoncomponent'] as key (key)}
|
|
102
|
+
<InputValue {key} {id} input={configuration[key]} bind:value={resolvedConfig[key]} />
|
|
103
|
+
{/each}
|
|
117
104
|
|
|
118
105
|
<RunnableWrapper
|
|
119
106
|
{recomputeIds}
|
|
@@ -122,8 +109,8 @@ async function handleClick(event) {
|
|
|
122
109
|
{id}
|
|
123
110
|
{extraQueryParams}
|
|
124
111
|
autoRefresh={false}
|
|
125
|
-
goto={gotoUrl}
|
|
126
|
-
{gotoNewTab}
|
|
112
|
+
goto={resolvedConfig.gotoUrl}
|
|
113
|
+
gotoNewTab={resolvedConfig.gotoNewTab}
|
|
127
114
|
{render}
|
|
128
115
|
>
|
|
129
116
|
<AlignWrapper {noWFull} {horizontalAlignment} {verticalAlignment}>
|
|
@@ -134,25 +121,25 @@ async function handleClick(event) {
|
|
|
134
121
|
btnClasses={twMerge(
|
|
135
122
|
$app.css?.['buttoncomponent']?.['button']?.class,
|
|
136
123
|
customCss?.button.class,
|
|
137
|
-
fillContainer ? 'w-full h-full' : ''
|
|
124
|
+
resolvedConfig.fillContainer ? 'w-full h-full' : ''
|
|
138
125
|
)}
|
|
139
126
|
style={[$app.css?.['buttoncomponent']?.['button']?.style, customCss?.button.style].join(';')}
|
|
140
|
-
{disabled}
|
|
127
|
+
disabled={resolvedConfig.disabled}
|
|
141
128
|
on:pointerdown={(e) => {
|
|
142
129
|
e?.stopPropagation()
|
|
143
130
|
window.dispatchEvent(new Event('pointerup'))
|
|
144
131
|
}}
|
|
145
132
|
on:click={handleClick}
|
|
146
|
-
{size}
|
|
147
|
-
{color}
|
|
133
|
+
size={resolvedConfig.size}
|
|
134
|
+
color={resolvedConfig.color}
|
|
148
135
|
{loading}
|
|
149
136
|
>
|
|
150
137
|
<span class="truncate inline-flex gap-2 items-center">
|
|
151
|
-
{#if beforeIcon && beforeIconComponent}
|
|
138
|
+
{#if resolvedConfig.beforeIcon && beforeIconComponent}
|
|
152
139
|
<svelte:component this={beforeIconComponent} size={14} />
|
|
153
140
|
{/if}
|
|
154
|
-
<div>{
|
|
155
|
-
{#if afterIcon && afterIconComponent}
|
|
141
|
+
<div>{resolvedConfig.label}</div>
|
|
142
|
+
{#if resolvedConfig.afterIcon && afterIconComponent}
|
|
156
143
|
<svelte:component this={afterIconComponent} size={14} />
|
|
157
144
|
{/if}
|
|
158
145
|
</span>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
9
9
|
recomputeIds?: string[] | undefined;
|
|
10
10
|
extraQueryParams?: Record<string, any> | undefined;
|
|
11
11
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
@@ -15,6 +15,10 @@ declare const __propDef: {
|
|
|
15
15
|
customCss?: ComponentCustomCSS<'button'> | undefined;
|
|
16
16
|
render: boolean;
|
|
17
17
|
initializing?: boolean | undefined;
|
|
18
|
+
controls?: {
|
|
19
|
+
left: () => boolean;
|
|
20
|
+
right: () => boolean | string;
|
|
21
|
+
} | undefined;
|
|
18
22
|
};
|
|
19
23
|
events: {
|
|
20
24
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
9
9
|
recomputeIds?: string[] | undefined;
|
|
10
10
|
extraQueryParams?: Record<string, any> | undefined;
|
|
11
11
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
9
9
|
recomputeIds?: string[] | undefined;
|
|
10
10
|
extraQueryParams?: Record<string, any> | undefined;
|
|
11
11
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
9
9
|
initializing?: boolean | undefined;
|
|
10
10
|
customCss?: ComponentCustomCSS<'container'> | undefined;
|
|
11
11
|
render: boolean;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
2
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
5
|
id: string;
|
|
7
6
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
8
7
|
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
9
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
10
9
|
customCss?: ComponentCustomCSS<'container' | 'icon'> | undefined;
|
|
11
10
|
render: boolean;
|
|
12
11
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
2
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
5
|
id: string;
|
|
7
|
-
configuration:
|
|
6
|
+
configuration: RichConfigurations;
|
|
8
7
|
customCss?: ComponentCustomCSS<'image'> | undefined;
|
|
9
8
|
render: boolean;
|
|
10
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { getContext
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
2
|
import { concatCustomCss } from '../../utils';
|
|
3
3
|
import { InputValue } from '../helpers';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -97,7 +97,7 @@ function updateMarkers() {
|
|
|
97
97
|
}
|
|
98
98
|
createMarkerLayers()?.forEach((l) => map.addLayer(l));
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
$: if (!map && mapElement) {
|
|
101
101
|
useGeographic();
|
|
102
102
|
map = new Map({
|
|
103
103
|
target: mapElement,
|
|
@@ -116,7 +116,7 @@ onMount(() => {
|
|
|
116
116
|
})
|
|
117
117
|
});
|
|
118
118
|
updateRegionOutput();
|
|
119
|
-
}
|
|
119
|
+
}
|
|
120
120
|
$: css = concatCustomCss($app.css?.mapcomponent, customCss);
|
|
121
121
|
function updateRegionOutput() {
|
|
122
122
|
if (map) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
2
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
5
|
id: string;
|
|
7
|
-
configuration:
|
|
6
|
+
configuration: RichConfigurations;
|
|
8
7
|
customCss?: ComponentCustomCSS<'map'> | undefined;
|
|
9
8
|
render: boolean;
|
|
10
9
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import 'pdfjs-dist/build/pdf.worker.entry';
|
|
3
|
-
import type {
|
|
4
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
5
4
|
declare const __propDef: {
|
|
6
5
|
props: {
|
|
7
6
|
id: string;
|
|
8
|
-
configuration:
|
|
7
|
+
configuration: RichConfigurations;
|
|
9
8
|
customCss?: ComponentCustomCSS<'container'> | undefined;
|
|
10
9
|
render: boolean;
|
|
11
10
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
9
9
|
initializing?: boolean | undefined;
|
|
10
10
|
customCss?: ComponentCustomCSS<'container'> | undefined;
|
|
11
11
|
render: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
9
9
|
initializing?: boolean | undefined;
|
|
10
10
|
customCss?: ComponentCustomCSS<'container'> | undefined;
|
|
11
11
|
render: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
3
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
id: string;
|
|
7
7
|
componentInput: AppInput | undefined;
|
|
8
8
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
9
9
|
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
10
|
-
configuration:
|
|
10
|
+
configuration: RichConfigurations;
|
|
11
11
|
initializing?: boolean | undefined;
|
|
12
12
|
customCss?: ComponentCustomCSS<'text'> | undefined;
|
|
13
13
|
render: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import 'chartjs-adapter-date-fns';
|
|
3
3
|
import type { AppInput } from '../../inputType';
|
|
4
|
-
import type { ComponentCustomCSS } from '../../types';
|
|
4
|
+
import type { ComponentCustomCSS, RichConfigurations } from '../../types';
|
|
5
5
|
declare const __propDef: {
|
|
6
6
|
props: {
|
|
7
7
|
id: string;
|
|
8
8
|
componentInput: AppInput | undefined;
|
|
9
|
-
configuration:
|
|
9
|
+
configuration: RichConfigurations;
|
|
10
10
|
initializing?: boolean | undefined;
|
|
11
11
|
customCss?: ComponentCustomCSS<'container'> | undefined;
|
|
12
12
|
render: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
+
import type { RichConfigurations } from '../../types';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
id: string;
|
|
6
7
|
componentInput: AppInput | undefined;
|
|
7
|
-
configuration:
|
|
8
|
+
configuration: RichConfigurations;
|
|
8
9
|
initializing?: boolean | undefined;
|
|
9
10
|
render: boolean;
|
|
10
11
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import 'ag-grid-community/styles/ag-grid.css';
|
|
3
3
|
import 'ag-grid-community/styles/ag-theme-alpine.css';
|
|
4
|
+
import type { RichConfigurations } from '../../../types';
|
|
4
5
|
import type { AppInput } from '../../../inputType';
|
|
5
6
|
declare const __propDef: {
|
|
6
7
|
props: {
|
|
7
8
|
id: string;
|
|
8
9
|
componentInput: AppInput | undefined;
|
|
9
|
-
configuration:
|
|
10
|
+
configuration: RichConfigurations;
|
|
10
11
|
initializing?: boolean | undefined;
|
|
11
12
|
render: boolean;
|
|
12
13
|
};
|
|
@@ -33,7 +33,7 @@ const options = writable({
|
|
|
33
33
|
columns: []
|
|
34
34
|
});
|
|
35
35
|
let table = createSvelteTable(options);
|
|
36
|
-
const { app, worldStore } = getContext('AppViewerContext');
|
|
36
|
+
const { app, worldStore, componentControl, selectedComponent } = getContext('AppViewerContext');
|
|
37
37
|
let selectedRowIndex = -1;
|
|
38
38
|
function toggleRow(row, rowIndex, force = false) {
|
|
39
39
|
if (selectedRowIndex !== rowIndex || force) {
|
|
@@ -105,6 +105,19 @@ function rerender() {
|
|
|
105
105
|
}
|
|
106
106
|
$: result && rerender();
|
|
107
107
|
$: css = concatCustomCss($app.css?.tablecomponent, customCss);
|
|
108
|
+
$componentControl[id] = {
|
|
109
|
+
right: (skipActions) => {
|
|
110
|
+
if (skipActions) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
const hasActions = actionButtons.length >= 1;
|
|
114
|
+
if (hasActions) {
|
|
115
|
+
$selectedComponent = actionButtons[0].id;
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
108
121
|
</script>
|
|
109
122
|
|
|
110
123
|
<InputValue {id} input={configuration.search} bind:value={search} />
|
|
@@ -187,6 +200,7 @@ $: css = concatCustomCss($app.css?.tablecomponent, customCss);
|
|
|
187
200
|
{#if context}
|
|
188
201
|
{@const component = renderCell(cell.column.columnDef.cell, context)}
|
|
189
202
|
<td
|
|
203
|
+
on:keydown={() => toggleRow(row, rowIndex)}
|
|
190
204
|
on:click={() => toggleRow(row, rowIndex)}
|
|
191
205
|
class="p-4 whitespace-pre-wrap truncate text-xs text-gray-900"
|
|
192
206
|
>
|
|
@@ -206,31 +220,69 @@ $: css = concatCustomCss($app.css?.tablecomponent, customCss);
|
|
|
206
220
|
on:keypress={() => toggleRow(row, rowIndex)}
|
|
207
221
|
on:click={() => toggleRow(row, rowIndex)}
|
|
208
222
|
>
|
|
209
|
-
<div class="center-center h-full w-full flex-wrap gap-1">
|
|
223
|
+
<div class="center-center h-full w-full flex-wrap gap-1 ">
|
|
210
224
|
{#each actionButtons as actionButton, actionIndex (actionIndex)}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
<div
|
|
226
|
+
class={actionButton.id === $selectedComponent
|
|
227
|
+
? 'outline outline-indigo-500 outline-1 outline-offset-1 relative '
|
|
228
|
+
: ''}
|
|
229
|
+
>
|
|
230
|
+
{#if actionButton.id === $selectedComponent}
|
|
231
|
+
<span
|
|
232
|
+
title={`Id: ${actionButton.id}`}
|
|
233
|
+
class={classNames(
|
|
234
|
+
'px-2 text-2xs font-bold w-fit absolute shadow -top-5 -left-[2px] border z-50 rounded-sm',
|
|
235
|
+
'bg-indigo-500/90 border-indigo-600 text-white'
|
|
236
|
+
)}
|
|
237
|
+
>
|
|
238
|
+
{actionButton.id}
|
|
239
|
+
</span>
|
|
240
|
+
{/if}
|
|
241
|
+
{#if rowIndex == 0}
|
|
242
|
+
<AppButton
|
|
243
|
+
{render}
|
|
244
|
+
noWFull
|
|
245
|
+
{...actionButton}
|
|
246
|
+
preclickAction={async () => {
|
|
247
|
+
toggleRow(row, rowIndex)
|
|
248
|
+
}}
|
|
249
|
+
extraQueryParams={{ row: row.original }}
|
|
250
|
+
bind:componentInput={actionButton.componentInput}
|
|
251
|
+
controls={{
|
|
252
|
+
left: () => {
|
|
253
|
+
if (actionIndex === 0) {
|
|
254
|
+
$selectedComponent = id
|
|
255
|
+
return true
|
|
256
|
+
} else if (actionIndex > 0) {
|
|
257
|
+
$selectedComponent = actionButtons[actionIndex - 1].id
|
|
258
|
+
return true
|
|
259
|
+
}
|
|
260
|
+
return false
|
|
261
|
+
},
|
|
262
|
+
right: () => {
|
|
263
|
+
if (actionIndex === actionButtons.length - 1) {
|
|
264
|
+
return id
|
|
265
|
+
} else if (actionIndex < actionButtons.length - 1) {
|
|
266
|
+
$selectedComponent = actionButtons[actionIndex + 1].id
|
|
267
|
+
return true
|
|
268
|
+
}
|
|
269
|
+
return false
|
|
270
|
+
}
|
|
271
|
+
}}
|
|
272
|
+
/>
|
|
273
|
+
{:else}
|
|
274
|
+
<AppButton
|
|
275
|
+
{render}
|
|
276
|
+
noWFull
|
|
277
|
+
{...actionButton}
|
|
278
|
+
preclickAction={async () => {
|
|
279
|
+
toggleRow(row, rowIndex)
|
|
280
|
+
}}
|
|
281
|
+
extraQueryParams={{ row: row.original }}
|
|
282
|
+
bind:componentInput={actionButton.componentInput}
|
|
283
|
+
/>
|
|
284
|
+
{/if}
|
|
285
|
+
</div>
|
|
234
286
|
{/each}
|
|
235
287
|
</div>
|
|
236
288
|
</td>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { BaseAppComponent, ComponentCustomCSS } from '../../../types';
|
|
2
|
+
import type { BaseAppComponent, ComponentCustomCSS, RichConfigurations } from '../../../types';
|
|
3
3
|
import type { AppInput } from '../../../inputType';
|
|
4
4
|
import type { ButtonComponent } from '../../../editor/component';
|
|
5
5
|
declare const __propDef: {
|
|
6
6
|
props: {
|
|
7
7
|
id: string;
|
|
8
8
|
componentInput: AppInput | undefined;
|
|
9
|
-
configuration:
|
|
9
|
+
configuration: RichConfigurations;
|
|
10
10
|
actionButtons: (BaseAppComponent & ButtonComponent)[];
|
|
11
11
|
initializing?: boolean | undefined;
|
|
12
12
|
customCss?: ComponentCustomCSS<'container' | 'tableHeader' | 'tableBody' | 'tableFooter'> | undefined;
|
|
@@ -8,12 +8,15 @@ export let value;
|
|
|
8
8
|
export let id = undefined;
|
|
9
9
|
export let error = '';
|
|
10
10
|
export let extraContext = {};
|
|
11
|
+
export let key = '';
|
|
12
|
+
$: console.log(value);
|
|
11
13
|
const { componentControl } = getContext('AppViewerContext');
|
|
12
14
|
const dispatch = createEventDispatcher();
|
|
13
15
|
if (input == undefined) {
|
|
14
16
|
dispatch('done');
|
|
15
17
|
}
|
|
16
18
|
let lastInput = input ? JSON.parse(JSON.stringify(input)) : undefined;
|
|
19
|
+
$: console.log(input);
|
|
17
20
|
$: if (input && !deepEqual(input, lastInput)) {
|
|
18
21
|
lastInput = JSON.parse(JSON.stringify(input));
|
|
19
22
|
// Needed because of file uploads
|
|
@@ -46,8 +49,9 @@ $: lastInput &&
|
|
|
46
49
|
$state &&
|
|
47
50
|
debounce(async () => (value = await evalExpr(lastInput)));
|
|
48
51
|
async function handleConnection() {
|
|
52
|
+
console.log('handleConnection', lastInput);
|
|
49
53
|
if (lastInput.type === 'connected') {
|
|
50
|
-
$worldStore?.connect(lastInput, onValueChange, id);
|
|
54
|
+
$worldStore?.connect(lastInput, onValueChange, `${id}-${key}`);
|
|
51
55
|
}
|
|
52
56
|
else if (lastInput.type === 'static' || lastInput.type == 'template') {
|
|
53
57
|
value = await getValue(lastInput);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
+
import type { RichConfiguration } from '../../types';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
|
-
input: AppInput |
|
|
6
|
+
input: AppInput | RichConfiguration;
|
|
6
7
|
value: string | number | boolean | Record<string | number, any> | undefined;
|
|
7
8
|
id?: string | undefined;
|
|
8
9
|
error?: string | undefined;
|
|
9
10
|
extraContext?: Record<string, any> | undefined;
|
|
11
|
+
key?: string | undefined;
|
|
10
12
|
};
|
|
11
13
|
events: {
|
|
12
14
|
done: CustomEvent<any>;
|
|
@@ -70,10 +70,6 @@ $: if (JSON.stringify(currentStaticValues) != JSON.stringify(lazyStaticValues))
|
|
|
70
70
|
}
|
|
71
71
|
$: fields && (lazyStaticValues = computeStaticValues());
|
|
72
72
|
$: (runnableInputValues || extraQueryParams || args) && testJobLoader && refreshIfAutoRefresh();
|
|
73
|
-
$: runnable?.type == 'runnableByName' &&
|
|
74
|
-
runnable.inlineScript?.language == 'frontend' &&
|
|
75
|
-
($stateId || $state) &&
|
|
76
|
-
refreshIfAutoRefresh();
|
|
77
73
|
function refreshIfAutoRefresh() {
|
|
78
74
|
if (autoRefresh) {
|
|
79
75
|
setDebouncedExecute();
|
|
@@ -208,12 +204,24 @@ function setResult(res) {
|
|
|
208
204
|
$: result?.error && recordError(result.error);
|
|
209
205
|
</script>
|
|
210
206
|
|
|
211
|
-
{#each Object.entries(fields ?? {}) as [key, v]}
|
|
207
|
+
{#each Object.entries(fields ?? {}) as [key, v] (key)}
|
|
212
208
|
{#if v.type != 'static' && v.type != 'user'}
|
|
213
|
-
<InputValue {id} input={fields[key]} bind:value={runnableInputValues[key]} />
|
|
209
|
+
<InputValue {key} {id} input={fields[key]} bind:value={runnableInputValues[key]} />
|
|
214
210
|
{/if}
|
|
215
211
|
{/each}
|
|
216
212
|
|
|
213
|
+
{#if runnable?.type == 'runnableByName' && runnable.inlineScript?.language == 'frontend'}
|
|
214
|
+
{#each runnable.inlineScript.refreshOn ?? [] as { id: tid, key } (`${tid}-${key}`)}
|
|
215
|
+
{@const fkey = `${tid}-${key}`}
|
|
216
|
+
<InputValue
|
|
217
|
+
{id}
|
|
218
|
+
key={fkey}
|
|
219
|
+
input={{ type: 'connected', connection: { componentId: tid, path: key }, fieldType: 'any' }}
|
|
220
|
+
bind:value={runnableInputValues[fkey]}
|
|
221
|
+
/>
|
|
222
|
+
{/each}
|
|
223
|
+
{/if}
|
|
224
|
+
|
|
217
225
|
<TestJobLoader
|
|
218
226
|
workspaceOverride={workspace}
|
|
219
227
|
on:done={(e) => {
|