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,23 +1,35 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { mdiWeatherNight, mdiWhiteBalanceSunny } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { browser } from '$app/environment'
|
|
3
|
+
import { ModeWatcher, toggleMode, mode } from 'mode-watcher'
|
|
4
|
+
import { mdiWeatherNight, mdiWhiteBalanceSunny } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
import { Icon } from '../icon/index.js'
|
|
7
|
+
import { onMount } from 'svelte'
|
|
8
|
+
|
|
9
|
+
let klass = ''
|
|
10
|
+
export { klass as class }
|
|
11
|
+
export let defaultMode: 'dark' | 'light' | 'system' | undefined = undefined
|
|
12
|
+
|
|
13
|
+
onMount(() => {
|
|
14
|
+
const [html] = document.getElementsByTagName('html')
|
|
15
|
+
if (!html || !$mode) return
|
|
16
|
+
html.setAttribute('data-theme', $mode)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
mode.subscribe((_mode) => {
|
|
20
|
+
if (!browser) return
|
|
21
|
+
const [html] = document.getElementsByTagName('html')
|
|
22
|
+
if (!html || !_mode) return
|
|
23
|
+
html.setAttribute('data-theme', _mode)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
$: path = $mode === 'light' ? mdiWhiteBalanceSunny : mdiWeatherNight
|
|
15
27
|
</script>
|
|
16
28
|
|
|
17
|
-
<ModeWatcher />
|
|
29
|
+
<ModeWatcher {defaultMode} />
|
|
18
30
|
|
|
19
31
|
<slot {toggleMode} {path}>
|
|
20
|
-
<button class="btn btn-square btn-sm" on:click={toggleMode}>
|
|
32
|
+
<button class="btn btn-square btn-sm {klass}" on:click={toggleMode}>
|
|
21
33
|
<Icon {path} />
|
|
22
34
|
</button>
|
|
23
35
|
</slot>
|
|
@@ -1,20 +1,37 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { toggleMode } from 'mode-watcher';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
default: {
|
|
10
|
-
toggleMode: typeof toggleMode;
|
|
11
|
-
path: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export type ToggleModeProps = typeof __propDef.props;
|
|
16
|
-
export type ToggleModeEvents = typeof __propDef.events;
|
|
17
|
-
export type ToggleModeSlots = typeof __propDef.slots;
|
|
18
|
-
export default class ToggleMode extends SvelteComponent<ToggleModeProps, ToggleModeEvents, ToggleModeSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const ToggleMode: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
+
class?: string;
|
|
22
|
+
defaultMode?: "dark" | "light" | "system" | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
default: {
|
|
25
|
+
toggleMode: typeof toggleMode;
|
|
26
|
+
path: string;
|
|
27
|
+
};
|
|
28
|
+
}>, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
default: {
|
|
32
|
+
toggleMode: typeof toggleMode;
|
|
33
|
+
path: string;
|
|
34
|
+
};
|
|
35
|
+
}, {}, string>;
|
|
36
|
+
type ToggleMode = InstanceType<typeof ToggleMode>;
|
|
37
|
+
export default ToggleMode;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiChevronLeft, mdiChevronRight } from '@mdi/js'
|
|
3
|
+
import { Icon } from '../icon/index.js'
|
|
4
|
+
import { urlParam } from '../../store/index.js'
|
|
5
|
+
|
|
6
|
+
export let take = 20
|
|
7
|
+
|
|
8
|
+
$: skip = +($urlParam.get('skip') || 0)
|
|
9
|
+
$: _take = +($urlParam.get('take') || take)
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<div class="join">
|
|
@@ -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 PaginationProps = typeof __propDef.props;
|
|
12
|
-
export type PaginationEvents = typeof __propDef.events;
|
|
13
|
-
export type PaginationSlots = typeof __propDef.slots;
|
|
14
|
-
export default class Pagination extends SvelteComponent<PaginationProps, PaginationEvents, PaginationSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
declare const Pagination: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
take?: number;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type Pagination = InstanceType<typeof Pagination>;
|
|
20
|
+
export default Pagination;
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type PlaceholderProps = typeof __propDef.props;
|
|
15
|
-
export type PlaceholderEvents = typeof __propDef.events;
|
|
16
|
-
export type PlaceholderSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Placeholder extends SvelteComponent<PlaceholderProps, PlaceholderEvents, PlaceholderSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
18
13
|
}
|
|
19
|
-
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const Placeholder: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
class?: string;
|
|
21
|
+
style?: string;
|
|
22
|
+
}, {
|
|
23
|
+
default: {};
|
|
24
|
+
}>, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {
|
|
27
|
+
default: {};
|
|
28
|
+
}, {}, string>;
|
|
29
|
+
type Placeholder = InstanceType<typeof Placeholder>;
|
|
30
|
+
export default Placeholder;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiPlus } from '@mdi/js'
|
|
3
|
+
import { Icon } from '../icon/index.js'
|
|
4
|
+
|
|
5
|
+
export let x: number
|
|
6
|
+
export let y: number
|
|
5
7
|
</script>
|
|
6
8
|
|
|
7
9
|
<div style:width="{x}px" style:height="{y}px" class="rounded-lg bg-base-200 p-2">
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type PlaceholderImageProps = typeof __propDef.props;
|
|
15
|
-
export type PlaceholderImageEvents = typeof __propDef.events;
|
|
16
|
-
export type PlaceholderImageSlots = typeof __propDef.slots;
|
|
17
|
-
export default class PlaceholderImage extends SvelteComponent<PlaceholderImageProps, PlaceholderImageEvents, PlaceholderImageSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
18
13
|
}
|
|
19
|
-
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const PlaceholderImage: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}, {
|
|
23
|
+
default: {};
|
|
24
|
+
}>, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {
|
|
27
|
+
default: {};
|
|
28
|
+
}, {}, string>;
|
|
29
|
+
type PlaceholderImage = InstanceType<typeof PlaceholderImage>;
|
|
30
|
+
export default PlaceholderImage;
|
|
@@ -1,68 +1,81 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
|
|
3
|
+
import type { Litepicker } from 'litepicker'
|
|
4
|
+
import type { Range, RangeAsDate, RangeDate } from './types.js'
|
|
5
|
+
import dayjs from 'dayjs'
|
|
6
|
+
|
|
7
|
+
export let numberOfMonths = 3
|
|
8
|
+
export let numberOfColumns = numberOfMonths
|
|
9
|
+
export let showWeekNumbers = true
|
|
10
|
+
export let range: RangeAsDate | undefined = undefined
|
|
11
|
+
export let minDate: Date | number | string | undefined = undefined
|
|
12
|
+
export let maxDate: Date | number | string | undefined = undefined
|
|
13
|
+
|
|
14
|
+
let startElement: HTMLInputElement
|
|
15
|
+
let endElement: HTMLInputElement
|
|
16
|
+
let picker: Litepicker
|
|
17
|
+
let parentEl: HTMLDivElement
|
|
18
|
+
const dispatch = createEventDispatcher<{ change: Range }>()
|
|
19
|
+
|
|
20
|
+
onMount(() => {
|
|
21
|
+
initTimePicker()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
onDestroy(() => {
|
|
25
|
+
picker?.destroy()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export function clear() {
|
|
29
|
+
picker?.clearSelection()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function initTimePicker() {
|
|
33
|
+
const _Litepicker = (await import('litepicker')).Litepicker
|
|
34
|
+
picker?.destroy()
|
|
35
|
+
picker = new _Litepicker({
|
|
36
|
+
element: startElement,
|
|
37
|
+
elementEnd: endElement,
|
|
38
|
+
// Nécéssaire pour traquer le theme
|
|
39
|
+
parentEl: parentEl,
|
|
40
|
+
inlineMode: true,
|
|
41
|
+
singleMode: false,
|
|
42
|
+
allowRepick: false,
|
|
43
|
+
lang: navigator.language,
|
|
44
|
+
numberOfMonths,
|
|
45
|
+
numberOfColumns,
|
|
46
|
+
showWeekNumbers,
|
|
47
|
+
minDate,
|
|
48
|
+
maxDate,
|
|
49
|
+
startDate: range?.start ? dayjs(range.start).toDate() : undefined,
|
|
50
|
+
endDate: range?.end ? dayjs(range.end).toDate() : undefined,
|
|
51
|
+
setup: (picker: Litepicker) => {
|
|
52
|
+
picker.on('selected', (date1: any, date2: any) => {
|
|
53
|
+
range = {
|
|
54
|
+
start: new Date(
|
|
55
|
+
`${getAbsoluteDate(date1.dateInstance)}T${getAbsoluteTime(range?.start)}`
|
|
56
|
+
),
|
|
57
|
+
end: new Date(
|
|
58
|
+
`${getAbsoluteDate(date2.dateInstance)}T${getAbsoluteTime(range?.end, '23:59:00')}`
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
dispatch('change', range)
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const getAbsoluteDate = (date: Date) =>
|
|
68
|
+
[date.getFullYear(), date.getMonth() + 1, date.getDate()]
|
|
69
|
+
.map((n) => n.toString().padStart(2, '0'))
|
|
70
|
+
.join('-')
|
|
71
|
+
|
|
72
|
+
const getAbsoluteTime = (date?: RangeDate, defaultTime = '00:00:00') => {
|
|
73
|
+
if (!date) return defaultTime
|
|
74
|
+
return dayjs(date).format('HH:mm:ss')
|
|
75
|
+
}
|
|
63
76
|
</script>
|
|
64
77
|
|
|
65
78
|
<input type="hidden" bind:this={startElement} />
|
|
66
79
|
<input type="hidden" bind:this={endElement} />
|
|
67
80
|
|
|
68
|
-
<div bind:this={parentEl}
|
|
81
|
+
<div bind:this={parentEl}></div>
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import type { Range, RangeAsDate } from './types.js';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
change: CustomEvent<RangeAsDate>;
|
|
15
|
-
} & {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export type RangePickerProps = typeof __propDef.props;
|
|
21
|
-
export type RangePickerEvents = typeof __propDef.events;
|
|
22
|
-
export type RangePickerSlots = typeof __propDef.slots;
|
|
23
|
-
export default class RangePicker extends SvelteComponent<RangePickerProps, RangePickerEvents, RangePickerSlots> {
|
|
24
|
-
get clear(): () => void;
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
25
14
|
}
|
|
26
|
-
|
|
15
|
+
declare const RangePicker: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
numberOfMonths?: number;
|
|
17
|
+
numberOfColumns?: number;
|
|
18
|
+
showWeekNumbers?: boolean;
|
|
19
|
+
range?: RangeAsDate | undefined;
|
|
20
|
+
minDate?: Date | number | string | undefined;
|
|
21
|
+
maxDate?: Date | number | string | undefined;
|
|
22
|
+
clear?: () => void;
|
|
23
|
+
}, {
|
|
24
|
+
change: CustomEvent<Range>;
|
|
25
|
+
} & {
|
|
26
|
+
[evt: string]: CustomEvent<any>;
|
|
27
|
+
}, {}, {
|
|
28
|
+
clear: () => void;
|
|
29
|
+
}, string>;
|
|
30
|
+
type RangePicker = InstanceType<typeof RangePicker>;
|
|
31
|
+
export default RangePicker;
|
|
@@ -1,38 +1,46 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { mdiCalendarMonthOutline } from '@mdi/js'
|
|
3
|
+
import { goto } from '$app/navigation'
|
|
4
|
+
import { slide } from 'svelte/transition'
|
|
5
|
+
|
|
6
|
+
import { urlParam } from '../../store/param.js'
|
|
7
|
+
import { formatRangeShort } from './format.js'
|
|
8
|
+
import { Icon } from '../icon/index.js'
|
|
9
|
+
import { DropDown } from '../menu/index.js'
|
|
10
|
+
import { InputTime } from '../input/index.js'
|
|
11
|
+
import { type RangeAsDate, RangePicker } from './index.js'
|
|
12
|
+
import { jsonParse } from '../../utils/jsonParse.js'
|
|
13
|
+
export let minDate: Date | number | string | undefined = undefined
|
|
14
|
+
export let maxDate: Date | number | string | undefined = undefined
|
|
15
|
+
|
|
16
|
+
let dropDown: DropDown
|
|
17
|
+
let rangePicker: RangePicker
|
|
18
|
+
|
|
19
|
+
export let key = 'range'
|
|
20
|
+
export let range: RangeAsDate = jsonParse<RangeAsDate>($urlParam.get(key), {
|
|
21
|
+
start: null,
|
|
22
|
+
end: null
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
$: isValidPeriod = !!range.start && !!range.end
|
|
26
|
+
|
|
27
|
+
function getLabel(_range?: Partial<RangeAsDate>) {
|
|
28
|
+
if (!_range || !_range.start || !_range.end) return ''
|
|
29
|
+
return formatRangeShort(_range as RangeAsDate)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function writeURL() {
|
|
33
|
+
const url =
|
|
34
|
+
!range.start && !range.end
|
|
35
|
+
? $urlParam.without(key)
|
|
36
|
+
: $urlParam.with({
|
|
37
|
+
[key]: JSON.stringify({
|
|
38
|
+
start: range.start?.toJSON(),
|
|
39
|
+
end: range.end?.toJSON()
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
return goto(url, { replaceState: true, noScroll: true })
|
|
43
|
+
}
|
|
36
44
|
</script>
|
|
37
45
|
|
|
38
46
|
<DropDown bind:this={dropDown} tippyProps={{ onHidden: writeURL }} class="max-h-full">
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import { type RangeAsDate } 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 RangePickerButtonProps = typeof __propDef.props;
|
|
16
|
-
export type RangePickerButtonEvents = typeof __propDef.events;
|
|
17
|
-
export type RangePickerButtonSlots = typeof __propDef.slots;
|
|
18
|
-
export default class RangePickerButton extends SvelteComponent<RangePickerButtonProps, RangePickerButtonEvents, RangePickerButtonSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
declare const RangePickerButton: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
minDate?: Date | number | string | undefined;
|
|
17
|
+
maxDate?: Date | number | string | undefined;
|
|
18
|
+
key?: string;
|
|
19
|
+
range?: RangeAsDate;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type RangePickerButton = InstanceType<typeof RangePickerButton>;
|
|
24
|
+
export default RangePickerButton;
|