@quaffui/quaff 0.1.0-prealpha15 → 0.1.0-prealpha19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/classes/QContext.svelte.d.ts +42 -0
- package/dist/classes/QContext.svelte.js +63 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
- package/dist/classes/QScrollObserver.svelte.js +95 -0
- package/dist/classes/QTheme.svelte.d.ts +11 -0
- package/dist/classes/QTheme.svelte.js +49 -0
- package/dist/classes/Quaff.svelte.d.ts +14 -0
- package/dist/classes/Quaff.svelte.js +35 -0
- package/dist/components/avatar/QAvatar.scss +97 -0
- package/dist/components/avatar/QAvatar.svelte +35 -50
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
- package/dist/components/avatar/docs.d.ts +1 -1
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/avatar/docs.props.js +21 -5
- package/dist/components/avatar/index.scss +5 -3
- package/dist/components/avatar/props.d.ts +24 -7
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -10
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +62 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.d.ts +1 -1
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/breadcrumbs/docs.props.js +27 -27
- package/dist/components/breadcrumbs/props.d.ts +25 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +89 -46
- package/dist/components/button/QBtn.svelte.d.ts +2 -33
- package/dist/components/button/docs.d.ts +1 -1
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/docs.props.js +26 -18
- package/dist/components/button/props.d.ts +21 -15
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +26 -17
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +11 -8
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +9 -7
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.d.ts +3 -3
- package/dist/components/card/docs.js +3 -3
- package/dist/components/card/docs.props.js +6 -14
- package/dist/components/card/props.d.ts +9 -15
- package/dist/components/checkbox/QCheckbox.svelte +6 -5
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.d.ts +1 -1
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/checkbox/docs.props.js +1 -1
- package/dist/components/checkbox/index.scss +3 -1
- package/dist/components/checkbox/props.d.ts +1 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +97 -69
- package/dist/components/chip/QChip.svelte.d.ts +2 -35
- package/dist/components/chip/docs.d.ts +1 -1
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/chip/docs.props.js +23 -47
- package/dist/components/chip/props.d.ts +21 -34
- package/dist/components/codeBlock/QCodeBlock.svelte +63 -45
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -19
- package/dist/components/codeBlock/docs.props.js +10 -2
- package/dist/components/codeBlock/props.d.ts +6 -1
- package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
- package/dist/components/dialog/QDialog.svelte +72 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.d.ts +1 -1
- package/dist/components/dialog/docs.js +1 -1
- package/dist/components/dialog/docs.props.d.ts +0 -8
- package/dist/components/dialog/docs.props.js +1 -131
- package/dist/components/dialog/props.d.ts +0 -16
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +87 -94
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -39
- package/dist/components/drawer/docs.d.ts +1 -1
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/drawer/docs.props.js +3 -3
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +65 -24
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.d.ts +1 -1
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/footer/docs.props.js +14 -6
- package/dist/components/footer/props.d.ts +8 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +52 -24
- package/dist/components/header/QHeader.svelte.d.ts +2 -23
- package/dist/components/header/docs.props.js +23 -7
- package/dist/components/header/props.d.ts +11 -3
- package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
- package/dist/components/icon/QIcon.svelte +29 -16
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.d.ts +1 -1
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +5 -5
- package/dist/components/icon/props.d.ts +6 -6
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/input/QInput.svelte +52 -25
- package/dist/components/input/QInput.svelte.d.ts +2 -32
- package/dist/components/input/docs.d.ts +1 -1
- package/dist/components/input/docs.js +1 -1
- package/dist/components/input/docs.props.js +33 -1
- package/dist/components/input/props.d.ts +5 -12
- package/dist/components/input/props.js +1 -12
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +100 -80
- package/dist/components/layout/QLayout.svelte.d.ts +16 -43
- package/dist/components/layout/docs.d.ts +1 -1
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/layout/docs.props.js +57 -1
- package/dist/components/layout/props.d.ts +8 -0
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +65 -46
- package/dist/components/list/QItem.svelte.d.ts +2 -30
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +46 -34
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +28 -16
- package/dist/components/list/QList.svelte.d.ts +2 -28
- package/dist/components/list/docs.d.ts +1 -1
- package/dist/components/list/docs.js +1 -1
- package/dist/components/list/docs.props.js +36 -4
- package/dist/components/list/props.d.ts +9 -8
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +6 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
- package/dist/components/private/QApi.svelte +118 -97
- package/dist/components/private/QApi.svelte.d.ts +4 -16
- package/dist/components/private/QDocs.svelte +67 -58
- package/dist/components/private/QDocs.svelte.d.ts +9 -20
- package/dist/components/private/QDocsSection.svelte +15 -22
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -29
- package/dist/components/private/QIconSnippet.svelte +12 -0
- package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
- package/dist/components/progress/QCircularProgress.scss +63 -0
- package/dist/components/progress/QCircularProgress.svelte +104 -28
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +55 -13
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
- package/dist/components/progress/docs.d.ts +1 -1
- package/dist/components/progress/docs.js +1 -1
- package/dist/components/progress/docs.props.js +138 -10
- package/dist/components/progress/props.d.ts +75 -12
- package/dist/components/radio/QRadio.svelte +14 -3
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.d.ts +1 -1
- package/dist/components/radio/docs.js +1 -1
- package/dist/components/radio/docs.props.js +2 -2
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +2 -4
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +43 -66
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.d.ts +1 -1
- package/dist/components/railbar/docs.js +1 -1
- package/dist/components/railbar/docs.props.js +4 -4
- package/dist/components/railbar/props.d.ts +3 -3
- package/dist/components/select/QSelect.svelte +121 -88
- package/dist/components/select/QSelect.svelte.d.ts +2 -34
- package/dist/components/select/docs.d.ts +1 -1
- package/dist/components/select/docs.js +8 -1
- package/dist/components/select/docs.props.js +41 -1
- package/dist/components/select/index.scss +8 -6
- package/dist/components/select/props.d.ts +6 -12
- package/dist/components/select/props.js +1 -12
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +38 -45
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.d.ts +1 -1
- package/dist/components/separator/docs.js +1 -1
- package/dist/components/separator/docs.props.js +4 -4
- package/dist/components/separator/props.d.ts +5 -7
- package/dist/components/separator/props.js +1 -9
- package/dist/components/switch/QSwitch.scss +305 -0
- package/dist/components/switch/QSwitch.svelte +96 -0
- package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
- package/dist/components/{toggle → switch}/docs.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.props.js +30 -6
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -85
- package/dist/components/table/QTable.svelte.d.ts +3 -29
- package/dist/components/table/docs.d.ts +1 -1
- package/dist/components/table/docs.js +1 -1
- package/dist/components/table/docs.props.js +9 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +10 -0
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +75 -96
- package/dist/components/tabs/QTab.svelte.d.ts +2 -25
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +107 -59
- package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
- package/dist/components/tabs/docs.d.ts +1 -1
- package/dist/components/tabs/docs.js +1 -1
- package/dist/components/tabs/docs.props.js +3 -3
- package/dist/components/tabs/index.scss +4 -2
- package/dist/components/tabs/props.d.ts +5 -4
- package/dist/components/tabs/props.js +1 -1
- package/dist/components/toolbar/QToolbar.svelte +15 -12
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
- package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
- package/dist/components/toolbar/docs.d.ts +1 -1
- package/dist/components/toolbar/docs.js +1 -1
- package/dist/components/toolbar/docs.props.js +4 -4
- package/dist/components/toolbar/index.scss +12 -14
- package/dist/components/toolbar/props.d.ts +4 -5
- package/dist/components/tooltip/QTooltip.svelte +5 -9
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.d.ts +1 -1
- package/dist/components/tooltip/docs.js +1 -1
- package/dist/components/tooltip/docs.props.js +1 -1
- package/dist/components/tooltip/index.scss +3 -1
- package/dist/components/tooltip/props.d.ts +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +3 -3
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/composables/{use-size.d.ts → useSizeLegacy.d.ts} +2 -2
- package/dist/composables/{use-size.js → useSizeLegacy.js} +5 -5
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/{ripple.scss → _ripple.scss} +1 -1
- package/dist/css/_variables.scss +73 -0
- package/dist/css/classes/_design.scss +57 -0
- package/dist/css/classes/_flex.scss +62 -0
- package/dist/css/classes/_grid.scss +35 -0
- package/dist/css/classes/_index.scss +7 -0
- package/dist/css/classes/_overflow.scss +7 -0
- package/dist/css/classes/_position.scss +7 -0
- package/dist/css/classes/_select.scss +6 -0
- package/dist/css/classes/_spaces.scss +23 -0
- package/dist/css/fonts.scss +16 -3
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +15 -94
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
- package/dist/css/mixins/_image.scss +63 -0
- package/dist/css/mixins/_index.scss +9 -0
- package/dist/css/mixins/_layout.scss +20 -0
- package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
- package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
- package/dist/css/mixins/_spaces.scss +36 -0
- package/dist/css/mixins/_typography.scss +7 -0
- package/dist/css/shared/q-field.scss +62 -32
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/page.scss +3 -3
- package/dist/css/theme/reset.scss +17 -1
- package/dist/css/theme/theme.scss +2 -3
- package/dist/css/theme/tokens.scss +0 -159
- package/dist/global.d.ts +1 -1
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/ripple.d.ts +1 -1
- package/dist/helpers/ripple.js +14 -5
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.js +1 -2
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +103 -15
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +10 -4
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +2 -2
- package/dist/utils/props.js +8 -6
- package/dist/utils/router.d.ts +17 -0
- package/dist/utils/router.js +23 -0
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +4 -1
- package/dist/utils/types.d.ts +7 -2
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +8 -5
- package/dist/utils/watchable.d.ts +0 -1
- package/dist/utils/watchable.js +1 -1
- package/package.json +42 -39
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -98
- package/dist/components/card/index.scss +0 -56
- package/dist/components/chip/index.scss +0 -103
- package/dist/components/drawer/index.scss +0 -59
- package/dist/components/footer/index.scss +0 -28
- package/dist/components/layout/index.scss +0 -387
- package/dist/components/list/index.scss +0 -144
- package/dist/components/progress/index.scss +0 -82
- package/dist/components/railbar/index.scss +0 -39
- package/dist/components/separator/index.scss +0 -52
- package/dist/components/toggle/QToggle.svelte +0 -34
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/index.scss +0 -31
- package/dist/components/toggle/props.d.ts +0 -9
- package/dist/components/toggle/props.js +0 -9
- package/dist/css/grid.scss +0 -50
- package/dist/css/mixins.scss +0 -137
- package/dist/css/states.scss +0 -75
- package/dist/css/theme/bridge.scss +0 -15
- package/dist/css/theme/theme.dark.scss +0 -39
- package/dist/css/theme/theme.light.scss +0 -39
- package/dist/css/variables-sass.scss +0 -16
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -60
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -58
- /package/dist/composables/{use-align.d.ts → useAlign.d.ts} +0 -0
- /package/dist/composables/{use-align.js → useAlign.js} +0 -0
- /package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +0 -0
- /package/dist/composables/{use-router-link.js → useRouterLink.js} +0 -0
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { QCodeBlock, QDialog } from "../..";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let dialog = false;
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { QCodeBlock, QDialog, QBtn } from "../..";
|
|
3
|
+
let { title, snippet, children } = $props();
|
|
4
|
+
let dialog = $state(false);
|
|
5
|
+
const code = $derived(snippet?.replaceAll(/^ {2}/gm, ""));
|
|
7
6
|
</script>
|
|
8
7
|
|
|
9
8
|
<div style="margin-bottom:48px">
|
|
10
9
|
<div class="flex justify-between q-mb-md">
|
|
11
10
|
<h5>{title}</h5>
|
|
12
|
-
{#if
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
>
|
|
20
|
-
<QCodeBlock code
|
|
11
|
+
{#if code}
|
|
12
|
+
<QBtn
|
|
13
|
+
icon="code"
|
|
14
|
+
design="outlined"
|
|
15
|
+
round
|
|
16
|
+
onclick={() => (dialog = true)}
|
|
17
|
+
/>
|
|
18
|
+
<QDialog class="snippet-dialog" bind:value={dialog} modal>
|
|
19
|
+
<QCodeBlock {code} language="svelte" {title} copiable />
|
|
21
20
|
</QDialog>
|
|
22
21
|
{/if}
|
|
23
22
|
</div>
|
|
24
|
-
|
|
23
|
+
{@render children?.()}
|
|
25
24
|
</div>
|
|
26
|
-
|
|
27
|
-
<style>
|
|
28
|
-
pre {
|
|
29
|
-
max-height: 400px;
|
|
30
|
-
}
|
|
31
|
-
</style>
|
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
}, {
|
|
10
|
-
default: {};
|
|
11
|
-
}> {
|
|
12
|
-
}
|
|
13
|
-
export type QDocsSectionProps = typeof __propDef.props;
|
|
14
|
-
export type QDocsSectionEvents = typeof __propDef.events;
|
|
15
|
-
export type QDocsSectionSlots = typeof __propDef.slots;
|
|
16
|
-
import { SvelteComponent } from "svelte";
|
|
17
|
-
declare const __propDef: {
|
|
18
|
-
props: {
|
|
19
|
-
title: any;
|
|
20
|
-
snippets: any;
|
|
21
|
-
};
|
|
22
|
-
events: {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export {};
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
declare const QDocsSection: import("svelte").Component<{
|
|
3
|
+
title: string;
|
|
4
|
+
snippet?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}, {}, "">;
|
|
7
|
+
export default QDocsSection;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
<script lang="ts">
|
|
3
|
+
import QIcon from "../icon/QIcon.svelte";
|
|
4
|
+
let { icon, defaultIcon, ...props } = $props();
|
|
5
|
+
const iconToUse = $derived(icon ?? defaultIcon);
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if typeof iconToUse === "string"}
|
|
9
|
+
<QIcon name={iconToUse} {...props} />
|
|
10
|
+
{:else}
|
|
11
|
+
{@render iconToUse?.()}
|
|
12
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { QIconProps } from "../icon/props";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
4
|
+
declare const QIconSnippet: import("svelte").Component<Omit<QIconProps, "name"> & {
|
|
5
|
+
icon?: MaterialSymbol | Snippet;
|
|
6
|
+
defaultIcon?: MaterialSymbol | Snippet;
|
|
7
|
+
}, {}, "">;
|
|
8
|
+
export default QIconSnippet;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
|
|
3
|
+
.q-circular-progress {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
|
|
8
|
+
height: 1em;
|
|
9
|
+
width: 1em;
|
|
10
|
+
font-size: var(--size);
|
|
11
|
+
line-height: 0;
|
|
12
|
+
|
|
13
|
+
&__svg {
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--indeterminate {
|
|
19
|
+
& .q-circular-progress__svg {
|
|
20
|
+
transform-origin: 50% 50%;
|
|
21
|
+
animation: q-spin 2s linear infinite;
|
|
22
|
+
|
|
23
|
+
& .q-circular-progress__indicator {
|
|
24
|
+
stroke-dasharray: 1400;
|
|
25
|
+
stroke-dashoffset: 0;
|
|
26
|
+
animation: q-load 1.5s ease-in-out infinite;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes q-spin {
|
|
33
|
+
0% {
|
|
34
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
35
|
+
}
|
|
36
|
+
25% {
|
|
37
|
+
transform: rotate3d(0, 0, 1, 90deg);
|
|
38
|
+
}
|
|
39
|
+
50% {
|
|
40
|
+
transform: rotate3d(0, 0, 1, 180deg);
|
|
41
|
+
}
|
|
42
|
+
75% {
|
|
43
|
+
transform: rotate3d(0, 0, 1, 270deg);
|
|
44
|
+
}
|
|
45
|
+
100% {
|
|
46
|
+
transform: rotate3d(0, 0, 1, 359deg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes q-load {
|
|
51
|
+
0% {
|
|
52
|
+
stroke-dasharray: 1, 400;
|
|
53
|
+
stroke-dashoffset: 0;
|
|
54
|
+
}
|
|
55
|
+
50% {
|
|
56
|
+
stroke-dasharray: 400, 400;
|
|
57
|
+
stroke-dashoffset: -100;
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
stroke-dasharray: 400, 400;
|
|
61
|
+
stroke-dashoffset: -300;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,36 +1,112 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { useSize } from "../../composables/useSize";
|
|
5
|
+
import { between } from "../../utils/number";
|
|
6
|
+
const radius = 50,
|
|
7
|
+
diameter = 2 * radius,
|
|
8
|
+
circumference = diameter * Math.PI,
|
|
9
|
+
strokeDashArray = Math.round(circumference * 1e3) / 1e3;
|
|
10
|
+
let {
|
|
11
|
+
value = 0,
|
|
12
|
+
indeterminate = false,
|
|
13
|
+
size = "2em",
|
|
14
|
+
fontSize = "0.25em",
|
|
15
|
+
color = "primary",
|
|
16
|
+
trackColor = "secondary-container",
|
|
17
|
+
thickness = 0.2,
|
|
18
|
+
min = 0,
|
|
19
|
+
max = 100,
|
|
20
|
+
angle = 0,
|
|
21
|
+
noRound = false,
|
|
22
|
+
instantFeedback = false,
|
|
23
|
+
animationSpeed = 600,
|
|
24
|
+
showValue = false,
|
|
25
|
+
children = fallback,
|
|
26
|
+
...props
|
|
27
|
+
} = $props();
|
|
28
|
+
const qSize = $derived(useSize(size, "q-circular-progress"));
|
|
29
|
+
const svgStyle = $derived(`rotate3d(0, 0, 1, ${angle - 90}deg)`);
|
|
30
|
+
const circleStyle = $derived(
|
|
31
|
+
instantFeedback || indeterminate
|
|
32
|
+
? void 0
|
|
33
|
+
: `stroke-dashoffset ${animationSpeed}ms ease 0s, stroke ${animationSpeed}ms ease`,
|
|
34
|
+
);
|
|
35
|
+
const viewBox = $derived(diameter / (1 - thickness / 2));
|
|
36
|
+
const viewBoxAttr = $derived(
|
|
37
|
+
`${viewBox / 2} ${viewBox / 2} ${viewBox} ${viewBox}`,
|
|
38
|
+
);
|
|
39
|
+
const normalized = $derived(between(value, min, max));
|
|
40
|
+
const range = $derived(max - min);
|
|
41
|
+
const strokeWidth = $derived((thickness / 2) * viewBox);
|
|
42
|
+
const strokeDashOffset = $derived.by(() => {
|
|
43
|
+
const dashRatio = (max - normalized) / range;
|
|
44
|
+
const dashGap =
|
|
45
|
+
!noRound && normalized < max && dashRatio < 0.25
|
|
46
|
+
? (strokeWidth / 2) * (1 - dashRatio / 0.25)
|
|
47
|
+
: 0;
|
|
48
|
+
return circumference * dashRatio + dashGap;
|
|
49
|
+
});
|
|
9
50
|
</script>
|
|
10
51
|
|
|
11
|
-
<
|
|
12
|
-
|
|
52
|
+
<div
|
|
53
|
+
{...props}
|
|
54
|
+
class="q-circular-progress{props.class ? ` ${props.class}` : ''}"
|
|
13
55
|
class:q-circular-progress--indeterminate={indeterminate}
|
|
14
|
-
|
|
15
|
-
width={spinnerSize.style}
|
|
16
|
-
viewBox="25 25 50 50"
|
|
17
|
-
style="transform: rotate3d(0, 0, 1, -90deg);"
|
|
56
|
+
style:--size={qSize.style}
|
|
18
57
|
role="progressbar"
|
|
19
|
-
aria-
|
|
20
|
-
aria-
|
|
21
|
-
aria-
|
|
22
|
-
{...$$restProps}
|
|
58
|
+
aria-valuemin={min}
|
|
59
|
+
aria-valuemax={max}
|
|
60
|
+
aria-valuenow={indeterminate ? undefined : normalized}
|
|
23
61
|
>
|
|
62
|
+
<svg
|
|
63
|
+
class="q-circular-progress__svg"
|
|
64
|
+
style:transform={svgStyle}
|
|
65
|
+
viewBox={viewBoxAttr}
|
|
66
|
+
aria-hidden="true"
|
|
67
|
+
>
|
|
68
|
+
{#if trackColor && trackColor !== "transparent"}
|
|
69
|
+
{@render circle({
|
|
70
|
+
cls: "track",
|
|
71
|
+
offset: 0,
|
|
72
|
+
color: trackColor,
|
|
73
|
+
})}
|
|
74
|
+
{/if}
|
|
75
|
+
|
|
76
|
+
{@render circle({
|
|
77
|
+
cls: "indicator",
|
|
78
|
+
offset: strokeDashOffset,
|
|
79
|
+
color,
|
|
80
|
+
rounded: !noRound,
|
|
81
|
+
})}
|
|
82
|
+
</svg>
|
|
83
|
+
|
|
84
|
+
{#if showValue}
|
|
85
|
+
<div
|
|
86
|
+
class="q-circular-progress__text absolute-full flex flex-center"
|
|
87
|
+
style:font-size={fontSize}
|
|
88
|
+
>
|
|
89
|
+
{@render children()}
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
{#snippet fallback()}
|
|
95
|
+
<div>{Math.round(normalized)}</div>
|
|
96
|
+
{/snippet}
|
|
97
|
+
|
|
98
|
+
{#snippet circle({ offset, color, cls, rounded }: CircleParams)}
|
|
24
99
|
<circle
|
|
25
|
-
class="q-circular-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
r="20"
|
|
29
|
-
fill="none"
|
|
100
|
+
class="q-circular-progress__{cls}{color ? ` text-${color}` : ''}"
|
|
101
|
+
style:transition={circleStyle}
|
|
102
|
+
fill="transparent"
|
|
30
103
|
stroke="currentColor"
|
|
31
|
-
stroke-width={
|
|
32
|
-
stroke-
|
|
33
|
-
stroke-
|
|
34
|
-
stroke-
|
|
104
|
+
stroke-width={strokeWidth}
|
|
105
|
+
stroke-dasharray={strokeDashArray}
|
|
106
|
+
stroke-dashoffset={offset}
|
|
107
|
+
stroke-linecap={rounded ? "round" : undefined}
|
|
108
|
+
cx={viewBox}
|
|
109
|
+
cy={viewBox}
|
|
110
|
+
r={radius}
|
|
35
111
|
/>
|
|
36
|
-
|
|
112
|
+
{/snippet}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QCircularProgressProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
value?: number | undefined;
|
|
7
|
-
indeterminate?: QCircularProgressProps["indeterminate"];
|
|
8
|
-
size?: QCircularProgressProps["size"];
|
|
9
|
-
color?: QCircularProgressProps["color"];
|
|
10
|
-
thickness?: QCircularProgressProps["thickness"];
|
|
11
|
-
class?: string | null | undefined;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {};
|
|
17
|
-
};
|
|
18
|
-
type QCircularProgressProps_ = typeof __propDef.props;
|
|
19
|
-
export { QCircularProgressProps_ as QCircularProgressProps };
|
|
20
|
-
export type QCircularProgressEvents = typeof __propDef.events;
|
|
21
|
-
export type QCircularProgressSlots = typeof __propDef.slots;
|
|
22
|
-
export default class QCircularProgress extends SvelteComponent<QCircularProgressProps, QCircularProgressEvents, QCircularProgressSlots> {
|
|
23
|
-
}
|
|
2
|
+
declare const QCircularProgress: import("svelte").Component<QCircularProgressProps, {}, "">;
|
|
3
|
+
export default QCircularProgress;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
|
|
3
|
+
.q-linear-progress {
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
flex-grow: 1;
|
|
7
|
+
height: 0.75em;
|
|
8
|
+
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
|
+
transform: scale3d(1, 1, 1);
|
|
12
|
+
|
|
13
|
+
&__indicator {
|
|
14
|
+
background-color: var(--q-indicator-color);
|
|
15
|
+
height: 100%;
|
|
16
|
+
|
|
17
|
+
&--indeterminate {
|
|
18
|
+
transition: none;
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
|
|
21
|
+
&::before,
|
|
22
|
+
&::after {
|
|
23
|
+
content: "";
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
|
|
30
|
+
background-color: var(--q-indicator-color);
|
|
31
|
+
transform-origin: 0 0;
|
|
32
|
+
border-radius: inherit;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&::before {
|
|
36
|
+
animation: q-progress 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&::after {
|
|
40
|
+
transform: translate3d(-101%, 0, 0) scale3d(1, 1, 1);
|
|
41
|
+
animation: q-progress-fast 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
|
42
|
+
animation-delay: 1.15s;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__track {
|
|
48
|
+
opacity: 0.4;
|
|
49
|
+
height: 100%;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes q-progress {
|
|
54
|
+
0% {
|
|
55
|
+
transform: translate3d(-35%, 0, 0) scale3d(0.35, 1, 1);
|
|
56
|
+
}
|
|
57
|
+
60% {
|
|
58
|
+
transform: translate3d(100%, 0, 0) scale3d(0.9, 1, 1);
|
|
59
|
+
}
|
|
60
|
+
100% {
|
|
61
|
+
transform: translate3d(100%, 0, 0) scale3d(0.9, 1, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes q-progress-fast {
|
|
66
|
+
0% {
|
|
67
|
+
transform: translate3d(-101%, 0, 0) scale3d(1, 1, 1);
|
|
68
|
+
}
|
|
69
|
+
60% {
|
|
70
|
+
transform: translate3d(107%, 0, 0) scale3d(0.01, 1, 1);
|
|
71
|
+
}
|
|
72
|
+
100% {
|
|
73
|
+
transform: translate3d(107%, 0, 0) scale3d(0.01, 1, 1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,20 +1,62 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { useSize } from "../../composables/useSize";
|
|
5
|
+
function width(val, reverse2) {
|
|
6
|
+
return reverse2
|
|
7
|
+
? `translateX(100%) scale3d(-${val}, 1, 1)`
|
|
8
|
+
: `scale3d(${val}, 1, 1)`;
|
|
9
|
+
}
|
|
10
|
+
let {
|
|
11
|
+
value = 0,
|
|
12
|
+
buffer,
|
|
13
|
+
reverse = false,
|
|
14
|
+
noRound = false,
|
|
15
|
+
size = "0.375em",
|
|
16
|
+
color = "primary",
|
|
17
|
+
animationSpeed = 600,
|
|
18
|
+
instantFeedback = false,
|
|
19
|
+
trackColor = "secondary-container",
|
|
20
|
+
indeterminate = false,
|
|
21
|
+
...props
|
|
22
|
+
} = $props();
|
|
23
|
+
const normalized = $derived(value > 1 ? value / 100 : value);
|
|
24
|
+
const qSize = $derived(useSize(size, "q-linear-progress"));
|
|
25
|
+
const radius = $derived(noRound ? "0" : "0.75rem");
|
|
26
|
+
const origin = $derived(reverse ? "0 100%" : "0 0");
|
|
27
|
+
const transition = $derived(
|
|
28
|
+
instantFeedback || indeterminate ? void 0 : `transform ${animationSpeed}ms`,
|
|
29
|
+
);
|
|
30
|
+
const trackTransform = $derived(width(buffer ?? 1, reverse));
|
|
31
|
+
const indicatorTransform = $derived(
|
|
32
|
+
width(+indeterminate || normalized, reverse),
|
|
33
|
+
);
|
|
3
34
|
</script>
|
|
4
35
|
|
|
5
36
|
<div
|
|
6
|
-
|
|
7
|
-
class
|
|
8
|
-
|
|
37
|
+
{...props}
|
|
38
|
+
class="q-linear-progress{props.class ? ` ${props.class}` : ''}"
|
|
39
|
+
style:font-size={qSize.style}
|
|
40
|
+
style:border-radius={radius}
|
|
9
41
|
role="progressbar"
|
|
10
|
-
aria-
|
|
11
|
-
aria-
|
|
12
|
-
aria-
|
|
13
|
-
{...$$restProps}
|
|
42
|
+
aria-valuemin="0"
|
|
43
|
+
aria-valuemax="100"
|
|
44
|
+
aria-valuenow={indeterminate ? undefined : normalized}
|
|
14
45
|
>
|
|
15
46
|
<div
|
|
16
|
-
class="q-linear-
|
|
17
|
-
|
|
18
|
-
style=
|
|
19
|
-
|
|
47
|
+
class="q-linear-progress__track absolute-full"
|
|
48
|
+
style:transition
|
|
49
|
+
style:transform-origin={origin}
|
|
50
|
+
style:background-color="var(--{trackColor}, {trackColor})"
|
|
51
|
+
style:transform={trackTransform}
|
|
52
|
+
></div>
|
|
53
|
+
|
|
54
|
+
<div
|
|
55
|
+
class="q-linear-progress__indicator"
|
|
56
|
+
class:q-linear-progress__indicator--indeterminate={indeterminate}
|
|
57
|
+
style:--q-indicator-color="var(--{color}, {color})"
|
|
58
|
+
style:transition
|
|
59
|
+
style:transform={indicatorTransform}
|
|
60
|
+
style:transform-origin={origin}
|
|
61
|
+
></div>
|
|
20
62
|
</div>
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QLinearProgressProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
value?: number | undefined;
|
|
7
|
-
from?: QLinearProgressProps["from"];
|
|
8
|
-
rounded?: QLinearProgressProps["rounded"];
|
|
9
|
-
class?: string | null | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
15
|
-
};
|
|
16
|
-
type QLinearProgressProps_ = typeof __propDef.props;
|
|
17
|
-
export { QLinearProgressProps_ as QLinearProgressProps };
|
|
18
|
-
export type QLinearProgressEvents = typeof __propDef.events;
|
|
19
|
-
export type QLinearProgressSlots = typeof __propDef.slots;
|
|
20
|
-
export default class QLinearProgress extends SvelteComponent<QLinearProgressProps, QLinearProgressEvents, QLinearProgressSlots> {
|
|
21
|
-
}
|
|
2
|
+
declare const QLinearProgress: import("svelte").Component<QLinearProgressProps, {}, "">;
|
|
3
|
+
export default QLinearProgress;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { QComponentDocs } from "../../utils";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const QProgressDocs: QComponentDocs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QLinearProgressDocsProps } from "./docs.props";
|
|
2
|
-
export
|
|
2
|
+
export const QProgressDocs = {
|
|
3
3
|
name: "QProgress",
|
|
4
4
|
description: "The QProgress component is used to display a progress bar, indicating the completion status of a task or process.",
|
|
5
5
|
docs: {
|