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,137 @@
|
|
|
1
|
+
<script>import { Button } from '../../../common';
|
|
2
|
+
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { getContext } from 'svelte';
|
|
4
|
+
import { Icon } from 'svelte-awesome';
|
|
5
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
6
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
7
|
+
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
8
|
+
import Portal from 'svelte-portal';
|
|
9
|
+
import Modal from '../../../common/modal/Modal.svelte';
|
|
10
|
+
export let id;
|
|
11
|
+
export let componentInput;
|
|
12
|
+
export let configuration;
|
|
13
|
+
export let recomputeIds = undefined;
|
|
14
|
+
export let extraQueryParams = {};
|
|
15
|
+
export let horizontalAlignment = undefined;
|
|
16
|
+
export let verticalAlignment = undefined;
|
|
17
|
+
export const staticOutputs = ['loading', 'result'];
|
|
18
|
+
const { runnableComponents, worldStore } = getContext('AppEditorContext');
|
|
19
|
+
let labelValue = 'Default label';
|
|
20
|
+
let color;
|
|
21
|
+
let size;
|
|
22
|
+
let runnableComponent;
|
|
23
|
+
let disabled = undefined;
|
|
24
|
+
let isLoading = false;
|
|
25
|
+
let ownClick = false;
|
|
26
|
+
let errors = {};
|
|
27
|
+
$: errorsMessage = Object.values(errors)
|
|
28
|
+
.filter((x) => x != '')
|
|
29
|
+
.join('\n');
|
|
30
|
+
$: noInputs =
|
|
31
|
+
componentInput?.type != 'runnable' || Object.keys(componentInput?.fields ?? {}).length == 0;
|
|
32
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
33
|
+
$: if (outputs?.loading != undefined) {
|
|
34
|
+
outputs.loading.set(false, true);
|
|
35
|
+
}
|
|
36
|
+
$: outputs?.loading.subscribe({
|
|
37
|
+
next: (value) => {
|
|
38
|
+
isLoading = value;
|
|
39
|
+
if (ownClick && !value) {
|
|
40
|
+
ownClick = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
$: loading = isLoading && ownClick;
|
|
45
|
+
let open = false;
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<InputValue {id} input={configuration.label} bind:value={labelValue} />
|
|
49
|
+
<InputValue {id} input={configuration.color} bind:value={color} />
|
|
50
|
+
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
51
|
+
<InputValue
|
|
52
|
+
{id}
|
|
53
|
+
input={configuration.disabled}
|
|
54
|
+
bind:value={disabled}
|
|
55
|
+
bind:error={errors.disabled}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<Portal>
|
|
59
|
+
<Modal
|
|
60
|
+
{open}
|
|
61
|
+
title={labelValue}
|
|
62
|
+
on:canceled={() => {
|
|
63
|
+
open = false
|
|
64
|
+
}}
|
|
65
|
+
on:confirmed={() => {
|
|
66
|
+
open = false
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<RunnableWrapper
|
|
70
|
+
defaultUserInput
|
|
71
|
+
bind:runnableComponent
|
|
72
|
+
bind:componentInput
|
|
73
|
+
{id}
|
|
74
|
+
{extraQueryParams}
|
|
75
|
+
autoRefresh={false}
|
|
76
|
+
forceSchemaDisplay={true}
|
|
77
|
+
runnableClass="!block"
|
|
78
|
+
>
|
|
79
|
+
<div class="flex flex-col gap-2 px-4 w-full">
|
|
80
|
+
<div>
|
|
81
|
+
{#if noInputs}
|
|
82
|
+
<div class="text-gray-600 italic text-sm my-4">
|
|
83
|
+
Run forms are associated with a runnable that has user inputs.
|
|
84
|
+
<br />
|
|
85
|
+
Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
|
|
86
|
+
<strong>
|
|
87
|
+
User Input
|
|
88
|
+
<Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
|
|
89
|
+
</strong>
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
<div class="flex justify-end">
|
|
94
|
+
<Button
|
|
95
|
+
{loading}
|
|
96
|
+
btnClasses="my-1"
|
|
97
|
+
on:pointerdown={(e) => {
|
|
98
|
+
e?.stopPropagation()
|
|
99
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
100
|
+
}}
|
|
101
|
+
on:click={async () => {
|
|
102
|
+
await runnableComponent?.runComponent()
|
|
103
|
+
|
|
104
|
+
if (recomputeIds) {
|
|
105
|
+
recomputeIds.forEach((id) => {
|
|
106
|
+
$runnableComponents[id]?.()
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
open = false
|
|
111
|
+
}}
|
|
112
|
+
size="xs"
|
|
113
|
+
color="dark"
|
|
114
|
+
>
|
|
115
|
+
Submit
|
|
116
|
+
</Button>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</RunnableWrapper>
|
|
120
|
+
</Modal>
|
|
121
|
+
</Portal>
|
|
122
|
+
|
|
123
|
+
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
124
|
+
{#if errorsMessage}
|
|
125
|
+
<div class="text-red-500 text-xs">{errorsMessage}</div>
|
|
126
|
+
{/if}
|
|
127
|
+
<Button
|
|
128
|
+
{disabled}
|
|
129
|
+
{size}
|
|
130
|
+
{color}
|
|
131
|
+
on:click={(e) => {
|
|
132
|
+
open = true
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
{labelValue}
|
|
136
|
+
</Button>
|
|
137
|
+
</AlignWrapper>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AppInput } from '../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
componentInput: AppInput | undefined;
|
|
7
|
+
configuration: Record<string, AppInput>;
|
|
8
|
+
recomputeIds?: string[] | undefined;
|
|
9
|
+
extraQueryParams?: Record<string, any> | undefined;
|
|
10
|
+
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
11
|
+
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
12
|
+
staticOutputs?: string[] | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export type AppFormButtonProps = typeof __propDef.props;
|
|
20
|
+
export type AppFormButtonEvents = typeof __propDef.events;
|
|
21
|
+
export type AppFormButtonSlots = typeof __propDef.slots;
|
|
22
|
+
export default class AppFormButton extends SvelteComponentTyped<AppFormButtonProps, AppFormButtonEvents, AppFormButtonSlots> {
|
|
23
|
+
get staticOutputs(): string[];
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import InputValue from '../helpers/InputValue.svelte';
|
|
|
5
5
|
export let id;
|
|
6
6
|
export let componentInput;
|
|
7
7
|
export let configuration;
|
|
8
|
+
export let initializing = undefined;
|
|
8
9
|
export const staticOutputs = ['loading', 'result'];
|
|
9
10
|
ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement);
|
|
10
11
|
let result = undefined;
|
|
@@ -17,7 +18,17 @@ $: backgroundColor = {
|
|
|
17
18
|
// red theme
|
|
18
19
|
theme3: ['#e74a3b', '#4e73df', '#1cc88a', '#36b9cc', '#f6c23e']
|
|
19
20
|
}[theme];
|
|
20
|
-
const
|
|
21
|
+
const lineOptions = {
|
|
22
|
+
responsive: true,
|
|
23
|
+
animation: false,
|
|
24
|
+
maintainAspectRatio: false,
|
|
25
|
+
plugins: {
|
|
26
|
+
legend: {
|
|
27
|
+
display: false
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const barOptions = {
|
|
21
32
|
responsive: true,
|
|
22
33
|
animation: false,
|
|
23
34
|
maintainAspectRatio: false,
|
|
@@ -41,12 +52,12 @@ $: data = {
|
|
|
41
52
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
42
53
|
<InputValue {id} input={configuration.line} bind:value={lineChart} />
|
|
43
54
|
|
|
44
|
-
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
55
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
|
|
45
56
|
{#if result}
|
|
46
57
|
{#if lineChart}
|
|
47
|
-
<Line {data} {
|
|
58
|
+
<Line {data} options={lineOptions} />
|
|
48
59
|
{:else}
|
|
49
|
-
<Bar {data} {
|
|
60
|
+
<Bar {data} options={barOptions} />
|
|
50
61
|
{/if}
|
|
51
62
|
{/if}
|
|
52
63
|
</RunnableWrapper>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script>import DisplayResult from '../../../DisplayResult.svelte';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { IS_APP_PUBLIC_CONTEXT_KEY } from '../../types';
|
|
5
|
+
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
6
|
+
export let id;
|
|
7
|
+
export let componentInput;
|
|
8
|
+
export let initializing = undefined;
|
|
9
|
+
export let customCss = undefined;
|
|
10
|
+
const requireHtmlApproval = getContext(IS_APP_PUBLIC_CONTEXT_KEY);
|
|
11
|
+
const { app } = getContext('AppEditorContext');
|
|
12
|
+
let result = undefined;
|
|
13
|
+
export const staticOutputs = ['result', 'loading'];
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:initializing bind:result>
|
|
17
|
+
<div class={twMerge(
|
|
18
|
+
'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
|
|
19
|
+
$app.css?.['displaycomponent']?.['header']?.class,
|
|
20
|
+
customCss?.header?.class
|
|
21
|
+
)}>
|
|
22
|
+
Results
|
|
23
|
+
</div>
|
|
24
|
+
<div class={twMerge(
|
|
25
|
+
'p-2',
|
|
26
|
+
$app.css?.['displaycomponent']?.['container']?.class,
|
|
27
|
+
customCss?.container?.class
|
|
28
|
+
)}>
|
|
29
|
+
<DisplayResult {result} {requireHtmlApproval} />
|
|
30
|
+
</div>
|
|
31
|
+
</RunnableWrapper>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AppInput } from '../../inputType';
|
|
3
|
+
import { type ComponentCustomCSS } from '../../types';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
id: string;
|
|
7
|
+
componentInput: AppInput | undefined;
|
|
8
|
+
initializing?: boolean | undefined;
|
|
9
|
+
customCss?: ComponentCustomCSS<'header' | 'container'> | undefined;
|
|
10
|
+
staticOutputs?: string[] | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export type AppDisplayComponentProps = typeof __propDef.props;
|
|
18
|
+
export type AppDisplayComponentEvents = typeof __propDef.events;
|
|
19
|
+
export type AppDisplayComponentSlots = typeof __propDef.slots;
|
|
20
|
+
export default class AppDisplayComponent extends SvelteComponentTyped<AppDisplayComponentProps, AppDisplayComponentEvents, AppDisplayComponentSlots> {
|
|
21
|
+
get staticOutputs(): string[];
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
2
|
+
export let id;
|
|
3
|
+
export let componentInput;
|
|
4
|
+
export let initializing = undefined;
|
|
5
|
+
export const staticOutputs = ['result', 'loading'];
|
|
6
|
+
let result = undefined;
|
|
7
|
+
let h = undefined;
|
|
8
|
+
let w = undefined;
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div
|
|
12
|
+
on:pointerdown={(e) => {
|
|
13
|
+
e?.preventDefault()
|
|
14
|
+
}}
|
|
15
|
+
class="h-full w-full"
|
|
16
|
+
bind:clientHeight={h}
|
|
17
|
+
bind:clientWidth={w}
|
|
18
|
+
>
|
|
19
|
+
<RunnableWrapper autoRefresh flexWrap bind:componentInput {id} bind:initializing bind:result>
|
|
20
|
+
{#key result}
|
|
21
|
+
<iframe
|
|
22
|
+
frameborder="0"
|
|
23
|
+
style="height: {h}px; width: {w}px"
|
|
24
|
+
class="p-0"
|
|
25
|
+
title="sandbox"
|
|
26
|
+
srcdoc={result
|
|
27
|
+
? '<scr' + `ipt type="application/javascript" src="/tailwind.js"></script>` + result
|
|
28
|
+
: 'No html'}
|
|
29
|
+
/>
|
|
30
|
+
{/key}
|
|
31
|
+
</RunnableWrapper>
|
|
32
|
+
</div>
|
|
@@ -4,9 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
id: string;
|
|
6
6
|
componentInput: AppInput | undefined;
|
|
7
|
-
|
|
8
|
-
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
9
|
-
configuration: Record<string, AppInput>;
|
|
7
|
+
initializing?: boolean | undefined;
|
|
10
8
|
staticOutputs?: string[] | undefined;
|
|
11
9
|
};
|
|
12
10
|
events: {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>import { AlignWrapper, InputValue, RunnableWrapper } from '../helpers';
|
|
2
|
+
import { loadIcon } from '../icon';
|
|
3
|
+
export let id;
|
|
4
|
+
export let horizontalAlignment = 'left';
|
|
5
|
+
export let verticalAlignment = undefined;
|
|
6
|
+
export let configuration;
|
|
7
|
+
export const staticOutputs = [];
|
|
8
|
+
let icon = undefined;
|
|
9
|
+
let size;
|
|
10
|
+
let color;
|
|
11
|
+
let strokeWidth;
|
|
12
|
+
let iconComponent;
|
|
13
|
+
$: icon && handleIcon();
|
|
14
|
+
async function handleIcon() {
|
|
15
|
+
if (icon) {
|
|
16
|
+
iconComponent = await loadIcon(icon);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<InputValue {id} input={configuration.icon} bind:value={icon} />
|
|
22
|
+
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
23
|
+
<InputValue {id} input={configuration.color} bind:value={color} />
|
|
24
|
+
<InputValue {id} input={configuration.strokeWidth} bind:value={strokeWidth} />
|
|
25
|
+
|
|
26
|
+
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
27
|
+
{#if iconComponent}
|
|
28
|
+
<svelte:component
|
|
29
|
+
this={iconComponent}
|
|
30
|
+
size={size || 24}
|
|
31
|
+
color={color || 'currentColor'}
|
|
32
|
+
strokeWidth={strokeWidth || 2}
|
|
33
|
+
/>
|
|
34
|
+
{/if}
|
|
35
|
+
</AlignWrapper>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AppInput } from '../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
7
|
+
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
8
|
+
configuration: Record<string, AppInput>;
|
|
9
|
+
staticOutputs?: string[] | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type AppIconProps = typeof __propDef.props;
|
|
17
|
+
export type AppIconEvents = typeof __propDef.events;
|
|
18
|
+
export type AppIconSlots = typeof __propDef.slots;
|
|
19
|
+
export default class AppIcon extends SvelteComponentTyped<AppIconProps, AppIconEvents, AppIconSlots> {
|
|
20
|
+
get staticOutputs(): string[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script>import InputValue from '../helpers/InputValue.svelte';
|
|
2
|
+
export let id;
|
|
3
|
+
export let configuration;
|
|
4
|
+
export const staticOutputs = ['loading'];
|
|
5
|
+
const fit = {
|
|
6
|
+
cover: 'object-cover',
|
|
7
|
+
contain: 'object-contain',
|
|
8
|
+
fill: 'object-fill'
|
|
9
|
+
};
|
|
10
|
+
let source = undefined;
|
|
11
|
+
let imageFit = undefined;
|
|
12
|
+
let altText = undefined;
|
|
13
|
+
let customStyles = undefined;
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<InputValue {id} input={configuration.source} bind:value={source} />
|
|
17
|
+
<InputValue {id} input={configuration.imageFit} bind:value={imageFit} />
|
|
18
|
+
<InputValue {id} input={configuration.altText} bind:value={altText} />
|
|
19
|
+
<InputValue {id} input={configuration.customStyles} bind:value={customStyles} />
|
|
20
|
+
|
|
21
|
+
<img
|
|
22
|
+
on:pointerdown|preventDefault
|
|
23
|
+
src={source}
|
|
24
|
+
alt={altText}
|
|
25
|
+
style={customStyles}
|
|
26
|
+
class="w-full h-full {fit[imageFit || 'cover']}"
|
|
27
|
+
/>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AppInput } from '../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
configuration: Record<string, AppInput>;
|
|
7
|
+
staticOutputs?: string[] | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
pointerdown: PointerEvent;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type AppImageProps = typeof __propDef.props;
|
|
17
|
+
export type AppImageEvents = typeof __propDef.events;
|
|
18
|
+
export type AppImageSlots = typeof __propDef.slots;
|
|
19
|
+
export default class AppImage extends SvelteComponentTyped<AppImageProps, AppImageEvents, AppImageSlots> {
|
|
20
|
+
get staticOutputs(): string[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import InputValue from '../helpers/InputValue.svelte';
|
|
|
5
5
|
export let id;
|
|
6
6
|
export let componentInput;
|
|
7
7
|
export let configuration;
|
|
8
|
+
export let initializing = undefined;
|
|
8
9
|
export const staticOutputs = ['loading', 'result'];
|
|
9
10
|
ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, ArcElement);
|
|
10
11
|
let result = undefined;
|
|
@@ -36,7 +37,7 @@ $: data = {
|
|
|
36
37
|
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
37
38
|
<InputValue {id} input={configuration.doughnutStyle} bind:value={doughnut} />
|
|
38
39
|
|
|
39
|
-
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
40
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
|
|
40
41
|
{#if result}
|
|
41
42
|
{#if doughnut}
|
|
42
43
|
<Doughnut {data} {options} />
|
|
@@ -6,6 +6,7 @@ import InputValue from '../helpers/InputValue.svelte';
|
|
|
6
6
|
export let id;
|
|
7
7
|
export let componentInput;
|
|
8
8
|
export let configuration;
|
|
9
|
+
export let initializing = undefined;
|
|
9
10
|
let zoomable = false;
|
|
10
11
|
let pannable = false;
|
|
11
12
|
export const staticOutputs = ['loading', 'result'];
|
|
@@ -39,7 +40,7 @@ $: data = {
|
|
|
39
40
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
40
41
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
41
42
|
|
|
42
|
-
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
43
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
|
|
43
44
|
{#if result}
|
|
44
45
|
<Scatter {data} {options} />
|
|
45
46
|
{/if}
|
|
@@ -5,13 +5,17 @@ import Popover from '../../../Popover.svelte';
|
|
|
5
5
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
6
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
7
7
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import { getContext } from 'svelte';
|
|
8
10
|
export let id;
|
|
9
11
|
export let componentInput;
|
|
10
12
|
export let horizontalAlignment = 'left';
|
|
11
13
|
export let verticalAlignment = undefined;
|
|
12
14
|
export let configuration;
|
|
15
|
+
export let initializing = undefined;
|
|
16
|
+
export let customCss = undefined;
|
|
13
17
|
export const staticOutputs = ['result', 'loading'];
|
|
14
|
-
|
|
18
|
+
const { app } = getContext('AppEditorContext');
|
|
15
19
|
let result = undefined;
|
|
16
20
|
let style = undefined;
|
|
17
21
|
let copyButton;
|
|
@@ -47,37 +51,35 @@ $: style && (component = getComponent());
|
|
|
47
51
|
$: style && (classes = getClasses());
|
|
48
52
|
</script>
|
|
49
53
|
|
|
50
|
-
<InputValue {id} input={configuration.extraStyle} bind:value={extraStyle} />
|
|
51
54
|
<InputValue {id} input={configuration.style} bind:value={style} />
|
|
52
55
|
<InputValue {id} input={configuration.copyButton} bind:value={copyButton} />
|
|
53
56
|
|
|
54
|
-
<RunnableWrapper flexWrap bind:componentInput {id} bind:result>
|
|
57
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:initializing bind:result>
|
|
55
58
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
56
59
|
{#if !result || result === ''}
|
|
57
60
|
<div class="text-gray-400 bg-gray-100 flex justify-center items-center h-full w-full">
|
|
58
61
|
No text
|
|
59
62
|
</div>
|
|
60
63
|
{:else}
|
|
61
|
-
<div class="flex flex-wrap gap-2">
|
|
64
|
+
<div class="flex flex-wrap gap-2 pb-0.5 overflow-x-auto">
|
|
62
65
|
<svelte:element
|
|
63
66
|
this={component}
|
|
64
|
-
class=
|
|
65
|
-
|
|
67
|
+
class={twMerge(
|
|
68
|
+
'whitespace-pre-wrap',
|
|
69
|
+
$app.css?.['textcomponent']?.['text']?.class,
|
|
70
|
+
customCss?.text?.class,
|
|
71
|
+
classes
|
|
72
|
+
)}
|
|
73
|
+
style={[$app.css?.['textcomponent']?.['text']?.style, customCss?.text?.style].join(';')}
|
|
66
74
|
>
|
|
67
75
|
{String(result)}
|
|
68
76
|
</svelte:element>
|
|
69
77
|
{#if copyButton && result}
|
|
70
78
|
<Popover notClickable>
|
|
71
|
-
<Button
|
|
72
|
-
size="xs"
|
|
73
|
-
btnClasses="!px-2"
|
|
74
|
-
on:click={() => copyToClipboard(result)}
|
|
75
|
-
>
|
|
79
|
+
<Button size="xs" btnClasses="!px-2" on:click={() => copyToClipboard(result)}>
|
|
76
80
|
<Clipboard size={14} strokeWidth={2} />
|
|
77
81
|
</Button>
|
|
78
|
-
<svelte:fragment slot="text">
|
|
79
|
-
Copy to clipboard
|
|
80
|
-
</svelte:fragment>
|
|
82
|
+
<svelte:fragment slot="text">Copy to clipboard</svelte:fragment>
|
|
81
83
|
</Popover>
|
|
82
84
|
{/if}
|
|
83
85
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { AppInput } from '../../inputType';
|
|
3
|
+
import type { ComponentCustomCSS } from '../../types';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
id: string;
|
|
@@ -7,6 +8,8 @@ declare const __propDef: {
|
|
|
7
8
|
horizontalAlignment?: 'left' | 'center' | 'right' | undefined;
|
|
8
9
|
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
9
10
|
configuration: Record<string, AppInput>;
|
|
11
|
+
initializing?: boolean | undefined;
|
|
12
|
+
customCss?: ComponentCustomCSS<'text'> | undefined;
|
|
10
13
|
staticOutputs?: string[] | undefined;
|
|
11
14
|
};
|
|
12
15
|
events: {
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import 'chartjs-adapter-date-fns';
|
|
3
3
|
import { Chart as ChartJS, Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement, TimeScale, LogarithmicScale } from 'chart.js';
|
|
4
4
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
5
|
-
import Scatter from 'svelte-chartjs
|
|
5
|
+
import { Scatter } from 'svelte-chartjs';
|
|
6
6
|
import InputValue from '../helpers/InputValue.svelte';
|
|
7
7
|
export let id;
|
|
8
8
|
export let componentInput;
|
|
9
9
|
export let configuration;
|
|
10
|
+
export let initializing = undefined;
|
|
10
11
|
export const staticOutputs = ['loading', 'result'];
|
|
11
12
|
let logarithmicScale = false;
|
|
12
13
|
let zoomable = false;
|
|
@@ -50,7 +51,7 @@ $: data = {
|
|
|
50
51
|
<InputValue {id} input={configuration.zoomable} bind:value={zoomable} />
|
|
51
52
|
<InputValue {id} input={configuration.pannable} bind:value={pannable} />
|
|
52
53
|
|
|
53
|
-
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:result>
|
|
54
|
+
<RunnableWrapper flexWrap autoRefresh bind:componentInput {id} bind:initializing bind:result>
|
|
54
55
|
{#if result}
|
|
55
56
|
<Scatter {data} {options} />
|
|
56
57
|
{/if}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script>import { Loader2 } from 'lucide-svelte';
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
4
|
+
export let id;
|
|
5
|
+
export let componentInput;
|
|
6
|
+
export let configuration;
|
|
7
|
+
export let initializing = undefined;
|
|
8
|
+
export const staticOutputs = ['result', 'loading'];
|
|
9
|
+
let result = undefined;
|
|
10
|
+
let divEl = null;
|
|
11
|
+
let Plotly;
|
|
12
|
+
onMount(async () => {
|
|
13
|
+
if (divEl) {
|
|
14
|
+
//@ts-ignore
|
|
15
|
+
await import('https://cdn.plot.ly/plotly-2.18.0.min.js');
|
|
16
|
+
Plotly = window['Plotly'];
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
let h = undefined;
|
|
20
|
+
let w = undefined;
|
|
21
|
+
$: Plotly &&
|
|
22
|
+
result &&
|
|
23
|
+
divEl &&
|
|
24
|
+
h &&
|
|
25
|
+
w &&
|
|
26
|
+
Plotly.newPlot(divEl, [result], { width: w, height: h, margin: { l: 40, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
|
|
30
|
+
<RunnableWrapper flexWrap bind:componentInput {id} bind:initializing bind:result>
|
|
31
|
+
{#if !Plotly}
|
|
32
|
+
<div class="p-2">
|
|
33
|
+
<Loader2 class="animate-spin" />
|
|
34
|
+
</div>
|
|
35
|
+
{/if}
|
|
36
|
+
<div on:pointerdown bind:this={divEl} />
|
|
37
|
+
</RunnableWrapper>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AppInput } from '../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
componentInput: AppInput | undefined;
|
|
7
|
+
configuration: Record<string, AppInput>;
|
|
8
|
+
initializing?: boolean | undefined;
|
|
9
|
+
staticOutputs?: string[] | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
pointerdown: PointerEvent;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
export type PlotlyHtmlProps = typeof __propDef.props;
|
|
19
|
+
export type PlotlyHtmlEvents = typeof __propDef.events;
|
|
20
|
+
export type PlotlyHtmlSlots = typeof __propDef.slots;
|
|
21
|
+
export default class PlotlyHtml extends SvelteComponentTyped<PlotlyHtmlProps, PlotlyHtmlEvents, PlotlyHtmlSlots> {
|
|
22
|
+
get staticOutputs(): string[];
|
|
23
|
+
}
|
|
24
|
+
export {};
|