windmill-components 1.82.8 → 1.82.10

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.
Files changed (88) hide show
  1. package/components/ArgInput.svelte +6 -0
  2. package/components/FlowBuilder.svelte +0 -5
  3. package/components/LightweightArgInput.svelte +5 -0
  4. package/components/Toggle.svelte +1 -1
  5. package/components/Toggle.svelte.d.ts +1 -0
  6. package/components/apps/components/buttons/AppButton.svelte +1 -1
  7. package/components/apps/components/buttons/AppForm.svelte +1 -0
  8. package/components/apps/components/buttons/AppFormButton.svelte +1 -0
  9. package/components/apps/components/display/AppDisplayComponent.svelte +17 -23
  10. package/components/apps/components/display/AppHtml.svelte +1 -7
  11. package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
  12. package/components/apps/components/display/AppMap.svelte +1 -1
  13. package/components/apps/components/display/AppPdf.svelte +1 -1
  14. package/components/apps/components/display/PlotlyHtml.svelte +3 -20
  15. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
  16. package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
  17. package/components/apps/components/display/table/AppTable.svelte +6 -6
  18. package/components/apps/components/helpers/HiddenComponent.svelte +2 -3
  19. package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -2
  20. package/components/apps/components/helpers/RefreshButton.svelte +10 -3
  21. package/components/apps/components/helpers/RefreshButton.svelte.d.ts +0 -1
  22. package/components/apps/components/helpers/RunnableComponent.svelte +7 -8
  23. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -1
  24. package/components/apps/components/helpers/RunnableWrapper.svelte +1 -1
  25. package/components/apps/components/inputs/AppCheckbox.svelte +4 -0
  26. package/components/apps/components/inputs/AppDateInput.svelte +2 -2
  27. package/components/apps/components/inputs/AppMultiSelect.svelte +3 -7
  28. package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
  29. package/components/apps/components/inputs/AppSelect.svelte +4 -3
  30. package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
  31. package/components/apps/components/inputs/AppTextInput.svelte +10 -7
  32. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
  33. package/components/apps/components/layout/AppContainer.svelte +2 -2
  34. package/components/apps/components/layout/AppDrawer.svelte +2 -1
  35. package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
  36. package/components/apps/components/layout/AppTabs.svelte +1 -1
  37. package/components/apps/editor/AppEditor.svelte +9 -35
  38. package/components/apps/editor/AppEditorHeader.svelte +0 -5
  39. package/components/apps/editor/AppPreview.svelte +5 -17
  40. package/components/apps/editor/ComponentHeader.svelte +0 -1
  41. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
  42. package/components/apps/editor/GridEditor.svelte +11 -21
  43. package/components/apps/editor/GridViewer.svelte +2 -2
  44. package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
  45. package/components/apps/editor/RecomputeAllComponents.svelte +7 -5
  46. package/components/apps/editor/SettingsPanel.svelte +3 -3
  47. package/components/apps/editor/SubGridEditor.svelte +12 -13
  48. package/components/apps/editor/appUtils.d.ts +0 -1
  49. package/components/apps/editor/appUtils.js +0 -19
  50. package/components/apps/editor/component/Component.svelte +6 -5
  51. package/components/apps/editor/component/Component.svelte.d.ts +1 -1
  52. package/components/apps/editor/component/ComponentNavigation.svelte +46 -55
  53. package/components/apps/editor/component/components.d.ts +26 -9
  54. package/components/apps/editor/component/components.js +26 -10
  55. package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
  56. package/components/apps/editor/componentsPanel/CssProperty.svelte +26 -0
  57. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -0
  58. package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -1
  59. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +10 -13
  60. package/components/apps/editor/contextPanel/ComponentOutput.svelte +26 -2
  61. package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +1 -0
  62. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +6 -8
  63. package/components/apps/editor/contextPanel/ContextPanel.svelte +11 -4
  64. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +25 -2
  65. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
  66. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
  67. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +40 -29
  68. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +2 -1
  69. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +3 -3
  70. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
  71. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +2 -2
  72. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +2 -18
  73. package/components/apps/editor/settingsPanel/StylePanel.svelte +2 -40
  74. package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
  75. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
  76. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
  77. package/components/apps/inputType.d.ts +2 -2
  78. package/components/apps/svelte-grid/Grid.svelte +34 -50
  79. package/components/apps/svelte-grid/Grid.svelte.d.ts +9 -14
  80. package/components/apps/svelte-grid/MoveResize.svelte +55 -76
  81. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +9 -15
  82. package/components/apps/svelte-grid/utils/helper.d.ts +1 -0
  83. package/components/apps/svelte-grid/utils/helper.js +3 -0
  84. package/components/apps/types.d.ts +4 -7
  85. package/components/apps/utils.d.ts +0 -2
  86. package/components/apps/utils.js +1 -30
  87. package/infer.js +1 -3
  88. package/package.json +2 -1
@@ -211,6 +211,7 @@ $: 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'))
214
215
  dispatch('focus')
215
216
  }}
216
217
  {disabled}
@@ -229,6 +230,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
229
230
  <Toggle
230
231
  on:pointerdown={(e) => {
231
232
  e?.stopPropagation()
233
+ window.dispatchEvent(new Event('pointerup'))
232
234
  }}
233
235
  {disabled}
234
236
  class={valid
@@ -308,6 +310,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
308
310
  <textarea
309
311
  bind:this={el}
310
312
  on:focus={(e) => {
313
+ window.dispatchEvent(new Event('pointerup'))
311
314
  dispatch('focus')
312
315
  }}
313
316
  {autofocus}
@@ -328,6 +331,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
328
331
  {:else if inputCat == 'enum'}
329
332
  <select
330
333
  on:focus={(e) => {
334
+ window.dispatchEvent(new Event('pointerup'))
331
335
  dispatch('focus')
332
336
  }}
333
337
  {disabled}
@@ -344,6 +348,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
344
348
  <div class="border my-1 mb-4 w-full border-gray-400">
345
349
  <SimpleEditor
346
350
  on:focus={(e) => {
351
+ window.dispatchEvent(new Event('pointerup'))
347
352
  dispatch('focus')
348
353
  }}
349
354
  on:blur={() => dispatch('blur')}
@@ -382,6 +387,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
382
387
  rows="1"
383
388
  bind:this={el}
384
389
  on:focus={(e) => {
390
+ window.dispatchEvent(new Event('pointerup'))
385
391
  dispatch('focus')
386
392
  }}
387
393
  on:blur={() => dispatch('blur')}
@@ -175,11 +175,6 @@ $: 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
- }
183
178
  switch (event.key) {
184
179
  case 'Z':
185
180
  if (event.ctrlKey) {
@@ -145,6 +145,7 @@ $: 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'))
148
149
  dispatch('focus')
149
150
  }}
150
151
  type="number"
@@ -162,6 +163,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
162
163
  <Toggle
163
164
  on:pointerdown={(e) => {
164
165
  e?.stopPropagation()
166
+ window.dispatchEvent(new Event('pointerup'))
165
167
  }}
166
168
  class={valid
167
169
  ? ''
@@ -238,6 +240,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
238
240
  <textarea
239
241
  bind:this={el}
240
242
  on:focus={(e) => {
243
+ window.dispatchEvent(new Event('pointerup'))
241
244
  dispatch('focus')
242
245
  }}
243
246
  use:autosize
@@ -255,6 +258,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
255
258
  {:else if inputCat == 'enum'}
256
259
  <select
257
260
  on:focus={(e) => {
261
+ window.dispatchEvent(new Event('pointerup'))
258
262
  dispatch('focus')
259
263
  }}
260
264
  class="px-6"
@@ -287,6 +291,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
287
291
  rows="1"
288
292
  bind:this={el}
289
293
  on:focus={(e) => {
294
+ window.dispatchEvent(new Event('pointerup'))
290
295
  dispatch('focus')
291
296
  }}
292
297
  on:blur={() => dispatch('blur')}
@@ -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:click|stopPropagation>
35
+ <div class="relative" on:pointerdown on:click|stopPropagation>
36
36
  <input
37
37
  on:focus
38
38
  on:click
@@ -14,6 +14,7 @@ declare const __propDef: {
14
14
  size?: "xs" | "sm" | undefined;
15
15
  };
16
16
  events: {
17
+ pointerdown: PointerEvent;
17
18
  click: MouseEvent;
18
19
  focus: FocusEvent;
19
20
  change: CustomEvent<any>;
@@ -55,7 +55,7 @@ let runnableWrapper;
55
55
  async function handleClick(event) {
56
56
  event?.stopPropagation();
57
57
  event?.preventDefault();
58
- $selectedComponent = [id];
58
+ $selectedComponent = id;
59
59
  if (preclickAction) {
60
60
  await preclickAction();
61
61
  }
@@ -82,6 +82,7 @@ let loading = false;
82
82
  style={css?.button?.style ?? ''}
83
83
  on:pointerdown={(e) => {
84
84
  e?.stopPropagation()
85
+ window.dispatchEvent(new Event('pointerup'))
85
86
  }}
86
87
  on:click={() => {
87
88
  runnableComponent?.runComponent()
@@ -87,6 +87,7 @@ let loading = false;
87
87
  btnClasses="my-1"
88
88
  on:pointerdown={(e) => {
89
89
  e?.stopPropagation()
90
+ window.dispatchEvent(new Event('pointerup'))
90
91
  }}
91
92
  on:click={async () => {
92
93
  if (!runnableComponent) {
@@ -19,28 +19,22 @@ const outputs = initOutput($worldStore, id, {
19
19
  </script>
20
20
 
21
21
  <RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
22
- <div class="flex flex-col w-full h-full">
23
- <div
24
- class={twMerge(
25
- 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
26
- $app.css?.['displaycomponent']?.['header']?.class,
27
- customCss?.header?.class
28
- )}
29
- >
30
- Results
31
- </div>
32
- <div
33
- style={twMerge(
34
- $app.css?.['displaycomponent']?.['container']?.style,
35
- customCss?.container?.style
36
- )}
37
- class={twMerge(
38
- 'p-2 grow',
39
- $app.css?.['displaycomponent']?.['container']?.class,
40
- customCss?.container?.class
41
- )}
42
- >
43
- <DisplayResult {result} {requireHtmlApproval} />
44
- </div>
22
+ <div
23
+ class={twMerge(
24
+ 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
25
+ $app.css?.['displaycomponent']?.['header']?.class,
26
+ customCss?.header?.class
27
+ )}
28
+ >
29
+ Results
30
+ </div>
31
+ <div
32
+ class={twMerge(
33
+ 'p-2',
34
+ $app.css?.['displaycomponent']?.['container']?.class,
35
+ customCss?.container?.class
36
+ )}
37
+ >
38
+ <DisplayResult {result} {requireHtmlApproval} />
45
39
  </div>
46
40
  </RunnableWrapper>
@@ -7,7 +7,7 @@ export let componentInput;
7
7
  export let initializing = undefined;
8
8
  export let customCss = undefined;
9
9
  export let render;
10
- const { app, worldStore, selectedComponent } = getContext('AppViewerContext');
10
+ const { app, worldStore } = getContext('AppViewerContext');
11
11
  const outputs = initOutput($worldStore, id, {
12
12
  result: undefined,
13
13
  loading: false
@@ -26,10 +26,6 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
26
26
  bind:clientHeight={h}
27
27
  bind:clientWidth={w}
28
28
  >
29
- <button
30
- class="absolute bottom-0 left-0 text-xs border px-2 py-0.5 bg-white/80"
31
- on:click={() => ($selectedComponent = [id])}>Select</button
32
- >
33
29
  <RunnableWrapper
34
30
  {outputs}
35
31
  {render}
@@ -50,7 +46,5 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
50
46
  : 'No html'}
51
47
  />
52
48
  {/key}
53
- <!-- svelte-ignore a11y-click-events-have-key-events -->
54
- <div on:click|stopPropagation class="absolute top-0 h-full w-full" />
55
49
  </RunnableWrapper>
56
50
  </div>
@@ -10,8 +10,6 @@ declare const __propDef: {
10
10
  render: boolean;
11
11
  };
12
12
  events: {
13
- click: MouseEvent;
14
- } & {
15
13
  [evt: string]: CustomEvent<any>;
16
14
  };
17
15
  slots: {};
@@ -41,7 +41,7 @@ $: if (map && markers) {
41
41
  }
42
42
  function selectComponent() {
43
43
  if (!$connectingInput.opened) {
44
- $selectedComponent = [id];
44
+ $selectedComponent = id;
45
45
  $focusedGrid = undefined;
46
46
  }
47
47
  }
@@ -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?.includes(id)}
292
+ {#if $mode !== 'preview' && $selectedComponent === 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"
@@ -1,15 +1,12 @@
1
1
  <script>import { getContext, onMount } from 'svelte';
2
- import { initConfig, initOutput } from '../../editor/appUtils';
3
- import { components } from '../../editor/component';
4
- import ResolveConfig from '../helpers/ResolveConfig.svelte';
2
+ import { initOutput } from '../../editor/appUtils';
5
3
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
6
4
  export let id;
7
5
  export let componentInput;
8
- export let configuration;
6
+ // export let configuration: Record<string, AppInput>
9
7
  export let initializing = undefined;
10
8
  export let render;
11
9
  const { worldStore } = getContext('AppViewerContext');
12
- let resolvedConfig = initConfig(components['plotlycomponent'].initialData.configuration, configuration);
13
10
  const outputs = initOutput($worldStore, id, {
14
11
  result: undefined,
15
12
  loading: false
@@ -30,23 +27,9 @@ $: Plotly &&
30
27
  divEl &&
31
28
  h &&
32
29
  w &&
33
- Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], {
34
- width: w,
35
- height: h,
36
- margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 },
37
- ...resolvedConfig.layout
38
- }, { responsive: true, displayModeBar: false });
30
+ Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
39
31
  </script>
40
32
 
41
- {#each Object.keys(components['plotlycomponent'].initialData.configuration) as key (key)}
42
- <ResolveConfig
43
- {id}
44
- {key}
45
- bind:resolvedConfig={resolvedConfig[key]}
46
- configuration={configuration[key]}
47
- />
48
- {/each}
49
-
50
33
  <div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
51
34
  <RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
52
35
  <div on:pointerdown bind:this={divEl} />
@@ -1,11 +1,9 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
- import type { RichConfigurations } from '../../types';
4
3
  declare const __propDef: {
5
4
  props: {
6
5
  id: string;
7
6
  componentInput: AppInput | undefined;
8
- configuration: RichConfigurations;
9
7
  initializing?: boolean | undefined;
10
8
  render: boolean;
11
9
  };
@@ -72,7 +72,7 @@ function onCellValueChanged(event) {
72
72
  >
73
73
  <div
74
74
  on:pointerdown|stopPropagation={() => {
75
- $selectedComponent = [id]
75
+ $selectedComponent = id
76
76
  }}
77
77
  style:height="{clientHeight}px"
78
78
  style:width="{clientWidth}px"
@@ -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={($selectedComponent?.includes(actionButton.id) ||
237
+ class={(actionButton.id === $selectedComponent ||
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 $selectedComponent?.includes(actionButton.id) || $hoverStore === actionButton.id}
243
+ {#if actionButton.id === $selectedComponent || $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,8 +5,7 @@ export let id;
5
5
  export let name;
6
6
  export let inlineScript;
7
7
  export let fields;
8
- export let doNotRecomputeOnInputChanged;
9
- export let recomputableByRefreshButton;
8
+ export let doNotRecomputeOnInputChanged = false;
10
9
  let result = undefined;
11
10
  const { worldStore } = getContext('AppViewerContext');
12
11
  let outputs = initOutput($worldStore, id, {
@@ -29,8 +28,8 @@ let outputs = initOutput($worldStore, id, {
29
28
  type: 'runnableByName'
30
29
  }}
31
30
  wrapperClass="hidden"
31
+ recomputable
32
32
  {outputs}
33
- {recomputableByRefreshButton}
34
33
  >
35
34
  <slot />
36
35
  </RunnableComponent>
@@ -7,8 +7,7 @@ declare const __propDef: {
7
7
  name: string;
8
8
  inlineScript: InlineScript | undefined;
9
9
  fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
10
- doNotRecomputeOnInputChanged: boolean;
11
- recomputableByRefreshButton: boolean;
10
+ doNotRecomputeOnInputChanged?: boolean | undefined;
12
11
  };
13
12
  events: {
14
13
  [evt: string]: CustomEvent<any>;
@@ -1,11 +1,18 @@
1
1
  <script>import { RefreshCw } from 'lucide-svelte';
2
2
  import { getContext } from 'svelte';
3
3
  export let componentId;
4
- export let loading;
5
- const { runnableComponents } = getContext('AppViewerContext');
4
+ const { runnableComponents, worldStore } = getContext('AppViewerContext');
6
5
  async function refresh() {
7
- await $runnableComponents[componentId]?.cb?.();
6
+ window.dispatchEvent(new Event('pointerup'));
7
+ await $runnableComponents[componentId]?.();
8
8
  }
9
+ let loading = false;
10
+ $: $worldStore?.outputsById[componentId]?.['loading']?.subscribe({
11
+ id: 'refresh-' + componentId,
12
+ next: (value) => {
13
+ loading = value;
14
+ }
15
+ });
9
16
  </script>
10
17
 
11
18
  <button
@@ -2,7 +2,6 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  componentId: string;
5
- loading: boolean;
6
5
  };
7
6
  events: {
8
7
  pointerdown: PointerEvent;
@@ -23,20 +23,19 @@ export let wrapperClass = '';
23
23
  export let wrapperStyle = '';
24
24
  export let initializing = undefined;
25
25
  export let render;
26
+ export let recomputable = false;
26
27
  export let outputs;
27
28
  export let extraKey = '';
28
29
  export let doNotRecomputeOnInputChanged = false;
29
30
  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
- $runnableComponents[id] = {
34
- autoRefresh: autoRefresh && recomputableByRefreshButton,
35
- cb: async (inlineScript) => {
33
+ if (recomputable || autoRefresh) {
34
+ $runnableComponents[id] = async (inlineScript) => {
36
35
  await executeComponent(true, inlineScript);
37
- }
38
- };
39
- $runnableComponents = $runnableComponents;
36
+ };
37
+ $runnableComponents = $runnableComponents;
38
+ }
40
39
  let args = undefined;
41
40
  let testIsLoading = false;
42
41
  let runnableInputValues = {};
@@ -311,7 +310,7 @@ async function setResult(res) {
311
310
  {/if}
312
311
  {#if !initializing && autoRefresh === true}
313
312
  <div class="flex absolute top-1 right-1 z-50">
314
- <RefreshButton {loading} componentId={id} />
313
+ <RefreshButton componentId={id} />
315
314
  </div>
316
315
  {/if}
317
316
  </div>
@@ -18,6 +18,7 @@ declare const __propDef: {
18
18
  wrapperStyle?: string | undefined;
19
19
  initializing?: boolean | undefined;
20
20
  render: boolean;
21
+ recomputable?: boolean | undefined;
21
22
  outputs: {
22
23
  result: Output<any>;
23
24
  loading: Output<boolean>;
@@ -25,7 +26,6 @@ declare const __propDef: {
25
26
  extraKey?: string | undefined;
26
27
  doNotRecomputeOnInputChanged?: boolean | undefined;
27
28
  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?.cb?.[id]?.());
38
+ recomputeIds.map((id) => $runnableComponents?.[id]?.());
39
39
  }
40
40
  if (!doOnSuccess)
41
41
  return;
@@ -27,6 +27,10 @@ $: 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
+ }}
30
34
  checked={defaultValue}
31
35
  options={{ right: labelValue }}
32
36
  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(css?.input?.class ?? '')}
45
+ class={twMerge('mx-0.5', css?.input?.class ?? '')}
46
46
  style={css?.input?.style ?? ''}
47
47
  />
48
48
  {/if}
@@ -42,11 +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
46
- class="app-select w-full"
47
- style="height: 34px; overflow: auto;"
48
- on:pointerdown|stopPropagation
49
- >
45
+ <div class="app-select w-full mx-0.5" style="height: 34px" on:pointerdown|stopPropagation>
50
46
  {#if !value || Array.isArray(value)}
51
47
  <Select
52
48
  --border-radius="0"
@@ -62,11 +58,11 @@ $: css = concatCustomCss($app.css?.selectcomponent, customCss);
62
58
  {placeholder}
63
59
  on:click={() => {
64
60
  if (!$connectingInput.opened) {
65
- $selectedComponent = [id]
61
+ $selectedComponent = id
66
62
  }
67
63
  }}
68
64
  on:focus={() => {
69
- $selectedComponent = [id]
65
+ $selectedComponent = id
70
66
  }}
71
67
  floatingConfig={{
72
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 mx-0.5',
42
42
  css?.input?.class ?? ''
43
43
  )}
44
44
  style={css?.input?.style ?? ''}
@@ -43,6 +43,7 @@ function handleItems() {
43
43
  }
44
44
  function onChange(e) {
45
45
  e?.stopPropagation();
46
+ window.dispatchEvent(new Event('pointerup'));
46
47
  if (create) {
47
48
  listItems = listItems.map((i) => {
48
49
  delete i.created;
@@ -87,7 +88,7 @@ let filterText = '';
87
88
  <InputValue {id} input={configuration.create} bind:value={create} />
88
89
 
89
90
  <AlignWrapper {render} {horizontalAlignment} {verticalAlignment}>
90
- <div class="app-select w-full" style="height: 34px;" on:pointerdown|stopPropagation>
91
+ <div class="app-select w-full mx-0.5" style="height: 34px;" on:pointerdown|stopPropagation>
91
92
  <Select
92
93
  --border-radius="0"
93
94
  --border-color="#999"
@@ -104,11 +105,11 @@ let filterText = '';
104
105
  {placeholder}
105
106
  on:click={() => {
106
107
  if (!$connectingInput.opened) {
107
- $selectedComponent = [id]
108
+ $selectedComponent = id
108
109
  }
109
110
  }}
110
111
  on:focus={() => {
111
- $selectedComponent = [id]
112
+ $selectedComponent = id
112
113
  }}
113
114
  floatingConfig={{
114
115
  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>