fuma 1.0.21 → 2.0.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/README.md +1 -1
- package/dist/action/list/handlers.d.ts +2 -2
- package/dist/action/list/index.d.ts +2 -0
- package/dist/action/list/index.js +1 -0
- package/dist/action/list/trigger.d.ts +7 -1
- package/dist/action/list/trigger.js +2 -2
- package/dist/private/Meta.svelte +32 -27
- package/dist/private/Meta.svelte.d.ts +29 -17
- package/dist/private/api.d.ts +1 -1
- package/dist/private/store.d.ts +0 -1
- package/dist/server/parseFormData.d.ts +1 -1
- package/dist/server/parseQuery.d.ts +1 -1
- package/dist/server/sse.d.ts +0 -1
- package/dist/store/isSmallScreen.d.ts +0 -1
- package/dist/store/param.d.ts +0 -2
- package/dist/store/session.d.ts +0 -1
- package/dist/ui/badge/Badge.svelte +4 -3
- package/dist/ui/badge/Badge.svelte.d.ts +19 -15
- package/dist/ui/button/ButtonCopy.svelte +35 -32
- package/dist/ui/button/ButtonCopy.svelte.d.ts +23 -21
- package/dist/ui/button/ButtonDelete.svelte +23 -21
- package/dist/ui/button/ButtonDelete.svelte.d.ts +32 -20
- package/dist/ui/card/Card.svelte +13 -10
- package/dist/ui/card/Card.svelte.d.ts +39 -24
- package/dist/ui/card/CardBasic.svelte +5 -4
- package/dist/ui/card/CardBasic.svelte.d.ts +29 -18
- package/dist/ui/card/CardCollapse.svelte +35 -31
- package/dist/ui/card/CardCollapse.svelte.d.ts +37 -23
- package/dist/ui/card/CardFullScreen.svelte +8 -6
- package/dist/ui/card/CardFullScreen.svelte.d.ts +35 -20
- package/dist/ui/card/CardLink.svelte +5 -4
- package/dist/ui/card/CardLink.svelte.d.ts +29 -18
- package/dist/ui/dialog/Dialog.svelte +41 -34
- package/dist/ui/dialog/Dialog.svelte.d.ts +36 -23
- package/dist/ui/dialog/DialogConfirm.svelte +6 -4
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +33 -19
- package/dist/ui/drawer/Drawer.svelte +47 -38
- package/dist/ui/drawer/Drawer.svelte.d.ts +81 -46
- package/dist/ui/drawer/drawerFly.d.ts +0 -1
- package/dist/ui/drawer/layers.d.ts +0 -1
- package/dist/ui/form/Form.svelte +106 -87
- package/dist/ui/form/Form.svelte.d.ts +29 -16
- package/dist/ui/form/FormInput.svelte +12 -6
- package/dist/ui/form/FormSection.svelte +24 -17
- package/dist/ui/form/FormSection.svelte.d.ts +37 -25
- package/dist/ui/icon/Icon.svelte +35 -32
- package/dist/ui/icon/Icon.svelte.d.ts +25 -21
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/input/FormControl.svelte +48 -36
- package/dist/ui/input/FormControl.svelte.d.ts +32 -30
- package/dist/ui/input/InputBoolean.svelte +29 -22
- package/dist/ui/input/InputBoolean.svelte.d.ts +43 -35
- package/dist/ui/input/InputCheckboxs.svelte +37 -34
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +54 -39
- package/dist/ui/input/InputCheckboxsMenu.svelte +64 -47
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +56 -41
- package/dist/ui/input/InputCheckboxsTree.svelte +9 -6
- package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +22 -18
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +36 -28
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +20 -16
- package/dist/ui/input/InputCombo.svelte +76 -65
- package/dist/ui/input/InputCombo.svelte.d.ts +55 -39
- package/dist/ui/input/InputDate.svelte +36 -29
- package/dist/ui/input/InputDate.svelte.d.ts +20 -16
- package/dist/ui/input/InputDateTime.svelte +37 -30
- package/dist/ui/input/InputDateTime.svelte.d.ts +20 -16
- package/dist/ui/input/InputImage.svelte +52 -45
- package/dist/ui/input/InputImage.svelte.d.ts +40 -27
- package/dist/ui/input/InputImagePreview.svelte +24 -20
- package/dist/ui/input/InputImagePreview.svelte.d.ts +25 -21
- package/dist/ui/input/InputNumber.svelte +28 -22
- package/dist/ui/input/InputNumber.svelte.d.ts +20 -20
- package/dist/ui/input/InputOptionInParam.svelte +12 -10
- package/dist/ui/input/InputOptionInParam.svelte.d.ts +21 -17
- package/dist/ui/input/InputOptions.svelte +40 -34
- package/dist/ui/input/InputOptions.svelte.d.ts +19 -15
- package/dist/ui/input/InputPassword.svelte +22 -18
- package/dist/ui/input/InputPassword.svelte.d.ts +43 -35
- package/dist/ui/input/InputRadio.svelte +51 -46
- package/dist/ui/input/InputRadio.svelte.d.ts +53 -38
- package/dist/ui/input/InputRelation.svelte +129 -112
- package/dist/ui/input/InputRelation.svelte.d.ts +39 -53
- package/dist/ui/input/InputRelations.svelte +96 -90
- package/dist/ui/input/InputRelations.svelte.d.ts +35 -37
- package/dist/ui/input/InputSearch.svelte +14 -11
- package/dist/ui/input/InputSearch.svelte.d.ts +25 -21
- package/dist/ui/input/InputSelect.svelte +59 -46
- package/dist/ui/input/InputSelect.svelte.d.ts +23 -19
- package/dist/ui/input/InputText.svelte +29 -28
- package/dist/ui/input/InputText.svelte.d.ts +41 -28
- package/dist/ui/input/InputTextarea.svelte +20 -19
- package/dist/ui/input/InputTextarea.svelte.d.ts +20 -20
- package/dist/ui/input/InputTime.svelte +43 -36
- package/dist/ui/input/InputTime.svelte.d.ts +21 -36
- package/dist/ui/input/RelationAfter.svelte +13 -9
- package/dist/ui/input/RelationAfter.svelte.d.ts +24 -20
- package/dist/ui/input/SelectorList.svelte +16 -12
- package/dist/ui/input/SelectorList.svelte.d.ts +29 -20
- package/dist/ui/input/textRich/InputTextRich.svelte +63 -59
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +36 -38
- package/dist/ui/input/textRich/SuggesionList.svelte +13 -9
- package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +19 -15
- package/dist/ui/input/textRich/ToolMark.svelte +12 -9
- package/dist/ui/input/textRich/ToolMark.svelte.d.ts +22 -18
- package/dist/ui/input/textRich/ToolMarkColor.svelte +16 -12
- package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +21 -17
- package/dist/ui/input/textRich/ToolMarkLink.svelte +46 -38
- package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolMenu.svelte +34 -19
- package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +30 -26
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +13 -9
- package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +12 -7
- package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +20 -16
- package/dist/ui/input/textRich/ToolMenuNode.svelte +14 -10
- package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolsBar.svelte +21 -14
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +19 -17
- package/dist/ui/input/textRich/suggestion.d.ts +0 -1
- package/dist/ui/login/Login.svelte +37 -31
- package/dist/ui/login/Login.svelte.d.ts +18 -14
- package/dist/ui/menu/ContextMenu.svelte +37 -31
- package/dist/ui/menu/ContextMenu.svelte.d.ts +38 -25
- package/dist/ui/menu/DropDown.svelte +92 -83
- package/dist/ui/menu/DropDown.svelte.d.ts +46 -33
- package/dist/ui/menu/DropDownMenu.svelte +25 -18
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +30 -19
- package/dist/ui/mode/ToggleMode.svelte +28 -16
- package/dist/ui/mode/ToggleMode.svelte.d.ts +34 -17
- package/dist/ui/pagination/Pagination.svelte +9 -8
- package/dist/ui/pagination/Pagination.svelte.d.ts +18 -14
- package/dist/ui/placeholder/Placeholder.svelte +4 -3
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +28 -17
- package/dist/ui/placeholder/PlaceholderImage.svelte +6 -4
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +28 -17
- package/dist/ui/range/RangePicker.svelte +76 -63
- package/dist/ui/range/RangePicker.svelte.d.ts +29 -24
- package/dist/ui/range/RangePickerButton.svelte +45 -40
- package/dist/ui/range/RangePickerButton.svelte.d.ts +21 -19
- package/dist/ui/table/Table.svelte +35 -28
- package/dist/ui/table/Table.svelte.d.ts +24 -19
- package/dist/ui/table/TableBody.svelte +18 -12
- package/dist/ui/table/TableBody.svelte.d.ts +20 -15
- package/dist/ui/table/TableCell.svelte +13 -10
- package/dist/ui/table/TableCell.svelte.d.ts +19 -14
- package/dist/ui/table/TableFieldsEdition.svelte +58 -52
- package/dist/ui/table/TableFieldsEdition.svelte.d.ts +20 -15
- package/dist/ui/table/TableHead.svelte +20 -21
- package/dist/ui/table/TableHead.svelte.d.ts +19 -14
- package/dist/ui/table/TableViewSelect.svelte +50 -37
- package/dist/ui/table/TableViewSelect.svelte.d.ts +27 -23
- package/dist/ui/table/cell/TableCellArray.svelte +5 -3
- package/dist/ui/table/cell/TableCellArray.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellBoolean.svelte +4 -3
- package/dist/ui/table/cell/TableCellBoolean.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellNumber.svelte +2 -1
- package/dist/ui/table/cell/TableCellNumber.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellString.svelte +5 -2
- package/dist/ui/table/cell/TableCellString.svelte.d.ts +19 -25
- package/dist/ui/table/field.d.ts +32 -40
- package/dist/ui/table/field.js +1 -1
- package/dist/ui/table/head/TableHeadBoolean.svelte +6 -3
- package/dist/ui/table/head/TableHeadBoolean.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadDate.svelte +61 -113
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadDefault.svelte +5 -2
- package/dist/ui/table/head/TableHeadDefault.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadNumber.svelte +67 -76
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadSelect.svelte +47 -41
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +21 -27
- package/dist/ui/table/head/TableHeadString.svelte +14 -8
- package/dist/ui/table/head/TableHeadString.svelte.d.ts +18 -24
- package/dist/ui/tabs/Tabs.svelte +8 -5
- package/dist/ui/tabs/Tabs.svelte.d.ts +19 -15
- package/dist/ui/tabs/TabsIcon.svelte +31 -28
- package/dist/ui/tabs/TabsIcon.svelte.d.ts +21 -17
- package/dist/utils/eventEmitter.d.ts +4 -4
- package/dist/utils/tippy.d.ts +1 -1
- package/dist/validation/form.d.ts +0 -1
- package/dist/validation/zod.d.ts +96 -162
- package/dist/validation/zod.js +2 -4
- package/package.json +134 -138
- package/dist/ui/form/FormInput.svelte.d.ts +0 -152
- package/dist/ui/form/formInput.d.ts +0 -90
- package/dist/ui/slot/Slot.svelte +0 -35
- package/dist/ui/slot/Slot.svelte.d.ts +0 -22
- package/dist/ui/slot/Span.svelte +0 -4
- package/dist/ui/slot/Span.svelte.d.ts +0 -16
- package/dist/ui/slot/index.d.ts +0 -1
- package/dist/ui/slot/index.js +0 -1
- package/dist/ui/table/head/OrderButtons.svelte +0 -37
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +0 -20
- package/dist/ui/table/head/index.d.ts +0 -19
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
-
import type
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
4
3
|
declare class __sveltets_Render<RelationItem extends {
|
|
5
|
-
id: string;
|
|
4
|
+
id: string | number;
|
|
6
5
|
}> {
|
|
7
6
|
props(): {
|
|
8
|
-
key?: string
|
|
9
|
-
label?: string
|
|
7
|
+
key?: string;
|
|
8
|
+
label?: string;
|
|
10
9
|
search: (q: string) => Promise<RelationItem[]>;
|
|
11
|
-
createUrl?: string
|
|
12
|
-
createTitle?: string
|
|
10
|
+
createUrl?: string;
|
|
11
|
+
createTitle?: string;
|
|
13
12
|
createIcon?: string | undefined;
|
|
14
|
-
error?: string
|
|
15
|
-
placeholder?: string
|
|
16
|
-
flatMode?: boolean
|
|
17
|
-
slotItem
|
|
18
|
-
slotSuggestion?:
|
|
13
|
+
error?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
flatMode?: boolean;
|
|
16
|
+
slotItem: Snippet<[RelationItem]>;
|
|
17
|
+
slotSuggestion?: Snippet<[RelationItem]> | undefined;
|
|
19
18
|
input?: HTMLInputAttributes | undefined;
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
append?: Snippet | undefined;
|
|
20
|
+
class?: string;
|
|
21
|
+
classList?: string;
|
|
22
22
|
value?: RelationItem[] | null | undefined;
|
|
23
23
|
};
|
|
24
24
|
events(): {
|
|
25
25
|
input: CustomEvent<{
|
|
26
|
-
value: string[];
|
|
26
|
+
value: (string | number)[];
|
|
27
27
|
items: RelationItem[];
|
|
28
28
|
}>;
|
|
29
29
|
} & {
|
|
30
30
|
[evt: string]: CustomEvent<any>;
|
|
31
31
|
};
|
|
32
|
-
slots(): {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
append: {};
|
|
37
|
-
suggestion: {
|
|
38
|
-
item: RelationItem;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
32
|
+
slots(): {};
|
|
33
|
+
bindings(): string;
|
|
34
|
+
exports(): {};
|
|
41
35
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
interface $$IsomorphicComponent {
|
|
37
|
+
new <RelationItem extends {
|
|
38
|
+
id: string | number;
|
|
39
|
+
}>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<RelationItem>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<RelationItem>['props']>, ReturnType<__sveltets_Render<RelationItem>['events']>, ReturnType<__sveltets_Render<RelationItem>['slots']>> & {
|
|
40
|
+
$$bindings?: ReturnType<__sveltets_Render<RelationItem>['bindings']>;
|
|
41
|
+
} & ReturnType<__sveltets_Render<RelationItem>['exports']>;
|
|
42
|
+
<RelationItem extends {
|
|
43
|
+
id: string | number;
|
|
44
|
+
}>(internal: unknown, props: ReturnType<__sveltets_Render<RelationItem>['props']> & {
|
|
45
|
+
$$events?: ReturnType<__sveltets_Render<RelationItem>['events']>;
|
|
46
|
+
}): ReturnType<__sveltets_Render<RelationItem>['exports']>;
|
|
47
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
54
48
|
}
|
|
55
|
-
|
|
49
|
+
declare const InputRelations: $$IsomorphicComponent;
|
|
50
|
+
type InputRelations<RelationItem extends {
|
|
51
|
+
id: string | number;
|
|
52
|
+
}> = InstanceType<typeof InputRelations<RelationItem>>;
|
|
53
|
+
export default InputRelations;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
let
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiClose } from '@mdi/js'
|
|
3
|
+
import { browser } from '$app/environment'
|
|
4
|
+
import { page } from '$app/stores'
|
|
5
|
+
import { Icon } from '../icon/index.js'
|
|
6
|
+
import { InputText } from './index.js'
|
|
7
|
+
|
|
8
|
+
let klass = ''
|
|
9
|
+
export { klass as class }
|
|
10
|
+
export let key = 'search'
|
|
11
|
+
export let value = $page.url.searchParams.get(key) || ''
|
|
12
|
+
|
|
13
|
+
let inputElement: HTMLInputElement
|
|
11
14
|
</script>
|
|
12
15
|
|
|
13
16
|
<InputText
|
|
@@ -23,7 +26,7 @@ let inputElement;
|
|
|
23
26
|
input={{
|
|
24
27
|
class: 'input-sm pr-8',
|
|
25
28
|
placeholder: 'Recherche',
|
|
26
|
-
autocomplete: '
|
|
29
|
+
autocomplete: 'off',
|
|
27
30
|
inputmode: 'search'
|
|
28
31
|
}}
|
|
29
32
|
classWrapper="relative {klass}"
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
7
11
|
};
|
|
8
|
-
|
|
9
|
-
blur: FocusEvent;
|
|
10
|
-
input: Event;
|
|
11
|
-
keydown: KeyboardEvent;
|
|
12
|
-
keyup: KeyboardEvent;
|
|
13
|
-
} & {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {};
|
|
17
|
-
};
|
|
18
|
-
export type InputSearchProps = typeof __propDef.props;
|
|
19
|
-
export type InputSearchEvents = typeof __propDef.events;
|
|
20
|
-
export type InputSearchSlots = typeof __propDef.slots;
|
|
21
|
-
export default class InputSearch extends SvelteComponent<InputSearchProps, InputSearchEvents, InputSearchSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
22
13
|
}
|
|
23
|
-
|
|
14
|
+
declare const InputSearch: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
class?: string;
|
|
16
|
+
key?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
}, {
|
|
19
|
+
blur: FocusEvent;
|
|
20
|
+
input: Event;
|
|
21
|
+
keydown: KeyboardEvent;
|
|
22
|
+
keyup: KeyboardEvent;
|
|
23
|
+
} & {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {}, {}, string>;
|
|
26
|
+
type InputSearch = InstanceType<typeof InputSearch>;
|
|
27
|
+
export default InputSearch;
|
|
@@ -1,55 +1,68 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher, onMount } from 'svelte'
|
|
3
|
+
import { mdiUnfoldMoreHorizontal } from '@mdi/js'
|
|
4
|
+
|
|
5
|
+
import { Icon } from '../icon/index.js'
|
|
6
|
+
import { DropDown } from '../menu/index.js'
|
|
7
|
+
import { SelectorList, FormControl, type InputProps } from './index.js'
|
|
8
|
+
|
|
9
|
+
import { type Options, parseOptions } from '../../utils/options.js'
|
|
10
|
+
import type { TippyProps } from '../../utils/tippy.js'
|
|
11
|
+
|
|
12
|
+
type $$Props = Omit<InputProps, 'input' | 'inputElement'> & {
|
|
13
|
+
options: Options
|
|
14
|
+
tippyProps?: TippyProps
|
|
15
|
+
placeholder?: string
|
|
16
|
+
}
|
|
17
|
+
$: ({ value: _value, options, tippyProps, placeholder, ...props } = $$props as $$Props)
|
|
18
|
+
export let value = _value
|
|
19
|
+
|
|
20
|
+
$: _options = parseOptions(options)
|
|
21
|
+
$: selectedOption = _options.find((opt) => opt.value === value)
|
|
22
|
+
|
|
23
|
+
let dropDown: DropDown
|
|
24
|
+
let button: HTMLButtonElement
|
|
25
|
+
const dispatch = createEventDispatcher<{ input: string; select: string }>()
|
|
26
|
+
|
|
27
|
+
let focusIndex = 0
|
|
28
|
+
onMount(() => {
|
|
29
|
+
const index = _options.findIndex((opt) => opt.value === value)
|
|
30
|
+
focusIndex = index === -1 ? 0 : index
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
function onSelect(index: number) {
|
|
34
|
+
focusIndex = index
|
|
35
|
+
value = _options[index].value
|
|
36
|
+
dispatch('input', value)
|
|
37
|
+
dispatch('select', value)
|
|
38
|
+
dropDown.hide()
|
|
39
|
+
}
|
|
29
40
|
</script>
|
|
30
41
|
|
|
31
42
|
<DropDown bind:this={dropDown}>
|
|
32
43
|
<svelte:fragment slot="activator">
|
|
33
|
-
<FormControl {...props}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{#if selectedOption
|
|
42
|
-
|
|
44
|
+
<FormControl {...props}>
|
|
45
|
+
{#snippet children({ key })}
|
|
46
|
+
<button
|
|
47
|
+
bind:this={button}
|
|
48
|
+
id={key}
|
|
49
|
+
type="button"
|
|
50
|
+
class="input-bordered flex h-12 items-center gap-2 rounded-lg border pl-4 pr-2 hover:bg-base-200/50"
|
|
51
|
+
>
|
|
52
|
+
{#if selectedOption}
|
|
53
|
+
{#if selectedOption.icon}
|
|
54
|
+
<Icon path={selectedOption.icon} size={21} class="opacity-70" />
|
|
55
|
+
{/if}
|
|
56
|
+
<span>{selectedOption.label}</span>
|
|
57
|
+
{:else if placeholder}
|
|
58
|
+
<span class="opacity-60">{placeholder}</span>
|
|
43
59
|
{/if}
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
<Icon class="ml-auto" path={mdiUnfoldMoreHorizontal} size={18} />
|
|
61
|
+
</button>
|
|
62
|
+
{#if value !== undefined}
|
|
63
|
+
<input type="hidden" name={key} {value} />
|
|
47
64
|
{/if}
|
|
48
|
-
|
|
49
|
-
</button>
|
|
50
|
-
{#if value !== undefined}
|
|
51
|
-
<input type="hidden" name={key} {value} />
|
|
52
|
-
{/if}
|
|
65
|
+
{/snippet}
|
|
53
66
|
</FormControl>
|
|
54
67
|
</svelte:fragment>
|
|
55
68
|
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type InputProps } from './index.js';
|
|
3
2
|
import { type Options } from '../../utils/options.js';
|
|
4
3
|
import type { TippyProps } from '../../utils/tippy.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: Props & {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
10
14
|
};
|
|
11
|
-
|
|
12
|
-
input: CustomEvent<string>;
|
|
13
|
-
select: CustomEvent<string>;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
};
|
|
19
|
-
export type InputSelectProps = typeof __propDef.props;
|
|
20
|
-
export type InputSelectEvents = typeof __propDef.events;
|
|
21
|
-
export type InputSelectSlots = typeof __propDef.slots;
|
|
22
|
-
export default class InputSelect extends SvelteComponent<InputSelectProps, InputSelectEvents, InputSelectSlots> {
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
23
16
|
}
|
|
24
|
-
|
|
17
|
+
declare const InputSelect: $$__sveltets_2_IsomorphicComponent<Omit<InputProps, "input" | "inputElement"> & {
|
|
18
|
+
options: Options;
|
|
19
|
+
tippyProps?: TippyProps;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
}, {
|
|
22
|
+
input: CustomEvent<string>;
|
|
23
|
+
select: CustomEvent<string>;
|
|
24
|
+
} & {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {}, {}, string>;
|
|
27
|
+
type InputSelect = InstanceType<typeof InputSelect>;
|
|
28
|
+
export default InputSelect;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export let
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { FormControl, bindValueWithParams, type InputProps } from './index.js'
|
|
3
|
+
|
|
4
|
+
type $$Props = InputProps
|
|
5
|
+
$: ({ input, value: _value, classWrapper, bindWithParams, ...props } = $$props as $$Props)
|
|
6
|
+
$: ({ class: inputClass, ...inputProps } = input || {})
|
|
7
|
+
export let value = _value
|
|
8
|
+
export let inputElement: HTMLInputElement | undefined = undefined
|
|
8
9
|
</script>
|
|
9
10
|
|
|
10
11
|
<FormControl {...props} enhanceDisabled={props.enhanceDisabled || bindWithParams} let:key>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
12
|
+
{#snippet children({ key })}
|
|
13
|
+
<div class={classWrapper}>
|
|
14
|
+
<slot name="prepend" {value} />
|
|
15
|
+
<input
|
|
16
|
+
bind:value
|
|
17
|
+
on:input
|
|
18
|
+
on:focus
|
|
19
|
+
on:blur
|
|
20
|
+
on:keydown
|
|
21
|
+
on:keyup
|
|
22
|
+
bind:this={inputElement}
|
|
23
|
+
use:bindValueWithParams={{ bindEnable: bindWithParams, initValue: (v) => (value = v) }}
|
|
24
|
+
type="text"
|
|
25
|
+
name={key}
|
|
26
|
+
id={key}
|
|
27
|
+
class="input input-bordered w-full {inputClass || ''}"
|
|
28
|
+
{...inputProps}
|
|
29
|
+
/>
|
|
30
|
+
<slot name="append" {value} />
|
|
31
|
+
</div>
|
|
32
|
+
{/snippet}
|
|
32
33
|
</FormControl>
|
|
@@ -1,31 +1,44 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type InputProps } from './index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
label_append: {
|
|
16
|
-
slot: string;
|
|
17
|
-
};
|
|
18
|
-
prepend: {
|
|
19
|
-
value: string | null | undefined;
|
|
20
|
-
};
|
|
21
|
-
append: {
|
|
22
|
-
value: string | null | undefined;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export type InputTextProps = typeof __propDef.props;
|
|
27
|
-
export type InputTextEvents = typeof __propDef.events;
|
|
28
|
-
export type InputTextSlots = typeof __propDef.slots;
|
|
29
|
-
export default class InputText extends SvelteComponent<InputTextProps, InputTextEvents, InputTextSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
30
14
|
}
|
|
31
|
-
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const InputText: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<InputProps, {
|
|
21
|
+
prepend: {
|
|
22
|
+
value: string | null | undefined;
|
|
23
|
+
};
|
|
24
|
+
append: {
|
|
25
|
+
value: string | null | undefined;
|
|
26
|
+
};
|
|
27
|
+
}>, {
|
|
28
|
+
input: Event;
|
|
29
|
+
focus: FocusEvent;
|
|
30
|
+
blur: FocusEvent;
|
|
31
|
+
keydown: KeyboardEvent;
|
|
32
|
+
keyup: KeyboardEvent;
|
|
33
|
+
} & {
|
|
34
|
+
[evt: string]: CustomEvent<any>;
|
|
35
|
+
}, {
|
|
36
|
+
prepend: {
|
|
37
|
+
value: string | null | undefined;
|
|
38
|
+
};
|
|
39
|
+
append: {
|
|
40
|
+
value: string | null | undefined;
|
|
41
|
+
};
|
|
42
|
+
}, {}, string>;
|
|
43
|
+
type InputText = InstanceType<typeof InputText>;
|
|
44
|
+
export default InputText;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
$:
|
|
5
|
-
|
|
6
|
-
export let value = _value
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { FormControl, type TextareaProps } from './index.js'
|
|
3
|
+
type $$Props = TextareaProps
|
|
4
|
+
$: ({ textarea, value: _value, ...props } = $$props as $$Props)
|
|
5
|
+
$: ({ class: inputClass, ...inputProps } = textarea || {})
|
|
6
|
+
export let value = _value
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<FormControl {...props}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
<FormControl {...props}>
|
|
10
|
+
{#snippet children({ key })}
|
|
11
|
+
<textarea
|
|
12
|
+
bind:value
|
|
13
|
+
on:input
|
|
14
|
+
on:focus
|
|
15
|
+
on:blur
|
|
16
|
+
name={key}
|
|
17
|
+
id={key}
|
|
18
|
+
class="textarea textarea-bordered {inputClass || ''}"
|
|
19
|
+
rows="4"
|
|
20
|
+
{...inputProps}
|
|
21
|
+
></textarea>
|
|
22
|
+
{/snippet}
|
|
22
23
|
</FormControl>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type TextareaProps } from './index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
label_append: {
|
|
14
|
-
slot: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type InputTextareaProps = typeof __propDef.props;
|
|
19
|
-
export type InputTextareaEvents = typeof __propDef.events;
|
|
20
|
-
export type InputTextareaSlots = typeof __propDef.slots;
|
|
21
|
-
export default class InputTextarea extends SvelteComponent<InputTextareaProps, InputTextareaEvents, InputTextareaSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
22
14
|
}
|
|
23
|
-
|
|
15
|
+
declare const InputTextarea: $$__sveltets_2_IsomorphicComponent<TextareaProps, {
|
|
16
|
+
input: Event;
|
|
17
|
+
focus: FocusEvent;
|
|
18
|
+
blur: FocusEvent;
|
|
19
|
+
} & {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type InputTextarea = InstanceType<typeof InputTextarea>;
|
|
23
|
+
export default InputTextarea;
|
|
@@ -1,39 +1,46 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher } from 'svelte'
|
|
3
|
+
import type { HTMLInputAttributes, FormEventHandler } from 'svelte/elements'
|
|
4
|
+
import { FormControl, type InputProps } from './index.js'
|
|
5
|
+
import dayjs from 'dayjs'
|
|
6
|
+
type $$Props = InputProps<Date>
|
|
7
|
+
|
|
8
|
+
export let value: Date | null | undefined = undefined
|
|
9
|
+
export let input: HTMLInputAttributes = {}
|
|
10
|
+
|
|
11
|
+
$: ({ class: inputClass = '', ...inputProps } = input)
|
|
12
|
+
|
|
13
|
+
const dispatch = createEventDispatcher<{ input: Date | null }>()
|
|
14
|
+
|
|
15
|
+
const onInput: FormEventHandler<HTMLInputElement> = ({ currentTarget }) => {
|
|
16
|
+
value = getDateTime(currentTarget.value)
|
|
17
|
+
dispatch('input', value)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getDateTime(v: string | null | undefined): Date | null | undefined {
|
|
21
|
+
if (!v) return value
|
|
22
|
+
const date = new Date(value || 0)
|
|
23
|
+
const dateString = [
|
|
24
|
+
date.getFullYear().toString(),
|
|
25
|
+
(date.getMonth() + 1).toString().padStart(2, '0'),
|
|
26
|
+
date.getDate().toString().padStart(2, '0')
|
|
27
|
+
].join('-')
|
|
28
|
+
return new Date(`${dateString}T${v}`)
|
|
29
|
+
}
|
|
25
30
|
</script>
|
|
26
31
|
|
|
27
|
-
<FormControl {...$$restProps}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
<FormControl {...$$restProps}>
|
|
33
|
+
{#snippet children({ key })}
|
|
34
|
+
<input
|
|
35
|
+
value={value && dayjs(value).format('HH:mm')}
|
|
36
|
+
on:input={onInput}
|
|
37
|
+
on:focus
|
|
38
|
+
on:blur
|
|
39
|
+
type="time"
|
|
40
|
+
name={key}
|
|
41
|
+
id={key}
|
|
42
|
+
class="input input-bordered {inputClass}"
|
|
43
|
+
{...inputProps}
|
|
44
|
+
/>
|
|
45
|
+
{/snippet}
|
|
39
46
|
</FormControl>
|