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.
Files changed (115) hide show
  1. package/components/apps/components/buttons/AppButton.svelte +40 -53
  2. package/components/apps/components/buttons/AppButton.svelte.d.ts +6 -2
  3. package/components/apps/components/buttons/AppForm.svelte.d.ts +2 -2
  4. package/components/apps/components/buttons/AppFormButton.svelte.d.ts +2 -2
  5. package/components/apps/components/display/AppBarChart.svelte.d.ts +2 -2
  6. package/components/apps/components/display/AppIcon.svelte.d.ts +2 -3
  7. package/components/apps/components/display/AppImage.svelte.d.ts +2 -3
  8. package/components/apps/components/display/AppMap.svelte +3 -3
  9. package/components/apps/components/display/AppMap.svelte.d.ts +2 -3
  10. package/components/apps/components/display/AppPdf.svelte.d.ts +2 -3
  11. package/components/apps/components/display/AppPieChart.svelte.d.ts +2 -2
  12. package/components/apps/components/display/AppScatterChart.svelte.d.ts +2 -2
  13. package/components/apps/components/display/AppText.svelte.d.ts +2 -2
  14. package/components/apps/components/display/AppTimeseries.svelte.d.ts +2 -2
  15. package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +2 -1
  16. package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +2 -1
  17. package/components/apps/components/display/table/AppTable.svelte +77 -25
  18. package/components/apps/components/display/table/AppTable.svelte.d.ts +2 -2
  19. package/components/apps/components/helpers/InputValue.svelte +5 -1
  20. package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -1
  21. package/components/apps/components/helpers/RunnableComponent.svelte +14 -6
  22. package/components/apps/components/helpers/eval.js +36 -1
  23. package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +2 -3
  24. package/components/apps/components/inputs/AppDateInput.svelte.d.ts +2 -3
  25. package/components/apps/components/inputs/AppFileInput.svelte.d.ts +2 -3
  26. package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -3
  27. package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +2 -3
  28. package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +2 -3
  29. package/components/apps/components/inputs/AppSelect.svelte +1 -0
  30. package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -3
  31. package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +2 -3
  32. package/components/apps/components/inputs/AppTextInput.svelte.d.ts +2 -3
  33. package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +2 -3
  34. package/components/apps/components/layout/AppContainer.svelte +0 -1
  35. package/components/apps/components/layout/AppContainer.svelte.d.ts +0 -2
  36. package/components/apps/components/layout/AppDivider.svelte.d.ts +2 -3
  37. package/components/apps/components/layout/AppDrawer.svelte.d.ts +2 -3
  38. package/components/apps/components/layout/AppSplitpanes.svelte +1 -5
  39. package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +0 -2
  40. package/components/apps/components/layout/AppTabs.svelte +5 -3
  41. package/components/apps/components/layout/AppTabs.svelte.d.ts +2 -3
  42. package/components/apps/editor/AppEditor.svelte +3 -2
  43. package/components/apps/editor/AppEditorHeader.svelte +2 -2
  44. package/components/apps/editor/AppInputs.svelte +13 -14
  45. package/components/apps/editor/AppPreview.svelte +2 -1
  46. package/components/apps/editor/ComponentHeader.svelte +49 -50
  47. package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
  48. package/components/apps/editor/SettingsPanel.svelte +11 -0
  49. package/components/apps/editor/SubGridEditor.svelte +2 -2
  50. package/components/apps/editor/SubGridEditor.svelte.d.ts +1 -1
  51. package/components/apps/editor/appUtils.d.ts +1 -0
  52. package/components/apps/editor/appUtils.js +12 -0
  53. package/components/apps/editor/component/Component.svelte +16 -12
  54. package/components/apps/editor/component/ComponentNavigation.svelte +11 -1
  55. package/components/apps/editor/component/components.d.ts +1 -0
  56. package/components/apps/editor/component/components.js +21 -0
  57. package/components/apps/editor/contextPanel/ContextPanel.svelte +4 -5
  58. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +0 -1
  59. package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +1 -3
  60. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +12 -2
  61. package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +1 -1
  62. package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +14 -1
  63. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +4 -2
  64. package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +1 -1
  65. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +19 -34
  66. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +109 -13
  67. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +6 -2
  68. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +12 -100
  69. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -2
  70. package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +4 -0
  71. package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +2 -2
  72. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -2
  73. package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +0 -1
  74. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +12 -6
  75. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte +81 -0
  76. package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +21 -0
  77. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +18 -0
  78. package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +17 -0
  79. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +98 -0
  80. package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +24 -0
  81. package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.d.ts +2 -0
  82. package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.js +11 -0
  83. package/components/apps/inputType.d.ts +11 -2
  84. package/components/apps/rx.js +3 -2
  85. package/components/apps/svelte-grid/Grid.svelte +1 -1
  86. package/components/apps/types.d.ts +20 -2
  87. package/components/flows/flowStore.js +1 -1
  88. package/components/graph/FlowGraph.svelte +0 -2
  89. package/components/graph/FlowGraph.svelte.d.ts +0 -1
  90. package/components/graph/svelvet/container/views/GraphView.svelte +3 -28
  91. package/components/graph/svelvet/container/views/GraphView.svelte.d.ts +0 -3
  92. package/components/graph/svelvet/container/views/Svelvet.svelte +1 -17
  93. package/components/graph/svelvet/container/views/Svelvet.svelte.d.ts +0 -8
  94. package/components/graph/svelvet/customCss/controllers/getCss.js +0 -11
  95. package/components/graph/svelvet/edges/controllers/util.js +1 -2
  96. package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte.d.ts +2 -2
  97. package/components/graph/svelvet/nodes/controllers/util.js +1 -1
  98. package/components/graph/svelvet/nodes/models/Node.d.ts +0 -4
  99. package/components/graph/svelvet/nodes/models/Node.js +3 -41
  100. package/components/graph/svelvet/store/controllers/storeApi.js +2 -7
  101. package/components/graph/svelvet/store/controllers/util.d.ts +0 -7
  102. package/components/graph/svelvet/store/controllers/util.js +4 -36
  103. package/components/graph/svelvet/store/types/types.d.ts +0 -5
  104. package/components/home/ItemsList.svelte +1 -1
  105. package/package.json +7 -5
  106. package/utils.d.ts +2 -0
  107. package/utils.js +6 -0
  108. package/components/graph/svelvet/nodes/views/EditNode.svelte +0 -147
  109. package/components/graph/svelvet/nodes/views/EditNode.svelte.d.ts +0 -33
  110. package/components/graph/svelvet/resizableNodes/controllers/util.d.ts +0 -11
  111. package/components/graph/svelvet/resizableNodes/controllers/util.js +0 -24
  112. package/components/graph/svelvet/resizableNodes/models/ResizeNode.d.ts +0 -33
  113. package/components/graph/svelvet/resizableNodes/models/ResizeNode.js +0 -71
  114. package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte +0 -81
  115. 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
- const { worldStore, app } = getContext('AppViewerContext');
23
- let labelValue;
24
- let color;
25
- let size;
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 disabled = undefined;
28
- let fillContainer = undefined;
29
- let gotoUrl = undefined;
30
- let gotoNewTab = undefined;
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 triggerOnAppLoad = false;
34
- let beforeIcon = undefined;
35
- let afterIcon = undefined;
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
- <InputValue
96
- on:done={() => initializing && (initializing = false)}
97
- {id}
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>{labelValue}</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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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 { AppInput } from '../../inputType';
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: Record<string, AppInput>;
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 { AppInput } from '../../inputType';
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: Record<string, AppInput>;
6
+ configuration: RichConfigurations;
8
7
  customCss?: ComponentCustomCSS<'image'> | undefined;
9
8
  render: boolean;
10
9
  };
@@ -1,4 +1,4 @@
1
- <script>import { getContext, onMount } from 'svelte';
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
- onMount(() => {
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 { AppInput } from '../../inputType';
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: Record<string, AppInput>;
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 { AppInput } from '../../inputType';
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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: Record<string, AppInput>;
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
- {#if rowIndex == 0}
212
- <AppButton
213
- {render}
214
- noWFull
215
- {...actionButton}
216
- preclickAction={async () => {
217
- toggleRow(row, rowIndex)
218
- }}
219
- extraQueryParams={{ row: row.original }}
220
- bind:componentInput={actionButton.componentInput}
221
- />
222
- {:else}
223
- <AppButton
224
- {render}
225
- noWFull
226
- {...actionButton}
227
- preclickAction={async () => {
228
- toggleRow(row, rowIndex)
229
- }}
230
- extraQueryParams={{ row: row.original }}
231
- bind:componentInput={actionButton.componentInput}
232
- />
233
- {/if}
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: Record<string, AppInput>;
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 | undefined;
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) => {