windmill-components 1.82.10 → 1.82.12
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 +0 -6
- package/components/FlowBuilder.svelte +5 -0
- package/components/LightweightArgInput.svelte +0 -5
- package/components/Toggle.svelte +1 -1
- package/components/Toggle.svelte.d.ts +0 -1
- package/components/apps/components/buttons/AppButton.svelte +1 -1
- package/components/apps/components/buttons/AppForm.svelte +0 -1
- package/components/apps/components/buttons/AppFormButton.svelte +0 -1
- package/components/apps/components/display/AppMap.svelte +1 -1
- package/components/apps/components/display/AppPdf.svelte +1 -1
- package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +6 -6
- package/components/apps/components/helpers/HiddenComponent.svelte +3 -2
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +2 -1
- package/components/apps/components/helpers/RefreshButton.svelte +3 -10
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +1 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +8 -7
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +1 -1
- package/components/apps/components/inputs/AppCheckbox.svelte +0 -4
- package/components/apps/components/inputs/AppDateInput.svelte +2 -2
- package/components/apps/components/inputs/AppMultiSelect.svelte +3 -3
- package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
- package/components/apps/components/inputs/AppSelect.svelte +3 -4
- package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/inputs/AppTextInput.svelte +7 -10
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
- package/components/apps/components/layout/AppContainer.svelte +2 -2
- package/components/apps/components/layout/AppDrawer.svelte +1 -2
- package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +5 -6
- package/components/apps/editor/AppEditorHeader.svelte +5 -0
- package/components/apps/editor/AppPreview.svelte +5 -4
- package/components/apps/editor/ComponentHeader.svelte +1 -0
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +10 -9
- package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
- package/components/apps/editor/SettingsPanel.svelte +3 -3
- package/components/apps/editor/SubGridEditor.svelte +11 -11
- package/components/apps/editor/component/Component.svelte +4 -3
- package/components/apps/editor/component/ComponentNavigation.svelte +55 -46
- package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +2 -2
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +2 -2
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +6 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +3 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +4 -0
- package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
- package/components/apps/svelte-grid/Grid.svelte +45 -26
- package/components/apps/svelte-grid/Grid.svelte.d.ts +13 -3
- package/components/apps/svelte-grid/MoveResize.svelte +74 -54
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +14 -1
- package/components/apps/svelte-grid/utils/helper.d.ts +0 -1
- package/components/apps/svelte-grid/utils/helper.js +0 -3
- package/components/apps/types.d.ts +6 -3
- package/components/apps/utils.d.ts +2 -0
- package/components/apps/utils.js +30 -1
- package/infer.js +3 -1
- package/package.json +1 -1
|
@@ -211,7 +211,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
211
211
|
<input
|
|
212
212
|
{autofocus}
|
|
213
213
|
on:focus={(e) => {
|
|
214
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
215
214
|
dispatch('focus')
|
|
216
215
|
}}
|
|
217
216
|
{disabled}
|
|
@@ -230,7 +229,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
230
229
|
<Toggle
|
|
231
230
|
on:pointerdown={(e) => {
|
|
232
231
|
e?.stopPropagation()
|
|
233
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
234
232
|
}}
|
|
235
233
|
{disabled}
|
|
236
234
|
class={valid
|
|
@@ -310,7 +308,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
310
308
|
<textarea
|
|
311
309
|
bind:this={el}
|
|
312
310
|
on:focus={(e) => {
|
|
313
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
314
311
|
dispatch('focus')
|
|
315
312
|
}}
|
|
316
313
|
{autofocus}
|
|
@@ -331,7 +328,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
331
328
|
{:else if inputCat == 'enum'}
|
|
332
329
|
<select
|
|
333
330
|
on:focus={(e) => {
|
|
334
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
335
331
|
dispatch('focus')
|
|
336
332
|
}}
|
|
337
333
|
{disabled}
|
|
@@ -348,7 +344,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
348
344
|
<div class="border my-1 mb-4 w-full border-gray-400">
|
|
349
345
|
<SimpleEditor
|
|
350
346
|
on:focus={(e) => {
|
|
351
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
352
347
|
dispatch('focus')
|
|
353
348
|
}}
|
|
354
349
|
on:blur={() => dispatch('blur')}
|
|
@@ -387,7 +382,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
387
382
|
rows="1"
|
|
388
383
|
bind:this={el}
|
|
389
384
|
on:focus={(e) => {
|
|
390
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
391
385
|
dispatch('focus')
|
|
392
386
|
}}
|
|
393
387
|
on:blur={() => dispatch('blur')}
|
|
@@ -175,6 +175,11 @@ $: selectedId && select(selectedId);
|
|
|
175
175
|
$: initialPath && $workspaceStore && loadSchedule();
|
|
176
176
|
loadHubScripts();
|
|
177
177
|
function onKeyDown(event) {
|
|
178
|
+
let classes = event.target?.['className'];
|
|
179
|
+
if ((typeof classes === 'string' && classes.includes('inputarea')) ||
|
|
180
|
+
['INPUT', 'TEXTAREA'].includes(document.activeElement?.tagName)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
178
183
|
switch (event.key) {
|
|
179
184
|
case 'Z':
|
|
180
185
|
if (event.ctrlKey) {
|
|
@@ -145,7 +145,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
145
145
|
{:else}
|
|
146
146
|
<input
|
|
147
147
|
on:focus={(e) => {
|
|
148
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
149
148
|
dispatch('focus')
|
|
150
149
|
}}
|
|
151
150
|
type="number"
|
|
@@ -163,7 +162,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
163
162
|
<Toggle
|
|
164
163
|
on:pointerdown={(e) => {
|
|
165
164
|
e?.stopPropagation()
|
|
166
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
167
165
|
}}
|
|
168
166
|
class={valid
|
|
169
167
|
? ''
|
|
@@ -240,7 +238,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
240
238
|
<textarea
|
|
241
239
|
bind:this={el}
|
|
242
240
|
on:focus={(e) => {
|
|
243
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
244
241
|
dispatch('focus')
|
|
245
242
|
}}
|
|
246
243
|
use:autosize
|
|
@@ -258,7 +255,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
258
255
|
{:else if inputCat == 'enum'}
|
|
259
256
|
<select
|
|
260
257
|
on:focus={(e) => {
|
|
261
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
262
258
|
dispatch('focus')
|
|
263
259
|
}}
|
|
264
260
|
class="px-6"
|
|
@@ -291,7 +287,6 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
291
287
|
rows="1"
|
|
292
288
|
bind:this={el}
|
|
293
289
|
on:focus={(e) => {
|
|
294
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
295
290
|
dispatch('focus')
|
|
296
291
|
}}
|
|
297
292
|
on:blur={() => dispatch('blur')}
|
package/components/Toggle.svelte
CHANGED
|
@@ -32,7 +32,7 @@ const dispatch = createEventDispatcher();
|
|
|
32
32
|
</span>
|
|
33
33
|
{/if}
|
|
34
34
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
35
|
-
<div class="relative" on:
|
|
35
|
+
<div class="relative" on:click|stopPropagation>
|
|
36
36
|
<input
|
|
37
37
|
on:focus
|
|
38
38
|
on:click
|
|
@@ -289,7 +289,7 @@ $: css = concatCustomCss($app.css?.pdfcomponent, customCss);
|
|
|
289
289
|
style="padding-top: {controlsHeight ?? 0}px; {css?.container?.style ?? ''}"
|
|
290
290
|
/>
|
|
291
291
|
{/if}
|
|
292
|
-
{#if $mode !== 'preview' && $selectedComponent
|
|
292
|
+
{#if $mode !== 'preview' && $selectedComponent?.includes(id)}
|
|
293
293
|
<button
|
|
294
294
|
class="fixed z-10 bottom-0 left-0 px-2 py-0.5 bg-indigo-500/90
|
|
295
295
|
hover:bg-indigo-500 focus:bg-indigo-500 duration-200 text-white text-2xs"
|
|
@@ -112,7 +112,7 @@ $componentControl[id] = {
|
|
|
112
112
|
}
|
|
113
113
|
const hasActions = actionButtons.length >= 1;
|
|
114
114
|
if (hasActions) {
|
|
115
|
-
$selectedComponent = actionButtons[0].id;
|
|
115
|
+
$selectedComponent = [actionButtons[0].id];
|
|
116
116
|
return true;
|
|
117
117
|
}
|
|
118
118
|
return false;
|
|
@@ -234,13 +234,13 @@ $componentControl[id] = {
|
|
|
234
234
|
$hoverStore = undefined
|
|
235
235
|
}
|
|
236
236
|
}}
|
|
237
|
-
class={(actionButton.id
|
|
237
|
+
class={($selectedComponent?.includes(actionButton.id) ||
|
|
238
238
|
$hoverStore === actionButton.id) &&
|
|
239
239
|
$mode !== 'preview'
|
|
240
240
|
? 'outline outline-indigo-500 outline-1 outline-offset-1 relative '
|
|
241
241
|
: ''}
|
|
242
242
|
>
|
|
243
|
-
{#if actionButton.id
|
|
243
|
+
{#if $selectedComponent?.includes(actionButton.id) || $hoverStore === actionButton.id}
|
|
244
244
|
<span
|
|
245
245
|
title={`Id: ${actionButton.id}`}
|
|
246
246
|
class={classNames(
|
|
@@ -268,10 +268,10 @@ $componentControl[id] = {
|
|
|
268
268
|
controls={{
|
|
269
269
|
left: () => {
|
|
270
270
|
if (actionIndex === 0) {
|
|
271
|
-
$selectedComponent = id
|
|
271
|
+
$selectedComponent = [id]
|
|
272
272
|
return true
|
|
273
273
|
} else if (actionIndex > 0) {
|
|
274
|
-
$selectedComponent = actionButtons[actionIndex - 1].id
|
|
274
|
+
$selectedComponent = [actionButtons[actionIndex - 1].id]
|
|
275
275
|
return true
|
|
276
276
|
}
|
|
277
277
|
return false
|
|
@@ -280,7 +280,7 @@ $componentControl[id] = {
|
|
|
280
280
|
if (actionIndex === actionButtons.length - 1) {
|
|
281
281
|
return id
|
|
282
282
|
} else if (actionIndex < actionButtons.length - 1) {
|
|
283
|
-
$selectedComponent = actionButtons[actionIndex + 1].id
|
|
283
|
+
$selectedComponent = [actionButtons[actionIndex + 1].id]
|
|
284
284
|
return true
|
|
285
285
|
}
|
|
286
286
|
return false
|
|
@@ -5,7 +5,8 @@ export let id;
|
|
|
5
5
|
export let name;
|
|
6
6
|
export let inlineScript;
|
|
7
7
|
export let fields;
|
|
8
|
-
export let doNotRecomputeOnInputChanged
|
|
8
|
+
export let doNotRecomputeOnInputChanged;
|
|
9
|
+
export let recomputableByRefreshButton;
|
|
9
10
|
let result = undefined;
|
|
10
11
|
const { worldStore } = getContext('AppViewerContext');
|
|
11
12
|
let outputs = initOutput($worldStore, id, {
|
|
@@ -28,8 +29,8 @@ let outputs = initOutput($worldStore, id, {
|
|
|
28
29
|
type: 'runnableByName'
|
|
29
30
|
}}
|
|
30
31
|
wrapperClass="hidden"
|
|
31
|
-
recomputable
|
|
32
32
|
{outputs}
|
|
33
|
+
{recomputableByRefreshButton}
|
|
33
34
|
>
|
|
34
35
|
<slot />
|
|
35
36
|
</RunnableComponent>
|
|
@@ -7,7 +7,8 @@ declare const __propDef: {
|
|
|
7
7
|
name: string;
|
|
8
8
|
inlineScript: InlineScript | undefined;
|
|
9
9
|
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
10
|
-
doNotRecomputeOnInputChanged
|
|
10
|
+
doNotRecomputeOnInputChanged: boolean;
|
|
11
|
+
recomputableByRefreshButton: boolean;
|
|
11
12
|
};
|
|
12
13
|
events: {
|
|
13
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
<script>import { RefreshCw } from 'lucide-svelte';
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
3
|
export let componentId;
|
|
4
|
-
|
|
4
|
+
export let loading;
|
|
5
|
+
const { runnableComponents } = getContext('AppViewerContext');
|
|
5
6
|
async function refresh() {
|
|
6
|
-
|
|
7
|
-
await $runnableComponents[componentId]?.();
|
|
7
|
+
await $runnableComponents[componentId]?.cb?.();
|
|
8
8
|
}
|
|
9
|
-
let loading = false;
|
|
10
|
-
$: $worldStore?.outputsById[componentId]?.['loading']?.subscribe({
|
|
11
|
-
id: 'refresh-' + componentId,
|
|
12
|
-
next: (value) => {
|
|
13
|
-
loading = value;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
9
|
</script>
|
|
17
10
|
|
|
18
11
|
<button
|
|
@@ -23,19 +23,20 @@ export let wrapperClass = '';
|
|
|
23
23
|
export let wrapperStyle = '';
|
|
24
24
|
export let initializing = undefined;
|
|
25
25
|
export let render;
|
|
26
|
-
export let recomputable = false;
|
|
27
26
|
export let outputs;
|
|
28
27
|
export let extraKey = '';
|
|
29
28
|
export let doNotRecomputeOnInputChanged = false;
|
|
30
29
|
export let loading = false;
|
|
30
|
+
export let recomputableByRefreshButton = true;
|
|
31
31
|
const { worldStore, runnableComponents, workspace, appPath, isEditor, jobs, noBackend, errorByComponent, mode, stateId, state, componentControl } = getContext('AppViewerContext');
|
|
32
32
|
const dispatch = createEventDispatcher();
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
$runnableComponents[id] = {
|
|
34
|
+
autoRefresh: autoRefresh && recomputableByRefreshButton,
|
|
35
|
+
cb: async (inlineScript) => {
|
|
35
36
|
await executeComponent(true, inlineScript);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
$runnableComponents = $runnableComponents;
|
|
39
40
|
let args = undefined;
|
|
40
41
|
let testIsLoading = false;
|
|
41
42
|
let runnableInputValues = {};
|
|
@@ -310,7 +311,7 @@ async function setResult(res) {
|
|
|
310
311
|
{/if}
|
|
311
312
|
{#if !initializing && autoRefresh === true}
|
|
312
313
|
<div class="flex absolute top-1 right-1 z-50">
|
|
313
|
-
<RefreshButton componentId={id} />
|
|
314
|
+
<RefreshButton {loading} componentId={id} />
|
|
314
315
|
</div>
|
|
315
316
|
{/if}
|
|
316
317
|
</div>
|
|
@@ -18,7 +18,6 @@ declare const __propDef: {
|
|
|
18
18
|
wrapperStyle?: string | undefined;
|
|
19
19
|
initializing?: boolean | undefined;
|
|
20
20
|
render: boolean;
|
|
21
|
-
recomputable?: boolean | undefined;
|
|
22
21
|
outputs: {
|
|
23
22
|
result: Output<any>;
|
|
24
23
|
loading: Output<boolean>;
|
|
@@ -26,6 +25,7 @@ declare const __propDef: {
|
|
|
26
25
|
extraKey?: string | undefined;
|
|
27
26
|
doNotRecomputeOnInputChanged?: boolean | undefined;
|
|
28
27
|
loading?: boolean | undefined;
|
|
28
|
+
recomputableByRefreshButton?: boolean | undefined;
|
|
29
29
|
runComponent?: (() => Promise<void>) | undefined;
|
|
30
30
|
};
|
|
31
31
|
events: {
|
|
@@ -35,7 +35,7 @@ function isRunnableDefined(componentInput) {
|
|
|
35
35
|
}
|
|
36
36
|
export function onSuccess() {
|
|
37
37
|
if (recomputeIds) {
|
|
38
|
-
recomputeIds.map((id) => $runnableComponents?.[id]?.());
|
|
38
|
+
recomputeIds.map((id) => $runnableComponents?.cb?.[id]?.());
|
|
39
39
|
}
|
|
40
40
|
if (!doOnSuccess)
|
|
41
41
|
return;
|
|
@@ -27,10 +27,6 @@ $: css = concatCustomCss($app.css?.checkboxcomponent, customCss);
|
|
|
27
27
|
|
|
28
28
|
<AlignWrapper {render} {horizontalAlignment} {verticalAlignment}>
|
|
29
29
|
<Toggle
|
|
30
|
-
on:pointerdown={(e) => {
|
|
31
|
-
e?.stopPropagation()
|
|
32
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
33
|
-
}}
|
|
34
30
|
checked={defaultValue}
|
|
35
31
|
options={{ right: labelValue }}
|
|
36
32
|
textClass={css?.text?.class ?? ''}
|
|
@@ -35,14 +35,14 @@ $: css = concatCustomCss($app.css?.dateinputcomponent, customCss);
|
|
|
35
35
|
<AlignWrapper {render} {verticalAlignment}>
|
|
36
36
|
{#if inputType === 'date'}
|
|
37
37
|
<input
|
|
38
|
-
on:focus={() => ($selectedComponent = id)}
|
|
38
|
+
on:focus={() => ($selectedComponent = [id])}
|
|
39
39
|
on:pointerdown|stopPropagation
|
|
40
40
|
type="date"
|
|
41
41
|
bind:value
|
|
42
42
|
min={minValue}
|
|
43
43
|
max={maxValue}
|
|
44
44
|
placeholder="Type..."
|
|
45
|
-
class={twMerge(
|
|
45
|
+
class={twMerge(css?.input?.class ?? '')}
|
|
46
46
|
style={css?.input?.style ?? ''}
|
|
47
47
|
/>
|
|
48
48
|
{/if}
|
|
@@ -42,7 +42,7 @@ $: css = concatCustomCss($app.css?.selectcomponent, customCss);
|
|
|
42
42
|
<InputValue {id} input={configuration.placeholder} bind:value={placeholder} />
|
|
43
43
|
|
|
44
44
|
<AlignWrapper {render} {horizontalAlignment} {verticalAlignment}>
|
|
45
|
-
<div class="app-select w-full
|
|
45
|
+
<div class="app-select w-full" style="height: 34px" on:pointerdown|stopPropagation>
|
|
46
46
|
{#if !value || Array.isArray(value)}
|
|
47
47
|
<Select
|
|
48
48
|
--border-radius="0"
|
|
@@ -58,11 +58,11 @@ $: css = concatCustomCss($app.css?.selectcomponent, customCss);
|
|
|
58
58
|
{placeholder}
|
|
59
59
|
on:click={() => {
|
|
60
60
|
if (!$connectingInput.opened) {
|
|
61
|
-
$selectedComponent = id
|
|
61
|
+
$selectedComponent = [id]
|
|
62
62
|
}
|
|
63
63
|
}}
|
|
64
64
|
on:focus={() => {
|
|
65
|
-
$selectedComponent = id
|
|
65
|
+
$selectedComponent = [id]
|
|
66
66
|
}}
|
|
67
67
|
floatingConfig={{
|
|
68
68
|
strategy: 'fixed'
|
|
@@ -35,10 +35,10 @@ $: css = concatCustomCss($app.css?.numberinputcomponent, customCss);
|
|
|
35
35
|
|
|
36
36
|
<AlignWrapper {render} {verticalAlignment}>
|
|
37
37
|
<input
|
|
38
|
-
on:pointerdown|stopPropagation={() => ($selectedComponent = id)}
|
|
39
|
-
on:focus={() => ($selectedComponent = id)}
|
|
38
|
+
on:pointerdown|stopPropagation={() => ($selectedComponent = [id])}
|
|
39
|
+
on:focus={() => ($selectedComponent = [id])}
|
|
40
40
|
class={twMerge(
|
|
41
|
-
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2
|
|
41
|
+
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2',
|
|
42
42
|
css?.input?.class ?? ''
|
|
43
43
|
)}
|
|
44
44
|
style={css?.input?.style ?? ''}
|
|
@@ -43,7 +43,6 @@ function handleItems() {
|
|
|
43
43
|
}
|
|
44
44
|
function onChange(e) {
|
|
45
45
|
e?.stopPropagation();
|
|
46
|
-
window.dispatchEvent(new Event('pointerup'));
|
|
47
46
|
if (create) {
|
|
48
47
|
listItems = listItems.map((i) => {
|
|
49
48
|
delete i.created;
|
|
@@ -88,7 +87,7 @@ let filterText = '';
|
|
|
88
87
|
<InputValue {id} input={configuration.create} bind:value={create} />
|
|
89
88
|
|
|
90
89
|
<AlignWrapper {render} {horizontalAlignment} {verticalAlignment}>
|
|
91
|
-
<div class="app-select w-full
|
|
90
|
+
<div class="app-select w-full" style="height: 34px;" on:pointerdown|stopPropagation>
|
|
92
91
|
<Select
|
|
93
92
|
--border-radius="0"
|
|
94
93
|
--border-color="#999"
|
|
@@ -105,11 +104,11 @@ let filterText = '';
|
|
|
105
104
|
{placeholder}
|
|
106
105
|
on:click={() => {
|
|
107
106
|
if (!$connectingInput.opened) {
|
|
108
|
-
$selectedComponent = id
|
|
107
|
+
$selectedComponent = [id]
|
|
109
108
|
}
|
|
110
109
|
}}
|
|
111
110
|
on:focus={() => {
|
|
112
|
-
$selectedComponent = id
|
|
111
|
+
$selectedComponent = [id]
|
|
113
112
|
}}
|
|
114
113
|
floatingConfig={{
|
|
115
114
|
strategy: 'fixed'
|
|
@@ -59,7 +59,7 @@ $: if (css && slider && lastStyle !== css?.handle?.style) {
|
|
|
59
59
|
class="grow"
|
|
60
60
|
style="--range-handle-focus: {'#7e9abd'}; --range-handle: {'#7e9abd'}; {css?.bar?.style ??
|
|
61
61
|
''}"
|
|
62
|
-
on:pointerdown|stopPropagation={() => ($selectedComponent = id)}
|
|
62
|
+
on:pointerdown|stopPropagation={() => ($selectedComponent = [id])}
|
|
63
63
|
>
|
|
64
64
|
<RangeSlider bind:slider bind:values {step} min={+min} max={+max} />
|
|
65
65
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import { initOutput } from '../../editor/appUtils';
|
|
4
|
-
import { concatCustomCss } from '../../utils';
|
|
4
|
+
import { concatCustomCss, selectId } from '../../utils';
|
|
5
5
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
6
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
7
7
|
export let id;
|
|
@@ -33,12 +33,11 @@ $: css = concatCustomCss($app.css?.[appCssKey], customCss);
|
|
|
33
33
|
{#if inputType === 'password'}
|
|
34
34
|
<input
|
|
35
35
|
class={twMerge(
|
|
36
|
-
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2
|
|
36
|
+
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2 ',
|
|
37
37
|
css?.input?.class ?? ''
|
|
38
38
|
)}
|
|
39
39
|
style={css?.input?.style ?? ''}
|
|
40
|
-
on:
|
|
41
|
-
on:pointerdown|stopPropagation={() => ($selectedComponent = id)}
|
|
40
|
+
on:pointerdown|stopPropagation={(e) => selectId(e, id, selectedComponent, $app)}
|
|
42
41
|
type="password"
|
|
43
42
|
bind:value
|
|
44
43
|
{placeholder}
|
|
@@ -46,12 +45,11 @@ $: css = concatCustomCss($app.css?.[appCssKey], customCss);
|
|
|
46
45
|
{:else if inputType === 'text'}
|
|
47
46
|
<input
|
|
48
47
|
class={twMerge(
|
|
49
|
-
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2
|
|
48
|
+
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2 ',
|
|
50
49
|
css?.input?.class ?? ''
|
|
51
50
|
)}
|
|
52
51
|
style={css?.input?.style ?? ''}
|
|
53
|
-
on:
|
|
54
|
-
on:pointerdown|stopPropagation={() => ($selectedComponent = id)}
|
|
52
|
+
on:pointerdown|stopPropagation={(e) => selectId(e, id, selectedComponent, $app)}
|
|
55
53
|
type="text"
|
|
56
54
|
bind:value
|
|
57
55
|
{placeholder}
|
|
@@ -59,12 +57,11 @@ $: css = concatCustomCss($app.css?.[appCssKey], customCss);
|
|
|
59
57
|
{:else if inputType === 'email'}
|
|
60
58
|
<input
|
|
61
59
|
class={twMerge(
|
|
62
|
-
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2
|
|
60
|
+
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2 ',
|
|
63
61
|
css?.input?.class ?? ''
|
|
64
62
|
)}
|
|
65
63
|
style={css?.input?.style ?? ''}
|
|
66
|
-
on:
|
|
67
|
-
on:pointerdown|stopPropagation={() => ($selectedComponent = id)}
|
|
64
|
+
on:pointerdown|stopPropagation={(e) => selectId(e, id, selectedComponent, $app)}
|
|
68
65
|
type="email"
|
|
69
66
|
bind:value
|
|
70
67
|
{placeholder}
|
|
@@ -40,7 +40,7 @@ $: css = concatCustomCss($app.css?.currencycomponent, customCss);
|
|
|
40
40
|
{#key isNegativeAllowed}
|
|
41
41
|
{#key locale}
|
|
42
42
|
{#key currency}
|
|
43
|
-
<div class="w-full" on:pointerdown|stopPropagation={() => ($selectedComponent = id)}>
|
|
43
|
+
<div class="w-full" on:pointerdown|stopPropagation={() => ($selectedComponent = [id])}>
|
|
44
44
|
<CurrencyInput
|
|
45
45
|
inputClasses={{
|
|
46
46
|
formatted: twMerge('px-2 w-full py-1.5 windmillapp', css?.input?.class),
|
|
@@ -15,7 +15,7 @@ function onFocus() {
|
|
|
15
15
|
subGridIndex: 0
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
$: $selectedComponent
|
|
18
|
+
$: $selectedComponent?.includes(id) && onFocus();
|
|
19
19
|
$: css = concatCustomCss($app.css?.containercomponent, customCss);
|
|
20
20
|
</script>
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ $: css = concatCustomCss($app.css?.containercomponent, customCss);
|
|
|
29
29
|
subGridId={`${id}-0`}
|
|
30
30
|
containerHeight={componentContainerHeight}
|
|
31
31
|
on:focus={() => {
|
|
32
|
-
$selectedComponent = id
|
|
32
|
+
$selectedComponent = [id]
|
|
33
33
|
}}
|
|
34
34
|
/>
|
|
35
35
|
{/if}
|
|
@@ -38,7 +38,6 @@ $: css = concatCustomCss($app.css?.containercomponent, customCss);
|
|
|
38
38
|
{disabled}
|
|
39
39
|
on:pointerdown={(e) => {
|
|
40
40
|
e?.stopPropagation()
|
|
41
|
-
window.dispatchEvent(new Event('pointerup'))
|
|
42
41
|
}}
|
|
43
42
|
on:click={async (e) => {
|
|
44
43
|
$focusedGrid = {
|
|
@@ -80,7 +79,7 @@ $: css = concatCustomCss($app.css?.containercomponent, customCss);
|
|
|
80
79
|
subGridId={`${id}-0`}
|
|
81
80
|
containerHeight={1200}
|
|
82
81
|
on:focus={() => {
|
|
83
|
-
$selectedComponent = id
|
|
82
|
+
$selectedComponent = [id]
|
|
84
83
|
}}
|
|
85
84
|
/>
|
|
86
85
|
{/if}
|
|
@@ -19,7 +19,7 @@ function onFocus() {
|
|
|
19
19
|
subGridIndex: 0
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
$: $selectedComponent
|
|
22
|
+
$: $selectedComponent?.includes(id) && onFocus();
|
|
23
23
|
$: css = concatCustomCss($app.css?.containercomponent, customCss);
|
|
24
24
|
$componentControl[id] = {
|
|
25
25
|
left: () => {
|
|
@@ -60,7 +60,7 @@ $: {
|
|
|
60
60
|
<div
|
|
61
61
|
class="w-full h-full"
|
|
62
62
|
on:pointerdown|stopPropagation={() => {
|
|
63
|
-
$selectedComponent = id
|
|
63
|
+
$selectedComponent = [id]
|
|
64
64
|
$focusedGrid = {
|
|
65
65
|
parentComponentId: id,
|
|
66
66
|
subGridIndex: index
|
|
@@ -77,7 +77,7 @@ $: {
|
|
|
77
77
|
subGridId={`${id}-${index}`}
|
|
78
78
|
containerHeight={horizontal ? undefined : componentContainerHeight - 8}
|
|
79
79
|
on:focus={() => {
|
|
80
|
-
$selectedComponent = id
|
|
80
|
+
$selectedComponent = [id]
|
|
81
81
|
$focusedGrid = {
|
|
82
82
|
parentComponentId: id,
|
|
83
83
|
subGridIndex: index
|
|
@@ -62,7 +62,7 @@ setContext('AppViewerContext', {
|
|
|
62
62
|
mode,
|
|
63
63
|
connectingInput,
|
|
64
64
|
breakpoint,
|
|
65
|
-
runnableComponents,
|
|
65
|
+
runnableComponents: writable({}),
|
|
66
66
|
appPath: path,
|
|
67
67
|
workspace: $workspaceStore ?? '',
|
|
68
68
|
onchange: () => saveDraft(),
|
|
@@ -83,7 +83,7 @@ setContext('AppEditorContext', {
|
|
|
83
83
|
history,
|
|
84
84
|
pickVariableCallback,
|
|
85
85
|
ontextfocus: writable(undefined),
|
|
86
|
-
|
|
86
|
+
movingcomponents: writable(undefined),
|
|
87
87
|
selectedComponentInEditor: writable(undefined)
|
|
88
88
|
});
|
|
89
89
|
let timeout = undefined;
|
|
@@ -110,12 +110,11 @@ function hashchange(e) {
|
|
|
110
110
|
$: previewing = $mode === 'preview';
|
|
111
111
|
$: width = $breakpoint === 'sm' ? 'min-w-[400px] max-w-[656px]' : 'min-w-[710px] w-full';
|
|
112
112
|
let selectedTab = 'insert';
|
|
113
|
-
|
|
113
|
+
let befSelected = undefined;
|
|
114
|
+
$: if ($selectedComponent?.[0] != befSelected) {
|
|
115
|
+
befSelected = $selectedComponent?.[0];
|
|
114
116
|
selectedTab = 'settings';
|
|
115
117
|
}
|
|
116
|
-
else {
|
|
117
|
-
selectedTab = 'insert';
|
|
118
|
-
}
|
|
119
118
|
let itemPicker = undefined;
|
|
120
119
|
$: if ($pickVariableCallback) {
|
|
121
120
|
itemPicker?.openDrawer();
|
|
@@ -177,6 +177,11 @@ let lock = false;
|
|
|
177
177
|
function onKeyDown(event) {
|
|
178
178
|
if (lock)
|
|
179
179
|
return;
|
|
180
|
+
let classes = event.target?.['className'];
|
|
181
|
+
if ((typeof classes === 'string' && classes.includes('inputarea')) ||
|
|
182
|
+
['INPUT', 'TEXTAREA'].includes(document.activeElement?.tagName)) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
180
185
|
lock = true;
|
|
181
186
|
switch (event.key) {
|
|
182
187
|
case 'Z':
|