('AppViewerContext')
- let acceptedFileTypes: string[] | undefined = undefined
- let allowMultiple: boolean | undefined = undefined
- let text: string | undefined = undefined
- let includeMimeType: boolean | undefined = undefined
- let submittedFileText: string | undefined = undefined
-
let outputs = initOutput($worldStore, id, {
result: [] as { name: string; data: string }[] | undefined
})
+ let resolvedConfig = initConfig(
+ components['fileinputcomponent'].initialData.configuration,
+ configuration
+ )
+
// Receives Base64 encoded strings from the input component
async function handleChange(files: { name: string; data: string }[] | undefined) {
- if (includeMimeType === false) {
+ if (resolvedConfig?.includeMimeType === false) {
files = files?.map((file) => {
const [_, data] = file.data.split('base64,')
return { name: file.name, data }
@@ -73,21 +74,15 @@
/>
{/each}
-
-
-
-
-
+{#each Object.keys(components['fileinputcomponent'].initialData.configuration) as key (key)}
+
+{/each}
@@ -95,8 +90,10 @@
{
@@ -104,10 +101,11 @@
}}
class={twMerge('w-full h-full', css?.container?.class, 'wm-file-input')}
style={css?.container?.style}
- submittedText={submittedFileText}
+ submittedText={resolvedConfig?.submittedFileText}
+ disabled={resolvedConfig.disabled}
bind:files
>
- {text}
+ {resolvedConfig?.text}
{/if}
diff --git a/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte
index 2f1030d3e1..c07c316193 100644
--- a/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte
+++ b/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte
@@ -76,7 +76,6 @@
'windmillapp w-full py-1.5 px-2 text-sm',
'app-editor-input',
css?.input?.class ?? '',
- resolvedConfig.disabled ? 'placeholder:text-gray-400 dark:placeholder:text-gray-600' : '',
'wm-input',
'wm-text-input'
)
diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts
index ee46dfef50..e84ad83847 100644
--- a/frontend/src/lib/components/apps/editor/component/components.ts
+++ b/frontend/src/lib/components/apps/editor/component/components.ts
@@ -2189,6 +2189,11 @@ This is a paragraph.
value: true,
tooltip: 'Set the width of the options popup to 100% of the select width'
+ },
+ disabled: {
+ type: 'static',
+ fieldType: 'boolean',
+ value: false
}
}
}
@@ -2627,6 +2632,11 @@ See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm'
type: 'static',
value: undefined,
fieldType: 'datetime'
+ },
+ disabled: {
+ type: 'static',
+ value: false,
+ fieldType: 'boolean'
}
}
}
@@ -2893,6 +2903,11 @@ See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm'
type: 'static',
value: 'Selected file',
fieldType: 'text'
+ },
+ disabled: {
+ type: 'static',
+ value: false,
+ fieldType: 'boolean'
}
}
}
@@ -3551,7 +3566,12 @@ See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm'
fieldType: 'template',
connections: [],
onDemandOnly: true
- } as EvalV2AppInput
+ } as EvalV2AppInput,
+ disabled: {
+ type: 'static',
+ value: false,
+ fieldType: 'boolean'
+ }
}
}
} as const
diff --git a/frontend/src/lib/components/apps/svelte-select/lib/Select.svelte b/frontend/src/lib/components/apps/svelte-select/lib/Select.svelte
index a0831b0d47..b0d8e4938c 100644
--- a/frontend/src/lib/components/apps/svelte-select/lib/Select.svelte
+++ b/frontend/src/lib/components/apps/svelte-select/lib/Select.svelte
@@ -668,7 +668,6 @@
bind:value={filterText}
placeholder={placeholderText}
style={inputStyles}
- {disabled}
/>
@@ -867,7 +866,7 @@
.disabled input::placeholder {
color: var(--disabled-placeholder-color, #c1c6cc);
- opacity: var(--disabled-placeholder-opacity, 1);
+ opacity: var(--disabled-placeholder-opacity, 0.8);
}
.selected-item {
diff --git a/frontend/src/lib/components/common/fileInput/FileInput.svelte b/frontend/src/lib/components/common/fileInput/FileInput.svelte
index ba2f374b79..1ce7347143 100644
--- a/frontend/src/lib/components/common/fileInput/FileInput.svelte
+++ b/frontend/src/lib/components/common/fileInput/FileInput.svelte
@@ -18,6 +18,7 @@
export let returnFileNames = false
export let submittedText: string | undefined = undefined
export let defaultFile: string | undefined = undefined
+ export let disabled: boolean | undefined = undefined
const dispatch = createEventDispatcher()
let input: HTMLInputElement
@@ -133,6 +134,7 @@
on:dragover={handleDragOver}
on:drop={handleDrop}
{style}
+ {disabled}
>
{#if !hideIcon && !files}
diff --git a/frontend/src/lib/defaults.ts b/frontend/src/lib/defaults.ts
index 0367444982..17ffdec1c2 100644
--- a/frontend/src/lib/defaults.ts
+++ b/frontend/src/lib/defaults.ts
@@ -2,5 +2,5 @@ export const SELECT_INPUT_DEFAULT_STYLE = {
inputStyles: 'border-radius: 0;',
containerStyles: '--height: 34px; --padding: 0 0 0 8px; --font-size: 0.875rem;',
containerStylesDark:
- '--height: 34px; --padding: 0 0 0 8px; --font-size: 0.875rem; --background: #3b4252; --disabled-background: #2a2f3a; --list-background: #3b4252;--item-is-active-bg:#434c5e;--item-hover-bg:#4c566a;'
+ '--height: 34px; --padding: 0 0 0 8px; --font-size: 0.875rem; --disabled-border-color: #3e4c60; --background: #2e3440; --disabled-background: transparent; --list-background: #3b4252;--item-is-active-bg:#434c5e;--item-hover-bg:#4c566a;'
} as const