@functionalcms/svelte-components 5.1.3 → 5.1.5
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.
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
type PhoneInputField,
|
|
11
11
|
type TimePickerField,
|
|
12
12
|
SubmitResult,
|
|
13
|
-
type ButtonConfig
|
|
13
|
+
type ButtonConfig,
|
|
14
|
+
type HiddenField
|
|
14
15
|
} from './form.js';
|
|
15
16
|
import {
|
|
16
17
|
Button,
|
|
@@ -197,6 +198,10 @@
|
|
|
197
198
|
<Timepicker id={field.id} required={field.required} disabled={field.disabled} />
|
|
198
199
|
{/snippet}
|
|
199
200
|
|
|
201
|
+
{#snippet renderHidden(field: HiddenField)}
|
|
202
|
+
<input type="hidden" id={field.id} name={field.id} value={field.value} />
|
|
203
|
+
{/snippet}
|
|
204
|
+
|
|
200
205
|
{#if showMessage}
|
|
201
206
|
<div class="alert alert-success" transition:fade={{ duration: 2000 }}>
|
|
202
207
|
{successMessage}
|
|
@@ -219,6 +224,8 @@
|
|
|
219
224
|
{@render renderPhoneInput(field)}
|
|
220
225
|
{:else if field.typeOfField === 'timepicker'}
|
|
221
226
|
{@render renderTimePicker(field)}
|
|
227
|
+
{:else if field.typeOfField === 'hidden'}
|
|
228
|
+
{@render renderHidden(field)}
|
|
222
229
|
{/if}
|
|
223
230
|
{/each}
|
|
224
231
|
|
|
@@ -11,7 +11,8 @@ export declare enum FieldType {
|
|
|
11
11
|
MultiSelect = "multi-select",
|
|
12
12
|
TimePicker = "time-picker",
|
|
13
13
|
Toggle = "toggle",
|
|
14
|
-
File = "file"
|
|
14
|
+
File = "file",
|
|
15
|
+
Hiidden = "hidden"
|
|
15
16
|
}
|
|
16
17
|
export declare enum InputType {
|
|
17
18
|
Text = "text",
|
|
@@ -93,6 +94,11 @@ export declare enum SubmitResult {
|
|
|
93
94
|
Success = "success",
|
|
94
95
|
Error = "error"
|
|
95
96
|
}
|
|
97
|
+
export type HiddenField = {
|
|
98
|
+
id: string;
|
|
99
|
+
value: string;
|
|
100
|
+
typeOfField: "hidden";
|
|
101
|
+
};
|
|
96
102
|
export declare function createInputField(id: string, label: string, type?: InputType, value?: any, options?: Partial<Omit<InputField, "id" | "label" | "typeOfField" | "type">>): InputField;
|
|
97
103
|
export declare function createTextareaField(id: string, label: string, value?: any, rows?: number, cols?: number, options?: Partial<Omit<TextareaField, "id" | "label" | "typeOfField" | "rows" | "cols">>): TextareaField;
|
|
98
104
|
export declare function createFilePickerField(id: string, label: string, value?: any, options?: Partial<Omit<FilePickerField, "id" | "label" | "typeOfField">>): FilePickerField;
|
|
@@ -106,6 +112,7 @@ export declare function createSelectField(id: string, label: string, selectOptio
|
|
|
106
112
|
}>, type?: "single" | "multiple", value?: any, options?: Partial<Omit<SelectField, "id" | "label" | "typeOfField" | "options" | "type">>): SelectField;
|
|
107
113
|
export declare function createTimePickerField(id: string, label: string, value?: any, options?: Partial<Omit<TimePickerField, "id" | "label" | "typeOfField">>): TimePickerField;
|
|
108
114
|
export declare function createPhoneInputField(id: string, label: string, value?: any, options?: Partial<Omit<PhoneInputField, "id" | "label" | "typeOfField">>): PhoneInputField;
|
|
115
|
+
export declare function createHiddenField(id: string, value: string): HiddenField;
|
|
109
116
|
export type ButtonConfig = {
|
|
110
117
|
label: string;
|
|
111
118
|
type: "submit" | "reset" | "button";
|
|
@@ -13,6 +13,7 @@ export var FieldType;
|
|
|
13
13
|
FieldType["TimePicker"] = "time-picker";
|
|
14
14
|
FieldType["Toggle"] = "toggle";
|
|
15
15
|
FieldType["File"] = "file";
|
|
16
|
+
FieldType["Hiidden"] = "hidden";
|
|
16
17
|
})(FieldType || (FieldType = {}));
|
|
17
18
|
export var InputType;
|
|
18
19
|
(function (InputType) {
|
|
@@ -108,8 +109,15 @@ export function createPhoneInputField(id, label, value = "", options = {}) {
|
|
|
108
109
|
id,
|
|
109
110
|
label,
|
|
110
111
|
value,
|
|
111
|
-
typeOfField: "
|
|
112
|
+
typeOfField: "phoneInput",
|
|
112
113
|
size: options.size || "md",
|
|
113
114
|
...options
|
|
114
115
|
};
|
|
115
116
|
}
|
|
117
|
+
export function createHiddenField(id, value) {
|
|
118
|
+
return {
|
|
119
|
+
id,
|
|
120
|
+
value,
|
|
121
|
+
typeOfField: "hidden",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -25,8 +25,13 @@
|
|
|
25
25
|
sidebarPosition?: 'fixed' | 'absolute' | 'static';
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
let {
|
|
29
|
-
|
|
28
|
+
let {
|
|
29
|
+
children,
|
|
30
|
+
menuItems = [],
|
|
31
|
+
logo = undefined,
|
|
32
|
+
sidebarPosition = 'fixed'
|
|
33
|
+
}: Partial<TwoColumnLayoutProps> = $props();
|
|
34
|
+
|
|
30
35
|
let container: HTMLElement | undefined = undefined;
|
|
31
36
|
const helpers = uiHelpers();
|
|
32
37
|
afterNavigate(() => {
|
|
@@ -36,9 +41,7 @@
|
|
|
36
41
|
|
|
37
42
|
<main class="" bind:this={container}>
|
|
38
43
|
<SidebarButton onclick={helpers.toggle} class="mb-2" />
|
|
39
|
-
|
|
40
|
-
<SidebarBrand site={logo} classes={{ img: 'h-6 w-6' }} />
|
|
41
|
-
{/if}
|
|
44
|
+
|
|
42
45
|
<Sidebar
|
|
43
46
|
backdrop={false}
|
|
44
47
|
isOpen={helpers.isOpen}
|
|
@@ -47,6 +50,9 @@
|
|
|
47
50
|
class="z-50 h-full"
|
|
48
51
|
>
|
|
49
52
|
<SidebarGroup>
|
|
53
|
+
{#if logo}
|
|
54
|
+
<SidebarBrand site={logo} classes={{ img: 'h-6 w-6' }} />
|
|
55
|
+
{/if}
|
|
50
56
|
{#each menuItems as item}
|
|
51
57
|
{#if 'items' in item}
|
|
52
58
|
<SidebarDropdownWrapper label={item.label}>
|
|
@@ -64,7 +70,7 @@
|
|
|
64
70
|
{/each}
|
|
65
71
|
</SidebarGroup>
|
|
66
72
|
</Sidebar>
|
|
67
|
-
<div class="content" style:flex="1">
|
|
73
|
+
<div class="content h-full overflow-auto px-4 md:ml-64" style:flex="1">
|
|
68
74
|
{@render children?.()}
|
|
69
75
|
</div>
|
|
70
76
|
</main>
|