@quaffui/quaff 0.1.0-prealpha → 0.1.0-prealpha10
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/QAvatar.svelte.d.ts +4 -4
- package/dist/components/avatar/docs.d.ts +1 -1
- package/dist/components/avatar/index.scss +4 -1
- package/dist/components/avatar/props.d.ts +2 -2
- package/dist/components/avatar/props.js +1 -1
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +4 -4
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +4 -4
- package/dist/components/breadcrumbs/docs.d.ts +1 -1
- package/dist/components/button/QBtn.svelte +23 -9
- package/dist/components/button/QBtn.svelte.d.ts +6 -5
- package/dist/components/button/docs.d.ts +1 -1
- package/dist/components/button/docs.props.js +8 -0
- package/dist/components/button/index.scss +23 -3
- package/dist/components/button/props.d.ts +7 -2
- package/dist/components/card/QCard.svelte +1 -1
- package/dist/components/card/QCard.svelte.d.ts +4 -4
- package/dist/components/card/QCardActions.svelte +1 -1
- package/dist/components/card/QCardActions.svelte.d.ts +4 -4
- package/dist/components/card/QCardSection.svelte +1 -1
- package/dist/components/card/QCardSection.svelte.d.ts +4 -4
- package/dist/components/card/docs.props.js +1 -1
- package/dist/components/card/index.scss +4 -1
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +4 -4
- package/dist/components/checkbox/index.scss +4 -0
- package/dist/components/chip/QChip.svelte +8 -2
- package/dist/components/chip/QChip.svelte.d.ts +4 -4
- package/dist/components/chip/docs.d.ts +1 -1
- package/dist/components/chip/docs.props.js +3 -3
- package/dist/components/chip/index.scss +4 -1
- package/dist/components/chip/props.d.ts +2 -2
- package/dist/components/codeBlock/QCodeBlock.svelte +8 -9
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +5 -7
- package/dist/components/dialog/QDialog.svelte +34 -20
- package/dist/components/dialog/QDialog.svelte.d.ts +4 -5
- package/dist/components/dialog/docs.d.ts +1 -1
- package/dist/components/dialog/docs.props.js +10 -2
- package/dist/components/dialog/index.scss +150 -3
- package/dist/components/drawer/QDrawer.svelte +50 -38
- package/dist/components/drawer/QDrawer.svelte.d.ts +5 -4
- package/dist/components/drawer/docs.d.ts +1 -1
- package/dist/components/drawer/index.scss +14 -9
- 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 +6 -6
- package/dist/components/footer/docs.d.ts +1 -1
- 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 +11 -13
- package/dist/components/icon/QIcon.svelte.d.ts +5 -5
- package/dist/components/icon/docs.d.ts +1 -1
- package/dist/components/icon/docs.props.js +1 -1
- package/dist/components/icon/index.scss +63 -6
- package/dist/components/icon/props.d.ts +3 -3
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +3 -1
- package/dist/components/input/QInput.svelte.d.ts +4 -4
- package/dist/components/input/docs.d.ts +1 -1
- package/dist/components/input/props.d.ts +1 -1
- package/dist/components/layout/QLayout.svelte.d.ts +4 -4
- package/dist/components/layout/docs.d.ts +1 -1
- package/dist/components/layout/index.scss +93 -76
- package/dist/components/list/QItem.svelte +1 -1
- package/dist/components/list/QItem.svelte.d.ts +4 -4
- package/dist/components/list/QItemSection.svelte.d.ts +4 -4
- package/dist/components/list/QList.svelte.d.ts +4 -4
- package/dist/components/list/docs.d.ts +2 -0
- package/dist/components/list/docs.js +11 -0
- package/dist/components/list/docs.props.js +1 -1
- package/dist/components/list/index.scss +7 -0
- package/dist/components/private/ContextReseter.svelte.d.ts +2 -2
- package/dist/components/private/QApi.svelte +25 -22
- package/dist/components/private/QApi.svelte.d.ts +2 -2
- package/dist/components/private/QDocs.svelte +38 -10
- package/dist/components/private/QDocs.svelte.d.ts +3 -3
- package/dist/components/private/QDocsSection.svelte +2 -2
- package/dist/components/private/QDocsSection.svelte.d.ts +2 -2
- package/dist/components/progress/QCircularProgress.svelte +4 -3
- package/dist/components/progress/QCircularProgress.svelte.d.ts +5 -5
- package/dist/components/progress/QLinearProgress.svelte +8 -2
- package/dist/components/progress/QLinearProgress.svelte.d.ts +4 -4
- package/dist/components/progress/docs.d.ts +2 -0
- package/dist/components/progress/docs.js +11 -0
- package/dist/components/progress/docs.props.d.ts +8 -0
- package/dist/components/progress/docs.props.js +42 -0
- package/dist/components/progress/index.scss +15 -0
- package/dist/components/progress/props.d.ts +26 -9
- package/dist/components/progress/props.js +1 -7
- package/dist/components/radio/QRadio.svelte.d.ts +4 -4
- package/dist/components/radio/docs.d.ts +1 -1
- package/dist/components/railbar/QRailbar.svelte +48 -29
- package/dist/components/railbar/QRailbar.svelte.d.ts +5 -5
- package/dist/components/railbar/docs.d.ts +2 -0
- package/dist/components/railbar/docs.js +11 -0
- 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/select/QSelect.svelte +6 -4
- package/dist/components/select/QSelect.svelte.d.ts +4 -4
- package/dist/components/select/docs.d.ts +1 -1
- package/dist/components/select/docs.props.js +2 -2
- package/dist/components/select/index.scss +8 -2
- package/dist/components/select/props.d.ts +1 -1
- package/dist/components/separator/QSeparator.svelte +1 -1
- package/dist/components/separator/QSeparator.svelte.d.ts +4 -4
- package/dist/components/separator/docs.d.ts +2 -0
- package/dist/components/separator/docs.js +11 -0
- package/dist/components/separator/props.d.ts +1 -1
- package/dist/components/table/QTable.svelte.d.ts +4 -4
- package/dist/components/table/docs.d.ts +1 -1
- package/dist/components/tabs/QTab.svelte +45 -17
- package/dist/components/tabs/QTab.svelte.d.ts +5 -7
- package/dist/components/tabs/QTabs.svelte +3 -7
- package/dist/components/tabs/QTabs.svelte.d.ts +4 -4
- package/dist/components/tabs/docs.d.ts +2 -0
- package/dist/components/tabs/docs.js +11 -0
- package/dist/components/tabs/docs.props.js +3 -11
- package/dist/components/tabs/index.scss +40 -9
- package/dist/components/toggle/QToggle.svelte.d.ts +4 -4
- package/dist/components/toggle/docs.d.ts +1 -1
- package/dist/components/toggle/props.d.ts +1 -1
- package/dist/components/toggle/props.js +1 -1
- package/dist/components/toolbar/QToolbar.svelte +6 -22
- package/dist/components/toolbar/QToolbar.svelte.d.ts +7 -5
- package/dist/components/toolbar/QToolbarTitle.svelte +10 -0
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +22 -0
- package/dist/components/toolbar/docs.d.ts +2 -0
- package/dist/components/toolbar/docs.js +11 -0
- package/dist/components/toolbar/docs.props.d.ts +8 -0
- package/dist/components/toolbar/docs.props.js +10 -0
- package/dist/components/toolbar/index.scss +35 -0
- package/dist/components/toolbar/props.d.ts +22 -3
- package/dist/components/toolbar/props.js +1 -6
- package/dist/components/tooltip/QTooltip.svelte +3 -5
- package/dist/components/tooltip/QTooltip.svelte.d.ts +4 -4
- package/dist/components/tooltip/docs.d.ts +2 -0
- package/dist/components/tooltip/docs.js +11 -0
- package/dist/components/tooltip/index.scss +77 -2
- package/dist/composables/use-align.js +17 -6
- package/dist/composables/use-router-link.js +0 -1
- package/dist/composables/use-size.d.ts +8 -10
- package/dist/composables/use-size.js +24 -12
- package/dist/css/flex.scss +41 -0
- package/dist/css/fonts.scss +4 -0
- package/dist/css/grid.scss +1 -16
- package/dist/css/index.css +1 -0
- package/dist/css/index.scss +5 -23
- package/dist/css/mixins/field.scss +3 -1
- package/dist/css/mixins/menu.scss +3 -1
- package/dist/css/mixins.scss +5 -4
- package/dist/css/ripple.scss +42 -0
- package/dist/css/states.scss +9 -4
- package/dist/css/theme/bridge.scss +15 -0
- package/dist/css/theme/elevate.scss +57 -0
- package/dist/css/theme/page.scss +16 -0
- package/dist/css/theme/palette.scss +633 -0
- package/dist/css/theme/reset.scss +40 -0
- package/dist/css/theme/theme.dark.scss +1 -0
- package/dist/css/theme/theme.light.scss +1 -0
- package/dist/css/theme/theme.scss +6 -0
- package/dist/css/theme/typography.scss +111 -0
- package/dist/css/variables-sass.scss +16 -0
- package/dist/global.d.ts +0 -1
- package/dist/helpers/ripple.d.ts +10 -0
- package/dist/helpers/ripple.js +79 -0
- package/dist/helpers/version.d.ts +2 -0
- package/dist/helpers/version.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/QTheme.d.ts +2 -1
- package/dist/stores/Quaff.d.ts +6 -5
- package/dist/stores/Quaff.js +2 -1
- 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/dist/utils/types.json +1 -1
- package/dist/utils/watchable.d.ts +1 -0
- package/package.json +34 -28
|
@@ -1,42 +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
|
-
classes = createClasses(
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]);
|
|
22
|
-
$:
|
|
23
|
-
value === true ? modal ? dialogElement?.showModal() : dialogElement?.show() : dialogElement?.close();
|
|
19
|
+
classes = createClasses(
|
|
20
|
+
[opened && "active", positionClass, modal && "modal", fullscreen && "max"],
|
|
21
|
+
{
|
|
22
|
+
component: "q-dialog",
|
|
23
|
+
userClasses
|
|
24
|
+
}
|
|
25
|
+
);
|
|
24
26
|
export function hide() {
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
+
if (dialogElement && dialogElement.open) {
|
|
28
|
+
dialogElement.close();
|
|
29
|
+
opened = false;
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
dialogElement.style.display = "none";
|
|
32
|
+
}, 250);
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
export function show() {
|
|
30
|
-
if (
|
|
31
|
-
|
|
36
|
+
if (dialogElement && !dialogElement.open) {
|
|
37
|
+
modal ? dialogElement.showModal() : dialogElement.show();
|
|
38
|
+
opened = true;
|
|
39
|
+
dialogElement.style.display = "block";
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
export function toggle(e) {
|
|
35
|
-
|
|
43
|
+
if (dialogElement) {
|
|
44
|
+
opened = !opened;
|
|
45
|
+
if (dialogElement.open) {
|
|
46
|
+
hide();
|
|
47
|
+
} else {
|
|
48
|
+
show();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
36
51
|
e.stopPropagation();
|
|
37
52
|
}
|
|
38
53
|
function addAnimation() {
|
|
39
|
-
if (persistent &&
|
|
54
|
+
if (persistent && opened) {
|
|
40
55
|
dialogElement?.classList.add("animating");
|
|
41
56
|
setTimeout(() => {
|
|
42
57
|
dialogElement?.classList.remove("animating");
|
|
@@ -71,7 +86,6 @@ function handleClickHide() {
|
|
|
71
86
|
<dialog
|
|
72
87
|
use:clickOutsideDialog={handleClickHide}
|
|
73
88
|
class={classes}
|
|
74
|
-
open={value}
|
|
75
89
|
{...$$restProps}
|
|
76
90
|
bind:this={dialogElement}
|
|
77
91
|
on:cancel={handleKeyboardHide}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { QDialogProps } from "./props";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
value?: boolean | undefined;
|
|
7
6
|
noBtn?: QDialogProps["noBtn"];
|
|
8
7
|
btnContent?: QDialogProps["btnContent"];
|
|
9
8
|
btnAttrs?: QDialogProps["btnAttrs"];
|
|
@@ -26,12 +25,12 @@ declare const __propDef: {
|
|
|
26
25
|
default: {};
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
type QDialogProps_ = typeof __propDef.props;
|
|
29
|
+
export { QDialogProps_ as QDialogProps };
|
|
30
30
|
export type QDialogEvents = typeof __propDef.events;
|
|
31
31
|
export type QDialogSlots = typeof __propDef.slots;
|
|
32
|
-
export default class QDialog extends
|
|
32
|
+
export default class QDialog extends SvelteComponent<QDialogProps, QDialogEvents, QDialogSlots> {
|
|
33
33
|
get hide(): any;
|
|
34
34
|
get show(): any;
|
|
35
35
|
get toggle(): any;
|
|
36
36
|
}
|
|
37
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { QComponentDocs } from "
|
|
1
|
+
import type { QComponentDocs } from "../../utils/types";
|
|
2
2
|
export declare let QDialogDocs: QComponentDocs;
|
|
@@ -55,6 +55,14 @@ export const QBtnDocsProps = [
|
|
|
55
55
|
description: "Use rectangle design for the button, removing the large border-radius.",
|
|
56
56
|
default: "false",
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
name: "round",
|
|
60
|
+
type: "boolean",
|
|
61
|
+
optional: true,
|
|
62
|
+
clickableType: false,
|
|
63
|
+
description: "Use round design for the button, giving it a circular shape.",
|
|
64
|
+
default: "false",
|
|
65
|
+
},
|
|
58
66
|
{
|
|
59
67
|
name: "to",
|
|
60
68
|
type: "string",
|
|
@@ -84,10 +92,10 @@ export const QDialogDocsProps = [
|
|
|
84
92
|
{
|
|
85
93
|
name: "value",
|
|
86
94
|
type: "boolean",
|
|
87
|
-
optional:
|
|
95
|
+
optional: false,
|
|
88
96
|
clickableType: false,
|
|
89
97
|
description: "The value indicating whether the dialog is visible or hidden.",
|
|
90
|
-
default: "
|
|
98
|
+
default: "true",
|
|
91
99
|
},
|
|
92
100
|
{
|
|
93
101
|
name: "noBtn",
|
|
@@ -1,10 +1,157 @@
|
|
|
1
|
-
|
|
1
|
+
.q-dialog {
|
|
2
|
+
display: block;
|
|
3
|
+
border: none;
|
|
4
|
+
opacity: 0;
|
|
5
|
+
visibility: hidden;
|
|
6
|
+
position: fixed;
|
|
7
|
+
box-shadow: var(--elevate2);
|
|
8
|
+
color: var(--on-surface);
|
|
9
|
+
background-color: var(--surface);
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
left: 50%;
|
|
13
|
+
top: 10%;
|
|
14
|
+
min-width: 20rem;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
max-height: 80%;
|
|
17
|
+
overflow-x: hidden;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
transition:
|
|
20
|
+
var(--speed3) all,
|
|
21
|
+
0s background-color;
|
|
22
|
+
transform: translate(-50%, -4rem);
|
|
2
23
|
animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
3
24
|
|
|
4
|
-
&:is(
|
|
25
|
+
&:is(&--active, [open]) {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
visibility: visible;
|
|
28
|
+
transform: translate(-50%, 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&::backdrop {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:not(&--left, &--right, &--top, &--bottom) {
|
|
36
|
+
border-radius: 0.75rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--small {
|
|
40
|
+
width: 25%;
|
|
41
|
+
height: 25%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&--medium {
|
|
45
|
+
width: 50%;
|
|
46
|
+
height: 50%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--large {
|
|
50
|
+
width: 75%;
|
|
51
|
+
height: 75%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:is(&--active, [open]) {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
visibility: visible;
|
|
57
|
+
transform: translate(-50%, 0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:is(&--active, [open]):is(&--left, &--right, &--top, &--bottom, &--max) {
|
|
61
|
+
transform: translate(0, 0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--top {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: auto;
|
|
69
|
+
bottom: auto;
|
|
70
|
+
height: auto;
|
|
71
|
+
width: 100%;
|
|
72
|
+
min-width: auto;
|
|
73
|
+
max-height: 100%;
|
|
74
|
+
transform: translateY(-100%);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&--left {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
top: 0;
|
|
80
|
+
left: 0;
|
|
81
|
+
right: auto;
|
|
82
|
+
bottom: auto;
|
|
83
|
+
width: auto;
|
|
84
|
+
height: 100%;
|
|
85
|
+
max-height: 100%;
|
|
86
|
+
transform: translateX(-100%);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--right {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: auto;
|
|
93
|
+
right: 0;
|
|
94
|
+
bottom: auto;
|
|
95
|
+
width: auto;
|
|
96
|
+
height: 100%;
|
|
97
|
+
max-height: 100%;
|
|
98
|
+
transform: translateX(100%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--bottom {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
top: auto;
|
|
104
|
+
left: 0;
|
|
105
|
+
right: auto;
|
|
106
|
+
bottom: 0;
|
|
107
|
+
height: auto;
|
|
108
|
+
width: 100%;
|
|
109
|
+
min-width: auto;
|
|
110
|
+
max-height: 100%;
|
|
111
|
+
transform: translateY(100%);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&--max {
|
|
115
|
+
top: 0;
|
|
116
|
+
left: 0;
|
|
117
|
+
right: auto;
|
|
118
|
+
bottom: auto;
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 100%;
|
|
121
|
+
max-width: 100%;
|
|
122
|
+
max-height: 100%;
|
|
123
|
+
transform: translateY(4rem);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&--small:is(&--left, &--right) {
|
|
127
|
+
width: 20rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&--medium:is(&--left, &--right) {
|
|
131
|
+
width: 32rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&--large:is(&--left, &--right) {
|
|
135
|
+
width: 44rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&--small:is(&--top, &--bottom) {
|
|
139
|
+
height: 16rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--medium:is(&--top, &--bottom) {
|
|
143
|
+
height: 24rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&--large:is(&--top, &--bottom) {
|
|
147
|
+
height: 32rem;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&:is(&--left, &--right, &--top, &--bottom) {
|
|
5
151
|
border-radius: 0;
|
|
6
152
|
}
|
|
7
|
-
|
|
153
|
+
|
|
154
|
+
&--modal::backdrop {
|
|
8
155
|
display: block;
|
|
9
156
|
background-color: rgba(0, 0, 0, 0.5);
|
|
10
157
|
}
|
|
@@ -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,20 +63,37 @@ $:
|
|
|
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
|
-
<div use:clickOutside={hide} class={classes} {style}>
|
|
97
|
+
<div use:clickOutside={hide} class={classes} {style} {...$$restProps}>
|
|
86
98
|
<slot />
|
|
87
99
|
</div>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { QDrawerProps } from "./props";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
+
[x: string]: any;
|
|
5
6
|
value?: QDrawerProps["value"];
|
|
6
7
|
side?: QDrawerProps["side"];
|
|
7
8
|
width?: QDrawerProps["width"];
|
|
@@ -28,12 +29,12 @@ declare const __propDef: {
|
|
|
28
29
|
default: {};
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
+
type QDrawerProps_ = typeof __propDef.props;
|
|
33
|
+
export { QDrawerProps_ as QDrawerProps };
|
|
32
34
|
export type QDrawerEvents = typeof __propDef.events;
|
|
33
35
|
export type QDrawerSlots = typeof __propDef.slots;
|
|
34
|
-
export default class QDrawer extends
|
|
36
|
+
export default class QDrawer extends SvelteComponent<QDrawerProps, QDrawerEvents, QDrawerSlots> {
|
|
35
37
|
get show(): any;
|
|
36
38
|
get hide(): any;
|
|
37
39
|
get toggle(): any;
|
|
38
40
|
}
|
|
39
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { QComponentDocs } from "
|
|
1
|
+
import type { QComponentDocs } from "../../utils/types";
|
|
2
2
|
export declare let QDrawerDocs: QComponentDocs;
|
|
@@ -6,46 +6,51 @@
|
|
|
6
6
|
bottom: 0;
|
|
7
7
|
left: auto;
|
|
8
8
|
height: 100%;
|
|
9
|
-
|
|
9
|
+
background-color: var(--surface);
|
|
10
|
+
color: var(--on-surface);
|
|
11
|
+
transition:
|
|
12
|
+
all var(--speed3),
|
|
13
|
+
background-color 0s;
|
|
10
14
|
overflow: auto;
|
|
11
15
|
padding: 8px;
|
|
12
16
|
|
|
13
|
-
&.fixed {
|
|
17
|
+
&.q-drawer--fixed {
|
|
14
18
|
position: fixed;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
&.left {
|
|
21
|
+
&.q-drawer--left {
|
|
18
22
|
left: 0px;
|
|
19
23
|
transform: translate(-100%);
|
|
20
24
|
width: var(--left-drawer-width);
|
|
21
|
-
&.bordered {
|
|
25
|
+
&.q-drawer--bordered {
|
|
22
26
|
border-right: 0.0625rem solid var(--outline);
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
&.right {
|
|
30
|
+
&.q-drawer--right {
|
|
27
31
|
right: 0px;
|
|
28
32
|
transform: translate(100%);
|
|
29
33
|
width: var(--right-drawer-width);
|
|
30
34
|
|
|
31
|
-
&.bordered {
|
|
35
|
+
&.q-drawer--bordered {
|
|
32
36
|
border-left: 0.0625rem solid var(--outline);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
&.active {
|
|
40
|
+
&.q-drawer--active {
|
|
37
41
|
transform: translate(0);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
&.offset {
|
|
44
|
+
&.q-drawer--offset {
|
|
41
45
|
&-top {
|
|
42
46
|
top: var(--header-height);
|
|
43
47
|
height: calc(100% - var(--header-height));
|
|
44
48
|
|
|
45
|
-
&.offset-bottom {
|
|
49
|
+
&.q-drawer--offset-bottom {
|
|
46
50
|
height: calc(100% - var(--header-height) - var(--footer-height));
|
|
47
51
|
}
|
|
48
52
|
}
|
|
53
|
+
|
|
49
54
|
&-bottom {
|
|
50
55
|
bottom: var(--footer-height);
|
|
51
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>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
2
|
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;
|
|
@@ -16,9 +16,9 @@ declare const __propDef: {
|
|
|
16
16
|
default: {};
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type QFooterProps_ = typeof __propDef.props;
|
|
20
|
+
export { QFooterProps_ as QFooterProps };
|
|
20
21
|
export type QFooterEvents = typeof __propDef.events;
|
|
21
22
|
export type QFooterSlots = typeof __propDef.slots;
|
|
22
|
-
export default class QFooter extends
|
|
23
|
+
export default class QFooter extends SvelteComponent<QFooterProps, QFooterEvents, QFooterSlots> {
|
|
23
24
|
}
|
|
24
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { QComponentDocs } from "
|
|
1
|
+
import type { QComponentDocs } from "../../utils/types";
|
|
2
2
|
export declare let QFooterDocs: QComponentDocs;
|
|
@@ -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>
|