fuma 1.0.16 → 1.0.17
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/dist/private/Meta.svelte +27 -32
- package/dist/private/Meta.svelte.d.ts +0 -1
- package/dist/private/api.d.ts +1 -1
- package/dist/ui/badge/Badge.svelte +3 -4
- package/dist/ui/button/ButtonCopy.svelte +31 -37
- package/dist/ui/button/ButtonDelete.svelte +21 -23
- package/dist/ui/button/ButtonDelete.svelte.d.ts +0 -1
- package/dist/ui/card/Card.svelte +10 -13
- package/dist/ui/card/Card.svelte.d.ts +0 -1
- package/dist/ui/card/CardBasic.svelte +4 -5
- package/dist/ui/card/CardBasic.svelte.d.ts +0 -1
- package/dist/ui/card/CardCollapse.svelte +31 -35
- package/dist/ui/card/CardCollapse.svelte.d.ts +0 -1
- package/dist/ui/card/CardFullScreen.svelte +6 -8
- package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -3
- package/dist/ui/card/CardLink.svelte +4 -5
- package/dist/ui/card/CardLink.svelte.d.ts +0 -1
- package/dist/ui/dialog/Dialog.svelte +34 -41
- package/dist/ui/dialog/Dialog.svelte.d.ts +0 -1
- package/dist/ui/dialog/DialogConfirm.svelte +4 -6
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -1
- package/dist/ui/drawer/Drawer.svelte +37 -46
- package/dist/ui/drawer/Drawer.svelte.d.ts +0 -16
- package/dist/ui/form/Form.svelte +82 -100
- package/dist/ui/form/Form.svelte.d.ts +0 -1
- package/dist/ui/form/FormInput.svelte +6 -12
- package/dist/ui/form/FormInput.svelte.d.ts +0 -18
- package/dist/ui/form/FormSection.svelte +16 -23
- package/dist/ui/form/formInput.d.ts +0 -1
- package/dist/ui/icon/Icon.svelte +32 -35
- package/dist/ui/input/FormControl.svelte +32 -38
- package/dist/ui/input/FormControl.svelte.d.ts +0 -3
- package/dist/ui/input/InputBoolean.svelte +8 -13
- package/dist/ui/input/InputBoolean.svelte.d.ts +0 -3
- package/dist/ui/input/InputCheckboxs.svelte +20 -22
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -3
- package/dist/ui/input/InputCheckboxsMenu.svelte +35 -51
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -3
- package/dist/ui/input/InputCheckboxsTree.svelte +6 -9
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +27 -35
- package/dist/ui/input/InputCombo.svelte +34 -43
- package/dist/ui/input/InputCombo.svelte.d.ts +0 -3
- package/dist/ui/input/InputDate.svelte +17 -22
- package/dist/ui/input/InputDateTime.svelte +18 -23
- package/dist/ui/input/InputImage.svelte +45 -52
- package/dist/ui/input/InputImage.svelte.d.ts +0 -1
- package/dist/ui/input/InputImagePreview.svelte +20 -24
- package/dist/ui/input/InputNumber.svelte +5 -10
- package/dist/ui/input/InputOptionInParam.svelte +10 -12
- package/dist/ui/input/InputOptions.svelte +34 -40
- package/dist/ui/input/InputPassword.svelte +5 -7
- package/dist/ui/input/InputPassword.svelte.d.ts +0 -3
- package/dist/ui/input/InputRadio.svelte +32 -36
- package/dist/ui/input/InputRadio.svelte.d.ts +0 -3
- package/dist/ui/input/InputRelation.svelte +67 -83
- package/dist/ui/input/InputRelation.svelte.d.ts +0 -1
- package/dist/ui/input/InputRelations.svelte +79 -92
- package/dist/ui/input/InputSearch.svelte +10 -13
- package/dist/ui/input/InputSelect.svelte +28 -39
- package/dist/ui/input/InputText.svelte +7 -8
- package/dist/ui/input/InputTextarea.svelte +6 -6
- package/dist/ui/input/InputTime.svelte +23 -29
- package/dist/ui/input/RelationAfter.svelte +9 -13
- package/dist/ui/input/SelectorList.svelte +12 -16
- package/dist/ui/input/SelectorList.svelte.d.ts +0 -4
- package/dist/ui/input/textRich/InputTextRich.svelte +50 -57
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -3
- package/dist/ui/input/textRich/SuggesionList.svelte +9 -13
- package/dist/ui/input/textRich/ToolMark.svelte +9 -12
- package/dist/ui/input/textRich/ToolMarkColor.svelte +11 -15
- package/dist/ui/input/textRich/ToolMarkLink.svelte +38 -46
- package/dist/ui/input/textRich/ToolMenu.svelte +19 -34
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +9 -13
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +7 -12
- package/dist/ui/input/textRich/ToolMenuNode.svelte +10 -14
- package/dist/ui/input/textRich/ToolsBar.svelte +11 -15
- package/dist/ui/login/Login.svelte +30 -36
- package/dist/ui/menu/ContextMenu.svelte +31 -37
- package/dist/ui/menu/ContextMenu.svelte.d.ts +0 -1
- package/dist/ui/menu/DropDown.svelte +83 -92
- package/dist/ui/menu/DropDown.svelte.d.ts +0 -1
- package/dist/ui/menu/DropDownMenu.svelte +18 -25
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +0 -1
- package/dist/ui/mode/ToggleMode.svelte +14 -15
- package/dist/ui/mode/ToggleMode.svelte.d.ts +1 -6
- package/dist/ui/pagination/Pagination.svelte +8 -9
- package/dist/ui/placeholder/Placeholder.svelte +3 -4
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -1
- package/dist/ui/placeholder/PlaceholderImage.svelte +4 -6
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -1
- package/dist/ui/range/RangePicker.svelte +62 -75
- package/dist/ui/range/RangePicker.svelte.d.ts +2 -2
- package/dist/ui/range/RangePickerButton.svelte +35 -43
- package/dist/ui/slot/Slot.svelte +25 -42
- package/dist/ui/slot/Span.svelte +1 -2
- package/dist/ui/table/Table.svelte +28 -35
- package/dist/ui/table/TableBody.svelte +12 -18
- package/dist/ui/table/TableCell.svelte +10 -13
- package/dist/ui/table/TableFieldsEdition.svelte +51 -57
- package/dist/ui/table/TableHead.svelte +20 -19
- package/dist/ui/table/TableViewSelect.svelte +37 -50
- package/dist/ui/table/cell/TableCellArray.svelte +3 -5
- package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
- package/dist/ui/table/cell/TableCellNumber.svelte +1 -2
- package/dist/ui/table/cell/TableCellString.svelte +2 -5
- package/dist/ui/table/head/OrderButtons.svelte +37 -0
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +20 -0
- package/dist/ui/table/head/TableHeadBoolean.svelte +3 -6
- package/dist/ui/table/head/TableHeadDate.svelte +110 -61
- package/dist/ui/table/head/TableHeadDefault.svelte +2 -5
- package/dist/ui/table/head/TableHeadNumber.svelte +76 -67
- package/dist/ui/table/head/TableHeadSelect.svelte +41 -47
- package/dist/ui/table/head/TableHeadString.svelte +8 -14
- package/dist/ui/tabs/Tabs.svelte +5 -8
- package/dist/ui/tabs/TabsIcon.svelte +28 -31
- package/dist/validation/zod.d.ts +12 -0
- package/dist/validation/zod.js +4 -2
- package/package.json +1 -1
|
@@ -25,22 +25,6 @@ declare const __propDef: {
|
|
|
25
25
|
invalidateAll?: boolean | undefined;
|
|
26
26
|
state?: App.PageState | undefined;
|
|
27
27
|
} | undefined) => Promise<void>) | undefined;
|
|
28
|
-
children?: import("svelte").Snippet<[{
|
|
29
|
-
open: (value?: number, options?: {
|
|
30
|
-
replaceState?: boolean | undefined;
|
|
31
|
-
noScroll?: boolean | undefined;
|
|
32
|
-
keepFocus?: boolean | undefined;
|
|
33
|
-
invalidateAll?: boolean | undefined;
|
|
34
|
-
state?: App.PageState | undefined;
|
|
35
|
-
} | undefined) => Promise<void>;
|
|
36
|
-
close: (options?: {
|
|
37
|
-
replaceState?: boolean | undefined;
|
|
38
|
-
noScroll?: boolean | undefined;
|
|
39
|
-
keepFocus?: boolean | undefined;
|
|
40
|
-
invalidateAll?: boolean | undefined;
|
|
41
|
-
state?: App.PageState | undefined;
|
|
42
|
-
} | undefined) => Promise<void>;
|
|
43
|
-
}]> | undefined;
|
|
44
28
|
};
|
|
45
29
|
events: {
|
|
46
30
|
[evt: string]: CustomEvent<any>;
|
package/dist/ui/form/Form.svelte
CHANGED
|
@@ -1,110 +1,92 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import type { z } from 'zod'
|
|
3
|
-
import type { FormDataInput } from './form.js'
|
|
4
|
-
</script>
|
|
1
|
+
<script context="module"></script>
|
|
5
2
|
|
|
6
3
|
<script
|
|
7
|
-
|
|
4
|
+
|
|
8
5
|
generics="
|
|
9
6
|
Shape extends z.ZodRawShape,
|
|
10
7
|
ReturnData extends Record<string, unknown> = FormDataInput<Shape>,
|
|
11
8
|
Data extends FormDataInput<Shape> = FormDataInput<Shape>
|
|
12
9
|
"
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (value && key in data) data[key] = value
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const actionPadding = getActionPadding()
|
|
98
|
-
function getActionPadding(): string {
|
|
99
|
-
const container = contextContainer.get()
|
|
100
|
-
if (container === 'drawer') return 'bottom-0 -ml-8 -mr-4 pl-8 pr-4'
|
|
101
|
-
if (container === 'card') return 'bottom-0 -mx-2 sm:-mx-8 px-2 sm:px-8'
|
|
102
|
-
if (container === 'dialog') return '-bottom-4 -mx-4 px-4'
|
|
103
|
-
return 'bottom-0'
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const getBoolean = (bool?: BoolOrFunction<Shape>) => (_data: Nullable<Data>) =>
|
|
107
|
-
typeof bool === 'boolean' || bool === undefined ? !!bool : !!bool(_data)
|
|
10
|
+
>import { createEventDispatcher, onMount } from "svelte";
|
|
11
|
+
import { fade } from "svelte/transition";
|
|
12
|
+
import { page } from "$app/stores";
|
|
13
|
+
import { contextContainer } from "../context.js";
|
|
14
|
+
import {
|
|
15
|
+
initData,
|
|
16
|
+
getFieldType,
|
|
17
|
+
useHandleInput
|
|
18
|
+
} from "./form.js";
|
|
19
|
+
import ButtonDelete from "../button/ButtonDelete.svelte";
|
|
20
|
+
import { useForm } from "../../validation/form.js";
|
|
21
|
+
import FormInput from "./FormInput.svelte";
|
|
22
|
+
import FormSection from "./FormSection.svelte";
|
|
23
|
+
let klass = "";
|
|
24
|
+
export { klass as class };
|
|
25
|
+
export let classSection = "";
|
|
26
|
+
export let classAction = "";
|
|
27
|
+
export let model = void 0;
|
|
28
|
+
export let fields = [];
|
|
29
|
+
export let sections = [{}];
|
|
30
|
+
export let action = "";
|
|
31
|
+
export let actionCreate = "_create";
|
|
32
|
+
export let actionDelete = "_delete";
|
|
33
|
+
export let actionUpdate = "_update";
|
|
34
|
+
export let simpleAction = false;
|
|
35
|
+
export let options = {};
|
|
36
|
+
let dataInput = initData(fields);
|
|
37
|
+
export { dataInput as data };
|
|
38
|
+
let data = dataInput;
|
|
39
|
+
export function set(key, value) {
|
|
40
|
+
isDirty.set(true);
|
|
41
|
+
data[key] = value;
|
|
42
|
+
}
|
|
43
|
+
export function update(updater) {
|
|
44
|
+
isDirty.set(true);
|
|
45
|
+
data = updater(data);
|
|
46
|
+
}
|
|
47
|
+
const dispatch = createEventDispatcher();
|
|
48
|
+
const { enhance, setError } = useForm({
|
|
49
|
+
...options,
|
|
50
|
+
async onSuccess(url, data2) {
|
|
51
|
+
if (options.onSuccess)
|
|
52
|
+
await options.onSuccess(url, data2);
|
|
53
|
+
dispatch("success", { action: url, data: data2 });
|
|
54
|
+
const actionPath = url.pathname + url.search;
|
|
55
|
+
if (actionPath.includes(action + actionDelete))
|
|
56
|
+
dispatch("deleted");
|
|
57
|
+
if (!data2)
|
|
58
|
+
return;
|
|
59
|
+
if (actionPath.includes(action + actionCreate))
|
|
60
|
+
dispatch("created", data2);
|
|
61
|
+
if (actionPath.includes(action + actionUpdate))
|
|
62
|
+
dispatch("updated", data2);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const { handleInput, isDirty } = useHandleInput({ model, setError });
|
|
66
|
+
onMount(lookupValueFromParams);
|
|
67
|
+
$:
|
|
68
|
+
$isDirty ? dataInput = data : data = dataInput;
|
|
69
|
+
function lookupValueFromParams() {
|
|
70
|
+
fields.flat().forEach(({ key }) => {
|
|
71
|
+
if (data[key])
|
|
72
|
+
return;
|
|
73
|
+
const value = $page.url.searchParams.get(key);
|
|
74
|
+
if (value && key in data)
|
|
75
|
+
data[key] = value;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const actionPadding = getActionPadding();
|
|
79
|
+
function getActionPadding() {
|
|
80
|
+
const container = contextContainer.get();
|
|
81
|
+
if (container === "drawer")
|
|
82
|
+
return "bottom-0 -ml-8 -mr-4 pl-8 pr-4";
|
|
83
|
+
if (container === "card")
|
|
84
|
+
return "bottom-0 -mx-2 sm:-mx-8 px-2 sm:px-8";
|
|
85
|
+
if (container === "dialog")
|
|
86
|
+
return "-bottom-4 -mx-4 px-4";
|
|
87
|
+
return "bottom-0";
|
|
88
|
+
}
|
|
89
|
+
const getBoolean = (bool) => (_data) => typeof bool === "boolean" || bool === void 0 ? !!bool : !!bool(_data);
|
|
108
90
|
</script>
|
|
109
91
|
|
|
110
92
|
<form
|
|
@@ -20,7 +20,6 @@ declare class __sveltets_Render<Shape extends z.ZodRawShape, ReturnData extends
|
|
|
20
20
|
data?: Nullable<Data> | undefined;
|
|
21
21
|
set?: (<K extends keyof Shape>(key: K, value: Nullable<Data>[K]) => void) | undefined;
|
|
22
22
|
update?: ((updater: (currentData: Nullable<Data>) => Nullable<Data>) => void) | undefined;
|
|
23
|
-
children?: import("svelte").Snippet<[]> | undefined;
|
|
24
23
|
};
|
|
25
24
|
events(): {
|
|
26
25
|
success: CustomEvent<{
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let inputType: InputType
|
|
10
|
-
export { inputType as type }
|
|
11
|
-
export let value: FormInputProps<InputType>['value']
|
|
12
|
-
$: component = formInputs[inputType] as any
|
|
1
|
+
<script generics="InputType extends FormInputsType">import { formInputs } from "./formInput.js";
|
|
2
|
+
let inputType;
|
|
3
|
+
export { inputType as type };
|
|
4
|
+
export let value;
|
|
5
|
+
$:
|
|
6
|
+
component = formInputs[inputType];
|
|
13
7
|
</script>
|
|
14
8
|
|
|
15
9
|
<svelte:component this={component} bind:value {...$$restProps} />
|
|
@@ -39,7 +39,6 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
39
39
|
hide?: (() => void) | undefined;
|
|
40
40
|
show?: (() => void) | undefined;
|
|
41
41
|
setTippyProps?: ((props: Partial<import("tippy.js").Props>) => void) | undefined;
|
|
42
|
-
children?: import("svelte").Snippet<[]> | undefined;
|
|
43
42
|
} | undefined;
|
|
44
43
|
flatMode?: boolean | undefined;
|
|
45
44
|
slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
@@ -49,10 +48,6 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
49
48
|
classList?: string | undefined;
|
|
50
49
|
clear?: (() => Promise<void>) | undefined;
|
|
51
50
|
}>): import("../index.js").InputRelation<any>;
|
|
52
|
-
element?: {
|
|
53
|
-
new (): HTMLElement;
|
|
54
|
-
prototype: HTMLElement;
|
|
55
|
-
} | undefined;
|
|
56
51
|
};
|
|
57
52
|
readonly relations: {
|
|
58
53
|
new (options: import("svelte").ComponentConstructorOptions<{
|
|
@@ -72,10 +67,6 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
72
67
|
classList?: string | undefined;
|
|
73
68
|
value?: any[] | null | undefined;
|
|
74
69
|
}>): import("../index.js").InputRelations<any>;
|
|
75
|
-
element?: {
|
|
76
|
-
new (): HTMLElement;
|
|
77
|
-
prototype: HTMLElement;
|
|
78
|
-
} | undefined;
|
|
79
70
|
};
|
|
80
71
|
}[InputType]>> & {
|
|
81
72
|
type: InputType;
|
|
@@ -117,7 +108,6 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
117
108
|
hide?: (() => void) | undefined;
|
|
118
109
|
show?: (() => void) | undefined;
|
|
119
110
|
setTippyProps?: ((props: Partial<import("tippy.js").Props>) => void) | undefined;
|
|
120
|
-
children?: import("svelte").Snippet<[]> | undefined;
|
|
121
111
|
} | undefined;
|
|
122
112
|
flatMode?: boolean | undefined;
|
|
123
113
|
slotItem?: ((item: any) => string | import("../../index.js").ComponentAndProps) | null | undefined;
|
|
@@ -127,10 +117,6 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
127
117
|
classList?: string | undefined;
|
|
128
118
|
clear?: (() => Promise<void>) | undefined;
|
|
129
119
|
}>): import("../index.js").InputRelation<any>;
|
|
130
|
-
element?: {
|
|
131
|
-
new (): HTMLElement;
|
|
132
|
-
prototype: HTMLElement;
|
|
133
|
-
} | undefined;
|
|
134
120
|
};
|
|
135
121
|
readonly relations: {
|
|
136
122
|
new (options: import("svelte").ComponentConstructorOptions<{
|
|
@@ -150,10 +136,6 @@ declare class __sveltets_Render<InputType extends FormInputsType> {
|
|
|
150
136
|
classList?: string | undefined;
|
|
151
137
|
value?: any[] | null | undefined;
|
|
152
138
|
}>): import("../index.js").InputRelations<any>;
|
|
153
|
-
element?: {
|
|
154
|
-
new (): HTMLElement;
|
|
155
|
-
prototype: HTMLElement;
|
|
156
|
-
} | undefined;
|
|
157
139
|
};
|
|
158
140
|
}[InputType]>>["value"];
|
|
159
141
|
};
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function open() {
|
|
18
|
-
isActive = true
|
|
19
|
-
}
|
|
20
|
-
function toggle(event: Event) {
|
|
21
|
-
event.stopPropagation()
|
|
22
|
-
isActive = !isActive
|
|
23
|
-
}
|
|
1
|
+
<script>import { slide } from "svelte/transition";
|
|
2
|
+
import { mdiChevronRight } from "@mdi/js";
|
|
3
|
+
import { Icon } from "../icon/index.js";
|
|
4
|
+
export let title = "";
|
|
5
|
+
export let isActive = false;
|
|
6
|
+
export let isReducible = false;
|
|
7
|
+
let klass = "";
|
|
8
|
+
export { klass as class };
|
|
9
|
+
export let contentClass = "";
|
|
10
|
+
function open() {
|
|
11
|
+
isActive = true;
|
|
12
|
+
}
|
|
13
|
+
function toggle(event) {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
isActive = !isActive;
|
|
16
|
+
}
|
|
24
17
|
</script>
|
|
25
18
|
|
|
26
19
|
<div>
|
|
@@ -60,7 +60,6 @@ export declare function relationProps<Item extends {
|
|
|
60
60
|
hide?: (() => void) | undefined;
|
|
61
61
|
show?: (() => void) | undefined;
|
|
62
62
|
setTippyProps?: ((props: Partial<import("tippy.js").Props>) => void) | undefined;
|
|
63
|
-
children?: import("svelte").Snippet<[]> | undefined;
|
|
64
63
|
} | undefined;
|
|
65
64
|
flatMode?: boolean | undefined;
|
|
66
65
|
slotItem?: ((item: Item) => string | import("../..").ComponentAndProps) | null | undefined;
|
package/dist/ui/icon/Icon.svelte
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
tip?.destroy()
|
|
34
|
-
}
|
|
35
|
-
})
|
|
1
|
+
<script>import { tippy } from "../../utils/tippy.js";
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
export let path;
|
|
4
|
+
export let title = "";
|
|
5
|
+
export let size = 22;
|
|
6
|
+
let klass = "";
|
|
7
|
+
export { klass as class };
|
|
8
|
+
export let style = "";
|
|
9
|
+
export let classSVG = "";
|
|
10
|
+
export let tippyProps = {};
|
|
11
|
+
export let disableTitlePropagation = false;
|
|
12
|
+
const viewWidth = 24;
|
|
13
|
+
const viewHeight = 24;
|
|
14
|
+
let icon;
|
|
15
|
+
let tip = null;
|
|
16
|
+
$:
|
|
17
|
+
tip?.setContent(title);
|
|
18
|
+
onMount(() => {
|
|
19
|
+
if (!title)
|
|
20
|
+
return;
|
|
21
|
+
const parent = icon.parentElement;
|
|
22
|
+
const isButton = parent?.tagName === "BUTTON" || parent?.tagName === "A";
|
|
23
|
+
const target = parent && isButton && !disableTitlePropagation ? parent : icon;
|
|
24
|
+
tip = tippy(target || icon, {
|
|
25
|
+
content: title,
|
|
26
|
+
trigger: "mouseenter",
|
|
27
|
+
...tippyProps
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
tip?.destroy();
|
|
31
|
+
};
|
|
32
|
+
});
|
|
36
33
|
</script>
|
|
37
34
|
|
|
38
35
|
<i bind:this={icon} class="grid place-content-center fill-base-content {klass}" {style}>
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const handleInput = () => (error = '')
|
|
34
|
-
input.addEventListener('input', handleInput)
|
|
35
|
-
return () => {
|
|
36
|
-
input.removeEventListener('input', handleInput)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
1
|
+
<script>import { slide } from "svelte/transition";
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
import { formContext } from "../../validation/form.js";
|
|
4
|
+
import { Slot } from "../index.js";
|
|
5
|
+
let klass = "";
|
|
6
|
+
export { klass as class };
|
|
7
|
+
export let classLabel = "";
|
|
8
|
+
export let key = "";
|
|
9
|
+
export let label = "";
|
|
10
|
+
export let error = "";
|
|
11
|
+
export let hint = "";
|
|
12
|
+
export let prefix = "";
|
|
13
|
+
export let prefixFor = "";
|
|
14
|
+
export let enhanceDisabled = false;
|
|
15
|
+
export let labelPosition = "top";
|
|
16
|
+
$:
|
|
17
|
+
_key = prefix && key ? `${prefix}_${key}` : key || "";
|
|
18
|
+
if (!enhanceDisabled) {
|
|
19
|
+
const { setError } = formContext.get();
|
|
20
|
+
setError[key] = (err) => error = err;
|
|
21
|
+
}
|
|
22
|
+
let formControl;
|
|
23
|
+
onMount(() => {
|
|
24
|
+
const input = formControl.querySelector("input, textarea");
|
|
25
|
+
if (!input)
|
|
26
|
+
return;
|
|
27
|
+
const handleInput = () => error = "";
|
|
28
|
+
input.addEventListener("input", handleInput);
|
|
29
|
+
return () => {
|
|
30
|
+
input.removeEventListener("input", handleInput);
|
|
31
|
+
};
|
|
32
|
+
});
|
|
39
33
|
</script>
|
|
40
34
|
|
|
41
35
|
<div class="form-control {klass}" bind:this={formControl}>
|
|
@@ -13,9 +13,6 @@ declare const __propDef: {
|
|
|
13
13
|
prefixFor?: string | number | undefined;
|
|
14
14
|
enhanceDisabled?: boolean | undefined;
|
|
15
15
|
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
16
|
-
children?: import("svelte").Snippet<[{
|
|
17
|
-
key: string;
|
|
18
|
-
}]> | undefined;
|
|
19
16
|
};
|
|
20
17
|
events: {
|
|
21
18
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export let input: HTMLInputAttributes = {}
|
|
10
|
-
export let inputElement: HTMLInputElement | undefined = undefined
|
|
11
|
-
export let bindWithParams: boolean = false
|
|
12
|
-
|
|
13
|
-
const dispatch = createEventDispatcher<{ change: boolean }>()
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { FormControl, bindCheckedWithParams } from "./index.js";
|
|
3
|
+
import { USE_COERCE_BOOLEAN } from "../../utils/constant.js";
|
|
4
|
+
export let value = false;
|
|
5
|
+
export let input = {};
|
|
6
|
+
export let inputElement = void 0;
|
|
7
|
+
export let bindWithParams = false;
|
|
8
|
+
const dispatch = createEventDispatcher();
|
|
14
9
|
</script>
|
|
15
10
|
|
|
16
11
|
<FormControl {...$$restProps} let:key class="">
|
|
@@ -12,9 +12,6 @@ declare const __propDef: {
|
|
|
12
12
|
prefixFor?: string | number | undefined;
|
|
13
13
|
enhanceDisabled?: boolean | undefined;
|
|
14
14
|
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
15
|
-
children?: import("svelte").Snippet<[{
|
|
16
|
-
key: string;
|
|
17
|
-
}]> | undefined;
|
|
18
15
|
} & {
|
|
19
16
|
input?: HTMLInputAttributes | undefined;
|
|
20
17
|
inputElement?: HTMLInputElement | undefined;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
$: _options = parseOptions(options)
|
|
1
|
+
<script>import { slide } from "svelte/transition";
|
|
2
|
+
import { FormControl } from "./index.js";
|
|
3
|
+
import { parseOptions } from "../../utils/options.js";
|
|
4
|
+
$:
|
|
5
|
+
({
|
|
6
|
+
input,
|
|
7
|
+
value: _value,
|
|
8
|
+
options: _1,
|
|
9
|
+
class: klass,
|
|
10
|
+
checkboxesClass,
|
|
11
|
+
hint,
|
|
12
|
+
error,
|
|
13
|
+
...props
|
|
14
|
+
} = $$props);
|
|
15
|
+
export let value = _value || [];
|
|
16
|
+
export let options;
|
|
17
|
+
if (!value)
|
|
18
|
+
value = [];
|
|
19
|
+
$:
|
|
20
|
+
_options = parseOptions(options);
|
|
23
21
|
</script>
|
|
24
22
|
|
|
25
23
|
<div class={klass}>
|
|
@@ -12,9 +12,6 @@ declare const __propDef: {
|
|
|
12
12
|
prefixFor?: string | number | undefined;
|
|
13
13
|
enhanceDisabled?: boolean | undefined;
|
|
14
14
|
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
15
|
-
children?: import("svelte").Snippet<[{
|
|
16
|
-
key: string;
|
|
17
|
-
}]> | undefined;
|
|
18
15
|
} & {
|
|
19
16
|
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
20
17
|
inputElement?: HTMLInputElement | undefined;
|