fuma 1.0.16 → 1.0.17
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 +51 -57
- package/dist/ui/table/TableHead.svelte +20 -19
- 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/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/TableHeadDate.svelte +110 -61
- package/dist/ui/table/head/TableHeadDefault.svelte +2 -5
- package/dist/ui/table/head/TableHeadNumber.svelte +76 -67
- package/dist/ui/table/head/TableHeadSelect.svelte +41 -47
- package/dist/ui/table/head/TableHeadString.svelte +8 -14
- 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,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>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,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>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">
|
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'])
|