@quaffui/quaff 1.0.0-beta1 → 1.0.0-beta12
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/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,296 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { createRawSnippet, mount, tick } from "svelte";
|
|
3
|
-
import Types from "../../utils/types.json";
|
|
4
|
-
import {
|
|
5
|
-
QCard,
|
|
6
|
-
QCardSection,
|
|
7
|
-
QIcon,
|
|
8
|
-
QItem,
|
|
9
|
-
QItemSection,
|
|
10
|
-
QList,
|
|
11
|
-
QTab,
|
|
12
|
-
QTabs,
|
|
13
|
-
QTooltip,
|
|
14
|
-
Quaff,
|
|
15
|
-
} from "../..";
|
|
16
|
-
import { capitalize, escape } from "../../utils";
|
|
17
|
-
import type {
|
|
18
|
-
QComponentDocs,
|
|
19
|
-
QComponentEvent,
|
|
20
|
-
QComponentMethod,
|
|
21
|
-
} from "../../utils";
|
|
22
|
-
import type { ParsedProp, ParsedSnippet } from "../../../../docgen/props/parseInterface";
|
|
23
|
-
|
|
24
|
-
let { componentDocs }: { componentDocs: QComponentDocs[] } = $props();
|
|
25
|
-
|
|
26
|
-
let api: (keyof QComponentDocs["docs"])[] = $state(
|
|
27
|
-
componentDocs.map(() => "props"),
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
function getType(type: string) {
|
|
31
|
-
type = type.replace("[]", "");
|
|
32
|
-
let found = type in Types ? Types[type as keyof typeof Types] : undefined;
|
|
33
|
-
return found;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function isProp(
|
|
37
|
-
doc: ParsedProp | ParsedSnippet | QComponentEvent | QComponentMethod,
|
|
38
|
-
index: number,
|
|
39
|
-
): doc is ParsedProp {
|
|
40
|
-
return api[index] === "props";
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function isEvent(
|
|
44
|
-
doc: ParsedProp | ParsedSnippet | QComponentEvent | QComponentMethod,
|
|
45
|
-
index: number,
|
|
46
|
-
): doc is QComponentEvent {
|
|
47
|
-
return api[index] === "events";
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function isSnippet(
|
|
51
|
-
doc: ParsedProp | ParsedSnippet | QComponentEvent | QComponentMethod,
|
|
52
|
-
index: number,
|
|
53
|
-
): doc is ParsedSnippet {
|
|
54
|
-
return api[index] === "snippets";
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function inSpan(
|
|
58
|
-
spanContent: string,
|
|
59
|
-
{ typeStyle = false, isClickable = false, typeName = "" } = {},
|
|
60
|
-
) {
|
|
61
|
-
const classes = [
|
|
62
|
-
typeStyle && "prop-type",
|
|
63
|
-
isClickable && "clickable",
|
|
64
|
-
].filter(Boolean);
|
|
65
|
-
const classString = classes.length ? ` class="${classes.join(" ")}"` : "";
|
|
66
|
-
|
|
67
|
-
const dataAttrs = isClickable
|
|
68
|
-
? ` data-quaff data-type-name="${escape(typeName)}"`
|
|
69
|
-
: "";
|
|
70
|
-
|
|
71
|
-
return `<span${classString}${dataAttrs}>${spanContent}</span>`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function prepareHeaderForSnippet(snippet: ParsedSnippet) {
|
|
75
|
-
let content = "<pre>";
|
|
76
|
-
|
|
77
|
-
if (snippet.optional) {
|
|
78
|
-
content += inSpan("?.", { typeStyle: true });
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
content += inSpan("(", { typeStyle: true });
|
|
82
|
-
|
|
83
|
-
if (snippet.type.length) {
|
|
84
|
-
content += inSpan("{ ", { typeStyle: true });
|
|
85
|
-
|
|
86
|
-
content += snippet.type
|
|
87
|
-
.map((arg) => {
|
|
88
|
-
return inSpan(escape(arg.propName)).concat(
|
|
89
|
-
inSpan(": "),
|
|
90
|
-
inSpan(escape(arg.name), {
|
|
91
|
-
typeStyle: true,
|
|
92
|
-
isClickable: arg.isClickable,
|
|
93
|
-
typeName: arg.name,
|
|
94
|
-
}),
|
|
95
|
-
);
|
|
96
|
-
})
|
|
97
|
-
.join(", ");
|
|
98
|
-
|
|
99
|
-
content += inSpan(" }", { typeStyle: true });
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
content += inSpan(")", { typeStyle: true });
|
|
103
|
-
|
|
104
|
-
content += "</pre>";
|
|
105
|
-
|
|
106
|
-
return content;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function prepareHeaderForProp(prop: ParsedProp) {
|
|
110
|
-
let content = "<pre>";
|
|
111
|
-
|
|
112
|
-
if (prop.optional) {
|
|
113
|
-
content += inSpan("?", { typeStyle: true });
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
content += inSpan(": ", { typeStyle: true });
|
|
117
|
-
|
|
118
|
-
if (prop.isArray && Array.isArray(prop.type)) {
|
|
119
|
-
content += inSpan("(", { typeStyle: true });
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (Array.isArray(prop.type)) {
|
|
123
|
-
content += prop.type
|
|
124
|
-
.map((type) =>
|
|
125
|
-
inSpan(escape(type.name), {
|
|
126
|
-
typeStyle: true,
|
|
127
|
-
isClickable: type.isClickable,
|
|
128
|
-
typeName: type.name,
|
|
129
|
-
}),
|
|
130
|
-
)
|
|
131
|
-
.join(" | ");
|
|
132
|
-
} else {
|
|
133
|
-
content += inSpan(escape(prop.type.name), {
|
|
134
|
-
typeStyle: true,
|
|
135
|
-
isClickable: prop.type.isClickable,
|
|
136
|
-
typeName: prop.type.name,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (prop.isArray) {
|
|
141
|
-
if (Array.isArray(prop.type)) {
|
|
142
|
-
content += inSpan(")", { typeStyle: true });
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
content += inSpan("[]", { typeStyle: true });
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (prop.default) {
|
|
149
|
-
content += inSpan(` = ${prop.default}`);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
content += "</pre>";
|
|
153
|
-
|
|
154
|
-
return content;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
async function attachTooltips() {
|
|
158
|
-
await tick();
|
|
159
|
-
|
|
160
|
-
document.querySelectorAll("span.clickable").forEach(async (el) => {
|
|
161
|
-
const typeName = el.getAttribute("data-type-name");
|
|
162
|
-
|
|
163
|
-
if (!typeName) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const type = getType(typeName) || "/* No definition found */";
|
|
168
|
-
|
|
169
|
-
const { codeToHtml } = await import("shiki");
|
|
170
|
-
|
|
171
|
-
const html = await codeToHtml(type, {
|
|
172
|
-
lang: "typescript",
|
|
173
|
-
theme: Quaff.darkMode.isActive
|
|
174
|
-
? "github-dark-default"
|
|
175
|
-
: "github-light-default",
|
|
176
|
-
transformers: [
|
|
177
|
-
{
|
|
178
|
-
pre(node) {
|
|
179
|
-
node.properties.style += ";padding: 1rem; text-align: left;";
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
const snip = createRawSnippet(() => ({
|
|
186
|
-
render: () => html,
|
|
187
|
-
}));
|
|
188
|
-
|
|
189
|
-
mount(QTooltip, {
|
|
190
|
-
target: el,
|
|
191
|
-
props: {
|
|
192
|
-
class: "q-pa-none transparent",
|
|
193
|
-
children: snip,
|
|
194
|
-
},
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
$effect(() => {
|
|
200
|
-
// Doesn't rerun if we don't use JSON.stringify
|
|
201
|
-
JSON.stringify(api);
|
|
202
|
-
|
|
203
|
-
attachTooltips();
|
|
204
|
-
});
|
|
205
|
-
</script>
|
|
206
|
-
|
|
207
|
-
{#each componentDocs as QDocument, index (index)}
|
|
208
|
-
<QCard class="q-px-none q-pb-none q-mt-lg">
|
|
209
|
-
<div class="flex justify-between items-center q-px-md">
|
|
210
|
-
<h5 class="no-margin">
|
|
211
|
-
<QIcon name="info" />
|
|
212
|
-
<span class="q-ml-md">{QDocument.name} API</span>
|
|
213
|
-
</h5>
|
|
214
|
-
<QTabs bind:value={api[index]} noSeparator class="no-margin">
|
|
215
|
-
{#each Object.entries(QDocument.docs) as [tabName, _tabDoc] (tabName)}
|
|
216
|
-
{#if _tabDoc.length !== 0}
|
|
217
|
-
<QTab name={tabName} style="min-width: 100px">
|
|
218
|
-
<h6 style="margin: 0">{capitalize(tabName)}</h6>
|
|
219
|
-
</QTab>
|
|
220
|
-
{/if}
|
|
221
|
-
{/each}
|
|
222
|
-
</QTabs>
|
|
223
|
-
</div>
|
|
224
|
-
<QCardSection style="max-height: 416px; overflow-y: auto">
|
|
225
|
-
<QList separator bordered>
|
|
226
|
-
{#each QDocument.docs[api[index]] as doc (doc)}
|
|
227
|
-
<QItem style="overflow-x: auto">
|
|
228
|
-
<QItemSection type="content">
|
|
229
|
-
{#snippet headline()}
|
|
230
|
-
<div
|
|
231
|
-
class="q-my-sm flex-center"
|
|
232
|
-
style="display: flex; flex: 1 1 0"
|
|
233
|
-
>
|
|
234
|
-
<span
|
|
235
|
-
class="q-px-sm q-py-xs q-mr-xs"
|
|
236
|
-
style="background-color: var(--surface-container); border-radius: 0.5rem"
|
|
237
|
-
>
|
|
238
|
-
<b>{doc.name}</b>
|
|
239
|
-
</span>
|
|
240
|
-
{#if isProp(doc, index)}
|
|
241
|
-
{@html prepareHeaderForProp(doc)}
|
|
242
|
-
{:else if isSnippet(doc, index)}
|
|
243
|
-
{@html prepareHeaderForSnippet(doc)}
|
|
244
|
-
{:else if isEvent(doc, index)}
|
|
245
|
-
<span class="prop-type">
|
|
246
|
-
: {doc.type}
|
|
247
|
-
</span>
|
|
248
|
-
{/if}
|
|
249
|
-
</div>
|
|
250
|
-
{/snippet}
|
|
251
|
-
{#snippet line1()}
|
|
252
|
-
<div
|
|
253
|
-
class="q-mt-sm prop-description"
|
|
254
|
-
style="white-space: normal;"
|
|
255
|
-
>
|
|
256
|
-
{@html doc.description}
|
|
257
|
-
</div>
|
|
258
|
-
{/snippet}
|
|
259
|
-
</QItemSection>
|
|
260
|
-
</QItem>
|
|
261
|
-
{/each}
|
|
262
|
-
</QList>
|
|
263
|
-
</QCardSection>
|
|
264
|
-
</QCard>
|
|
265
|
-
{/each}
|
|
266
|
-
|
|
267
|
-
<style>
|
|
268
|
-
:global(.clickable) {
|
|
269
|
-
cursor: pointer;
|
|
270
|
-
}
|
|
271
|
-
:global(.clickable):hover {
|
|
272
|
-
color: var(--primary);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
:global(.prop-type) {
|
|
276
|
-
opacity: 0.75;
|
|
277
|
-
width: 100%;
|
|
278
|
-
letter-spacing: 0.5px;
|
|
279
|
-
}
|
|
280
|
-
:global(.prop-type):global(.clickable) {
|
|
281
|
-
cursor: pointer;
|
|
282
|
-
}
|
|
283
|
-
:global(.prop-type):global(.clickable):hover {
|
|
284
|
-
opacity: 1;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
:global(.q-drawer.api-drawer pre) {
|
|
288
|
-
margin: 0;
|
|
289
|
-
border-radius: inherit;
|
|
290
|
-
white-space: pre-wrap;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
:global(.prop-description > a:hover) {
|
|
294
|
-
color: var(--primary);
|
|
295
|
-
}
|
|
296
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
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,155 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { setContext, type Snippet } from "svelte";
|
|
3
|
-
import { QCard, QCardSection, QTheme, Quaff } from "../..";
|
|
4
|
-
import { QColors, QDocsCtxName, type QComponentDocs } from "../../utils";
|
|
5
|
-
import QApi from "./QApi.svelte";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
children,
|
|
9
|
-
display,
|
|
10
|
-
pre,
|
|
11
|
-
usage,
|
|
12
|
-
snippets,
|
|
13
|
-
componentDocs,
|
|
14
|
-
docName,
|
|
15
|
-
docDescription,
|
|
16
|
-
}: {
|
|
17
|
-
children?: Snippet;
|
|
18
|
-
display?: Snippet;
|
|
19
|
-
pre?: Snippet;
|
|
20
|
-
usage?: Snippet;
|
|
21
|
-
snippets?: Record<string, string>;
|
|
22
|
-
componentDocs?: QComponentDocs | QComponentDocs[];
|
|
23
|
-
docName?: string;
|
|
24
|
-
docDescription?: string;
|
|
25
|
-
} = $props();
|
|
26
|
-
|
|
27
|
-
const isDark = $derived(Quaff.darkMode.isActive);
|
|
28
|
-
|
|
29
|
-
const hueRotate = $derived(
|
|
30
|
-
QColors.calculateHueRotate(
|
|
31
|
-
"#ec6b08",
|
|
32
|
-
QTheme.themeColors[`primary-${isDark ? "dark" : "light"}`],
|
|
33
|
-
),
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
if (snippets) {
|
|
37
|
-
setContext(QDocsCtxName.snippets, () => snippets);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
let principalDocument = Array.isArray(componentDocs)
|
|
41
|
-
? componentDocs[0]
|
|
42
|
-
: componentDocs;
|
|
43
|
-
|
|
44
|
-
const brightness = $derived(Quaff.darkMode.isActive ? 0.7 : 1.2);
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<div
|
|
48
|
-
class="q-docs"
|
|
49
|
-
style="padding: 1rem; --q-hue-rotate: {hueRotate}deg; --q-brightness: {brightness}; max-width: {Quaff
|
|
50
|
-
.breakpoints.lg}px; margin: auto;"
|
|
51
|
-
>
|
|
52
|
-
<div class="row q-gutter-lg" style="min-height: 400px">
|
|
53
|
-
<QCard
|
|
54
|
-
class="col-sm-12 col-xs-12 col-lg-6"
|
|
55
|
-
fill="primary"
|
|
56
|
-
style="min-height: 400px; align-content: center;"
|
|
57
|
-
>
|
|
58
|
-
<h1
|
|
59
|
-
class={[
|
|
60
|
-
"no-margin justify-center",
|
|
61
|
-
Quaff.breakpoints.isMoreThan("sm", true) ? "large" : "small",
|
|
62
|
-
]}
|
|
63
|
-
>
|
|
64
|
-
{docName || principalDocument?.name}
|
|
65
|
-
</h1>
|
|
66
|
-
<QCardSection class="q-docs__description flex flex-center">
|
|
67
|
-
<h3 class="q-docs__description-text">
|
|
68
|
-
{docDescription || principalDocument?.description}
|
|
69
|
-
</h3>
|
|
70
|
-
</QCardSection>
|
|
71
|
-
</QCard>
|
|
72
|
-
<QCard
|
|
73
|
-
class="q-docs__preview col-sm-12 col-xs-12 col-lg-6 q-mt-none q-pa-none"
|
|
74
|
-
fill="secondary"
|
|
75
|
-
style="min-height: 400px"
|
|
76
|
-
>
|
|
77
|
-
<QCardSection class="q-pa-none">
|
|
78
|
-
<div
|
|
79
|
-
class="flex flex-center column"
|
|
80
|
-
style="position: absolute; height: 100%; width: 100%; z-index: 1; overflow: hidden;"
|
|
81
|
-
>
|
|
82
|
-
{@render display?.()}
|
|
83
|
-
</div>
|
|
84
|
-
<img
|
|
85
|
-
class="q-docs__image"
|
|
86
|
-
src="/cocktail-close-up.jpg"
|
|
87
|
-
alt="Close-up of the content of a cocktail"
|
|
88
|
-
/>
|
|
89
|
-
</QCardSection>
|
|
90
|
-
</QCard>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<div class="q-page">
|
|
94
|
-
{#if componentDocs}
|
|
95
|
-
<QApi
|
|
96
|
-
componentDocs={Array.isArray(componentDocs)
|
|
97
|
-
? componentDocs
|
|
98
|
-
: [componentDocs]}
|
|
99
|
-
/>
|
|
100
|
-
{/if}
|
|
101
|
-
|
|
102
|
-
{@render pre?.()}
|
|
103
|
-
|
|
104
|
-
{#if usage}
|
|
105
|
-
<div class="q-pa-md">
|
|
106
|
-
<div class="heading-usage">
|
|
107
|
-
<h4 class="q-my-xl">Usage</h4>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
{@render usage()}
|
|
111
|
-
</div>
|
|
112
|
-
{/if}
|
|
113
|
-
|
|
114
|
-
{@render children?.()}
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<style>
|
|
119
|
-
.q-docs :global(.q-pa-none) {
|
|
120
|
-
padding: 0 !important;
|
|
121
|
-
}
|
|
122
|
-
.q-docs :global(code:not(pre > code)) {
|
|
123
|
-
background-color: var(--surface-container);
|
|
124
|
-
padding: 0.25rem 0.5rem;
|
|
125
|
-
border-radius: 0.25rem;
|
|
126
|
-
}
|
|
127
|
-
.q-docs__image {
|
|
128
|
-
width: 100%;
|
|
129
|
-
height: 25rem;
|
|
130
|
-
object-fit: cover;
|
|
131
|
-
filter: hue-rotate(var(--q-hue-rotate)) brightness(var(--q-brightness));
|
|
132
|
-
}
|
|
133
|
-
.q-docs :global(.q-docs__preview) {
|
|
134
|
-
display: flex !important;
|
|
135
|
-
flex-direction: column;
|
|
136
|
-
}
|
|
137
|
-
.q-docs :global(.q-docs__description) {
|
|
138
|
-
display: flex;
|
|
139
|
-
flex-grow: 1;
|
|
140
|
-
justify-content: center;
|
|
141
|
-
align-items: center;
|
|
142
|
-
}
|
|
143
|
-
.q-docs :global(.q-docs__description-text) {
|
|
144
|
-
font-size: 1.75rem;
|
|
145
|
-
text-align: center;
|
|
146
|
-
}
|
|
147
|
-
.q-docs .q-page {
|
|
148
|
-
padding-top: 0.5rem;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.heading-usage {
|
|
152
|
-
display: flex;
|
|
153
|
-
align-items: center;
|
|
154
|
-
}
|
|
155
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
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,62 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { getContext, type Snippet } from "svelte";
|
|
3
|
-
import { QBtn, QCodeBlock, QDialog } from "../..";
|
|
4
|
-
import { QDocsCtxName } from "../../utils";
|
|
5
|
-
|
|
6
|
-
type QDocsSectionProps = {
|
|
7
|
-
title: string;
|
|
8
|
-
sectionDescription?: Snippet;
|
|
9
|
-
children?: Snippet;
|
|
10
|
-
noCode?: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let {
|
|
14
|
-
title,
|
|
15
|
-
noCode = false,
|
|
16
|
-
sectionDescription,
|
|
17
|
-
children,
|
|
18
|
-
}: QDocsSectionProps = $props();
|
|
19
|
-
|
|
20
|
-
const snippets = getContext<undefined | (() => Record<string, string>)>(
|
|
21
|
-
QDocsCtxName.snippets,
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const code = $derived(snippets && snippets()[title]);
|
|
25
|
-
|
|
26
|
-
let dialog = $state(false);
|
|
27
|
-
|
|
28
|
-
// Create a kebab-case id from the title to be able to link to this section
|
|
29
|
-
const id = $derived(title.toLowerCase().replaceAll(" ", "-"));
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<div {id} style="margin-bottom:48px">
|
|
33
|
-
<div class="flex justify-between q-mb-sm">
|
|
34
|
-
<h5>{title}</h5>
|
|
35
|
-
{#if code && !noCode}
|
|
36
|
-
<QBtn
|
|
37
|
-
icon="code"
|
|
38
|
-
variant="outlined"
|
|
39
|
-
round
|
|
40
|
-
onclick={() => (dialog = true)}
|
|
41
|
-
/>
|
|
42
|
-
<QDialog
|
|
43
|
-
class="snippet-dialog"
|
|
44
|
-
bind:value={dialog}
|
|
45
|
-
modal
|
|
46
|
-
style="max-width: 75vw"
|
|
47
|
-
>
|
|
48
|
-
<QCodeBlock {code} language="svelte" {title} copiable />
|
|
49
|
-
</QDialog>
|
|
50
|
-
{/if}
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
{#if sectionDescription}
|
|
54
|
-
<div class="q-mb-md" style="text-wrap: balance">
|
|
55
|
-
{@render sectionDescription()}
|
|
56
|
-
</div>
|
|
57
|
-
{/if}
|
|
58
|
-
|
|
59
|
-
<div class="q-ma-sm">
|
|
60
|
-
{@render children?.()}
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
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 QDocsSectionProps_ = typeof __propDef.props;
|
|
10
|
-
export { QDocsSectionProps_ as QDocsSectionProps };
|
|
11
|
-
export type QDocsSectionEvents = typeof __propDef.events;
|
|
12
|
-
export type QDocsSectionSlots = typeof __propDef.slots;
|
|
13
|
-
export default class QDocsSection extends SvelteComponentTyped<QDocsSectionProps_, QDocsSectionEvents, QDocsSectionSlots> {
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import ContextReseter from "./ContextReseter.svelte";
|
|
2
|
-
import QApi from "./QApi.svelte";
|
|
3
|
-
import QDocs from "./QDocs.svelte";
|
|
4
|
-
import QDocsSection from "./QDocsSection.svelte";
|
|
5
|
-
import QIconSnippet from "./QIconSnippet.svelte";
|
|
6
|
-
export { ContextReseter, QApi, QDocs, QDocsSection, QIconSnippet };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import ContextReseter from "./ContextReseter.svelte";
|
|
2
|
-
import QApi from "./QApi.svelte";
|
|
3
|
-
import QDocs from "./QDocs.svelte";
|
|
4
|
-
import QDocsSection from "./QDocsSection.svelte";
|
|
5
|
-
import QIconSnippet from "./QIconSnippet.svelte";
|
|
6
|
-
export { ContextReseter, QApi, QDocs, QDocsSection, QIconSnippet };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ParsedProp, ParsedSnippet } from "../../../../docgen/props/parseInterface";
|
|
2
|
-
export declare const QLinearProgressDocsProps: ParsedProp[];
|
|
3
|
-
export declare const QLinearProgressDocsSnippets: ParsedSnippet[];
|
|
4
|
-
export declare const QCircularProgressDocsProps: ParsedProp[];
|
|
5
|
-
export declare const QCircularProgressDocsSnippets: ParsedSnippet[];
|