fuma 2.0.50 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action/index.d.ts +2 -5
- package/dist/action/index.js +2 -5
- package/dist/action/list/handlers.d.ts +6 -6
- package/dist/action/list/handlers.js +6 -5
- package/dist/action/list/index.d.ts +1 -1
- package/dist/action/list/index.js +11 -5
- package/dist/action/list/trigger.js +6 -2
- package/dist/action/list/utils.js +1 -1
- package/dist/action/tip.js +2 -2
- package/dist/command/command.svelte.d.ts +16 -0
- package/dist/command/command.svelte.js +68 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/data.d.ts +87 -0
- package/dist/data.js +51 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/InputBoolean.svelte +107 -0
- package/dist/input/InputBoolean.svelte.d.ts +12 -0
- package/dist/input/InputNumber.svelte +33 -0
- package/dist/input/InputNumber.svelte.d.ts +10 -0
- package/dist/input/InputRadio.svelte +56 -0
- package/dist/input/InputRadio.svelte.d.ts +11 -0
- package/dist/input/InputRange.svelte +30 -0
- package/dist/input/InputRange.svelte.d.ts +10 -0
- package/dist/input/InputRelation.svelte +119 -0
- package/dist/input/InputRelation.svelte.d.ts +39 -0
- package/dist/input/InputSelect.svelte +113 -0
- package/dist/input/InputSelect.svelte.d.ts +37 -0
- package/dist/input/InputSelectNative.svelte +56 -0
- package/dist/input/InputSelectNative.svelte.d.ts +12 -0
- package/dist/input/InputString.svelte +48 -0
- package/dist/input/InputString.svelte.d.ts +11 -0
- package/dist/input/InputTextarea.svelte +47 -0
- package/dist/input/InputTextarea.svelte.d.ts +11 -0
- package/dist/input/Issues.svelte +21 -0
- package/dist/input/Issues.svelte.d.ts +7 -0
- package/dist/input/index.d.ts +11 -0
- package/dist/input/index.js +10 -0
- package/dist/input/type.d.ts +5 -0
- package/dist/popover/Popover.svelte +50 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/popover.svelte.d.ts +26 -0
- package/dist/popover/popover.svelte.js +101 -0
- package/dist/remote/useForm.d.ts +6 -0
- package/dist/remote/useForm.js +22 -0
- package/dist/search/Spans.svelte +15 -0
- package/dist/search/Spans.svelte.d.ts +7 -0
- package/dist/search/index.d.ts +2 -0
- package/dist/search/index.js +2 -0
- package/dist/search/search.js +96 -0
- package/dist/server/index.d.ts +0 -4
- package/dist/server/index.js +0 -4
- package/dist/server/parseQuery.js +1 -1
- package/dist/server/sse.js +4 -4
- package/dist/server/table.js +1 -1
- package/dist/state/index.d.ts +1 -0
- package/dist/state/index.js +1 -0
- package/dist/state/param.svelte.d.ts +17 -0
- package/dist/state/param.svelte.js +64 -0
- package/dist/ui/button/ButtonDelete.svelte +49 -28
- package/dist/ui/button/ButtonDelete.svelte.d.ts +12 -31
- package/dist/ui/button/index.d.ts +0 -1
- package/dist/ui/button/index.js +0 -1
- package/dist/ui/copy/ButtonCopy.svelte +43 -0
- package/dist/ui/copy/ButtonCopy.svelte.d.ts +17 -0
- package/dist/ui/copy/index.d.ts +2 -0
- package/dist/ui/copy/index.js +2 -0
- package/dist/ui/copy/useCopy.svelte.d.ts +10 -0
- package/dist/ui/copy/useCopy.svelte.js +36 -0
- package/dist/ui/dialog/Dialog.svelte +56 -26
- package/dist/ui/dialog/Dialog.svelte.d.ts +14 -35
- package/dist/ui/dialog/index.d.ts +0 -1
- package/dist/ui/dialog/index.js +0 -1
- package/dist/ui/drawer/Drawer.svelte +53 -45
- package/dist/ui/drawer/Drawer.svelte.d.ts +8 -63
- package/dist/ui/drawer/drawerFly.js +1 -1
- package/dist/ui/drawer/useLayer.svelte.d.ts +5 -0
- package/dist/ui/drawer/useLayer.svelte.js +33 -0
- package/dist/ui/index.d.ts +4 -12
- package/dist/ui/index.js +4 -12
- package/dist/ui/menu/ContextMenu.svelte +27 -26
- package/dist/ui/menu/ContextMenu.svelte.d.ts +9 -35
- package/dist/ui/menu/DropDown.svelte +44 -26
- package/dist/ui/menu/DropDown.svelte.d.ts +18 -43
- package/dist/ui/menu/DropDownMenu.svelte +51 -41
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +7 -29
- package/dist/ui/menu/dropdown.css +4 -4
- package/dist/ui/menu/index.d.ts +1 -1
- package/dist/ui/menu/index.js +2 -1
- package/dist/ui/mode/ToggleMode.svelte +25 -14
- package/dist/ui/mode/ToggleMode.svelte.d.ts +10 -35
- package/dist/ui/mode/index.d.ts +1 -1
- package/dist/ui/mode/index.js +1 -1
- package/dist/ui/mode/useMode.svelte.d.ts +8 -0
- package/dist/ui/mode/useMode.svelte.js +40 -0
- package/dist/ui/pagination/Pagination.svelte +18 -14
- package/dist/ui/pagination/Pagination.svelte.d.ts +4 -18
- package/dist/ui/range/RangePicker.svelte +3 -2
- package/dist/ui/range/RangePickerButton.svelte +49 -37
- package/dist/ui/range/RangePickerButton.svelte.d.ts +7 -21
- package/dist/ui/range/index.d.ts +1 -1
- package/dist/ui/range/index.js +1 -1
- package/dist/ui/table/Table.svelte +17 -24
- package/dist/ui/table/Table.svelte.d.ts +3 -3
- package/dist/ui/table/TableBody.svelte +1 -1
- package/dist/ui/table/TableBody.svelte.d.ts +1 -1
- package/dist/ui/table/TableFieldsEdition.svelte +90 -78
- package/dist/ui/table/TableFieldsEdition.svelte.d.ts +14 -13
- package/dist/ui/table/TableHead.svelte +1 -1
- package/dist/ui/table/TableViewSelect.svelte +71 -70
- package/dist/ui/table/TableViewSelect.svelte.d.ts +10 -23
- package/dist/ui/table/cell/TableCellArray.svelte +2 -2
- package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
- package/dist/ui/table/cell/index.d.ts +1 -1
- package/dist/ui/table/cell/index.js +1 -1
- package/dist/ui/table/field.d.ts +7 -7
- package/dist/ui/table/head/OrderButtons.svelte +18 -13
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +11 -23
- package/dist/ui/table/head/TableHeadBoolean.svelte +3 -3
- package/dist/ui/table/head/TableHeadDate.svelte +40 -56
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +1 -1
- package/dist/ui/table/head/TableHeadDefault.svelte +2 -1
- package/dist/ui/table/head/TableHeadNumber.svelte +93 -108
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +13 -10
- package/dist/ui/table/head/TableHeadSelect.svelte +55 -52
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +13 -10
- package/dist/ui/table/head/TableHeadString.svelte +28 -34
- package/dist/ui/table/head/index.d.ts +3 -3
- package/dist/ui/table/head/index.js +3 -3
- package/dist/ui/table/index.d.ts +5 -5
- package/dist/ui/table/index.js +4 -5
- package/dist/utils/csv.js +1 -1
- package/dist/utils/eventEmitter.d.ts +2 -2
- package/dist/utils/eventEmitter.js +18 -11
- package/dist/utils/index.d.ts +4 -6
- package/dist/utils/index.js +4 -6
- package/dist/utils/normalizePath.js +1 -1
- package/dist/utils/options.d.ts +6 -5
- package/dist/utils/options.js +3 -2
- package/dist/utils/tippy.d.ts +1 -1
- package/dist/utils/tippy.js +1 -1
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.js +0 -1
- package/dist/validation/zod.d.ts +12 -393
- package/dist/validation/zod.js +22 -82
- package/package.json +115 -134
- package/dist/action/heightScreen.d.ts +0 -10
- package/dist/action/heightScreen.js +0 -24
- package/dist/action/portal.d.ts +0 -3
- package/dist/action/portal.js +0 -9
- package/dist/action/selector.d.ts +0 -15
- package/dist/action/selector.js +0 -71
- package/dist/api/client.d.ts +0 -3
- package/dist/api/client.js +0 -24
- package/dist/api/config.d.ts +0 -46
- package/dist/api/config.js +0 -7
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.js +0 -3
- package/dist/api/server.d.ts +0 -11
- package/dist/api/server.js +0 -17
- package/dist/private/Meta.svelte +0 -16
- package/dist/private/Meta.svelte.d.ts +0 -30
- package/dist/private/api.d.ts +0 -61
- package/dist/private/api.js +0 -10
- package/dist/private/constant.d.ts +0 -14
- package/dist/private/constant.js +0 -6
- package/dist/private/model.d.ts +0 -70
- package/dist/private/model.js +0 -25
- package/dist/private/prisma.d.ts +0 -2
- package/dist/private/prisma.js +0 -2
- package/dist/private/store.d.ts +0 -1
- package/dist/private/store.js +0 -2
- package/dist/server/auth.d.ts +0 -12
- package/dist/server/auth.js +0 -15
- package/dist/server/formAction.d.ts +0 -13
- package/dist/server/formAction.js +0 -8
- package/dist/server/json.d.ts +0 -1
- package/dist/server/json.js +0 -16
- package/dist/server/parseFormData.d.ts +0 -10
- package/dist/server/parseFormData.js +0 -85
- package/dist/server/try.d.ts +0 -9
- package/dist/server/try.js +0 -41
- package/dist/store/index.d.ts +0 -2
- package/dist/store/index.js +0 -2
- package/dist/store/isSmallScreen.d.ts +0 -1
- package/dist/store/isSmallScreen.js +0 -14
- package/dist/store/param.d.ts +0 -22
- package/dist/store/param.js +0 -61
- package/dist/store/session.d.ts +0 -1
- package/dist/store/session.js +0 -13
- package/dist/ui/badge/Badge.svelte +0 -9
- package/dist/ui/badge/Badge.svelte.d.ts +0 -21
- package/dist/ui/badge/index.d.ts +0 -1
- package/dist/ui/badge/index.js +0 -1
- package/dist/ui/button/ButtonCopy.svelte +0 -59
- package/dist/ui/button/ButtonCopy.svelte.d.ts +0 -27
- package/dist/ui/card/Card.svelte +0 -43
- package/dist/ui/card/Card.svelte.d.ts +0 -41
- package/dist/ui/card/CardBasic.svelte +0 -15
- package/dist/ui/card/CardBasic.svelte.d.ts +0 -31
- package/dist/ui/card/CardCollapse.svelte +0 -71
- package/dist/ui/card/CardCollapse.svelte.d.ts +0 -39
- package/dist/ui/card/CardFullScreen.svelte +0 -31
- package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -38
- package/dist/ui/card/CardLink.svelte +0 -22
- package/dist/ui/card/CardLink.svelte.d.ts +0 -31
- package/dist/ui/card/index.d.ts +0 -5
- package/dist/ui/card/index.js +0 -5
- package/dist/ui/context.d.ts +0 -6
- package/dist/ui/context.js +0 -12
- package/dist/ui/dialog/DialogConfirm.svelte +0 -24
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -35
- package/dist/ui/drawer/layers.d.ts +0 -7
- package/dist/ui/drawer/layers.js +0 -68
- package/dist/ui/form/Form.svelte +0 -168
- package/dist/ui/form/Form.svelte.d.ts +0 -62
- package/dist/ui/form/FormInput.svelte +0 -15
- package/dist/ui/form/FormSection.svelte +0 -78
- package/dist/ui/form/FormSection.svelte.d.ts +0 -39
- package/dist/ui/form/form.d.ts +0 -37
- package/dist/ui/form/form.js +0 -57
- package/dist/ui/form/formInput.js +0 -33
- package/dist/ui/form/index.d.ts +0 -3
- package/dist/ui/form/index.js +0 -3
- package/dist/ui/icon/Icon.svelte +0 -53
- package/dist/ui/icon/Icon.svelte.d.ts +0 -29
- package/dist/ui/icon/index.d.ts +0 -1
- package/dist/ui/icon/index.js +0 -1
- package/dist/ui/input/FormControl.svelte +0 -77
- package/dist/ui/input/FormControl.svelte.d.ts +0 -34
- package/dist/ui/input/InputBoolean.svelte +0 -33
- package/dist/ui/input/InputBoolean.svelte.d.ts +0 -46
- package/dist/ui/input/InputCheckboxs.svelte +0 -71
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -57
- package/dist/ui/input/InputCheckboxsMenu.svelte +0 -106
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -59
- package/dist/ui/input/InputCheckboxsTree.svelte +0 -18
- package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +0 -25
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +0 -68
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +0 -27
- package/dist/ui/input/InputCombo.svelte +0 -99
- package/dist/ui/input/InputCombo.svelte.d.ts +0 -59
- package/dist/ui/input/InputDate.svelte +0 -47
- package/dist/ui/input/InputDate.svelte.d.ts +0 -46
- package/dist/ui/input/InputDateTime.svelte +0 -41
- package/dist/ui/input/InputDateTime.svelte.d.ts +0 -23
- package/dist/ui/input/InputImage.svelte +0 -116
- package/dist/ui/input/InputImage.svelte.d.ts +0 -48
- package/dist/ui/input/InputImagePreview.svelte +0 -60
- package/dist/ui/input/InputImagePreview.svelte.d.ts +0 -27
- package/dist/ui/input/InputNumber.svelte +0 -31
- package/dist/ui/input/InputNumber.svelte.d.ts +0 -23
- package/dist/ui/input/InputOptionInParam.svelte +0 -36
- package/dist/ui/input/InputOptionInParam.svelte.d.ts +0 -24
- package/dist/ui/input/InputOptions.svelte +0 -85
- package/dist/ui/input/InputOptions.svelte.d.ts +0 -21
- package/dist/ui/input/InputPassword.svelte +0 -25
- package/dist/ui/input/InputPassword.svelte.d.ts +0 -45
- package/dist/ui/input/InputRadio.svelte +0 -84
- package/dist/ui/input/InputRadio.svelte.d.ts +0 -56
- package/dist/ui/input/InputRelation.svelte +0 -171
- package/dist/ui/input/InputRelation.svelte.d.ts +0 -76
- package/dist/ui/input/InputRelations.svelte +0 -166
- package/dist/ui/input/InputRelations.svelte.d.ts +0 -55
- package/dist/ui/input/InputSearch.svelte +0 -59
- package/dist/ui/input/InputSearch.svelte.d.ts +0 -29
- package/dist/ui/input/InputSelect.svelte +0 -84
- package/dist/ui/input/InputSelect.svelte.d.ts +0 -29
- package/dist/ui/input/InputText.svelte +0 -46
- package/dist/ui/input/InputText.svelte.d.ts +0 -30
- package/dist/ui/input/InputTextarea.svelte +0 -23
- package/dist/ui/input/InputTextarea.svelte.d.ts +0 -23
- package/dist/ui/input/InputTime.svelte +0 -47
- package/dist/ui/input/InputTime.svelte.d.ts +0 -46
- package/dist/ui/input/RelationAfter.svelte +0 -34
- package/dist/ui/input/RelationAfter.svelte.d.ts +0 -26
- package/dist/ui/input/SelectorList.svelte +0 -50
- package/dist/ui/input/SelectorList.svelte.d.ts +0 -49
- package/dist/ui/input/action.d.ts +0 -13
- package/dist/ui/input/action.js +0 -56
- package/dist/ui/input/index.d.ts +0 -26
- package/dist/ui/input/index.js +0 -26
- package/dist/ui/input/textRich/InputTextRich.svelte +0 -72
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -48
- package/dist/ui/input/textRich/SuggesionList.svelte +0 -25
- package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMark.svelte +0 -22
- package/dist/ui/input/textRich/ToolMark.svelte.d.ts +0 -25
- package/dist/ui/input/textRich/ToolMarkColor.svelte +0 -36
- package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMarkLink.svelte +0 -72
- package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolMenu.svelte +0 -66
- package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +0 -33
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +0 -50
- package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +0 -54
- package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +0 -23
- package/dist/ui/input/textRich/ToolMenuNode.svelte +0 -60
- package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +0 -21
- package/dist/ui/input/textRich/ToolsBar.svelte +0 -61
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +0 -24
- package/dist/ui/input/textRich/extensions.d.ts +0 -2
- package/dist/ui/input/textRich/extensions.js +0 -62
- package/dist/ui/input/textRich/indent.d.ts +0 -13
- package/dist/ui/input/textRich/indent.js +0 -112
- package/dist/ui/input/textRich/index.d.ts +0 -3
- package/dist/ui/input/textRich/index.js +0 -3
- package/dist/ui/input/textRich/suggestion.d.ts +0 -7
- package/dist/ui/input/textRich/suggestion.js +0 -55
- package/dist/ui/input/textRich/tiptapParser.d.ts +0 -4
- package/dist/ui/input/textRich/tiptapParser.js +0 -29
- package/dist/ui/input/types.d.ts +0 -15
- package/dist/ui/input/types.js +0 -1
- package/dist/ui/login/Login.svelte +0 -99
- package/dist/ui/login/Login.svelte.d.ts +0 -20
- package/dist/ui/login/index.d.ts +0 -1
- package/dist/ui/login/index.js +0 -1
- package/dist/ui/placeholder/Placeholder.svelte +0 -12
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -30
- package/dist/ui/placeholder/PlaceholderImage.svelte +0 -16
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -30
- package/dist/ui/placeholder/index.d.ts +0 -2
- package/dist/ui/placeholder/index.js +0 -2
- package/dist/ui/table/type.d.ts +0 -2
- package/dist/ui/tabs/Tabs.svelte +0 -32
- package/dist/ui/tabs/Tabs.svelte.d.ts +0 -22
- package/dist/ui/tabs/TabsIcon.svelte +0 -60
- package/dist/ui/tabs/TabsIcon.svelte.d.ts +0 -24
- package/dist/ui/tabs/index.d.ts +0 -8
- package/dist/ui/tabs/index.js +0 -2
- package/dist/utils/avatar.d.ts +0 -1
- package/dist/utils/avatar.js +0 -5
- package/dist/utils/component.d.ts +0 -6
- package/dist/utils/component.js +0 -3
- package/dist/validation/form.d.ts +0 -34
- package/dist/validation/form.js +0 -103
- /package/dist/{ui/table → input}/type.js +0 -0
|
@@ -1,133 +1,118 @@
|
|
|
1
1
|
<script lang="ts" generics="Item extends ItemBase">
|
|
2
|
-
import {
|
|
3
|
-
import type { TippyInstance } from '../../../utils/tippy.js'
|
|
2
|
+
import { ArrowDownNarrowWideIcon, ArrowDownWideNarrowIcon, FunnelIcon } from '@lucide/svelte'
|
|
4
3
|
import debounce from 'debounce'
|
|
4
|
+
import z from 'zod'
|
|
5
5
|
import { goto } from '$app/navigation'
|
|
6
|
-
import { page } from '$app/
|
|
7
|
-
|
|
6
|
+
import { page } from '$app/state'
|
|
7
|
+
import { urlParam } from '../../../state/param.svelte.ts'
|
|
8
8
|
import { DropDown } from '../../menu/index.js'
|
|
9
|
-
import {
|
|
10
|
-
import { urlParam } from '../../../store/param.js'
|
|
11
|
-
import { jsonParse } from '../../../utils/jsonParse.js'
|
|
9
|
+
import { zodCoerceJsonRecord } from '../../../validation/zod.js'
|
|
12
10
|
import type { ItemBase, TableField } from '../field.js'
|
|
13
|
-
import { mdiFilterMultipleOutline, mdiSortAscending, mdiSortDescending } from '@mdi/js'
|
|
14
|
-
import { Icon } from '../../icon/index.js'
|
|
15
11
|
import OrderButtons from './OrderButtons.svelte'
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let tip: TippyInstance
|
|
20
|
-
type Range = { min: number | undefined; max: number | undefined }
|
|
13
|
+
let { field }: { field: TableField<Item> } = $props()
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const paramModel = zodCoerceJsonRecord
|
|
16
|
+
.pipe(
|
|
17
|
+
z.object({
|
|
18
|
+
min: z.number().optional(),
|
|
19
|
+
max: z.number().optional(),
|
|
20
|
+
order: z.enum(['asc', 'desc']).optional()
|
|
21
|
+
})
|
|
22
|
+
)
|
|
23
|
+
.default({})
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
return jsonParse<Range & { order?: 'asc' | 'desc' }>(searchParams.get(field.key), {
|
|
27
|
-
min: undefined,
|
|
28
|
-
max: undefined,
|
|
29
|
-
order: undefined
|
|
30
|
-
})
|
|
31
|
-
}
|
|
25
|
+
let { min, max, order } = $derived(paramModel.parse(page.url.searchParams.get(field.key)))
|
|
32
26
|
|
|
33
27
|
const updateUrl = debounce(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
'skip',
|
|
45
|
-
'take'
|
|
46
|
-
),
|
|
47
|
-
{
|
|
48
|
-
noScroll: true,
|
|
49
|
-
keepFocus: true
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
return
|
|
53
|
-
}
|
|
54
|
-
goto($urlParam.without(field.key, 'skip', 'take'), { noScroll: true, keepFocus: true })
|
|
28
|
+
const query: Record<string, string | number> = {}
|
|
29
|
+
if (order) query.order = order
|
|
30
|
+
if (min !== undefined) query.min = min
|
|
31
|
+
if (max !== undefined) query.max = max
|
|
32
|
+
if (!Object.keys(query).length) return resetFilter()
|
|
33
|
+
goto(urlParam.with({ [field.key]: JSON.stringify(query) }, 'skip', 'take'), {
|
|
34
|
+
noScroll: true,
|
|
35
|
+
keepFocus: true
|
|
36
|
+
})
|
|
55
37
|
}, 250)
|
|
56
38
|
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
function isDefined(v: number | undefined | null): v is number {
|
|
65
|
-
return typeof v === 'number'
|
|
39
|
+
function resetFilter() {
|
|
40
|
+
return goto(urlParam.without(field.key, 'skip', 'take'), {
|
|
41
|
+
replaceState: true,
|
|
42
|
+
noScroll: true,
|
|
43
|
+
keepFocus: true
|
|
44
|
+
})
|
|
66
45
|
}
|
|
67
|
-
|
|
68
|
-
$: isNegatifRange = isDefined(min) && isDefined(max) && max < min
|
|
69
46
|
</script>
|
|
70
47
|
|
|
71
48
|
<th class="p-1">
|
|
72
|
-
<DropDown
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{#if
|
|
83
|
-
<
|
|
49
|
+
<DropDown hideOnBlur hideOnNav={false} autofocus tippyProps={{ appendTo: () => document.body }}>
|
|
50
|
+
{#snippet activator()}
|
|
51
|
+
<button class="menu-item min-h-8 w-full flex-wrap gap-y-1">
|
|
52
|
+
<div class="flex gap-2">
|
|
53
|
+
<span>{field.label}</span>
|
|
54
|
+
{#if min === undefined && max === undefined}
|
|
55
|
+
<FunnelIcon size={15} class="opacity-50" />
|
|
56
|
+
{/if}
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
{#if min !== undefined || max !== undefined}
|
|
60
|
+
<span class="badge badge-xs text-[0.7rem] font-normal text-white badge-primary">
|
|
61
|
+
{#if min !== undefined}
|
|
62
|
+
{min} ≤
|
|
63
|
+
{/if}
|
|
64
|
+
x
|
|
65
|
+
{#if max !== undefined}
|
|
66
|
+
≤ {max}
|
|
67
|
+
{/if}
|
|
68
|
+
</span>
|
|
69
|
+
{/if}
|
|
70
|
+
{#if order === 'asc'}
|
|
71
|
+
<ArrowDownNarrowWideIcon size={18} class="fill-primary" />
|
|
72
|
+
{:else if order === 'desc'}
|
|
73
|
+
<ArrowDownWideNarrowIcon size={18} class="fill-primary" />
|
|
84
74
|
{/if}
|
|
85
|
-
</
|
|
75
|
+
</button>
|
|
76
|
+
{/snippet}
|
|
86
77
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{/if}
|
|
96
|
-
</span>
|
|
97
|
-
{/if}
|
|
98
|
-
{#if order}
|
|
99
|
-
<Icon
|
|
100
|
-
path={order === 'asc' ? mdiSortAscending : mdiSortDescending}
|
|
101
|
-
size={18}
|
|
102
|
-
class="fill-primary"
|
|
78
|
+
{#snippet children({ tip })}
|
|
79
|
+
{#if field.sortable !== false}
|
|
80
|
+
<OrderButtons
|
|
81
|
+
bind:order
|
|
82
|
+
onChange={() => {
|
|
83
|
+
updateUrl()
|
|
84
|
+
tip?.hide()
|
|
85
|
+
}}
|
|
103
86
|
/>
|
|
87
|
+
<div class="divider"></div>
|
|
88
|
+
<span class="p-1 py-1 text-sm font-semibold opacity-70">Filtre:</span>
|
|
104
89
|
{/if}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
on:change={() => {
|
|
111
|
-
updateUrl()
|
|
112
|
-
tip.hide()
|
|
90
|
+
<form
|
|
91
|
+
class="grid grid-cols-2 gap-2 p-1"
|
|
92
|
+
onsubmit={(e) => {
|
|
93
|
+
e.preventDefault()
|
|
94
|
+
tip?.hide()
|
|
113
95
|
}}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{/if}
|
|
118
|
-
<form class="grid grid-cols-2 gap-2 p-1" on:submit|preventDefault={() => tip.hide()}>
|
|
119
|
-
<InputNumber bind:value={min} on:input={updateUrl} input={{ placeholder: 'Min' }} />
|
|
120
|
-
<InputNumber
|
|
121
|
-
bind:value={max}
|
|
122
|
-
on:input={updateUrl}
|
|
123
|
-
hint={isNegatifRange ? 'Doit être plus grand' : ''}
|
|
124
|
-
input={{ placeholder: 'Max' }}
|
|
125
|
-
/>
|
|
96
|
+
>
|
|
97
|
+
<input bind:value={min} oninput={updateUrl} placeholder="Min" />
|
|
98
|
+
<input bind:value={max} oninput={updateUrl} placeholder="Max" />
|
|
126
99
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
100
|
+
<div class="col-span-full flex justify-end gap-2">
|
|
101
|
+
<button
|
|
102
|
+
class="btn btn-ghost"
|
|
103
|
+
type="button"
|
|
104
|
+
onclick={() => {
|
|
105
|
+
min = undefined
|
|
106
|
+
max = undefined
|
|
107
|
+
tip?.hide()
|
|
108
|
+
resetFilter()
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
Effacer
|
|
112
|
+
</button>
|
|
113
|
+
<button class="btn">Ok</button>
|
|
114
|
+
</div>
|
|
115
|
+
</form>
|
|
116
|
+
{/snippet}
|
|
132
117
|
</DropDown>
|
|
133
118
|
</th>
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import type { ItemBase, TableField } from '../field.js';
|
|
2
|
-
declare
|
|
3
|
-
props
|
|
2
|
+
declare function $$render<Item extends ItemBase>(): {
|
|
3
|
+
props: {
|
|
4
4
|
field: TableField<Item>;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
exports: {};
|
|
7
|
+
bindings: "";
|
|
8
|
+
slots: {};
|
|
9
|
+
events: {};
|
|
10
|
+
};
|
|
11
|
+
declare class __sveltets_Render<Item extends ItemBase> {
|
|
12
|
+
props(): ReturnType<typeof $$render<Item>>['props'];
|
|
13
|
+
events(): ReturnType<typeof $$render<Item>>['events'];
|
|
14
|
+
slots(): ReturnType<typeof $$render<Item>>['slots'];
|
|
15
|
+
bindings(): "";
|
|
11
16
|
exports(): {};
|
|
12
17
|
}
|
|
13
18
|
interface $$IsomorphicComponent {
|
|
14
19
|
new <Item extends ItemBase>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Item>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Item>['props']>, ReturnType<__sveltets_Render<Item>['events']>, ReturnType<__sveltets_Render<Item>['slots']>> & {
|
|
15
20
|
$$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
|
|
16
21
|
} & ReturnType<__sveltets_Render<Item>['exports']>;
|
|
17
|
-
<Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {
|
|
18
|
-
$$events?: ReturnType<__sveltets_Render<Item>['events']>;
|
|
19
|
-
}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
22
|
+
<Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
20
23
|
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
21
24
|
}
|
|
22
25
|
declare const TableHeadNumber: $$IsomorphicComponent;
|
|
@@ -1,87 +1,90 @@
|
|
|
1
1
|
<script lang="ts" generics="Item extends ItemBase">
|
|
2
|
-
import {
|
|
3
|
-
import { page } from '$app/
|
|
4
|
-
|
|
5
|
-
import { jsonParse } from '../../../utils/jsonParse.js'
|
|
6
|
-
import type { ItemBase, TableField } from '../index.js'
|
|
2
|
+
import { ListFilterIcon } from '@lucide/svelte'
|
|
3
|
+
import { page } from '$app/state'
|
|
4
|
+
import { param, urlParam } from '../../../state/param.svelte.ts'
|
|
7
5
|
import { DropDown } from '../../menu/index.js'
|
|
8
|
-
import {
|
|
6
|
+
import type { ItemBase, TableField } from '../index.js'
|
|
7
|
+
import { jsonParse } from '../../../utils/jsonParse.js'
|
|
9
8
|
import { type Options, parseOptions } from '../../../utils/options.js'
|
|
10
|
-
import { urlParam } from '../../../store/param.js'
|
|
11
|
-
import { mdiOrderBoolAscendingVariant } from '@mdi/js'
|
|
12
|
-
|
|
13
|
-
export let field: TableField<Item>
|
|
14
|
-
export let options: Options
|
|
15
|
-
export let multiSelect = false
|
|
16
|
-
export let placeholder = 'No option'
|
|
17
|
-
|
|
18
|
-
let _options = initOptions($page.url)
|
|
19
|
-
page.subscribe(({ url }) => (_options = initOptions(url)))
|
|
20
9
|
|
|
21
|
-
|
|
10
|
+
let {
|
|
11
|
+
field,
|
|
12
|
+
options: propOptions,
|
|
13
|
+
multiSelect = false,
|
|
14
|
+
placeholder = 'No option'
|
|
15
|
+
}: {
|
|
16
|
+
field: TableField<Item>
|
|
17
|
+
options: Options
|
|
18
|
+
multiSelect?: boolean
|
|
19
|
+
placeholder?: string
|
|
20
|
+
} = $props()
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
const selection = searchParams.get(field.key)
|
|
25
|
-
const selections = jsonParse<string[]>(searchParams.get(field.key), [])
|
|
22
|
+
let options = $derived.by(() => {
|
|
23
|
+
const selection = page.url.searchParams.get(field.key)
|
|
24
|
+
const selections = jsonParse<string[]>(page.url.searchParams.get(field.key), [])
|
|
26
25
|
|
|
27
26
|
function getActive(value: string) {
|
|
28
27
|
if (!multiSelect) return selection === value
|
|
29
28
|
return selections.includes(value)
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
return parseOptions(
|
|
31
|
+
return parseOptions(propOptions).map((option) => ({
|
|
33
32
|
...option,
|
|
34
33
|
isActive: getActive(option.value)
|
|
35
34
|
}))
|
|
36
|
-
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
let optionsActive = $derived(options.filter((option) => option.isActive))
|
|
37
38
|
|
|
38
|
-
const getHref = derived(
|
|
39
|
-
const selections = jsonParse<string[]>(
|
|
40
|
-
if (!multiSelect) return
|
|
39
|
+
const getHref = $derived((value: string) => {
|
|
40
|
+
const selections = jsonParse<string[]>(param.get(field.key), [])
|
|
41
|
+
if (!multiSelect) return urlParam.toggle({ [field.key]: value }, 'skip', 'take')
|
|
41
42
|
if (selections.includes(value)) {
|
|
42
43
|
const newSelections = selections.filter((v) => v !== value)
|
|
43
|
-
if (!newSelections.length) return
|
|
44
|
-
return
|
|
44
|
+
if (!newSelections.length) return urlParam.without(field.key)
|
|
45
|
+
return urlParam.with({ [field.key]: JSON.stringify(newSelections) }, 'skip', 'take')
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
+
return urlParam.with({ [field.key]: JSON.stringify([...selections, value]) }, 'skip', 'take')
|
|
47
48
|
})
|
|
48
49
|
</script>
|
|
49
50
|
|
|
50
51
|
<th class="p-1">
|
|
51
52
|
<DropDown hideOnBlur hideOnNav={!multiSelect} tippyProps={{ appendTo: () => document.body }}>
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{#if optionsActive.length}
|
|
61
|
-
<div class="flex flex-wrap gap-1">
|
|
62
|
-
{#each optionsActive as option}
|
|
63
|
-
<span class="badge badge-primary badge-xs text-[0.7rem] font-normal text-white">
|
|
64
|
-
{#if option.icon}
|
|
65
|
-
<Icon path={option.icon} size={10} class="-translate-x-1 fill-white/80" />
|
|
66
|
-
{/if}
|
|
67
|
-
{option.label}
|
|
68
|
-
</span>
|
|
69
|
-
{/each}
|
|
53
|
+
{#snippet activator()}
|
|
54
|
+
<button class="menu-item min-h-8 w-full flex-wrap gap-y-1">
|
|
55
|
+
<div class="flex gap-2">
|
|
56
|
+
{field.label}
|
|
57
|
+
{#if !optionsActive.length}
|
|
58
|
+
<ListFilterIcon size={15} class="opacity-50" />
|
|
59
|
+
{/if}
|
|
70
60
|
</div>
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
|
|
62
|
+
{#if optionsActive.length}
|
|
63
|
+
<div class="flex flex-wrap gap-1">
|
|
64
|
+
{#each optionsActive as option}
|
|
65
|
+
<span class="badge badge-xs text-[0.7rem] font-normal text-white badge-primary">
|
|
66
|
+
{#if option.icon}
|
|
67
|
+
<option.icon size={10} class="-translate-x-1 fill-white/80" />
|
|
68
|
+
{/if}
|
|
69
|
+
{option.label}
|
|
70
|
+
</span>
|
|
71
|
+
{/each}
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
</button>
|
|
75
|
+
{/snippet}
|
|
73
76
|
|
|
74
77
|
<div class="flex flex-col gap-1">
|
|
75
|
-
{#each
|
|
78
|
+
{#each options as { isActive, icon: Icon, label, value }}
|
|
76
79
|
<a
|
|
77
|
-
href={
|
|
80
|
+
href={getHref(value)}
|
|
78
81
|
class="menu-item px-3 py-2"
|
|
79
82
|
class:active={isActive}
|
|
80
83
|
data-sveltekit-noscroll
|
|
81
84
|
data-sveltekit-replacestate
|
|
82
85
|
>
|
|
83
|
-
{#if
|
|
84
|
-
<Icon
|
|
86
|
+
{#if Icon}
|
|
87
|
+
<Icon size={18} class="opacity-60" />
|
|
85
88
|
{/if}
|
|
86
89
|
<span class="font-normal whitespace-nowrap">{label}</span>
|
|
87
90
|
</a>
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import type { ItemBase, TableField } from '../index.js';
|
|
2
2
|
import { type Options } from '../../../utils/options.js';
|
|
3
|
-
declare
|
|
4
|
-
props
|
|
3
|
+
declare function $$render<Item extends ItemBase>(): {
|
|
4
|
+
props: {
|
|
5
5
|
field: TableField<Item>;
|
|
6
6
|
options: Options;
|
|
7
7
|
multiSelect?: boolean;
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
exports: {};
|
|
11
|
+
bindings: "";
|
|
12
|
+
slots: {};
|
|
13
|
+
events: {};
|
|
14
|
+
};
|
|
15
|
+
declare class __sveltets_Render<Item extends ItemBase> {
|
|
16
|
+
props(): ReturnType<typeof $$render<Item>>['props'];
|
|
17
|
+
events(): ReturnType<typeof $$render<Item>>['events'];
|
|
18
|
+
slots(): ReturnType<typeof $$render<Item>>['slots'];
|
|
19
|
+
bindings(): "";
|
|
15
20
|
exports(): {};
|
|
16
21
|
}
|
|
17
22
|
interface $$IsomorphicComponent {
|
|
18
23
|
new <Item extends ItemBase>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Item>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Item>['props']>, ReturnType<__sveltets_Render<Item>['events']>, ReturnType<__sveltets_Render<Item>['slots']>> & {
|
|
19
24
|
$$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
|
|
20
25
|
} & ReturnType<__sveltets_Render<Item>['exports']>;
|
|
21
|
-
<Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {
|
|
22
|
-
$$events?: ReturnType<__sveltets_Render<Item>['events']>;
|
|
23
|
-
}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
26
|
+
<Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
24
27
|
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
25
28
|
}
|
|
26
29
|
declare const TableHeadSelect: $$IsomorphicComponent;
|
|
@@ -1,48 +1,42 @@
|
|
|
1
1
|
<script lang="ts" generics="Item extends ItemBase">
|
|
2
|
-
import {
|
|
2
|
+
import { SearchIcon } from '@lucide/svelte'
|
|
3
3
|
import { page } from '$app/state'
|
|
4
|
-
|
|
5
4
|
import { DropDown } from '../../menu/index.js'
|
|
6
|
-
import { Icon } from '../../icon/index.js'
|
|
7
|
-
import { InputSearch } from '../../input/index.js'
|
|
8
5
|
import type { ItemBase, TableField } from '../index.js'
|
|
9
|
-
|
|
10
|
-
import { urlParam } from '../../../store/param.js'
|
|
6
|
+
|
|
11
7
|
let { field }: { field: TableField<Item> } = $props()
|
|
12
8
|
|
|
13
9
|
let searchValue = $derived(page.url.searchParams.get(field.key) || '')
|
|
14
10
|
</script>
|
|
15
11
|
|
|
16
12
|
<th class="p-1">
|
|
17
|
-
<DropDown
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<span>{field.label}</span>
|
|
27
|
-
{#if !searchValue}
|
|
28
|
-
<Icon path={mdiMagnify} size={15} class="opacity-50" />
|
|
29
|
-
{/if}
|
|
30
|
-
</div>
|
|
13
|
+
<DropDown hideOnBlur hideOnNav={false} autofocus tippyProps={{ appendTo: () => document.body }}>
|
|
14
|
+
{#snippet activator()}
|
|
15
|
+
<button class="menu-item min-h-8 w-full flex-wrap gap-y-1">
|
|
16
|
+
<div class="flex items-center gap-2">
|
|
17
|
+
<span>{field.label}</span>
|
|
18
|
+
{#if !searchValue}
|
|
19
|
+
<SearchIcon size={15} class="opacity-50" />
|
|
20
|
+
{/if}
|
|
21
|
+
</div>
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
{#if searchValue}
|
|
24
|
+
<span class="badge badge-xs text-[0.7rem] font-normal text-white badge-primary">
|
|
25
|
+
<SearchIcon size={10} class="-translate-x-1 fill-white/80" />
|
|
26
|
+
<span>{searchValue}</span>
|
|
27
|
+
</span>
|
|
28
|
+
{/if}
|
|
29
|
+
</button>
|
|
30
|
+
{/snippet}
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
{#snippet children({ tip })}
|
|
33
|
+
<input
|
|
34
|
+
name={field.key}
|
|
35
|
+
type="search"
|
|
36
|
+
class="m-1"
|
|
37
|
+
value={searchValue}
|
|
38
|
+
onkeydown={(e) => e.key === 'Enter' && tip?.hide()}
|
|
39
|
+
/>
|
|
40
|
+
{/snippet}
|
|
47
41
|
</DropDown>
|
|
48
42
|
</th>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as TableHeadSelect } from './TableHeadSelect.svelte';
|
|
2
|
-
export { default as TableHeadDate } from './TableHeadDate.svelte';
|
|
3
1
|
export { default as TableHeadBoolean } from './TableHeadBoolean.svelte';
|
|
2
|
+
export { default as TableHeadDate } from './TableHeadDate.svelte';
|
|
3
|
+
export { default as TableHeadDefault } from './TableHeadDefault.svelte';
|
|
4
4
|
export { default as TableHeadNumber } from './TableHeadNumber.svelte';
|
|
5
|
+
export { default as TableHeadSelect } from './TableHeadSelect.svelte';
|
|
5
6
|
export { default as TableHeadString } from './TableHeadString.svelte';
|
|
6
|
-
export { default as TableHeadDefault } from './TableHeadDefault.svelte';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as TableHeadSelect } from './TableHeadSelect.svelte';
|
|
2
|
-
export { default as TableHeadDate } from './TableHeadDate.svelte';
|
|
3
1
|
export { default as TableHeadBoolean } from './TableHeadBoolean.svelte';
|
|
2
|
+
export { default as TableHeadDate } from './TableHeadDate.svelte';
|
|
3
|
+
export { default as TableHeadDefault } from './TableHeadDefault.svelte';
|
|
4
4
|
export { default as TableHeadNumber } from './TableHeadNumber.svelte';
|
|
5
|
+
export { default as TableHeadSelect } from './TableHeadSelect.svelte';
|
|
5
6
|
export { default as TableHeadString } from './TableHeadString.svelte';
|
|
6
|
-
export { default as TableHeadDefault } from './TableHeadDefault.svelte';
|
package/dist/ui/table/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './context.js';
|
|
2
|
+
export type { TableField } from './field.js';
|
|
3
|
+
export * from './field.js';
|
|
4
|
+
export * from './head/index.js';
|
|
2
5
|
export { default as Table } from './Table.svelte';
|
|
3
|
-
export { default as TableHead } from './TableHead.svelte';
|
|
4
6
|
export { default as TableBody } from './TableBody.svelte';
|
|
5
7
|
export { default as TableCell } from './TableCell.svelte';
|
|
6
8
|
export { default as TableFieldsEdition } from './TableFieldsEdition.svelte';
|
|
9
|
+
export { default as TableHead } from './TableHead.svelte';
|
|
7
10
|
export { default as TableViewSelect } from './TableViewSelect.svelte';
|
|
8
|
-
export * from './head/index.js';
|
|
9
|
-
export * from './field.js';
|
|
10
|
-
export * from './context.js';
|
package/dist/ui/table/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './context.js';
|
|
2
|
+
export * from './field.js';
|
|
3
|
+
export * from './head/index.js';
|
|
2
4
|
export { default as Table } from './Table.svelte';
|
|
3
|
-
export { default as TableHead } from './TableHead.svelte';
|
|
4
5
|
export { default as TableBody } from './TableBody.svelte';
|
|
5
6
|
export { default as TableCell } from './TableCell.svelte';
|
|
6
7
|
export { default as TableFieldsEdition } from './TableFieldsEdition.svelte';
|
|
8
|
+
export { default as TableHead } from './TableHead.svelte';
|
|
7
9
|
export { default as TableViewSelect } from './TableViewSelect.svelte';
|
|
8
|
-
export * from './head/index.js';
|
|
9
|
-
export * from './field.js';
|
|
10
|
-
export * from './context.js';
|
package/dist/utils/csv.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function getCSV(items, fields) {
|
|
2
2
|
const headers = Object.keys(fields).join('\t');
|
|
3
3
|
const rows = items.map((m) => Object.values(fields)
|
|
4
|
-
.map((getValue) =>
|
|
4
|
+
.map((getValue) => (getValue ? getValue(m) : ''))
|
|
5
5
|
.join('\t'));
|
|
6
6
|
return [headers, rows.join('\r\n')].join('\r\n');
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function createEventEmitter<EventMap extends Record<string,
|
|
1
|
+
export declare function createEventEmitter<EventMap extends Record<string, unknown>>(): {
|
|
2
2
|
on<K extends keyof EventMap>(eventKey: K, callback: Callback<EventMap[K]>): () => void;
|
|
3
3
|
once<K extends keyof EventMap>(eventKey: K, callback: Callback<EventMap[K]>): () => void;
|
|
4
4
|
off<K extends keyof EventMap>(eventKey: K, callback: Callback<EventMap[K]>): void;
|
|
@@ -6,5 +6,5 @@ export declare function createEventEmitter<EventMap extends Record<string, any>>
|
|
|
6
6
|
emit<K extends keyof EventMap>(...args: EventEmitterArgs<EventMap, K>): void;
|
|
7
7
|
};
|
|
8
8
|
type Callback<Arg> = (arg: Arg) => unknown;
|
|
9
|
-
type EventEmitterArgs<EventMap extends Record<string,
|
|
9
|
+
type EventEmitterArgs<EventMap extends Record<string, unknown>, K extends keyof EventMap> = undefined extends EventMap[K] ? [type: K, parameter?: EventMap[K]] : [type: K, parameter: EventMap[K]];
|
|
10
10
|
export {};
|