fuma 2.0.50 → 2.1.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/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/input/type.js +1 -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 +18 -0
- package/dist/state/param.svelte.js +66 -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 +15 -21
- package/dist/ui/table/Table.svelte.d.ts +1 -1
- 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 +69 -69
- package/dist/ui/table/TableViewSelect.svelte.d.ts +10 -23
- package/dist/ui/table/cell/TableCellArray.svelte +1 -1
- 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/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 +41 -53
- 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 +94 -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 +111 -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/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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import dayjs from 'dayjs'
|
|
3
3
|
import type { Litepicker } from 'litepicker'
|
|
4
|
+
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
|
|
4
5
|
import type { RangeAsDate, RangeDate } from './types.js'
|
|
5
|
-
import dayjs from 'dayjs'
|
|
6
6
|
|
|
7
7
|
export let numberOfMonths = 3
|
|
8
8
|
export let numberOfColumns = numberOfMonths
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
startDate: range?.start ? dayjs(range.start).toDate() : undefined,
|
|
50
50
|
endDate: range?.end ? dayjs(range.end).toDate() : undefined,
|
|
51
51
|
setup: (picker: Litepicker) => {
|
|
52
|
+
// biome-ignore lint/suspicious/noExplicitAny: Litepicker external type
|
|
52
53
|
picker.on('selected', (date1: any, date2: any) => {
|
|
53
54
|
range = {
|
|
54
55
|
start: new Date(
|
|
@@ -1,42 +1,49 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { goto } from '$app/navigation'
|
|
2
|
+
import { CalendarRangeIcon } from '@lucide/svelte'
|
|
4
3
|
import { slide } from 'svelte/transition'
|
|
5
|
-
|
|
6
|
-
import { urlParam } from '../../
|
|
7
|
-
import { formatRangeShort } from './format.js'
|
|
8
|
-
import { Icon } from '../icon/index.js'
|
|
4
|
+
import { goto } from '$app/navigation'
|
|
5
|
+
import { param, urlParam } from '../../state/param.svelte.ts'
|
|
9
6
|
import { DropDown } from '../menu/index.js'
|
|
10
|
-
import {
|
|
7
|
+
import { formatRangeShort } from './format.js'
|
|
11
8
|
import { type RangeAsDate, RangePicker } from './index.js'
|
|
12
9
|
import { jsonParse } from '../../utils/jsonParse.js'
|
|
13
10
|
|
|
14
11
|
let dropDown: DropDown
|
|
15
12
|
let rangePicker: RangePicker
|
|
16
|
-
let klass = ''
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
let {
|
|
15
|
+
key = 'range',
|
|
16
|
+
range = $bindable(
|
|
17
|
+
jsonParse<RangeAsDate>(param.get(key), {
|
|
18
|
+
start: null,
|
|
19
|
+
end: null
|
|
20
|
+
})
|
|
21
|
+
),
|
|
22
|
+
minDate,
|
|
23
|
+
maxDate,
|
|
24
|
+
class: klass = '',
|
|
25
|
+
classLabel = ''
|
|
26
|
+
}: {
|
|
27
|
+
key?: string
|
|
28
|
+
range: RangeAsDate
|
|
29
|
+
minDate?: Date | number | string
|
|
30
|
+
maxDate?: Date | number | string
|
|
31
|
+
class?: string
|
|
32
|
+
classLabel?: string
|
|
33
|
+
} = $props()
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
let isValidPeriod = $derived(!!range.start && !!range.end)
|
|
29
36
|
|
|
30
37
|
function getLabel(_range?: Partial<RangeAsDate>) {
|
|
31
38
|
if (!_range || !_range.start || !_range.end) return ''
|
|
32
39
|
return formatRangeShort(_range as RangeAsDate)
|
|
33
40
|
}
|
|
34
41
|
|
|
35
|
-
async function
|
|
42
|
+
async function updateURL() {
|
|
36
43
|
const url =
|
|
37
44
|
!range.start && !range.end
|
|
38
|
-
?
|
|
39
|
-
:
|
|
45
|
+
? urlParam.without(key)
|
|
46
|
+
: urlParam.with({
|
|
40
47
|
[key]: JSON.stringify({
|
|
41
48
|
start: range.start?.toJSON(),
|
|
42
49
|
end: range.end?.toJSON()
|
|
@@ -46,24 +53,29 @@
|
|
|
46
53
|
}
|
|
47
54
|
</script>
|
|
48
55
|
|
|
49
|
-
<DropDown bind:this={dropDown} tippyProps={{ onHidden:
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
<DropDown bind:this={dropDown} tippyProps={{ onHidden: updateURL }} class="max-h-full">
|
|
57
|
+
{#snippet activator()}
|
|
58
|
+
<button class="min-width-0 btn flex-nowrap btn-sm {klass}">
|
|
59
|
+
<CalendarRangeIcon class="opacity-60" size={20} />
|
|
60
|
+
{#if isValidPeriod}
|
|
61
|
+
<span
|
|
62
|
+
transition:slide={{ axis: 'x', duration: 200 }}
|
|
63
|
+
class="text-xs font-medium whitespace-nowrap opacity-80 {classLabel}"
|
|
64
|
+
>
|
|
65
|
+
{getLabel(range)}
|
|
66
|
+
</span>
|
|
67
|
+
{/if}
|
|
68
|
+
</button>
|
|
69
|
+
{/snippet}
|
|
61
70
|
|
|
62
71
|
<RangePicker bind:this={rangePicker} numberOfMonths={1} bind:range {minDate} {maxDate} />
|
|
63
72
|
|
|
64
73
|
<div class="flex gap-2 p-2">
|
|
65
|
-
|
|
66
|
-
<
|
|
74
|
+
<!--
|
|
75
|
+
<InputString label="A partir de" bind:value={range.start} class="grow" />
|
|
76
|
+
<InputString label="Jusqu'à" bind:value={range.end} class="grow" />
|
|
77
|
+
-->
|
|
78
|
+
<span>TODO: same problème with input...</span>
|
|
67
79
|
</div>
|
|
68
80
|
|
|
69
81
|
<div class="m-2 flex justify-end gap-2">
|
|
@@ -71,7 +83,7 @@
|
|
|
71
83
|
<button
|
|
72
84
|
transition:slide
|
|
73
85
|
class="btn btn-ghost"
|
|
74
|
-
|
|
86
|
+
onclick={() => {
|
|
75
87
|
range = { start: null, end: null }
|
|
76
88
|
rangePicker.clear()
|
|
77
89
|
dropDown.hide()
|
|
@@ -80,6 +92,6 @@
|
|
|
80
92
|
Effacer
|
|
81
93
|
</button>
|
|
82
94
|
{/if}
|
|
83
|
-
<button class="btn"
|
|
95
|
+
<button class="btn" onclick={() => dropDown.hide()}> Valider </button>
|
|
84
96
|
</div>
|
|
85
97
|
</DropDown>
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import { type RangeAsDate } from './index.js';
|
|
2
|
-
|
|
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;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const RangePickerButton: $$__sveltets_2_IsomorphicComponent<{
|
|
2
|
+
type $$ComponentProps = {
|
|
16
3
|
key?: string;
|
|
17
|
-
range
|
|
18
|
-
minDate?: Date | number | string
|
|
19
|
-
maxDate?: Date | number | string
|
|
4
|
+
range: RangeAsDate;
|
|
5
|
+
minDate?: Date | number | string;
|
|
6
|
+
maxDate?: Date | number | string;
|
|
20
7
|
class?: string;
|
|
21
8
|
classLabel?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
type RangePickerButton = InstanceType<typeof RangePickerButton>;
|
|
9
|
+
};
|
|
10
|
+
declare const RangePickerButton: import("svelte").Component<$$ComponentProps, {}, "range">;
|
|
11
|
+
type RangePickerButton = ReturnType<typeof RangePickerButton>;
|
|
26
12
|
export default RangePickerButton;
|
package/dist/ui/range/index.d.ts
CHANGED
package/dist/ui/range/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<script lang="ts" generics="Item extends ItemBase">
|
|
2
2
|
import { afterNavigate } from '$app/navigation'
|
|
3
|
-
import { maxHeightScreen } from '../../action/heightScreen.js'
|
|
4
|
-
import { Placeholder } from '../placeholder/index.js'
|
|
5
3
|
|
|
6
4
|
import {
|
|
7
|
-
type TableField,
|
|
8
|
-
type ItemBase,
|
|
9
|
-
TableHead,
|
|
10
|
-
TableBody,
|
|
11
5
|
context,
|
|
12
6
|
createKeys,
|
|
13
|
-
|
|
7
|
+
type ItemBase,
|
|
8
|
+
syncFieldsWithParams,
|
|
9
|
+
TableBody,
|
|
10
|
+
type TableField,
|
|
11
|
+
TableHead
|
|
14
12
|
} from './index.js'
|
|
15
13
|
import type { SnippetLike } from './type.js'
|
|
16
14
|
|
|
@@ -40,11 +38,13 @@
|
|
|
40
38
|
screenPadding?: number
|
|
41
39
|
} = $props()
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
$effect(() => {
|
|
42
|
+
const { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = createKeys(key)
|
|
43
|
+
context.set(key, {
|
|
44
|
+
KEY_FIELDS_VISIBLE,
|
|
45
|
+
KEY_FIELDS_HIDDEN,
|
|
46
|
+
KEY_FIELDS_ORDER
|
|
47
|
+
})
|
|
48
48
|
})
|
|
49
49
|
|
|
50
50
|
const initFields = () => (fields = syncFieldsWithParams(key, fields))
|
|
@@ -52,12 +52,8 @@
|
|
|
52
52
|
afterNavigate(initFields)
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
|
-
<div
|
|
56
|
-
class="
|
|
57
|
-
class:min-h-[320px]={!hideBody}
|
|
58
|
-
use:maxHeightScreen={{ padding: screenPadding }}
|
|
59
|
-
>
|
|
60
|
-
<table class="relative table">
|
|
55
|
+
<div class="{klass} overflow-x-auto rounded-lg border bg-base-100" class:min-h-[320px]={!hideBody}>
|
|
56
|
+
<table class="table relative">
|
|
61
57
|
<TableHead {fields} {key} {onCreateField} />
|
|
62
58
|
{#if !hideBody && items.length}
|
|
63
59
|
<TableBody {fields} {items} {actions} {classRow} {onclick} />
|
|
@@ -65,8 +61,6 @@
|
|
|
65
61
|
</table>
|
|
66
62
|
|
|
67
63
|
{#if hideBody && !items.length}
|
|
68
|
-
|
|
69
|
-
{placholder}
|
|
70
|
-
</Placeholder>
|
|
64
|
+
{placholder}
|
|
71
65
|
{/if}
|
|
72
66
|
</div>
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
<script lang="ts" generics="Item extends ItemBase">
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from '@
|
|
10
|
-
import type { TippyInstance } from '../../utils/tippy.js'
|
|
3
|
+
CheckIcon,
|
|
4
|
+
CircleCheckIcon,
|
|
5
|
+
CircleIcon,
|
|
6
|
+
EllipsisIcon,
|
|
7
|
+
GripIcon,
|
|
8
|
+
PlusIcon
|
|
9
|
+
} from '@lucide/svelte'
|
|
11
10
|
import { goto } from '$app/navigation'
|
|
12
|
-
import { page } from '$app/
|
|
13
|
-
import { urlParam } from '../../store/param.js'
|
|
11
|
+
import { page } from '$app/state'
|
|
14
12
|
import { listEditable } from '../../action/list/index.js'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { Icon } from '../icon/index.js'
|
|
13
|
+
import { tip } from '../../action/tip.js'
|
|
14
|
+
import { param, urlParam } from '../../state/param.svelte.ts'
|
|
18
15
|
import { DropDown } from '../menu/index.js'
|
|
16
|
+
import { context } from './context.js'
|
|
19
17
|
import type { ItemBase, TableField } from './index.js'
|
|
18
|
+
import { jsonParse } from '../../utils/jsonParse.js'
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
let {
|
|
21
|
+
fields,
|
|
22
|
+
key,
|
|
23
|
+
onCreateField
|
|
24
|
+
}: {
|
|
25
|
+
fields: TableField<Item>[]
|
|
26
|
+
key: string
|
|
27
|
+
onCreateField?: () => void
|
|
28
|
+
} = $props()
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
let { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = $derived(context.get(key))
|
|
28
31
|
|
|
29
32
|
function getFieldHref(field: TableField<Item>) {
|
|
30
33
|
if (field.locked) return
|
|
@@ -38,8 +41,8 @@
|
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
function toggleParam(paramKey: string, fieldKey: string): URL {
|
|
41
|
-
const url = new URL(
|
|
42
|
-
const fieldsKeys = jsonParse<string[]>(
|
|
44
|
+
const url = new URL(page.url)
|
|
45
|
+
const fieldsKeys = jsonParse<string[]>(page.url.searchParams.get(paramKey), [])
|
|
43
46
|
if (!fieldsKeys.includes(fieldKey)) fieldsKeys.push(fieldKey)
|
|
44
47
|
else fieldsKeys.splice(fieldsKeys.indexOf(fieldKey), 1)
|
|
45
48
|
|
|
@@ -52,78 +55,87 @@
|
|
|
52
55
|
function handleReorder(newFieldsOrder: TableField<Item>[]) {
|
|
53
56
|
fields = newFieldsOrder
|
|
54
57
|
const fieldsOrder = fields.map((f) => f.key)
|
|
55
|
-
const newUrl =
|
|
58
|
+
const newUrl = urlParam.with({
|
|
59
|
+
[KEY_FIELDS_ORDER]: JSON.stringify(fieldsOrder)
|
|
60
|
+
})
|
|
56
61
|
goto(newUrl, { replaceState: true, noScroll: true, keepFocus: true })
|
|
57
62
|
}
|
|
58
63
|
</script>
|
|
59
64
|
|
|
60
65
|
<th class="sticky right-0 z-10 p-0 px-1" align="right">
|
|
61
66
|
<DropDown
|
|
62
|
-
bind:tip
|
|
63
67
|
hideOnNav={false}
|
|
64
68
|
class="max-h-none px-0"
|
|
65
69
|
tippyProps={{ appendTo: () => document.body, placement: 'bottom-end' }}
|
|
66
70
|
>
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
|
|
71
|
+
{#snippet activator()}
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
class="btn btn-square btn-ghost backdrop-blur btn-sm"
|
|
75
|
+
use:tip={{ content: 'Dénfinir les champs' }}
|
|
76
|
+
>
|
|
77
|
+
<EllipsisIcon />
|
|
78
|
+
</button>
|
|
79
|
+
{/snippet}
|
|
80
|
+
|
|
81
|
+
{#snippet children({ tip })}
|
|
82
|
+
{#if onCreateField}
|
|
83
|
+
<div class="bordered flex items-center gap-2 border-b pr-1 pb-1 pl-2">
|
|
84
|
+
<span class=" font-semibold opacity-70">Champs</span>
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
class="btn ml-auto btn-square btn-sm"
|
|
88
|
+
onclick={() => {
|
|
89
|
+
if (onCreateField) onCreateField()
|
|
90
|
+
tip?.hide()
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<PlusIcon title="Ajouter un champ" />
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
96
|
+
{/if}
|
|
70
97
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
on:click={() => {
|
|
78
|
-
if (onCreateField) onCreateField()
|
|
79
|
-
tip.hide()
|
|
98
|
+
<div class="max-h-125 overflow-auto px-1 pt-1">
|
|
99
|
+
<div
|
|
100
|
+
use:listEditable={{
|
|
101
|
+
items: fields,
|
|
102
|
+
onChange: handleReorder,
|
|
103
|
+
dragElementsSelector: '.drag-button'
|
|
80
104
|
}}
|
|
81
105
|
>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
data-sveltekit-keepfocus
|
|
102
|
-
data-sveltekit-replacestate
|
|
103
|
-
data-sveltekit-noscroll
|
|
104
|
-
>
|
|
105
|
-
{#if field.locked}
|
|
106
|
-
<Icon path={mdiCheck} class="fill-base-content/50" size={21} />
|
|
107
|
-
{:else if $urlParam.has(field.key)}
|
|
108
|
-
<Icon path={mdiCheckCircleOutline} class="fill-primary" size={21} />
|
|
109
|
-
{:else if field._visible}
|
|
110
|
-
<Icon path={mdiCheck} class="fill-success" size={21} />
|
|
111
|
-
{:else}
|
|
112
|
-
<Icon path={mdiCircleSmall} class="fill-base-content/50" size={21} />
|
|
113
|
-
{/if}
|
|
106
|
+
{#each fields as field (field.key)}
|
|
107
|
+
<a
|
|
108
|
+
draggable="false"
|
|
109
|
+
href={getFieldHref(field)}
|
|
110
|
+
class="menu-item w-full"
|
|
111
|
+
class:disabled={field.locked}
|
|
112
|
+
data-sveltekit-keepfocus
|
|
113
|
+
data-sveltekit-replacestate
|
|
114
|
+
data-sveltekit-noscroll
|
|
115
|
+
>
|
|
116
|
+
{#if field.locked}
|
|
117
|
+
<CheckIcon class="fill-base-content/50" size={21} />
|
|
118
|
+
{:else if param.has(field.key)}
|
|
119
|
+
<CircleCheckIcon class="fill-primary" size={21} />
|
|
120
|
+
{:else if field._visible}
|
|
121
|
+
<CheckIcon class="fill-success" size={21} />
|
|
122
|
+
{:else}
|
|
123
|
+
<CircleIcon class="fill-base-content/50" size={21} />
|
|
124
|
+
{/if}
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
<span>{field.label}</span>
|
|
116
127
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
<span
|
|
129
|
+
class="drag-button btn ml-auto btn-square btn-ghost btn-xs"
|
|
130
|
+
onclick={(e) => e.preventDefault()}
|
|
131
|
+
role="none"
|
|
132
|
+
>
|
|
133
|
+
<GripIcon size={18} class="fill-base-content/80" />
|
|
134
|
+
</span>
|
|
135
|
+
</a>
|
|
136
|
+
{/each}
|
|
137
|
+
</div>
|
|
126
138
|
</div>
|
|
127
|
-
|
|
139
|
+
{/snippet}
|
|
128
140
|
</DropDown>
|
|
129
141
|
</th>
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import type { ItemBase, TableField } from './index.js';
|
|
2
|
-
declare
|
|
3
|
-
props
|
|
2
|
+
declare function $$render<Item extends ItemBase>(): {
|
|
3
|
+
props: {
|
|
4
4
|
fields: TableField<Item>[];
|
|
5
5
|
key: string;
|
|
6
|
-
onCreateField?: (
|
|
7
|
-
};
|
|
8
|
-
events(): {
|
|
9
|
-
click: PointerEvent;
|
|
10
|
-
} & {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
+
onCreateField?: () => void;
|
|
12
7
|
};
|
|
13
|
-
|
|
14
|
-
bindings
|
|
8
|
+
exports: {};
|
|
9
|
+
bindings: "";
|
|
10
|
+
slots: {};
|
|
11
|
+
events: {};
|
|
12
|
+
};
|
|
13
|
+
declare class __sveltets_Render<Item extends ItemBase> {
|
|
14
|
+
props(): ReturnType<typeof $$render<Item>>['props'];
|
|
15
|
+
events(): ReturnType<typeof $$render<Item>>['events'];
|
|
16
|
+
slots(): ReturnType<typeof $$render<Item>>['slots'];
|
|
17
|
+
bindings(): "";
|
|
15
18
|
exports(): {};
|
|
16
19
|
}
|
|
17
20
|
interface $$IsomorphicComponent {
|
|
18
21
|
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
22
|
$$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
|
|
20
23
|
} & 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']>;
|
|
24
|
+
<Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {}): ReturnType<__sveltets_Render<Item>['exports']>;
|
|
24
25
|
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
25
26
|
}
|
|
26
27
|
declare const TableFieldsEdition: $$IsomorphicComponent;
|