windmill-components 1.60.3 → 1.70.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/assets/app.css +3 -0
- package/common.d.ts +5 -1
- package/components/ApiConnectForm.svelte +66 -5
- package/components/AppConnect.svelte +24 -9
- package/components/ArgInput.svelte +1 -1
- package/components/CliHelpBox.svelte +49 -0
- package/components/CliHelpBox.svelte.d.ts +14 -0
- package/components/DisplayResult.svelte +51 -1
- package/components/DisplayResult.svelte.d.ts +1 -0
- package/components/Editor.svelte +17 -7
- package/components/EditorBar.svelte +129 -111
- package/components/FlowBuilder.svelte +2 -2
- package/components/FlowJobResult.svelte +10 -2
- package/components/FlowJobResult.svelte.d.ts +1 -0
- package/components/FlowMetadata.svelte +24 -8
- package/components/FlowPreviewContent.svelte +3 -4
- package/components/FlowStatusViewer.svelte +41 -9
- package/components/FolderEditor.svelte +4 -3
- package/components/HighlightCode.svelte +7 -1
- package/components/InlineCodeCopy.svelte +11 -0
- package/components/InlineCodeCopy.svelte.d.ts +16 -0
- package/components/InputTransformForm.svelte +9 -5
- package/components/LogViewer.svelte +6 -0
- package/components/LogViewer.svelte.d.ts +1 -0
- package/components/ModulePreview.svelte +11 -2
- package/components/MoveDrawer.svelte +1 -1
- package/components/Multiselect.svelte.d.ts +2 -2
- package/components/ObjectResourceInput.svelte +6 -1
- package/components/Path.svelte +14 -5
- package/components/Popover.svelte +8 -2
- package/components/Popover.svelte.d.ts +1 -0
- package/components/Range.svelte.d.ts +2 -2
- package/components/ResourceEditor.svelte +39 -16
- package/components/ResourcePicker.svelte +0 -1
- package/components/RunForm.svelte +26 -2
- package/components/RunForm.svelte.d.ts +1 -0
- package/components/ScheduleEditor.svelte +1 -1
- package/components/SchemaEditor.svelte +2 -2
- package/components/SchemaForm.svelte +14 -4
- package/components/SchemaForm.svelte.d.ts +1 -0
- package/components/ScriptBuilder.svelte +45 -22
- package/components/ScriptBuilder.svelte.d.ts +1 -0
- package/components/ScriptEditor.svelte +1 -0
- package/components/SharedBadge.svelte +5 -5
- package/components/Slider.svelte +14 -0
- package/components/Slider.svelte.d.ts +19 -0
- package/components/StringTypeNarrowing.svelte +0 -1
- package/components/SuperadminSettings.svelte +11 -3
- package/components/SuperadminSettings.svelte.d.ts +2 -0
- package/components/TemplateEditor.svelte.d.ts +204 -0
- package/components/TestJobLoader.svelte +3 -3
- package/components/Toggle.svelte +1 -2
- package/components/UserSettings.svelte +25 -28
- package/components/UserSettings.svelte.d.ts +2 -0
- package/components/VariableEditor.svelte +1 -1
- package/components/WhitelistIp.svelte +23 -0
- package/components/WhitelistIp.svelte.d.ts +14 -0
- package/components/apps/components/buttons/AppButton.svelte +52 -6
- package/components/apps/components/buttons/AppButton.svelte.d.ts +3 -0
- package/components/apps/components/{form → buttons}/AppForm.svelte +3 -1
- package/components/apps/components/buttons/AppFormButton.svelte +137 -0
- package/components/apps/components/buttons/AppFormButton.svelte.d.ts +25 -0
- package/components/apps/components/buttons/index.d.ts +3 -0
- package/components/apps/components/buttons/index.js +3 -0
- package/components/apps/components/{dataDisplay → display}/AppBarChart.svelte +15 -4
- package/components/apps/components/{dataDisplay → display}/AppBarChart.svelte.d.ts +1 -0
- package/components/apps/components/display/AppDisplayComponent.svelte +31 -0
- package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +23 -0
- package/components/apps/components/display/AppHtml.svelte +32 -0
- package/components/apps/components/{dataDisplay → display}/AppHtml.svelte.d.ts +1 -3
- package/components/apps/components/display/AppIcon.svelte +35 -0
- package/components/apps/components/display/AppIcon.svelte.d.ts +22 -0
- package/components/apps/components/display/AppImage.svelte +27 -0
- package/components/apps/components/display/AppImage.svelte.d.ts +22 -0
- package/components/apps/components/{dataDisplay → display}/AppPieChart.svelte +2 -1
- package/components/apps/components/{dataDisplay → display}/AppPieChart.svelte.d.ts +1 -0
- package/components/apps/components/{dataDisplay → display}/AppScatterChart.svelte +2 -1
- package/components/apps/components/{dataDisplay → display}/AppScatterChart.svelte.d.ts +1 -0
- package/components/apps/components/{dataDisplay → display}/AppText.svelte +16 -14
- package/components/apps/components/{dataDisplay → display}/AppText.svelte.d.ts +3 -0
- package/components/apps/components/{dataDisplay → display}/AppTimeseries.svelte +3 -2
- package/components/apps/components/{dataDisplay → display}/AppTimeseries.svelte.d.ts +1 -0
- package/components/apps/components/display/PlotlyHtml.svelte +38 -0
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +24 -0
- package/components/apps/components/display/VegaLiteHtml.svelte +52 -0
- package/components/apps/components/{dataDisplay → display}/VegaLiteHtml.svelte.d.ts +3 -2
- package/components/apps/components/display/index.d.ts +12 -0
- package/components/apps/components/display/index.js +12 -0
- package/components/apps/components/display/table/AppAggridTable.svelte +83 -0
- package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +24 -0
- package/components/apps/components/{table → display/table}/AppTable.svelte +44 -23
- package/components/apps/components/{table → display/table}/AppTable.svelte.d.ts +4 -2
- package/components/apps/components/{table → display/table}/AppTableFooter.svelte +1 -1
- package/components/apps/components/helpers/AlignWrapper.svelte +19 -19
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +4 -2
- package/components/apps/components/helpers/HiddenComponent.svelte +22 -0
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +25 -0
- package/components/apps/components/helpers/InputDefaultValue.svelte +17 -0
- package/components/apps/components/helpers/InputDefaultValue.svelte.d.ts +17 -0
- package/components/apps/components/helpers/InputValue.svelte +5 -7
- package/components/apps/components/helpers/InputValue.svelte.d.ts +0 -1
- package/components/apps/components/helpers/RunnableComponent.svelte +37 -48
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +7 -2
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +2 -1
- package/components/apps/components/helpers/index.d.ts +10 -0
- package/components/apps/components/helpers/index.js +10 -0
- package/components/apps/components/icon.d.ts +1 -0
- package/components/apps/components/icon.js +18 -0
- package/components/apps/components/index.d.ts +5 -0
- package/components/apps/components/index.js +5 -0
- package/components/apps/components/{selectInputs → inputs}/AppCheckbox.svelte +4 -2
- package/components/apps/components/{dateInputs → inputs}/AppDateInput.svelte +6 -0
- package/components/apps/components/inputs/AppFileInput.svelte +34 -0
- package/components/apps/components/inputs/AppFileInput.svelte.d.ts +20 -0
- package/components/apps/components/inputs/AppNumberInput.svelte +48 -0
- package/components/apps/components/inputs/AppRangeInput.svelte +44 -0
- package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +23 -0
- package/components/apps/components/inputs/AppSelect.svelte +90 -0
- package/components/apps/components/{selectInputs → inputs}/AppSelect.svelte.d.ts +2 -0
- package/components/apps/components/{numberInputs → inputs}/AppSliderInputs.svelte +13 -9
- package/components/apps/components/{textInputs → inputs}/AppTextInput.svelte +6 -0
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +49 -0
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +21 -0
- package/components/apps/components/inputs/currency/CurrencyInput.svelte +181 -0
- package/components/apps/components/inputs/currency/CurrencyInput.svelte.d.ts +32 -0
- package/components/apps/components/inputs/index.d.ts +9 -0
- package/components/apps/components/inputs/index.js +9 -0
- package/components/apps/components/layout/AppContainer.svelte +32 -0
- package/components/apps/components/layout/AppContainer.svelte.d.ts +21 -0
- package/components/apps/components/layout/AppDivider.svelte +20 -0
- package/components/apps/components/layout/AppDivider.svelte.d.ts +22 -0
- package/components/apps/components/layout/AppTabs.svelte +58 -0
- package/components/apps/components/layout/AppTabs.svelte.d.ts +24 -0
- package/components/apps/components/layout/index.d.ts +3 -0
- package/components/apps/components/layout/index.js +3 -0
- package/components/apps/editor/AppComponentInput.svelte +33 -0
- package/components/apps/editor/AppComponentInput.svelte.d.ts +18 -0
- package/components/apps/editor/AppComponentInputs.svelte +13 -0
- package/components/apps/editor/AppComponentInputs.svelte.d.ts +20 -0
- package/components/apps/editor/AppEditor.svelte +66 -31
- package/components/apps/editor/AppEditor.svelte.d.ts +1 -0
- package/components/apps/editor/AppEditorHeader.svelte +74 -18
- package/components/apps/editor/AppEditorHeader.svelte.d.ts +1 -0
- package/components/apps/editor/AppInputs.svelte +60 -0
- package/components/apps/editor/AppInputs.svelte.d.ts +14 -0
- package/components/apps/editor/AppPreview.svelte +32 -5
- package/components/apps/editor/AppPreview.svelte.d.ts +2 -0
- package/components/apps/editor/ComponentHeader.svelte +40 -2
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +75 -32
- package/components/apps/editor/GridEditor.svelte.d.ts +2 -0
- package/components/apps/editor/SettingsPanel.svelte +31 -3
- package/components/apps/editor/SubGridEditor.svelte +111 -0
- package/components/apps/editor/SubGridEditor.svelte.d.ts +24 -0
- package/components/apps/editor/TablePanel.svelte +2 -0
- package/components/apps/editor/TablePanel.svelte.d.ts +1 -1
- package/components/apps/editor/appUtils.d.ts +9 -0
- package/components/apps/editor/appUtils.js +141 -0
- package/components/apps/editor/component/Component.svelte +209 -0
- package/components/apps/editor/component/Component.svelte.d.ts +23 -0
- package/components/apps/editor/component/README.md +15 -0
- package/components/apps/editor/component/components.d.ts +65 -0
- package/components/apps/editor/component/components.js +1102 -0
- package/components/apps/editor/component/default-codes.d.ts +3 -0
- package/components/apps/editor/component/default-codes.js +322 -0
- package/components/apps/editor/component/index.d.ts +4 -0
- package/components/apps/editor/component/index.js +4 -0
- package/components/apps/editor/component/sets.d.ts +2 -0
- package/components/apps/editor/component/sets.js +47 -0
- package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -105
- package/components/apps/editor/componentsPanel/CssProperty.svelte +31 -0
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +20 -0
- package/components/apps/editor/componentsPanel/CssSettings.svelte +141 -0
- package/components/apps/editor/componentsPanel/CssSettings.svelte.d.ts +14 -0
- package/components/apps/editor/componentsPanel/ListItem.svelte +28 -0
- package/components/apps/editor/componentsPanel/ListItem.svelte.d.ts +20 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +4 -1
- package/components/apps/editor/componentsPanel/componentStaticValues.js +4 -1
- package/components/apps/editor/contextPanel/ContextPanel.svelte +8 -6
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +98 -9
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +38 -29
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +21 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +66 -8
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +92 -46
- package/components/apps/editor/inlineScriptsPanel/utils.d.ts +5 -1
- package/components/apps/editor/inlineScriptsPanel/utils.js +30 -0
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte.d.ts +1 -1
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +4 -1
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +59 -1
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +64 -34
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +5 -3
- package/components/apps/editor/settingsPanel/GridTab.svelte +73 -0
- package/components/apps/editor/settingsPanel/GridTab.svelte.d.ts +18 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +3 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +92 -77
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte +85 -0
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte.d.ts +18 -0
- package/components/apps/editor/settingsPanel/Recompute.svelte +4 -1
- package/components/apps/editor/settingsPanel/TableActions.svelte +17 -6
- package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +2 -1
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +5 -3
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +83 -0
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte.d.ts +19 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +6 -1
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +2 -0
- package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte +23 -0
- package/components/apps/editor/settingsPanel/inputEditor/UploadInputEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +3 -20
- package/components/apps/gridUtils.d.ts +3 -1
- package/components/apps/gridUtils.js +5 -3
- package/components/apps/inputType.d.ts +33 -6
- package/components/apps/types.d.ts +35 -39
- package/components/apps/types.js +1 -1
- package/components/apps/utils.d.ts +6 -5
- package/components/apps/utils.js +90 -90
- package/components/common/button/Button.svelte +12 -5
- package/components/common/button/Button.svelte.d.ts +3 -1
- package/components/common/button/ButtonPopup.svelte.d.ts +1 -1
- package/components/common/button/model.d.ts +2 -2
- package/components/common/button/model.js +21 -6
- package/components/common/confirmationModal/ConfirmationModal.svelte +8 -1
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +4 -4
- package/components/common/drawer/Drawer.svelte +3 -1
- package/components/common/fileInput/FileInput.svelte +112 -0
- package/components/common/fileInput/FileInput.svelte.d.ts +27 -0
- package/components/common/index.d.ts +1 -0
- package/components/common/index.js +1 -0
- package/components/common/kbd/Kbd.svelte.d.ts +2 -2
- package/components/common/modal/Modal.svelte +74 -0
- package/components/common/modal/Modal.svelte.d.ts +22 -0
- package/components/common/popup/Popup.svelte +34 -17
- package/components/common/popup/Popup.svelte.d.ts +11 -4
- package/components/common/table/FlowRow.svelte +22 -3
- package/components/common/table/LanguageBadge.svelte +10 -4
- package/components/common/table/Row.svelte +1 -1
- package/components/common/table/ScriptRow.svelte +2 -2
- package/components/common/tabs/Tabs.svelte +9 -7
- package/components/common/tabs/Tabs.svelte.d.ts +3 -1
- package/components/flows/CreateActionsFlow.svelte +2 -3
- package/components/flows/content/BranchPredicateEditor.svelte +10 -8
- package/components/flows/content/CapturePayload.svelte +3 -3
- package/components/flows/content/FlowInputs.svelte +109 -99
- package/components/flows/content/FlowLoop.svelte +1 -1
- package/components/flows/content/FlowModuleComponent.svelte +3 -2
- package/components/flows/content/FlowRetries.svelte +8 -6
- package/components/flows/content/FlowSettings.svelte +72 -26
- package/components/flows/flowState.d.ts +1 -0
- package/components/flows/flowState.js +1 -0
- package/components/flows/flowStateUtils.js +4 -2
- package/components/flows/flowStore.d.ts +1 -0
- package/components/flows/flowStore.js +1 -0
- package/components/flows/map/FlowBranchAllMap.svelte +1 -1
- package/components/flows/map/FlowBranchOneMap.svelte +2 -2
- package/components/flows/map/FlowModuleSchemaItem.svelte +5 -5
- package/components/flows/map/FlowModuleSchemaMap.svelte +15 -8
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +1 -0
- package/components/flows/map/InsertModuleButton.svelte +24 -10
- package/components/flows/map/InsertModuleButton.svelte.d.ts +1 -0
- package/components/flows/map/MapItem.svelte +3 -1
- package/components/flows/utils.js +16 -10
- package/components/graph/FlowGraph.svelte +38 -15
- package/components/graph/FlowGraph.svelte.d.ts +1 -0
- package/components/icons/SquareIcon.svelte +9 -0
- package/components/icons/SquareIcon.svelte.d.ts +17 -0
- package/components/icons/index.d.ts +2 -0
- package/components/icons/index.js +2 -0
- package/components/jobs/JobDetail.svelte +29 -5
- package/components/propertyPicker/ObjectViewer.svelte +8 -5
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/PropPicker.svelte +8 -1
- package/components/propertyPicker/PropPickerResult.svelte +1 -1
- package/components/random_positive_adjetive.d.ts +1 -0
- package/components/random_positive_adjetive.js +961 -0
- package/components/scriptEditor/LogPanel.svelte +2 -1
- package/components/sidebar/SidebarContent.svelte +1 -1
- package/components/sidebar/UserMenu.svelte +46 -16
- package/components/sidebar/UserMenu.svelte.d.ts +0 -3
- package/components/sidebar/WorkspaceMenu.svelte +3 -1
- package/components/sidebar/settings.d.ts +2 -0
- package/components/sidebar/settings.js +2 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/models/CompletedJob.d.ts +1 -0
- package/gen/models/FlowModule.d.ts +0 -1
- package/gen/models/QueuedJob.d.ts +1 -0
- package/gen/models/WorkerPing.d.ts +1 -1
- package/gen/services/FlowService.d.ts +9 -0
- package/gen/services/FlowService.js +15 -0
- package/gen/services/JobService.d.ts +97 -15
- package/gen/services/JobService.js +74 -15
- package/gen/services/ScriptService.d.ts +10 -1
- package/gen/services/ScriptService.js +16 -1
- package/gen/services/VariableService.d.ts +4 -2
- package/gen/services/VariableService.js +8 -2
- package/gen/services/WorkspaceService.d.ts +17 -0
- package/gen/services/WorkspaceService.js +16 -0
- package/infer.js +3 -0
- package/init_scripts/python_failure_module.py +10 -0
- package/init_scripts/python_init_code.py +37 -0
- package/init_scripts/python_init_code_clear.py +5 -0
- package/init_scripts/python_init_code_trigger.py +14 -0
- package/logout.js +2 -1
- package/package.json +577 -522
- package/script_helpers.d.ts +6 -5
- package/script_helpers.js +7 -73
- package/stores.d.ts +5 -1
- package/stores.js +8 -1
- package/user.d.ts +1 -1
- package/user.js +14 -8
- package/utils.d.ts +1 -1
- package/utils.js +8 -7
- package/components/apps/components/DisplayComponent.svelte +0 -16
- package/components/apps/components/DisplayComponent.svelte.d.ts +0 -20
- package/components/apps/components/dataDisplay/AppHtml.svelte +0 -35
- package/components/apps/components/dataDisplay/VegaLiteHtml.svelte +0 -28
- package/components/apps/components/numberInputs/AppNumberInput.svelte +0 -33
- package/components/apps/components/selectInputs/AppSelect.svelte +0 -47
- package/components/apps/editor/ComponentEditor.svelte +0 -138
- package/components/apps/editor/ComponentEditor.svelte.d.ts +0 -23
- package/components/apps/editor/componentsPanel/data.d.ts +0 -3
- package/components/apps/editor/componentsPanel/data.js +0 -465
- package/components/apps/editorUtils.d.ts +0 -1
- package/components/apps/editorUtils.js +0 -253
- /package/components/apps/components/{form → buttons}/AppForm.svelte.d.ts +0 -0
- /package/components/apps/components/{table → display/table}/AppTableFooter.svelte.d.ts +0 -0
- /package/components/apps/components/{table → display/table}/tableOptions.d.ts +0 -0
- /package/components/apps/components/{table → display/table}/tableOptions.js +0 -0
- /package/components/apps/components/{selectInputs → inputs}/AppCheckbox.svelte.d.ts +0 -0
- /package/components/apps/components/{dateInputs → inputs}/AppDateInput.svelte.d.ts +0 -0
- /package/components/apps/components/{numberInputs → inputs}/AppNumberInput.svelte.d.ts +0 -0
- /package/components/apps/components/{numberInputs → inputs}/AppSliderInputs.svelte.d.ts +0 -0
- /package/components/apps/components/{textInputs → inputs}/AppTextInput.svelte.d.ts +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>import { FileInput } from "../../../../common";
|
|
2
|
+
export let componentInput;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<FileInput
|
|
6
|
+
accept={componentInput?.fileUpload?.accept}
|
|
7
|
+
multiple={componentInput?.fileUpload?.multiple}
|
|
8
|
+
convertToBase64={componentInput?.fileUpload?.base64}
|
|
9
|
+
iconSize={24}
|
|
10
|
+
class="text-sm py-4"
|
|
11
|
+
on:change={({detail}) => {
|
|
12
|
+
if(componentInput) {
|
|
13
|
+
componentInput.value = componentInput?.fileUpload?.multiple
|
|
14
|
+
? detail
|
|
15
|
+
: detail?.[0]
|
|
16
|
+
}
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<svelte:fragment slot="selected-title">
|
|
20
|
+
<!-- Removing the title when there is a selected file -->
|
|
21
|
+
<span></span>
|
|
22
|
+
</svelte:fragment>
|
|
23
|
+
</FileInput>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { UploadAppInput } from "../../../inputType";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
componentInput: UploadAppInput | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export type UploadInputEditorProps = typeof __propDef.props;
|
|
13
|
+
export type UploadInputEditorEvents = typeof __propDef.events;
|
|
14
|
+
export type UploadInputEditorSlots = typeof __propDef.slots;
|
|
15
|
+
export default class UploadInputEditor extends SvelteComponentTyped<UploadInputEditorProps, UploadInputEditorEvents, UploadInputEditorSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import InlineScriptList from './InlineScriptList.svelte';
|
|
|
6
6
|
import WorkspaceScriptList from './WorkspaceScriptList.svelte';
|
|
7
7
|
import WorkspaceFlowList from './WorkspaceFlowList.svelte';
|
|
8
8
|
import { getContext } from 'svelte';
|
|
9
|
-
import { loadSchema, schemaToInputsSpec } from '../../../utils';
|
|
9
|
+
import { getAllScriptNames, loadSchema, schemaToInputsSpec } from '../../../utils';
|
|
10
10
|
import { emptySchema } from '../../../../../utils';
|
|
11
11
|
export let appInput;
|
|
12
12
|
export let defaultUserInput = false;
|
|
@@ -72,26 +72,9 @@ function pickInlineScript(name) {
|
|
|
72
72
|
function createScript() {
|
|
73
73
|
let index = 0;
|
|
74
74
|
let newScriptPath = `Inline Script ${index}`;
|
|
75
|
-
const names = $app
|
|
76
|
-
const { componentInput } = gridItem.data;
|
|
77
|
-
if (componentInput?.type === 'runnable' &&
|
|
78
|
-
componentInput?.runnable?.type === 'runnableByName') {
|
|
79
|
-
acc.push(componentInput.runnable.name);
|
|
80
|
-
}
|
|
81
|
-
if (componentInput?.type === 'tablecomponent') {
|
|
82
|
-
componentInput.actionButtons.forEach((actionButton) => {
|
|
83
|
-
if (actionButton.componentInput?.type === 'runnable') {
|
|
84
|
-
if (actionButton.componentInput.runnable?.type === 'runnableByName') {
|
|
85
|
-
acc.push(actionButton.componentInput.runnable.name);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return acc;
|
|
91
|
-
}, []);
|
|
92
|
-
const unusedNames = $app.unusedInlineScripts.map((x) => x.name);
|
|
75
|
+
const names = getAllScriptNames($app);
|
|
93
76
|
// Find a name that is not used by any other inline script
|
|
94
|
-
while (names.includes(newScriptPath)
|
|
77
|
+
while (names.includes(newScriptPath)) {
|
|
95
78
|
newScriptPath = `Inline Script ${++index}`;
|
|
96
79
|
}
|
|
97
80
|
appInput.runnable = {
|
|
@@ -4,10 +4,12 @@ declare const Breakpoints: {
|
|
|
4
4
|
sm: number;
|
|
5
5
|
lg: number;
|
|
6
6
|
};
|
|
7
|
+
declare const WIDE_GRID_COLUMNS: 12;
|
|
8
|
+
declare const NARROW_GRID_COLUMNS: 3;
|
|
7
9
|
declare const columnConfiguration: ColumnConfiguration;
|
|
8
10
|
declare const gridColumns: number[];
|
|
9
11
|
declare function disableDrag(component: GridItem): GridItem;
|
|
10
12
|
declare function toggleFixed(component: GridItem): GridItem;
|
|
11
13
|
declare function isFixed(component: GridItem): boolean;
|
|
12
14
|
declare function enableDrag(component: GridItem): GridItem;
|
|
13
|
-
export { gridColumns, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
|
|
15
|
+
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
|
|
@@ -2,9 +2,11 @@ const Breakpoints = {
|
|
|
2
2
|
sm: 640,
|
|
3
3
|
lg: 1024
|
|
4
4
|
};
|
|
5
|
+
const WIDE_GRID_COLUMNS = 12;
|
|
6
|
+
const NARROW_GRID_COLUMNS = 3;
|
|
5
7
|
const columnConfiguration = [
|
|
6
|
-
[Breakpoints.lg,
|
|
7
|
-
[Breakpoints.sm,
|
|
8
|
+
[Breakpoints.lg, WIDE_GRID_COLUMNS],
|
|
9
|
+
[Breakpoints.sm, NARROW_GRID_COLUMNS]
|
|
8
10
|
];
|
|
9
11
|
const gridColumns = columnConfiguration.map((value) => value[1]);
|
|
10
12
|
function disableDrag(component) {
|
|
@@ -37,4 +39,4 @@ function enableDrag(component) {
|
|
|
37
39
|
});
|
|
38
40
|
return component;
|
|
39
41
|
}
|
|
40
|
-
export { gridColumns, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
|
|
42
|
+
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { staticValues } from './editor/componentsPanel/componentStaticValues';
|
|
2
2
|
import type { InlineScript } from './types';
|
|
3
|
-
export type InputType = 'text' | 'textarea' | 'template' | 'number' | 'boolean' | 'select' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any';
|
|
3
|
+
export type InputType = 'text' | 'textarea' | 'template' | 'number' | 'boolean' | 'select' | 'icon-select' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any';
|
|
4
4
|
export type InputConnection = {
|
|
5
5
|
componentId: string;
|
|
6
6
|
path: string;
|
|
@@ -13,6 +13,10 @@ export type UserInput<U> = {
|
|
|
13
13
|
type: 'user';
|
|
14
14
|
value: U | undefined;
|
|
15
15
|
};
|
|
16
|
+
export type UploadInput = {
|
|
17
|
+
type: 'upload';
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
16
20
|
export type EvalInput = {
|
|
17
21
|
type: 'eval';
|
|
18
22
|
expr: string;
|
|
@@ -29,7 +33,7 @@ export type TemplateInput = {
|
|
|
29
33
|
eval: string;
|
|
30
34
|
type: 'template';
|
|
31
35
|
};
|
|
32
|
-
type RunnableByPath = {
|
|
36
|
+
export type RunnableByPath = {
|
|
33
37
|
path: string;
|
|
34
38
|
schema: any;
|
|
35
39
|
runType: 'script' | 'flow' | 'hubscript';
|
|
@@ -43,24 +47,44 @@ type RunnableByName = {
|
|
|
43
47
|
export type Runnable = RunnableByPath | RunnableByName | undefined;
|
|
44
48
|
export type ResultInput = {
|
|
45
49
|
runnable: Runnable;
|
|
46
|
-
fields: Record<string,
|
|
50
|
+
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
47
51
|
type: 'runnable';
|
|
48
52
|
value?: any;
|
|
49
53
|
};
|
|
50
|
-
type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | RowInput | EvalInput | ResultInput | TemplateInput) & InputConfiguration<T, U, V>;
|
|
54
|
+
type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | RowInput | EvalInput | UploadInput | ResultInput | TemplateInput) & InputConfiguration<T, U, V>;
|
|
51
55
|
type InputConfiguration<T extends InputType, U, V extends InputType> = {
|
|
52
56
|
fieldType: T;
|
|
53
57
|
subFieldType?: V;
|
|
54
58
|
format?: string | undefined;
|
|
59
|
+
fileUpload?: {
|
|
60
|
+
/** Use `*` to accept anything. */
|
|
61
|
+
accept: string;
|
|
62
|
+
/**
|
|
63
|
+
* Controls if user is allowed to select multiple files.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
multiple?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Controls if the uploaded file(s) will be returned as `Base64` strings.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
base64?: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
type StaticOptions = {
|
|
75
|
+
/**
|
|
76
|
+
* One of the keys of `staticValues` from `lib/components/apps/editor/componentsPanel/componentStaticValues`
|
|
77
|
+
*/
|
|
78
|
+
optionValuesKey: keyof typeof staticValues;
|
|
55
79
|
};
|
|
56
80
|
export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'template', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | AppInputSpec<'object', string> | (AppInputSpec<'select', string> & {
|
|
57
81
|
/**
|
|
58
82
|
* One of the keys of `staticValues` from `lib/components/apps/editor/componentsPanel/componentStaticValues`
|
|
59
83
|
*/
|
|
60
84
|
optionValuesKey: keyof typeof staticValues;
|
|
61
|
-
}) | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & {
|
|
85
|
+
}) | (AppInputSpec<'select', string> & StaticOptions) | AppInputSpec<'icon-select', string> | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & {
|
|
62
86
|
optionValuesKey: keyof typeof staticValues;
|
|
63
|
-
});
|
|
87
|
+
}) | (AppInputSpec<'array', string[], 'select'> & StaticOptions);
|
|
64
88
|
export type RowAppInput = Extract<AppInput, {
|
|
65
89
|
type: 'row';
|
|
66
90
|
}>;
|
|
@@ -79,5 +103,8 @@ export type ResultAppInput = Extract<AppInput, {
|
|
|
79
103
|
export type EvalAppInput = Extract<AppInput, {
|
|
80
104
|
type: 'eval';
|
|
81
105
|
}>;
|
|
106
|
+
export type UploadAppInput = Extract<AppInput, {
|
|
107
|
+
type: 'upload';
|
|
108
|
+
}>;
|
|
82
109
|
export type AppInputs = Record<string, AppInput>;
|
|
83
110
|
export {};
|
|
@@ -1,65 +1,43 @@
|
|
|
1
1
|
import type { Schema } from '../../common';
|
|
2
2
|
import type { Preview } from '../../gen';
|
|
3
|
-
import type { FilledItem } from 'svelte-grid';
|
|
3
|
+
import type { FilledItem } from '@windmill-labs/svelte-grid';
|
|
4
4
|
import type { Writable } from 'svelte/store';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AppComponent } from './editor/component/components';
|
|
6
|
+
import type { AppInput, ConnectedAppInput, ConnectedInput, EvalAppInput, RowAppInput, StaticAppInput, UploadAppInput, UserAppInput } from './inputType';
|
|
6
7
|
import type { World } from './rx';
|
|
7
|
-
type BaseComponent<T extends string> = {
|
|
8
|
-
type: T;
|
|
9
|
-
};
|
|
10
|
-
export type TextComponent = BaseComponent<'textcomponent'>;
|
|
11
|
-
export type TextInputComponent = BaseComponent<'textinputcomponent'>;
|
|
12
|
-
export type PasswordInputComponent = BaseComponent<'passwordinputcomponent'>;
|
|
13
|
-
export type DateInputComponent = BaseComponent<'dateinputcomponent'>;
|
|
14
|
-
export type NumberInputComponent = BaseComponent<'numberinputcomponent'>;
|
|
15
|
-
export type SliderComponent = BaseComponent<'slidercomponent'>;
|
|
16
|
-
export type HtmlComponent = BaseComponent<'htmlcomponent'>;
|
|
17
|
-
export type TimeseriesComponent = BaseComponent<'timeseriescomponent'>;
|
|
18
|
-
export type ButtonComponent = BaseComponent<'buttoncomponent'> & {
|
|
19
|
-
recomputeIds: string[] | undefined;
|
|
20
|
-
};
|
|
21
|
-
export type FormComponent = BaseComponent<'formcomponent'> & {
|
|
22
|
-
recomputeIds: string[] | undefined;
|
|
23
|
-
};
|
|
24
|
-
export type RunFormComponent = BaseComponent<'runformcomponent'>;
|
|
25
|
-
export type BarChartComponent = BaseComponent<'barchartcomponent'>;
|
|
26
|
-
export type PieChartComponent = BaseComponent<'piechartcomponent'>;
|
|
27
|
-
export type ScatterChartComponent = BaseComponent<'scatterchartcomponent'>;
|
|
28
|
-
export type TableComponent = BaseComponent<'tablecomponent'> & {
|
|
29
|
-
actionButtons: (BaseAppComponent & ButtonComponent)[];
|
|
30
|
-
};
|
|
31
|
-
export type DisplayComponent = BaseComponent<'displaycomponent'>;
|
|
32
|
-
export type ImageComponent = BaseComponent<'imagecomponent'>;
|
|
33
|
-
export type InputComponent = BaseComponent<'inputcomponent'>;
|
|
34
|
-
export type SelectComponent = BaseComponent<'selectcomponent'>;
|
|
35
|
-
export type CheckboxComponent = BaseComponent<'checkboxcomponent'>;
|
|
36
|
-
export type RadioComponent = BaseComponent<'radiocomponent'>;
|
|
37
8
|
export type HorizontalAlignment = 'left' | 'center' | 'right';
|
|
38
9
|
export type VerticalAlignment = 'top' | 'center' | 'bottom';
|
|
39
10
|
export type Aligned = {
|
|
40
11
|
horizontalAlignment: HorizontalAlignment;
|
|
41
12
|
verticalAlignment: VerticalAlignment;
|
|
42
13
|
};
|
|
14
|
+
export interface GeneralAppInput {
|
|
15
|
+
onlyStatic?: boolean;
|
|
16
|
+
evaluatedValue?: boolean;
|
|
17
|
+
tooltip?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ComponentCssProperty = {
|
|
20
|
+
class: string;
|
|
21
|
+
style: string;
|
|
22
|
+
};
|
|
23
|
+
export type ComponentCustomCSS<T extends string = string> = Record<T, ComponentCssProperty>;
|
|
43
24
|
export interface BaseAppComponent extends Partial<Aligned> {
|
|
44
25
|
id: ComponentID;
|
|
45
26
|
componentInput: AppInput | undefined;
|
|
46
|
-
configuration: Record<string, (StaticAppInput | ConnectedAppInput | UserAppInput | RowAppInput | EvalAppInput
|
|
47
|
-
onlyStatic?: boolean;
|
|
48
|
-
evaluatedValue?: boolean;
|
|
49
|
-
tooltip?: string;
|
|
50
|
-
}>;
|
|
27
|
+
configuration: Record<string, GeneralAppInput & (StaticAppInput | ConnectedAppInput | UserAppInput | RowAppInput | EvalAppInput | UploadAppInput)>;
|
|
51
28
|
card: boolean | undefined;
|
|
29
|
+
customCss?: ComponentCustomCSS;
|
|
52
30
|
/**
|
|
53
31
|
* If `true` then the wrapper will allow items to flow outside of it's borders.
|
|
54
32
|
*
|
|
55
33
|
* *For example when the component has a popup like `Select`*
|
|
56
34
|
*/
|
|
57
35
|
softWrap?: boolean;
|
|
36
|
+
numberOfSubgrids?: number;
|
|
58
37
|
}
|
|
59
|
-
export type AppComponent = BaseAppComponent & (RunFormComponent | DisplayComponent | TextInputComponent | PasswordInputComponent | DateInputComponent | NumberInputComponent | SliderComponent | BarChartComponent | TimeseriesComponent | HtmlComponent | TableComponent | TextComponent | TableComponent | ButtonComponent | PieChartComponent | ScatterChartComponent | ImageComponent | InputComponent | SelectComponent | CheckboxComponent | RadioComponent | FormComponent);
|
|
60
38
|
export type ComponentSet = {
|
|
61
39
|
title: string;
|
|
62
|
-
components: AppComponent[]
|
|
40
|
+
components: Readonly<AppComponent['type'][]>;
|
|
63
41
|
};
|
|
64
42
|
type SectionID = string;
|
|
65
43
|
export type AppSection = {
|
|
@@ -83,6 +61,13 @@ export type App = {
|
|
|
83
61
|
name: string;
|
|
84
62
|
inlineScript: InlineScript;
|
|
85
63
|
}>;
|
|
64
|
+
hiddenInlineScripts: Array<{
|
|
65
|
+
name: string;
|
|
66
|
+
inlineScript: InlineScript | undefined;
|
|
67
|
+
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
68
|
+
}>;
|
|
69
|
+
css?: Record<'viewer' | 'grid' | AppComponent['type'], ComponentCustomCSS>;
|
|
70
|
+
subgrids?: Record<string, GridItem[]>;
|
|
86
71
|
};
|
|
87
72
|
export type ConnectingInput = {
|
|
88
73
|
opened: boolean;
|
|
@@ -111,8 +96,19 @@ export type AppEditorContext = {
|
|
|
111
96
|
component: string;
|
|
112
97
|
}[]>;
|
|
113
98
|
noBackend: boolean;
|
|
99
|
+
errorByComponent: Writable<Record<string, {
|
|
100
|
+
error: string;
|
|
101
|
+
componentId: string;
|
|
102
|
+
}>>;
|
|
103
|
+
openDebugRun: Writable<((componentID: string) => void) | undefined>;
|
|
104
|
+
focusedGrid: Writable<FocusedGrid | undefined>;
|
|
105
|
+
};
|
|
106
|
+
export type FocusedGrid = {
|
|
107
|
+
parentComponentId: string;
|
|
108
|
+
subGridIndex: number;
|
|
114
109
|
};
|
|
115
110
|
export type EditorMode = 'dnd' | 'preview';
|
|
116
111
|
export type EditorBreakpoint = 'sm' | 'lg';
|
|
112
|
+
export declare const IS_APP_PUBLIC_CONTEXT_KEY: "isAppPublicContext";
|
|
117
113
|
type ComponentID = string;
|
|
118
114
|
export {};
|
package/components/apps/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const IS_APP_PUBLIC_CONTEXT_KEY = 'isAppPublicContext';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { Schema } from '../../common';
|
|
2
2
|
import type { AppInput, InputType, ResultAppInput, StaticAppInput } from './inputType';
|
|
3
3
|
import type { Output } from './rx';
|
|
4
|
-
import type { App,
|
|
4
|
+
import type { App, GridItem } from './types';
|
|
5
|
+
export declare function allItems(grid: GridItem[], subgrids: Record<string, GridItem[]> | undefined): GridItem[];
|
|
6
|
+
export declare function allItemsWithParent(grid: GridItem[], subgrids: Record<string, GridItem[]> | undefined): [GridItem, string | undefined][];
|
|
5
7
|
export declare function loadSchema(workspace: string, path: string, runType: 'script' | 'flow' | 'hubscript'): Promise<Schema>;
|
|
6
8
|
export declare function schemaToInputsSpec(schema: Schema, defaultUserInput: boolean): Record<string, StaticAppInput>;
|
|
7
|
-
export declare const displayData: Record<AppComponent['type'], {
|
|
8
|
-
name: string;
|
|
9
|
-
icon: any;
|
|
10
|
-
}>;
|
|
11
9
|
export declare function accessPropertyByPath<T>(object: T, path: string): T | undefined;
|
|
12
10
|
export declare function fieldTypeToTsType(inputType: InputType): string;
|
|
13
11
|
export declare function isScriptByNameDefined(appInput: AppInput | undefined): boolean;
|
|
@@ -18,3 +16,6 @@ export declare function toStatic(app: App, staticExporter: Record<string, () =>
|
|
|
18
16
|
summary: string;
|
|
19
17
|
};
|
|
20
18
|
export declare function buildExtraLib(components: Record<string, Record<string, Output<any>>>, idToExclude: string, hasRows: boolean): string;
|
|
19
|
+
export declare function getAllScriptNames(app: App): string[];
|
|
20
|
+
export declare function toPascalCase(text: string): string;
|
|
21
|
+
export declare function toKebabCase(text: string): string;
|
package/components/apps/utils.js
CHANGED
|
@@ -1,7 +1,60 @@
|
|
|
1
1
|
import { FlowService, ScriptService } from '../../gen';
|
|
2
2
|
import { inferArgs } from '../../infer';
|
|
3
3
|
import { emptySchema } from '../../utils';
|
|
4
|
-
|
|
4
|
+
/*
|
|
5
|
+
export function deleteComponent(
|
|
6
|
+
subgrid: string | undefined,
|
|
7
|
+
component: AppComponent,
|
|
8
|
+
app: App,
|
|
9
|
+
staticOutputs: Record<string, any>,
|
|
10
|
+
runnableComponents: Record<string, any>
|
|
11
|
+
) {
|
|
12
|
+
if (parentItems) {
|
|
13
|
+
let index = parentItems.findIndex((item) => item.data?.id === component.id)
|
|
14
|
+
if (index != -1) {
|
|
15
|
+
parentItems.splice(index, 1)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
delete staticOutputs[component.id]
|
|
20
|
+
delete runnableComponents[component.id]
|
|
21
|
+
|
|
22
|
+
if (
|
|
23
|
+
component.componentInput?.type === 'runnable' &&
|
|
24
|
+
component.componentInput?.runnable?.type === 'runnableByName'
|
|
25
|
+
) {
|
|
26
|
+
const { name, inlineScript } = component.componentInput.runnable
|
|
27
|
+
|
|
28
|
+
if (inlineScript) {
|
|
29
|
+
if (!app.unusedInlineScripts) {
|
|
30
|
+
app.unusedInlineScripts = []
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
app.unusedInlineScripts.push({
|
|
34
|
+
name,
|
|
35
|
+
inlineScript
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
*/
|
|
42
|
+
export function allItems(grid, subgrids) {
|
|
43
|
+
if (subgrids == undefined) {
|
|
44
|
+
return grid;
|
|
45
|
+
}
|
|
46
|
+
return [...grid, ...Object.values(subgrids).flat()];
|
|
47
|
+
}
|
|
48
|
+
export function allItemsWithParent(grid, subgrids) {
|
|
49
|
+
const items = grid.map((item) => [item, undefined]);
|
|
50
|
+
if (subgrids == undefined) {
|
|
51
|
+
return items;
|
|
52
|
+
}
|
|
53
|
+
return [
|
|
54
|
+
...items,
|
|
55
|
+
...Object.entries(subgrids).flatMap(([k, v]) => v.map((g) => [g, k]))
|
|
56
|
+
];
|
|
57
|
+
}
|
|
5
58
|
export async function loadSchema(workspace, path, runType) {
|
|
6
59
|
if (runType === 'script') {
|
|
7
60
|
const script = await ScriptService.getScriptByPath({
|
|
@@ -21,7 +74,9 @@ export async function loadSchema(workspace, path, runType) {
|
|
|
21
74
|
const script = await ScriptService.getHubScriptByPath({
|
|
22
75
|
path
|
|
23
76
|
});
|
|
24
|
-
if (script.schema == undefined ||
|
|
77
|
+
if (script.schema == undefined ||
|
|
78
|
+
Object.keys(script.schema).length == 0 ||
|
|
79
|
+
typeof script.schema != 'object') {
|
|
25
80
|
script.schema = emptySchema();
|
|
26
81
|
}
|
|
27
82
|
await inferArgs(script.language, script.content, script.schema);
|
|
@@ -43,92 +98,6 @@ export function schemaToInputsSpec(schema, defaultUserInput) {
|
|
|
43
98
|
return accu;
|
|
44
99
|
}, {});
|
|
45
100
|
}
|
|
46
|
-
export const displayData = {
|
|
47
|
-
displaycomponent: {
|
|
48
|
-
name: 'Result',
|
|
49
|
-
icon: Monitor
|
|
50
|
-
},
|
|
51
|
-
textcomponent: {
|
|
52
|
-
name: 'Text',
|
|
53
|
-
icon: Type
|
|
54
|
-
},
|
|
55
|
-
buttoncomponent: {
|
|
56
|
-
name: 'Button',
|
|
57
|
-
icon: Inspect
|
|
58
|
-
},
|
|
59
|
-
formcomponent: {
|
|
60
|
-
name: 'Form',
|
|
61
|
-
icon: FormInput
|
|
62
|
-
},
|
|
63
|
-
piechartcomponent: {
|
|
64
|
-
name: 'Pie Chart',
|
|
65
|
-
icon: PieChart
|
|
66
|
-
},
|
|
67
|
-
barchartcomponent: {
|
|
68
|
-
name: 'Bar/Line Chart',
|
|
69
|
-
icon: BarChart4
|
|
70
|
-
},
|
|
71
|
-
htmlcomponent: {
|
|
72
|
-
name: 'Html',
|
|
73
|
-
icon: Code2
|
|
74
|
-
},
|
|
75
|
-
timeseriescomponent: {
|
|
76
|
-
name: 'Timeseries',
|
|
77
|
-
icon: GripHorizontal
|
|
78
|
-
},
|
|
79
|
-
scatterchartcomponent: {
|
|
80
|
-
name: 'Scatter Chart',
|
|
81
|
-
icon: GripHorizontal
|
|
82
|
-
},
|
|
83
|
-
tablecomponent: {
|
|
84
|
-
name: 'Table',
|
|
85
|
-
icon: Table2
|
|
86
|
-
},
|
|
87
|
-
checkboxcomponent: {
|
|
88
|
-
name: 'Toggle',
|
|
89
|
-
icon: ToggleLeft
|
|
90
|
-
},
|
|
91
|
-
textinputcomponent: {
|
|
92
|
-
name: 'Text input',
|
|
93
|
-
icon: TextCursorInput
|
|
94
|
-
},
|
|
95
|
-
imagecomponent: {
|
|
96
|
-
name: 'Image',
|
|
97
|
-
icon: Image
|
|
98
|
-
},
|
|
99
|
-
inputcomponent: {
|
|
100
|
-
name: 'Input',
|
|
101
|
-
icon: FormInput
|
|
102
|
-
},
|
|
103
|
-
radiocomponent: {
|
|
104
|
-
name: 'Radio button',
|
|
105
|
-
icon: CircleDot
|
|
106
|
-
},
|
|
107
|
-
runformcomponent: {
|
|
108
|
-
name: 'Run form',
|
|
109
|
-
icon: Play
|
|
110
|
-
},
|
|
111
|
-
selectcomponent: {
|
|
112
|
-
name: 'Select',
|
|
113
|
-
icon: List
|
|
114
|
-
},
|
|
115
|
-
numberinputcomponent: {
|
|
116
|
-
name: 'Number',
|
|
117
|
-
icon: Binary
|
|
118
|
-
},
|
|
119
|
-
slidercomponent: {
|
|
120
|
-
name: 'Slider',
|
|
121
|
-
icon: SlidersHorizontal
|
|
122
|
-
},
|
|
123
|
-
passwordinputcomponent: {
|
|
124
|
-
name: 'Password',
|
|
125
|
-
icon: Lock
|
|
126
|
-
},
|
|
127
|
-
dateinputcomponent: {
|
|
128
|
-
name: 'Date input',
|
|
129
|
-
icon: Calendar
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
101
|
export function accessPropertyByPath(object, path) {
|
|
133
102
|
// convert indexes to properties
|
|
134
103
|
path = path.replace(/\[(\w+)\]/g, '.$1');
|
|
@@ -199,7 +168,7 @@ export function toStatic(app, staticExporter, summary) {
|
|
|
199
168
|
return { app: newApp, summary };
|
|
200
169
|
}
|
|
201
170
|
export function buildExtraLib(components, idToExclude, hasRows) {
|
|
202
|
-
return Object.entries(components)
|
|
171
|
+
return (Object.entries(components)
|
|
203
172
|
.filter(([k, v]) => k != idToExclude)
|
|
204
173
|
.map(([k, v]) => [k, Object.fromEntries(Object.entries(v).map(([k, v]) => [k, v.peak()]))])
|
|
205
174
|
.map(([k, v]) => `
|
|
@@ -207,5 +176,36 @@ export function buildExtraLib(components, idToExclude, hasRows) {
|
|
|
207
176
|
declare const ${k} = ${JSON.stringify(v)};
|
|
208
177
|
|
|
209
178
|
`)
|
|
210
|
-
.join('\n') + (hasRows ? 'declare const row: Record<string, any>;' : '');
|
|
179
|
+
.join('\n') + (hasRows ? 'declare const row: Record<string, any>;' : ''));
|
|
180
|
+
}
|
|
181
|
+
export function getAllScriptNames(app) {
|
|
182
|
+
const names = app.grid.reduce((acc, gridItem) => {
|
|
183
|
+
const { componentInput } = gridItem.data;
|
|
184
|
+
if (componentInput?.type === 'runnable' &&
|
|
185
|
+
componentInput?.runnable?.type === 'runnableByName') {
|
|
186
|
+
acc.push(componentInput.runnable.name);
|
|
187
|
+
}
|
|
188
|
+
if (componentInput?.type === 'tablecomponent') {
|
|
189
|
+
componentInput.actionButtons.forEach((actionButton) => {
|
|
190
|
+
if (actionButton.componentInput?.type === 'runnable') {
|
|
191
|
+
if (actionButton.componentInput.runnable?.type === 'runnableByName') {
|
|
192
|
+
acc.push(actionButton.componentInput.runnable.name);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return acc;
|
|
198
|
+
}, []);
|
|
199
|
+
const unusedNames = app.unusedInlineScripts.map((x) => x.name);
|
|
200
|
+
const backgroundNames = app.hiddenInlineScripts?.map((x) => x.name) ?? [];
|
|
201
|
+
return [...names, ...unusedNames, ...backgroundNames];
|
|
202
|
+
}
|
|
203
|
+
function clearAndUpper(text) {
|
|
204
|
+
return text.replace(/-/, '').toUpperCase();
|
|
205
|
+
}
|
|
206
|
+
export function toPascalCase(text) {
|
|
207
|
+
return text.replace(/(^\w|-\w)/g, clearAndUpper);
|
|
208
|
+
}
|
|
209
|
+
export function toKebabCase(text) {
|
|
210
|
+
return text.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
211
211
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
-
import { classNames } from '../../../utils';
|
|
3
2
|
import Icon from 'svelte-awesome';
|
|
4
3
|
import { ButtonType } from './model';
|
|
5
4
|
import { goto } from '$app/navigation';
|
|
6
5
|
import { Loader2 } from 'lucide-svelte';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
export let size = 'md';
|
|
8
8
|
export let spacingSize = size;
|
|
9
9
|
export let color = 'blue';
|
|
@@ -21,9 +21,14 @@ export let nonCaptureEvent = false;
|
|
|
21
21
|
export let buttonType = 'button';
|
|
22
22
|
export let loading = false;
|
|
23
23
|
export let title = undefined;
|
|
24
|
+
export let style = '';
|
|
24
25
|
const dispatch = createEventDispatcher();
|
|
25
26
|
// Order of classes: border, border modifier, bg, bg modifier, text, text modifier, everything else
|
|
26
27
|
const colorVariants = {
|
|
28
|
+
none: {
|
|
29
|
+
border: '',
|
|
30
|
+
contained: ''
|
|
31
|
+
},
|
|
27
32
|
blue: {
|
|
28
33
|
border: 'border-frost-500 hover:border-frost-700 focus:border-frost-700 bg-white hover:bg-frost-100 focus:bg-frost-100 text-frost-500 hover:text-frost-700 focus:text-frost-700 focus:ring-frost-300',
|
|
29
34
|
contained: 'bg-frost-500 hover:bg-frost-700 focus:bg-frost-700 text-white focus:ring-frost-300'
|
|
@@ -51,12 +56,13 @@ const colorVariants = {
|
|
|
51
56
|
};
|
|
52
57
|
$: buttonProps = {
|
|
53
58
|
id,
|
|
54
|
-
class:
|
|
59
|
+
class: twMerge(colorVariants?.[color]?.[variant], variant === 'border' ? 'border' : '', ButtonType.FontSizeClasses[size], ButtonType.SpacingClasses[spacingSize][variant], 'focus:ring-2 font-semibold', 'rounded-md', 'justify-center items-center text-center whitespace-nowrap inline-flex', btnClasses, disabled ? '!bg-gray-300 !text-gray-600 !cursor-not-allowed' : ''),
|
|
55
60
|
href,
|
|
56
61
|
target,
|
|
57
62
|
tabindex: disabled ? -1 : 0,
|
|
58
63
|
type: buttonType,
|
|
59
|
-
title
|
|
64
|
+
title,
|
|
65
|
+
...$$restProps
|
|
60
66
|
};
|
|
61
67
|
async function onClick(event) {
|
|
62
68
|
if (!nonCaptureEvent) {
|
|
@@ -76,8 +82,8 @@ async function onClick(event) {
|
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
$: isSmall = size === 'xs' || size === 'sm';
|
|
79
|
-
$: startIconClass =
|
|
80
|
-
$: endIconClass =
|
|
85
|
+
$: startIconClass = twMerge(iconOnly ? undefined : isSmall ? 'mr-1' : 'mr-2', startIcon?.classes);
|
|
86
|
+
$: endIconClass = twMerge(iconOnly ? undefined : isSmall ? 'ml-1' : 'ml-2', endIcon?.classes);
|
|
81
87
|
</script>
|
|
82
88
|
|
|
83
89
|
<svelte:element
|
|
@@ -90,6 +96,7 @@ $: endIconClass = classNames(iconOnly ? undefined : isSmall ? 'ml-1' : 'ml-2', e
|
|
|
90
96
|
{...buttonProps}
|
|
91
97
|
disabled={disabled || loading}
|
|
92
98
|
type="submit"
|
|
99
|
+
{style}
|
|
93
100
|
>
|
|
94
101
|
{#if loading}
|
|
95
102
|
<Loader2 class="animate-spin mr-1" size={14} />
|
|
@@ -3,9 +3,10 @@ import Icon from 'svelte-awesome';
|
|
|
3
3
|
import { ButtonType } from './model';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
|
+
[x: string]: any;
|
|
6
7
|
size?: ButtonType.Size | undefined;
|
|
7
8
|
spacingSize?: ButtonType.Size | undefined;
|
|
8
|
-
color?: "blue" | "gray" | "red" | "green" | "dark" | "light" | undefined;
|
|
9
|
+
color?: "none" | "blue" | "gray" | "red" | "green" | "dark" | "light" | undefined;
|
|
9
10
|
variant?: ButtonType.Variant | undefined;
|
|
10
11
|
btnClasses?: string | undefined;
|
|
11
12
|
disabled?: boolean | undefined;
|
|
@@ -20,6 +21,7 @@ declare const __propDef: {
|
|
|
20
21
|
buttonType?: "reset" | "submit" | "button" | undefined;
|
|
21
22
|
loading?: boolean | undefined;
|
|
22
23
|
title?: string | undefined;
|
|
24
|
+
style?: string | undefined;
|
|
23
25
|
};
|
|
24
26
|
events: {
|
|
25
27
|
pointerdown: PointerEvent;
|
|
@@ -4,7 +4,7 @@ import { ButtonType } from '..';
|
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
size?: ButtonType.Size | undefined;
|
|
7
|
-
color?: "blue" | "gray" | "red" | "green" | "dark" | "light" | undefined;
|
|
7
|
+
color?: "none" | "blue" | "gray" | "red" | "green" | "dark" | "light" | undefined;
|
|
8
8
|
variant?: ButtonType.Variant | undefined;
|
|
9
9
|
mainClasses?: string | undefined;
|
|
10
10
|
toggleClasses?: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const BUTTON_COLORS: readonly ["blue", "red", "dark", "light", "green", "gray"];
|
|
1
|
+
export declare const BUTTON_COLORS: readonly ["blue", "red", "dark", "light", "green", "gray", "none"];
|
|
2
2
|
export declare namespace ButtonType {
|
|
3
3
|
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
type Color = typeof BUTTON_COLORS[number];
|
|
@@ -10,7 +10,7 @@ export declare namespace ButtonType {
|
|
|
10
10
|
classes?: string;
|
|
11
11
|
}
|
|
12
12
|
const FontSizeClasses: Record<ButtonType.Size, string>;
|
|
13
|
-
const SpacingClasses: Record<ButtonType.Size, string
|
|
13
|
+
const SpacingClasses: Record<ButtonType.Size, Record<ButtonType.Variant, string>>;
|
|
14
14
|
const IconScale: Record<ButtonType.Size, number>;
|
|
15
15
|
const ItemContextKey: "popupItemProps";
|
|
16
16
|
interface ItemProps {
|