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,40 +1,53 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
let
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import { mdiChevronDown, mdiContentSaveEditOutline, mdiPlus } from '@mdi/js'
|
|
4
|
+
import { page } from '$app/stores'
|
|
5
|
+
import { enhance } from '$app/forms'
|
|
6
|
+
|
|
7
|
+
import { Icon } from '../icon/index.js'
|
|
8
|
+
import { Dialog } from '../dialog/index.js'
|
|
9
|
+
import { DropDown } from '../menu/index.js'
|
|
10
|
+
import { InputText } from '../input/index.js'
|
|
11
|
+
import { useForm } from '../../validation/form.js'
|
|
12
|
+
|
|
13
|
+
type View = {
|
|
14
|
+
id: string
|
|
15
|
+
name: string
|
|
16
|
+
query: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export let key: string
|
|
20
|
+
export let views: View[]
|
|
21
|
+
export let action = ''
|
|
22
|
+
export let actionCreate = '?/view_create'
|
|
23
|
+
export let actionUpdate = '?/view_update'
|
|
24
|
+
export let actionDelete = '?/view_delete'
|
|
25
|
+
|
|
26
|
+
let dialog: HTMLDialogElement
|
|
27
|
+
const form = useForm({
|
|
28
|
+
onSuccess() {
|
|
29
|
+
dialog.close()
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
let query = getQuery($page.url)
|
|
34
|
+
let selectedView = views.find((v) => v.query === query)
|
|
35
|
+
let isNewView = !!query && !selectedView
|
|
36
|
+
|
|
37
|
+
onMount(() =>
|
|
38
|
+
page.subscribe(({ url }) => {
|
|
39
|
+
query = getQuery(url)
|
|
40
|
+
selectedView = views.find((v) => v.query === query)
|
|
41
|
+
isNewView = !!query && !selectedView
|
|
42
|
+
})
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
function getQuery({ searchParams }: URL) {
|
|
46
|
+
const searchParam = new URLSearchParams(searchParams)
|
|
47
|
+
searchParam.delete('skip')
|
|
48
|
+
searchParam.delete('take')
|
|
49
|
+
return searchParam.toString()
|
|
50
|
+
}
|
|
38
51
|
</script>
|
|
39
52
|
|
|
40
53
|
<DropDown>
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
actionCreate?: string | undefined;
|
|
12
|
-
actionUpdate?: string | undefined;
|
|
13
|
-
actionDelete?: 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;
|
|
14
11
|
};
|
|
15
|
-
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export type TableViewSelectProps = typeof __propDef.props;
|
|
21
|
-
export type TableViewSelectEvents = typeof __propDef.events;
|
|
22
|
-
export type TableViewSelectSlots = typeof __propDef.slots;
|
|
23
|
-
export default class TableViewSelect extends SvelteComponent<TableViewSelectProps, TableViewSelectEvents, TableViewSelectSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
24
13
|
}
|
|
25
|
-
|
|
14
|
+
declare const TableViewSelect: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
key: string;
|
|
16
|
+
views: {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
query: string;
|
|
20
|
+
}[];
|
|
21
|
+
action?: string;
|
|
22
|
+
actionCreate?: string;
|
|
23
|
+
actionUpdate?: string;
|
|
24
|
+
actionDelete?: string;
|
|
25
|
+
}, {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {}, {}, string>;
|
|
28
|
+
type TableViewSelect = InstanceType<typeof TableViewSelect>;
|
|
29
|
+
export default TableViewSelect;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Badge } from '../../badge/index.js'
|
|
3
|
+
import { component, type ComponentAndProps } from '../../../utils/component.js'
|
|
4
|
+
|
|
5
|
+
export let value: (ComponentAndProps | string | number | boolean)[]
|
|
4
6
|
</script>
|
|
5
7
|
|
|
6
8
|
<td>
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type ComponentAndProps } from '../../../utils/component.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
12
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type TableCellArrayProps = typeof __propDef.props;
|
|
13
|
-
export type TableCellArrayEvents = typeof __propDef.events;
|
|
14
|
-
export type TableCellArraySlots = typeof __propDef.slots;
|
|
15
|
-
export default class TableCellArray extends SvelteComponent<TableCellArrayProps, TableCellArrayEvents, TableCellArraySlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
declare const TableCellArray: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
value: (ComponentAndProps | string | number | boolean)[];
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type TableCellArray = InstanceType<typeof TableCellArray>;
|
|
21
|
+
export default TableCellArray;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiCheck, mdiClose } from '@mdi/js'
|
|
3
|
+
import { Icon } from '../../icon/index.js'
|
|
4
|
+
export let value: boolean
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<td>
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type TableCellBooleanProps = typeof __propDef.props;
|
|
12
|
-
export type TableCellBooleanEvents = typeof __propDef.events;
|
|
13
|
-
export type TableCellBooleanSlots = typeof __propDef.slots;
|
|
14
|
-
export default class TableCellBoolean extends SvelteComponent<TableCellBooleanProps, TableCellBooleanEvents, TableCellBooleanSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
declare const TableCellBoolean: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
value: boolean;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type TableCellBoolean = InstanceType<typeof TableCellBoolean>;
|
|
20
|
+
export default TableCellBoolean;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type TableCellNumberProps = typeof __propDef.props;
|
|
12
|
-
export type TableCellNumberEvents = typeof __propDef.events;
|
|
13
|
-
export type TableCellNumberSlots = typeof __propDef.slots;
|
|
14
|
-
export default class TableCellNumber extends SvelteComponent<TableCellNumberProps, TableCellNumberEvents, TableCellNumberSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
declare const TableCellNumber: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
value: number;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type TableCellNumber = InstanceType<typeof TableCellNumber>;
|
|
20
|
+
export default TableCellNumber;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { TableField } from '../index.js'
|
|
3
|
+
|
|
4
|
+
export let value: string
|
|
5
|
+
export let field: TableField
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
<td data-field-key={field.key} data-field-type={field.type === 'textarea' ? 'textarea' : 'string'}>
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { TableField } from '../index.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 TableCellStringProps<Item extends {
|
|
16
|
-
id: string;
|
|
17
|
-
}> = ReturnType<__sveltets_Render<Item>['props']>;
|
|
18
|
-
export type TableCellStringEvents<Item extends {
|
|
19
|
-
id: string;
|
|
20
|
-
}> = ReturnType<__sveltets_Render<Item>['events']>;
|
|
21
|
-
export type TableCellStringSlots<Item extends {
|
|
22
|
-
id: string;
|
|
23
|
-
}> = ReturnType<__sveltets_Render<Item>['slots']>;
|
|
24
|
-
export default class TableCellString<Item extends {
|
|
25
|
-
id: string;
|
|
26
|
-
}> extends SvelteComponent<TableCellStringProps<Item>, TableCellStringEvents<Item>, TableCellStringSlots<Item>> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
27
14
|
}
|
|
28
|
-
|
|
15
|
+
declare const TableCellString: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
value: string;
|
|
17
|
+
field: TableField;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type TableCellString = InstanceType<typeof TableCellString>;
|
|
22
|
+
export default TableCellString;
|
package/dist/ui/table/field.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { ComponentAndProps, Primitive } from '../../utils/component.js';
|
|
2
2
|
import type { Options } from '../../utils/options.js';
|
|
3
|
-
export type ItemBase = {
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
3
|
export type TableFieldType = 'string' | 'textarea' | 'number' | 'boolean' | 'select' | 'multiselect' | 'date';
|
|
7
|
-
export type TableField<Item
|
|
4
|
+
export type TableField<Item = any> = TableFieldCommon & (TableFieldUntyped<Item> | TableFieldPrimitive<Item> | TableFieldSelect<Item> | TableFieldMultiselect<Item>);
|
|
8
5
|
type TableFieldCommon = {
|
|
9
6
|
key: string;
|
|
10
7
|
label: string;
|
|
@@ -13,24 +10,23 @@ type TableFieldCommon = {
|
|
|
13
10
|
hint?: string;
|
|
14
11
|
locked?: boolean;
|
|
15
12
|
visible?: boolean;
|
|
16
|
-
sortable?: boolean;
|
|
17
13
|
/** Internal usage */
|
|
18
|
-
|
|
14
|
+
$visible?: boolean;
|
|
19
15
|
};
|
|
20
|
-
type TableFieldUntyped<Item
|
|
16
|
+
type TableFieldUntyped<Item = any> = {
|
|
21
17
|
getCell: (item: Item) => ComponentAndProps[] | ComponentAndProps | Primitive[] | Primitive | undefined | null;
|
|
22
|
-
head?: ComponentAndProps | ((field: TableField
|
|
18
|
+
head?: ComponentAndProps | ((field: TableField) => ComponentAndProps);
|
|
23
19
|
};
|
|
24
|
-
type TableFieldPrimitive<Item
|
|
20
|
+
type TableFieldPrimitive<Item = any> = {
|
|
25
21
|
type: Exclude<TableFieldType, 'select' | 'multiselect'>;
|
|
26
22
|
getCell: (item: Item) => ComponentAndProps[] | ComponentAndProps | Primitive | undefined | null;
|
|
27
23
|
};
|
|
28
|
-
type TableFieldSelect<Item
|
|
24
|
+
type TableFieldSelect<Item = any> = {
|
|
29
25
|
type: 'select';
|
|
30
26
|
getCell: (item: Item) => Primitive | undefined | null;
|
|
31
27
|
options: Options;
|
|
32
28
|
};
|
|
33
|
-
type TableFieldMultiselect<Item
|
|
29
|
+
type TableFieldMultiselect<Item = any> = {
|
|
34
30
|
type: 'multiselect';
|
|
35
31
|
getCell: (item: Item) => Primitive[] | undefined | null;
|
|
36
32
|
options: Options;
|
|
@@ -38,50 +34,46 @@ type TableFieldMultiselect<Item extends ItemBase> = {
|
|
|
38
34
|
/**
|
|
39
35
|
* Initialise fields from url query
|
|
40
36
|
*/
|
|
41
|
-
export declare function syncFieldsWithParams
|
|
42
|
-
|
|
37
|
+
export declare function syncFieldsWithParams(tablekey: string, fields: TableField[]): ({
|
|
38
|
+
$visible: boolean;
|
|
43
39
|
key: string;
|
|
44
40
|
label: string;
|
|
45
|
-
type?: TableFieldType
|
|
46
|
-
options?: Options
|
|
47
|
-
hint?: string
|
|
48
|
-
locked?: boolean
|
|
49
|
-
visible?: boolean
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
head?: ComponentAndProps | ((field: TableField<Item>) => ComponentAndProps) | undefined;
|
|
41
|
+
type?: TableFieldType;
|
|
42
|
+
options?: Options;
|
|
43
|
+
hint?: string;
|
|
44
|
+
locked?: boolean;
|
|
45
|
+
visible?: boolean;
|
|
46
|
+
getCell: (item: any) => ComponentAndProps[] | ComponentAndProps | Primitive[] | Primitive | undefined | null;
|
|
47
|
+
head?: ComponentAndProps | ((field: TableField) => ComponentAndProps);
|
|
53
48
|
} | {
|
|
54
|
-
|
|
49
|
+
$visible: boolean;
|
|
55
50
|
key: string;
|
|
56
51
|
label: string;
|
|
57
52
|
type: "string" | "number" | "boolean" | "textarea" | "date";
|
|
58
|
-
options?: Options
|
|
59
|
-
hint?: string
|
|
60
|
-
locked?: boolean
|
|
61
|
-
visible?: boolean
|
|
62
|
-
|
|
63
|
-
getCell: (item: Item) => Primitive | ComponentAndProps | ComponentAndProps[] | null | undefined;
|
|
53
|
+
options?: Options;
|
|
54
|
+
hint?: string;
|
|
55
|
+
locked?: boolean;
|
|
56
|
+
visible?: boolean;
|
|
57
|
+
getCell: (item: any) => ComponentAndProps[] | ComponentAndProps | Primitive | undefined | null;
|
|
64
58
|
} | {
|
|
65
|
-
|
|
59
|
+
$visible: boolean;
|
|
66
60
|
key: string;
|
|
67
61
|
label: string;
|
|
68
62
|
type: "select";
|
|
69
63
|
options: (Options | undefined) & Options;
|
|
70
|
-
hint?: string
|
|
71
|
-
locked?: boolean
|
|
72
|
-
visible?: boolean
|
|
73
|
-
|
|
74
|
-
getCell: (item: Item) => Primitive | null | undefined;
|
|
64
|
+
hint?: string;
|
|
65
|
+
locked?: boolean;
|
|
66
|
+
visible?: boolean;
|
|
67
|
+
getCell: (item: any) => Primitive | undefined | null;
|
|
75
68
|
} | {
|
|
76
|
-
|
|
69
|
+
$visible: boolean;
|
|
77
70
|
key: string;
|
|
78
71
|
label: string;
|
|
79
72
|
type: "multiselect";
|
|
80
73
|
options: (Options | undefined) & Options;
|
|
81
|
-
hint?: string
|
|
82
|
-
locked?: boolean
|
|
83
|
-
visible?: boolean
|
|
84
|
-
|
|
85
|
-
getCell: (item: Item) => Primitive[] | null | undefined;
|
|
74
|
+
hint?: string;
|
|
75
|
+
locked?: boolean;
|
|
76
|
+
visible?: boolean;
|
|
77
|
+
getCell: (item: any) => Primitive[] | undefined | null;
|
|
86
78
|
})[];
|
|
87
79
|
export {};
|
package/dist/ui/table/field.js
CHANGED
|
@@ -14,7 +14,7 @@ export function syncFieldsWithParams(tablekey, fields) {
|
|
|
14
14
|
// Init correct visible prop
|
|
15
15
|
const _fields = fields.map((field) => ({
|
|
16
16
|
...field,
|
|
17
|
-
|
|
17
|
+
$visible: field.locked ||
|
|
18
18
|
(field.visible ? !fieldsHidden.includes(field.key) : fieldsVisible.includes(field.key))
|
|
19
19
|
}));
|
|
20
20
|
// Init correct order fields
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiCheck, mdiClose } from '@mdi/js'
|
|
3
|
+
import type { TableField } from '../index.js'
|
|
4
|
+
import TableHeadSelect from './TableHeadSelect.svelte'
|
|
5
|
+
|
|
6
|
+
export let field: TableField
|
|
4
7
|
</script>
|
|
5
8
|
|
|
6
9
|
<TableHeadSelect
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { TableField } from '../index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
8
12
|
};
|
|
9
|
-
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots(): {};
|
|
13
|
-
}
|
|
14
|
-
export type TableHeadBooleanProps<Item extends {
|
|
15
|
-
id: string;
|
|
16
|
-
}> = ReturnType<__sveltets_Render<Item>['props']>;
|
|
17
|
-
export type TableHeadBooleanEvents<Item extends {
|
|
18
|
-
id: string;
|
|
19
|
-
}> = ReturnType<__sveltets_Render<Item>['events']>;
|
|
20
|
-
export type TableHeadBooleanSlots<Item extends {
|
|
21
|
-
id: string;
|
|
22
|
-
}> = ReturnType<__sveltets_Render<Item>['slots']>;
|
|
23
|
-
export default class TableHeadBoolean<Item extends {
|
|
24
|
-
id: string;
|
|
25
|
-
}> extends SvelteComponent<TableHeadBooleanProps<Item>, TableHeadBooleanEvents<Item>, TableHeadBooleanSlots<Item>> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
26
14
|
}
|
|
27
|
-
|
|
15
|
+
declare const TableHeadBoolean: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
field: TableField;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type TableHeadBoolean = InstanceType<typeof TableHeadBoolean>;
|
|
21
|
+
export default TableHeadBoolean;
|