@quaffui/quaff 0.1.0-prealpha7 → 0.1.0-prealpha9
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/components/avatar/QAvatar.svelte +8 -7
- package/dist/components/avatar/props.d.ts +2 -2
- package/dist/components/button/QBtn.svelte +20 -7
- package/dist/components/button/QBtn.svelte.d.ts +0 -1
- package/dist/components/button/index.scss +18 -1
- package/dist/components/button/props.d.ts +2 -2
- package/dist/components/chip/QChip.svelte +8 -2
- package/dist/components/chip/props.d.ts +2 -2
- package/dist/components/dialog/QDialog.svelte +28 -13
- package/dist/components/dialog/QDialog.svelte.d.ts +0 -1
- package/dist/components/drawer/QDrawer.svelte +49 -37
- package/dist/components/drawer/index.scss +11 -8
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.svelte +18 -4
- package/dist/components/footer/QFooter.svelte.d.ts +2 -2
- package/dist/components/footer/index.scss +23 -0
- package/dist/components/footer/props.d.ts +4 -4
- package/dist/components/header/QHeader.svelte +28 -0
- package/dist/components/header/QHeader.svelte.d.ts +24 -0
- package/dist/components/header/props.d.ts +15 -0
- package/dist/components/header/props.js +1 -0
- package/dist/components/icon/QIcon.svelte +5 -12
- package/dist/components/icon/props.d.ts +2 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/layout/index.scss +89 -75
- package/dist/components/list/index.scss +1 -0
- package/dist/components/private/QApi.svelte +3 -1
- package/dist/components/progress/QCircularProgress.svelte +4 -3
- package/dist/components/progress/QCircularProgress.svelte.d.ts +1 -1
- package/dist/components/progress/props.d.ts +26 -9
- package/dist/components/progress/props.js +1 -7
- package/dist/components/railbar/QRailbar.svelte +48 -29
- package/dist/components/railbar/QRailbar.svelte.d.ts +1 -1
- package/dist/components/railbar/index.scss +39 -0
- package/dist/components/railbar/props.d.ts +11 -3
- package/dist/components/railbar/props.js +1 -7
- package/dist/components/tabs/QTab.svelte +44 -16
- package/dist/components/tabs/QTab.svelte.d.ts +1 -3
- package/dist/components/tabs/QTabs.svelte +3 -7
- package/dist/components/tabs/index.scss +40 -9
- package/dist/components/toolbar/QToolbar.svelte +6 -22
- package/dist/components/toolbar/QToolbar.svelte.d.ts +3 -1
- package/dist/components/toolbar/index.scss +8 -0
- package/dist/components/toolbar/props.d.ts +19 -4
- package/dist/components/toolbar/props.js +1 -10
- package/dist/composables/use-size.d.ts +8 -8
- package/dist/composables/use-size.js +23 -13
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +2 -2
- package/dist/css/mixins.scss +1 -3
- package/dist/css/ripple.scss +42 -0
- package/dist/css/states.scss +6 -2
- package/dist/helpers/ripple.d.ts +10 -0
- package/dist/helpers/ripple.js +75 -0
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/dom.d.ts +8 -0
- package/dist/utils/dom.js +71 -0
- package/dist/utils/events.d.ts +13 -0
- package/dist/utils/events.js +13 -0
- package/dist/utils/props.d.ts +1 -1
- package/dist/utils/props.js +1 -1
- package/dist/utils/types.d.ts +3 -0
- package/package.json +1 -1
- package/dist/css/material-symbols-outlined-latin-100-normal.woff +0 -0
- package/dist/css/material-symbols-outlined-latin-100-normal.woff2 +0 -0
- package/dist/css/material-symbols-outlined-latin-200-normal.woff +0 -0
- package/dist/css/material-symbols-outlined-latin-200-normal.woff2 +0 -0
- package/dist/css/material-symbols-outlined-latin-300-normal.woff +0 -0
- package/dist/css/material-symbols-outlined-latin-300-normal.woff2 +0 -0
- package/dist/css/material-symbols-outlined-latin-400-normal.woff +0 -0
- package/dist/css/material-symbols-outlined-latin-400-normal.woff2 +0 -0
- package/dist/css/material-symbols-rounded-latin-100-normal.woff +0 -0
- package/dist/css/material-symbols-rounded-latin-100-normal.woff2 +0 -0
- package/dist/css/material-symbols-rounded-latin-200-normal.woff +0 -0
- package/dist/css/material-symbols-rounded-latin-200-normal.woff2 +0 -0
- package/dist/css/material-symbols-rounded-latin-300-normal.woff +0 -0
- package/dist/css/material-symbols-rounded-latin-300-normal.woff2 +0 -0
- package/dist/css/material-symbols-rounded-latin-400-normal.woff +0 -0
- package/dist/css/material-symbols-rounded-latin-400-normal.woff2 +0 -0
- package/dist/css/material-symbols-sharp-latin-100-normal.woff +0 -0
- package/dist/css/material-symbols-sharp-latin-100-normal.woff2 +0 -0
- package/dist/css/material-symbols-sharp-latin-200-normal.woff +0 -0
- package/dist/css/material-symbols-sharp-latin-200-normal.woff2 +0 -0
- package/dist/css/material-symbols-sharp-latin-300-normal.woff +0 -0
- package/dist/css/material-symbols-sharp-latin-300-normal.woff2 +0 -0
- package/dist/css/material-symbols-sharp-latin-400-normal.woff +0 -0
- package/dist/css/material-symbols-sharp-latin-400-normal.woff2 +0 -0
- package/dist/css/roboto-cyrillic-400-normal.woff +0 -0
- package/dist/css/roboto-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/roboto-cyrillic-ext-400-normal.woff +0 -0
- package/dist/css/roboto-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/roboto-greek-400-normal.woff +0 -0
- package/dist/css/roboto-greek-400-normal.woff2 +0 -0
- package/dist/css/roboto-latin-400-normal.woff +0 -0
- package/dist/css/roboto-latin-400-normal.woff2 +0 -0
- package/dist/css/roboto-latin-ext-400-normal.woff +0 -0
- package/dist/css/roboto-latin-ext-400-normal.woff2 +0 -0
- package/dist/css/roboto-vietnamese-400-normal.woff +0 -0
- package/dist/css/roboto-vietnamese-400-normal.woff2 +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { useSize } from "../../composables/use-size";
|
|
2
|
+
import { createClasses, createStyles } from "../../utils/props";
|
|
2
3
|
export let shape = "circle", size = "md", src = void 0, video = false, userClasses = void 0, userStyles = void 0;
|
|
3
4
|
export { userClasses as class };
|
|
4
5
|
export { userStyles as style };
|
|
5
6
|
$:
|
|
6
|
-
|
|
7
|
+
sizeObj = useSize(size);
|
|
7
8
|
$:
|
|
8
9
|
shapeClass = createClasses([
|
|
9
10
|
shape === "circle" && "circle",
|
|
@@ -14,18 +15,18 @@ $:
|
|
|
14
15
|
shape.includes("right") && "right-round"
|
|
15
16
|
]);
|
|
16
17
|
$:
|
|
17
|
-
classes = createClasses([shapeClass,
|
|
18
|
+
classes = createClasses([shapeClass, sizeObj.class], {
|
|
18
19
|
component: "q-avatar",
|
|
19
20
|
userClasses
|
|
20
21
|
});
|
|
21
22
|
$:
|
|
22
|
-
style =
|
|
23
|
+
style = createStyles(
|
|
23
24
|
{
|
|
24
|
-
width:
|
|
25
|
-
height:
|
|
25
|
+
width: sizeObj.style,
|
|
26
|
+
height: sizeObj.style
|
|
26
27
|
},
|
|
27
28
|
userStyles
|
|
28
|
-
)
|
|
29
|
+
);
|
|
29
30
|
</script>
|
|
30
31
|
|
|
31
32
|
{#if video === true}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
1
|
+
import type { QuaffSizes, CssValue, NativeProps } from "../../utils/types";
|
|
2
2
|
export type QAvatarShapeOptions = "circle" | "rounded" | "top-round" | "left-round" | "right-round" | "bottom-round" | "top-left-round" | "top-right-round" | "bottom-left-round" | "bottom-right-round";
|
|
3
|
-
export type QAvatarSizeOptions =
|
|
3
|
+
export type QAvatarSizeOptions = QuaffSizes | CssValue | number;
|
|
4
4
|
export interface QAvatarProps extends NativeProps {
|
|
5
5
|
/**
|
|
6
6
|
* Shape of the avatar.
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
<script>import { createClasses } from "../../utils/props";
|
|
2
|
-
import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { createEventDispatcher, onMount } from "svelte";
|
|
3
3
|
import QIcon from "../icon/QIcon.svelte";
|
|
4
4
|
import QCircularProgress from "../progress/QCircularProgress.svelte";
|
|
5
|
-
import {
|
|
5
|
+
import { useSize } from "../../composables/use-size";
|
|
6
|
+
import { isActivationKey } from "../../utils/events";
|
|
7
|
+
import { ripple } from "../../helpers/ripple";
|
|
6
8
|
export let icon = void 0, label = void 0, disable = false, loading = false, unelevated = false, outline = false, round = false, rectangle = false, flat = false, to = void 0, size = void 0, userClasses = void 0;
|
|
7
9
|
export { userClasses as class };
|
|
8
|
-
|
|
10
|
+
let qBtn;
|
|
9
11
|
let tag;
|
|
10
12
|
$:
|
|
11
|
-
tag = to !== void 0 ? "a" : "
|
|
13
|
+
tag = to !== void 0 ? "a" : "button";
|
|
14
|
+
$:
|
|
15
|
+
sizeObj = useSize(size);
|
|
12
16
|
$:
|
|
13
17
|
classes = createClasses(
|
|
14
18
|
[
|
|
@@ -17,24 +21,33 @@ $:
|
|
|
17
21
|
outline && "outlined",
|
|
18
22
|
flat && "flat",
|
|
19
23
|
(!$$slots.default && !label || round) && "round",
|
|
20
|
-
size
|
|
24
|
+
size !== "md" && sizeObj.class
|
|
21
25
|
],
|
|
22
26
|
{
|
|
23
27
|
component: "q-btn",
|
|
24
28
|
userClasses
|
|
25
29
|
}
|
|
26
30
|
);
|
|
31
|
+
function onKeyDown(e) {
|
|
32
|
+
if (!isActivationKey(e))
|
|
33
|
+
return;
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
let click = new MouseEvent("click");
|
|
36
|
+
qBtn.dispatchEvent(click);
|
|
37
|
+
}
|
|
27
38
|
</script>
|
|
28
39
|
|
|
29
40
|
<svelte:element
|
|
30
41
|
this={tag}
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
bind:this={qBtn}
|
|
43
|
+
use:ripple
|
|
44
|
+
role={tag === "a" ? "button" : undefined}
|
|
33
45
|
href={to}
|
|
34
46
|
class={classes}
|
|
35
47
|
aria-disabled={disable || undefined}
|
|
36
48
|
tabindex={disable ? -1 : 0}
|
|
37
49
|
on:click
|
|
50
|
+
on:keydown={onKeyDown}
|
|
38
51
|
{...$$restProps}
|
|
39
52
|
>
|
|
40
53
|
{#if icon && !loading}
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
gap: 1rem;
|
|
27
27
|
line-height: normal;
|
|
28
28
|
@extend .elevate-sm-bottom;
|
|
29
|
-
@extend .ripple;
|
|
30
29
|
|
|
31
30
|
$sizeMap: (
|
|
32
31
|
"sm": -1,
|
|
@@ -77,5 +76,23 @@
|
|
|
77
76
|
margin: 0 -0.5rem;
|
|
78
77
|
}
|
|
79
78
|
|
|
79
|
+
&:is(:hover, :focus):not([aria-disabled])::after {
|
|
80
|
+
content: "";
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
background-color: var(--on-primary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:hover:not([aria-disabled])::after {
|
|
90
|
+
opacity: 0.08;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:focus:not([aria-disabled])::after {
|
|
94
|
+
opacity: 0.16;
|
|
95
|
+
}
|
|
96
|
+
|
|
80
97
|
@include btn-image;
|
|
81
98
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
2
|
-
export type QBtnSizeOptions =
|
|
1
|
+
import type { NativeProps, QuaffSizes } from "../../utils/types";
|
|
2
|
+
export type QBtnSizeOptions = Exclude<QuaffSizes, "xs">;
|
|
3
3
|
export interface QBtnProps extends NativeProps {
|
|
4
4
|
/**
|
|
5
5
|
* Puts the button in a disabled state, making it unclickable.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { createClasses } from "../../utils/props";
|
|
3
3
|
import { createEventDispatcher } from "svelte";
|
|
4
4
|
import QIcon from "../icon/QIcon.svelte";
|
|
5
|
+
import { useSize } from "../../composables/use-size";
|
|
5
6
|
export let content = void 0, icon = void 0, iconRight = void 0, disable = false, responsive = false, vertical = false, round = false, outlined = false, size = "md", tabindex = void 0, href = void 0, userClasses = void 0;
|
|
6
7
|
export { userClasses as class };
|
|
7
8
|
const emit = createEventDispatcher();
|
|
@@ -10,10 +11,15 @@ $:
|
|
|
10
11
|
$:
|
|
11
12
|
imgRight = iconRight?.startsWith("img:") ? iconRight.slice(4) : void 0;
|
|
12
13
|
$:
|
|
13
|
-
|
|
14
|
+
sizeObj = useSize(size);
|
|
14
15
|
$:
|
|
15
16
|
classes = createClasses(
|
|
16
|
-
[
|
|
17
|
+
[
|
|
18
|
+
vertical && "vertical",
|
|
19
|
+
round && "rounded",
|
|
20
|
+
(outlined || disable) && "bordered",
|
|
21
|
+
size !== "md" && sizeObj.class
|
|
22
|
+
],
|
|
17
23
|
{
|
|
18
24
|
component: "q-chip",
|
|
19
25
|
userClasses
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
2
|
-
export type QChipSizeOptions =
|
|
1
|
+
import type { NativeProps, QuaffSizes } from "../../utils/types";
|
|
2
|
+
export type QChipSizeOptions = Exclude<QuaffSizes, "xs" | "xl">;
|
|
3
3
|
export interface QChipProps extends NativeProps {
|
|
4
4
|
/**
|
|
5
5
|
* The content inside the chip. Will overwrite the default slot.
|
|
@@ -1,41 +1,57 @@
|
|
|
1
1
|
<script>import { createClasses } from "../../utils/props";
|
|
2
|
-
import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { createEventDispatcher, onMount } from "svelte";
|
|
3
3
|
import QBtn from "../button/QBtn.svelte";
|
|
4
4
|
import { clickOutsideDialog } from "../../helpers";
|
|
5
|
-
export let
|
|
5
|
+
export let noBtn = false, btnContent = void 0, btnAttrs = {}, position = "default", modal = false, fullscreen = false, persistent = false, userClasses = void 0;
|
|
6
6
|
export { userClasses as class };
|
|
7
7
|
const emit = createEventDispatcher();
|
|
8
8
|
let dialogElement;
|
|
9
|
+
let opened = false;
|
|
10
|
+
onMount(() => {
|
|
11
|
+
opened = dialogElement.open;
|
|
12
|
+
dialogElement.style.display = opened ? "block" : "none";
|
|
13
|
+
});
|
|
9
14
|
$:
|
|
10
|
-
canHideOnClickOutside =
|
|
15
|
+
canHideOnClickOutside = opened && persistent !== true;
|
|
11
16
|
$:
|
|
12
17
|
positionClass = ["top", "right", "bottom", "left"].includes(position) ? position : void 0;
|
|
13
18
|
$:
|
|
14
19
|
classes = createClasses(
|
|
15
|
-
[
|
|
20
|
+
[opened && "active", positionClass, modal && "modal", fullscreen && "max"],
|
|
16
21
|
{
|
|
17
22
|
component: "q-dialog",
|
|
18
23
|
userClasses
|
|
19
24
|
}
|
|
20
25
|
);
|
|
21
|
-
$:
|
|
22
|
-
value === true ? modal ? dialogElement?.showModal() : dialogElement?.show() : dialogElement?.close();
|
|
23
26
|
export function hide() {
|
|
24
|
-
if (
|
|
25
|
-
|
|
27
|
+
if (dialogElement && dialogElement.open) {
|
|
28
|
+
dialogElement.close();
|
|
29
|
+
opened = false;
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
dialogElement.style.display = "none";
|
|
32
|
+
}, 250);
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
35
|
export function show() {
|
|
29
|
-
if (
|
|
30
|
-
|
|
36
|
+
if (dialogElement && !dialogElement.open) {
|
|
37
|
+
modal ? dialogElement.showModal() : dialogElement.show();
|
|
38
|
+
opened = true;
|
|
39
|
+
dialogElement.style.display = "block";
|
|
31
40
|
}
|
|
32
41
|
}
|
|
33
42
|
export function toggle(e) {
|
|
34
|
-
|
|
43
|
+
if (dialogElement) {
|
|
44
|
+
opened = !opened;
|
|
45
|
+
if (dialogElement.open) {
|
|
46
|
+
hide();
|
|
47
|
+
} else {
|
|
48
|
+
show();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
35
51
|
e.stopPropagation();
|
|
36
52
|
}
|
|
37
53
|
function addAnimation() {
|
|
38
|
-
if (persistent &&
|
|
54
|
+
if (persistent && opened) {
|
|
39
55
|
dialogElement?.classList.add("animating");
|
|
40
56
|
setTimeout(() => {
|
|
41
57
|
dialogElement?.classList.remove("animating");
|
|
@@ -70,7 +86,6 @@ function handleClickHide() {
|
|
|
70
86
|
<dialog
|
|
71
87
|
use:clickOutsideDialog={handleClickHide}
|
|
72
88
|
class={classes}
|
|
73
|
-
open={value}
|
|
74
89
|
{...$$restProps}
|
|
75
90
|
bind:this={dialogElement}
|
|
76
91
|
on:cancel={handleKeyboardHide}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { createClasses, createStyles } from "../../utils/props";
|
|
3
3
|
import { getContext } from "svelte";
|
|
4
4
|
import { clickOutside } from "../../helpers";
|
|
5
|
+
import { useSize } from "../../composables/use-size";
|
|
6
|
+
import { derived } from "svelte/store";
|
|
5
7
|
export let value = true, side = "left", width = 300, breakpoint = 1023, showIfAbove = false, behavior = "default", bordered = false, elevated = false, overlay = false, persistent = false, noSwipeOpen = false, noSwipeClose = false, noSwipeBackdrop = false, userClasses = void 0, userStyles = void 0;
|
|
6
8
|
export { userClasses as class, userStyles as style };
|
|
7
9
|
$:
|
|
@@ -10,7 +12,7 @@ $:
|
|
|
10
12
|
belowBreakpoint = behavior === "mobile" === true || behavior !== "desktop" && /** TODO: Get Layout width */
|
|
11
13
|
1300 <= breakpoint;
|
|
12
14
|
$:
|
|
13
|
-
widthStyle = ctx
|
|
15
|
+
widthStyle = !$ctx && useSize(width).style;
|
|
14
16
|
$:
|
|
15
17
|
hideOnRouteChange = persistent !== true || overlay === true;
|
|
16
18
|
export const show = (e) => {
|
|
@@ -33,34 +35,27 @@ $:
|
|
|
33
35
|
hide();
|
|
34
36
|
}
|
|
35
37
|
let ctx = getContext("layout");
|
|
36
|
-
function prepareZIndexClass(context, overlayProp, sideProp) {
|
|
37
|
-
let drawer = sideProp === "left" ? context.drawerLeft : context.drawerRight;
|
|
38
|
-
let pos;
|
|
39
|
-
for (pos of ["top", "bottom"]) {
|
|
40
|
-
if (!drawer.offset[pos] && overlayProp) {
|
|
41
|
-
drawer.overlay = true;
|
|
42
|
-
return "above";
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
38
|
let drawerType;
|
|
47
39
|
$:
|
|
48
40
|
drawerType = side === "left" ? "drawerLeft" : "drawerRight";
|
|
49
41
|
$:
|
|
50
|
-
classes = createClasses(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
classes = createClasses(
|
|
43
|
+
[
|
|
44
|
+
side,
|
|
45
|
+
value && "active",
|
|
46
|
+
overlay && "overlay",
|
|
47
|
+
bordered && "bordered",
|
|
48
|
+
$ctx && $ctx[drawerType].offset.top && "offset-top",
|
|
49
|
+
$ctx && $ctx[drawerType].offset.bottom && "offset-bottom",
|
|
50
|
+
$ctx && $ctx[drawerType].fixed && "fixed",
|
|
51
|
+
$borderRadiusClasses,
|
|
52
|
+
$zIndexClass
|
|
53
|
+
],
|
|
54
|
+
{
|
|
55
|
+
component: "q-drawer",
|
|
56
|
+
userClasses
|
|
57
|
+
}
|
|
58
|
+
);
|
|
64
59
|
$:
|
|
65
60
|
style = createStyles(
|
|
66
61
|
{
|
|
@@ -68,18 +63,35 @@ $:
|
|
|
68
63
|
},
|
|
69
64
|
userStyles
|
|
70
65
|
);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
66
|
+
$:
|
|
67
|
+
borderRadiusClasses = ctx && // No border radius if this isn't a layout drawer
|
|
68
|
+
derived(ctx, (context) => {
|
|
69
|
+
const borderSide = side === "left" ? "right" : "left";
|
|
70
|
+
const shouldHaveRadius = (pos) => {
|
|
71
|
+
let appBarEl = pos === "top" ? context["header"] : context["footer"];
|
|
72
|
+
return overlay || !appBarEl?.display || context[drawerType].offset[pos];
|
|
73
|
+
};
|
|
74
|
+
return createClasses(
|
|
75
|
+
[
|
|
76
|
+
shouldHaveRadius("top") && `top-${borderSide}-radius`,
|
|
77
|
+
shouldHaveRadius("bottom") && `bottom-${borderSide}-radius`
|
|
78
|
+
],
|
|
79
|
+
{
|
|
80
|
+
component: "q-drawer"
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
$:
|
|
85
|
+
zIndexClass = ctx && derived(ctx, (context) => {
|
|
86
|
+
const drawer = side === "left" ? context.drawerLeft : context.drawerRight;
|
|
87
|
+
let pos;
|
|
88
|
+
for (pos of ["top", "bottom"]) {
|
|
89
|
+
if (!drawer.offset[pos] && overlay) {
|
|
90
|
+
drawer.overlay = true;
|
|
91
|
+
return "above";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
83
95
|
</script>
|
|
84
96
|
|
|
85
97
|
<div use:clickOutside={hide} class={classes} {style} {...$$restProps}>
|
|
@@ -6,48 +6,51 @@
|
|
|
6
6
|
bottom: 0;
|
|
7
7
|
left: auto;
|
|
8
8
|
height: 100%;
|
|
9
|
+
background-color: var(--surface);
|
|
10
|
+
color: var(--on-surface);
|
|
9
11
|
transition:
|
|
10
12
|
all var(--speed3),
|
|
11
13
|
background-color 0s;
|
|
12
14
|
overflow: auto;
|
|
13
15
|
padding: 8px;
|
|
14
16
|
|
|
15
|
-
&.fixed {
|
|
17
|
+
&.q-drawer--fixed {
|
|
16
18
|
position: fixed;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
&.left {
|
|
21
|
+
&.q-drawer--left {
|
|
20
22
|
left: 0px;
|
|
21
23
|
transform: translate(-100%);
|
|
22
24
|
width: var(--left-drawer-width);
|
|
23
|
-
&.bordered {
|
|
25
|
+
&.q-drawer--bordered {
|
|
24
26
|
border-right: 0.0625rem solid var(--outline);
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
&.right {
|
|
30
|
+
&.q-drawer--right {
|
|
29
31
|
right: 0px;
|
|
30
32
|
transform: translate(100%);
|
|
31
33
|
width: var(--right-drawer-width);
|
|
32
34
|
|
|
33
|
-
&.bordered {
|
|
35
|
+
&.q-drawer--bordered {
|
|
34
36
|
border-left: 0.0625rem solid var(--outline);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
&.active {
|
|
40
|
+
&.q-drawer--active {
|
|
39
41
|
transform: translate(0);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
&.offset {
|
|
44
|
+
&.q-drawer--offset {
|
|
43
45
|
&-top {
|
|
44
46
|
top: var(--header-height);
|
|
45
47
|
height: calc(100% - var(--header-height));
|
|
46
48
|
|
|
47
|
-
&.offset-bottom {
|
|
49
|
+
&.q-drawer--offset-bottom {
|
|
48
50
|
height: calc(100% - var(--header-height) - var(--footer-height));
|
|
49
51
|
}
|
|
50
52
|
}
|
|
53
|
+
|
|
51
54
|
&-bottom {
|
|
52
55
|
bottom: var(--footer-height);
|
|
53
56
|
height: calc(100% - var(--footer-height));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
1
|
+
import type { CssValue, NativeProps } from "../../utils/types";
|
|
2
2
|
export type QDrawerSideOptions = "left" | "right";
|
|
3
3
|
export type QDrawerBehaviorOptions = "default" | "desktop" | "mobile";
|
|
4
4
|
export interface QDrawerProps extends NativeProps {
|
|
@@ -16,7 +16,7 @@ export interface QDrawerProps extends NativeProps {
|
|
|
16
16
|
* The width of the drawer. Can be specified with a CSS unit. If no unit is specified, "px" will be used.
|
|
17
17
|
* @default 300
|
|
18
18
|
*/
|
|
19
|
-
width?: number |
|
|
19
|
+
width?: number | CssValue;
|
|
20
20
|
/**
|
|
21
21
|
* The breakpoint at which the drawer behavior changes. (not supported yet)
|
|
22
22
|
* @default 1023
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
|
-
import { createClasses } from "../../utils/props";
|
|
3
|
-
|
|
2
|
+
import { createClasses, createStyles } from "../../utils/props";
|
|
3
|
+
import { useSize } from "../../composables/use-size";
|
|
4
|
+
export let value = true, border = false, elevate = false, height = void 0, userClasses = void 0, userStyles = void 0;
|
|
4
5
|
export { userClasses as class, userStyles as style };
|
|
5
6
|
let ctx = getContext("layout");
|
|
6
7
|
$:
|
|
7
|
-
classes = createClasses(
|
|
8
|
+
classes = createClasses(
|
|
9
|
+
[border && "bordered", elevate && "elevated", $ctx?.footer?.fixed && "fixed"],
|
|
10
|
+
{
|
|
11
|
+
component: "q-footer",
|
|
12
|
+
userClasses
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
$:
|
|
16
|
+
style = createStyles(
|
|
17
|
+
{
|
|
18
|
+
height: !ctx && useSize(height).style
|
|
19
|
+
},
|
|
20
|
+
userStyles
|
|
21
|
+
);
|
|
8
22
|
</script>
|
|
9
23
|
|
|
10
|
-
<footer class={classes} style
|
|
24
|
+
<footer class={classes} {style}>
|
|
11
25
|
<nav>
|
|
12
26
|
<slot />
|
|
13
27
|
</nav>
|
|
@@ -3,8 +3,8 @@ import type { QFooterProps } from "./props";
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
value?: QFooterProps["value"];
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
border?: QFooterProps["border"];
|
|
7
|
+
elevate?: QFooterProps["elevate"];
|
|
8
8
|
height?: QFooterProps["height"];
|
|
9
9
|
class?: string | undefined;
|
|
10
10
|
style?: string | undefined;
|
|
@@ -2,4 +2,27 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: var(--footer-height);
|
|
4
4
|
transition: all var(--speed3);
|
|
5
|
+
background-color: var(--surface);
|
|
6
|
+
color: var(--on-surface);
|
|
7
|
+
padding: 0 1rem;
|
|
8
|
+
|
|
9
|
+
nav {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
gap: 1rem;
|
|
15
|
+
|
|
16
|
+
> * {
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--bordered {
|
|
22
|
+
border-top: solid 0.0625rem var(--outline);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--elevated {
|
|
26
|
+
@include elevate(1, "top");
|
|
27
|
+
}
|
|
5
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
1
|
+
import type { CssValue, NativeProps } from "../../utils/types";
|
|
2
2
|
export interface QFooterProps extends NativeProps {
|
|
3
3
|
/**
|
|
4
4
|
* The value indicating whether the footer is visible or hidden. (not supported yet)
|
|
@@ -9,15 +9,15 @@ export interface QFooterProps extends NativeProps {
|
|
|
9
9
|
* Determines whether the footer has a border around it. (not supported yet)
|
|
10
10
|
* @default false
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
border?: boolean;
|
|
13
13
|
/**
|
|
14
14
|
* Determines whether the footer has an elevated effect. (not supported yet)
|
|
15
15
|
* @default false
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
elevate?: boolean;
|
|
18
18
|
/**
|
|
19
19
|
* The height of the footer. Can be specified with a CSS unit. If not specified, "px" will be used. (not supported yet)
|
|
20
20
|
* @default undefined
|
|
21
21
|
*/
|
|
22
|
-
height?:
|
|
22
|
+
height?: number | CssValue;
|
|
23
23
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script>import { createClasses } from "../../utils/props";
|
|
2
|
+
import { getContext } from "svelte";
|
|
3
|
+
import QToolbar from "../toolbar/QToolbar.svelte";
|
|
4
|
+
export let inset = false, elevate = false, border = false, userClasses = void 0, userStyles = void 0;
|
|
5
|
+
export { userClasses as class, userStyles as style };
|
|
6
|
+
let ctx = getContext("layout");
|
|
7
|
+
$:
|
|
8
|
+
if ($ctx === void 0) {
|
|
9
|
+
console.warn("QHeader should be used inside QLayout");
|
|
10
|
+
}
|
|
11
|
+
$:
|
|
12
|
+
classes = createClasses([$ctx?.header?.fixed && "fixed"], {
|
|
13
|
+
component: "q-header",
|
|
14
|
+
userClasses
|
|
15
|
+
});
|
|
16
|
+
$:
|
|
17
|
+
if ($ctx?.header !== void 0) {
|
|
18
|
+
if (userStyles?.includes("display: none")) {
|
|
19
|
+
$ctx.header.display = false;
|
|
20
|
+
} else {
|
|
21
|
+
$ctx.header.display = true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<QToolbar {inset} {elevate} {border} class={classes} role="header" {...$$restProps}>
|
|
27
|
+
<slot />
|
|
28
|
+
</QToolbar>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { QHeaderProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
inset?: QHeaderProps["inset"];
|
|
7
|
+
elevate?: QHeaderProps["elevate"];
|
|
8
|
+
border?: QHeaderProps["border"];
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
style?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {
|
|
16
|
+
default: {};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type QHeaderProps_ = typeof __propDef.props;
|
|
20
|
+
export { QHeaderProps_ as QHeaderProps };
|
|
21
|
+
export type QHeaderEvents = typeof __propDef.events;
|
|
22
|
+
export type QHeaderSlots = typeof __propDef.slots;
|
|
23
|
+
export default class QHeader extends SvelteComponent<QHeaderProps, QHeaderEvents, QHeaderSlots> {
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NativeProps } from "../../utils/types";
|
|
2
|
+
export interface QHeaderProps extends NativeProps {
|
|
3
|
+
/**
|
|
4
|
+
* @default false
|
|
5
|
+
*/
|
|
6
|
+
inset?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
elevate?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
border?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|