fuma 2.0.50 → 2.1.1
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/action/index.d.ts +2 -5
- package/dist/action/index.js +2 -5
- package/dist/action/list/handlers.d.ts +6 -6
- package/dist/action/list/handlers.js +6 -5
- package/dist/action/list/index.d.ts +1 -1
- package/dist/action/list/index.js +11 -5
- package/dist/action/list/trigger.js +6 -2
- package/dist/action/list/utils.js +1 -1
- package/dist/action/tip.js +2 -2
- package/dist/command/command.svelte.d.ts +16 -0
- package/dist/command/command.svelte.js +68 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/data.d.ts +87 -0
- package/dist/data.js +51 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/InputBoolean.svelte +107 -0
- package/dist/input/InputBoolean.svelte.d.ts +12 -0
- package/dist/input/InputNumber.svelte +33 -0
- package/dist/input/InputNumber.svelte.d.ts +10 -0
- package/dist/input/InputRadio.svelte +56 -0
- package/dist/input/InputRadio.svelte.d.ts +11 -0
- package/dist/input/InputRange.svelte +30 -0
- package/dist/input/InputRange.svelte.d.ts +10 -0
- package/dist/input/InputRelation.svelte +119 -0
- package/dist/input/InputRelation.svelte.d.ts +39 -0
- package/dist/input/InputSelect.svelte +113 -0
- package/dist/input/InputSelect.svelte.d.ts +37 -0
- package/dist/input/InputSelectNative.svelte +56 -0
- package/dist/input/InputSelectNative.svelte.d.ts +12 -0
- package/dist/input/InputString.svelte +48 -0
- package/dist/input/InputString.svelte.d.ts +11 -0
- package/dist/input/InputTextarea.svelte +47 -0
- package/dist/input/InputTextarea.svelte.d.ts +11 -0
- package/dist/input/Issues.svelte +21 -0
- package/dist/input/Issues.svelte.d.ts +7 -0
- package/dist/input/index.d.ts +11 -0
- package/dist/input/index.js +10 -0
- package/dist/input/type.d.ts +5 -0
- package/dist/popover/Popover.svelte +50 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/popover.svelte.d.ts +26 -0
- package/dist/popover/popover.svelte.js +101 -0
- package/dist/remote/useForm.d.ts +6 -0
- package/dist/remote/useForm.js +22 -0
- package/dist/search/Spans.svelte +15 -0
- package/dist/search/Spans.svelte.d.ts +7 -0
- package/dist/search/index.d.ts +2 -0
- package/dist/search/index.js +2 -0
- package/dist/search/search.js +96 -0
- package/dist/server/index.d.ts +0 -4
- package/dist/server/index.js +0 -4
- package/dist/server/parseQuery.js +1 -1
- package/dist/server/sse.js +4 -4
- package/dist/server/table.js +1 -1
- package/dist/state/index.d.ts +1 -0
- package/dist/state/index.js +1 -0
- package/dist/state/param.svelte.d.ts +17 -0
- package/dist/state/param.svelte.js +64 -0
- package/dist/ui/button/ButtonDelete.svelte +49 -28
- package/dist/ui/button/ButtonDelete.svelte.d.ts +12 -31
- package/dist/ui/button/index.d.ts +0 -1
- package/dist/ui/button/index.js +0 -1
- package/dist/ui/copy/ButtonCopy.svelte +43 -0
- package/dist/ui/copy/ButtonCopy.svelte.d.ts +17 -0
- package/dist/ui/copy/index.d.ts +2 -0
- package/dist/ui/copy/index.js +2 -0
- package/dist/ui/copy/useCopy.svelte.d.ts +10 -0
- package/dist/ui/copy/useCopy.svelte.js +36 -0
- package/dist/ui/dialog/Dialog.svelte +56 -26
- package/dist/ui/dialog/Dialog.svelte.d.ts +14 -35
- package/dist/ui/dialog/index.d.ts +0 -1
- package/dist/ui/dialog/index.js +0 -1
- package/dist/ui/drawer/Drawer.svelte +53 -45
- package/dist/ui/drawer/Drawer.svelte.d.ts +8 -63
- package/dist/ui/drawer/drawerFly.js +1 -1
- package/dist/ui/drawer/useLayer.svelte.d.ts +5 -0
- package/dist/ui/drawer/useLayer.svelte.js +33 -0
- package/dist/ui/index.d.ts +4 -12
- package/dist/ui/index.js +4 -12
- package/dist/ui/menu/ContextMenu.svelte +27 -26
- package/dist/ui/menu/ContextMenu.svelte.d.ts +9 -35
- package/dist/ui/menu/DropDown.svelte +44 -26
- package/dist/ui/menu/DropDown.svelte.d.ts +18 -43
- package/dist/ui/menu/DropDownMenu.svelte +51 -41
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +7 -29
- package/dist/ui/menu/dropdown.css +4 -4
- package/dist/ui/menu/index.d.ts +1 -1
- package/dist/ui/menu/index.js +2 -1
- package/dist/ui/mode/ToggleMode.svelte +25 -14
- package/dist/ui/mode/ToggleMode.svelte.d.ts +10 -35
- package/dist/ui/mode/index.d.ts +1 -1
- package/dist/ui/mode/index.js +1 -1
- package/dist/ui/mode/useMode.svelte.d.ts +8 -0
- package/dist/ui/mode/useMode.svelte.js +40 -0
- package/dist/ui/pagination/Pagination.svelte +18 -14
- package/dist/ui/pagination/Pagination.svelte.d.ts +4 -18
- package/dist/ui/range/RangePicker.svelte +3 -2
- package/dist/ui/range/RangePickerButton.svelte +49 -37
- package/dist/ui/range/RangePickerButton.svelte.d.ts +7 -21
- package/dist/ui/range/index.d.ts +1 -1
- package/dist/ui/range/index.js +1 -1
- package/dist/ui/table/Table.svelte +17 -24
- package/dist/ui/table/Table.svelte.d.ts +3 -3
- package/dist/ui/table/TableBody.svelte +1 -1
- package/dist/ui/table/TableBody.svelte.d.ts +1 -1
- package/dist/ui/table/TableFieldsEdition.svelte +90 -78
- package/dist/ui/table/TableFieldsEdition.svelte.d.ts +14 -13
- package/dist/ui/table/TableHead.svelte +1 -1
- package/dist/ui/table/TableViewSelect.svelte +71 -70
- package/dist/ui/table/TableViewSelect.svelte.d.ts +10 -23
- package/dist/ui/table/cell/TableCellArray.svelte +2 -2
- package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
- package/dist/ui/table/cell/index.d.ts +1 -1
- package/dist/ui/table/cell/index.js +1 -1
- package/dist/ui/table/field.d.ts +7 -7
- package/dist/ui/table/head/OrderButtons.svelte +18 -13
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +11 -23
- package/dist/ui/table/head/TableHeadBoolean.svelte +3 -3
- package/dist/ui/table/head/TableHeadDate.svelte +40 -56
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +1 -1
- package/dist/ui/table/head/TableHeadDefault.svelte +2 -1
- package/dist/ui/table/head/TableHeadNumber.svelte +93 -108
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +13 -10
- package/dist/ui/table/head/TableHeadSelect.svelte +55 -52
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +13 -10
- package/dist/ui/table/head/TableHeadString.svelte +28 -34
- package/dist/ui/table/head/index.d.ts +3 -3
- package/dist/ui/table/head/index.js +3 -3
- package/dist/ui/table/index.d.ts +5 -5
- package/dist/ui/table/index.js +4 -5
- package/dist/utils/csv.js +1 -1
- package/dist/utils/eventEmitter.d.ts +2 -2
- package/dist/utils/eventEmitter.js +18 -11
- package/dist/utils/index.d.ts +4 -6
- package/dist/utils/index.js +4 -6
- package/dist/utils/normalizePath.js +1 -1
- package/dist/utils/options.d.ts +6 -5
- package/dist/utils/options.js +3 -2
- package/dist/utils/tippy.d.ts +1 -1
- package/dist/utils/tippy.js +1 -1
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.js +0 -1
- package/dist/validation/zod.d.ts +12 -393
- package/dist/validation/zod.js +22 -82
- package/package.json +115 -134
- package/dist/action/heightScreen.d.ts +0 -10
- package/dist/action/heightScreen.js +0 -24
- package/dist/action/portal.d.ts +0 -3
- package/dist/action/portal.js +0 -9
- package/dist/action/selector.d.ts +0 -15
- package/dist/action/selector.js +0 -71
- package/dist/api/client.d.ts +0 -3
- package/dist/api/client.js +0 -24
- package/dist/api/config.d.ts +0 -46
- package/dist/api/config.js +0 -7
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.js +0 -3
- package/dist/api/server.d.ts +0 -11
- package/dist/api/server.js +0 -17
- package/dist/private/Meta.svelte +0 -16
- package/dist/private/Meta.svelte.d.ts +0 -30
- package/dist/private/api.d.ts +0 -61
- package/dist/private/api.js +0 -10
- package/dist/private/constant.d.ts +0 -14
- package/dist/private/constant.js +0 -6
- package/dist/private/model.d.ts +0 -70
- package/dist/private/model.js +0 -25
- package/dist/private/prisma.d.ts +0 -2
- package/dist/private/prisma.js +0 -2
- package/dist/private/store.d.ts +0 -1
- package/dist/private/store.js +0 -2
- package/dist/server/auth.d.ts +0 -12
- package/dist/server/auth.js +0 -15
- package/dist/server/formAction.d.ts +0 -13
- package/dist/server/formAction.js +0 -8
- package/dist/server/json.d.ts +0 -1
- package/dist/server/json.js +0 -16
- package/dist/server/parseFormData.d.ts +0 -10
- package/dist/server/parseFormData.js +0 -85
- package/dist/server/try.d.ts +0 -9
- package/dist/server/try.js +0 -41
- package/dist/store/index.d.ts +0 -2
- package/dist/store/index.js +0 -2
- package/dist/store/isSmallScreen.d.ts +0 -1
- package/dist/store/isSmallScreen.js +0 -14
- package/dist/store/param.d.ts +0 -22
- package/dist/store/param.js +0 -61
- package/dist/store/session.d.ts +0 -1
- package/dist/store/session.js +0 -13
- package/dist/ui/badge/Badge.svelte +0 -9
- package/dist/ui/badge/Badge.svelte.d.ts +0 -21
- package/dist/ui/badge/index.d.ts +0 -1
- package/dist/ui/badge/index.js +0 -1
- package/dist/ui/button/ButtonCopy.svelte +0 -59
- package/dist/ui/button/ButtonCopy.svelte.d.ts +0 -27
- package/dist/ui/card/Card.svelte +0 -43
- package/dist/ui/card/Card.svelte.d.ts +0 -41
- package/dist/ui/card/CardBasic.svelte +0 -15
- package/dist/ui/card/CardBasic.svelte.d.ts +0 -31
- package/dist/ui/card/CardCollapse.svelte +0 -71
- package/dist/ui/card/CardCollapse.svelte.d.ts +0 -39
- package/dist/ui/card/CardFullScreen.svelte +0 -31
- package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -38
- package/dist/ui/card/CardLink.svelte +0 -22
- package/dist/ui/card/CardLink.svelte.d.ts +0 -31
- package/dist/ui/card/index.d.ts +0 -5
- package/dist/ui/card/index.js +0 -5
- package/dist/ui/context.d.ts +0 -6
- package/dist/ui/context.js +0 -12
- package/dist/ui/dialog/DialogConfirm.svelte +0 -24
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -35
- package/dist/ui/drawer/layers.d.ts +0 -7
- package/dist/ui/drawer/layers.js +0 -68
- package/dist/ui/form/Form.svelte +0 -168
- package/dist/ui/form/Form.svelte.d.ts +0 -62
- package/dist/ui/form/FormInput.svelte +0 -15
- package/dist/ui/form/FormSection.svelte +0 -78
- package/dist/ui/form/FormSection.svelte.d.ts +0 -39
- package/dist/ui/form/form.d.ts +0 -37
- package/dist/ui/form/form.js +0 -57
- package/dist/ui/form/formInput.js +0 -33
- package/dist/ui/form/index.d.ts +0 -3
- package/dist/ui/form/index.js +0 -3
- package/dist/ui/icon/Icon.svelte +0 -53
- package/dist/ui/icon/Icon.svelte.d.ts +0 -29
- package/dist/ui/icon/index.d.ts +0 -1
- package/dist/ui/icon/index.js +0 -1
- package/dist/ui/input/FormControl.svelte +0 -77
- package/dist/ui/input/FormControl.svelte.d.ts +0 -34
- package/dist/ui/input/InputBoolean.svelte +0 -33
- package/dist/ui/input/InputBoolean.svelte.d.ts +0 -46
- package/dist/ui/input/InputCheckboxs.svelte +0 -71
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -57
- package/dist/ui/input/InputCheckboxsMenu.svelte +0 -106
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -59
- package/dist/ui/input/InputCheckboxsTree.svelte +0 -18
- package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +0 -25
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +0 -68
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +0 -27
- package/dist/ui/input/InputCombo.svelte +0 -99
- package/dist/ui/input/InputCombo.svelte.d.ts +0 -59
- package/dist/ui/input/InputDate.svelte +0 -47
- package/dist/ui/input/InputDate.svelte.d.ts +0 -46
- package/dist/ui/input/InputDateTime.svelte +0 -41
- package/dist/ui/input/InputDateTime.svelte.d.ts +0 -23
- package/dist/ui/input/InputImage.svelte +0 -116
- package/dist/ui/input/InputImage.svelte.d.ts +0 -48
- package/dist/ui/input/InputImagePreview.svelte +0 -60
- package/dist/ui/input/InputImagePreview.svelte.d.ts +0 -27
- package/dist/ui/input/InputNumber.svelte +0 -31
- package/dist/ui/input/InputNumber.svelte.d.ts +0 -23
- package/dist/ui/input/InputOptionInParam.svelte +0 -36
- package/dist/ui/input/InputOptionInParam.svelte.d.ts +0 -24
- package/dist/ui/input/InputOptions.svelte +0 -85
- package/dist/ui/input/InputOptions.svelte.d.ts +0 -21
- package/dist/ui/input/InputPassword.svelte +0 -25
- package/dist/ui/input/InputPassword.svelte.d.ts +0 -45
- package/dist/ui/input/InputRadio.svelte +0 -84
- package/dist/ui/input/InputRadio.svelte.d.ts +0 -56
- package/dist/ui/input/InputRelation.svelte +0 -171
- package/dist/ui/input/InputRelation.svelte.d.ts +0 -76
- package/dist/ui/input/InputRelations.svelte +0 -166
- package/dist/ui/input/InputRelations.svelte.d.ts +0 -55
- package/dist/ui/input/InputSearch.svelte +0 -59
- package/dist/ui/input/InputSearch.svelte.d.ts +0 -29
- package/dist/ui/input/InputSelect.svelte +0 -84
- package/dist/ui/input/InputSelect.svelte.d.ts +0 -29
- package/dist/ui/input/InputText.svelte +0 -46
- package/dist/ui/input/InputText.svelte.d.ts +0 -30
- package/dist/ui/input/InputTextarea.svelte +0 -23
- package/dist/ui/input/InputTextarea.svelte.d.ts +0 -23
- package/dist/ui/input/InputTime.svelte +0 -47
- package/dist/ui/input/InputTime.svelte.d.ts +0 -46
- package/dist/ui/input/RelationAfter.svelte +0 -34
- package/dist/ui/input/RelationAfter.svelte.d.ts +0 -26
- package/dist/ui/input/SelectorList.svelte +0 -50
- package/dist/ui/input/SelectorList.svelte.d.ts +0 -49
- package/dist/ui/input/action.d.ts +0 -13
- package/dist/ui/input/action.js +0 -56
- package/dist/ui/input/index.d.ts +0 -26
- package/dist/ui/input/index.js +0 -26
- package/dist/ui/input/textRich/InputTextRich.svelte +0 -72
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -48
- package/dist/ui/input/textRich/SuggesionList.svelte +0 -25
- package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMark.svelte +0 -22
- package/dist/ui/input/textRich/ToolMark.svelte.d.ts +0 -25
- package/dist/ui/input/textRich/ToolMarkColor.svelte +0 -36
- package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMarkLink.svelte +0 -72
- package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolMenu.svelte +0 -66
- package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +0 -33
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +0 -50
- package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +0 -54
- package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMenuNode.svelte +0 -60
- package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolsBar.svelte +0 -61
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +0 -24
- package/dist/ui/input/textRich/extensions.d.ts +0 -2
- package/dist/ui/input/textRich/extensions.js +0 -62
- package/dist/ui/input/textRich/indent.d.ts +0 -13
- package/dist/ui/input/textRich/indent.js +0 -112
- package/dist/ui/input/textRich/index.d.ts +0 -3
- package/dist/ui/input/textRich/index.js +0 -3
- package/dist/ui/input/textRich/suggestion.d.ts +0 -7
- package/dist/ui/input/textRich/suggestion.js +0 -55
- package/dist/ui/input/textRich/tiptapParser.d.ts +0 -4
- package/dist/ui/input/textRich/tiptapParser.js +0 -29
- package/dist/ui/input/types.d.ts +0 -15
- package/dist/ui/input/types.js +0 -1
- package/dist/ui/login/Login.svelte +0 -99
- package/dist/ui/login/Login.svelte.d.ts +0 -20
- package/dist/ui/login/index.d.ts +0 -1
- package/dist/ui/login/index.js +0 -1
- package/dist/ui/placeholder/Placeholder.svelte +0 -12
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -30
- package/dist/ui/placeholder/PlaceholderImage.svelte +0 -16
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -30
- package/dist/ui/placeholder/index.d.ts +0 -2
- package/dist/ui/placeholder/index.js +0 -2
- package/dist/ui/table/type.d.ts +0 -2
- package/dist/ui/tabs/Tabs.svelte +0 -32
- package/dist/ui/tabs/Tabs.svelte.d.ts +0 -22
- package/dist/ui/tabs/TabsIcon.svelte +0 -60
- package/dist/ui/tabs/TabsIcon.svelte.d.ts +0 -24
- package/dist/ui/tabs/index.d.ts +0 -8
- package/dist/ui/tabs/index.js +0 -2
- package/dist/utils/avatar.d.ts +0 -1
- package/dist/utils/avatar.js +0 -5
- package/dist/utils/component.d.ts +0 -6
- package/dist/utils/component.js +0 -3
- package/dist/validation/form.d.ts +0 -34
- package/dist/validation/form.js +0 -103
- /package/dist/{ui/table → input}/type.js +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type Snippet } from 'svelte';
|
|
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;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const FormControl: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
class?: string;
|
|
17
|
-
classLabel?: string;
|
|
18
|
-
key?: string;
|
|
19
|
-
label?: Snippet | string;
|
|
20
|
-
labelAppend?: Snippet | null;
|
|
21
|
-
error?: string;
|
|
22
|
-
hint?: string;
|
|
23
|
-
prefix?: string | number;
|
|
24
|
-
prefixFor?: string | number;
|
|
25
|
-
enhanceDisabled?: boolean;
|
|
26
|
-
labelPosition?: "top" | "left" | "right";
|
|
27
|
-
children?: Snippet<[{
|
|
28
|
-
key: string;
|
|
29
|
-
}]> | undefined;
|
|
30
|
-
}, {
|
|
31
|
-
[evt: string]: CustomEvent<any>;
|
|
32
|
-
}, {}, {}, string>;
|
|
33
|
-
type FormControl = InstanceType<typeof FormControl>;
|
|
34
|
-
export default FormControl;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { createEventDispatcher } from 'svelte'
|
|
3
|
-
import type { HTMLInputAttributes } from 'svelte/elements'
|
|
4
|
-
import { FormControl, type InputProps, bindCheckedWithParams } from './index.js'
|
|
5
|
-
import { USE_COERCE_BOOLEAN } from '../../utils/constant.js'
|
|
6
|
-
|
|
7
|
-
type $$Props = InputProps<boolean> & { isRow?: boolean }
|
|
8
|
-
export let value: boolean | null | undefined = false
|
|
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 }>()
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<FormControl {...$$restProps} class="">
|
|
17
|
-
{#snippet children({ key })}
|
|
18
|
-
<input
|
|
19
|
-
bind:this={inputElement}
|
|
20
|
-
bind:checked={value}
|
|
21
|
-
use:bindCheckedWithParams={{ bindEnable: bindWithParams }}
|
|
22
|
-
on:input={({ currentTarget: { checked } }) => dispatch('change', checked)}
|
|
23
|
-
on:focus
|
|
24
|
-
on:blur
|
|
25
|
-
type="checkbox"
|
|
26
|
-
id={key}
|
|
27
|
-
class="checkbox ml-1"
|
|
28
|
-
{...input}
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
<input type="hidden" name={key} value="{USE_COERCE_BOOLEAN}{value}" />
|
|
32
|
-
{/snippet}
|
|
33
|
-
</FormControl>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
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;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const InputBoolean: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
class?: string;
|
|
17
|
-
classLabel?: string;
|
|
18
|
-
key?: string;
|
|
19
|
-
label?: import("svelte").Snippet | string;
|
|
20
|
-
labelAppend?: import("svelte").Snippet | null;
|
|
21
|
-
error?: string;
|
|
22
|
-
hint?: string;
|
|
23
|
-
prefix?: string | number;
|
|
24
|
-
prefixFor?: string | number;
|
|
25
|
-
enhanceDisabled?: boolean;
|
|
26
|
-
labelPosition?: "top" | "left" | "right";
|
|
27
|
-
children?: import("svelte").Snippet<[{
|
|
28
|
-
key: string;
|
|
29
|
-
}]> | undefined;
|
|
30
|
-
} & {
|
|
31
|
-
input?: HTMLInputAttributes;
|
|
32
|
-
inputElement?: HTMLInputElement;
|
|
33
|
-
classWrapper?: string;
|
|
34
|
-
value?: boolean | null | undefined;
|
|
35
|
-
bindWithParams?: boolean;
|
|
36
|
-
} & {
|
|
37
|
-
isRow?: boolean;
|
|
38
|
-
}, {
|
|
39
|
-
focus: FocusEvent;
|
|
40
|
-
blur: FocusEvent;
|
|
41
|
-
change: CustomEvent<boolean>;
|
|
42
|
-
} & {
|
|
43
|
-
[evt: string]: CustomEvent<any>;
|
|
44
|
-
}, {}, {}, string>;
|
|
45
|
-
type InputBoolean = InstanceType<typeof InputBoolean>;
|
|
46
|
-
export default InputBoolean;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { slide } from 'svelte/transition'
|
|
3
|
-
import { FormControl, type InputProps } from './index.js'
|
|
4
|
-
import { type Options, parseOptions } from '../../utils/options.js'
|
|
5
|
-
|
|
6
|
-
type $$Props = InputProps<string[]> & { options: Options; checkboxesClass?: string }
|
|
7
|
-
$: ({
|
|
8
|
-
input,
|
|
9
|
-
value: _value,
|
|
10
|
-
options: _1,
|
|
11
|
-
class: klass,
|
|
12
|
-
checkboxesClass,
|
|
13
|
-
hint,
|
|
14
|
-
error,
|
|
15
|
-
...props
|
|
16
|
-
} = $$props as $$Props)
|
|
17
|
-
export let value: string[] | null | undefined = _value || []
|
|
18
|
-
export let options: Options
|
|
19
|
-
|
|
20
|
-
if (!value) value = []
|
|
21
|
-
|
|
22
|
-
$: _options = parseOptions(options)
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<div class={klass}>
|
|
26
|
-
{#if props.label}
|
|
27
|
-
<div class="label">
|
|
28
|
-
<span class="label-text">{props.label}</span>
|
|
29
|
-
<slot name="label_append" />
|
|
30
|
-
</div>
|
|
31
|
-
{/if}
|
|
32
|
-
|
|
33
|
-
<div class={checkboxesClass}>
|
|
34
|
-
{#each _options as option, index}
|
|
35
|
-
<FormControl
|
|
36
|
-
{...props}
|
|
37
|
-
label={option.label}
|
|
38
|
-
prefixFor={index}
|
|
39
|
-
class="flex-row-reverse items-center justify-end gap-2"
|
|
40
|
-
>
|
|
41
|
-
{#snippet children({ key })}
|
|
42
|
-
<input
|
|
43
|
-
bind:group={value}
|
|
44
|
-
on:change
|
|
45
|
-
on:input
|
|
46
|
-
on:focus
|
|
47
|
-
on:blur
|
|
48
|
-
value={option.value}
|
|
49
|
-
type="checkbox"
|
|
50
|
-
name={key}
|
|
51
|
-
id="{index}{key}"
|
|
52
|
-
class="checkbox"
|
|
53
|
-
{...input}
|
|
54
|
-
/>
|
|
55
|
-
{/snippet}
|
|
56
|
-
</FormControl>
|
|
57
|
-
{/each}
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
{#if error}
|
|
61
|
-
<div class="label" transition:slide>
|
|
62
|
-
<span class="label-text-alt text-warning">{error}</span>
|
|
63
|
-
</div>
|
|
64
|
-
{:else if hint}
|
|
65
|
-
<div class="label" transition:slide>
|
|
66
|
-
<span class="label-text-alt text-info">{hint}</span>
|
|
67
|
-
</div>
|
|
68
|
-
{/if}
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<input type="hidden" name={props.key} value={JSON.stringify(value)} />
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { type Options } from '../../utils/options.js';
|
|
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;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
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 InputCheckboxs: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
-
class?: string;
|
|
22
|
-
classLabel?: string;
|
|
23
|
-
key?: string;
|
|
24
|
-
label?: import("svelte").Snippet | string;
|
|
25
|
-
labelAppend?: import("svelte").Snippet | null;
|
|
26
|
-
error?: string;
|
|
27
|
-
hint?: string;
|
|
28
|
-
prefix?: string | number;
|
|
29
|
-
prefixFor?: string | number;
|
|
30
|
-
enhanceDisabled?: boolean;
|
|
31
|
-
labelPosition?: "top" | "left" | "right";
|
|
32
|
-
children?: import("svelte").Snippet<[{
|
|
33
|
-
key: string;
|
|
34
|
-
}]> | undefined;
|
|
35
|
-
} & {
|
|
36
|
-
input?: import("svelte/elements").HTMLInputAttributes;
|
|
37
|
-
inputElement?: HTMLInputElement;
|
|
38
|
-
classWrapper?: string;
|
|
39
|
-
value?: string[] | null | undefined;
|
|
40
|
-
bindWithParams?: boolean;
|
|
41
|
-
} & {
|
|
42
|
-
options: Options;
|
|
43
|
-
checkboxesClass?: string;
|
|
44
|
-
}, {
|
|
45
|
-
label_append: {};
|
|
46
|
-
}>, {
|
|
47
|
-
change: Event;
|
|
48
|
-
input: Event;
|
|
49
|
-
focus: FocusEvent;
|
|
50
|
-
blur: FocusEvent;
|
|
51
|
-
} & {
|
|
52
|
-
[evt: string]: CustomEvent<any>;
|
|
53
|
-
}, {
|
|
54
|
-
label_append: {};
|
|
55
|
-
}, {}, string>;
|
|
56
|
-
type InputCheckboxs = InstanceType<typeof InputCheckboxs>;
|
|
57
|
-
export default InputCheckboxs;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { goto } from '$app/navigation'
|
|
3
|
-
import { page } from '$app/stores'
|
|
4
|
-
import { mdiClose } from '@mdi/js'
|
|
5
|
-
|
|
6
|
-
import { urlParam } from '../../store/index.js'
|
|
7
|
-
import { jsonParse, type Options, parseOptions } from '../../utils/index.js'
|
|
8
|
-
import { Icon } from '../icon/index.js'
|
|
9
|
-
import { DropDown } from '../menu/index.js'
|
|
10
|
-
import { FormControl, type InputProps } from './index.js'
|
|
11
|
-
|
|
12
|
-
type $$Props = InputProps<string[]> & {
|
|
13
|
-
key: string
|
|
14
|
-
options: Options
|
|
15
|
-
right?: boolean
|
|
16
|
-
btnClass?: string
|
|
17
|
-
badgePrimary?: boolean
|
|
18
|
-
}
|
|
19
|
-
$: ({
|
|
20
|
-
input,
|
|
21
|
-
value: _value,
|
|
22
|
-
options: _1,
|
|
23
|
-
class: klass,
|
|
24
|
-
label,
|
|
25
|
-
right,
|
|
26
|
-
btnClass,
|
|
27
|
-
badgePrimary,
|
|
28
|
-
...props
|
|
29
|
-
} = $$props as $$Props)
|
|
30
|
-
|
|
31
|
-
export let key: string
|
|
32
|
-
export let options: Options
|
|
33
|
-
export let value: string[] | null | undefined =
|
|
34
|
-
_value || jsonParse($page.url.searchParams.get(key), [])
|
|
35
|
-
|
|
36
|
-
let dropdown: DropDown
|
|
37
|
-
|
|
38
|
-
$: _options = parseOptions(options)
|
|
39
|
-
|
|
40
|
-
async function writeUrl() {
|
|
41
|
-
const url = value?.length
|
|
42
|
-
? $urlParam.with({ [key]: JSON.stringify(value) })
|
|
43
|
-
: $urlParam.without(key)
|
|
44
|
-
return goto(url, { replaceState: true, noScroll: true })
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function handleReset() {
|
|
48
|
-
dropdown.hide()
|
|
49
|
-
value = []
|
|
50
|
-
goto($urlParam.without(key), { replaceState: true })
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<input type="hidden" name={key} value={JSON.stringify(value)} />
|
|
55
|
-
|
|
56
|
-
<DropDown bind:this={dropdown} tippyProps={{ onHidden: writeUrl }} classWrapper="mb-[-2px]">
|
|
57
|
-
<div class="join" class:ml-2={value?.length} slot="activator">
|
|
58
|
-
<button class="btn indicator join-item btn-sm {btnClass || ''}">
|
|
59
|
-
<slot name="label">
|
|
60
|
-
<span>{label}</span>
|
|
61
|
-
</slot>
|
|
62
|
-
{#if !!value?.length}
|
|
63
|
-
<span
|
|
64
|
-
class="
|
|
65
|
-
badge indicator-item badge-sm indicator-start
|
|
66
|
-
{badgePrimary ? 'badge-primary' : 'badge-outline bg-base-100'}
|
|
67
|
-
"
|
|
68
|
-
>
|
|
69
|
-
{value?.length}
|
|
70
|
-
</span>
|
|
71
|
-
{/if}
|
|
72
|
-
</button>
|
|
73
|
-
{#if !!value?.length}
|
|
74
|
-
<button class="btn btn-square join-item btn-sm" on:click={handleReset}>
|
|
75
|
-
<Icon path={mdiClose} class="fill-base-content" />
|
|
76
|
-
</button>
|
|
77
|
-
{/if}
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div class={klass}>
|
|
81
|
-
{#each _options as option, index (option.value)}
|
|
82
|
-
<FormControl
|
|
83
|
-
{...props}
|
|
84
|
-
label={option.label}
|
|
85
|
-
prefixFor={index}
|
|
86
|
-
class="flex-row-reverse items-center justify-end gap-2 whitespace-nowrap"
|
|
87
|
-
>
|
|
88
|
-
{#snippet children({ key })}
|
|
89
|
-
<input
|
|
90
|
-
bind:group={value}
|
|
91
|
-
on:input
|
|
92
|
-
on:focus
|
|
93
|
-
on:blur
|
|
94
|
-
value={option.value}
|
|
95
|
-
type="checkbox"
|
|
96
|
-
id="{index}{key}"
|
|
97
|
-
class="checkbox"
|
|
98
|
-
{...input}
|
|
99
|
-
/>
|
|
100
|
-
{/snippet}
|
|
101
|
-
</FormControl>
|
|
102
|
-
{:else}
|
|
103
|
-
<div class="px-3 py-2 rounded opacity-70">Aucun élément</div>
|
|
104
|
-
{/each}
|
|
105
|
-
</div>
|
|
106
|
-
</DropDown>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type Options } from '../../utils/index.js';
|
|
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;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
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 InputCheckboxsMenu: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
-
class?: string;
|
|
22
|
-
classLabel?: string;
|
|
23
|
-
key?: string;
|
|
24
|
-
label?: import("svelte").Snippet | string;
|
|
25
|
-
labelAppend?: import("svelte").Snippet | null;
|
|
26
|
-
error?: string;
|
|
27
|
-
hint?: string;
|
|
28
|
-
prefix?: string | number;
|
|
29
|
-
prefixFor?: string | number;
|
|
30
|
-
enhanceDisabled?: boolean;
|
|
31
|
-
labelPosition?: "top" | "left" | "right";
|
|
32
|
-
children?: import("svelte").Snippet<[{
|
|
33
|
-
key: string;
|
|
34
|
-
}]> | undefined;
|
|
35
|
-
} & {
|
|
36
|
-
input?: import("svelte/elements").HTMLInputAttributes;
|
|
37
|
-
inputElement?: HTMLInputElement;
|
|
38
|
-
classWrapper?: string;
|
|
39
|
-
value?: string[] | null | undefined;
|
|
40
|
-
bindWithParams?: boolean;
|
|
41
|
-
} & {
|
|
42
|
-
key: string;
|
|
43
|
-
options: Options;
|
|
44
|
-
right?: boolean;
|
|
45
|
-
btnClass?: string;
|
|
46
|
-
badgePrimary?: boolean;
|
|
47
|
-
}, {
|
|
48
|
-
label: {};
|
|
49
|
-
}>, {
|
|
50
|
-
input: Event;
|
|
51
|
-
focus: FocusEvent;
|
|
52
|
-
blur: FocusEvent;
|
|
53
|
-
} & {
|
|
54
|
-
[evt: string]: CustomEvent<any>;
|
|
55
|
-
}, {
|
|
56
|
-
label: {};
|
|
57
|
-
}, {}, string>;
|
|
58
|
-
type InputCheckboxsMenu = InstanceType<typeof InputCheckboxsMenu>;
|
|
59
|
-
export default InputCheckboxsMenu;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import InputCheckboxsTreeNodes, {
|
|
3
|
-
type OptionsNode
|
|
4
|
-
} from './InputCheckboxsTreeNodes.svelte'
|
|
5
|
-
|
|
6
|
-
export let label: string
|
|
7
|
-
export let options: OptionsNode
|
|
8
|
-
let klass = ''
|
|
9
|
-
export { klass as class }
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div class={klass}>
|
|
13
|
-
<div class="label">
|
|
14
|
-
<span class="label-text">{label}</span>
|
|
15
|
-
<slot name="label_append" />
|
|
16
|
-
</div>
|
|
17
|
-
<InputCheckboxsTreeNodes {options} />
|
|
18
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type OptionsNode } from './InputCheckboxsTreeNodes.svelte';
|
|
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;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const InputCheckboxsTree: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
label: string;
|
|
17
|
-
options: OptionsNode;
|
|
18
|
-
class?: string;
|
|
19
|
-
}, {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
}, {
|
|
22
|
-
label_append: {};
|
|
23
|
-
}, {}, string>;
|
|
24
|
-
type InputCheckboxsTree = InstanceType<typeof InputCheckboxsTree>;
|
|
25
|
-
export default InputCheckboxsTree;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<script lang="ts" context="module">
|
|
2
|
-
export type OptionsNode = Record<
|
|
3
|
-
string,
|
|
4
|
-
{ label: string; value?: boolean; options?: OptionsNode }
|
|
5
|
-
>
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import { createEventDispatcher } from 'svelte'
|
|
10
|
-
import { InputBoolean } from './index.js'
|
|
11
|
-
export let options: OptionsNode
|
|
12
|
-
|
|
13
|
-
type Events = { setTrue: void }
|
|
14
|
-
const dispatch = createEventDispatcher<Events>()
|
|
15
|
-
|
|
16
|
-
function handleChange(newValue: boolean, option: OptionsNode[string]) {
|
|
17
|
-
if (newValue === true) dispatch('setTrue')
|
|
18
|
-
else if (option.options) {
|
|
19
|
-
option.options = setFalse(option.options)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function setFalse(_options?: OptionsNode): OptionsNode | undefined {
|
|
24
|
-
if (!_options) return undefined
|
|
25
|
-
return Object.entries(_options).reduce<OptionsNode>(
|
|
26
|
-
(acc, [key, opt]) => ({
|
|
27
|
-
...acc,
|
|
28
|
-
[key]: {
|
|
29
|
-
label: opt.label,
|
|
30
|
-
value: false,
|
|
31
|
-
options: setFalse(opt.options)
|
|
32
|
-
}
|
|
33
|
-
}),
|
|
34
|
-
{}
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
{#each Object.keys(options) as key (key)}
|
|
40
|
-
<InputBoolean
|
|
41
|
-
{key}
|
|
42
|
-
label={options[key].label}
|
|
43
|
-
bind:value={options[key].value}
|
|
44
|
-
on:change={({ detail }) => handleChange(detail, options[key])}
|
|
45
|
-
/>
|
|
46
|
-
|
|
47
|
-
{#if options[key].options}
|
|
48
|
-
<div class="flex">
|
|
49
|
-
<div class="relative -mt-[6px] ml-3 w-3">
|
|
50
|
-
{#each Object.keys(options[key].options || {}) as k, index}
|
|
51
|
-
<div
|
|
52
|
-
style:height="{24 + index * 36}px"
|
|
53
|
-
class="t-0 bordered absolute w-3 rounded-bl-lg border-b-2 border-l-2"
|
|
54
|
-
></div>
|
|
55
|
-
{/each}
|
|
56
|
-
</div>
|
|
57
|
-
<div>
|
|
58
|
-
<svelte:self
|
|
59
|
-
options={options[key].options}
|
|
60
|
-
on:setTrue={() => {
|
|
61
|
-
options[key].value = true
|
|
62
|
-
dispatch('setTrue')
|
|
63
|
-
}}
|
|
64
|
-
/>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
{/if}
|
|
68
|
-
{/each}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type OptionsNode = Record<string, {
|
|
2
|
-
label: string;
|
|
3
|
-
value?: boolean;
|
|
4
|
-
options?: OptionsNode;
|
|
5
|
-
}>;
|
|
6
|
-
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> {
|
|
7
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
8
|
-
$$bindings?: Bindings;
|
|
9
|
-
} & Exports;
|
|
10
|
-
(internal: unknown, props: Props & {
|
|
11
|
-
$$events?: Events;
|
|
12
|
-
$$slots?: Slots;
|
|
13
|
-
}): Exports & {
|
|
14
|
-
$set?: any;
|
|
15
|
-
$on?: any;
|
|
16
|
-
};
|
|
17
|
-
z_$$bindings?: Bindings;
|
|
18
|
-
}
|
|
19
|
-
declare const InputCheckboxsTreeNodes: $$__sveltets_2_IsomorphicComponent<{
|
|
20
|
-
options: OptionsNode;
|
|
21
|
-
}, {
|
|
22
|
-
setTrue: CustomEvent<void>;
|
|
23
|
-
} & {
|
|
24
|
-
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {}, {}, string>;
|
|
26
|
-
type InputCheckboxsTreeNodes = InstanceType<typeof InputCheckboxsTreeNodes>;
|
|
27
|
-
export default InputCheckboxsTreeNodes;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { createEventDispatcher, tick } from 'svelte'
|
|
3
|
-
|
|
4
|
-
import type { InputProps } from './types.js'
|
|
5
|
-
import type { TippyProps } from '../../utils/tippy.js'
|
|
6
|
-
import { type Options, type Option, parseOptions } from '../../utils/options.js'
|
|
7
|
-
import { FormControl, SelectorList } from './index.js'
|
|
8
|
-
import { DropDown } from '../menu/index.js'
|
|
9
|
-
import { Icon } from '../icon/index.js'
|
|
10
|
-
|
|
11
|
-
type $$Props = InputProps & { options: Options; tippyProps?: TippyProps }
|
|
12
|
-
$: ({ input, value: _value, options, tippyProps, ...props } = $$props as $$Props)
|
|
13
|
-
$: ({ class: inputClass, ...inputProps } = input || {})
|
|
14
|
-
export let value = _value
|
|
15
|
-
export let inputElement: HTMLInputElement | undefined = undefined
|
|
16
|
-
|
|
17
|
-
let focusIndex = 0
|
|
18
|
-
let searchValue = ''
|
|
19
|
-
|
|
20
|
-
const dispatch = createEventDispatcher<{ input: string }>()
|
|
21
|
-
let filteredOptions: (Option & { id: string })[] = []
|
|
22
|
-
$: _options = parseOptions(options)
|
|
23
|
-
$: selectedOption = _options.find((opt) => opt.value === value)
|
|
24
|
-
|
|
25
|
-
function filterOptions(value: string) {
|
|
26
|
-
const reg = new RegExp(value, 'i')
|
|
27
|
-
filteredOptions = _options
|
|
28
|
-
.filter((opt) => opt.label.match(reg) || opt.value.match(reg))
|
|
29
|
-
.map((opt) => ({ id: opt.value, ...opt }))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export async function clear() {
|
|
33
|
-
searchValue = ''
|
|
34
|
-
value = ''
|
|
35
|
-
filterOptions('')
|
|
36
|
-
await tick()
|
|
37
|
-
inputElement?.focus()
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function select(index = focusIndex) {
|
|
41
|
-
value = _options[index].value
|
|
42
|
-
dispatch('input', value)
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<DropDown {tippyProps}>
|
|
47
|
-
<div class="contents" slot="activator">
|
|
48
|
-
<FormControl {...props}>
|
|
49
|
-
{#snippet children({ key })}
|
|
50
|
-
<div class="flex grow gap-2" class:hidden={selectedOption}>
|
|
51
|
-
<div class="relative flex grow items-center gap-2">
|
|
52
|
-
<input
|
|
53
|
-
type="text"
|
|
54
|
-
id={key}
|
|
55
|
-
bind:this={inputElement}
|
|
56
|
-
bind:value={searchValue}
|
|
57
|
-
on:focus={() => filterOptions('')}
|
|
58
|
-
on:blur={() => (searchValue = '')}
|
|
59
|
-
on:input={(e) => filterOptions(e.currentTarget.value)}
|
|
60
|
-
autocomplete="off"
|
|
61
|
-
class="input input-bordered grow {inputClass || {}}"
|
|
62
|
-
{...inputProps}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
<slot name="append" />
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
{#if selectedOption}
|
|
69
|
-
<button
|
|
70
|
-
type="button"
|
|
71
|
-
class="flex h-12 items-center gap-2 rounded-lg border pl-4 pr-2"
|
|
72
|
-
on:click={clear}
|
|
73
|
-
on:focus={clear}
|
|
74
|
-
>
|
|
75
|
-
{#if selectedOption.icon}
|
|
76
|
-
<Icon path={selectedOption.icon} size={21} class="opacity-70" />
|
|
77
|
-
{/if}
|
|
78
|
-
<span>{selectedOption.label}</span>
|
|
79
|
-
</button>
|
|
80
|
-
<input type="hidden" name={key} value={selectedOption.value} />
|
|
81
|
-
{/if}
|
|
82
|
-
{/snippet}
|
|
83
|
-
</FormControl>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<SelectorList
|
|
87
|
-
items={filteredOptions}
|
|
88
|
-
trigger={inputElement}
|
|
89
|
-
{focusIndex}
|
|
90
|
-
let:item
|
|
91
|
-
class="w-full"
|
|
92
|
-
on:select={({ detail }) => select(detail)}
|
|
93
|
-
>
|
|
94
|
-
{#if item.icon}
|
|
95
|
-
<Icon path={item.icon} size={21} class="opacity-70" />
|
|
96
|
-
{/if}
|
|
97
|
-
<span class="whitespace-nowrap pr-4">{item.label}</span>
|
|
98
|
-
</SelectorList>
|
|
99
|
-
</DropDown>
|