fuma 1.0.21 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/action/list/handlers.d.ts +2 -2
- package/dist/action/list/index.d.ts +2 -0
- package/dist/action/list/index.js +1 -0
- package/dist/action/list/trigger.d.ts +7 -1
- package/dist/action/list/trigger.js +2 -2
- package/dist/private/Meta.svelte +32 -27
- package/dist/private/Meta.svelte.d.ts +29 -17
- package/dist/private/api.d.ts +1 -1
- package/dist/private/store.d.ts +0 -1
- package/dist/server/parseFormData.d.ts +1 -1
- package/dist/server/parseQuery.d.ts +1 -1
- package/dist/server/sse.d.ts +0 -1
- package/dist/store/isSmallScreen.d.ts +0 -1
- package/dist/store/param.d.ts +0 -2
- package/dist/store/session.d.ts +0 -1
- package/dist/ui/badge/Badge.svelte +4 -3
- package/dist/ui/badge/Badge.svelte.d.ts +19 -15
- package/dist/ui/button/ButtonCopy.svelte +35 -32
- package/dist/ui/button/ButtonCopy.svelte.d.ts +23 -21
- package/dist/ui/button/ButtonDelete.svelte +23 -21
- package/dist/ui/button/ButtonDelete.svelte.d.ts +32 -20
- package/dist/ui/card/Card.svelte +13 -10
- package/dist/ui/card/Card.svelte.d.ts +39 -24
- package/dist/ui/card/CardBasic.svelte +5 -4
- package/dist/ui/card/CardBasic.svelte.d.ts +29 -18
- package/dist/ui/card/CardCollapse.svelte +35 -31
- package/dist/ui/card/CardCollapse.svelte.d.ts +37 -23
- package/dist/ui/card/CardFullScreen.svelte +8 -6
- package/dist/ui/card/CardFullScreen.svelte.d.ts +35 -20
- package/dist/ui/card/CardLink.svelte +5 -4
- package/dist/ui/card/CardLink.svelte.d.ts +29 -18
- package/dist/ui/dialog/Dialog.svelte +41 -34
- package/dist/ui/dialog/Dialog.svelte.d.ts +36 -23
- package/dist/ui/dialog/DialogConfirm.svelte +6 -4
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +33 -19
- package/dist/ui/drawer/Drawer.svelte +47 -38
- package/dist/ui/drawer/Drawer.svelte.d.ts +81 -46
- package/dist/ui/drawer/drawerFly.d.ts +0 -1
- package/dist/ui/drawer/layers.d.ts +0 -1
- package/dist/ui/form/Form.svelte +106 -87
- package/dist/ui/form/Form.svelte.d.ts +29 -16
- package/dist/ui/form/FormInput.svelte +12 -6
- package/dist/ui/form/FormSection.svelte +24 -17
- package/dist/ui/form/FormSection.svelte.d.ts +37 -25
- package/dist/ui/icon/Icon.svelte +35 -32
- package/dist/ui/icon/Icon.svelte.d.ts +25 -21
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/input/FormControl.svelte +48 -36
- package/dist/ui/input/FormControl.svelte.d.ts +32 -30
- package/dist/ui/input/InputBoolean.svelte +29 -22
- package/dist/ui/input/InputBoolean.svelte.d.ts +43 -35
- package/dist/ui/input/InputCheckboxs.svelte +37 -34
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +54 -39
- package/dist/ui/input/InputCheckboxsMenu.svelte +64 -47
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +56 -41
- package/dist/ui/input/InputCheckboxsTree.svelte +9 -6
- package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +22 -18
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +36 -28
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +20 -16
- package/dist/ui/input/InputCombo.svelte +76 -65
- package/dist/ui/input/InputCombo.svelte.d.ts +55 -39
- package/dist/ui/input/InputDate.svelte +36 -29
- package/dist/ui/input/InputDate.svelte.d.ts +20 -16
- package/dist/ui/input/InputDateTime.svelte +37 -30
- package/dist/ui/input/InputDateTime.svelte.d.ts +20 -16
- package/dist/ui/input/InputImage.svelte +52 -45
- package/dist/ui/input/InputImage.svelte.d.ts +40 -27
- package/dist/ui/input/InputImagePreview.svelte +24 -20
- package/dist/ui/input/InputImagePreview.svelte.d.ts +25 -21
- package/dist/ui/input/InputNumber.svelte +28 -22
- package/dist/ui/input/InputNumber.svelte.d.ts +20 -20
- package/dist/ui/input/InputOptionInParam.svelte +12 -10
- package/dist/ui/input/InputOptionInParam.svelte.d.ts +21 -17
- package/dist/ui/input/InputOptions.svelte +40 -34
- package/dist/ui/input/InputOptions.svelte.d.ts +19 -15
- package/dist/ui/input/InputPassword.svelte +22 -18
- package/dist/ui/input/InputPassword.svelte.d.ts +43 -35
- package/dist/ui/input/InputRadio.svelte +51 -46
- package/dist/ui/input/InputRadio.svelte.d.ts +53 -38
- package/dist/ui/input/InputRelation.svelte +129 -112
- package/dist/ui/input/InputRelation.svelte.d.ts +39 -53
- package/dist/ui/input/InputRelations.svelte +96 -90
- package/dist/ui/input/InputRelations.svelte.d.ts +35 -37
- package/dist/ui/input/InputSearch.svelte +14 -11
- package/dist/ui/input/InputSearch.svelte.d.ts +25 -21
- package/dist/ui/input/InputSelect.svelte +59 -46
- package/dist/ui/input/InputSelect.svelte.d.ts +23 -19
- package/dist/ui/input/InputText.svelte +29 -28
- package/dist/ui/input/InputText.svelte.d.ts +41 -28
- package/dist/ui/input/InputTextarea.svelte +20 -19
- package/dist/ui/input/InputTextarea.svelte.d.ts +20 -20
- package/dist/ui/input/InputTime.svelte +43 -36
- package/dist/ui/input/InputTime.svelte.d.ts +21 -36
- package/dist/ui/input/RelationAfter.svelte +13 -9
- package/dist/ui/input/RelationAfter.svelte.d.ts +24 -20
- package/dist/ui/input/SelectorList.svelte +16 -12
- package/dist/ui/input/SelectorList.svelte.d.ts +29 -20
- package/dist/ui/input/textRich/InputTextRich.svelte +63 -59
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +36 -38
- package/dist/ui/input/textRich/SuggesionList.svelte +13 -9
- package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +19 -15
- package/dist/ui/input/textRich/ToolMark.svelte +12 -9
- package/dist/ui/input/textRich/ToolMark.svelte.d.ts +22 -18
- package/dist/ui/input/textRich/ToolMarkColor.svelte +16 -12
- package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +21 -17
- package/dist/ui/input/textRich/ToolMarkLink.svelte +46 -38
- package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolMenu.svelte +34 -19
- package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +30 -26
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +13 -9
- package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +12 -7
- package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +20 -16
- package/dist/ui/input/textRich/ToolMenuNode.svelte +14 -10
- package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolsBar.svelte +21 -14
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +19 -17
- package/dist/ui/input/textRich/suggestion.d.ts +0 -1
- package/dist/ui/login/Login.svelte +37 -31
- package/dist/ui/login/Login.svelte.d.ts +18 -14
- package/dist/ui/menu/ContextMenu.svelte +37 -31
- package/dist/ui/menu/ContextMenu.svelte.d.ts +38 -25
- package/dist/ui/menu/DropDown.svelte +92 -83
- package/dist/ui/menu/DropDown.svelte.d.ts +46 -33
- package/dist/ui/menu/DropDownMenu.svelte +25 -18
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +30 -19
- package/dist/ui/mode/ToggleMode.svelte +28 -16
- package/dist/ui/mode/ToggleMode.svelte.d.ts +34 -17
- package/dist/ui/pagination/Pagination.svelte +9 -8
- package/dist/ui/pagination/Pagination.svelte.d.ts +18 -14
- package/dist/ui/placeholder/Placeholder.svelte +4 -3
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +28 -17
- package/dist/ui/placeholder/PlaceholderImage.svelte +6 -4
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +28 -17
- package/dist/ui/range/RangePicker.svelte +76 -63
- package/dist/ui/range/RangePicker.svelte.d.ts +29 -24
- package/dist/ui/range/RangePickerButton.svelte +45 -40
- package/dist/ui/range/RangePickerButton.svelte.d.ts +21 -19
- package/dist/ui/table/Table.svelte +35 -28
- package/dist/ui/table/Table.svelte.d.ts +24 -19
- package/dist/ui/table/TableBody.svelte +18 -12
- package/dist/ui/table/TableBody.svelte.d.ts +20 -15
- package/dist/ui/table/TableCell.svelte +13 -10
- package/dist/ui/table/TableCell.svelte.d.ts +19 -14
- package/dist/ui/table/TableFieldsEdition.svelte +58 -52
- package/dist/ui/table/TableFieldsEdition.svelte.d.ts +20 -15
- package/dist/ui/table/TableHead.svelte +20 -21
- package/dist/ui/table/TableHead.svelte.d.ts +19 -14
- package/dist/ui/table/TableViewSelect.svelte +50 -37
- package/dist/ui/table/TableViewSelect.svelte.d.ts +27 -23
- package/dist/ui/table/cell/TableCellArray.svelte +5 -3
- package/dist/ui/table/cell/TableCellArray.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellBoolean.svelte +4 -3
- package/dist/ui/table/cell/TableCellBoolean.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellNumber.svelte +2 -1
- package/dist/ui/table/cell/TableCellNumber.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellString.svelte +5 -2
- package/dist/ui/table/cell/TableCellString.svelte.d.ts +19 -25
- package/dist/ui/table/field.d.ts +32 -40
- package/dist/ui/table/field.js +1 -1
- package/dist/ui/table/head/TableHeadBoolean.svelte +6 -3
- package/dist/ui/table/head/TableHeadBoolean.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadDate.svelte +61 -113
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadDefault.svelte +5 -2
- package/dist/ui/table/head/TableHeadDefault.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadNumber.svelte +67 -76
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadSelect.svelte +47 -41
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +21 -27
- package/dist/ui/table/head/TableHeadString.svelte +14 -8
- package/dist/ui/table/head/TableHeadString.svelte.d.ts +18 -24
- package/dist/ui/tabs/Tabs.svelte +8 -5
- package/dist/ui/tabs/Tabs.svelte.d.ts +19 -15
- package/dist/ui/tabs/TabsIcon.svelte +31 -28
- package/dist/ui/tabs/TabsIcon.svelte.d.ts +21 -17
- package/dist/utils/eventEmitter.d.ts +4 -4
- package/dist/utils/tippy.d.ts +1 -1
- package/dist/validation/form.d.ts +0 -1
- package/dist/validation/zod.d.ts +96 -162
- package/dist/validation/zod.js +2 -4
- package/package.json +134 -138
- package/dist/ui/form/FormInput.svelte.d.ts +0 -152
- package/dist/ui/form/formInput.d.ts +0 -90
- package/dist/ui/slot/Slot.svelte +0 -35
- package/dist/ui/slot/Slot.svelte.d.ts +0 -22
- package/dist/ui/slot/Span.svelte +0 -4
- package/dist/ui/slot/Span.svelte.d.ts +0 -16
- package/dist/ui/slot/index.d.ts +0 -1
- package/dist/ui/slot/index.js +0 -1
- package/dist/ui/table/head/OrderButtons.svelte +0 -37
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +0 -20
- package/dist/ui/table/head/index.d.ts +0 -19
|
@@ -1,38 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
prefixFor?: string | number | undefined;
|
|
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?: Date | null | undefined;
|
|
20
|
-
bindWithParams?: boolean | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
getDefaultDate?: (() => Date) | undefined;
|
|
1
|
+
import { type InputProps } from './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;
|
|
23
12
|
};
|
|
24
|
-
|
|
25
|
-
focus: FocusEvent;
|
|
26
|
-
blur: FocusEvent;
|
|
27
|
-
input: CustomEvent<Date | null>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
};
|
|
31
|
-
slots: {};
|
|
32
|
-
};
|
|
33
|
-
export type InputTimeProps = typeof __propDef.props;
|
|
34
|
-
export type InputTimeEvents = typeof __propDef.events;
|
|
35
|
-
export type InputTimeSlots = typeof __propDef.slots;
|
|
36
|
-
export default class InputTime extends SvelteComponent<InputTimeProps, InputTimeEvents, InputTimeSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
37
14
|
}
|
|
38
|
-
|
|
15
|
+
declare const InputTime: $$__sveltets_2_IsomorphicComponent<InputProps<Date>, {
|
|
16
|
+
focus: FocusEvent;
|
|
17
|
+
blur: FocusEvent;
|
|
18
|
+
input: CustomEvent<Date | null>;
|
|
19
|
+
} & {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type InputTime = InstanceType<typeof InputTime>;
|
|
23
|
+
export default InputTime;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { fade } from 'svelte/transition'
|
|
3
|
+
import { createEventDispatcher } from 'svelte'
|
|
4
|
+
import { mdiLoading, mdiPlus } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
import Icon from '../icon/Icon.svelte'
|
|
7
|
+
|
|
8
|
+
export let isLoading: boolean
|
|
9
|
+
export let createUrl = ''
|
|
10
|
+
export let createTitle = ''
|
|
11
|
+
export let createIcon = mdiPlus
|
|
12
|
+
|
|
13
|
+
const dispatch = createEventDispatcher<{ unselect: void; create: void }>()
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
{#if isLoading}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
unselect: CustomEvent<void>;
|
|
11
|
-
create: CustomEvent<void>;
|
|
12
|
-
} & {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {};
|
|
16
|
-
};
|
|
17
|
-
export type RelationAfterProps = typeof __propDef.props;
|
|
18
|
-
export type RelationAfterEvents = typeof __propDef.events;
|
|
19
|
-
export type RelationAfterSlots = typeof __propDef.slots;
|
|
20
|
-
export default class RelationAfter extends SvelteComponent<RelationAfterProps, RelationAfterEvents, RelationAfterSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
21
13
|
}
|
|
22
|
-
|
|
14
|
+
declare const RelationAfter: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
createUrl?: string;
|
|
17
|
+
createTitle?: string;
|
|
18
|
+
createIcon?: string;
|
|
19
|
+
}, {
|
|
20
|
+
unselect: CustomEvent<void>;
|
|
21
|
+
create: CustomEvent<void>;
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {}, {}, string>;
|
|
25
|
+
type RelationAfter = InstanceType<typeof RelationAfter>;
|
|
26
|
+
export default RelationAfter;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
<script generics="Item extends {id: string
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
|
|
1
|
+
<script lang="ts" generics="Item extends {id: string | number}">
|
|
2
|
+
import { createEventDispatcher } from 'svelte'
|
|
3
|
+
import { selector } from '../../action/selector.js'
|
|
4
|
+
|
|
5
|
+
let klass = ''
|
|
6
|
+
export { klass as class }
|
|
7
|
+
|
|
8
|
+
export let items: Item[]
|
|
9
|
+
export let isError = false
|
|
10
|
+
export let isLoading = false
|
|
11
|
+
export let focusIndex = 0
|
|
12
|
+
export let trigger: HTMLElement | undefined = undefined
|
|
13
|
+
export let keyDownEvent: KeyboardEvent | undefined = undefined
|
|
14
|
+
export let keyDownPreventDefault = true
|
|
15
|
+
|
|
16
|
+
const dispatch = createEventDispatcher<{ select: number }>()
|
|
13
17
|
</script>
|
|
14
18
|
|
|
15
19
|
<ul
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
declare class __sveltets_Render<Item extends {
|
|
3
|
-
id: string;
|
|
2
|
+
id: string | number;
|
|
4
3
|
}> {
|
|
5
4
|
props(): {
|
|
6
|
-
class?: string
|
|
5
|
+
class?: string;
|
|
7
6
|
items: Item[];
|
|
8
|
-
isError?: boolean
|
|
9
|
-
isLoading?: boolean
|
|
10
|
-
focusIndex?: number
|
|
7
|
+
isError?: boolean;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
focusIndex?: number;
|
|
11
10
|
trigger?: HTMLElement | undefined;
|
|
12
11
|
keyDownEvent?: KeyboardEvent | undefined;
|
|
13
|
-
keyDownPreventDefault?: boolean
|
|
12
|
+
keyDownPreventDefault?: boolean;
|
|
14
13
|
};
|
|
15
14
|
events(): {
|
|
16
15
|
select: CustomEvent<number>;
|
|
@@ -23,18 +22,28 @@ declare class __sveltets_Render<Item extends {
|
|
|
23
22
|
index: any;
|
|
24
23
|
};
|
|
25
24
|
};
|
|
25
|
+
bindings(): string;
|
|
26
|
+
exports(): {};
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
interface $$IsomorphicComponent {
|
|
29
|
+
new <Item extends {
|
|
30
|
+
id: string | number;
|
|
31
|
+
}>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Item>['props']> & {
|
|
32
|
+
children?: any;
|
|
33
|
+
}>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Item>['props']>, ReturnType<__sveltets_Render<Item>['events']>, ReturnType<__sveltets_Render<Item>['slots']>> & {
|
|
34
|
+
$$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
|
|
35
|
+
} & ReturnType<__sveltets_Render<Item>['exports']>;
|
|
36
|
+
<Item extends {
|
|
37
|
+
id: string | number;
|
|
38
|
+
}>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {
|
|
39
|
+
$$events?: ReturnType<__sveltets_Render<Item>['events']>;
|
|
40
|
+
$$slots?: ReturnType<__sveltets_Render<Item>['slots']>;
|
|
41
|
+
children?: any;
|
|
42
|
+
}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
43
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
39
44
|
}
|
|
40
|
-
|
|
45
|
+
declare const SelectorList: $$IsomorphicComponent;
|
|
46
|
+
type SelectorList<Item extends {
|
|
47
|
+
id: string | number;
|
|
48
|
+
}> = InstanceType<typeof SelectorList<Item>>;
|
|
49
|
+
export default SelectorList;
|
|
@@ -1,63 +1,67 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher, onMount, type ComponentProps } from 'svelte'
|
|
3
|
+
import { Editor } from '@tiptap/core'
|
|
4
|
+
import debounce from 'debounce'
|
|
5
|
+
|
|
6
|
+
import { jsonParse } from '../../../utils/jsonParse.js'
|
|
7
|
+
import { FormControl } from '../index.js'
|
|
8
|
+
import ToolsBar from './ToolsBar.svelte'
|
|
9
|
+
import { extensions } from './extensions.js'
|
|
10
|
+
|
|
11
|
+
type $$Props = ComponentProps<FormControl> & { value?: string; classToolbar?: string }
|
|
12
|
+
|
|
13
|
+
export let value = ''
|
|
14
|
+
export let classToolbar = ''
|
|
15
|
+
|
|
16
|
+
let element: HTMLDivElement
|
|
17
|
+
let editor: Editor | null = null
|
|
18
|
+
|
|
19
|
+
const dispatch = createEventDispatcher<{ change: void }>()
|
|
20
|
+
|
|
21
|
+
onMount(() => {
|
|
22
|
+
initEditor()
|
|
23
|
+
return () => {
|
|
24
|
+
if (editor) editor.destroy()
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
function initEditor() {
|
|
29
|
+
const valueAsHtml = !value.startsWith('{') && value !== 'null'
|
|
30
|
+
editor = new Editor({
|
|
31
|
+
element,
|
|
32
|
+
content: valueAsHtml ? value : jsonParse(value, undefined),
|
|
33
|
+
editorProps: {
|
|
34
|
+
attributes: {
|
|
35
|
+
class: 'prose max-w-[210mm] mx-auto focus:outline-none'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
extensions,
|
|
39
|
+
onTransaction() {
|
|
40
|
+
editor = editor
|
|
41
|
+
updateValue()
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const updateValue = debounce(() => {
|
|
47
|
+
if (!editor) return
|
|
48
|
+
const newValue = JSON.stringify(editor.getJSON())
|
|
49
|
+
if (newValue === value) return
|
|
50
|
+
value = newValue
|
|
51
|
+
dispatch('change')
|
|
52
|
+
}, 120)
|
|
51
53
|
</script>
|
|
52
54
|
|
|
53
|
-
<FormControl {...$$restProps}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
<FormControl {...$$restProps}>
|
|
56
|
+
{#snippet children({ key })}
|
|
57
|
+
<div class="bordered relative rounded-lg border">
|
|
58
|
+
{#if editor}
|
|
59
|
+
<ToolsBar {editor} class={classToolbar} />
|
|
60
|
+
{/if}
|
|
61
|
+
<div bind:this={element} class="min-h-[20rem] p-4 pb-10"></div>
|
|
62
|
+
</div>
|
|
63
|
+
{#if key}
|
|
64
|
+
<input type="hidden" name={key} {value} />
|
|
57
65
|
{/if}
|
|
58
|
-
|
|
59
|
-
</div>
|
|
60
|
-
{#if key}
|
|
61
|
-
<input type="hidden" name={key} {value} />
|
|
62
|
-
{/if}
|
|
66
|
+
{/snippet}
|
|
63
67
|
</FormControl>
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
key?: string | undefined;
|
|
12
|
-
label?: string | import("svelte").ComponentType | import("../../..").ComponentAndProps | undefined;
|
|
13
|
-
error?: string | undefined;
|
|
14
|
-
hint?: string | undefined;
|
|
15
|
-
prefix?: string | number | undefined;
|
|
16
|
-
prefixFor?: string | number | undefined;
|
|
17
|
-
enhanceDisabled?: boolean | undefined;
|
|
18
|
-
labelPosition?: ("top" | "left" | "right") | undefined;
|
|
19
|
-
} & {
|
|
20
|
-
value?: string | undefined;
|
|
21
|
-
classToolbar?: 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
|
-
insertMedia: CustomEvent<void>;
|
|
25
|
-
change: CustomEvent<void>;
|
|
26
|
-
} & {
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {};
|
|
30
|
-
};
|
|
31
|
-
export type InputTextRichProps = typeof __propDef.props;
|
|
32
|
-
export type InputTextRichEvents = typeof __propDef.events;
|
|
33
|
-
export type InputTextRichSlots = typeof __propDef.slots;
|
|
34
|
-
export default class InputTextRich extends SvelteComponent<InputTextRichProps, InputTextRichEvents, InputTextRichSlots> {
|
|
35
|
-
get setImage(): (image: {
|
|
36
|
-
src: string;
|
|
37
|
-
alt: string;
|
|
38
|
-
}) => boolean;
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
39
13
|
}
|
|
40
|
-
|
|
14
|
+
declare const InputTextRich: $$__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
|
+
value?: string;
|
|
31
|
+
classToolbar?: string;
|
|
32
|
+
}, {
|
|
33
|
+
change: CustomEvent<void>;
|
|
34
|
+
} & {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
}, {}, {}, string>;
|
|
37
|
+
type InputTextRich = InstanceType<typeof InputTextRich>;
|
|
38
|
+
export default InputTextRich;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SuggestionProps } from '@tiptap/suggestion'
|
|
3
|
+
import { SelectorList } from '../index.js'
|
|
4
|
+
import type { SuggestionItem } from './suggestion.js'
|
|
5
|
+
|
|
6
|
+
export let props: SuggestionProps<SuggestionItem>
|
|
7
|
+
export let keyDownEvent: KeyboardEvent | undefined = undefined
|
|
8
|
+
|
|
9
|
+
function handleSelect(index: number) {
|
|
10
|
+
const item = props.items[index]
|
|
11
|
+
if (!item) return
|
|
12
|
+
props.command(item)
|
|
13
|
+
}
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
<SelectorList
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { SuggestionProps } from '@tiptap/suggestion';
|
|
3
2
|
import type { SuggestionItem } from './suggestion.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
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> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
8
13
|
};
|
|
9
|
-
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export type SuggesionListProps = typeof __propDef.props;
|
|
15
|
-
export type SuggesionListEvents = typeof __propDef.events;
|
|
16
|
-
export type SuggesionListSlots = typeof __propDef.slots;
|
|
17
|
-
export default class SuggesionList extends SvelteComponent<SuggesionListProps, SuggesionListEvents, SuggesionListSlots> {
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
18
15
|
}
|
|
19
|
-
|
|
16
|
+
declare const SuggesionList: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
props: SuggestionProps<SuggestionItem>;
|
|
18
|
+
keyDownEvent?: KeyboardEvent | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type SuggesionList = InstanceType<typeof SuggesionList>;
|
|
23
|
+
export default SuggesionList;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let
|
|
7
|
-
export let
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '@tiptap/core'
|
|
3
|
+
import { Icon } from '../../icon/index.js'
|
|
4
|
+
import { tip } from '../../../action/tip.js'
|
|
5
|
+
|
|
6
|
+
export let editor: Editor
|
|
7
|
+
export let key: string
|
|
8
|
+
export let label: string
|
|
9
|
+
export let icon: string
|
|
10
|
+
export let action: () => void
|
|
11
|
+
|
|
12
|
+
$: isActive = editor.isActive(key)
|
|
10
13
|
</script>
|
|
11
14
|
|
|
12
15
|
<button
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
10
12
|
};
|
|
11
|
-
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
15
|
-
};
|
|
16
|
-
export type ToolMarkProps = typeof __propDef.props;
|
|
17
|
-
export type ToolMarkEvents = typeof __propDef.events;
|
|
18
|
-
export type ToolMarkSlots = typeof __propDef.slots;
|
|
19
|
-
export default class ToolMark extends SvelteComponent<ToolMarkProps, ToolMarkEvents, ToolMarkSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
20
14
|
}
|
|
21
|
-
|
|
15
|
+
declare const ToolMark: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
key: string;
|
|
18
|
+
label: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
action: () => void;
|
|
21
|
+
}, {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
}, {}, {}, string>;
|
|
24
|
+
type ToolMark = InstanceType<typeof ToolMark>;
|
|
25
|
+
export default ToolMark;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export let
|
|
6
|
-
export let
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '../../icon/index.js'
|
|
3
|
+
import { tip } from '../../../action/tip.js'
|
|
4
|
+
|
|
5
|
+
export let icon: string
|
|
6
|
+
export let label: string
|
|
7
|
+
export let color: string
|
|
8
|
+
export let setColor: (color: string) => void
|
|
9
|
+
|
|
10
|
+
let inputColor: HTMLInputElement
|
|
11
|
+
|
|
12
|
+
function handleClick() {
|
|
13
|
+
inputColor.click()
|
|
14
|
+
setColor(color)
|
|
15
|
+
}
|
|
12
16
|
</script>
|
|
13
17
|
|
|
14
18
|
<div class="flex align-bottom">
|
|
@@ -25,7 +29,7 @@ function handleClick() {
|
|
|
25
29
|
<span
|
|
26
30
|
class="badge indicator-item badge-xs scale-75 border transition-none"
|
|
27
31
|
style:background={color}
|
|
28
|
-
|
|
32
|
+
></span>
|
|
29
33
|
<Icon path={icon} size={19} class="opacity-70" />
|
|
30
34
|
</div>
|
|
31
35
|
</button>
|