fuma 1.0.20 → 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 +43 -35
- package/dist/ui/range/RangePickerButton.svelte.d.ts +21 -17
- 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,20 +1,24 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type Options } from '../../utils/options.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
9
12
|
};
|
|
10
|
-
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export type InputOptionInParamProps = typeof __propDef.props;
|
|
16
|
-
export type InputOptionInParamEvents = typeof __propDef.events;
|
|
17
|
-
export type InputOptionInParamSlots = typeof __propDef.slots;
|
|
18
|
-
export default class InputOptionInParam extends SvelteComponent<InputOptionInParamProps, InputOptionInParamEvents, InputOptionInParamSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
declare const InputOptionInParam: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
class?: string;
|
|
17
|
+
key: string;
|
|
18
|
+
options: Options;
|
|
19
|
+
removeKeys?: string[];
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type InputOptionInParam = InstanceType<typeof InputOptionInParam>;
|
|
24
|
+
export default InputOptionInParam;
|
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { slide } from 'svelte/transition'
|
|
3
|
+
import { mdiPlus, mdiTrashCanOutline } from '@mdi/js'
|
|
4
|
+
import { toast } from 'svelte-sonner'
|
|
5
|
+
|
|
6
|
+
import { Icon } from '../icon/index.js'
|
|
7
|
+
import { listEditable } from '../../action/list/index.js'
|
|
8
|
+
|
|
9
|
+
export let key: string
|
|
10
|
+
export let value: string | undefined | null = '[]'
|
|
11
|
+
|
|
12
|
+
let options: string[] = JSON.parse(value || '[]')
|
|
13
|
+
let newOption = ''
|
|
14
|
+
let optionInput: HTMLInputElement
|
|
15
|
+
|
|
16
|
+
function handleKeyDown(e: KeyboardEvent) {
|
|
17
|
+
if (e.key === 'Enter') {
|
|
18
|
+
e.preventDefault()
|
|
19
|
+
createOption()
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function createOption() {
|
|
24
|
+
if (!newOption) return
|
|
25
|
+
if (options.includes(newOption)) return toast.warning('Cette option éxiste déjà !')
|
|
26
|
+
options = [...options, newOption]
|
|
27
|
+
newOption = ''
|
|
28
|
+
value = JSON.stringify(options)
|
|
29
|
+
optionInput.focus()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function removeOption(index: number) {
|
|
33
|
+
options = [...options.slice(0, index), ...options.slice(index + 1)]
|
|
34
|
+
value = JSON.stringify(options)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function onChange(newOrder: string[]) {
|
|
38
|
+
options = newOrder
|
|
39
|
+
value = JSON.stringify(options)
|
|
40
|
+
}
|
|
35
41
|
</script>
|
|
36
42
|
|
|
37
43
|
<input type="hidden" name={key} {value} />
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type InputOptionsProps = typeof __propDef.props;
|
|
13
|
-
export type InputOptionsEvents = typeof __propDef.events;
|
|
14
|
-
export type InputOptionsSlots = typeof __propDef.slots;
|
|
15
|
-
export default class InputOptions extends SvelteComponent<InputOptionsProps, InputOptionsEvents, InputOptionsSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
16
13
|
}
|
|
17
|
-
|
|
14
|
+
declare const InputOptions: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
key: string;
|
|
16
|
+
value?: string | undefined | null;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type InputOptions = InstanceType<typeof InputOptions>;
|
|
21
|
+
export default InputOptions;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { FormControl, type InputProps } from './index.js'
|
|
3
|
+
|
|
4
|
+
type $$Props = InputProps & { autocomplete?: string }
|
|
5
|
+
$: ({ input, value: _value, ...props } = $$props as $$Props)
|
|
6
|
+
export let value = _value
|
|
7
|
+
export let autocomplete = 'current-password'
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
|
-
<FormControl {...props}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
<FormControl {...props}>
|
|
11
|
+
{#snippet children({ key })}
|
|
12
|
+
<input
|
|
13
|
+
bind:value
|
|
14
|
+
on:input
|
|
15
|
+
on:focus
|
|
16
|
+
on:blur
|
|
17
|
+
type="password"
|
|
18
|
+
name={key}
|
|
19
|
+
id={key}
|
|
20
|
+
class="input input-bordered"
|
|
21
|
+
{autocomplete}
|
|
22
|
+
{...input}
|
|
23
|
+
/>
|
|
24
|
+
{/snippet}
|
|
21
25
|
</FormControl>
|
|
@@ -1,37 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
prefixFor?: string | number | undefined;
|
|
12
|
-
enhanceDisabled?: boolean | undefined;
|
|
13
|
-
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
14
|
-
} & {
|
|
15
|
-
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
16
|
-
inputElement?: HTMLInputElement | undefined;
|
|
17
|
-
classWrapper?: string | undefined;
|
|
18
|
-
value?: string | null | undefined;
|
|
19
|
-
bindWithParams?: boolean | undefined;
|
|
20
|
-
} & {
|
|
21
|
-
autocomplete?: string | undefined;
|
|
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;
|
|
22
11
|
};
|
|
23
|
-
|
|
24
|
-
input: Event;
|
|
25
|
-
focus: FocusEvent;
|
|
26
|
-
blur: FocusEvent;
|
|
27
|
-
} & {
|
|
28
|
-
[evt: string]: CustomEvent<any>;
|
|
29
|
-
};
|
|
30
|
-
slots: {};
|
|
31
|
-
};
|
|
32
|
-
export type InputPasswordProps = typeof __propDef.props;
|
|
33
|
-
export type InputPasswordEvents = typeof __propDef.events;
|
|
34
|
-
export type InputPasswordSlots = typeof __propDef.slots;
|
|
35
|
-
export default class InputPassword extends SvelteComponent<InputPasswordProps, InputPasswordEvents, InputPasswordSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
36
13
|
}
|
|
37
|
-
|
|
14
|
+
declare const InputPassword: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
class?: string;
|
|
16
|
+
classLabel?: string;
|
|
17
|
+
key?: string;
|
|
18
|
+
label?: import("svelte").Snippet | string;
|
|
19
|
+
labelAppend?: import("svelte").Snippet | null;
|
|
20
|
+
error?: string;
|
|
21
|
+
hint?: string;
|
|
22
|
+
prefix?: string | number;
|
|
23
|
+
prefixFor?: string | number;
|
|
24
|
+
enhanceDisabled?: boolean;
|
|
25
|
+
labelPosition?: "top" | "left" | "right";
|
|
26
|
+
children?: import("svelte").Snippet<[{
|
|
27
|
+
key: string;
|
|
28
|
+
}]> | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
input?: import("svelte/elements").HTMLInputAttributes;
|
|
31
|
+
inputElement?: HTMLInputElement;
|
|
32
|
+
classWrapper?: string;
|
|
33
|
+
value?: string | null | undefined;
|
|
34
|
+
bindWithParams?: boolean;
|
|
35
|
+
} & {
|
|
36
|
+
autocomplete?: string;
|
|
37
|
+
}, {
|
|
38
|
+
input: Event;
|
|
39
|
+
focus: FocusEvent;
|
|
40
|
+
blur: FocusEvent;
|
|
41
|
+
} & {
|
|
42
|
+
[evt: string]: CustomEvent<any>;
|
|
43
|
+
}, {}, {}, string>;
|
|
44
|
+
type InputPassword = InstanceType<typeof InputPassword>;
|
|
45
|
+
export default InputPassword;
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import { slide } from 'svelte/transition'
|
|
4
|
+
|
|
5
|
+
import { type Options, parseOptions } from '../../utils/options.js'
|
|
6
|
+
import { formContext } from '../../validation/form.js'
|
|
7
|
+
import { FormControl, bindValueWithParams, type InputProps } from './index.js'
|
|
8
|
+
|
|
9
|
+
type $$Props = InputProps & { options: Options; optionsClass?: string }
|
|
10
|
+
$: ({
|
|
11
|
+
input,
|
|
12
|
+
value: _value,
|
|
13
|
+
error: _error,
|
|
14
|
+
options,
|
|
15
|
+
optionsClass = '',
|
|
16
|
+
hint,
|
|
17
|
+
class: klass,
|
|
18
|
+
...props
|
|
19
|
+
} = $$props as $$Props)
|
|
20
|
+
export let value = _value
|
|
21
|
+
export let error = _error
|
|
22
|
+
|
|
23
|
+
$: _options = parseOptions(options)
|
|
24
|
+
|
|
25
|
+
let formControl: HTMLDivElement
|
|
26
|
+
const { setError } = formContext.get()
|
|
27
|
+
onMount(() => {
|
|
28
|
+
if (props.key) setError[props.key] = (err) => (error = err)
|
|
29
|
+
|
|
30
|
+
const inputs = formControl.querySelectorAll('input')
|
|
31
|
+
const handleInput = () => (error = '')
|
|
32
|
+
inputs.forEach((input) => input.addEventListener('input', handleInput))
|
|
33
|
+
return () => {
|
|
34
|
+
inputs.forEach((input) => input.removeEventListener('input', handleInput))
|
|
35
|
+
}
|
|
36
|
+
})
|
|
33
37
|
</script>
|
|
34
38
|
|
|
35
39
|
<div class={klass} bind:this={formControl}>
|
|
@@ -44,25 +48,26 @@ onMount(() => {
|
|
|
44
48
|
{#each _options as option}
|
|
45
49
|
<FormControl
|
|
46
50
|
{...props}
|
|
47
|
-
let:key
|
|
48
51
|
enhanceDisabled
|
|
49
52
|
label={option.label}
|
|
50
53
|
prefixFor={option.value}
|
|
51
54
|
class="flex-row-reverse items-center justify-end gap-2"
|
|
52
55
|
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
{#snippet children({ key })}
|
|
57
|
+
<input
|
|
58
|
+
use:bindValueWithParams={{ bindEnable: props.bindWithParams }}
|
|
59
|
+
bind:group={value}
|
|
60
|
+
on:input
|
|
61
|
+
on:focus
|
|
62
|
+
on:blur
|
|
63
|
+
value={option.value}
|
|
64
|
+
type="radio"
|
|
65
|
+
name={key}
|
|
66
|
+
id="{option.value}{key}"
|
|
67
|
+
class="radio"
|
|
68
|
+
{...input}
|
|
69
|
+
/>
|
|
70
|
+
{/snippet}
|
|
66
71
|
</FormControl>
|
|
67
72
|
{/each}
|
|
68
73
|
</div>
|
|
@@ -1,41 +1,56 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type Options } from '../../utils/options.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enhanceDisabled?: boolean | undefined;
|
|
14
|
-
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
input?: import("svelte/elements.js").HTMLInputAttributes | undefined;
|
|
17
|
-
inputElement?: HTMLInputElement | undefined;
|
|
18
|
-
classWrapper?: string | undefined;
|
|
19
|
-
value?: string | null | undefined;
|
|
20
|
-
bindWithParams?: boolean | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
options: Options;
|
|
23
|
-
optionsClass?: string | undefined;
|
|
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;
|
|
24
12
|
};
|
|
25
|
-
|
|
26
|
-
input: Event;
|
|
27
|
-
focus: FocusEvent;
|
|
28
|
-
blur: FocusEvent;
|
|
29
|
-
} & {
|
|
30
|
-
[evt: string]: CustomEvent<any>;
|
|
31
|
-
};
|
|
32
|
-
slots: {
|
|
33
|
-
label_append: {};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export type InputRadioProps = typeof __propDef.props;
|
|
37
|
-
export type InputRadioEvents = typeof __propDef.events;
|
|
38
|
-
export type InputRadioSlots = typeof __propDef.slots;
|
|
39
|
-
export default class InputRadio extends SvelteComponent<InputRadioProps, InputRadioEvents, InputRadioSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
40
14
|
}
|
|
41
|
-
|
|
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 InputRadio: $$__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
|
+
optionsClass?: string;
|
|
44
|
+
}, {
|
|
45
|
+
label_append: {};
|
|
46
|
+
}>, {
|
|
47
|
+
input: Event;
|
|
48
|
+
focus: FocusEvent;
|
|
49
|
+
blur: FocusEvent;
|
|
50
|
+
} & {
|
|
51
|
+
[evt: string]: CustomEvent<any>;
|
|
52
|
+
}, {
|
|
53
|
+
label_append: {};
|
|
54
|
+
}, {}, string>;
|
|
55
|
+
type InputRadio = InstanceType<typeof InputRadio>;
|
|
56
|
+
export default InputRadio;
|