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
package/dist/private/Meta.svelte
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
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
|
-
props = propsIndex.map(([id, index]) => ({
|
|
29
|
-
id,
|
|
30
|
-
value: ctx[index] as string
|
|
31
|
-
}))
|
|
32
|
-
}
|
|
1
|
+
<script>import {} from "svelte";
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
3
|
+
import { mdiEyeOffOutline, mdiEyeOutline } from "@mdi/js";
|
|
4
|
+
import { Card } from "../ui/card/index.js";
|
|
5
|
+
import { Table } from "../ui/table/index.js";
|
|
6
|
+
import { Icon } from "../ui/icon/index.js";
|
|
7
|
+
export let name = "";
|
|
8
|
+
export let description = "";
|
|
9
|
+
export let component;
|
|
10
|
+
let props = [];
|
|
11
|
+
let isPropsVisible = false;
|
|
12
|
+
$:
|
|
13
|
+
initMeta(component);
|
|
14
|
+
function initMeta(c) {
|
|
15
|
+
if (!c)
|
|
16
|
+
return;
|
|
17
|
+
updateComponentMeta(c);
|
|
18
|
+
component.$$.after_update.push(() => updateComponentMeta(c));
|
|
19
|
+
}
|
|
20
|
+
function updateComponentMeta(c) {
|
|
21
|
+
const ctx = c.$$.ctx;
|
|
22
|
+
const propsIndex = Object.entries(c.$$.props);
|
|
23
|
+
props = propsIndex.map(([id, index]) => ({
|
|
24
|
+
id,
|
|
25
|
+
value: ctx[index]
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
33
28
|
</script>
|
|
34
29
|
|
|
35
30
|
<Card class="mx-auto mb-6 max-w-4xl">
|
package/dist/private/api.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const apiConfig: {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
export declare const api: import("../api/config.js").ApiClient<Prisma.TypeMap<import("@prisma/client/runtime/library").DefaultArgs
|
|
32
|
+
export declare const api: import("../api/config.js").ApiClient<Prisma.TypeMap<import("@prisma/client/runtime/library").DefaultArgs>, {
|
|
33
33
|
Tag: (search: string) => {
|
|
34
34
|
where: {
|
|
35
35
|
name: {
|
|
@@ -1,40 +1,34 @@
|
|
|
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
|
-
disptach('success')
|
|
33
|
-
})
|
|
34
|
-
.catch((error) => {
|
|
35
|
-
toast.error(error)
|
|
36
|
-
})
|
|
37
|
-
}
|
|
1
|
+
<script>import { mdiClipboardTextOutline } from "@mdi/js";
|
|
2
|
+
import { toast } from "svelte-sonner";
|
|
3
|
+
import { Icon } from "../icon/index.js";
|
|
4
|
+
import { createEventDispatcher } from "svelte";
|
|
5
|
+
let valueOrGetValue;
|
|
6
|
+
export { valueOrGetValue as value };
|
|
7
|
+
export let title = "";
|
|
8
|
+
export let label = "";
|
|
9
|
+
export let icon = mdiClipboardTextOutline;
|
|
10
|
+
export let successMessage = "Copied";
|
|
11
|
+
let klass = "";
|
|
12
|
+
export { klass as class };
|
|
13
|
+
let isLoading = false;
|
|
14
|
+
const disptach = createEventDispatcher();
|
|
15
|
+
async function loadValue() {
|
|
16
|
+
if (typeof valueOrGetValue === "string")
|
|
17
|
+
return valueOrGetValue;
|
|
18
|
+
return valueOrGetValue();
|
|
19
|
+
}
|
|
20
|
+
async function handleClick() {
|
|
21
|
+
if (isLoading)
|
|
22
|
+
return;
|
|
23
|
+
isLoading = true;
|
|
24
|
+
const value = await loadValue().finally(() => isLoading = false);
|
|
25
|
+
navigator.clipboard.writeText(value).then(() => {
|
|
26
|
+
toast.success(successMessage);
|
|
27
|
+
disptach("success");
|
|
28
|
+
}).catch((error) => {
|
|
29
|
+
toast.error(error);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
38
32
|
</script>
|
|
39
33
|
|
|
40
34
|
<div class="relative">
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
clearTimeout(timeout)
|
|
23
|
-
}
|
|
1
|
+
<script>let klass = "";
|
|
2
|
+
export { klass as class };
|
|
3
|
+
export let formaction;
|
|
4
|
+
export let disabled = false;
|
|
5
|
+
export let btn = true;
|
|
6
|
+
let button;
|
|
7
|
+
let width = 0;
|
|
8
|
+
let ready = false;
|
|
9
|
+
let timeout;
|
|
10
|
+
function handleClick(event) {
|
|
11
|
+
if (ready)
|
|
12
|
+
return;
|
|
13
|
+
width = button.offsetWidth;
|
|
14
|
+
event.preventDefault();
|
|
15
|
+
ready = true;
|
|
16
|
+
timeout = setTimeout(() => ready = false, 2e3);
|
|
17
|
+
}
|
|
18
|
+
function handleLeave() {
|
|
19
|
+
ready = false;
|
|
20
|
+
clearTimeout(timeout);
|
|
21
|
+
}
|
|
24
22
|
</script>
|
|
25
23
|
|
|
26
24
|
<button
|
package/dist/ui/card/Card.svelte
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export let style = ''
|
|
12
|
-
|
|
13
|
-
contextContainer.set('card')
|
|
1
|
+
<script>import { mdiArrowLeft } from "@mdi/js";
|
|
2
|
+
import { Icon } from "../icon/index.js";
|
|
3
|
+
import { contextContainer } from "../context.js";
|
|
4
|
+
let klass = "";
|
|
5
|
+
export { klass as class };
|
|
6
|
+
export let bodyClass = "";
|
|
7
|
+
export let headerClass = "";
|
|
8
|
+
export let returnUrl = "";
|
|
9
|
+
export let style = "";
|
|
10
|
+
contextContainer.set("card");
|
|
14
11
|
</script>
|
|
15
12
|
|
|
16
13
|
<div class="card bordered border bg-base-100 shadow-lg {klass}" {style}>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export let style = ''
|
|
1
|
+
<script>export let title = "";
|
|
2
|
+
let klass = "";
|
|
3
|
+
export { klass as class };
|
|
4
|
+
export let style = "";
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
7
|
<div class="{klass} bg-base-100 border rounded-lg p-2 sm:p-5" {style}>
|
|
@@ -1,38 +1,34 @@
|
|
|
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
|
-
onDestroy(() => {
|
|
34
|
-
clearTimeout(timeout)
|
|
35
|
-
})
|
|
1
|
+
<script>import { onDestroy } from "svelte";
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
3
|
+
import { mdiChevronRight } from "@mdi/js";
|
|
4
|
+
import { Icon } from "../icon/index.js";
|
|
5
|
+
import { urlParam } from "../../store/index.js";
|
|
6
|
+
import { goto } from "$app/navigation";
|
|
7
|
+
export let value;
|
|
8
|
+
let klass = "";
|
|
9
|
+
export { klass as class };
|
|
10
|
+
export let classHeader = "";
|
|
11
|
+
export let classBody = "";
|
|
12
|
+
export let classTitle = "";
|
|
13
|
+
$:
|
|
14
|
+
isOpen = $urlParam.hasValue("section", value);
|
|
15
|
+
let header;
|
|
16
|
+
let timeout;
|
|
17
|
+
async function handleClick(event) {
|
|
18
|
+
if (isClickOnInteractiveElement(event))
|
|
19
|
+
return;
|
|
20
|
+
await goto($urlParam.toggle({ section: value }), { noScroll: true, keepFocus: true });
|
|
21
|
+
}
|
|
22
|
+
function isClickOnInteractiveElement(event) {
|
|
23
|
+
if (!event)
|
|
24
|
+
return false;
|
|
25
|
+
const target = event.target;
|
|
26
|
+
const elements = [...header.querySelectorAll("a, button")];
|
|
27
|
+
return !!elements.filter((element) => element.contains(target)).length;
|
|
28
|
+
}
|
|
29
|
+
onDestroy(() => {
|
|
30
|
+
clearTimeout(timeout);
|
|
31
|
+
});
|
|
36
32
|
</script>
|
|
37
33
|
|
|
38
34
|
<section class="card bordered border bg-base-100 shadow-md {klass}">
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let klass = ''
|
|
8
|
-
export { klass as class }
|
|
1
|
+
<script>import { mdiArrowCollapse, mdiArrowExpand } from "@mdi/js";
|
|
2
|
+
import { Icon } from "../icon/index.js";
|
|
3
|
+
import { Card } from "./index.js";
|
|
4
|
+
export let isFullScreen = false;
|
|
5
|
+
let klass = "";
|
|
6
|
+
export { klass as class };
|
|
9
7
|
</script>
|
|
10
8
|
|
|
11
9
|
<Card
|
|
@@ -1,44 +1,37 @@
|
|
|
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
|
-
buttons.forEach((button) => (button.tabIndex = -1))
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const observer = new MutationObserver(() => (dialog.open ? onDialogOpen() : onDialogClose()))
|
|
39
|
-
observer.observe(dialog, { attributeFilter: ['open'] })
|
|
40
|
-
return () => observer.disconnect()
|
|
41
|
-
})
|
|
1
|
+
<script>import { createEventDispatcher, onMount } from "svelte";
|
|
2
|
+
import { mdiClose } from "@mdi/js";
|
|
3
|
+
import { Icon } from "../icon/index.js";
|
|
4
|
+
import { contextContainer } from "../context.js";
|
|
5
|
+
export let dialog;
|
|
6
|
+
export let hideCloseButton = false;
|
|
7
|
+
let klass = "";
|
|
8
|
+
export { klass as class };
|
|
9
|
+
const dispatch = createEventDispatcher();
|
|
10
|
+
contextContainer.set("dialog");
|
|
11
|
+
onMount(() => {
|
|
12
|
+
const inputsSelector = 'input:not([type=hidden], [tabindex="-1"])';
|
|
13
|
+
const inputs = dialog.querySelectorAll(inputsSelector);
|
|
14
|
+
const buttons = dialog.querySelectorAll("button");
|
|
15
|
+
inputs.forEach((input) => input.tabIndex = -1);
|
|
16
|
+
buttons.forEach((button) => button.tabIndex = -1);
|
|
17
|
+
function onDialogOpen() {
|
|
18
|
+
dispatch("open");
|
|
19
|
+
inputs.forEach((input) => input.tabIndex = 0);
|
|
20
|
+
buttons.forEach((button) => button.tabIndex = 0);
|
|
21
|
+
if (!inputs[0])
|
|
22
|
+
return;
|
|
23
|
+
inputs[0].focus();
|
|
24
|
+
inputs[0].select();
|
|
25
|
+
}
|
|
26
|
+
function onDialogClose() {
|
|
27
|
+
dispatch("close");
|
|
28
|
+
inputs.forEach((input) => input.tabIndex = -1);
|
|
29
|
+
buttons.forEach((button) => button.tabIndex = -1);
|
|
30
|
+
}
|
|
31
|
+
const observer = new MutationObserver(() => dialog.open ? onDialogOpen() : onDialogClose());
|
|
32
|
+
observer.observe(dialog, { attributeFilter: ["open"] });
|
|
33
|
+
return () => observer.disconnect();
|
|
34
|
+
});
|
|
42
35
|
</script>
|
|
43
36
|
|
|
44
37
|
<dialog bind:this={dialog} class="modal" tabindex="-1">
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let klass = ''
|
|
6
|
-
export { klass as class }
|
|
1
|
+
<script>import { Dialog } from "./index.js";
|
|
2
|
+
let dialog;
|
|
3
|
+
let klass = "";
|
|
4
|
+
export { klass as class };
|
|
7
5
|
</script>
|
|
8
6
|
|
|
9
7
|
<button type="button" on:click={() => dialog.showModal()} class="btn btn-ghost {klass}">
|
|
@@ -1,49 +1,40 @@
|
|
|
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
|
-
const { offset, index, destroy, isActive } = subscibeDrawerLayers(key)
|
|
40
|
-
onDestroy(destroy)
|
|
41
|
-
contextContainer.set('drawer')
|
|
42
|
-
let clientWidth = 0
|
|
43
|
-
|
|
44
|
-
onMount(() => {
|
|
45
|
-
transitionX = $isActive ? clientWidth : 0
|
|
46
|
-
})
|
|
1
|
+
<script>import { onDestroy, onMount } from "svelte";
|
|
2
|
+
import { fade } from "svelte/transition";
|
|
3
|
+
import { mdiClose } from "@mdi/js";
|
|
4
|
+
import { goto } from "$app/navigation";
|
|
5
|
+
import { urlParam } from "../../store/param.js";
|
|
6
|
+
import { Icon } from "../icon/index.js";
|
|
7
|
+
import { subscibeDrawerLayers } from "./layers.js";
|
|
8
|
+
import { contextContainer } from "../context.js";
|
|
9
|
+
import { drawerFly } from "./drawerFly.js";
|
|
10
|
+
export let title = "";
|
|
11
|
+
export let key;
|
|
12
|
+
let klass = "";
|
|
13
|
+
export { klass as class };
|
|
14
|
+
export let maxWidth = "32rem";
|
|
15
|
+
export let classHeader = "";
|
|
16
|
+
export let classBody = "";
|
|
17
|
+
export let duration = 180;
|
|
18
|
+
export let noOverlay = false;
|
|
19
|
+
export let transitionX = 0;
|
|
20
|
+
export let zIndex = 50;
|
|
21
|
+
export function open(value = 1, options = {}) {
|
|
22
|
+
return goto($urlParam.with({ [key]: value }), {
|
|
23
|
+
...options,
|
|
24
|
+
replaceState: true,
|
|
25
|
+
noScroll: true
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export function close(options = {}) {
|
|
29
|
+
return goto($urlParam.without(key), { ...options, replaceState: true, noScroll: true });
|
|
30
|
+
}
|
|
31
|
+
const { offset, index, destroy, isActive } = subscibeDrawerLayers(key);
|
|
32
|
+
onDestroy(destroy);
|
|
33
|
+
contextContainer.set("drawer");
|
|
34
|
+
let clientWidth = 0;
|
|
35
|
+
onMount(() => {
|
|
36
|
+
transitionX = $isActive ? clientWidth : 0;
|
|
37
|
+
});
|
|
47
38
|
</script>
|
|
48
39
|
|
|
49
40
|
{#if !noOverlay && $isActive}
|