fuma 1.0.16 → 1.0.18
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/private/Meta.svelte +27 -32
- package/dist/private/Meta.svelte.d.ts +0 -1
- package/dist/private/api.d.ts +1 -1
- package/dist/ui/badge/Badge.svelte +3 -4
- package/dist/ui/button/ButtonCopy.svelte +31 -37
- package/dist/ui/button/ButtonDelete.svelte +21 -23
- package/dist/ui/button/ButtonDelete.svelte.d.ts +0 -1
- package/dist/ui/card/Card.svelte +10 -13
- package/dist/ui/card/Card.svelte.d.ts +0 -1
- package/dist/ui/card/CardBasic.svelte +4 -5
- package/dist/ui/card/CardBasic.svelte.d.ts +0 -1
- package/dist/ui/card/CardCollapse.svelte +31 -35
- package/dist/ui/card/CardCollapse.svelte.d.ts +0 -1
- package/dist/ui/card/CardFullScreen.svelte +6 -8
- package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -3
- package/dist/ui/card/CardLink.svelte +4 -5
- package/dist/ui/card/CardLink.svelte.d.ts +0 -1
- package/dist/ui/dialog/Dialog.svelte +34 -41
- package/dist/ui/dialog/Dialog.svelte.d.ts +0 -1
- package/dist/ui/dialog/DialogConfirm.svelte +4 -6
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -1
- package/dist/ui/drawer/Drawer.svelte +37 -46
- package/dist/ui/drawer/Drawer.svelte.d.ts +0 -16
- package/dist/ui/form/Form.svelte +82 -100
- package/dist/ui/form/Form.svelte.d.ts +0 -1
- package/dist/ui/form/FormInput.svelte +6 -12
- package/dist/ui/form/FormInput.svelte.d.ts +0 -18
- package/dist/ui/form/FormSection.svelte +16 -23
- package/dist/ui/form/formInput.d.ts +0 -1
- package/dist/ui/icon/Icon.svelte +32 -35
- package/dist/ui/input/FormControl.svelte +32 -38
- package/dist/ui/input/FormControl.svelte.d.ts +0 -3
- package/dist/ui/input/InputBoolean.svelte +8 -13
- package/dist/ui/input/InputBoolean.svelte.d.ts +0 -3
- package/dist/ui/input/InputCheckboxs.svelte +20 -22
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -3
- package/dist/ui/input/InputCheckboxsMenu.svelte +35 -51
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -3
- package/dist/ui/input/InputCheckboxsTree.svelte +6 -9
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +27 -35
- package/dist/ui/input/InputCombo.svelte +34 -43
- package/dist/ui/input/InputCombo.svelte.d.ts +0 -3
- package/dist/ui/input/InputDate.svelte +17 -22
- package/dist/ui/input/InputDateTime.svelte +18 -23
- package/dist/ui/input/InputImage.svelte +45 -52
- package/dist/ui/input/InputImage.svelte.d.ts +0 -1
- package/dist/ui/input/InputImagePreview.svelte +20 -24
- package/dist/ui/input/InputNumber.svelte +5 -10
- package/dist/ui/input/InputOptionInParam.svelte +10 -12
- package/dist/ui/input/InputOptions.svelte +34 -40
- package/dist/ui/input/InputPassword.svelte +5 -7
- package/dist/ui/input/InputPassword.svelte.d.ts +0 -3
- package/dist/ui/input/InputRadio.svelte +32 -36
- package/dist/ui/input/InputRadio.svelte.d.ts +0 -3
- package/dist/ui/input/InputRelation.svelte +67 -83
- package/dist/ui/input/InputRelation.svelte.d.ts +0 -1
- package/dist/ui/input/InputRelations.svelte +79 -92
- package/dist/ui/input/InputSearch.svelte +10 -13
- package/dist/ui/input/InputSelect.svelte +28 -39
- package/dist/ui/input/InputText.svelte +7 -8
- package/dist/ui/input/InputTextarea.svelte +6 -6
- package/dist/ui/input/InputTime.svelte +23 -29
- package/dist/ui/input/RelationAfter.svelte +9 -13
- package/dist/ui/input/SelectorList.svelte +12 -16
- package/dist/ui/input/SelectorList.svelte.d.ts +0 -4
- package/dist/ui/input/textRich/InputTextRich.svelte +50 -57
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -3
- package/dist/ui/input/textRich/SuggesionList.svelte +9 -13
- package/dist/ui/input/textRich/ToolMark.svelte +9 -12
- package/dist/ui/input/textRich/ToolMarkColor.svelte +11 -15
- package/dist/ui/input/textRich/ToolMarkLink.svelte +38 -46
- package/dist/ui/input/textRich/ToolMenu.svelte +19 -34
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +9 -13
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +7 -12
- package/dist/ui/input/textRich/ToolMenuNode.svelte +10 -14
- package/dist/ui/input/textRich/ToolsBar.svelte +11 -15
- package/dist/ui/login/Login.svelte +30 -36
- package/dist/ui/menu/ContextMenu.svelte +31 -37
- package/dist/ui/menu/ContextMenu.svelte.d.ts +0 -1
- package/dist/ui/menu/DropDown.svelte +83 -92
- package/dist/ui/menu/DropDown.svelte.d.ts +0 -1
- package/dist/ui/menu/DropDownMenu.svelte +18 -25
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +0 -1
- package/dist/ui/mode/ToggleMode.svelte +14 -15
- package/dist/ui/mode/ToggleMode.svelte.d.ts +1 -6
- package/dist/ui/pagination/Pagination.svelte +8 -9
- package/dist/ui/placeholder/Placeholder.svelte +3 -4
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -1
- package/dist/ui/placeholder/PlaceholderImage.svelte +4 -6
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -1
- package/dist/ui/range/RangePicker.svelte +62 -75
- package/dist/ui/range/RangePicker.svelte.d.ts +2 -2
- package/dist/ui/range/RangePickerButton.svelte +35 -43
- package/dist/ui/slot/Slot.svelte +25 -42
- package/dist/ui/slot/Span.svelte +1 -2
- package/dist/ui/table/Table.svelte +28 -35
- package/dist/ui/table/TableBody.svelte +12 -18
- package/dist/ui/table/TableCell.svelte +10 -13
- package/dist/ui/table/TableFieldsEdition.svelte +52 -58
- package/dist/ui/table/TableHead.svelte +21 -20
- package/dist/ui/table/TableViewSelect.svelte +37 -50
- package/dist/ui/table/cell/TableCellArray.svelte +3 -5
- package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
- package/dist/ui/table/cell/TableCellNumber.svelte +1 -2
- package/dist/ui/table/cell/TableCellString.svelte +2 -5
- package/dist/ui/table/cell/TableCellString.svelte.d.ts +20 -10
- package/dist/ui/table/field.d.ts +25 -17
- package/dist/ui/table/field.js +1 -1
- package/dist/ui/table/head/OrderButtons.svelte +37 -0
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +20 -0
- package/dist/ui/table/head/TableHeadBoolean.svelte +3 -6
- package/dist/ui/table/head/TableHeadBoolean.svelte.d.ts +20 -10
- package/dist/ui/table/head/TableHeadDate.svelte +113 -61
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +20 -10
- package/dist/ui/table/head/TableHeadDefault.svelte +2 -5
- package/dist/ui/table/head/TableHeadDefault.svelte.d.ts +20 -10
- package/dist/ui/table/head/TableHeadNumber.svelte +76 -67
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +20 -10
- package/dist/ui/table/head/TableHeadSelect.svelte +41 -47
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +20 -10
- package/dist/ui/table/head/TableHeadString.svelte +8 -14
- package/dist/ui/table/head/TableHeadString.svelte.d.ts +20 -10
- package/dist/ui/table/head/index.d.ts +2 -2
- package/dist/ui/tabs/Tabs.svelte +5 -8
- package/dist/ui/tabs/TabsIcon.svelte +28 -31
- package/dist/validation/zod.d.ts +12 -0
- package/dist/validation/zod.js +4 -2
- package/package.json +1 -1
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { TableField } from '../index.js';
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
declare class __sveltets_Render<Item extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}> {
|
|
6
|
+
props(): {
|
|
7
|
+
field: TableField<Item>;
|
|
6
8
|
};
|
|
7
|
-
events: {
|
|
9
|
+
events(): {} & {
|
|
8
10
|
[evt: string]: CustomEvent<any>;
|
|
9
11
|
};
|
|
10
|
-
slots: {};
|
|
11
|
-
}
|
|
12
|
-
export type TableHeadDefaultProps
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
12
|
+
slots(): {};
|
|
13
|
+
}
|
|
14
|
+
export type TableHeadDefaultProps<Item extends {
|
|
15
|
+
id: string;
|
|
16
|
+
}> = ReturnType<__sveltets_Render<Item>['props']>;
|
|
17
|
+
export type TableHeadDefaultEvents<Item extends {
|
|
18
|
+
id: string;
|
|
19
|
+
}> = ReturnType<__sveltets_Render<Item>['events']>;
|
|
20
|
+
export type TableHeadDefaultSlots<Item extends {
|
|
21
|
+
id: string;
|
|
22
|
+
}> = ReturnType<__sveltets_Render<Item>['slots']>;
|
|
23
|
+
export default class TableHeadDefault<Item extends {
|
|
24
|
+
id: string;
|
|
25
|
+
}> extends SvelteComponent<TableHeadDefaultProps<Item>, TableHeadDefaultEvents<Item>, TableHeadDefaultSlots<Item>> {
|
|
16
26
|
}
|
|
17
27
|
export {};
|
|
@@ -1,68 +1,59 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
tip.hide()
|
|
58
|
-
goto($urlParam.without(field.key, 'skip', 'take'), { noScroll: true, keepFocus: true })
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function isDefined(v: number | undefined | null): v is number {
|
|
62
|
-
return typeof v === 'number'
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
$: isNegatifRange = isDefined(min) && isDefined(max) && max < min
|
|
1
|
+
<script generics="Item extends {id: string}">import { onMount } from "svelte";
|
|
2
|
+
import debounce from "debounce";
|
|
3
|
+
import { goto } from "$app/navigation";
|
|
4
|
+
import { page } from "$app/stores";
|
|
5
|
+
import { DropDown } from "../../menu/index.js";
|
|
6
|
+
import { InputNumber } from "../../input/index.js";
|
|
7
|
+
import { urlParam } from "../../../store/param.js";
|
|
8
|
+
import { jsonParse } from "../../../utils/jsonParse.js";
|
|
9
|
+
import { mdiFilterMultipleOutline, mdiSortAscending, mdiSortDescending } from "@mdi/js";
|
|
10
|
+
import { Icon } from "../../icon/index.js";
|
|
11
|
+
import OrderButtons from "./OrderButtons.svelte";
|
|
12
|
+
export let field;
|
|
13
|
+
let tip;
|
|
14
|
+
let { min, max, order } = initRange($page.url);
|
|
15
|
+
onMount(() => page.subscribe(({ url }) => ({ min, max, order } = initRange(url))));
|
|
16
|
+
function initRange({ searchParams }) {
|
|
17
|
+
return jsonParse(searchParams.get(field.key), {
|
|
18
|
+
min: void 0,
|
|
19
|
+
max: void 0,
|
|
20
|
+
order: void 0
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const updateUrl = debounce(() => {
|
|
24
|
+
if (isDefined(min) || isDefined(max) || order) {
|
|
25
|
+
goto(
|
|
26
|
+
$urlParam.with(
|
|
27
|
+
{
|
|
28
|
+
[field.key]: JSON.stringify({
|
|
29
|
+
...isDefined(min) ? { min } : {},
|
|
30
|
+
...isDefined(max) ? { max } : {},
|
|
31
|
+
...order ? { order } : {}
|
|
32
|
+
})
|
|
33
|
+
},
|
|
34
|
+
"skip",
|
|
35
|
+
"take"
|
|
36
|
+
),
|
|
37
|
+
{
|
|
38
|
+
noScroll: true,
|
|
39
|
+
keepFocus: true
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
goto($urlParam.without(field.key, "skip", "take"), { noScroll: true, keepFocus: true });
|
|
45
|
+
}, 250);
|
|
46
|
+
function handleReset() {
|
|
47
|
+
min = void 0;
|
|
48
|
+
max = void 0;
|
|
49
|
+
tip.hide();
|
|
50
|
+
goto($urlParam.without(field.key, "skip", "take"), { noScroll: true, keepFocus: true });
|
|
51
|
+
}
|
|
52
|
+
function isDefined(v) {
|
|
53
|
+
return typeof v === "number";
|
|
54
|
+
}
|
|
55
|
+
$:
|
|
56
|
+
isNegatifRange = isDefined(min) && isDefined(max) && max < min;
|
|
66
57
|
</script>
|
|
67
58
|
|
|
68
59
|
<th class="p-1">
|
|
@@ -92,13 +83,31 @@
|
|
|
92
83
|
{/if}
|
|
93
84
|
</span>
|
|
94
85
|
{/if}
|
|
86
|
+
{#if order}
|
|
87
|
+
<Icon
|
|
88
|
+
path={order === 'asc' ? mdiSortAscending : mdiSortDescending}
|
|
89
|
+
size={18}
|
|
90
|
+
class="fill-primary"
|
|
91
|
+
/>
|
|
92
|
+
{/if}
|
|
95
93
|
</button>
|
|
96
94
|
|
|
95
|
+
{#if field.sortable !== false}
|
|
96
|
+
<OrderButtons
|
|
97
|
+
bind:order
|
|
98
|
+
on:change={() => {
|
|
99
|
+
updateUrl()
|
|
100
|
+
tip.hide()
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
<div class="divider"></div>
|
|
104
|
+
<span class="p-1 py-1 text-sm font-semibold opacity-70">Filtre:</span>
|
|
105
|
+
{/if}
|
|
97
106
|
<form class="grid grid-cols-2 gap-2 p-1" on:submit|preventDefault={() => tip.hide()}>
|
|
98
|
-
<InputNumber bind:value={min} on:input={
|
|
107
|
+
<InputNumber bind:value={min} on:input={updateUrl} input={{ placeholder: 'Min' }} />
|
|
99
108
|
<InputNumber
|
|
100
109
|
bind:value={max}
|
|
101
|
-
on:input={
|
|
110
|
+
on:input={updateUrl}
|
|
102
111
|
hint={isNegatifRange ? 'Doit être plus grand' : ''}
|
|
103
112
|
input={{ placeholder: 'Max' }}
|
|
104
113
|
/>
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { TableField } from '../field.js';
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
declare class __sveltets_Render<Item extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}> {
|
|
6
|
+
props(): {
|
|
7
|
+
field: TableField<Item>;
|
|
6
8
|
};
|
|
7
|
-
events: {
|
|
9
|
+
events(): {} & {
|
|
8
10
|
[evt: string]: CustomEvent<any>;
|
|
9
11
|
};
|
|
10
|
-
slots: {};
|
|
11
|
-
}
|
|
12
|
-
export type TableHeadNumberProps
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
12
|
+
slots(): {};
|
|
13
|
+
}
|
|
14
|
+
export type TableHeadNumberProps<Item extends {
|
|
15
|
+
id: string;
|
|
16
|
+
}> = ReturnType<__sveltets_Render<Item>['props']>;
|
|
17
|
+
export type TableHeadNumberEvents<Item extends {
|
|
18
|
+
id: string;
|
|
19
|
+
}> = ReturnType<__sveltets_Render<Item>['events']>;
|
|
20
|
+
export type TableHeadNumberSlots<Item extends {
|
|
21
|
+
id: string;
|
|
22
|
+
}> = ReturnType<__sveltets_Render<Item>['slots']>;
|
|
23
|
+
export default class TableHeadNumber<Item extends {
|
|
24
|
+
id: string;
|
|
25
|
+
}> extends SvelteComponent<TableHeadNumberProps<Item>, TableHeadNumberEvents<Item>, TableHeadNumberSlots<Item>> {
|
|
16
26
|
}
|
|
17
27
|
export {};
|
|
@@ -1,50 +1,44 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const newSelections = selections.filter((v) => v !== value)
|
|
43
|
-
if (!newSelections.length) return params.without(field.key)
|
|
44
|
-
return params.with({ [field.key]: JSON.stringify(newSelections) }, 'skip', 'take')
|
|
45
|
-
}
|
|
46
|
-
return params.with({ [field.key]: JSON.stringify([...selections, value]) }, 'skip', 'take')
|
|
47
|
-
})
|
|
1
|
+
<script generics="Item extends {id: string}">import { derived } from "svelte/store";
|
|
2
|
+
import { page } from "$app/stores";
|
|
3
|
+
import { jsonParse } from "../../../utils/jsonParse.js";
|
|
4
|
+
import { DropDown } from "../../menu/index.js";
|
|
5
|
+
import { Icon } from "../../icon/index.js";
|
|
6
|
+
import { parseOptions } from "../../../utils/options.js";
|
|
7
|
+
import { urlParam } from "../../../store/param.js";
|
|
8
|
+
import { mdiOrderBoolAscendingVariant } from "@mdi/js";
|
|
9
|
+
export let field;
|
|
10
|
+
export let options;
|
|
11
|
+
export let multiSelect = false;
|
|
12
|
+
export let placeholder = "No option";
|
|
13
|
+
let _options = initOptions($page.url);
|
|
14
|
+
page.subscribe(({ url }) => _options = initOptions(url));
|
|
15
|
+
$:
|
|
16
|
+
optionsActive = _options.filter((option) => option.isActive);
|
|
17
|
+
function initOptions({ searchParams }) {
|
|
18
|
+
const selection = searchParams.get(field.key);
|
|
19
|
+
const selections = jsonParse(searchParams.get(field.key), []);
|
|
20
|
+
function getActive(value) {
|
|
21
|
+
if (!multiSelect)
|
|
22
|
+
return selection === value;
|
|
23
|
+
return selections.includes(value);
|
|
24
|
+
}
|
|
25
|
+
return parseOptions(options).map((option) => ({
|
|
26
|
+
...option,
|
|
27
|
+
isActive: getActive(option.value)
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
const getHref = derived(urlParam, (params) => (value) => {
|
|
31
|
+
const selections = jsonParse(params.get(field.key), []);
|
|
32
|
+
if (!multiSelect)
|
|
33
|
+
return params.toggle({ [field.key]: value }, "skip", "take");
|
|
34
|
+
if (selections.includes(value)) {
|
|
35
|
+
const newSelections = selections.filter((v) => v !== value);
|
|
36
|
+
if (!newSelections.length)
|
|
37
|
+
return params.without(field.key);
|
|
38
|
+
return params.with({ [field.key]: JSON.stringify(newSelections) }, "skip", "take");
|
|
39
|
+
}
|
|
40
|
+
return params.with({ [field.key]: JSON.stringify([...selections, value]) }, "skip", "take");
|
|
41
|
+
});
|
|
48
42
|
</script>
|
|
49
43
|
|
|
50
44
|
<th class="p-1">
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { TableField } from '../index.js';
|
|
3
3
|
import { type Options } from '../../../utils/options.js';
|
|
4
|
-
declare
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare class __sveltets_Render<Item extends {
|
|
5
|
+
id: string;
|
|
6
|
+
}> {
|
|
7
|
+
props(): {
|
|
8
|
+
field: TableField<Item>;
|
|
7
9
|
options: Options;
|
|
8
10
|
multiSelect?: boolean | undefined;
|
|
9
11
|
placeholder?: string | undefined;
|
|
10
12
|
};
|
|
11
|
-
events: {
|
|
13
|
+
events(): {} & {
|
|
12
14
|
[evt: string]: CustomEvent<any>;
|
|
13
15
|
};
|
|
14
|
-
slots: {};
|
|
15
|
-
}
|
|
16
|
-
export type TableHeadSelectProps
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
16
|
+
slots(): {};
|
|
17
|
+
}
|
|
18
|
+
export type TableHeadSelectProps<Item extends {
|
|
19
|
+
id: string;
|
|
20
|
+
}> = ReturnType<__sveltets_Render<Item>['props']>;
|
|
21
|
+
export type TableHeadSelectEvents<Item extends {
|
|
22
|
+
id: string;
|
|
23
|
+
}> = ReturnType<__sveltets_Render<Item>['events']>;
|
|
24
|
+
export type TableHeadSelectSlots<Item extends {
|
|
25
|
+
id: string;
|
|
26
|
+
}> = ReturnType<__sveltets_Render<Item>['slots']>;
|
|
27
|
+
export default class TableHeadSelect<Item extends {
|
|
28
|
+
id: string;
|
|
29
|
+
}> extends SvelteComponent<TableHeadSelectProps<Item>, TableHeadSelectEvents<Item>, TableHeadSelectSlots<Item>> {
|
|
20
30
|
}
|
|
21
31
|
export {};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import type { TableField } from '../index.js'
|
|
10
|
-
|
|
11
|
-
export let field: TableField
|
|
12
|
-
|
|
13
|
-
let tip: TippyInstance
|
|
14
|
-
let searchValue = $page.url.searchParams.get(field.key) || ''
|
|
1
|
+
<script generics="Item extends {id: string}">import { mdiMagnify } from "@mdi/js";
|
|
2
|
+
import { page } from "$app/stores";
|
|
3
|
+
import { DropDown } from "../../menu/index.js";
|
|
4
|
+
import { Icon } from "../../icon/index.js";
|
|
5
|
+
import { InputSearch } from "../../input/index.js";
|
|
6
|
+
export let field;
|
|
7
|
+
let tip;
|
|
8
|
+
let searchValue = $page.url.searchParams.get(field.key) || "";
|
|
15
9
|
</script>
|
|
16
10
|
|
|
17
11
|
<th class="p-1">
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { TableField } from '../index.js';
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
declare class __sveltets_Render<Item extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}> {
|
|
6
|
+
props(): {
|
|
7
|
+
field: TableField<Item>;
|
|
6
8
|
};
|
|
7
|
-
events: {
|
|
9
|
+
events(): {} & {
|
|
8
10
|
[evt: string]: CustomEvent<any>;
|
|
9
11
|
};
|
|
10
|
-
slots: {};
|
|
11
|
-
}
|
|
12
|
-
export type TableHeadStringProps
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
12
|
+
slots(): {};
|
|
13
|
+
}
|
|
14
|
+
export type TableHeadStringProps<Item extends {
|
|
15
|
+
id: string;
|
|
16
|
+
}> = ReturnType<__sveltets_Render<Item>['props']>;
|
|
17
|
+
export type TableHeadStringEvents<Item extends {
|
|
18
|
+
id: string;
|
|
19
|
+
}> = ReturnType<__sveltets_Render<Item>['events']>;
|
|
20
|
+
export type TableHeadStringSlots<Item extends {
|
|
21
|
+
id: string;
|
|
22
|
+
}> = ReturnType<__sveltets_Render<Item>['slots']>;
|
|
23
|
+
export default class TableHeadString<Item extends {
|
|
24
|
+
id: string;
|
|
25
|
+
}> extends SvelteComponent<TableHeadStringProps<Item>, TableHeadStringEvents<Item>, TableHeadStringSlots<Item>> {
|
|
16
26
|
}
|
|
17
27
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps } from 'svelte';
|
|
2
2
|
import type { ComponentAndProps } from '../../../utils/component.js';
|
|
3
|
-
import type { TableField, TableFieldType } from '../field.js';
|
|
3
|
+
import type { ItemBase, TableField, TableFieldType } from '../field.js';
|
|
4
4
|
import { default as TableHeadSelect } from './TableHeadSelect.svelte';
|
|
5
5
|
import { default as TableHeadDate } from './TableHeadDate.svelte';
|
|
6
6
|
import { default as TableHeadBoolean } from './TableHeadBoolean.svelte';
|
|
@@ -15,5 +15,5 @@ declare const tableHeadComponentRecord: {
|
|
|
15
15
|
select: typeof TableHeadSelect;
|
|
16
16
|
date: typeof TableHeadDate;
|
|
17
17
|
};
|
|
18
|
-
export declare function tableHeadComponent<T extends TableFieldType>(type: T, props: Omit<ComponentProps<InstanceType<(typeof tableHeadComponentRecord)[T]>>, 'field'>): (field: TableField) => ComponentAndProps;
|
|
18
|
+
export declare function tableHeadComponent<T extends TableFieldType>(type: T, props: Omit<ComponentProps<InstanceType<(typeof tableHeadComponentRecord)[T]>>, 'field'>): <Item extends ItemBase>(field: TableField<Item>) => ComponentAndProps;
|
|
19
19
|
export {};
|
package/dist/ui/tabs/Tabs.svelte
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let tabs: Tab[]
|
|
7
|
-
let klass = ''
|
|
8
|
-
export { klass as class }
|
|
1
|
+
<script>import { page } from "$app/stores";
|
|
2
|
+
import { Icon } from "../icon/index.js";
|
|
3
|
+
export let tabs;
|
|
4
|
+
let klass = "";
|
|
5
|
+
export { klass as class };
|
|
9
6
|
</script>
|
|
10
7
|
|
|
11
8
|
<div
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!searchParams.has(key)) return option.value === defaultValue
|
|
30
|
-
return false
|
|
31
|
-
}
|
|
1
|
+
<script>import { page } from "$app/stores";
|
|
2
|
+
import { onMount } from "svelte";
|
|
3
|
+
import { urlParam } from "../../store/index.js";
|
|
4
|
+
import { Icon } from "../icon/index.js";
|
|
5
|
+
import { parseOptions } from "../../utils/options.js";
|
|
6
|
+
export let options;
|
|
7
|
+
export let showLabel = false;
|
|
8
|
+
export let key;
|
|
9
|
+
export let defaultValue = void 0;
|
|
10
|
+
let _options = getOptions($page.url);
|
|
11
|
+
onMount(
|
|
12
|
+
() => page.subscribe(({ url }) => {
|
|
13
|
+
_options = getOptions(url);
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
function getOptions(url) {
|
|
17
|
+
return parseOptions(options).map((option) => ({
|
|
18
|
+
...option,
|
|
19
|
+
isActive: getIsActive(option, url)
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
function getIsActive(option, { searchParams }) {
|
|
23
|
+
if (searchParams.get(key) === option.value)
|
|
24
|
+
return true;
|
|
25
|
+
if (!searchParams.has(key))
|
|
26
|
+
return option.value === defaultValue;
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
32
29
|
</script>
|
|
33
30
|
|
|
34
31
|
<div class="flex items-center gap-[3px] rounded-lg bg-base-200 p-1">
|
package/dist/validation/zod.d.ts
CHANGED
|
@@ -103,41 +103,53 @@ export declare const z: {
|
|
|
103
103
|
number: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{
|
|
104
104
|
min: zod.ZodOptional<zod.ZodNumber>;
|
|
105
105
|
max: zod.ZodOptional<zod.ZodNumber>;
|
|
106
|
+
order: zod.ZodOptional<zod.ZodEnum<["asc", "desc"]>>;
|
|
106
107
|
}, "strip", zod.ZodTypeAny, {
|
|
107
108
|
min?: number | undefined;
|
|
108
109
|
max?: number | undefined;
|
|
110
|
+
order?: "desc" | "asc" | undefined;
|
|
109
111
|
}, {
|
|
110
112
|
min?: number | undefined;
|
|
111
113
|
max?: number | undefined;
|
|
114
|
+
order?: "desc" | "asc" | undefined;
|
|
112
115
|
}>, zod.ZodPipeline<zod.ZodEffects<zod.ZodString, zod.RefinementCtx, string>, zod.ZodObject<{
|
|
113
116
|
min: zod.ZodOptional<zod.ZodNumber>;
|
|
114
117
|
max: zod.ZodOptional<zod.ZodNumber>;
|
|
118
|
+
order: zod.ZodOptional<zod.ZodEnum<["asc", "desc"]>>;
|
|
115
119
|
}, "strip", zod.ZodTypeAny, {
|
|
116
120
|
min?: number | undefined;
|
|
117
121
|
max?: number | undefined;
|
|
122
|
+
order?: "desc" | "asc" | undefined;
|
|
118
123
|
}, {
|
|
119
124
|
min?: number | undefined;
|
|
120
125
|
max?: number | undefined;
|
|
126
|
+
order?: "desc" | "asc" | undefined;
|
|
121
127
|
}>>]>>;
|
|
122
128
|
multiselect: zod.ZodOptional<zod.ZodUnion<[zod.ZodArray<zod.ZodString, "many">, zod.ZodPipeline<zod.ZodEffects<zod.ZodString, zod.RefinementCtx, string>, zod.ZodArray<zod.ZodString, "many">>]>>;
|
|
123
129
|
range: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{
|
|
124
130
|
start: zod.ZodOptional<zod.ZodDate>;
|
|
125
131
|
end: zod.ZodOptional<zod.ZodDate>;
|
|
132
|
+
order: zod.ZodOptional<zod.ZodEnum<["asc", "desc"]>>;
|
|
126
133
|
}, "strip", zod.ZodTypeAny, {
|
|
127
134
|
start?: Date | undefined;
|
|
128
135
|
end?: Date | undefined;
|
|
136
|
+
order?: "desc" | "asc" | undefined;
|
|
129
137
|
}, {
|
|
130
138
|
start?: Date | undefined;
|
|
131
139
|
end?: Date | undefined;
|
|
140
|
+
order?: "desc" | "asc" | undefined;
|
|
132
141
|
}>, zod.ZodPipeline<zod.ZodEffects<zod.ZodString, zod.RefinementCtx, string>, zod.ZodObject<{
|
|
133
142
|
start: zod.ZodOptional<zod.ZodDate>;
|
|
134
143
|
end: zod.ZodOptional<zod.ZodDate>;
|
|
144
|
+
order: zod.ZodOptional<zod.ZodEnum<["asc", "desc"]>>;
|
|
135
145
|
}, "strip", zod.ZodTypeAny, {
|
|
136
146
|
start?: Date | undefined;
|
|
137
147
|
end?: Date | undefined;
|
|
148
|
+
order?: "desc" | "asc" | undefined;
|
|
138
149
|
}, {
|
|
139
150
|
start?: Date | undefined;
|
|
140
151
|
end?: Date | undefined;
|
|
152
|
+
order?: "desc" | "asc" | undefined;
|
|
141
153
|
}>>]>>;
|
|
142
154
|
boolean: zod.ZodOptional<zod.ZodEffects<zod.ZodEnum<["true", "false"]>, boolean, "true" | "false">>;
|
|
143
155
|
};
|
package/dist/validation/zod.js
CHANGED
|
@@ -59,12 +59,14 @@ const relations = {
|
|
|
59
59
|
const filter = {
|
|
60
60
|
number: json({
|
|
61
61
|
min: zod.number().optional(),
|
|
62
|
-
max: zod.number().optional()
|
|
62
|
+
max: zod.number().optional(),
|
|
63
|
+
order: zod.enum(['asc', 'desc']).optional()
|
|
63
64
|
}).optional(),
|
|
64
65
|
multiselect: jsonArray(zod.string()).optional(),
|
|
65
66
|
range: json({
|
|
66
67
|
start: zod.coerce.date().optional(),
|
|
67
|
-
end: zod.coerce.date().optional()
|
|
68
|
+
end: zod.coerce.date().optional(),
|
|
69
|
+
order: zod.enum(['asc', 'desc']).optional()
|
|
68
70
|
}).optional(),
|
|
69
71
|
boolean: zod
|
|
70
72
|
.enum(['true', 'false'])
|