@quaffui/quaff 0.1.0-prealpha7 → 0.1.0-prealpha8
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 +4 -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/drawer/QDrawer.svelte +2 -1
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.svelte +13 -3
- package/dist/components/footer/props.d.ts +2 -2
- package/dist/components/icon/QIcon.svelte +5 -12
- package/dist/components/icon/props.d.ts +2 -2
- 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 +2 -1
- package/dist/components/railbar/QRailbar.svelte.d.ts +1 -1
- package/dist/components/railbar/props.d.ts +11 -3
- package/dist/components/railbar/props.js +1 -7
- package/dist/components/toolbar/QToolbar.svelte +2 -1
- package/dist/components/toolbar/QToolbar.svelte.d.ts +1 -1
- package/dist/components/toolbar/props.d.ts +11 -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 +0 -1
- 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/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.
|
|
@@ -3,12 +3,15 @@ import { createEventDispatcher } from "svelte";
|
|
|
3
3
|
import QIcon from "../icon/QIcon.svelte";
|
|
4
4
|
import QCircularProgress from "../progress/QCircularProgress.svelte";
|
|
5
5
|
import { activationHandler } from "../../helpers/activationHandler";
|
|
6
|
+
import { useSize } from "../../composables/use-size";
|
|
6
7
|
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
8
|
export { userClasses as class };
|
|
8
9
|
const emit = createEventDispatcher();
|
|
9
10
|
let tag;
|
|
10
11
|
$:
|
|
11
12
|
tag = to !== void 0 ? "a" : "div";
|
|
13
|
+
$:
|
|
14
|
+
sizeObj = useSize(size);
|
|
12
15
|
$:
|
|
13
16
|
classes = createClasses(
|
|
14
17
|
[
|
|
@@ -17,7 +20,7 @@ $:
|
|
|
17
20
|
outline && "outlined",
|
|
18
21
|
flat && "flat",
|
|
19
22
|
(!$$slots.default && !label || round) && "round",
|
|
20
|
-
size
|
|
23
|
+
size !== "md" && sizeObj.class
|
|
21
24
|
],
|
|
22
25
|
{
|
|
23
26
|
component: "q-btn",
|
|
@@ -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.
|
|
@@ -2,6 +2,7 @@
|
|
|
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";
|
|
5
6
|
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
7
|
export { userClasses as class, userStyles as style };
|
|
7
8
|
$:
|
|
@@ -10,7 +11,7 @@ $:
|
|
|
10
11
|
belowBreakpoint = behavior === "mobile" === true || behavior !== "desktop" && /** TODO: Get Layout width */
|
|
11
12
|
1300 <= breakpoint;
|
|
12
13
|
$:
|
|
13
|
-
widthStyle = ctx
|
|
14
|
+
widthStyle = $ctx && useSize(width).style;
|
|
14
15
|
$:
|
|
15
16
|
hideOnRouteChange = persistent !== true || overlay === true;
|
|
16
17
|
export const show = (e) => {
|
|
@@ -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,23 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
|
-
import { createClasses } from "../../utils/props";
|
|
2
|
+
import { createClasses, createStyles } from "../../utils/props";
|
|
3
|
+
import { useSize } from "../../composables/use-size";
|
|
3
4
|
export let value = true, bordered = false, elevated = 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
|
-
|
|
8
|
+
heightStyle = $ctx && useSize(height).style;
|
|
9
|
+
$:
|
|
10
|
+
classes = createClasses(["q-footer", $ctx && $ctx.footer?.fixed && "fixed", userClasses]);
|
|
11
|
+
$:
|
|
12
|
+
style = createStyles(
|
|
13
|
+
{
|
|
14
|
+
"--footer-height": heightStyle
|
|
15
|
+
},
|
|
16
|
+
userStyles
|
|
17
|
+
);
|
|
8
18
|
</script>
|
|
9
19
|
|
|
10
|
-
<footer class={classes} style
|
|
20
|
+
<footer class={classes} {style}>
|
|
11
21
|
<nav>
|
|
12
22
|
<slot />
|
|
13
23
|
</nav>
|
|
@@ -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)
|
|
@@ -19,5 +19,5 @@ export interface QFooterProps extends NativeProps {
|
|
|
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
|
}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
<script>import { createClasses, createStyles } from "../../utils/props";
|
|
2
2
|
import { isNumber } from "../../utils/types";
|
|
3
3
|
import { sizes } from "../../composables/use-size";
|
|
4
|
+
import { useSize } from "../../composables/use-size";
|
|
4
5
|
export let size = "md", name = void 0, type = "outlined", filled = false, svg = void 0, img = void 0, imgAttributes = {}, color = void 0, userClasses = void 0, userStyles = void 0;
|
|
5
6
|
export { userClasses as class, userStyles as style };
|
|
6
|
-
let sizeStyle;
|
|
7
|
-
$: {
|
|
8
|
-
if (isNumber(size)) {
|
|
9
|
-
sizeStyle = `${size}px`;
|
|
10
|
-
} else if (typeof size === "string" && !sizes.includes(size)) {
|
|
11
|
-
sizeStyle = size;
|
|
12
|
-
} else {
|
|
13
|
-
sizeStyle = void 0;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
7
|
$:
|
|
17
|
-
|
|
8
|
+
sizeObj = useSize(size);
|
|
9
|
+
$:
|
|
10
|
+
classes = createClasses([type, filled && "filled", sizeObj.class], {
|
|
18
11
|
component: "q-icon",
|
|
19
12
|
userClasses,
|
|
20
13
|
quaffClasses: [color && `text-${color}`]
|
|
@@ -22,7 +15,7 @@ $:
|
|
|
22
15
|
$:
|
|
23
16
|
style = createStyles(
|
|
24
17
|
{
|
|
25
|
-
"--size":
|
|
18
|
+
"--size": sizeObj.style
|
|
26
19
|
},
|
|
27
20
|
userStyles
|
|
28
21
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
2
|
-
export type QIconSizeOptions =
|
|
1
|
+
import type { CssValue, NativeProps, QuaffSizes } from "../../utils/types";
|
|
2
|
+
export type QIconSizeOptions = QuaffSizes | CssValue | number;
|
|
3
3
|
export type QIconTypeOptions = "outlined" | "sharp" | "rounded";
|
|
4
4
|
export interface QIconProps extends NativeProps {
|
|
5
5
|
/**
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { useSize } from "../../composables/use-size";
|
|
2
|
+
import { createClasses } from "../../utils/props";
|
|
2
3
|
import { isNumber } from "../../utils/types";
|
|
3
4
|
export let value = 0, indeterminate = false, size = "2em", color = void 0, thickness = 5, userClasses = void 0;
|
|
4
5
|
export { userClasses as class };
|
|
5
6
|
$:
|
|
6
|
-
spinnerSize =
|
|
7
|
+
spinnerSize = useSize(size);
|
|
7
8
|
$:
|
|
8
9
|
classes = createClasses([indeterminate && "indeterminate"], {
|
|
9
10
|
component: "q-circular-progress",
|
|
@@ -12,7 +13,7 @@ $:
|
|
|
12
13
|
});
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
|
-
<svg class={classes} height={spinnerSize} width={spinnerSize} viewBox="25 25 50 50">
|
|
16
|
+
<svg class={classes} height={spinnerSize.style} width={spinnerSize.style} viewBox="25 25 50 50">
|
|
16
17
|
<circle
|
|
17
18
|
class="path"
|
|
18
19
|
cx="50"
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
value?: number | undefined;
|
|
6
6
|
indeterminate?: boolean | undefined;
|
|
7
|
-
size?:
|
|
7
|
+
size?: number | `${number}px` | `${number}%` | `${number}em` | `${number}ex` | `${number}ch` | `${number}rem` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | undefined;
|
|
8
8
|
color?: QCircularProgressProps["color"];
|
|
9
9
|
thickness?: number | undefined;
|
|
10
10
|
class?: string | undefined;
|
|
@@ -1,20 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NativeProps, CssValue } from "../../utils/types";
|
|
2
2
|
export interface QLinearProgressProps extends NativeProps {
|
|
3
|
+
/**
|
|
4
|
+
* @default 0
|
|
5
|
+
*/
|
|
3
6
|
value: number;
|
|
7
|
+
/**
|
|
8
|
+
* @default left
|
|
9
|
+
*/
|
|
4
10
|
from: "left" | "right";
|
|
11
|
+
/**
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
5
14
|
rounded: boolean;
|
|
6
15
|
}
|
|
7
16
|
export interface QCircularProgressProps extends NativeProps {
|
|
17
|
+
/**
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
8
20
|
value: number;
|
|
21
|
+
/**
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
9
24
|
indeterminate: boolean;
|
|
10
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @default 2em
|
|
27
|
+
*/
|
|
28
|
+
size: CssValue | number;
|
|
29
|
+
/**
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
11
32
|
color?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @default 5
|
|
35
|
+
*/
|
|
12
36
|
thickness: number;
|
|
13
37
|
}
|
|
14
|
-
export declare const QLinearProgressPropsDefaults: {
|
|
15
|
-
userClasses?: string | undefined;
|
|
16
|
-
userStyles?: string | undefined;
|
|
17
|
-
value: number;
|
|
18
|
-
from: string;
|
|
19
|
-
rounded: boolean;
|
|
20
|
-
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
2
|
import { createClasses, createStyles } from "../../utils/props";
|
|
3
3
|
import { isNumber } from "../../utils/types";
|
|
4
|
+
import { useSize } from "../../composables/use-size";
|
|
4
5
|
export let width = 88, side = "left", bordered = false, userClasses = void 0, userStyles = void 0;
|
|
5
6
|
export { userClasses as class, userStyles as style };
|
|
6
7
|
let ctx = getContext("layout");
|
|
@@ -21,7 +22,7 @@ $:
|
|
|
21
22
|
userClasses
|
|
22
23
|
]);
|
|
23
24
|
$:
|
|
24
|
-
widthStyle = ctx
|
|
25
|
+
widthStyle = $ctx && useSize(width).style;
|
|
25
26
|
$:
|
|
26
27
|
style = createStyles(
|
|
27
28
|
{
|
|
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import type { QRailbarProps } from "./props";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
width?:
|
|
5
|
+
width?: number | `${number}px` | `${number}%` | `${number}em` | `${number}ex` | `${number}ch` | `${number}rem` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | undefined;
|
|
6
6
|
side?: "left" | "right" | undefined;
|
|
7
7
|
bordered?: boolean | undefined;
|
|
8
8
|
class?: string | undefined;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NativeProps, CssValue } from "../../utils/types";
|
|
2
2
|
export interface QRailbarProps extends NativeProps {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @default 88px
|
|
5
|
+
*/
|
|
6
|
+
width: CssValue | number;
|
|
7
|
+
/**
|
|
8
|
+
* @default left
|
|
9
|
+
*/
|
|
4
10
|
side: "left" | "right";
|
|
11
|
+
/**
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
5
14
|
bordered: boolean;
|
|
6
15
|
}
|
|
7
|
-
export declare const QRailbarPropsDefaults: QRailbarProps;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import { createClasses, createStyles } from "../../utils/props";
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import { isNumber } from "../../utils/types";
|
|
4
|
+
import { useSize } from "../../composables/use-size";
|
|
4
5
|
export let inset = false, height = "64px", userClasses = void 0, userStyles = void 0;
|
|
5
6
|
export { userClasses as class, userStyles as style };
|
|
6
7
|
let ctx = getContext("layout");
|
|
@@ -14,7 +15,7 @@ $:
|
|
|
14
15
|
userClasses
|
|
15
16
|
]);
|
|
16
17
|
$:
|
|
17
|
-
heightStyle = ctx
|
|
18
|
+
heightStyle = $ctx && useSize(height).style;
|
|
18
19
|
$:
|
|
19
20
|
if ($ctx?.header !== void 0) {
|
|
20
21
|
if (userStyles?.includes("display: none")) {
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
inset?: boolean | undefined;
|
|
7
|
-
height?:
|
|
7
|
+
height?: number | `${number}px` | `${number}%` | `${number}em` | `${number}ex` | `${number}ch` | `${number}rem` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | undefined;
|
|
8
8
|
class?: string | undefined;
|
|
9
9
|
style?: string | undefined;
|
|
10
10
|
};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import type { NativeProps } from "../../utils/types";
|
|
1
|
+
import type { NativeProps, CssValue } from "../../utils/types";
|
|
2
2
|
export interface QToolbarProps extends NativeProps {
|
|
3
|
+
/**
|
|
4
|
+
* @default false
|
|
5
|
+
*/
|
|
3
6
|
inset: boolean;
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @default 64px
|
|
9
|
+
*/
|
|
10
|
+
height: CssValue | number;
|
|
5
11
|
}
|
|
6
|
-
export declare const QToolbarPropsDefaults: QToolbarProps;
|
|
7
12
|
export interface QToolbarTitleProps extends NativeProps {
|
|
13
|
+
/**
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
8
16
|
shrink: boolean;
|
|
9
17
|
}
|
|
10
|
-
export declare const QToolbarTitlePropsDefaults: QToolbarTitleProps;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export const QToolbarPropsDefaults = {
|
|
3
|
-
inset: false,
|
|
4
|
-
height: "64px",
|
|
5
|
-
...NativePropsDefaults,
|
|
6
|
-
};
|
|
7
|
-
export const QToolbarTitlePropsDefaults = {
|
|
8
|
-
shrink: false,
|
|
9
|
-
...NativePropsDefaults,
|
|
10
|
-
};
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const sizes:
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
size?: string;
|
|
1
|
+
import { CssUnit, QuaffSizes } from "../utils/types";
|
|
2
|
+
export declare const sizes: QuaffSizes[];
|
|
3
|
+
export declare const CssUnits: CssUnit[];
|
|
4
|
+
interface UseSize {
|
|
5
|
+
class?: string;
|
|
6
|
+
style?: string;
|
|
8
7
|
}
|
|
9
|
-
export
|
|
8
|
+
export declare function useSize(sizeProp: any): UseSize;
|
|
9
|
+
export {};
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
+
import { isNumber } from "../utils/types";
|
|
1
2
|
export const sizes = ["xs", "sm", "md", "lg", "xl"];
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
export const CssUnits = ["px", "%", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax"];
|
|
4
|
+
export function useSize(sizeProp) {
|
|
5
|
+
if (isNumber(sizeProp) && sizeProp > 0) {
|
|
6
|
+
return {
|
|
7
|
+
style: `${sizeProp}px`,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
else if (typeof sizeProp === "string") {
|
|
11
|
+
for (let unit of CssUnits) {
|
|
12
|
+
if (sizeProp.slice(-unit.length) === unit) {
|
|
13
|
+
return {
|
|
14
|
+
style: sizeProp,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
else if (sizes.includes(sizeProp)) {
|
|
18
|
+
return {
|
|
19
|
+
class: sizeProp,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {};
|
|
15
25
|
}
|