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
package/dist/ui/icon/Icon.svelte
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export let
|
|
6
|
-
let
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tippy, type TippyProps, type TippyInstance } from '../../utils/tippy.js'
|
|
3
|
+
import { onMount } from 'svelte'
|
|
4
|
+
|
|
5
|
+
export let path: string
|
|
6
|
+
export let title = ''
|
|
7
|
+
export let size = 22
|
|
8
|
+
let klass = ''
|
|
9
|
+
export { klass as class }
|
|
10
|
+
export let style = ''
|
|
11
|
+
export let classSVG = ''
|
|
12
|
+
export let tippyProps: Partial<TippyProps> = {}
|
|
13
|
+
export let disableTitlePropagation = false
|
|
14
|
+
const viewWidth = 24
|
|
15
|
+
const viewHeight = 24
|
|
16
|
+
|
|
17
|
+
let icon: HTMLElement
|
|
18
|
+
|
|
19
|
+
let tip: TippyInstance | null = null
|
|
20
|
+
$: tip?.setContent(title)
|
|
21
|
+
|
|
22
|
+
onMount(() => {
|
|
23
|
+
if (!title) return
|
|
24
|
+
const parent = icon.parentElement
|
|
25
|
+
const isButton = parent?.tagName === 'BUTTON' || parent?.tagName === 'A'
|
|
26
|
+
const target = parent && isButton && !disableTitlePropagation ? parent : icon
|
|
27
|
+
tip = tippy(target || icon, {
|
|
28
|
+
content: title,
|
|
29
|
+
trigger: 'mouseenter',
|
|
30
|
+
...tippyProps
|
|
31
|
+
})
|
|
32
|
+
return () => {
|
|
33
|
+
tip?.destroy()
|
|
34
|
+
}
|
|
35
|
+
})
|
|
33
36
|
</script>
|
|
34
37
|
|
|
35
38
|
<i bind:this={icon} class="grid place-content-center fill-base-content {klass}" {style}>
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type TippyProps } from '../../utils/tippy.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
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
};
|
|
19
|
-
export type IconProps = typeof __propDef.props;
|
|
20
|
-
export type IconEvents = typeof __propDef.events;
|
|
21
|
-
export type IconSlots = typeof __propDef.slots;
|
|
22
|
-
export default class Icon extends SvelteComponent<IconProps, IconEvents, IconSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
23
14
|
}
|
|
24
|
-
|
|
15
|
+
declare const Icon: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
path: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
size?: number;
|
|
19
|
+
class?: string;
|
|
20
|
+
style?: string;
|
|
21
|
+
classSVG?: string;
|
|
22
|
+
tippyProps?: Partial<TippyProps>;
|
|
23
|
+
disableTitlePropagation?: boolean;
|
|
24
|
+
}, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {}, {}, string>;
|
|
27
|
+
type Icon = InstanceType<typeof Icon>;
|
|
28
|
+
export default Icon;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export * from './dialog/index.js';
|
|
|
11
11
|
export * from './placeholder/index.js';
|
|
12
12
|
export * from './icon/index.js';
|
|
13
13
|
export * from './login/index.js';
|
|
14
|
-
export * from './slot/index.js';
|
|
15
14
|
export * from './pagination/index.js';
|
|
16
15
|
export * from './mode/index.js';
|
|
17
16
|
export * from './badge/index.js';
|
package/dist/ui/index.js
CHANGED
|
@@ -11,7 +11,6 @@ export * from './dialog/index.js';
|
|
|
11
11
|
export * from './placeholder/index.js';
|
|
12
12
|
export * from './icon/index.js';
|
|
13
13
|
export * from './login/index.js';
|
|
14
|
-
export * from './slot/index.js';
|
|
15
14
|
export * from './pagination/index.js';
|
|
16
15
|
export * from './mode/index.js';
|
|
17
16
|
export * from './badge/index.js';
|
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export let
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let
|
|
13
|
-
export let
|
|
14
|
-
export let
|
|
15
|
-
export let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { slide } from 'svelte/transition'
|
|
3
|
+
import { onMount, type Snippet } from 'svelte'
|
|
4
|
+
import { formContext } from '../../validation/form.js'
|
|
5
|
+
|
|
6
|
+
let klass = ''
|
|
7
|
+
export { klass as class }
|
|
8
|
+
export let classLabel = ''
|
|
9
|
+
export let key = ''
|
|
10
|
+
export let label: Snippet | string = ''
|
|
11
|
+
export let labelAppend: Snippet | null = null
|
|
12
|
+
export let error = ''
|
|
13
|
+
export let hint = ''
|
|
14
|
+
export let prefix: string | number = ''
|
|
15
|
+
export let prefixFor: string | number = ''
|
|
16
|
+
export let enhanceDisabled = false
|
|
17
|
+
export let labelPosition: LabelPosition = 'top'
|
|
18
|
+
export let children: Snippet<[{ key: string }]> | undefined = undefined
|
|
19
|
+
|
|
20
|
+
type LabelPosition = 'top' | 'left' | 'right'
|
|
21
|
+
|
|
22
|
+
$: _key = prefix && key ? `${prefix}_${key}` : key || ''
|
|
23
|
+
|
|
24
|
+
if (!enhanceDisabled) {
|
|
25
|
+
const { setError } = formContext.get()
|
|
26
|
+
setError[key] = (err) => (error = err)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let formControl: HTMLDivElement
|
|
30
|
+
onMount(() => {
|
|
31
|
+
const input = formControl.querySelector('input, textarea')
|
|
32
|
+
if (!input) return
|
|
33
|
+
const handleInput = () => (error = '')
|
|
34
|
+
input.addEventListener('input', handleInput)
|
|
35
|
+
return () => {
|
|
36
|
+
input.removeEventListener('input', handleInput)
|
|
37
|
+
}
|
|
38
|
+
})
|
|
33
39
|
</script>
|
|
34
40
|
|
|
35
41
|
<div class="form-control {klass}" bind:this={formControl}>
|
|
@@ -44,15 +50,21 @@ onMount(() => {
|
|
|
44
50
|
{#if label}
|
|
45
51
|
<label for="{prefixFor}{_key}" class="label cursor-pointer {classLabel}">
|
|
46
52
|
<span class="label-text">
|
|
47
|
-
|
|
53
|
+
{#if typeof label === 'string'}
|
|
54
|
+
{label}
|
|
55
|
+
{:else}
|
|
56
|
+
{@render label()}
|
|
57
|
+
{/if}
|
|
48
58
|
</span>
|
|
49
|
-
|
|
59
|
+
{#if labelAppend}
|
|
60
|
+
{@render labelAppend()}
|
|
61
|
+
{/if}
|
|
50
62
|
</label>
|
|
51
63
|
{/if}
|
|
52
|
-
|
|
53
|
-
<slot key={_key} />
|
|
54
64
|
</div>
|
|
55
65
|
|
|
66
|
+
{@render children?.({ key: _key })}
|
|
67
|
+
|
|
56
68
|
{#if error}
|
|
57
69
|
<label for="{prefixFor}{_key}" class="label" transition:slide>
|
|
58
70
|
<span class="label-text-alt text-warning">{error}</span>
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
prefix?: string | number | undefined;
|
|
13
|
-
prefixFor?: string | number | undefined;
|
|
14
|
-
enhanceDisabled?: boolean | undefined;
|
|
15
|
-
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
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;
|
|
16
12
|
};
|
|
17
|
-
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {
|
|
21
|
-
label_append: {};
|
|
22
|
-
default: {
|
|
23
|
-
key: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export type FormControlProps = typeof __propDef.props;
|
|
28
|
-
export type FormControlEvents = typeof __propDef.events;
|
|
29
|
-
export type FormControlSlots = typeof __propDef.slots;
|
|
30
|
-
export default class FormControl extends SvelteComponent<FormControlProps, FormControlEvents, FormControlSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
31
14
|
}
|
|
32
|
-
|
|
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,26 +1,33 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 }>()
|
|
9
14
|
</script>
|
|
10
15
|
|
|
11
|
-
<FormControl {...$$restProps}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
+
/>
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
<input type="hidden" name={key} value="{USE_COERCE_BOOLEAN}{value}" />
|
|
32
|
+
{/snippet}
|
|
26
33
|
</FormControl>
|
|
@@ -1,38 +1,46 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enhanceDisabled?: boolean | undefined;
|
|
14
|
-
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
input?: HTMLInputAttributes | undefined;
|
|
17
|
-
inputElement?: HTMLInputElement | undefined;
|
|
18
|
-
classWrapper?: string | undefined;
|
|
19
|
-
value?: boolean | null | undefined;
|
|
20
|
-
bindWithParams?: boolean | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
isRow?: boolean | 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;
|
|
23
12
|
};
|
|
24
|
-
|
|
25
|
-
focus: FocusEvent;
|
|
26
|
-
blur: FocusEvent;
|
|
27
|
-
change: CustomEvent<boolean>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
};
|
|
31
|
-
slots: {};
|
|
32
|
-
};
|
|
33
|
-
export type InputBooleanProps = typeof __propDef.props;
|
|
34
|
-
export type InputBooleanEvents = typeof __propDef.events;
|
|
35
|
-
export type InputBooleanSlots = typeof __propDef.slots;
|
|
36
|
-
export default class InputBoolean extends SvelteComponent<InputBooleanProps, InputBooleanEvents, InputBooleanSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
37
14
|
}
|
|
38
|
-
|
|
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,23 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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)
|
|
21
23
|
</script>
|
|
22
24
|
|
|
23
25
|
<div class={klass}>
|
|
@@ -32,24 +34,25 @@ $:
|
|
|
32
34
|
{#each _options as option, index}
|
|
33
35
|
<FormControl
|
|
34
36
|
{...props}
|
|
35
|
-
let:key
|
|
36
37
|
label={option.label}
|
|
37
38
|
prefixFor={index}
|
|
38
39
|
class="flex-row-reverse items-center justify-end gap-2"
|
|
39
40
|
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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}
|
|
53
56
|
</FormControl>
|
|
54
57
|
{/each}
|
|
55
58
|
</div>
|
|
@@ -1,42 +1,57 @@
|
|
|
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
|
-
checkboxesClass?: 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
|
-
change: Event;
|
|
27
|
-
input: Event;
|
|
28
|
-
focus: FocusEvent;
|
|
29
|
-
blur: FocusEvent;
|
|
30
|
-
} & {
|
|
31
|
-
[evt: string]: CustomEvent<any>;
|
|
32
|
-
};
|
|
33
|
-
slots: {
|
|
34
|
-
label_append: {};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export type InputCheckboxsProps = typeof __propDef.props;
|
|
38
|
-
export type InputCheckboxsEvents = typeof __propDef.events;
|
|
39
|
-
export type InputCheckboxsSlots = typeof __propDef.slots;
|
|
40
|
-
export default class InputCheckboxs extends SvelteComponent<InputCheckboxsProps, InputCheckboxsEvents, InputCheckboxsSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
41
14
|
}
|
|
42
|
-
|
|
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;
|