@quaffui/quaff 0.1.0-prealpha20 → 0.1.0-prealpha22
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 +4 -1
- package/dist/components/avatar/QAvatar.svelte.d.ts +14 -2
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +7 -2
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +14 -2
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +16 -5
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +14 -2
- package/dist/components/button/QBtn.svelte +61 -11
- package/dist/components/button/QBtn.svelte.d.ts +14 -2
- package/dist/components/button/docs.props.js +37 -5
- package/dist/components/button/props.d.ts +24 -4
- package/dist/components/card/QCard.svelte +6 -2
- package/dist/components/card/QCard.svelte.d.ts +14 -2
- package/dist/components/card/QCardActions.svelte +9 -1
- package/dist/components/card/QCardActions.svelte.d.ts +14 -2
- package/dist/components/card/QCardSection.svelte +3 -1
- package/dist/components/card/QCardSection.svelte.d.ts +14 -2
- package/dist/components/checkbox/QCheckbox.svelte +8 -1
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +14 -3
- package/dist/components/chip/QChip.svelte +30 -9
- package/dist/components/chip/QChip.svelte.d.ts +14 -3
- package/dist/components/codeBlock/QCodeBlock.svelte +37 -8
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +14 -3
- package/dist/components/dialog/QDialog.svelte +20 -5
- package/dist/components/dialog/QDialog.svelte.d.ts +21 -7
- package/dist/components/drawer/QDrawer.svelte +36 -7
- package/dist/components/drawer/QDrawer.svelte.d.ts +21 -7
- package/dist/components/footer/QFooter.svelte +24 -6
- package/dist/components/footer/QFooter.svelte.d.ts +14 -3
- package/dist/components/header/QHeader.svelte +19 -6
- package/dist/components/header/QHeader.svelte.d.ts +14 -3
- package/dist/components/icon/QIcon.svelte +6 -1
- package/dist/components/icon/QIcon.svelte.d.ts +14 -2
- package/dist/components/input/QInput.svelte +23 -10
- package/dist/components/input/QInput.svelte.d.ts +14 -3
- package/dist/components/input/index.scss +1 -1
- package/dist/components/layout/QLayout.scss +2 -1
- package/dist/components/layout/QLayout.svelte +50 -8
- package/dist/components/layout/QLayout.svelte.d.ts +14 -3
- package/dist/components/list/QItem.svelte +11 -2
- package/dist/components/list/QItem.svelte.d.ts +14 -3
- package/dist/components/list/QItemSection.svelte +9 -3
- package/dist/components/list/QItemSection.svelte.d.ts +14 -3
- package/dist/components/list/QList.svelte +8 -3
- package/dist/components/list/QList.svelte.d.ts +14 -3
- package/dist/components/private/ContextReseter.svelte +10 -1
- package/dist/components/private/ContextReseter.svelte.d.ts +14 -6
- package/dist/components/private/QApi.svelte +32 -9
- package/dist/components/private/QApi.svelte.d.ts +14 -5
- package/dist/components/private/QDocs.svelte +18 -1
- package/dist/components/private/QDocs.svelte.d.ts +14 -10
- package/dist/components/private/QDocsSection.svelte +14 -2
- package/dist/components/private/QDocsSection.svelte.d.ts +14 -7
- package/dist/components/private/QIconSnippet.svelte +11 -1
- package/dist/components/private/QIconSnippet.svelte.d.ts +14 -8
- package/dist/components/progress/QCircularProgress.svelte +19 -3
- package/dist/components/progress/QCircularProgress.svelte.d.ts +14 -2
- package/dist/components/progress/QLinearProgress.svelte +12 -4
- package/dist/components/progress/QLinearProgress.svelte.d.ts +14 -2
- package/dist/components/radio/QRadio.svelte +3 -1
- package/dist/components/radio/QRadio.svelte.d.ts +14 -3
- package/dist/components/railbar/QRailbar.svelte +17 -4
- package/dist/components/railbar/QRailbar.svelte.d.ts +14 -3
- package/dist/components/select/QSelect.svelte +65 -23
- package/dist/components/select/QSelect.svelte.d.ts +14 -3
- package/dist/components/select/index.scss +1 -1
- package/dist/components/separator/QSeparator.svelte +4 -1
- package/dist/components/separator/QSeparator.svelte.d.ts +14 -3
- package/dist/components/switch/QSwitch.svelte +20 -6
- package/dist/components/switch/QSwitch.svelte.d.ts +14 -3
- package/dist/components/table/QTable.svelte +47 -19
- package/dist/components/table/QTable.svelte.d.ts +14 -3
- package/dist/components/tabs/QTab.svelte +32 -9
- package/dist/components/tabs/QTab.svelte.d.ts +14 -3
- package/dist/components/tabs/QTabs.svelte +58 -16
- package/dist/components/tabs/QTabs.svelte.d.ts +14 -3
- package/dist/components/toolbar/QToolbar.svelte +3 -1
- package/dist/components/toolbar/QToolbar.svelte.d.ts +14 -3
- package/dist/components/toolbar/QToolbarTitle.svelte +3 -1
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +14 -3
- package/dist/components/tooltip/QTooltip.svelte +8 -1
- package/dist/components/tooltip/QTooltip.svelte.d.ts +14 -3
- package/dist/css/classes/_index.scss +7 -7
- package/dist/css/fonts.scss +3 -2
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +7 -5
- package/dist/css/mixins/_design.scss +5 -4
- package/dist/css/mixins/_image.scss +2 -1
- package/dist/css/mixins/_index.scss +9 -9
- package/dist/css/theme/_index.scss +12 -0
- package/dist/css/theme/_page.scss +17 -0
- package/dist/css/theme/{palette.scss → _palette.scss} +5 -3
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/utils/types.json +1 -1
- package/package.json +32 -31
- package/dist/css/flex.scss +0 -41
- package/dist/css/theme/page.scss +0 -16
- package/dist/css/theme/theme.scss +0 -10
- /package/dist/css/theme/{colors.module.scss → _color-classes.scss} +0 -0
- /package/dist/css/theme/{css-variables.scss → _css-variables.scss} +0 -0
- /package/dist/css/theme/{elevate.scss → _elevate.scss} +0 -0
- /package/dist/css/theme/{reset.scss → _reset.scss} +0 -0
- /package/dist/css/theme/{typography.module.scss → _typography-classes.scss} +0 -0
- /package/dist/css/theme/{tokens.scss → _typography-variables.scss} +0 -0
- /package/dist/css/theme/{typography.scss → _typography.scss} +0 -0
|
@@ -2,6 +2,40 @@
|
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
import QContext from "../../classes/QContext.svelte";
|
|
4
4
|
import ContextReseter from "../private/ContextReseter.svelte";
|
|
5
|
+
import type { QLayoutProps } from "./props";
|
|
6
|
+
|
|
7
|
+
export interface DrawerContextLegacy {
|
|
8
|
+
offset: {
|
|
9
|
+
top: boolean;
|
|
10
|
+
bottom: boolean;
|
|
11
|
+
};
|
|
12
|
+
fixed: boolean;
|
|
13
|
+
railbar: boolean;
|
|
14
|
+
drawer: boolean;
|
|
15
|
+
overlay: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AppbarContext {
|
|
19
|
+
height: number;
|
|
20
|
+
collapsed: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DrawerContext {
|
|
24
|
+
width: number;
|
|
25
|
+
takesSpace: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface AppbarContextLegacy {
|
|
29
|
+
display: boolean;
|
|
30
|
+
fixed: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type LayoutContext = {
|
|
34
|
+
header?: AppbarContextLegacy;
|
|
35
|
+
footer?: AppbarContextLegacy;
|
|
36
|
+
drawerLeft: DrawerContextLegacy;
|
|
37
|
+
drawerRight: DrawerContextLegacy;
|
|
38
|
+
};
|
|
5
39
|
</script>
|
|
6
40
|
|
|
7
41
|
<script lang="ts">
|
|
@@ -18,36 +52,42 @@
|
|
|
18
52
|
onresize,
|
|
19
53
|
children,
|
|
20
54
|
...props
|
|
21
|
-
} = $props();
|
|
55
|
+
}: QLayoutProps = $props();
|
|
56
|
+
|
|
22
57
|
setContext("view", {
|
|
23
58
|
get value() {
|
|
24
59
|
return view;
|
|
25
60
|
},
|
|
26
61
|
});
|
|
27
|
-
|
|
62
|
+
|
|
63
|
+
const headerCtx = new QContext<AppbarContext>("QHeader", {
|
|
28
64
|
height: 0,
|
|
29
65
|
collapsed: false,
|
|
30
66
|
});
|
|
31
|
-
|
|
67
|
+
|
|
68
|
+
const footerCtx = new QContext<AppbarContext>("QFooter", {
|
|
32
69
|
height: 0,
|
|
33
70
|
collapsed: false,
|
|
34
71
|
});
|
|
35
|
-
|
|
72
|
+
|
|
73
|
+
const leftRailbarCtx = new QContext<DrawerContext>("QRailbar-left", {
|
|
36
74
|
width: 0,
|
|
37
75
|
takesSpace: false,
|
|
38
76
|
});
|
|
39
|
-
const rightRailbarCtx = new QContext("QRailbar-right", {
|
|
77
|
+
const rightRailbarCtx = new QContext<DrawerContext>("QRailbar-right", {
|
|
40
78
|
width: 0,
|
|
41
79
|
takesSpace: false,
|
|
42
80
|
});
|
|
43
|
-
|
|
81
|
+
|
|
82
|
+
const leftDrawerCtx = new QContext<DrawerContext>("QDrawer-left", {
|
|
44
83
|
width: 0,
|
|
45
84
|
takesSpace: false,
|
|
46
85
|
});
|
|
47
|
-
const rightDrawerCtx = new QContext("QDrawer-right", {
|
|
86
|
+
const rightDrawerCtx = new QContext<DrawerContext>("QDrawer-right", {
|
|
48
87
|
width: 360,
|
|
49
88
|
takesSpace: false,
|
|
50
89
|
});
|
|
90
|
+
|
|
51
91
|
const topOffset = $derived(
|
|
52
92
|
!header || headerCtx.value.collapsed ? 0 : headerCtx.value.height,
|
|
53
93
|
);
|
|
@@ -60,10 +100,12 @@
|
|
|
60
100
|
const rightOffset = $derived(
|
|
61
101
|
handleDrawerCtx(rightRailbarCtx) + handleDrawerCtx(rightDrawerCtx),
|
|
62
102
|
);
|
|
103
|
+
|
|
63
104
|
const contentMargin = $derived(
|
|
64
105
|
`${header ? topOffset : 0}px ${rightOffset}px ${footer ? bottomOffset : 0}px ${leftOffset}px`,
|
|
65
106
|
);
|
|
66
|
-
|
|
107
|
+
|
|
108
|
+
function handleDrawerCtx(ctx: QContext<DrawerContext>) {
|
|
67
109
|
return ctx.value.takesSpace ? ctx.value.width : 0;
|
|
68
110
|
}
|
|
69
111
|
</script>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
export interface DrawerContextLegacy {
|
|
3
3
|
offset: {
|
|
4
4
|
top: boolean;
|
|
@@ -27,5 +27,16 @@ export type LayoutContext = {
|
|
|
27
27
|
drawerLeft: DrawerContextLegacy;
|
|
28
28
|
drawerRight: DrawerContextLegacy;
|
|
29
29
|
};
|
|
30
|
-
declare const
|
|
31
|
-
|
|
30
|
+
declare const __propDef: {
|
|
31
|
+
props: Record<string, never>;
|
|
32
|
+
events: {
|
|
33
|
+
[evt: string]: CustomEvent<any>;
|
|
34
|
+
};
|
|
35
|
+
slots: {};
|
|
36
|
+
};
|
|
37
|
+
type QLayoutProps_ = typeof __propDef.props;
|
|
38
|
+
export { QLayoutProps_ as QLayoutProps };
|
|
39
|
+
export type QLayoutEvents = typeof __propDef.events;
|
|
40
|
+
export type QLayoutSlots = typeof __propDef.slots;
|
|
41
|
+
export default class QLayout extends SvelteComponentTyped<QLayoutProps_, QLayoutEvents, QLayoutSlots> {
|
|
42
|
+
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { ripple } from "../../helpers/ripple";
|
|
5
5
|
import QContext from "../../classes/QContext.svelte";
|
|
6
6
|
import QSeparator from "../separator/QSeparator.svelte";
|
|
7
|
+
import type { QItemProps, QListProps } from "./props";
|
|
8
|
+
|
|
7
9
|
let {
|
|
8
10
|
tag = "div",
|
|
9
11
|
active = false,
|
|
@@ -18,7 +20,8 @@
|
|
|
18
20
|
noRipple = false,
|
|
19
21
|
children,
|
|
20
22
|
...props
|
|
21
|
-
} = $props();
|
|
23
|
+
}: QItemProps = $props();
|
|
24
|
+
|
|
22
25
|
const routerInfo = $derived(
|
|
23
26
|
getRouterInfo({
|
|
24
27
|
href,
|
|
@@ -28,12 +31,18 @@
|
|
|
28
31
|
replace,
|
|
29
32
|
}),
|
|
30
33
|
);
|
|
34
|
+
|
|
31
35
|
const multiline = new QContext("multiline", false);
|
|
32
|
-
|
|
36
|
+
|
|
37
|
+
const separatorOptions = getContext<
|
|
38
|
+
QListProps["separatorOptions"] | undefined
|
|
39
|
+
>("separator");
|
|
40
|
+
|
|
33
41
|
const isActionable = $derived(
|
|
34
42
|
clickable || routerInfo.hasLink || tag === "label",
|
|
35
43
|
);
|
|
36
44
|
const isClickable = $derived(isActionable && !disabled);
|
|
45
|
+
|
|
37
46
|
const isActive = $derived(
|
|
38
47
|
$isRouteActive(to || href) || (routerInfo.hasLink && active),
|
|
39
48
|
);
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
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> {
|
|
14
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import QContext from "../../classes/QContext.svelte";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { QItemSectionProps } from "./props";
|
|
5
|
+
|
|
3
6
|
let {
|
|
4
7
|
type = "content",
|
|
5
8
|
children,
|
|
@@ -8,8 +11,10 @@
|
|
|
8
11
|
line2,
|
|
9
12
|
line3,
|
|
10
13
|
...props
|
|
11
|
-
} = $props();
|
|
12
|
-
|
|
14
|
+
}: QItemSectionProps = $props();
|
|
15
|
+
|
|
16
|
+
const multiline = QContext.get<boolean>("multiline");
|
|
17
|
+
|
|
13
18
|
$effect(() => {
|
|
14
19
|
if (type === "content") {
|
|
15
20
|
multiline?.update(
|
|
@@ -17,7 +22,8 @@
|
|
|
17
22
|
);
|
|
18
23
|
}
|
|
19
24
|
});
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
function getClass(snip: Snippet) {
|
|
21
27
|
return snip === headline
|
|
22
28
|
? "body-large text-on-surface"
|
|
23
29
|
: "body-medium text-on-surface-variant";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
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,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
|
+
import type { QListProps } from "./props";
|
|
4
|
+
|
|
3
5
|
let {
|
|
4
6
|
bordered = false,
|
|
5
7
|
roundedBorders = false,
|
|
@@ -10,12 +12,15 @@
|
|
|
10
12
|
tag = "div",
|
|
11
13
|
children,
|
|
12
14
|
...props
|
|
13
|
-
} = $props();
|
|
14
|
-
|
|
15
|
+
}: QListProps = $props();
|
|
16
|
+
|
|
17
|
+
let listEl: HTMLElement;
|
|
18
|
+
|
|
15
19
|
$effect(() => {
|
|
16
20
|
listEl.querySelector(".q-separator__wrapper:first-child")?.remove();
|
|
17
21
|
});
|
|
18
|
-
|
|
22
|
+
|
|
23
|
+
setContext("separator", separator ? separatorOptions : undefined);
|
|
19
24
|
</script>
|
|
20
25
|
|
|
21
26
|
<svelte:element
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
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> {
|
|
14
|
+
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import QContext from "../../classes/QContext.svelte";
|
|
3
|
-
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
keys,
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
keys: string | string[];
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
} = $props();
|
|
12
|
+
|
|
4
13
|
const keysArr = Array.isArray(keys) ? keys : [keys];
|
|
5
14
|
keysArr.forEach((key) => QContext.reset(key));
|
|
6
15
|
</script>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type ContextReseterProps = typeof __propDef.props;
|
|
10
|
+
export type ContextReseterEvents = typeof __propDef.events;
|
|
11
|
+
export type ContextReseterSlots = typeof __propDef.slots;
|
|
12
|
+
export default class ContextReseter extends SvelteComponentTyped<ContextReseterProps, ContextReseterEvents, ContextReseterSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -13,8 +13,17 @@
|
|
|
13
13
|
} from "../..";
|
|
14
14
|
import { capitalize } from "../../utils";
|
|
15
15
|
import Types from "../../utils/types.json";
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import type {
|
|
17
|
+
QComponentDocs,
|
|
18
|
+
QComponentProp,
|
|
19
|
+
QComponentSlot,
|
|
20
|
+
QComponentType,
|
|
21
|
+
QComponentEvent,
|
|
22
|
+
} from "../../utils";
|
|
23
|
+
|
|
24
|
+
let { componentDocs }: { componentDocs: QComponentDocs[] } = $props();
|
|
25
|
+
|
|
26
|
+
let api: (keyof QComponentDocs["docs"])[] = componentDocs.map(() => "props");
|
|
18
27
|
let drawer = $state(
|
|
19
28
|
Object.fromEntries(
|
|
20
29
|
componentDocs.map((doc) => [
|
|
@@ -22,25 +31,38 @@
|
|
|
22
31
|
Object.fromEntries(
|
|
23
32
|
doc.docs.props.map((prop) => [
|
|
24
33
|
prop.name,
|
|
25
|
-
prop.clickableType ? false :
|
|
34
|
+
prop.clickableType ? false : undefined,
|
|
26
35
|
]),
|
|
27
36
|
),
|
|
28
37
|
]),
|
|
29
38
|
),
|
|
30
39
|
);
|
|
31
|
-
let drawerContent = $state("");
|
|
32
|
-
|
|
40
|
+
let drawerContent: string | undefined = $state("");
|
|
41
|
+
|
|
42
|
+
function isProp(
|
|
43
|
+
doc: QComponentProp | QComponentSlot | QComponentType | QComponentEvent,
|
|
44
|
+
index: number,
|
|
45
|
+
): doc is QComponentProp {
|
|
33
46
|
return api[index] === "props";
|
|
34
47
|
}
|
|
35
|
-
function isEvent(
|
|
48
|
+
function isEvent(
|
|
49
|
+
doc: QComponentProp | QComponentSlot | QComponentType | QComponentEvent,
|
|
50
|
+
index: number,
|
|
51
|
+
): doc is QComponentEvent {
|
|
36
52
|
return api[index] === "events";
|
|
37
53
|
}
|
|
38
|
-
|
|
54
|
+
|
|
55
|
+
function getType(type: string) {
|
|
39
56
|
type = type.replace("[]", "");
|
|
40
|
-
let found = type in Types ? Types[type] :
|
|
57
|
+
let found = type in Types ? Types[type as keyof typeof Types] : undefined;
|
|
41
58
|
return found;
|
|
42
59
|
}
|
|
43
|
-
|
|
60
|
+
|
|
61
|
+
function handleDrawer(
|
|
62
|
+
QDocument: QComponentDocs,
|
|
63
|
+
doc: QComponentProp,
|
|
64
|
+
e: Event,
|
|
65
|
+
) {
|
|
44
66
|
e.stopPropagation();
|
|
45
67
|
let content = getType(doc.type);
|
|
46
68
|
for (let docName in drawer[QDocument.name]) {
|
|
@@ -48,6 +70,7 @@
|
|
|
48
70
|
drawer[QDocument.name][docName] = false;
|
|
49
71
|
}
|
|
50
72
|
}
|
|
73
|
+
|
|
51
74
|
if (!drawer[QDocument.name][doc.name]) {
|
|
52
75
|
setTimeout(() => {
|
|
53
76
|
drawerContent = content;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type QApiProps = typeof __propDef.props;
|
|
10
|
+
export type QApiEvents = typeof __propDef.events;
|
|
11
|
+
export type QApiSlots = typeof __propDef.slots;
|
|
12
|
+
export default class QApi extends SvelteComponentTyped<QApiProps, QApiEvents, QApiSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { QCard, QCardSection } from "../..";
|
|
3
|
+
import type { QComponentDocs } from "../../utils";
|
|
3
4
|
import Quaff from "../../classes/Quaff.svelte";
|
|
4
5
|
import QApi from "./QApi.svelte";
|
|
5
|
-
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
display,
|
|
11
|
+
pre,
|
|
12
|
+
usage,
|
|
13
|
+
componentDocs,
|
|
14
|
+
}: {
|
|
15
|
+
children?: Snippet;
|
|
16
|
+
display?: Snippet;
|
|
17
|
+
pre?: Snippet;
|
|
18
|
+
usage?: Snippet;
|
|
19
|
+
componentDocs: QComponentDocs | QComponentDocs[];
|
|
20
|
+
} = $props();
|
|
21
|
+
|
|
6
22
|
const isDark = $derived(Quaff.darkMode.isActive);
|
|
23
|
+
|
|
7
24
|
let principalDocument = Array.isArray(componentDocs)
|
|
8
25
|
? componentDocs[0]
|
|
9
26
|
: componentDocs;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type QDocsProps = typeof __propDef.props;
|
|
10
|
+
export type QDocsEvents = typeof __propDef.events;
|
|
11
|
+
export type QDocsSlots = typeof __propDef.slots;
|
|
12
|
+
export default class QDocs extends SvelteComponentTyped<QDocsProps, QDocsEvents, QDocsSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { QCodeBlock, QDialog, QBtn } from "../..";
|
|
3
|
-
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
title,
|
|
7
|
+
snippet,
|
|
8
|
+
children,
|
|
9
|
+
}: {
|
|
10
|
+
title: string;
|
|
11
|
+
snippet?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
} = $props();
|
|
14
|
+
|
|
4
15
|
let dialog = $state(false);
|
|
16
|
+
|
|
5
17
|
const code = $derived(snippet?.replaceAll(/^ {2}/gm, ""));
|
|
6
18
|
</script>
|
|
7
19
|
|
|
@@ -11,7 +23,7 @@
|
|
|
11
23
|
{#if code}
|
|
12
24
|
<QBtn
|
|
13
25
|
icon="code"
|
|
14
|
-
|
|
26
|
+
variant="outlined"
|
|
15
27
|
round
|
|
16
28
|
onclick={() => (dialog = true)}
|
|
17
29
|
/>
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type QDocsSectionProps = typeof __propDef.props;
|
|
10
|
+
export type QDocsSectionEvents = typeof __propDef.events;
|
|
11
|
+
export type QDocsSectionSlots = typeof __propDef.slots;
|
|
12
|
+
export default class QDocsSection extends SvelteComponentTyped<QDocsSectionProps, QDocsSectionEvents, QDocsSectionSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
<!-- This component should be used when an icon can be set from props. The icon can either be undefined, a string or a Snippet so this componnet handles it all. -->
|
|
2
2
|
<script lang="ts">
|
|
3
3
|
import QIcon from "../icon/QIcon.svelte";
|
|
4
|
-
|
|
4
|
+
import type { QIconProps } from "../icon/props";
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
7
|
+
|
|
8
|
+
interface IconSnippetProps extends Omit<QIconProps, "name"> {
|
|
9
|
+
icon?: MaterialSymbol | Snippet;
|
|
10
|
+
defaultIcon?: MaterialSymbol | Snippet;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { icon, defaultIcon, ...props }: IconSnippetProps = $props();
|
|
14
|
+
|
|
5
15
|
const iconToUse = $derived(icon ?? defaultIcon);
|
|
6
16
|
</script>
|
|
7
17
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type QIconSnippetProps = typeof __propDef.props;
|
|
10
|
+
export type QIconSnippetEvents = typeof __propDef.events;
|
|
11
|
+
export type QIconSnippetSlots = typeof __propDef.slots;
|
|
12
|
+
export default class QIconSnippet extends SvelteComponentTyped<QIconSnippetProps, QIconSnippetEvents, QIconSnippetSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -3,10 +3,20 @@
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import { useSize } from "../../composables/useSize";
|
|
5
5
|
import { between } from "../../utils/number";
|
|
6
|
+
import type { QCircularProgressProps } from "./props";
|
|
7
|
+
|
|
8
|
+
type CircleParams = {
|
|
9
|
+
cls: "track" | "indicator";
|
|
10
|
+
offset: number;
|
|
11
|
+
color: string;
|
|
12
|
+
rounded?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
6
15
|
const radius = 50,
|
|
7
16
|
diameter = 2 * radius,
|
|
8
17
|
circumference = diameter * Math.PI,
|
|
9
|
-
strokeDashArray = Math.round(circumference *
|
|
18
|
+
strokeDashArray = Math.round(circumference * 1000) / 1000;
|
|
19
|
+
|
|
10
20
|
let {
|
|
11
21
|
value = 0,
|
|
12
22
|
indeterminate = false,
|
|
@@ -24,20 +34,25 @@
|
|
|
24
34
|
showValue = false,
|
|
25
35
|
children = fallback,
|
|
26
36
|
...props
|
|
27
|
-
} = $props();
|
|
37
|
+
}: QCircularProgressProps = $props();
|
|
38
|
+
|
|
28
39
|
const qSize = $derived(useSize(size, "q-circular-progress"));
|
|
40
|
+
|
|
29
41
|
const svgStyle = $derived(`rotate3d(0, 0, 1, ${angle - 90}deg)`);
|
|
30
42
|
const circleStyle = $derived(
|
|
31
43
|
instantFeedback || indeterminate
|
|
32
|
-
?
|
|
44
|
+
? undefined
|
|
33
45
|
: `stroke-dashoffset ${animationSpeed}ms ease 0s, stroke ${animationSpeed}ms ease`,
|
|
34
46
|
);
|
|
47
|
+
|
|
35
48
|
const viewBox = $derived(diameter / (1 - thickness / 2));
|
|
36
49
|
const viewBoxAttr = $derived(
|
|
37
50
|
`${viewBox / 2} ${viewBox / 2} ${viewBox} ${viewBox}`,
|
|
38
51
|
);
|
|
52
|
+
|
|
39
53
|
const normalized = $derived(between(value, min, max));
|
|
40
54
|
const range = $derived(max - min);
|
|
55
|
+
|
|
41
56
|
const strokeWidth = $derived((thickness / 2) * viewBox);
|
|
42
57
|
const strokeDashOffset = $derived.by(() => {
|
|
43
58
|
const dashRatio = (max - normalized) / range;
|
|
@@ -45,6 +60,7 @@
|
|
|
45
60
|
!noRound && normalized < max && dashRatio < 0.25
|
|
46
61
|
? (strokeWidth / 2) * (1 - dashRatio / 0.25)
|
|
47
62
|
: 0;
|
|
63
|
+
|
|
48
64
|
return circumference * dashRatio + dashGap;
|
|
49
65
|
});
|
|
50
66
|
</script>
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
1
2
|
import type { QCircularProgressProps } from "./props";
|
|
2
|
-
declare const
|
|
3
|
-
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: QCircularProgressProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {};
|
|
9
|
+
};
|
|
10
|
+
type QCircularProgressProps_ = typeof __propDef.props;
|
|
11
|
+
export { QCircularProgressProps_ as QCircularProgressProps };
|
|
12
|
+
export type QCircularProgressEvents = typeof __propDef.events;
|
|
13
|
+
export type QCircularProgressSlots = typeof __propDef.slots;
|
|
14
|
+
export default class QCircularProgress extends SvelteComponentTyped<QCircularProgressProps_, QCircularProgressEvents, QCircularProgressSlots> {
|
|
15
|
+
}
|