@quaffui/quaff 1.0.0-beta1 → 1.0.0-beta13
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 +2 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +4 -4
- package/dist/classes/QScrollObserver.svelte.js +26 -13
- package/dist/classes/Quaff.svelte.d.ts +3 -0
- package/dist/classes/Quaff.svelte.js +21 -17
- package/dist/components/avatar/QAvatar.svelte +4 -0
- package/dist/components/avatar/QAvatar.svelte.d.ts +4 -14
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +9 -5
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +46 -16
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +24 -12
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +22 -3
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +50 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +4 -14
- package/dist/components/breadcrumbs/props.d.ts +4 -4
- package/dist/components/button/QBtn.scss +3 -1
- package/dist/components/button/QBtn.svelte +38 -22
- package/dist/components/button/QBtn.svelte.d.ts +4 -14
- package/dist/components/button/props.d.ts +9 -2
- package/dist/components/card/QCard.svelte +9 -5
- package/dist/components/card/QCard.svelte.d.ts +4 -14
- package/dist/components/card/QCardActions.svelte +4 -0
- package/dist/components/card/QCardActions.svelte.d.ts +4 -14
- package/dist/components/card/QCardSection.svelte +2 -0
- package/dist/components/card/QCardSection.svelte.d.ts +4 -14
- package/dist/components/checkbox/QCheckbox.svelte +6 -4
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +4 -14
- package/dist/components/checkbox/props.d.ts +1 -1
- package/dist/components/chip/QChip.scss +3 -1
- package/dist/components/chip/QChip.svelte +24 -14
- package/dist/components/chip/QChip.svelte.d.ts +4 -14
- package/dist/components/codeBlock/QCodeBlock.svelte +8 -0
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +4 -14
- package/dist/components/dialog/QDialog.scss +17 -0
- package/dist/components/dialog/QDialog.svelte +34 -9
- package/dist/components/dialog/QDialog.svelte.d.ts +8 -21
- package/dist/components/drawer/QDrawer.scss +2 -2
- package/dist/components/drawer/QDrawer.svelte +124 -69
- package/dist/components/drawer/QDrawer.svelte.d.ts +8 -21
- package/dist/components/drawer/props.d.ts +3 -3
- package/dist/components/expansion-item/QExpansionItem.scss +59 -0
- package/dist/components/expansion-item/QExpansionItem.svelte +319 -0
- package/dist/components/expansion-item/QExpansionItem.svelte.d.ts +8 -0
- package/dist/components/expansion-item/docs.d.ts +2 -0
- package/dist/components/expansion-item/docs.js +17 -0
- package/dist/components/expansion-item/props.d.ts +129 -0
- package/dist/components/expansion-item/props.js +1 -0
- package/dist/components/footer/QFooter.scss +1 -1
- package/dist/components/footer/QFooter.svelte +32 -28
- package/dist/components/footer/QFooter.svelte.d.ts +4 -14
- package/dist/components/header/QHeader.scss +1 -1
- package/dist/components/header/QHeader.svelte +41 -33
- package/dist/components/header/QHeader.svelte.d.ts +4 -14
- package/dist/components/icon/QIcon.svelte +6 -4
- package/dist/components/icon/QIcon.svelte.d.ts +4 -14
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +3 -1
- package/dist/components/input/QInput.svelte +139 -17
- package/dist/components/input/QInput.svelte.d.ts +4 -14
- package/dist/components/input/docs.js +2 -2
- package/dist/components/input/mask.d.ts +10 -0
- package/dist/components/input/mask.js +204 -0
- package/dist/components/input/props.d.ts +37 -4
- package/dist/components/layout/QLayout.svelte +248 -93
- package/dist/components/layout/QLayout.svelte.d.ts +67 -15
- package/dist/components/layout/props.d.ts +1 -1
- package/dist/components/list/QItem.scss +7 -4
- package/dist/components/list/QItem.svelte +44 -24
- package/dist/components/list/QItem.svelte.d.ts +17 -13
- package/dist/components/list/QItemSection.scss +24 -3
- package/dist/components/list/QItemSection.svelte +19 -21
- package/dist/components/list/QItemSection.svelte.d.ts +4 -14
- package/dist/components/list/QList.scss +17 -4
- package/dist/components/list/QList.svelte +30 -8
- package/dist/components/list/QList.svelte.d.ts +17 -13
- package/dist/components/list/props.d.ts +3 -3
- package/dist/components/menu/QMenu.scss +37 -0
- package/dist/components/menu/QMenu.svelte +314 -0
- package/dist/components/menu/QMenu.svelte.d.ts +8 -0
- package/dist/components/menu/docs.d.ts +2 -0
- package/dist/components/menu/docs.js +27 -0
- package/dist/components/menu/props.d.ts +48 -0
- package/dist/components/menu/props.js +1 -0
- package/dist/components/progress/QCircularProgress.svelte +17 -14
- package/dist/components/progress/QCircularProgress.svelte.d.ts +4 -14
- package/dist/components/progress/QLinearProgress.svelte +15 -15
- package/dist/components/progress/QLinearProgress.svelte.d.ts +4 -14
- package/dist/components/radio/QRadio.svelte +6 -4
- package/dist/components/radio/QRadio.svelte.d.ts +4 -14
- package/dist/components/radio/props.d.ts +1 -1
- package/dist/components/railbar/QRailbar.scss +1 -1
- package/dist/components/railbar/QRailbar.svelte +36 -35
- package/dist/components/railbar/QRailbar.svelte.d.ts +4 -14
- package/dist/components/select/QSelect.svelte +316 -102
- package/dist/components/select/QSelect.svelte.d.ts +4 -14
- package/dist/components/select/filter.d.ts +13 -0
- package/dist/components/select/filter.js +73 -0
- package/dist/components/select/index.scss +28 -27
- package/dist/components/select/option.d.ts +9 -0
- package/dist/components/select/option.js +59 -0
- package/dist/components/select/props.d.ts +40 -7
- package/dist/components/separator/QSeparator.scss +2 -0
- package/dist/components/separator/QSeparator.svelte +9 -8
- package/dist/components/separator/QSeparator.svelte.d.ts +4 -14
- package/dist/components/switch/QSwitch.scss +12 -6
- package/dist/components/switch/QSwitch.svelte +7 -1
- package/dist/components/switch/QSwitch.svelte.d.ts +4 -14
- package/dist/components/table/QTable.svelte +31 -19
- package/dist/components/table/QTable.svelte.d.ts +4 -14
- package/dist/components/table/index.scss +1 -1
- package/dist/components/tabs/QTab.scss +2 -0
- package/dist/components/tabs/QTab.svelte +19 -22
- package/dist/components/tabs/QTab.svelte.d.ts +4 -14
- package/dist/components/tabs/QTabs.svelte +59 -32
- package/dist/components/tabs/QTabs.svelte.d.ts +18 -18
- package/dist/components/toolbar/QToolbar.svelte +2 -0
- package/dist/components/toolbar/QToolbar.svelte.d.ts +4 -14
- package/dist/components/toolbar/QToolbarTitle.svelte +2 -0
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +4 -14
- package/dist/components/tooltip/QTooltip.svelte +48 -38
- package/dist/components/tooltip/QTooltip.svelte.d.ts +29 -17
- package/dist/components/tooltip/QTooltipBase.svelte +18 -8
- package/dist/components/tooltip/QTooltipBase.svelte.d.ts +4 -14
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +2 -0
- package/dist/composables/useColor.d.ts +1 -0
- package/dist/composables/useColor.js +19 -0
- package/dist/composables/useRevealScrollObserver.svelte.d.ts +9 -0
- package/dist/composables/useRevealScrollObserver.svelte.js +25 -0
- package/dist/composables/useRouterLink.d.ts +3 -2
- package/dist/composables/useRouterLink.js +2 -2
- package/dist/css/_components.scss +2 -0
- package/dist/css/classes/_grid.scss +12 -1
- package/dist/css/index.css +1 -1
- package/dist/css/mixins/_design.scss +1 -1
- package/dist/css/mixins/_field.scss +3 -2
- package/dist/css/mixins/_table.scss +1 -1
- package/dist/css/mixins/_toolbar.scss +1 -1
- package/dist/css/shared/q-field.scss +7 -6
- package/dist/css/theme/_page.scss +8 -6
- package/dist/css/theme/_reset.scss +2 -1
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/ripple.js +5 -6
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/{components/private/ContextReseter.svelte → internal/ContextResetter.svelte} +2 -3
- package/dist/internal/ContextResetter.svelte.d.ts +8 -0
- package/dist/{components/private → internal}/QIconSnippet.svelte +2 -2
- package/dist/internal/QIconSnippet.svelte.d.ts +10 -0
- package/dist/utils/context.d.ts +49 -32
- package/dist/utils/context.js +82 -33
- package/dist/utils/dom.d.ts +6 -0
- package/dist/utils/dom.js +33 -0
- package/dist/utils/events.d.ts +0 -24
- package/dist/utils/events.js +0 -24
- package/package.json +44 -38
- package/dist/classes/QContext.svelte.d.ts +0 -42
- package/dist/classes/QContext.svelte.js +0 -63
- package/dist/components/avatar/docs.props.d.ts +0 -3
- package/dist/components/avatar/docs.props.js +0 -87
- package/dist/components/breadcrumbs/docs.props.d.ts +0 -5
- package/dist/components/breadcrumbs/docs.props.js +0 -144
- package/dist/components/button/docs.props.d.ts +0 -3
- package/dist/components/button/docs.props.js +0 -227
- package/dist/components/card/docs.props.d.ts +0 -7
- package/dist/components/card/docs.props.js +0 -89
- package/dist/components/checkbox/docs.props.d.ts +0 -3
- package/dist/components/checkbox/docs.props.js +0 -41
- package/dist/components/chip/docs.props.d.ts +0 -3
- package/dist/components/chip/docs.props.js +0 -137
- package/dist/components/codeBlock/docs.props.d.ts +0 -3
- package/dist/components/codeBlock/docs.props.js +0 -83
- package/dist/components/dialog/docs.props.d.ts +0 -3
- package/dist/components/dialog/docs.props.js +0 -65
- package/dist/components/drawer/docs.props.d.ts +0 -3
- package/dist/components/drawer/docs.props.js +0 -149
- package/dist/components/footer/docs.props.d.ts +0 -3
- package/dist/components/footer/docs.props.js +0 -65
- package/dist/components/header/docs.props.d.ts +0 -7
- package/dist/components/header/docs.props.js +0 -131
- package/dist/components/icon/docs.props.d.ts +0 -3
- package/dist/components/icon/docs.props.js +0 -107
- package/dist/components/input/docs.props.d.ts +0 -3
- package/dist/components/input/docs.props.js +0 -162
- package/dist/components/layout/docs.props.d.ts +0 -3
- package/dist/components/layout/docs.props.js +0 -81
- package/dist/components/list/docs.props.d.ts +0 -11
- package/dist/components/list/docs.props.js +0 -434
- package/dist/components/private/ContextReseter.svelte.d.ts +0 -14
- package/dist/components/private/QApi.svelte +0 -296
- package/dist/components/private/QApi.svelte.d.ts +0 -14
- package/dist/components/private/QDocs.svelte +0 -155
- package/dist/components/private/QDocs.svelte.d.ts +0 -14
- package/dist/components/private/QDocsSection.svelte +0 -62
- package/dist/components/private/QDocsSection.svelte.d.ts +0 -14
- package/dist/components/private/QIconSnippet.svelte.d.ts +0 -14
- package/dist/components/private/index.d.ts +0 -6
- package/dist/components/private/index.js +0 -6
- package/dist/components/progress/docs.props.d.ts +0 -5
- package/dist/components/progress/docs.props.js +0 -314
- package/dist/components/radio/docs.props.d.ts +0 -3
- package/dist/components/radio/docs.props.js +0 -53
- package/dist/components/railbar/docs.props.d.ts +0 -3
- package/dist/components/railbar/docs.props.js +0 -47
- package/dist/components/select/docs.props.d.ts +0 -3
- package/dist/components/select/docs.props.js +0 -198
- package/dist/components/separator/docs.props.d.ts +0 -5
- package/dist/components/separator/docs.props.js +0 -196
- package/dist/components/switch/docs.props.d.ts +0 -3
- package/dist/components/switch/docs.props.js +0 -119
- package/dist/components/table/docs.props.d.ts +0 -3
- package/dist/components/table/docs.props.js +0 -94
- package/dist/components/tabs/docs.props.d.ts +0 -5
- package/dist/components/tabs/docs.props.js +0 -86
- package/dist/components/toolbar/docs.props.d.ts +0 -5
- package/dist/components/toolbar/docs.props.js +0 -68
- package/dist/components/tooltip/docs.props.d.ts +0 -3
- package/dist/components/tooltip/docs.props.js +0 -77
- package/dist/utils/types.json +0 -31
|
@@ -1,24 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { QLayoutProps } from "./props";
|
|
2
|
+
interface AppbarContext {
|
|
3
|
+
readonly view: string;
|
|
3
4
|
height: number;
|
|
4
5
|
collapsed: boolean;
|
|
5
6
|
ready: boolean;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
interface DrawerContext {
|
|
9
|
+
readonly view: string;
|
|
8
10
|
width: number;
|
|
9
11
|
takesSpace: boolean;
|
|
10
12
|
ready: boolean;
|
|
11
13
|
}
|
|
12
|
-
declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export declare const headerCtx: {
|
|
15
|
+
readonly symbol: symbol;
|
|
16
|
+
get(): AppbarContext | undefined;
|
|
17
|
+
assertGet(errorMsg?: string): AppbarContext;
|
|
18
|
+
set(context: AppbarContext): void;
|
|
19
|
+
reset(): void;
|
|
20
|
+
exists(): boolean;
|
|
21
|
+
updateEntry(key: keyof AppbarContext, value: string | number | boolean): void;
|
|
22
|
+
updateEntries(updates: Partial<AppbarContext>): void;
|
|
18
23
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
export declare const footerCtx: {
|
|
25
|
+
readonly symbol: symbol;
|
|
26
|
+
get(): AppbarContext | undefined;
|
|
27
|
+
assertGet(errorMsg?: string): AppbarContext;
|
|
28
|
+
set(context: AppbarContext): void;
|
|
29
|
+
reset(): void;
|
|
30
|
+
exists(): boolean;
|
|
31
|
+
updateEntry(key: keyof AppbarContext, value: string | number | boolean): void;
|
|
32
|
+
updateEntries(updates: Partial<AppbarContext>): void;
|
|
33
|
+
};
|
|
34
|
+
export declare const leftRailbarCtx: {
|
|
35
|
+
readonly symbol: symbol;
|
|
36
|
+
get(): DrawerContext | undefined;
|
|
37
|
+
assertGet(errorMsg?: string): DrawerContext;
|
|
38
|
+
set(context: DrawerContext): void;
|
|
39
|
+
reset(): void;
|
|
40
|
+
exists(): boolean;
|
|
41
|
+
updateEntry(key: keyof DrawerContext, value: string | number | boolean): void;
|
|
42
|
+
updateEntries(updates: Partial<DrawerContext>): void;
|
|
43
|
+
};
|
|
44
|
+
export declare const rightRailbarCtx: {
|
|
45
|
+
readonly symbol: symbol;
|
|
46
|
+
get(): DrawerContext | undefined;
|
|
47
|
+
assertGet(errorMsg?: string): DrawerContext;
|
|
48
|
+
set(context: DrawerContext): void;
|
|
49
|
+
reset(): void;
|
|
50
|
+
exists(): boolean;
|
|
51
|
+
updateEntry(key: keyof DrawerContext, value: string | number | boolean): void;
|
|
52
|
+
updateEntries(updates: Partial<DrawerContext>): void;
|
|
53
|
+
};
|
|
54
|
+
export declare const leftDrawerCtx: {
|
|
55
|
+
readonly symbol: symbol;
|
|
56
|
+
get(): DrawerContext | undefined;
|
|
57
|
+
assertGet(errorMsg?: string): DrawerContext;
|
|
58
|
+
set(context: DrawerContext): void;
|
|
59
|
+
reset(): void;
|
|
60
|
+
exists(): boolean;
|
|
61
|
+
updateEntry(key: keyof DrawerContext, value: string | number | boolean): void;
|
|
62
|
+
updateEntries(updates: Partial<DrawerContext>): void;
|
|
63
|
+
};
|
|
64
|
+
export declare const rightDrawerCtx: {
|
|
65
|
+
readonly symbol: symbol;
|
|
66
|
+
get(): DrawerContext | undefined;
|
|
67
|
+
assertGet(errorMsg?: string): DrawerContext;
|
|
68
|
+
set(context: DrawerContext): void;
|
|
69
|
+
reset(): void;
|
|
70
|
+
exists(): boolean;
|
|
71
|
+
updateEntry(key: keyof DrawerContext, value: string | number | boolean): void;
|
|
72
|
+
updateEntries(updates: Partial<DrawerContext>): void;
|
|
73
|
+
};
|
|
74
|
+
declare const QLayout: import("svelte").Component<QLayoutProps, {}, "">;
|
|
75
|
+
type QLayout = ReturnType<typeof QLayout>;
|
|
76
|
+
export default QLayout;
|
|
@@ -5,7 +5,7 @@ export type QLayoutViewOptions = `${"l" | "h"}${"h" | "H"}${"r" | "h"} ${"l" | "
|
|
|
5
5
|
export interface QLayoutProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
/**
|
|
7
7
|
* The layout view configuration, which defines how layout components (header, railbars, drawers, footer) should be displayed on screen.
|
|
8
|
-
*
|
|
8
|
+
* Controls how layout components (header, railbars, drawers, footer) are displayed on screen.
|
|
9
9
|
* @default "hhh lpr fff"
|
|
10
10
|
*/
|
|
11
11
|
view?: QLayoutViewOptions;
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
margin-top: 0 !important;
|
|
14
14
|
margin: 0;
|
|
15
15
|
padding: 0.5rem 1.5rem 0.5rem 1rem;
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
|
|
19
|
+
isolation: isolate;
|
|
17
20
|
|
|
18
21
|
&--clickable {
|
|
19
22
|
cursor: pointer;
|
|
@@ -55,14 +58,14 @@
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
&--multiline {
|
|
61
|
+
white-space: normal;
|
|
58
62
|
padding-block: 0.75rem;
|
|
59
63
|
|
|
60
|
-
& > .q-item__section:is(.
|
|
64
|
+
& > .q-item__section:is(.q-item__section--thumbnail, .q-item__section--video) {
|
|
61
65
|
align-self: start;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
> .q-item__section
|
|
65
|
-
margin-left: -1rem !important;
|
|
68
|
+
> .q-item__section--video {
|
|
66
69
|
padding-block: 0;
|
|
67
70
|
}
|
|
68
71
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { QContext } from "../../utils";
|
|
3
|
+
|
|
4
|
+
interface QItemContext {
|
|
5
|
+
readonly activeClass: string | false;
|
|
6
|
+
multiline: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const itemCtx = QContext<QItemContext>("QItem");
|
|
10
|
+
</script>
|
|
11
|
+
|
|
1
12
|
<script lang="ts">
|
|
2
|
-
import { getContext, setContext } from "svelte";
|
|
3
13
|
import { ripple } from "../../helpers";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
getRouterInfo,
|
|
7
|
-
isRouteActive,
|
|
8
|
-
QItemCtxName,
|
|
9
|
-
QListCtxName,
|
|
10
|
-
} from "../../utils";
|
|
14
|
+
import { getRouterInfo, isRouteActive } from "../../utils";
|
|
11
15
|
import QSeparator from "../separator/QSeparator.svelte";
|
|
12
|
-
import
|
|
16
|
+
import { listCtx } from "./QList.svelte";
|
|
17
|
+
import type { QItemProps } from "./props";
|
|
13
18
|
|
|
19
|
+
// #region: --- Props
|
|
14
20
|
let {
|
|
15
21
|
tag = "div",
|
|
16
22
|
active = false,
|
|
@@ -26,7 +32,15 @@
|
|
|
26
32
|
children,
|
|
27
33
|
...props
|
|
28
34
|
}: QItemProps = $props();
|
|
35
|
+
// #endregion: --- Props
|
|
36
|
+
|
|
37
|
+
// #region: --- Reactive variables
|
|
38
|
+
let multiline = $state(false);
|
|
39
|
+
|
|
40
|
+
const ctx = listCtx.assertGet("QItem should be used inside QList");
|
|
41
|
+
// #endregion: --- Reactive variables
|
|
29
42
|
|
|
43
|
+
// #region: --- Derived values
|
|
30
44
|
const routerInfo = $derived(
|
|
31
45
|
getRouterInfo({
|
|
32
46
|
href,
|
|
@@ -37,30 +51,35 @@
|
|
|
37
51
|
}),
|
|
38
52
|
);
|
|
39
53
|
|
|
40
|
-
const listActiveClass = getContext<() => string>(QListCtxName.activeClass);
|
|
41
|
-
|
|
42
54
|
const activeClassToUse = $derived(
|
|
43
|
-
activeClass === "active" ?
|
|
55
|
+
activeClass === "active" ? ctx.activeClass || activeClass : activeClass,
|
|
44
56
|
);
|
|
45
57
|
|
|
46
|
-
setContext(QItemCtxName.activeClass, () => active && activeClassToUse);
|
|
47
|
-
|
|
48
|
-
const multiline = new QContext(QItemCtxName.multiline, false);
|
|
49
|
-
|
|
50
|
-
const separatorOptions = getContext<
|
|
51
|
-
QListProps["separatorOptions"] | undefined
|
|
52
|
-
>(QListCtxName.separator);
|
|
53
|
-
|
|
54
58
|
const isActionable = $derived(
|
|
55
59
|
clickable || routerInfo.hasLink || tag === "label",
|
|
56
60
|
);
|
|
57
61
|
const isClickable = $derived(isActionable && !disabled);
|
|
58
62
|
|
|
59
63
|
const isActive = $derived(isRouteActive(to || href) || active);
|
|
64
|
+
// #endregion: --- Derived values
|
|
65
|
+
|
|
66
|
+
// #region: --- Context
|
|
67
|
+
itemCtx.set({
|
|
68
|
+
get multiline() {
|
|
69
|
+
return multiline;
|
|
70
|
+
},
|
|
71
|
+
set multiline(newValue) {
|
|
72
|
+
multiline = newValue;
|
|
73
|
+
},
|
|
74
|
+
get activeClass() {
|
|
75
|
+
return active && activeClassToUse;
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
// #endregion: --- Context
|
|
60
79
|
</script>
|
|
61
80
|
|
|
62
|
-
{#if separatorOptions}
|
|
63
|
-
<QSeparator {...separatorOptions} />
|
|
81
|
+
{#if ctx.separatorOptions}
|
|
82
|
+
<QSeparator {...ctx.separatorOptions} />
|
|
64
83
|
{/if}
|
|
65
84
|
|
|
66
85
|
{#if routerInfo.linkAttributes.href}
|
|
@@ -73,7 +92,7 @@
|
|
|
73
92
|
routerInfo.linkClasses,
|
|
74
93
|
isActive && activeClassToUse,
|
|
75
94
|
props.class,
|
|
76
|
-
multiline
|
|
95
|
+
multiline && "q-item--multiline",
|
|
77
96
|
dense && "q-item--dense",
|
|
78
97
|
isActive && "q-item--active",
|
|
79
98
|
clickable && "q-item--clickable",
|
|
@@ -88,13 +107,14 @@
|
|
|
88
107
|
{:else}
|
|
89
108
|
<svelte:element
|
|
90
109
|
this={tag}
|
|
110
|
+
use:ripple={{ disabled: !isClickable || noRipple }}
|
|
91
111
|
{...props}
|
|
92
112
|
class={[
|
|
93
113
|
"q-item",
|
|
94
114
|
routerInfo.linkClasses,
|
|
95
115
|
isActive && activeClassToUse,
|
|
96
116
|
props.class,
|
|
97
|
-
multiline
|
|
117
|
+
multiline && "q-item--multiline",
|
|
98
118
|
dense && "q-item--dense",
|
|
99
119
|
isActive && "q-item--active",
|
|
100
120
|
clickable && "q-item--clickable",
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
type QItemProps_ = typeof __propDef.props;
|
|
10
|
-
export { QItemProps_ as QItemProps };
|
|
11
|
-
export type QItemEvents = typeof __propDef.events;
|
|
12
|
-
export type QItemSlots = typeof __propDef.slots;
|
|
13
|
-
export default class QItem extends SvelteComponentTyped<QItemProps_, QItemEvents, QItemSlots> {
|
|
1
|
+
interface QItemContext {
|
|
2
|
+
readonly activeClass: string | false;
|
|
3
|
+
multiline: boolean;
|
|
14
4
|
}
|
|
5
|
+
export declare const itemCtx: {
|
|
6
|
+
readonly symbol: symbol;
|
|
7
|
+
get(): QItemContext | undefined;
|
|
8
|
+
assertGet(errorMsg?: string): QItemContext;
|
|
9
|
+
set(context: QItemContext): void;
|
|
10
|
+
reset(): void;
|
|
11
|
+
exists(): boolean;
|
|
12
|
+
updateEntry(key: keyof QItemContext, value: string | boolean): void;
|
|
13
|
+
updateEntries(updates: Partial<QItemContext>): void;
|
|
14
|
+
};
|
|
15
|
+
import type { QItemProps } from "./props";
|
|
16
|
+
declare const QItem: import("svelte").Component<QItemProps, {}, "">;
|
|
17
|
+
type QItem = ReturnType<typeof QItem>;
|
|
18
|
+
export default QItem;
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
&--video {
|
|
20
|
-
margin-left: -1rem;
|
|
21
20
|
padding-block: 0.25rem;
|
|
22
21
|
|
|
23
22
|
& video {
|
|
@@ -32,11 +31,16 @@
|
|
|
32
31
|
height: 2.5rem;
|
|
33
32
|
width: 2.5rem;
|
|
34
33
|
}
|
|
34
|
+
|
|
35
35
|
&--icon {
|
|
36
36
|
height: 1.5rem;
|
|
37
37
|
width: 1.5rem;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
&--thumbnail {
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
&--thumbnail img {
|
|
41
45
|
width: 3.5rem;
|
|
42
46
|
height: 3.5rem;
|
|
@@ -46,12 +50,29 @@
|
|
|
46
50
|
|
|
47
51
|
&--content {
|
|
48
52
|
flex-direction: column;
|
|
49
|
-
flex:
|
|
53
|
+
flex: 1 1 auto;
|
|
54
|
+
min-width: 0;
|
|
50
55
|
justify-content: center;
|
|
51
|
-
align-items: start;
|
|
56
|
+
align-items: flex-start;
|
|
57
|
+
white-space: normal;
|
|
58
|
+
overflow-wrap: break-word;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&--side {
|
|
62
|
+
flex: 0 1 auto;
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
width: auto;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--content ~ &--side {
|
|
71
|
+
align-items: flex-end;
|
|
52
72
|
}
|
|
53
73
|
|
|
54
74
|
&--toggle {
|
|
75
|
+
flex: 0 0 auto;
|
|
55
76
|
align-items: center;
|
|
56
77
|
justify-content: center;
|
|
57
78
|
height: 1.5rem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { QItemCtxName } from "../../utils";
|
|
2
|
+
import { itemCtx } from "./QItem.svelte";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
5
4
|
import type { QItemSectionProps } from "./props";
|
|
6
5
|
|
|
6
|
+
// #region: --- Props
|
|
7
7
|
let {
|
|
8
8
|
type = "content",
|
|
9
9
|
children,
|
|
@@ -13,22 +13,20 @@
|
|
|
13
13
|
line3,
|
|
14
14
|
...props
|
|
15
15
|
}: QItemSectionProps = $props();
|
|
16
|
+
// #endregion: --- Props
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// #region: --- Reactive variables
|
|
19
|
+
const ctx = itemCtx.assertGet();
|
|
20
|
+
// #endregion: --- Reactive variables
|
|
20
21
|
|
|
22
|
+
// #region: --- Effects
|
|
21
23
|
$effect(() => {
|
|
22
24
|
if (type === "content") {
|
|
23
|
-
multiline
|
|
24
|
-
!!headline && [line1, line2, line3].filter(Boolean).length >= 2
|
|
25
|
-
);
|
|
25
|
+
ctx.multiline =
|
|
26
|
+
!!headline && [line1, line2, line3].filter(Boolean).length >= 2;
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
|
-
|
|
29
|
-
function getClass(snip: Snippet) {
|
|
30
|
-
return snip === headline ? "q-item__section--headline" : undefined;
|
|
31
|
-
}
|
|
29
|
+
// #endregion: --- Effects
|
|
32
30
|
</script>
|
|
33
31
|
|
|
34
32
|
<div
|
|
@@ -42,10 +40,8 @@
|
|
|
42
40
|
data-quaff
|
|
43
41
|
>
|
|
44
42
|
{#if type === "content"}
|
|
45
|
-
{#if
|
|
46
|
-
{@render
|
|
47
|
-
{:else}
|
|
48
|
-
{@render line(headline)}
|
|
43
|
+
{#if headline || line1 || line2 || line3}
|
|
44
|
+
{@render line(headline, true)}
|
|
49
45
|
|
|
50
46
|
{@render line(line1)}
|
|
51
47
|
|
|
@@ -54,19 +50,21 @@
|
|
|
54
50
|
{@render line(line3)}
|
|
55
51
|
{/if}
|
|
56
52
|
{:else if type === "trailingText"}
|
|
57
|
-
<div class={["label-small", activeClass
|
|
53
|
+
<div class={["label-small", ctx.activeClass]}>
|
|
58
54
|
{@render children?.()}
|
|
59
55
|
</div>
|
|
56
|
+
{:else if type === "side"}
|
|
57
|
+
{@render children?.()}
|
|
60
58
|
{:else}
|
|
61
|
-
<div class={activeClass
|
|
59
|
+
<div class={ctx.activeClass || undefined}>
|
|
62
60
|
{@render children?.()}
|
|
63
61
|
</div>
|
|
64
62
|
{/if}
|
|
65
63
|
</div>
|
|
66
64
|
|
|
67
|
-
{#snippet line(snip: Snippet | undefined)}
|
|
65
|
+
{#snippet line(snip: Snippet | undefined, isHeadline = false)}
|
|
68
66
|
{#if snip}
|
|
69
|
-
<div class={[
|
|
67
|
+
<div class={[isHeadline && "q-item__section--headline", ctx.activeClass]}>
|
|
70
68
|
{@render snip()}
|
|
71
69
|
</div>
|
|
72
70
|
{/if}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
type QItemSectionProps_ = typeof __propDef.props;
|
|
10
|
-
export { QItemSectionProps_ as QItemSectionProps };
|
|
11
|
-
export type QItemSectionEvents = typeof __propDef.events;
|
|
12
|
-
export type QItemSectionSlots = typeof __propDef.slots;
|
|
13
|
-
export default class QItemSection extends SvelteComponentTyped<QItemSectionProps_, QItemSectionEvents, QItemSectionSlots> {
|
|
14
|
-
}
|
|
1
|
+
import type { QItemSectionProps } from "./props";
|
|
2
|
+
declare const QItemSection: import("svelte").Component<QItemSectionProps, {}, "">;
|
|
3
|
+
type QItemSection = ReturnType<typeof QItemSection>;
|
|
4
|
+
export default QItemSection;
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: center;
|
|
8
8
|
width: 100%;
|
|
9
|
+
border-radius: 1rem;
|
|
9
10
|
|
|
10
|
-
&--
|
|
11
|
-
|
|
11
|
+
&--no-round {
|
|
12
|
+
border-radius: 0;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
&--
|
|
15
|
-
|
|
15
|
+
&--bordered {
|
|
16
|
+
@include mixins.border;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
&--dense {
|
|
@@ -24,6 +25,18 @@
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
& > .q-item {
|
|
29
|
+
&:first-child {
|
|
30
|
+
border-top-left-radius: inherit;
|
|
31
|
+
border-top-right-radius: inherit;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:last-child {
|
|
35
|
+
border-bottom-left-radius: inherit;
|
|
36
|
+
border-bottom-right-radius: inherit;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
27
40
|
& > .q-separator__wrapper:first-child {
|
|
28
41
|
display: none !important;
|
|
29
42
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { QListCtxName } from "../../utils";
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { QContext } from "../../utils";
|
|
4
3
|
import type { QListProps } from "./props";
|
|
5
4
|
|
|
5
|
+
interface QListContext {
|
|
6
|
+
readonly activeClass: string | undefined;
|
|
7
|
+
readonly separatorOptions: QListProps["separatorOptions"];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const listCtx = QContext<QListContext>("QList");
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
// #region: --- Props
|
|
6
15
|
let {
|
|
7
16
|
bordered = false,
|
|
8
|
-
|
|
17
|
+
noRound = false,
|
|
9
18
|
dense = false,
|
|
10
19
|
separator = false,
|
|
11
20
|
separatorOptions = {},
|
|
@@ -15,15 +24,28 @@
|
|
|
15
24
|
children,
|
|
16
25
|
...props
|
|
17
26
|
}: QListProps = $props();
|
|
27
|
+
// #endregion: --- Props
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
setContext(QListCtxName.separator, separator ? separatorOptions : undefined);
|
|
21
|
-
|
|
29
|
+
// #region: --- Non-reactive variables
|
|
22
30
|
let listEl: HTMLElement;
|
|
31
|
+
// #endregion: --- Non-reactive variables
|
|
32
|
+
|
|
33
|
+
// #region: --- Context
|
|
34
|
+
listCtx.set({
|
|
35
|
+
get activeClass() {
|
|
36
|
+
return activeClass;
|
|
37
|
+
},
|
|
38
|
+
get separatorOptions() {
|
|
39
|
+
return separator ? separatorOptions : undefined;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
// #endregion: --- Context
|
|
23
43
|
|
|
44
|
+
// #region: --- Effects
|
|
24
45
|
$effect(() => {
|
|
25
46
|
listEl.querySelector(".q-separator__wrapper:first-child")?.remove();
|
|
26
47
|
});
|
|
48
|
+
// #endregion: --- Effects
|
|
27
49
|
</script>
|
|
28
50
|
|
|
29
51
|
<svelte:element
|
|
@@ -38,7 +60,7 @@
|
|
|
38
60
|
props.class,
|
|
39
61
|
bordered && "q-list--bordered",
|
|
40
62
|
dense && "q-list--dense",
|
|
41
|
-
|
|
63
|
+
noRound && "q-list--no-round",
|
|
42
64
|
]}
|
|
43
65
|
data-quaff
|
|
44
66
|
>
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
type QListProps_ = typeof __propDef.props;
|
|
10
|
-
export { QListProps_ as QListProps };
|
|
11
|
-
export type QListEvents = typeof __propDef.events;
|
|
12
|
-
export type QListSlots = typeof __propDef.slots;
|
|
13
|
-
export default class QList extends SvelteComponentTyped<QListProps_, QListEvents, QListSlots> {
|
|
1
|
+
import type { QListProps } from "./props";
|
|
2
|
+
interface QListContext {
|
|
3
|
+
readonly activeClass: string | undefined;
|
|
4
|
+
readonly separatorOptions: QListProps["separatorOptions"];
|
|
14
5
|
}
|
|
6
|
+
export declare const listCtx: {
|
|
7
|
+
readonly symbol: symbol;
|
|
8
|
+
get(): QListContext | undefined;
|
|
9
|
+
assertGet(errorMsg?: string): QListContext;
|
|
10
|
+
set(context: QListContext): void;
|
|
11
|
+
reset(): void;
|
|
12
|
+
exists(): boolean;
|
|
13
|
+
updateEntry(key: keyof QListContext, value: string | Omit<import("../separator/props").QSeparatorHorizontalProps, "vertical"> | undefined): void;
|
|
14
|
+
updateEntries(updates: Partial<QListContext>): void;
|
|
15
|
+
};
|
|
16
|
+
declare const QList: import("svelte").Component<QListProps, {}, "">;
|
|
17
|
+
type QList = ReturnType<typeof QList>;
|
|
18
|
+
export default QList;
|
|
@@ -10,11 +10,11 @@ export interface QListProps extends HTMLAttributes<HTMLElement> {
|
|
|
10
10
|
*/
|
|
11
11
|
bordered?: boolean;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Removes the rounded borders when bordered is true.
|
|
14
14
|
*
|
|
15
15
|
* @default false
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
noRound?: boolean;
|
|
18
18
|
/**
|
|
19
19
|
* Makes all the items in the list more compact.
|
|
20
20
|
*
|
|
@@ -96,7 +96,7 @@ export interface QItemProps extends RouterProps, HTMLAttributes<HTMLElement> {
|
|
|
96
96
|
*/
|
|
97
97
|
target?: HTMLAnchorAttributes["target"];
|
|
98
98
|
}
|
|
99
|
-
export type QItemSectionTypes = "thumbnail" | "video" | "avatar" | "toggle" | "icon" | "trailingIcon" | "trailingText" | "content";
|
|
99
|
+
export type QItemSectionTypes = "thumbnail" | "video" | "avatar" | "side" | "toggle" | "icon" | "trailingIcon" | "trailingText" | "content";
|
|
100
100
|
export interface QItemSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
101
101
|
/**
|
|
102
102
|
* Type of the section, determines its layout and styling.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.q-menu {
|
|
2
|
+
display: block;
|
|
3
|
+
inset: auto;
|
|
4
|
+
margin: 0;
|
|
5
|
+
border: none;
|
|
6
|
+
padding: 0;
|
|
7
|
+
width: max-content;
|
|
8
|
+
height: auto;
|
|
9
|
+
min-width: 8rem;
|
|
10
|
+
max-width: min(90vw, 28rem);
|
|
11
|
+
max-height: min(50vh, calc(100vh - 1rem));
|
|
12
|
+
overflow: auto;
|
|
13
|
+
border-radius: 1rem;
|
|
14
|
+
background: var(--surface-container);
|
|
15
|
+
color: var(--on-surface);
|
|
16
|
+
box-shadow: var(--elevate2);
|
|
17
|
+
z-index: 6000;
|
|
18
|
+
|
|
19
|
+
&:popover-open {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
> :is(.q-card, .q-list) {
|
|
24
|
+
border-radius: inherit;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
> .q-list {
|
|
28
|
+
align-items: stretch;
|
|
29
|
+
justify-content: flex-start;
|
|
30
|
+
width: max-content;
|
|
31
|
+
min-width: 100%;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.q-menu__helper {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|