windmill-components 1.60.4 → 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 +3 -2
- 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 +11 -3
- 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/{dataDisplay → display}/AppHtml.svelte +6 -5
- package/components/apps/components/{dataDisplay → display}/AppHtml.svelte.d.ts +1 -1
- 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/{dataDisplay → display}/VegaLiteHtml.svelte +2 -3
- package/components/apps/components/{dataDisplay → display}/VegaLiteHtml.svelte.d.ts +1 -0
- 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 +32 -21
- 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 +11 -6
- 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 -106
- 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 -40
- package/components/apps/types.js +1 -1
- package/components/apps/utils.d.ts +6 -5
- package/components/apps/utils.js +90 -94
- 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/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/numberInputs/AppNumberInput.svelte +0 -33
- package/components/apps/components/selectInputs/AppSelect.svelte +0 -47
- package/components/apps/editor/ComponentEditor.svelte +0 -145
- 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 -499
- package/components/apps/editorUtils.d.ts +0 -1
- package/components/apps/editorUtils.js +0 -292
- /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
|
@@ -5,7 +5,7 @@ import RunnableComponent from './RunnableComponent.svelte';
|
|
|
5
5
|
export let componentInput;
|
|
6
6
|
export let id;
|
|
7
7
|
export let result = undefined;
|
|
8
|
-
export let
|
|
8
|
+
export let initializing = true;
|
|
9
9
|
export let extraQueryParams = {};
|
|
10
10
|
export let autoRefresh = true;
|
|
11
11
|
export let runnableComponent = undefined;
|
|
@@ -13,7 +13,11 @@ export let forceSchemaDisplay = false;
|
|
|
13
13
|
export let defaultUserInput = false;
|
|
14
14
|
export let flexWrap = false;
|
|
15
15
|
export let runnableClass = '';
|
|
16
|
+
export let goto = undefined;
|
|
16
17
|
const { staticExporter, noBackend } = getContext('AppEditorContext');
|
|
18
|
+
$: if (initializing && result) {
|
|
19
|
+
initializing = false;
|
|
20
|
+
}
|
|
17
21
|
if (noBackend && componentInput?.type == 'runnable') {
|
|
18
22
|
result = componentInput?.['value'];
|
|
19
23
|
}
|
|
@@ -29,6 +33,7 @@ function isRunnableDefined() {
|
|
|
29
33
|
<slot />
|
|
30
34
|
{:else if componentInput.type === 'runnable' && isRunnableDefined()}
|
|
31
35
|
<RunnableComponent
|
|
36
|
+
gotoUrl={goto}
|
|
32
37
|
{flexWrap}
|
|
33
38
|
{defaultUserInput}
|
|
34
39
|
bind:this={runnableComponent}
|
|
@@ -39,7 +44,7 @@ function isRunnableDefined() {
|
|
|
39
44
|
{id}
|
|
40
45
|
{extraQueryParams}
|
|
41
46
|
{forceSchemaDisplay}
|
|
42
|
-
{
|
|
47
|
+
{initializing}
|
|
43
48
|
wrapperClass={runnableClass}
|
|
44
49
|
>
|
|
45
50
|
<slot />
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
componentInput: AppInput | undefined;
|
|
7
7
|
id: string;
|
|
8
8
|
result?: any;
|
|
9
|
-
|
|
9
|
+
initializing?: boolean | undefined;
|
|
10
10
|
extraQueryParams?: Record<string, any> | undefined;
|
|
11
11
|
autoRefresh?: boolean | undefined;
|
|
12
12
|
runnableComponent?: RunnableComponent | undefined;
|
|
@@ -14,6 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
defaultUserInput?: boolean | undefined;
|
|
15
15
|
flexWrap?: boolean | undefined;
|
|
16
16
|
runnableClass?: string | undefined;
|
|
17
|
+
goto?: string | undefined;
|
|
17
18
|
};
|
|
18
19
|
events: {
|
|
19
20
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as AlignWrapper } from './AlignWrapper.svelte';
|
|
2
|
+
export { default as DebouncedInput } from './DebouncedInput.svelte';
|
|
3
|
+
export { default as HiddenComponent } from './HiddenComponent.svelte';
|
|
4
|
+
export { default as InputDefaultValue } from './InputDefaultValue.svelte';
|
|
5
|
+
export { default as InputValue } from './InputValue.svelte';
|
|
6
|
+
export { default as MissingConnectionWarning } from './MissingConnectionWarning.svelte';
|
|
7
|
+
export { default as NonRunnableComponent } from './NonRunnableComponent.svelte';
|
|
8
|
+
export { default as RefreshButton } from './RefreshButton.svelte';
|
|
9
|
+
export { default as RunnableComponent } from './RunnableComponent.svelte';
|
|
10
|
+
export { default as RunnableWrapper } from './RunnableWrapper.svelte';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as AlignWrapper } from './AlignWrapper.svelte';
|
|
2
|
+
export { default as DebouncedInput } from './DebouncedInput.svelte';
|
|
3
|
+
export { default as HiddenComponent } from './HiddenComponent.svelte';
|
|
4
|
+
export { default as InputDefaultValue } from './InputDefaultValue.svelte';
|
|
5
|
+
export { default as InputValue } from './InputValue.svelte';
|
|
6
|
+
export { default as MissingConnectionWarning } from './MissingConnectionWarning.svelte';
|
|
7
|
+
export { default as NonRunnableComponent } from './NonRunnableComponent.svelte';
|
|
8
|
+
export { default as RefreshButton } from './RefreshButton.svelte';
|
|
9
|
+
export { default as RunnableComponent } from './RunnableComponent.svelte';
|
|
10
|
+
export { default as RunnableWrapper } from './RunnableWrapper.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadIcon(name: string): Promise<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { toKebabCase } from '../utils';
|
|
2
|
+
export async function loadIcon(name) {
|
|
3
|
+
let iconComponent;
|
|
4
|
+
try {
|
|
5
|
+
if (name) {
|
|
6
|
+
name = toKebabCase(name).replace(/([a-z])(\d)/i, '$1-$2');
|
|
7
|
+
iconComponent = (await import(`../../../../../node_modules/lucide-svelte/dist/svelte/icons/${name}.svelte`)).default;
|
|
8
|
+
return iconComponent;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
iconComponent = undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(error);
|
|
16
|
+
iconComponent = undefined;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -8,14 +8,16 @@ export let horizontalAlignment = undefined;
|
|
|
8
8
|
export let verticalAlignment = undefined;
|
|
9
9
|
const { worldStore } = getContext('AppEditorContext');
|
|
10
10
|
export const staticOutputs = ['result'];
|
|
11
|
+
let defaultValue = undefined;
|
|
11
12
|
let labelValue = 'Default label';
|
|
12
|
-
let value = false;
|
|
13
13
|
// As the checkbox is a special case and has no input
|
|
14
14
|
// we need to manually set the output
|
|
15
15
|
$: outputs = $worldStore?.outputsById[id];
|
|
16
|
+
$: defaultValue != undefined && outputs?.result.set(defaultValue);
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
<InputValue {id} input={configuration.label} bind:value={labelValue} />
|
|
20
|
+
<InputValue {id} input={configuration.defaultValue} bind:value={defaultValue} />
|
|
19
21
|
|
|
20
22
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
21
23
|
<Toggle
|
|
@@ -23,7 +25,7 @@ $: outputs = $worldStore?.outputsById[id];
|
|
|
23
25
|
e?.stopPropagation()
|
|
24
26
|
window.dispatchEvent(new Event('pointerup'))
|
|
25
27
|
}}
|
|
26
|
-
|
|
28
|
+
checked={defaultValue}
|
|
27
29
|
options={{ right: labelValue }}
|
|
28
30
|
on:change={(e) => {
|
|
29
31
|
outputs.result.set(e.detail)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
3
|
+
import InputDefaultValue from '../helpers/InputDefaultValue.svelte';
|
|
3
4
|
import InputValue from '../helpers/InputValue.svelte';
|
|
4
5
|
export let id;
|
|
5
6
|
export let configuration;
|
|
@@ -11,15 +12,20 @@ let input;
|
|
|
11
12
|
let labelValue = 'Title';
|
|
12
13
|
let minValue = '';
|
|
13
14
|
let maxValue = '';
|
|
15
|
+
let defaultValue = undefined;
|
|
14
16
|
$: outputs = $worldStore?.outputsById[id];
|
|
15
17
|
function handleInput() {
|
|
16
18
|
outputs?.result.set(input.value);
|
|
17
19
|
}
|
|
20
|
+
$: input && handleInput();
|
|
18
21
|
</script>
|
|
19
22
|
|
|
20
23
|
<InputValue {id} input={configuration.label} bind:value={labelValue} />
|
|
21
24
|
<InputValue {id} input={configuration.minDate} bind:value={minValue} />
|
|
22
25
|
<InputValue {id} input={configuration.maxDate} bind:value={maxValue} />
|
|
26
|
+
<InputValue {id} input={configuration.defaultValue} bind:value={defaultValue} />
|
|
27
|
+
|
|
28
|
+
<InputDefaultValue bind:input {defaultValue} />
|
|
23
29
|
|
|
24
30
|
<AlignWrapper {verticalAlignment}>
|
|
25
31
|
<input
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { FileInput } from '../../../common';
|
|
3
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
4
|
+
export let id;
|
|
5
|
+
export let configuration;
|
|
6
|
+
export const staticOutputs = ['result'];
|
|
7
|
+
const { worldStore } = getContext('AppEditorContext');
|
|
8
|
+
let acceptedFileTypes = undefined;
|
|
9
|
+
let allowMultiple = undefined;
|
|
10
|
+
let text = undefined;
|
|
11
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
12
|
+
// Receives Base64 encoded strings from the input component
|
|
13
|
+
async function handleChange(files) {
|
|
14
|
+
outputs?.result.set(files);
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<InputValue {id} input={configuration.acceptedFileTypes} bind:value={acceptedFileTypes} />
|
|
19
|
+
<InputValue {id} input={configuration.allowMultiple} bind:value={allowMultiple} />
|
|
20
|
+
<InputValue {id} input={configuration.text} bind:value={text} />
|
|
21
|
+
|
|
22
|
+
<div class="w-full h-full p-1">
|
|
23
|
+
<FileInput
|
|
24
|
+
accept={acceptedFileTypes?.length ? acceptedFileTypes?.join(', ') : undefined}
|
|
25
|
+
multiple={allowMultiple}
|
|
26
|
+
convertToBase64
|
|
27
|
+
on:change={({ detail }) => {
|
|
28
|
+
handleChange(detail)
|
|
29
|
+
}}
|
|
30
|
+
class="w-full h-full"
|
|
31
|
+
>
|
|
32
|
+
{text}
|
|
33
|
+
</FileInput>
|
|
34
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type AppFileInputProps = typeof __propDef.props;
|
|
15
|
+
export type AppFileInputEvents = typeof __propDef.events;
|
|
16
|
+
export type AppFileInputSlots = typeof __propDef.slots;
|
|
17
|
+
export default class AppFileInput extends SvelteComponentTyped<AppFileInputProps, AppFileInputEvents, AppFileInputSlots> {
|
|
18
|
+
get staticOutputs(): string[];
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
3
|
+
import InputDefaultValue from '../helpers/InputDefaultValue.svelte';
|
|
4
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
5
|
+
export let id;
|
|
6
|
+
export let configuration;
|
|
7
|
+
export let verticalAlignment = undefined;
|
|
8
|
+
export const staticOutputs = ['result'];
|
|
9
|
+
const { worldStore } = getContext('AppEditorContext');
|
|
10
|
+
let input;
|
|
11
|
+
let defaultValue = undefined;
|
|
12
|
+
let placeholder = undefined;
|
|
13
|
+
let min = undefined;
|
|
14
|
+
let max = undefined;
|
|
15
|
+
let step = 1;
|
|
16
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
17
|
+
function handleInput() {
|
|
18
|
+
const value = input?.value;
|
|
19
|
+
const num = isNaN(+value) ? null : +value;
|
|
20
|
+
outputs?.result.set(num);
|
|
21
|
+
}
|
|
22
|
+
$: input && handleInput();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<InputValue {id} input={configuration.step} bind:value={step} />
|
|
26
|
+
<InputValue {id} input={configuration.min} bind:value={min} />
|
|
27
|
+
<InputValue {id} input={configuration.max} bind:value={max} />
|
|
28
|
+
<InputValue {id} input={configuration.placeholder} bind:value={placeholder} />
|
|
29
|
+
<InputValue {id} input={configuration.defaultValue} bind:value={defaultValue} />
|
|
30
|
+
<InputDefaultValue bind:input {defaultValue} />
|
|
31
|
+
|
|
32
|
+
<AlignWrapper {verticalAlignment}>
|
|
33
|
+
<input
|
|
34
|
+
bind:this={input}
|
|
35
|
+
on:input={handleInput}
|
|
36
|
+
on:focus={(e) => {
|
|
37
|
+
e?.stopPropagation()
|
|
38
|
+
window.dispatchEvent(new Event('pointerup'))
|
|
39
|
+
}}
|
|
40
|
+
{min}
|
|
41
|
+
{max}
|
|
42
|
+
{step}
|
|
43
|
+
type="number"
|
|
44
|
+
inputmode="numeric"
|
|
45
|
+
pattern="\d*"
|
|
46
|
+
{placeholder}
|
|
47
|
+
/>
|
|
48
|
+
</AlignWrapper>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>import RangeSlider from 'svelte-range-slider-pips';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
4
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
5
|
+
import { Badge } from '../../../common';
|
|
6
|
+
export let id;
|
|
7
|
+
export let configuration;
|
|
8
|
+
export let verticalAlignment = undefined;
|
|
9
|
+
export const staticOutputs = ['result'];
|
|
10
|
+
const { worldStore } = getContext('AppEditorContext');
|
|
11
|
+
let min = 0;
|
|
12
|
+
let max = 42;
|
|
13
|
+
let step = 1;
|
|
14
|
+
let values = [0, 0];
|
|
15
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
16
|
+
$: outputs?.result.set(values);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<InputValue {id} input={configuration.step} bind:value={step} />
|
|
20
|
+
<InputValue {id} input={configuration.min} bind:value={min} />
|
|
21
|
+
<InputValue {id} input={configuration.max} bind:value={max} />
|
|
22
|
+
<InputValue {id} input={configuration.defaultLow} bind:value={values[0]} />
|
|
23
|
+
<InputValue {id} input={configuration.defaultHigh} bind:value={values[1]} />
|
|
24
|
+
|
|
25
|
+
<AlignWrapper {verticalAlignment}>
|
|
26
|
+
<div class="flex flex-col w-full">
|
|
27
|
+
<div class="flex items-center w-full gap-1 px-1">
|
|
28
|
+
<span>{min}</span>
|
|
29
|
+
<div class="grow" on:pointerdown|stopPropagation>
|
|
30
|
+
<RangeSlider {step} range min={min ?? 0} max={max ?? 1} bind:values />
|
|
31
|
+
<!-- <DoubleRange bind:start bind:end /> -->
|
|
32
|
+
</div>
|
|
33
|
+
<span>{max}</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="flex justify-between px-1">
|
|
36
|
+
<div>
|
|
37
|
+
<Badge color="blue">{values[0]}</Badge>
|
|
38
|
+
</div>
|
|
39
|
+
<div>
|
|
40
|
+
<Badge color="blue">{values[1]}</Badge>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</AlignWrapper>
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
8
|
+
staticOutputs?: string[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
pointerdown: PointerEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export type AppRangeInputProps = typeof __propDef.props;
|
|
18
|
+
export type AppRangeInputEvents = typeof __propDef.events;
|
|
19
|
+
export type AppRangeInputSlots = typeof __propDef.slots;
|
|
20
|
+
export default class AppRangeInput extends SvelteComponentTyped<AppRangeInputProps, AppRangeInputEvents, AppRangeInputSlots> {
|
|
21
|
+
get staticOutputs(): string[];
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import Select from 'svelte-select';
|
|
3
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
4
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
5
|
+
export const staticOutputs = ['result'];
|
|
6
|
+
export let id;
|
|
7
|
+
export let configuration;
|
|
8
|
+
export let horizontalAlignment = undefined;
|
|
9
|
+
export let verticalAlignment = undefined;
|
|
10
|
+
const { worldStore, connectingInput, selectedComponent } = getContext('AppEditorContext');
|
|
11
|
+
let items;
|
|
12
|
+
let multiple = false;
|
|
13
|
+
let placeholder = 'Select an item';
|
|
14
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
15
|
+
// $: outputs && handleOutputs()
|
|
16
|
+
// function handleOutputs() {
|
|
17
|
+
// value = outputs.result.peak()
|
|
18
|
+
// }
|
|
19
|
+
let value = outputs?.result.peak();
|
|
20
|
+
$: items && handleItems();
|
|
21
|
+
let listItems = [];
|
|
22
|
+
function handleItems() {
|
|
23
|
+
listItems = Array.isArray(items)
|
|
24
|
+
? items.map((item) => {
|
|
25
|
+
return {
|
|
26
|
+
label: item.label,
|
|
27
|
+
value: JSON.stringify(item.value)
|
|
28
|
+
};
|
|
29
|
+
})
|
|
30
|
+
: [];
|
|
31
|
+
const valuePeak = outputs?.result.peak();
|
|
32
|
+
if (!valuePeak) {
|
|
33
|
+
const value0 = items?.[0]?.['value'];
|
|
34
|
+
if (value0 != value && !items.includes(value0)) {
|
|
35
|
+
value = JSON.stringify(value0);
|
|
36
|
+
outputs?.result.set(value0);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
value = valuePeak;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function onChange(e) {
|
|
44
|
+
e?.stopPropagation();
|
|
45
|
+
window.dispatchEvent(new Event('pointerup'));
|
|
46
|
+
let result = undefined;
|
|
47
|
+
try {
|
|
48
|
+
result = JSON.parse(e.detail?.['value']);
|
|
49
|
+
}
|
|
50
|
+
catch (_) { }
|
|
51
|
+
outputs?.result.set(result);
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<InputValue {id} input={configuration.items} bind:value={items} />
|
|
56
|
+
<InputValue {id} input={configuration.multiple} bind:value={multiple} />
|
|
57
|
+
<InputValue {id} input={configuration.placeholder} bind:value={placeholder} />
|
|
58
|
+
|
|
59
|
+
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
60
|
+
<div class="app-select w-full" style="height: 34px" on:pointerdown|stopPropagation>
|
|
61
|
+
<Select
|
|
62
|
+
--height="34px"
|
|
63
|
+
{multiple}
|
|
64
|
+
on:clear={onChange}
|
|
65
|
+
on:change={onChange}
|
|
66
|
+
items={listItems}
|
|
67
|
+
{value}
|
|
68
|
+
{placeholder}
|
|
69
|
+
on:click={() => {
|
|
70
|
+
if (!$connectingInput.opened) {
|
|
71
|
+
$selectedComponent = id
|
|
72
|
+
}
|
|
73
|
+
}}
|
|
74
|
+
on:focus={() => {
|
|
75
|
+
$selectedComponent = id
|
|
76
|
+
}}
|
|
77
|
+
floatingConfig={{
|
|
78
|
+
strategy: 'fixed'
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</AlignWrapper>
|
|
83
|
+
|
|
84
|
+
<style global>
|
|
85
|
+
:global(.app-select) :global(.value-container) {
|
|
86
|
+
padding: 0 !important;
|
|
87
|
+
}
|
|
88
|
+
:global(.svelte-select-list) {
|
|
89
|
+
z-index: 1000 !important;
|
|
90
|
+
}</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { Badge } from '../../../common';
|
|
2
|
-
import
|
|
2
|
+
import RangeSlider from 'svelte-range-slider-pips';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
4
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
5
5
|
import InputValue from '../helpers/InputValue.svelte';
|
|
@@ -7,31 +7,35 @@ export let id;
|
|
|
7
7
|
export let configuration;
|
|
8
8
|
export let verticalAlignment = undefined;
|
|
9
9
|
export const staticOutputs = ['result'];
|
|
10
|
-
const { worldStore } = getContext('AppEditorContext');
|
|
11
|
-
let value;
|
|
10
|
+
const { worldStore, selectedComponent } = getContext('AppEditorContext');
|
|
12
11
|
let min = 0;
|
|
13
12
|
let max = 42;
|
|
13
|
+
let step = 1;
|
|
14
14
|
$: outputs = $worldStore?.outputsById[id];
|
|
15
|
-
|
|
15
|
+
let values = [outputs?.result.peak() ?? 0];
|
|
16
|
+
$: values && handleValues();
|
|
17
|
+
function handleValues() {
|
|
16
18
|
// Disallow 'e' character in numbers
|
|
17
19
|
// if(value && value.toString().includes('e')) {
|
|
18
20
|
// value = +value.toString().replaceAll('e', '')
|
|
19
21
|
// }
|
|
20
|
-
const num = isNaN(+
|
|
22
|
+
const num = isNaN(+values[0]) ? null : +values[0];
|
|
21
23
|
outputs?.result.set(num);
|
|
22
24
|
}
|
|
23
25
|
</script>
|
|
24
26
|
|
|
27
|
+
<InputValue {id} input={configuration.step} bind:value={step} />
|
|
25
28
|
<InputValue {id} input={configuration.min} bind:value={min} />
|
|
26
29
|
<InputValue {id} input={configuration.max} bind:value={max} />
|
|
30
|
+
<InputValue {id} input={configuration.defaultValue} bind:value={values[0]} />
|
|
27
31
|
|
|
28
32
|
<AlignWrapper {verticalAlignment}>
|
|
29
|
-
<div class="flex w-full gap-1 px-1">
|
|
33
|
+
<div class="flex items-center w-full gap-1 px-1">
|
|
30
34
|
<span>{min}</span>
|
|
31
|
-
<div class="grow
|
|
32
|
-
<
|
|
35
|
+
<div class="grow" on:pointerdown|stopPropagation={() => ($selectedComponent = id)}>
|
|
36
|
+
<RangeSlider {step} min={min ?? 0} max={max ?? 1} bind:values />
|
|
33
37
|
</div>
|
|
34
38
|
<span>{max}</span>
|
|
35
|
-
<span class="mx-2"><Badge large color="blue">{
|
|
39
|
+
<span class="mx-2"><Badge large color="blue">{values[0]}</Badge></span>
|
|
36
40
|
</div>
|
|
37
41
|
</AlignWrapper>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
3
|
+
import InputDefaultValue from '../helpers/InputDefaultValue.svelte';
|
|
3
4
|
import InputValue from '../helpers/InputValue.svelte';
|
|
4
5
|
export let id;
|
|
5
6
|
export let configuration;
|
|
@@ -9,16 +10,21 @@ export const staticOutputs = ['result'];
|
|
|
9
10
|
const { worldStore } = getContext('AppEditorContext');
|
|
10
11
|
let input;
|
|
11
12
|
let placeholder = undefined;
|
|
13
|
+
let defaultValue = undefined;
|
|
12
14
|
$: outputs = $worldStore?.outputsById[id];
|
|
13
15
|
function handleInput() {
|
|
14
16
|
outputs?.result.set(input.value);
|
|
15
17
|
}
|
|
18
|
+
$: input && handleInput();
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
21
|
<InputValue {id} input={configuration.placeholder} bind:value={placeholder} />
|
|
22
|
+
<InputValue {id} input={configuration.defaultValue} bind:value={defaultValue} />
|
|
23
|
+
<InputDefaultValue bind:input {defaultValue} />
|
|
19
24
|
|
|
20
25
|
<AlignWrapper {verticalAlignment}>
|
|
21
26
|
<input
|
|
27
|
+
class="mx-0.5"
|
|
22
28
|
on:focus={(e) => {
|
|
23
29
|
e?.stopPropagation()
|
|
24
30
|
window.dispatchEvent(new Event('pointerup'))
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import AlignWrapper from '../../helpers/AlignWrapper.svelte';
|
|
3
|
+
import InputValue from '../../helpers/InputValue.svelte';
|
|
4
|
+
import CurrencyInput from './CurrencyInput.svelte';
|
|
5
|
+
export let id;
|
|
6
|
+
export let configuration;
|
|
7
|
+
export let verticalAlignment = undefined;
|
|
8
|
+
export const staticOutputs = ['result'];
|
|
9
|
+
const { worldStore } = getContext('AppEditorContext');
|
|
10
|
+
let defaultValue = undefined;
|
|
11
|
+
let isNegativeAllowed = undefined;
|
|
12
|
+
let currency = undefined;
|
|
13
|
+
let locale = undefined;
|
|
14
|
+
let value = undefined;
|
|
15
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
16
|
+
function handleInput() {
|
|
17
|
+
outputs?.result.set(value ?? null);
|
|
18
|
+
}
|
|
19
|
+
function handleDefault() {
|
|
20
|
+
value = defaultValue;
|
|
21
|
+
handleInput();
|
|
22
|
+
}
|
|
23
|
+
$: value != undefined && handleInput();
|
|
24
|
+
$: defaultValue != undefined && handleDefault();
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<InputValue {id} input={configuration.defaultValue} bind:value={defaultValue} />
|
|
28
|
+
<InputValue {id} input={configuration.isNegativeAllowed} bind:value={isNegativeAllowed} />
|
|
29
|
+
<InputValue {id} input={configuration.currency} bind:value={currency} />
|
|
30
|
+
<InputValue {id} input={configuration.locale} bind:value={locale} />
|
|
31
|
+
|
|
32
|
+
<AlignWrapper {verticalAlignment}>
|
|
33
|
+
{#key isNegativeAllowed}
|
|
34
|
+
{#key locale}
|
|
35
|
+
{#key currency}
|
|
36
|
+
<CurrencyInput
|
|
37
|
+
inputClasses={{ formatted: 'p-0', wrapper: 'w-full', formattedZero: 'text-black' }}
|
|
38
|
+
bind:value
|
|
39
|
+
{currency}
|
|
40
|
+
{locale}
|
|
41
|
+
on:focus={(e) => {
|
|
42
|
+
e?.stopPropagation()
|
|
43
|
+
}}
|
|
44
|
+
{isNegativeAllowed}
|
|
45
|
+
/>
|
|
46
|
+
{/key}
|
|
47
|
+
{/key}
|
|
48
|
+
{/key}
|
|
49
|
+
</AlignWrapper>
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
8
|
+
staticOutputs?: string[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type AppCurrencyInputProps = typeof __propDef.props;
|
|
16
|
+
export type AppCurrencyInputEvents = typeof __propDef.events;
|
|
17
|
+
export type AppCurrencyInputSlots = typeof __propDef.slots;
|
|
18
|
+
export default class AppCurrencyInput extends SvelteComponentTyped<AppCurrencyInputProps, AppCurrencyInputEvents, AppCurrencyInputSlots> {
|
|
19
|
+
get staticOutputs(): string[];
|
|
20
|
+
}
|
|
21
|
+
export {};
|