@quaffui/quaff 0.1.0-prealpha16 → 0.1.0-prealpha19
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/README.md +6 -6
- package/dist/classes/QContext.svelte.d.ts +42 -0
- package/dist/classes/QContext.svelte.js +63 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
- package/dist/classes/QScrollObserver.svelte.js +95 -0
- package/dist/classes/QTheme.svelte.d.ts +11 -0
- package/dist/classes/QTheme.svelte.js +49 -0
- package/dist/classes/Quaff.svelte.d.ts +14 -0
- package/dist/classes/Quaff.svelte.js +35 -0
- package/dist/components/avatar/QAvatar.scss +97 -0
- package/dist/components/avatar/QAvatar.svelte +35 -60
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
- package/dist/components/avatar/docs.props.js +21 -5
- package/dist/components/avatar/index.scss +5 -3
- package/dist/components/avatar/props.d.ts +24 -7
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -9
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +64 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.props.js +27 -27
- package/dist/components/breadcrumbs/props.d.ts +25 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +88 -48
- package/dist/components/button/QBtn.svelte.d.ts +2 -33
- package/dist/components/button/docs.props.js +26 -18
- package/dist/components/button/props.d.ts +21 -15
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +25 -16
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +11 -8
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +8 -6
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.props.js +6 -14
- package/dist/components/card/props.d.ts +9 -15
- package/dist/components/checkbox/QCheckbox.svelte +8 -3
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.props.js +1 -1
- package/dist/components/checkbox/index.scss +3 -1
- package/dist/components/checkbox/props.d.ts +1 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +95 -70
- package/dist/components/chip/QChip.svelte.d.ts +2 -35
- package/dist/components/chip/docs.props.js +23 -47
- package/dist/components/chip/props.d.ts +21 -34
- package/dist/components/codeBlock/QCodeBlock.svelte +64 -42
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -20
- package/dist/components/codeBlock/docs.props.js +10 -2
- package/dist/components/codeBlock/props.d.ts +6 -1
- package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
- package/dist/components/dialog/QDialog.svelte +72 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.props.d.ts +0 -8
- package/dist/components/dialog/docs.props.js +1 -131
- package/dist/components/dialog/props.d.ts +0 -16
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +87 -91
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -32
- package/dist/components/drawer/docs.props.js +3 -3
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +62 -23
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.props.js +14 -6
- package/dist/components/footer/props.d.ts +8 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +52 -24
- package/dist/components/header/QHeader.svelte.d.ts +2 -23
- package/dist/components/header/docs.props.js +23 -7
- package/dist/components/header/props.d.ts +11 -3
- package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
- package/dist/components/icon/QIcon.svelte +29 -16
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.props.js +3 -3
- package/dist/components/icon/props.d.ts +4 -4
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/input/QInput.svelte +52 -25
- package/dist/components/input/QInput.svelte.d.ts +2 -32
- package/dist/components/input/docs.props.js +33 -1
- package/dist/components/input/props.d.ts +5 -12
- package/dist/components/input/props.js +1 -12
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +100 -80
- package/dist/components/layout/QLayout.svelte.d.ts +16 -43
- package/dist/components/layout/docs.props.js +57 -1
- package/dist/components/layout/props.d.ts +8 -0
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +65 -46
- package/dist/components/list/QItem.svelte.d.ts +2 -30
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +48 -33
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +25 -14
- package/dist/components/list/QList.svelte.d.ts +2 -28
- package/dist/components/list/docs.props.js +36 -4
- package/dist/components/list/props.d.ts +9 -8
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +6 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
- package/dist/components/private/QApi.svelte +117 -103
- package/dist/components/private/QApi.svelte.d.ts +4 -16
- package/dist/components/private/QDocs.svelte +67 -48
- package/dist/components/private/QDocs.svelte.d.ts +9 -20
- package/dist/components/private/QDocsSection.svelte +15 -14
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -19
- package/dist/components/private/QIconSnippet.svelte +12 -0
- package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
- package/dist/components/progress/QCircularProgress.scss +63 -0
- package/dist/components/progress/QCircularProgress.svelte +104 -28
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +55 -13
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
- package/dist/components/progress/docs.props.js +138 -10
- package/dist/components/progress/props.d.ts +75 -12
- package/dist/components/radio/QRadio.svelte +14 -3
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.props.js +1 -1
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +1 -3
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +43 -66
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.props.js +4 -4
- package/dist/components/railbar/props.d.ts +3 -3
- package/dist/components/select/QSelect.svelte +121 -88
- package/dist/components/select/QSelect.svelte.d.ts +2 -34
- package/dist/components/select/docs.js +7 -0
- package/dist/components/select/docs.props.js +41 -1
- package/dist/components/select/index.scss +8 -6
- package/dist/components/select/props.d.ts +6 -12
- package/dist/components/select/props.js +1 -12
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +38 -45
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.props.js +4 -4
- package/dist/components/separator/props.d.ts +5 -7
- package/dist/components/separator/props.js +1 -9
- package/dist/components/switch/QSwitch.scss +305 -0
- package/dist/components/switch/QSwitch.svelte +96 -0
- package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
- package/dist/components/{toggle → switch}/docs.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.props.js +30 -6
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -85
- package/dist/components/table/QTable.svelte.d.ts +3 -29
- package/dist/components/table/docs.props.js +9 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +10 -0
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +74 -90
- package/dist/components/tabs/QTab.svelte.d.ts +2 -25
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +110 -58
- package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
- package/dist/components/tabs/docs.props.js +3 -3
- package/dist/components/tabs/index.scss +4 -2
- package/dist/components/tabs/props.d.ts +5 -4
- package/dist/components/toolbar/QToolbar.svelte +15 -12
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
- package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
- package/dist/components/toolbar/docs.props.js +4 -4
- package/dist/components/toolbar/index.scss +12 -14
- package/dist/components/toolbar/props.d.ts +4 -5
- package/dist/components/tooltip/QTooltip.svelte +5 -9
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.props.js +1 -1
- package/dist/components/tooltip/index.scss +3 -1
- package/dist/components/tooltip/props.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/composables/useSize.d.ts +10 -9
- package/dist/composables/useSize.js +32 -20
- package/dist/composables/useSizeLegacy.d.ts +9 -0
- package/dist/composables/useSizeLegacy.js +25 -0
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/{ripple.scss → _ripple.scss} +1 -1
- package/dist/css/_variables.scss +73 -0
- package/dist/css/classes/_design.scss +57 -0
- package/dist/css/classes/_flex.scss +62 -0
- package/dist/css/classes/_grid.scss +35 -0
- package/dist/css/classes/_index.scss +7 -0
- package/dist/css/classes/_overflow.scss +7 -0
- package/dist/css/classes/_position.scss +7 -0
- package/dist/css/classes/_select.scss +6 -0
- package/dist/css/classes/_spaces.scss +23 -0
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +15 -94
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
- package/dist/css/mixins/_image.scss +63 -0
- package/dist/css/mixins/_index.scss +9 -0
- package/dist/css/mixins/_layout.scss +20 -0
- package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
- package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
- package/dist/css/mixins/_spaces.scss +36 -0
- package/dist/css/mixins/_typography.scss +7 -0
- package/dist/css/shared/q-field.scss +62 -32
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/page.scss +3 -3
- package/dist/css/theme/reset.scss +17 -1
- package/dist/css/theme/theme.scss +2 -3
- package/dist/css/theme/tokens.scss +0 -159
- package/dist/helpers/clickOutside.js +2 -1
- package/dist/helpers/ripple.d.ts +1 -1
- package/dist/helpers/ripple.js +13 -4
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.js +1 -2
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +101 -14
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +6 -0
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.js +3 -1
- package/dist/utils/router.d.ts +17 -0
- package/dist/utils/router.js +23 -0
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +3 -0
- package/dist/utils/types.d.ts +6 -1
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +8 -5
- package/dist/utils/watchable.d.ts +0 -1
- package/package.json +40 -37
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -103
- package/dist/components/card/index.scss +0 -56
- package/dist/components/chip/index.scss +0 -103
- package/dist/components/drawer/index.scss +0 -59
- package/dist/components/footer/index.scss +0 -28
- package/dist/components/layout/index.scss +0 -387
- package/dist/components/list/index.scss +0 -144
- package/dist/components/progress/index.scss +0 -82
- package/dist/components/railbar/index.scss +0 -39
- package/dist/components/separator/index.scss +0 -52
- package/dist/components/toggle/QToggle.svelte +0 -34
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/index.scss +0 -31
- package/dist/components/toggle/props.d.ts +0 -9
- package/dist/components/toggle/props.js +0 -9
- package/dist/css/grid.scss +0 -50
- package/dist/css/mixins.scss +0 -137
- package/dist/css/states.scss +0 -75
- package/dist/css/theme/bridge.scss +0 -15
- package/dist/css/theme/theme.dark.scss +0 -39
- package/dist/css/theme/theme.light.scss +0 -39
- package/dist/css/variables-sass.scss +0 -16
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -59
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -58
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
|
@@ -1,111 +1,5 @@
|
|
|
1
1
|
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
-
// @quaffHash
|
|
3
|
-
export const QBtnDocsProps = [
|
|
4
|
-
{
|
|
5
|
-
name: "disable",
|
|
6
|
-
type: "boolean",
|
|
7
|
-
optional: true,
|
|
8
|
-
clickableType: false,
|
|
9
|
-
description: "Puts the button in a disabled state, making it unclickable.",
|
|
10
|
-
default: "false",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: "flat",
|
|
14
|
-
type: "boolean",
|
|
15
|
-
optional: true,
|
|
16
|
-
clickableType: false,
|
|
17
|
-
description: "Use flat design for the button, removing its elevation and background-color.",
|
|
18
|
-
default: "false",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "icon",
|
|
22
|
-
type: "string",
|
|
23
|
-
optional: true,
|
|
24
|
-
clickableType: false,
|
|
25
|
-
description: "Name of the leading icon to use for the button.",
|
|
26
|
-
default: "undefined",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "label",
|
|
30
|
-
type: "string",
|
|
31
|
-
optional: true,
|
|
32
|
-
clickableType: false,
|
|
33
|
-
description: "Text to use for the button.",
|
|
34
|
-
default: "undefined",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "loading",
|
|
38
|
-
type: "boolean",
|
|
39
|
-
optional: true,
|
|
40
|
-
clickableType: false,
|
|
41
|
-
description: "Puts the button in a loading state, adding a loader as the leading icon.",
|
|
42
|
-
default: "false",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: "outline",
|
|
46
|
-
type: "boolean",
|
|
47
|
-
optional: true,
|
|
48
|
-
clickableType: false,
|
|
49
|
-
description: "Use outline design for the button, adding a border around it.",
|
|
50
|
-
default: "false",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "rectangle",
|
|
54
|
-
type: "boolean",
|
|
55
|
-
optional: true,
|
|
56
|
-
clickableType: false,
|
|
57
|
-
description: "Use rectangle design for the button, removing the large border-radius.",
|
|
58
|
-
default: "false",
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "noRipple",
|
|
62
|
-
type: "boolean",
|
|
63
|
-
optional: true,
|
|
64
|
-
clickableType: false,
|
|
65
|
-
description: "Disable the ripple effect for the button.",
|
|
66
|
-
default: "false",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "round",
|
|
70
|
-
type: "boolean",
|
|
71
|
-
optional: true,
|
|
72
|
-
clickableType: false,
|
|
73
|
-
description: "Use round design for the button, giving it a circular shape.",
|
|
74
|
-
default: "false",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "to",
|
|
78
|
-
type: "string",
|
|
79
|
-
optional: true,
|
|
80
|
-
clickableType: false,
|
|
81
|
-
description: 'Makes the button navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id").',
|
|
82
|
-
default: "undefined",
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "unelevated",
|
|
86
|
-
type: "boolean",
|
|
87
|
-
optional: true,
|
|
88
|
-
clickableType: false,
|
|
89
|
-
description: "Removes the button's elevation.",
|
|
90
|
-
default: "false",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "size",
|
|
94
|
-
type: "QBtnSizeOptions",
|
|
95
|
-
optional: true,
|
|
96
|
-
clickableType: true,
|
|
97
|
-
description: "Size of the button.",
|
|
98
|
-
default: "md",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "target",
|
|
102
|
-
type: 'HTMLAnchorAttributes["target"]',
|
|
103
|
-
optional: true,
|
|
104
|
-
clickableType: true,
|
|
105
|
-
description: 'For "a" (anchor) tag only, apply the target attribute.',
|
|
106
|
-
default: "undefined",
|
|
107
|
-
},
|
|
108
|
-
];
|
|
2
|
+
// @quaffHash a93df4aad7eee70fe7022c2eb26b6ef5
|
|
109
3
|
export const QDialogDocsProps = [
|
|
110
4
|
{
|
|
111
5
|
name: "value",
|
|
@@ -115,30 +9,6 @@ export const QDialogDocsProps = [
|
|
|
115
9
|
description: "The value indicating whether the dialog is visible or hidden.",
|
|
116
10
|
default: "true",
|
|
117
11
|
},
|
|
118
|
-
{
|
|
119
|
-
name: "button",
|
|
120
|
-
type: "boolean",
|
|
121
|
-
optional: true,
|
|
122
|
-
clickableType: false,
|
|
123
|
-
description: "Wether the dialog should have a trigger button or not.",
|
|
124
|
-
default: "false",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: "buttonLabel",
|
|
128
|
-
type: "string",
|
|
129
|
-
optional: true,
|
|
130
|
-
clickableType: false,
|
|
131
|
-
description: 'The label of the trigger button. Requires "button" to be set.',
|
|
132
|
-
default: "undefined",
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "buttonProps",
|
|
136
|
-
type: "QBtnProps",
|
|
137
|
-
optional: true,
|
|
138
|
-
clickableType: false,
|
|
139
|
-
description: "Additional attributes for the dialog button.",
|
|
140
|
-
default: "{}",
|
|
141
|
-
},
|
|
142
12
|
{
|
|
143
13
|
name: "position",
|
|
144
14
|
type: "QDialogPositionOptions",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { NativeProps } from "../../utils";
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
import type { QBtnProps } from "../button/props";
|
|
4
3
|
export type QDialogPositionOptions = "default" | "top" | "right" | "bottom" | "left";
|
|
5
4
|
export interface QDialogProps extends NativeProps, HTMLAttributes<HTMLDialogElement> {
|
|
6
5
|
/**
|
|
@@ -8,21 +7,6 @@ export interface QDialogProps extends NativeProps, HTMLAttributes<HTMLDialogElem
|
|
|
8
7
|
* @default true
|
|
9
8
|
*/
|
|
10
9
|
value: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Wether the dialog should have a trigger button or not.
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
button?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The label of the trigger button. Requires "button" to be set.
|
|
18
|
-
* @default undefined
|
|
19
|
-
*/
|
|
20
|
-
buttonLabel?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Additional attributes for the dialog button.
|
|
23
|
-
* @default {}
|
|
24
|
-
*/
|
|
25
|
-
buttonProps?: QBtnProps;
|
|
26
10
|
/**
|
|
27
11
|
* The position of the dialog relative to the viewport.
|
|
28
12
|
* @default "default"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
@use "$css/variables";
|
|
3
|
+
|
|
4
|
+
.q-drawer {
|
|
5
|
+
z-index: 4;
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
right: auto;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
left: auto;
|
|
11
|
+
|
|
12
|
+
height: auto;
|
|
13
|
+
@include mixins.padding("a-sm");
|
|
14
|
+
|
|
15
|
+
background-color: var(--surface);
|
|
16
|
+
color: var(--on-surface);
|
|
17
|
+
|
|
18
|
+
overflow: auto;
|
|
19
|
+
|
|
20
|
+
transition:
|
|
21
|
+
border-radius variables.$speed3,
|
|
22
|
+
transform variables.$speed3,
|
|
23
|
+
top variables.$speed3,
|
|
24
|
+
bottom variables.$speed3;
|
|
25
|
+
|
|
26
|
+
&.q-drawer--overlay {
|
|
27
|
+
z-index: 6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@each $side in ("left", "right") {
|
|
31
|
+
&.q-drawer--#{$side} {
|
|
32
|
+
#{$side}: 0;
|
|
33
|
+
width: var(--#{$side}-drawer-width);
|
|
34
|
+
transform: translate(if($side == "left", -100%, 100%));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(.q-drawer--#{$side}).q-drawer--bordered {
|
|
38
|
+
@include mixins.border(var(--outline), $side);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.q-drawer--active {
|
|
43
|
+
transform: translate(0);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,101 +1,97 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
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
|
-
if ($navigating && hideOnRouteChange) {
|
|
32
|
-
hide();
|
|
33
|
-
}
|
|
34
|
-
let ctx = getContext("layout");
|
|
35
|
-
let drawerType;
|
|
36
|
-
$:
|
|
37
|
-
drawerType = side === "left" ? "drawerLeft" : "drawerRight";
|
|
38
|
-
$:
|
|
39
|
-
classes = createClasses(
|
|
40
|
-
[
|
|
41
|
-
side,
|
|
42
|
-
value && "active",
|
|
43
|
-
overlay && "overlay",
|
|
44
|
-
bordered && "bordered",
|
|
45
|
-
$ctx && $ctx[drawerType].offset.top && "offset-top",
|
|
46
|
-
$ctx && $ctx[drawerType].offset.bottom && "offset-bottom",
|
|
47
|
-
$ctx && $ctx[drawerType].fixed && "fixed",
|
|
48
|
-
$borderRadiusClasses,
|
|
49
|
-
$zIndexClass
|
|
50
|
-
],
|
|
51
|
-
{
|
|
52
|
-
component: "q-drawer",
|
|
53
|
-
userClasses
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
$:
|
|
57
|
-
style = createStyles(
|
|
58
|
-
{
|
|
59
|
-
[side === "left" ? "--leftDrawerWidth" : "--rightDrawerWidth"]: widthStyle
|
|
60
|
-
},
|
|
61
|
-
userStyles
|
|
62
|
-
);
|
|
63
|
-
$:
|
|
64
|
-
borderRadiusClasses = ctx && // No border radius if this isn't a layout drawer
|
|
65
|
-
derived(ctx, (context) => {
|
|
66
|
-
const borderSide = side === "left" ? "right" : "left";
|
|
67
|
-
const shouldHaveRadius = (pos) => {
|
|
68
|
-
let appBarEl = pos === "top" ? context["header"] : context["footer"];
|
|
69
|
-
return overlay || !appBarEl?.display || context[drawerType].offset[pos];
|
|
70
|
-
};
|
|
71
|
-
return createClasses(
|
|
72
|
-
[
|
|
73
|
-
shouldHaveRadius("top") && `top-${borderSide}-radius`,
|
|
74
|
-
shouldHaveRadius("bottom") && `bottom-${borderSide}-radius`
|
|
75
|
-
],
|
|
76
|
-
{
|
|
77
|
-
component: "q-drawer"
|
|
78
|
-
}
|
|
79
|
-
);
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext, onDestroy, untrack } from "svelte";
|
|
3
|
+
import { navigating } from "$app/stores";
|
|
4
|
+
import { useSize } from "../../composables";
|
|
5
|
+
import { clickOutside } from "../../helpers";
|
|
6
|
+
import QContext from "../../classes/QContext.svelte";
|
|
7
|
+
let {
|
|
8
|
+
value = $bindable(false),
|
|
9
|
+
side = "left",
|
|
10
|
+
width = 300,
|
|
11
|
+
bordered = false,
|
|
12
|
+
overlay = false,
|
|
13
|
+
persistent = false,
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
} = $props();
|
|
17
|
+
const drawerContext = QContext.get(`QDrawer-${side}`);
|
|
18
|
+
const layoutView = getContext("view");
|
|
19
|
+
const ctx = QContext.get("layout");
|
|
20
|
+
const drawerType = $derived(side === "left" ? "drawerLeft" : "drawerRight");
|
|
21
|
+
const drawerCtx = $derived(ctx?.value?.[drawerType]);
|
|
22
|
+
const canHideOnClickOutside = $derived((value && !persistent) || overlay);
|
|
23
|
+
const hideOnRouteChange = $derived(!persistent || overlay);
|
|
24
|
+
const offsetTop = $derived.by(() => {
|
|
25
|
+
const charPos = side === "left" ? 0 : 2;
|
|
26
|
+
return layoutView?.value.charAt(charPos) === "h";
|
|
27
|
+
});
|
|
28
|
+
const offsetBottom = $derived.by(() => {
|
|
29
|
+
const charPos = side === "left" ? 8 : 10;
|
|
30
|
+
return layoutView?.value.charAt(charPos) === "f";
|
|
80
31
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
32
|
+
export const show = (e) => {
|
|
33
|
+
if (!value) {
|
|
34
|
+
value = true;
|
|
35
|
+
e?.stopPropagation();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export const hide = () => {
|
|
39
|
+
if (value) {
|
|
40
|
+
value = false;
|
|
90
41
|
}
|
|
42
|
+
};
|
|
43
|
+
export const toggle = (e) => {
|
|
44
|
+
value = !value;
|
|
45
|
+
e?.stopPropagation();
|
|
46
|
+
};
|
|
47
|
+
$effect(() => {
|
|
48
|
+
if ($navigating && hideOnRouteChange) {
|
|
49
|
+
hide();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
onDestroy(() => {
|
|
53
|
+
drawerContext?.updateEntries({
|
|
54
|
+
width: 0,
|
|
55
|
+
takesSpace: false,
|
|
56
|
+
});
|
|
91
57
|
});
|
|
58
|
+
$effect(() => {
|
|
59
|
+
[value, overlay, width];
|
|
60
|
+
untrack(() =>
|
|
61
|
+
drawerContext?.updateEntries({
|
|
62
|
+
takesSpace: !!value && !overlay,
|
|
63
|
+
width,
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
const shouldHaveRadius = (pos) => {
|
|
68
|
+
const appBarEl = pos === "top" ? ctx?.value?.header : ctx?.value?.footer;
|
|
69
|
+
return overlay || !appBarEl?.display || drawerCtx?.offset[pos];
|
|
70
|
+
};
|
|
71
|
+
const widthStyle = $derived(!ctx ? useSize(width).style : null);
|
|
72
|
+
const drawerWidthStyle = $derived(
|
|
73
|
+
widthStyle === null ? "" : `--${side}-drawer-width: ${widthStyle};`,
|
|
74
|
+
);
|
|
75
|
+
const style = $derived(`${drawerWidthStyle}${props.style ?? ""}`);
|
|
92
76
|
</script>
|
|
93
77
|
|
|
94
78
|
<div
|
|
79
|
+
{...props}
|
|
95
80
|
use:clickOutside={() => canHideOnClickOutside && hide()}
|
|
96
|
-
class={
|
|
81
|
+
class="q-drawer{props.class ? ` ${props.class}` : ''} q-drawer--{side}"
|
|
82
|
+
class:q-drawer--active={value}
|
|
83
|
+
class:q-drawer--overlay={overlay}
|
|
84
|
+
class:q-drawer--bordered={bordered}
|
|
85
|
+
class:q-drawer--offset-top={offsetTop}
|
|
86
|
+
class:q-drawer--offset-bottom={offsetBottom}
|
|
87
|
+
class:q-drawer--fixed={drawerCtx?.fixed}
|
|
88
|
+
class:q-drawer--top-left-radius={side === "right" && shouldHaveRadius("top")}
|
|
89
|
+
class:q-drawer--bottom-left-radius={side === "right" &&
|
|
90
|
+
shouldHaveRadius("bottom")}
|
|
91
|
+
class:q-drawer--top-right-radius={side === "left" && shouldHaveRadius("top")}
|
|
92
|
+
class:q-drawer--bottom-right-radius={side === "left" &&
|
|
93
|
+
shouldHaveRadius("bottom")}
|
|
97
94
|
{style}
|
|
98
|
-
{...$$restProps}
|
|
99
95
|
>
|
|
100
|
-
|
|
96
|
+
{@render children?.()}
|
|
101
97
|
</div>
|
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QDrawerProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
bordered?: QDrawerProps["bordered"];
|
|
10
|
-
overlay?: QDrawerProps["overlay"];
|
|
11
|
-
persistent?: QDrawerProps["persistent"];
|
|
12
|
-
class?: string | null | undefined;
|
|
13
|
-
style?: string | null | undefined;
|
|
14
|
-
show?: ((e?: MouseEvent) => void) | undefined;
|
|
15
|
-
hide?: (() => void) | undefined;
|
|
16
|
-
toggle?: ((e?: MouseEvent) => void) | undefined;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {
|
|
22
|
-
default: {};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
type QDrawerProps_ = typeof __propDef.props;
|
|
26
|
-
export { QDrawerProps_ as QDrawerProps };
|
|
27
|
-
export type QDrawerEvents = typeof __propDef.events;
|
|
28
|
-
export type QDrawerSlots = typeof __propDef.slots;
|
|
29
|
-
export default class QDrawer extends SvelteComponent<QDrawerProps, QDrawerEvents, QDrawerSlots> {
|
|
30
|
-
get show(): any;
|
|
31
|
-
get hide(): any;
|
|
32
|
-
get toggle(): any;
|
|
33
|
-
}
|
|
2
|
+
declare const QDrawer: import("svelte").Component<QDrawerProps, {
|
|
3
|
+
show: (e?: MouseEvent) => void;
|
|
4
|
+
hide: () => void;
|
|
5
|
+
toggle: (e?: MouseEvent) => void;
|
|
6
|
+
}, "value">;
|
|
7
|
+
export default QDrawer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
-
// @quaffHash
|
|
2
|
+
// @quaffHash f39265baa2de427fc47e65c2f0088cb9
|
|
3
3
|
export const QDrawerDocsProps = [
|
|
4
4
|
{
|
|
5
5
|
name: "value",
|
|
@@ -19,9 +19,9 @@ export const QDrawerDocsProps = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: "width",
|
|
22
|
-
type: "number
|
|
22
|
+
type: "number",
|
|
23
23
|
optional: true,
|
|
24
|
-
clickableType:
|
|
24
|
+
clickableType: false,
|
|
25
25
|
description: 'The width of the drawer. Can be specified with a CSS unit. If no unit is specified, "px" will be used.',
|
|
26
26
|
default: "300",
|
|
27
27
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NativeProps } from "../../utils";
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
export type QDrawerSideOptions = "left" | "right";
|
|
4
4
|
export type QDrawerBehaviorOptions = "default" | "desktop" | "mobile";
|
|
@@ -17,7 +17,7 @@ export interface QDrawerProps extends NativeProps, HTMLAttributes<HTMLDivElement
|
|
|
17
17
|
* The width of the drawer. Can be specified with a CSS unit. If no unit is specified, "px" will be used.
|
|
18
18
|
* @default 300
|
|
19
19
|
*/
|
|
20
|
-
width?: number
|
|
20
|
+
width?: number;
|
|
21
21
|
/**
|
|
22
22
|
* The breakpoint at which the drawer behavior changes. (not supported yet)
|
|
23
23
|
* @default 1023
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
@use "$css/variables";
|
|
3
|
+
|
|
4
|
+
.q-footer {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: auto;
|
|
7
|
+
right: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
z-index: 4;
|
|
11
|
+
|
|
12
|
+
@include mixins.padding("x-md");
|
|
13
|
+
|
|
14
|
+
min-height: unset;
|
|
15
|
+
height: var(--footer-height);
|
|
16
|
+
width: auto;
|
|
17
|
+
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
|
|
20
|
+
background-color: var(--surface);
|
|
21
|
+
|
|
22
|
+
transition: all variables.$speed3;
|
|
23
|
+
|
|
24
|
+
&.q-footer--bordered {
|
|
25
|
+
@include mixins.border(var(--outline), "top");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.q-footer--collapsed {
|
|
29
|
+
translate: 0 calc(1.5 * var(--footer-height));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
& > nav {
|
|
33
|
+
height: 100%;
|
|
34
|
+
min-height: unset;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@each $side in ("left", "right") {
|
|
38
|
+
&.q-footer--offset-#{$side} {
|
|
39
|
+
#{$side}: var(--offset-#{$side}, 0);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,30 +1,69 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext, onDestroy, onMount, untrack } from "svelte";
|
|
3
|
+
import QContext from "../../classes/QContext.svelte";
|
|
4
|
+
import QScrollObserver from "../../classes/QScrollObserver.svelte";
|
|
5
|
+
import QToolbar from "../toolbar/QToolbar.svelte";
|
|
6
|
+
const footerIdentifier = Date.now();
|
|
7
|
+
let {
|
|
8
|
+
value = $bindable(true),
|
|
9
|
+
bordered = false,
|
|
10
|
+
reveal = false,
|
|
11
|
+
revealOffset = 250,
|
|
12
|
+
height = 80,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
} = $props();
|
|
16
|
+
const footerContext = QContext.get("QFooter");
|
|
17
|
+
const layoutView = getContext("view");
|
|
18
|
+
if (!footerContext || !layoutView) {
|
|
19
|
+
throw new Error("QFooter should be used inside QLayout");
|
|
20
|
+
}
|
|
21
|
+
const scroll = $derived(
|
|
22
|
+
reveal
|
|
23
|
+
? new QScrollObserver(
|
|
24
|
+
`.q-footer--${footerIdentifier} ~ .q-layout__content`,
|
|
25
|
+
)
|
|
26
|
+
: void 0,
|
|
14
27
|
);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
let contentScrollHeight = $state(0);
|
|
29
|
+
const offset = $derived(scroll ? scroll.position + height : void 0);
|
|
30
|
+
const collapsed = $derived(
|
|
31
|
+
reveal &&
|
|
32
|
+
scroll?.direction === "up" &&
|
|
33
|
+
offset + revealOffset < contentScrollHeight,
|
|
21
34
|
);
|
|
35
|
+
const leftOffset = () => layoutView.value.charAt(8) === "l";
|
|
36
|
+
const rightOffset = () => layoutView.value.charAt(10) === "r";
|
|
37
|
+
$effect.pre(() => {
|
|
38
|
+
untrack(() => footerContext).updateEntries({ height, collapsed });
|
|
39
|
+
});
|
|
40
|
+
onMount(() => {
|
|
41
|
+
const content = document.querySelector(
|
|
42
|
+
`.q-footer--${footerIdentifier} ~ .q-layout__content`,
|
|
43
|
+
);
|
|
44
|
+
contentScrollHeight = content
|
|
45
|
+
? content.scrollHeight - content.clientHeight
|
|
46
|
+
: 0;
|
|
47
|
+
});
|
|
48
|
+
onDestroy(() => {
|
|
49
|
+
untrack(() => footerContext).updateEntries({ height: 0, collapsed: false });
|
|
50
|
+
});
|
|
22
51
|
</script>
|
|
23
52
|
|
|
24
53
|
{#if value}
|
|
25
|
-
<footer
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
54
|
+
<footer
|
|
55
|
+
{...props}
|
|
56
|
+
class="q-footer{props.class
|
|
57
|
+
? ` ${props.class}`
|
|
58
|
+
: ''} q-footer--{footerIdentifier}"
|
|
59
|
+
class:q-footer--collapsed={collapsed}
|
|
60
|
+
class:q-footer--bordered={bordered}
|
|
61
|
+
class:q-footer--offset-left={leftOffset()}
|
|
62
|
+
class:q-footer--offset-right={rightOffset()}
|
|
63
|
+
style:--footer-height="{height}px"
|
|
64
|
+
>
|
|
65
|
+
<QToolbar>
|
|
66
|
+
{@render children?.()}
|
|
67
|
+
</QToolbar>
|
|
29
68
|
</footer>
|
|
30
69
|
{/if}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QFooterProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
value?: QFooterProps["value"];
|
|
6
|
-
border?: QFooterProps["border"];
|
|
7
|
-
elevate?: QFooterProps["elevate"];
|
|
8
|
-
height?: QFooterProps["height"];
|
|
9
|
-
class?: string | null | undefined;
|
|
10
|
-
style?: string | null | undefined;
|
|
11
|
-
};
|
|
12
|
-
events: {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
type QFooterProps_ = typeof __propDef.props;
|
|
20
|
-
export { QFooterProps_ as QFooterProps };
|
|
21
|
-
export type QFooterEvents = typeof __propDef.events;
|
|
22
|
-
export type QFooterSlots = typeof __propDef.slots;
|
|
23
|
-
export default class QFooter extends SvelteComponent<QFooterProps, QFooterEvents, QFooterSlots> {
|
|
24
|
-
}
|
|
2
|
+
declare const QFooter: import("svelte").Component<QFooterProps, {}, "value">;
|
|
3
|
+
export default QFooter;
|