windmill-components 1.75.0 → 1.77.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/DisplayResult.svelte +1 -1
- package/components/Dropdown.svelte +14 -4
- package/components/FlowGraphViewer.svelte +1 -1
- package/components/FolderUsageInfo.svelte +16 -6
- package/components/FolderUsageInfo.svelte.d.ts +2 -0
- package/components/PageHeader.svelte +1 -1
- package/components/Path.svelte +22 -3
- package/components/ScriptBuilder.svelte +122 -122
- package/components/SettingSection.svelte +44 -0
- package/components/SettingSection.svelte.d.ts +21 -0
- package/components/Tooltip.svelte +3 -1
- package/components/WhitelistIp.svelte +1 -3
- package/components/apps/components/buttons/AppButton.svelte +11 -5
- package/components/apps/components/buttons/AppButton.svelte.d.ts +1 -0
- package/components/apps/components/buttons/AppForm.svelte +3 -7
- package/components/apps/components/buttons/AppFormButton.svelte +2 -6
- package/components/apps/components/display/table/AppAggridTable.svelte +4 -1
- package/components/apps/components/display/table/AppTable.svelte +4 -1
- package/components/apps/components/helpers/HiddenComponent.svelte +3 -0
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -0
- package/components/apps/components/helpers/InputValue.svelte +26 -43
- package/components/apps/components/helpers/InputValue.svelte.d.ts +4 -3
- package/components/apps/components/helpers/RefreshButton.svelte +2 -3
- package/components/apps/components/helpers/RunnableComponent.svelte +61 -34
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte +2 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/components/apps/components/helpers/eval.d.ts +5 -0
- package/components/apps/components/helpers/eval.js +57 -0
- package/components/apps/components/layout/AppContainer.svelte +1 -6
- package/components/apps/components/layout/AppDrawer.svelte +0 -3
- package/components/apps/components/layout/AppSplitpanes.svelte +1 -6
- package/components/apps/components/layout/AppTabs.svelte +64 -33
- package/components/apps/components/layout/AppTabs.svelte.d.ts +1 -0
- package/components/apps/editor/AppEditor.svelte +136 -131
- package/components/apps/editor/AppEditorHeader.svelte +43 -35
- package/components/apps/editor/AppPreview.svelte +3 -2
- package/components/apps/editor/ComponentHeader.svelte +3 -1
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -0
- package/components/apps/editor/GridEditor.svelte +53 -51
- package/components/apps/editor/RecomputeAllComponents.svelte +7 -1
- package/components/apps/editor/SettingsPanel.svelte +23 -10
- package/components/apps/editor/SubGridEditor.svelte +56 -52
- package/components/apps/editor/SubGridEditor.svelte.d.ts +3 -4
- package/components/apps/editor/appUtils.d.ts +12 -3
- package/components/apps/editor/appUtils.js +111 -37
- package/components/apps/editor/component/Component.svelte +4 -9
- package/components/apps/editor/component/ComponentNavigation.svelte +91 -46
- package/components/apps/editor/component/components.d.ts +1 -1
- package/components/apps/editor/component/components.js +24 -43
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +1 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.js +1 -0
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +77 -0
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +21 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +9 -5
- package/components/apps/editor/contextPanel/ContextPanel.svelte +80 -136
- package/components/apps/editor/contextPanel/SubGridOutput.svelte +71 -0
- package/components/apps/editor/contextPanel/SubGridOutput.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +38 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +10 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +78 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +26 -0
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte +19 -0
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte.d.ts +18 -0
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +14 -0
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte.d.ts +18 -0
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +53 -21
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +69 -43
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +1 -1
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +32 -31
- package/components/apps/editor/settingsPanel/GridTab.svelte +4 -12
- package/components/apps/editor/settingsPanel/Recompute.svelte +1 -0
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +6 -0
- package/components/apps/editor/settingsPanel/TableActions.svelte +2 -1
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +2 -8
- package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +58 -46
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +2 -0
- package/components/apps/rx.d.ts +6 -4
- package/components/apps/rx.js +34 -14
- package/components/apps/svelte-grid/Grid.svelte +171 -0
- package/components/apps/svelte-grid/Grid.svelte.d.ts +47 -0
- package/components/apps/svelte-grid/LICENSE +23 -0
- package/components/apps/svelte-grid/MoveResize.svelte +328 -0
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +46 -0
- package/components/apps/svelte-grid/types.d.ts +25 -0
- package/components/apps/svelte-grid/utils/container.d.ts +1 -0
- package/components/apps/svelte-grid/utils/container.js +4 -0
- package/components/apps/svelte-grid/utils/helper.d.ts +14 -0
- package/components/apps/svelte-grid/utils/helper.js +36 -0
- package/components/apps/svelte-grid/utils/item.d.ts +14 -0
- package/components/apps/svelte-grid/utils/item.js +192 -0
- package/components/apps/svelte-grid/utils/matrix.d.ts +6 -0
- package/components/apps/svelte-grid/utils/matrix.js +53 -0
- package/components/apps/svelte-grid/utils/other.d.ts +3 -0
- package/components/apps/svelte-grid/utils/other.js +30 -0
- package/components/apps/types.d.ts +10 -7
- package/components/apps/utils.d.ts +1 -1
- package/components/apps/utils.js +13 -7
- package/components/common/CloseButton.svelte +18 -0
- package/components/common/CloseButton.svelte.d.ts +27 -0
- package/components/common/badge/Badge.svelte +6 -1
- package/components/common/badge/Badge.svelte.d.ts +1 -0
- package/components/common/drawer/DrawerContent.svelte +2 -6
- package/components/common/languageIcons/JavaScript.svelte +11 -0
- package/components/common/languageIcons/JavaScript.svelte.d.ts +25 -0
- package/components/common/languageIcons/LanguageIcon.svelte +3 -1
- package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
- package/components/common/menu/Menu.svelte +1 -1
- package/components/common/popup/Popup.svelte +2 -1
- package/components/common/popup/Popup.svelte.d.ts +9 -0
- package/components/common/table/AppRow.svelte +1 -4
- package/components/common/table/FlowRow.svelte +1 -4
- package/components/common/table/ScriptRow.svelte +1 -4
- package/components/common/tabs/Tab.svelte +1 -0
- package/components/common/tabs/Tab.svelte.d.ts +2 -0
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
- package/components/graph/FlowGraph.svelte +1 -1
- package/components/sidebar/SidebarContent.svelte +2 -2
- package/consts.js +1 -1
- package/history.js +8 -1
- package/package.json +21 -27
- package/utils.js +0 -1
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte +0 -92
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte.d.ts +0 -18
- package/components/graph/svelvet/d3/controllers/README.md +0 -3
- package/components/graph/svelvet/d3/controllers/d3Old.d.ts +0 -1
- package/components/graph/svelvet/d3/controllers/d3Old.js +0 -43
- package/components/graph/svelvet/docs/CHANGELOG.md +0 -145
- package/components/graph/svelvet/docs/DESIGN_PATTERNS.md +0 -44
- package/components/graph/svelvet/docs/DOCUMENTATION.md +0 -5
- package/components/graph/svelvet/docs/README.md +0 -34
- package/components/graph/svelvet/docs/TODO.md +0 -14
- package/components/graph/svelvet/docs/Tutorials.md +0 -25
- package/components/graph/svelvet/docs/images/css-background-after.png +0 -0
- package/components/graph/svelvet/docs/images/css-background-before.png +0 -0
- package/components/graph/svelvet/docs/images/custom-edges-after.png +0 -0
- package/components/graph/svelvet/docs/images/custom-edges-before.png +0 -0
- package/components/graph/svelvet/docs/images/custom-nodes-after.png +0 -0
- package/components/graph/svelvet/docs/images/custom-nodes-before.png +0 -0
- package/components/graph/svelvet/docs/images/custom-svelte-components-after.png +0 -0
- package/components/graph/svelvet/docs/images/custom-svelte-components-before.png +0 -0
- package/components/graph/svelvet/docs/images/html-docs-after.png +0 -0
- package/components/graph/svelvet/docs/images/html-docs-before.png +0 -0
- package/components/graph/svelvet/docs/images/minimap-after.png +0 -0
- package/components/graph/svelvet/docs/images/minimap-before.png +0 -0
- package/components/graph/svelvet/docs/images/node-classes-after.png +0 -0
- package/components/graph/svelvet/docs/images/node-classes-before.png +0 -0
- package/components/graph/svelvet/docs/images/node-create-after.png +0 -0
- package/components/graph/svelvet/docs/images/node-create-before.png +0 -0
|
@@ -1,149 +1,93 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import ObjectViewer from '../../../propertyPicker/ObjectViewer.svelte';
|
|
2
2
|
import { X } from 'lucide-svelte';
|
|
3
|
-
import { getContext } from 'svelte';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { findGridItem } from '../appUtils';
|
|
7
|
-
import { components } from '../component';
|
|
3
|
+
import { getContext, setContext } from 'svelte';
|
|
4
|
+
import { writable } from 'svelte/store';
|
|
5
|
+
import { connectInput, recursivelyFilterKeyInJSON, sortGridItemsPosition } from '../appUtils';
|
|
8
6
|
import PanelSection from '../settingsPanel/common/PanelSection.svelte';
|
|
7
|
+
import ComponentOutput from './ComponentOutput.svelte';
|
|
9
8
|
import ComponentOutputViewer from './ComponentOutputViewer.svelte';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type: 'connected'
|
|
21
|
-
},
|
|
22
|
-
hoveredComponent: undefined
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function getComponentNameById(componentId) {
|
|
27
|
-
const component = findGridItem($app, componentId);
|
|
28
|
-
if (component?.data?.type) {
|
|
29
|
-
return components[component?.data.type].name;
|
|
30
|
-
}
|
|
31
|
-
else if (componentId == 'ctx') {
|
|
32
|
-
return 'Context';
|
|
33
|
-
}
|
|
34
|
-
else if (componentId.startsWith('bg_')) {
|
|
35
|
-
return 'Background';
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return 'Table action';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
$: panels = [['ctx', ['email', 'username', 'query', 'hash']]].concat(Object.entries($staticOutputs));
|
|
42
|
-
let search = '';
|
|
43
|
-
// filter out outputs that don't match the search by name (computed by getComponentNameById) and id
|
|
44
|
-
// The output should be [string, string[]][]
|
|
45
|
-
$: filteredPanels = panels.filter(([componentId, outputs]) => {
|
|
46
|
-
const name = getComponentNameById(componentId);
|
|
47
|
-
return (name.toLowerCase().includes(search.toLowerCase()) ||
|
|
48
|
-
componentId.toLowerCase().includes(search.toLowerCase()));
|
|
9
|
+
import BackgroundScriptsOutput from './components/BackgroundScriptsOutput.svelte';
|
|
10
|
+
import MinMaxButton from './components/MinMaxButton.svelte';
|
|
11
|
+
import OutputHeader from './components/OutputHeader.svelte';
|
|
12
|
+
const { connectingInput, breakpoint, app, state } = getContext('AppViewerContext');
|
|
13
|
+
let search = writable('');
|
|
14
|
+
let expanded = false;
|
|
15
|
+
let ctxOpened = true;
|
|
16
|
+
let stateOpened = true;
|
|
17
|
+
setContext('searchCtx', {
|
|
18
|
+
search
|
|
49
19
|
});
|
|
20
|
+
let sortedItems = sortGridItemsPosition($app.grid, $breakpoint);
|
|
21
|
+
$: $app.subgrids &&
|
|
22
|
+
setTimeout(() => (sortedItems = sortGridItemsPosition($app.grid, $breakpoint)), 500);
|
|
23
|
+
$: expanded && !ctxOpened && (ctxOpened = true);
|
|
24
|
+
$: expanded && !stateOpened && (stateOpened = true);
|
|
25
|
+
$: filteredState = recursivelyFilterKeyInJSON($state, $search);
|
|
50
26
|
</script>
|
|
51
27
|
|
|
52
28
|
<PanelSection noPadding titlePadding="px-4 pt-2 pb-0.5" title="Outputs">
|
|
53
|
-
<div
|
|
54
|
-
<div class="
|
|
55
|
-
<div class="
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
<div class="relative p-2">
|
|
72
|
-
{#each filteredPanels as [componentId, outputs] (componentId)}
|
|
73
|
-
<div
|
|
74
|
-
animate:flip={{ duration: 300 }}
|
|
75
|
-
in:fade|local={{ duration: 100, delay: 50 }}
|
|
76
|
-
out:fade|local={{ duration: 100 }}
|
|
77
|
-
class="pb-2"
|
|
78
|
-
>
|
|
79
|
-
{#if outputs.length > 0 && $worldStore?.outputsById[componentId]}
|
|
80
|
-
{@const name = getComponentNameById(componentId)}
|
|
81
|
-
<div>
|
|
82
|
-
<div
|
|
83
|
-
class="flex {$connectingInput?.opened
|
|
84
|
-
? 'bg-white z-50'
|
|
85
|
-
: ''} flex-row justify-between w-full"
|
|
86
|
-
>
|
|
87
|
-
<button
|
|
88
|
-
on:click|stopPropagation|preventDefault={$connectingInput.opened
|
|
89
|
-
? undefined
|
|
90
|
-
: () => ($selectedComponent = componentId)}
|
|
91
|
-
class={classNames(
|
|
92
|
-
'px-2 text-2xs py-0.5 border-t border-x font-bold rounded-t-sm w-fit',
|
|
93
|
-
$selectedComponent === componentId
|
|
94
|
-
? ' bg-indigo-500/90 text-white border-indigo-500/90'
|
|
95
|
-
: 'bg-gray-100 text-gray-500 border-gray-200'
|
|
96
|
-
)}
|
|
97
|
-
>
|
|
98
|
-
{componentId}
|
|
99
|
-
</button>
|
|
100
|
-
<span
|
|
101
|
-
class={classNames(
|
|
102
|
-
'px-1 text-2xs py-0.5 font-semibold rounded-t-sm w-fit',
|
|
103
|
-
'bg-gray-700 text-white'
|
|
104
|
-
)}
|
|
105
|
-
>
|
|
106
|
-
{name}
|
|
107
|
-
</span>
|
|
108
|
-
</div>
|
|
109
|
-
<div
|
|
110
|
-
class={classNames(
|
|
111
|
-
$connectingInput?.opened ? 'bg-white z-50' : '',
|
|
112
|
-
`w-full py-2 grow border relative break-all `,
|
|
113
|
-
$selectedComponent === componentId ? 'border border-indigo-500/90 ' : '',
|
|
114
|
-
$connectingInput.hoveredComponent === componentId
|
|
115
|
-
? 'outline outline-indigo-500/90'
|
|
116
|
-
: ''
|
|
117
|
-
)}
|
|
118
|
-
>
|
|
119
|
-
{#key $selectedComponent}
|
|
120
|
-
{#key $connectingInput?.opened}
|
|
121
|
-
<ComponentOutputViewer
|
|
122
|
-
outputs={$connectingInput?.opened && $selectedComponent === componentId
|
|
123
|
-
? name == 'Table'
|
|
124
|
-
? ['search']
|
|
125
|
-
: []
|
|
126
|
-
: outputs}
|
|
127
|
-
{componentId}
|
|
128
|
-
on:select={({ detail }) => {
|
|
129
|
-
connectInput(componentId, detail)
|
|
130
|
-
}}
|
|
131
|
-
/>
|
|
132
|
-
{/key}
|
|
133
|
-
{/key}
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
29
|
+
<div style="z-index:1000;" class="bg-white w-full h-full">
|
|
30
|
+
<div class="min-w-[150px]">
|
|
31
|
+
<div class="sticky z-50 top-0 left-0 w-full bg-white p-2">
|
|
32
|
+
<div class="relative">
|
|
33
|
+
<input
|
|
34
|
+
bind:value={$search}
|
|
35
|
+
class="px-2 py-1 border border-gray-300 rounded-sm {search ? 'pr-8' : ''}"
|
|
36
|
+
placeholder="Search outputs..."
|
|
37
|
+
/>
|
|
38
|
+
{#if search}
|
|
39
|
+
<button
|
|
40
|
+
class="absolute right-2 top-1/2 transform -translate-y-1/2 hover:bg-gray-200 rounded-full p-0.5"
|
|
41
|
+
on:click|stopPropagation|preventDefault={() => ($search = '')}
|
|
42
|
+
>
|
|
43
|
+
<X size="14" />
|
|
44
|
+
</button>
|
|
136
45
|
{/if}
|
|
137
46
|
</div>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="p-1 ">
|
|
50
|
+
<MinMaxButton bind:expanded />
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="flex flex-col gap-4">
|
|
54
|
+
<div>
|
|
55
|
+
<span class="text-sm font-bold p-2">State & Context</span>
|
|
56
|
+
|
|
57
|
+
<OutputHeader id={'ctx'} name={'App Context'} first color="blue" {expanded}>
|
|
58
|
+
<ComponentOutputViewer
|
|
59
|
+
componentId={'ctx'}
|
|
60
|
+
outputs={['email', 'username', 'query', 'hash']}
|
|
61
|
+
on:select={({ detail }) => {
|
|
62
|
+
$connectingInput = connectInput($connectingInput, 'ctx', detail)
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
</OutputHeader>
|
|
66
|
+
|
|
67
|
+
<OutputHeader id={'state'} name={'State'} color="blue" {expanded}>
|
|
68
|
+
<ComponentOutputViewer
|
|
69
|
+
componentId={'state'}
|
|
70
|
+
outputs={Object.keys($state)}
|
|
71
|
+
on:select={({ detail }) => {
|
|
72
|
+
$connectingInput = connectInput($connectingInput, 'state', detail)
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
</OutputHeader>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div>
|
|
79
|
+
<span class="text-sm font-bold p-2">Components</span>
|
|
80
|
+
{#each sortedItems as gridItem, index}
|
|
81
|
+
<ComponentOutput {gridItem} first={index === 0} {expanded} />
|
|
82
|
+
{/each}
|
|
83
|
+
</div>
|
|
84
|
+
<div>
|
|
85
|
+
<span class="text-sm font-bold p-2">Background scripts</span>
|
|
86
|
+
<div class="border-t">
|
|
87
|
+
<BackgroundScriptsOutput {expanded} />
|
|
88
|
+
</div>
|
|
145
89
|
</div>
|
|
146
|
-
|
|
90
|
+
</div>
|
|
147
91
|
</div>
|
|
148
92
|
</div>
|
|
149
93
|
</PanelSection>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script>import { classNames } from '../../../../utils';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
import { slide } from 'svelte/transition';
|
|
4
|
+
import { connectInput, sortGridItemsPosition } from '../appUtils';
|
|
5
|
+
import ComponentOutput from './ComponentOutput.svelte';
|
|
6
|
+
export let name = undefined;
|
|
7
|
+
export let parentId;
|
|
8
|
+
export let expanded = false;
|
|
9
|
+
export let subGrids;
|
|
10
|
+
const { app, connectingInput, breakpoint, worldStore } = getContext('AppViewerContext');
|
|
11
|
+
let selected = 0;
|
|
12
|
+
$: outputs = $worldStore?.outputsById[parentId];
|
|
13
|
+
let sortedItems = subGrids.map((k) => ({
|
|
14
|
+
k,
|
|
15
|
+
items: sortGridItemsPosition($app.subgrids?.[k] ?? [], $breakpoint)
|
|
16
|
+
}));
|
|
17
|
+
$: $app.subgrids &&
|
|
18
|
+
setTimeout(() => (sortedItems = subGrids.map((k) => ({
|
|
19
|
+
k,
|
|
20
|
+
items: sortGridItemsPosition($app.subgrids?.[k] ?? [], $breakpoint)
|
|
21
|
+
}))), 500);
|
|
22
|
+
$: if (outputs?.selectedTabIndex) {
|
|
23
|
+
outputs.selectedTabIndex.subscribe({
|
|
24
|
+
id: 'subgridoutput-' + parentId,
|
|
25
|
+
next: (value) => {
|
|
26
|
+
selected = value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#each sortedItems as { k, items }, index (k)}
|
|
33
|
+
<div class="ml-2 my-2">
|
|
34
|
+
{#if subGrids.length > 1}
|
|
35
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
36
|
+
<div
|
|
37
|
+
class={classNames(
|
|
38
|
+
'px-1 py-0.5 flex justify-between items-center font-semibold text-xs border-l border-y w-full cursor-pointer',
|
|
39
|
+
selected === index ? 'bg-gray-200' : 'bg-gray-50'
|
|
40
|
+
)}
|
|
41
|
+
on:click={() => {
|
|
42
|
+
selected = index
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<div class="text-xs">
|
|
46
|
+
{name ? name : 'Should implement name'}
|
|
47
|
+
{index + 1}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
{/if}
|
|
51
|
+
|
|
52
|
+
{#if selected === index || name !== 'Tabs'}
|
|
53
|
+
<div transition:slide|local class="border-l">
|
|
54
|
+
{#if items.length > 0}
|
|
55
|
+
{#each items as subGridItem, index (subGridItem.id)}
|
|
56
|
+
<ComponentOutput
|
|
57
|
+
gridItem={subGridItem}
|
|
58
|
+
first={index === 0}
|
|
59
|
+
{expanded}
|
|
60
|
+
on:select={({ detail }) => {
|
|
61
|
+
$connectingInput = connectInput($connectingInput, subGridItem.id, detail)
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
{/each}
|
|
65
|
+
{:else}
|
|
66
|
+
<div class="text-xs text-gray-500 border-y border-l p-1">No components</div>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
71
|
+
{/each}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
name?: string | undefined;
|
|
5
|
+
parentId: string;
|
|
6
|
+
expanded?: boolean | undefined;
|
|
7
|
+
subGrids: string[];
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type SubGridOutputProps = typeof __propDef.props;
|
|
15
|
+
export type SubGridOutputEvents = typeof __propDef.events;
|
|
16
|
+
export type SubGridOutputSlots = typeof __propDef.slots;
|
|
17
|
+
export default class SubGridOutput extends SvelteComponentTyped<SubGridOutputProps, SubGridOutputEvents, SubGridOutputSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { connectInput } from '../../appUtils';
|
|
3
|
+
import ComponentOutputViewer from '../ComponentOutputViewer.svelte';
|
|
4
|
+
import OutputHeader from './OutputHeader.svelte';
|
|
5
|
+
const { selectedComponent, connectingInput } = getContext('AppViewerContext');
|
|
6
|
+
export let id;
|
|
7
|
+
export let name;
|
|
8
|
+
export let expanded = false;
|
|
9
|
+
export let first = false;
|
|
10
|
+
function onHeaderClick(manuallyOpen) {
|
|
11
|
+
if (manuallyOpen) {
|
|
12
|
+
$selectedComponent = undefined;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
$selectedComponent = id;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<OutputHeader
|
|
21
|
+
{id}
|
|
22
|
+
{name}
|
|
23
|
+
color="blue"
|
|
24
|
+
{first}
|
|
25
|
+
{expanded}
|
|
26
|
+
on:handleClick={(e) => {
|
|
27
|
+
onHeaderClick(e.detail.manuallyOpen)
|
|
28
|
+
}}
|
|
29
|
+
shouldOpen={$selectedComponent === id}
|
|
30
|
+
>
|
|
31
|
+
<ComponentOutputViewer
|
|
32
|
+
componentId={id}
|
|
33
|
+
outputs={['loading', 'result']}
|
|
34
|
+
on:select={({ detail }) => {
|
|
35
|
+
$connectingInput = connectInput($connectingInput, id, detail)
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
</OutputHeader>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
expanded?: boolean | undefined;
|
|
7
|
+
first?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type BackgroundScriptOutputProps = typeof __propDef.props;
|
|
15
|
+
export type BackgroundScriptOutputEvents = typeof __propDef.events;
|
|
16
|
+
export type BackgroundScriptOutputSlots = typeof __propDef.slots;
|
|
17
|
+
export default class BackgroundScriptOutput extends SvelteComponentTyped<BackgroundScriptOutputProps, BackgroundScriptOutputEvents, BackgroundScriptOutputSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import OutputHeader from './OutputHeader.svelte';
|
|
3
|
+
import BackgroundScriptOutput from './BackgroundScriptOutput.svelte';
|
|
4
|
+
const { app } = getContext('AppViewerContext');
|
|
5
|
+
export let expanded = false;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#each $app.hiddenInlineScripts as action, index}
|
|
9
|
+
<BackgroundScriptOutput id={`bg_${index}`} name={action.name} {expanded} />
|
|
10
|
+
{/each}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
expanded?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type BackgroundScriptsOutputProps = typeof __propDef.props;
|
|
12
|
+
export type BackgroundScriptsOutputEvents = typeof __propDef.events;
|
|
13
|
+
export type BackgroundScriptsOutputSlots = typeof __propDef.slots;
|
|
14
|
+
export default class BackgroundScriptsOutput extends SvelteComponentTyped<BackgroundScriptsOutputProps, BackgroundScriptsOutputEvents, BackgroundScriptsOutputSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>import Button from '../../../../common/button/Button.svelte';
|
|
2
|
+
import { Maximize, Minimize } from 'lucide-svelte';
|
|
3
|
+
export let expanded = false;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<Button
|
|
7
|
+
on:click={() => {
|
|
8
|
+
expanded = !expanded
|
|
9
|
+
}}
|
|
10
|
+
color="light"
|
|
11
|
+
size="xs"
|
|
12
|
+
variant="border"
|
|
13
|
+
>
|
|
14
|
+
{#if !expanded}
|
|
15
|
+
<div class="flex flex-row gap-2">
|
|
16
|
+
<Maximize size="14" />
|
|
17
|
+
Expand all
|
|
18
|
+
</div>
|
|
19
|
+
{:else}
|
|
20
|
+
<div class="flex flex-row gap-2">
|
|
21
|
+
<Minimize size="14" />
|
|
22
|
+
Collapse all
|
|
23
|
+
</div>
|
|
24
|
+
{/if}
|
|
25
|
+
</Button>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
expanded?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type MinMaxButtonProps = typeof __propDef.props;
|
|
12
|
+
export type MinMaxButtonEvents = typeof __propDef.events;
|
|
13
|
+
export type MinMaxButtonSlots = typeof __propDef.slots;
|
|
14
|
+
export default class MinMaxButton extends SvelteComponentTyped<MinMaxButtonProps, MinMaxButtonEvents, MinMaxButtonSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>import { classNames } from '../../../../../utils';
|
|
2
|
+
import { ChevronDown, ChevronUp } from 'lucide-svelte';
|
|
3
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
import { slide } from 'svelte/transition';
|
|
5
|
+
export let id;
|
|
6
|
+
export let name;
|
|
7
|
+
export let first = false;
|
|
8
|
+
export let nested = false;
|
|
9
|
+
export let color = 'indigo';
|
|
10
|
+
export let expanded = false;
|
|
11
|
+
export let shouldOpen = false;
|
|
12
|
+
$: open = shouldOpen;
|
|
13
|
+
let manuallyOpen = false;
|
|
14
|
+
const dispatch = createEventDispatcher();
|
|
15
|
+
$: if (expanded) {
|
|
16
|
+
manuallyOpen = true;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
manuallyOpen = false;
|
|
20
|
+
}
|
|
21
|
+
const hoverColor = {
|
|
22
|
+
blue: 'hover:bg-blue-300 hover:text-blue-600',
|
|
23
|
+
indigo: 'hover:bg-indigo-300 hover:text-indigo-600'
|
|
24
|
+
};
|
|
25
|
+
const openBackground = {
|
|
26
|
+
blue: 'bg-blue-50',
|
|
27
|
+
indigo: 'bg-indigo-50'
|
|
28
|
+
};
|
|
29
|
+
const manuallyOpenColor = {
|
|
30
|
+
blue: 'text-blue-600',
|
|
31
|
+
indigo: 'text-indigo-600'
|
|
32
|
+
};
|
|
33
|
+
const idClass = {
|
|
34
|
+
blue: 'bg-blue-500 text-white',
|
|
35
|
+
indigo: 'bg-indigo-500 text-white'
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
40
|
+
<div
|
|
41
|
+
class={classNames(
|
|
42
|
+
'flex items-center justify-between p-1 cursor-pointer border-b gap-1 truncate',
|
|
43
|
+
hoverColor[color],
|
|
44
|
+
open && !manuallyOpen ? openBackground[color] : 'bg-white',
|
|
45
|
+
first ? 'border-t' : '',
|
|
46
|
+
nested ? 'border-l' : ''
|
|
47
|
+
)}
|
|
48
|
+
on:click={() => {
|
|
49
|
+
dispatch('handleClick', { manuallyOpen })
|
|
50
|
+
manuallyOpen = !manuallyOpen
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
class={classNames(
|
|
55
|
+
'text-2xs ml-0.5 font-bold px-2 py-0.5 rounded-sm',
|
|
56
|
+
open ? idClass[color] : ' bg-gray-100'
|
|
57
|
+
)}
|
|
58
|
+
>
|
|
59
|
+
{id}
|
|
60
|
+
</div>
|
|
61
|
+
<div class="text-2xs font-bold flex flex-row gap-2 items-center truncate">
|
|
62
|
+
{name}
|
|
63
|
+
{#if !open && !manuallyOpen}
|
|
64
|
+
<ChevronDown size={14} />
|
|
65
|
+
{:else if manuallyOpen}
|
|
66
|
+
<ChevronUp size={14} class={manuallyOpenColor[color]} strokeWidth={4} />
|
|
67
|
+
{:else}
|
|
68
|
+
<ChevronUp size={14} />
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
{#if open || manuallyOpen}
|
|
73
|
+
<div class="py-1 border-b" transition:slide|local>
|
|
74
|
+
<div class={classNames(nested ? 'border-l ml-2' : '')}>
|
|
75
|
+
<slot />
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
{/if}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
first?: boolean | undefined;
|
|
7
|
+
nested?: boolean | undefined;
|
|
8
|
+
color?: "blue" | "indigo" | undefined;
|
|
9
|
+
expanded?: boolean | undefined;
|
|
10
|
+
shouldOpen?: boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
handleClick: CustomEvent<any>;
|
|
14
|
+
} & {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type OutputHeaderProps = typeof __propDef.props;
|
|
22
|
+
export type OutputHeaderEvents = typeof __propDef.events;
|
|
23
|
+
export type OutputHeaderSlots = typeof __propDef.slots;
|
|
24
|
+
export default class OutputHeader extends SvelteComponentTyped<OutputHeaderProps, OutputHeaderEvents, OutputHeaderSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { connectInput } from '../../appUtils';
|
|
3
|
+
import ComponentOutputViewer from '../ComponentOutputViewer.svelte';
|
|
4
|
+
import OutputHeader from './OutputHeader.svelte';
|
|
5
|
+
const { staticOutputs, connectingInput } = getContext('AppViewerContext');
|
|
6
|
+
export let id;
|
|
7
|
+
export let expanded = false;
|
|
8
|
+
export let first = false;
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<OutputHeader {id} name={'Table action'} {first} {expanded}>
|
|
12
|
+
<ComponentOutputViewer
|
|
13
|
+
componentId={id}
|
|
14
|
+
outputs={$staticOutputs[id]}
|
|
15
|
+
on:select={({ detail }) => {
|
|
16
|
+
$connectingInput = connectInput($connectingInput, id, detail)
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
</OutputHeader>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id: string;
|
|
5
|
+
expanded?: boolean | undefined;
|
|
6
|
+
first?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type TableActionOutputProps = typeof __propDef.props;
|
|
14
|
+
export type TableActionOutputEvents = typeof __propDef.events;
|
|
15
|
+
export type TableActionOutputSlots = typeof __propDef.slots;
|
|
16
|
+
export default class TableActionOutput extends SvelteComponentTyped<TableActionOutputProps, TableActionOutputEvents, TableActionOutputSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import TableActionOutput from './TableActionOutput.svelte';
|
|
2
|
+
export let gridItem;
|
|
3
|
+
export let expanded = false;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class="my-1">
|
|
7
|
+
{#if gridItem.data.type === 'tablecomponent' && gridItem.data.actionButtons.length > 0}
|
|
8
|
+
<div class="ml-2 border-l">
|
|
9
|
+
{#each gridItem.data.actionButtons as action, index}
|
|
10
|
+
<TableActionOutput id={action.id} {expanded} first={index === 0} />
|
|
11
|
+
{/each}
|
|
12
|
+
</div>
|
|
13
|
+
{/if}
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { GridItem } from '../../../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
gridItem: GridItem;
|
|
6
|
+
expanded?: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type TableActionsOutputProps = typeof __propDef.props;
|
|
14
|
+
export type TableActionsOutputEvents = typeof __propDef.events;
|
|
15
|
+
export type TableActionsOutputSlots = typeof __propDef.slots;
|
|
16
|
+
export default class TableActionsOutput extends SvelteComponentTyped<TableActionsOutputProps, TableActionsOutputEvents, TableActionsOutputSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|