@quaffui/quaff 0.1.0-prealpha2 → 0.1.0-prealpha20
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 -41
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -26
- package/dist/components/avatar/docs.d.ts +2 -2
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/avatar/docs.props.js +22 -4
- package/dist/components/avatar/index.scss +6 -1
- package/dist/components/avatar/props.d.ts +25 -7
- package/dist/components/avatar/props.js +1 -1
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +23 -14
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +64 -48
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.d.ts +2 -2
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/breadcrumbs/docs.props.js +28 -26
- package/dist/components/breadcrumbs/props.d.ts +26 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +94 -41
- package/dist/components/button/QBtn.svelte.d.ts +2 -31
- package/dist/components/button/docs.d.ts +2 -2
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/docs.props.js +47 -13
- package/dist/components/button/props.d.ts +35 -13
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +27 -19
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +14 -15
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +11 -11
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.d.ts +4 -4
- package/dist/components/card/docs.js +3 -3
- package/dist/components/card/docs.props.js +9 -15
- package/dist/components/card/props.d.ts +11 -16
- package/dist/components/checkbox/QCheckbox.svelte +8 -9
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.d.ts +2 -2
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/checkbox/docs.props.js +2 -0
- package/dist/components/checkbox/index.scss +7 -1
- package/dist/components/checkbox/props.d.ts +2 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +98 -55
- package/dist/components/chip/QChip.svelte.d.ts +2 -34
- package/dist/components/chip/docs.d.ts +2 -2
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/chip/docs.props.js +28 -42
- package/dist/components/chip/props.d.ts +25 -32
- package/dist/components/codeBlock/QCodeBlock.svelte +64 -45
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -22
- package/dist/components/codeBlock/docs.props.js +11 -1
- package/dist/components/codeBlock/props.d.ts +8 -2
- package/dist/components/dialog/QDialog.scss +177 -0
- package/dist/components/dialog/QDialog.svelte +77 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.d.ts +2 -2
- 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 +4 -108
- package/dist/components/dialog/props.d.ts +3 -18
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +91 -81
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -38
- package/dist/components/drawer/docs.d.ts +2 -2
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/drawer/docs.props.js +4 -2
- package/dist/components/drawer/props.d.ts +4 -3
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +67 -12
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.d.ts +2 -2
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/footer/docs.props.js +13 -3
- package/dist/components/footer/props.d.ts +9 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +56 -0
- package/dist/components/header/QHeader.svelte.d.ts +3 -0
- package/dist/components/header/docs.props.d.ts +24 -0
- package/dist/components/header/docs.props.js +88 -0
- package/dist/components/header/props.d.ts +23 -0
- package/dist/components/header/props.js +1 -0
- package/dist/components/icon/QIcon.scss +73 -0
- package/dist/components/icon/QIcon.svelte +32 -30
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.d.ts +2 -2
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +11 -9
- package/dist/components/icon/props.d.ts +9 -8
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +5 -2
- package/dist/components/input/QInput.svelte +88 -72
- package/dist/components/input/QInput.svelte.d.ts +3 -32
- package/dist/components/input/docs.d.ts +2 -2
- package/dist/components/input/docs.js +2 -8
- package/dist/components/input/docs.props.js +39 -13
- package/dist/components/input/index.scss +1 -3
- package/dist/components/input/props.d.ts +13 -21
- package/dist/components/input/props.js +1 -13
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +101 -81
- package/dist/components/layout/QLayout.svelte.d.ts +17 -43
- package/dist/components/layout/docs.d.ts +2 -2
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/layout/docs.props.js +65 -7
- package/dist/components/layout/props.d.ts +18 -9
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +73 -51
- package/dist/components/list/QItem.svelte.d.ts +2 -33
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +50 -37
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +30 -20
- package/dist/components/list/QList.svelte.d.ts +2 -35
- package/dist/components/list/docs.d.ts +2 -0
- package/dist/components/list/docs.js +11 -0
- package/dist/components/list/docs.props.js +79 -29
- package/dist/components/list/props.d.ts +24 -20
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +6 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
- package/dist/components/private/QApi.svelte +117 -93
- package/dist/components/private/QApi.svelte.d.ts +5 -17
- package/dist/components/private/QDocs.svelte +78 -41
- package/dist/components/private/QDocs.svelte.d.ts +10 -21
- package/dist/components/private/QDocsSection.svelte +16 -24
- 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 +106 -20
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -21
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +59 -17
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -21
- package/dist/components/progress/docs.d.ts +2 -0
- package/dist/components/progress/docs.js +11 -0
- package/dist/components/progress/docs.props.d.ts +8 -0
- package/dist/components/progress/docs.props.js +181 -9
- package/dist/components/progress/props.d.ts +98 -17
- package/dist/components/progress/props.js +1 -7
- package/dist/components/radio/QRadio.svelte +14 -9
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.d.ts +2 -2
- package/dist/components/radio/docs.js +1 -1
- package/dist/components/radio/docs.props.js +6 -4
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +5 -6
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +45 -49
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.d.ts +2 -0
- package/dist/components/railbar/docs.js +11 -0
- package/dist/components/railbar/docs.props.js +10 -8
- package/dist/components/railbar/props.d.ts +15 -6
- package/dist/components/railbar/props.js +1 -7
- package/dist/components/select/QSelect.svelte +171 -140
- package/dist/components/select/QSelect.svelte.d.ts +2 -33
- package/dist/components/select/docs.d.ts +2 -2
- package/dist/components/select/docs.js +9 -8
- package/dist/components/select/docs.props.js +47 -13
- package/dist/components/select/index.scss +28 -7
- package/dist/components/select/props.d.ts +16 -20
- package/dist/components/select/props.js +1 -14
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +39 -57
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.d.ts +2 -0
- package/dist/components/separator/docs.js +11 -0
- package/dist/components/separator/docs.props.js +16 -14
- package/dist/components/separator/props.d.ts +13 -14
- 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/switch/docs.d.ts +2 -0
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/switch/docs.props.js +68 -0
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -94
- package/dist/components/table/QTable.svelte.d.ts +2 -28
- package/dist/components/table/docs.d.ts +2 -2
- package/dist/components/table/docs.js +1 -1
- package/dist/components/table/docs.props.js +11 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +14 -3
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +80 -66
- package/dist/components/tabs/QTab.svelte.d.ts +2 -27
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +114 -51
- package/dist/components/tabs/QTabs.svelte.d.ts +7 -22
- package/dist/components/tabs/docs.d.ts +2 -0
- package/dist/components/tabs/docs.js +11 -0
- package/dist/components/tabs/docs.props.js +10 -16
- package/dist/components/tabs/index.scss +71 -28
- package/dist/components/tabs/props.d.ts +9 -9
- package/dist/components/tabs/props.js +1 -13
- package/dist/components/toolbar/QToolbar.svelte +20 -37
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -22
- package/dist/components/toolbar/QToolbarTitle.svelte +11 -0
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +3 -0
- package/dist/components/toolbar/docs.d.ts +2 -0
- package/dist/components/toolbar/docs.js +11 -0
- package/dist/components/toolbar/docs.props.d.ts +8 -0
- package/dist/components/toolbar/docs.props.js +33 -5
- package/dist/components/toolbar/index.scss +34 -1
- package/dist/components/toolbar/props.d.ts +24 -5
- package/dist/components/toolbar/props.js +1 -6
- package/dist/components/tooltip/QTooltip.svelte +8 -12
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.d.ts +2 -0
- package/dist/components/tooltip/docs.js +11 -0
- package/dist/components/tooltip/docs.props.js +3 -1
- package/dist/components/tooltip/index.scss +80 -2
- package/dist/components/tooltip/props.d.ts +4 -3
- package/dist/components/tooltip/props.js +1 -1
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.js +3 -1
- package/dist/composables/{use-align.d.ts → useAlign.d.ts} +1 -1
- package/dist/composables/useAlign.js +23 -0
- package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +3 -3
- package/dist/composables/{use-router-link.js → useRouterLink.js} +4 -5
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/composables/useSizeLegacy.d.ts +9 -0
- package/dist/composables/useSizeLegacy.js +25 -0
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/_ripple.scss +49 -0
- 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/flex.scss +41 -0
- package/dist/css/fonts.scss +17 -0
- package/dist/css/index.css +1 -0
- package/dist/css/index.scss +15 -111
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/_field.scss +64 -0
- 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} +6 -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 +348 -0
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/colors.module.scss +261 -109
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/elevate.scss +57 -0
- package/dist/css/theme/page.scss +16 -0
- package/dist/css/theme/palette.scss +653 -0
- package/dist/css/theme/reset.scss +56 -0
- package/dist/css/theme/theme.scss +7 -2
- package/dist/css/theme/tokens.scss +0 -159
- package/dist/css/theme/typography.scss +111 -0
- package/dist/global.d.ts +1 -2
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/ripple.d.ts +11 -0
- package/dist/helpers/ripple.js +90 -0
- package/dist/helpers/version.d.ts +2 -0
- package/dist/helpers/version.js +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/stores/index.d.ts +0 -0
- package/dist/stores/index.js +1 -0
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.js +3 -4
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +103 -15
- package/dist/utils/dom.d.ts +11 -0
- package/dist/utils/dom.js +81 -0
- package/dist/utils/events.d.ts +13 -0
- package/dist/utils/events.js +13 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -1
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +4 -4
- package/dist/utils/props.js +9 -7
- 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 +12 -4
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +27 -1
- package/dist/utils/watchable.d.ts +0 -1
- package/dist/utils/watchable.js +1 -1
- package/package.json +45 -37
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -78
- package/dist/components/card/index.scss +0 -53
- package/dist/components/chip/index.scss +0 -83
- package/dist/components/dialog/index.scss +0 -27
- package/dist/components/drawer/index.scss +0 -54
- package/dist/components/footer/index.scss +0 -5
- package/dist/components/icon/index.scss +0 -18
- package/dist/components/layout/index.scss +0 -370
- package/dist/components/list/index.scss +0 -114
- package/dist/components/progress/index.scss +0 -50
- package/dist/components/toggle/QToggle.svelte +0 -35
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/docs.d.ts +0 -2
- package/dist/components/toggle/docs.props.js +0 -42
- 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/composables/use-align.js +0 -12
- package/dist/composables/use-index.d.ts +0 -2
- package/dist/composables/use-index.js +0 -17
- package/dist/composables/use-size.d.ts +0 -11
- package/dist/composables/use-size.js +0 -13
- package/dist/css/grid.scss +0 -65
- package/dist/css/mixins/field.scss +0 -430
- package/dist/css/mixins.scss +0 -135
- package/dist/css/states.scss +0 -70
- package/dist/css/theme/theme.dark.scss +0 -36
- package/dist/css/theme/theme.light.scss +0 -36
- package/dist/helpers/activationHandler.d.ts +0 -9
- package/dist/helpers/activationHandler.js +0 -23
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -53
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -52
- package/dist/utils/fields.d.ts +0 -1
- package/dist/utils/fields.js +0 -14
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
|
@@ -1,55 +1,118 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
<script context="module" lang="ts"></script>
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { setContext, untrack } from "svelte";
|
|
5
|
+
import QContext from "../../classes/QContext.svelte";
|
|
6
|
+
import { shouldReduceMotion } from "../../utils/dom";
|
|
7
|
+
let {
|
|
8
|
+
value = $bindable(),
|
|
9
|
+
variant = "primary",
|
|
10
|
+
round = false,
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
} = $props();
|
|
14
|
+
let qTabs;
|
|
15
|
+
let tabList;
|
|
16
|
+
const valueContext = new QContext("QTabsValue", value);
|
|
17
|
+
const requestContext = new QContext("QTabsRequest", null);
|
|
18
|
+
setContext("QTabsVariant", variant);
|
|
19
|
+
$effect(() => {
|
|
20
|
+
tabList = Array.from(qTabs.querySelectorAll(".q-tab"));
|
|
21
|
+
});
|
|
22
|
+
$effect(() => {
|
|
23
|
+
if (!value) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
untrack(() => {
|
|
27
|
+
const newTab = getResquetingTab(value);
|
|
28
|
+
animateIndicator(newTab);
|
|
29
|
+
valueContext.update(value);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
$effect(() => {
|
|
33
|
+
const request = requestContext.value;
|
|
34
|
+
if (!request) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const defaultPrevented = !dispatchEvent(
|
|
38
|
+
new Event("change", { bubbles: true, cancelable: true }),
|
|
39
|
+
);
|
|
40
|
+
const requester = getResquetingTab(request);
|
|
41
|
+
if (defaultPrevented || !requester) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
untrack(() => {
|
|
45
|
+
value = request;
|
|
46
|
+
});
|
|
24
47
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
function getResquetingTab(requestingTabName) {
|
|
49
|
+
return (
|
|
50
|
+
tabList.find(
|
|
51
|
+
(tab) => tab.getAttribute("aria-label") === requestingTabName,
|
|
52
|
+
) ?? null
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function getActiveTab() {
|
|
56
|
+
return (
|
|
57
|
+
tabList.find((tab) => tab.getAttribute("aria-current") === "true") ?? null
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
function animateIndicator(newTab) {
|
|
61
|
+
const qIndicator = newTab?.querySelector(".q-tab__indicator");
|
|
62
|
+
if (!qIndicator) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const previousTab = getActiveTab();
|
|
66
|
+
qIndicator.getAnimations().forEach((animation) => animation.cancel());
|
|
67
|
+
const frames = getKeyframes(previousTab, newTab);
|
|
68
|
+
if (frames) {
|
|
69
|
+
qIndicator.animate(frames, {
|
|
70
|
+
duration: 600,
|
|
71
|
+
easing: "cubic-bezier(.18,.77,0,1)",
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function getKeyframes(oldTab, newTab) {
|
|
76
|
+
const reduceMotion = shouldReduceMotion();
|
|
77
|
+
if (!oldTab) {
|
|
78
|
+
return reduceMotion ? [{ opacity: 1 }, { transform: "none" }] : null;
|
|
79
|
+
}
|
|
80
|
+
const previousEl =
|
|
81
|
+
variant === "primary" ? oldTab?.querySelector(".q-tab__content") : oldTab;
|
|
82
|
+
const activeEl =
|
|
83
|
+
variant === "primary" ? newTab?.querySelector(".q-tab__content") : newTab;
|
|
84
|
+
const pos = variant === "vertical" ? "top" : "left";
|
|
85
|
+
const extent = variant === "vertical" ? "height" : "width";
|
|
86
|
+
const axis = variant === "vertical" ? "Y" : "X";
|
|
87
|
+
const fromRect = previousEl?.getBoundingClientRect() ?? {};
|
|
88
|
+
const fromPos = fromRect[pos];
|
|
89
|
+
const fromExtent = fromRect[extent];
|
|
90
|
+
const toRect = activeEl?.getBoundingClientRect() ?? {};
|
|
91
|
+
const toPos = toRect[pos];
|
|
92
|
+
const toExtent = toRect[extent];
|
|
93
|
+
const scale = fromExtent / toExtent;
|
|
94
|
+
const keyframe = {};
|
|
95
|
+
if (
|
|
96
|
+
!reduceMotion &&
|
|
97
|
+
fromPos !== void 0 &&
|
|
98
|
+
toPos !== void 0 &&
|
|
99
|
+
!isNaN(scale)
|
|
100
|
+
) {
|
|
101
|
+
const translateAnimation = (fromPos - toPos).toFixed(4);
|
|
102
|
+
const scaleAnimation = scale.toFixed(4);
|
|
103
|
+
keyframe.transform = `translate${axis}(${translateAnimation}px) scale${axis}(${scaleAnimation})`;
|
|
104
|
+
} else {
|
|
105
|
+
keyframe.opacity = 0;
|
|
106
|
+
}
|
|
107
|
+
return [keyframe, { transform: "none" }];
|
|
108
|
+
}
|
|
51
109
|
</script>
|
|
52
110
|
|
|
53
|
-
<nav
|
|
54
|
-
|
|
111
|
+
<nav
|
|
112
|
+
{...props}
|
|
113
|
+
bind:this={qTabs}
|
|
114
|
+
class="q-tabs{props.class ? ` ${props.class}` : ''} q-tabs--{variant}"
|
|
115
|
+
class:q-tabs--rounded={round}
|
|
116
|
+
>
|
|
117
|
+
{@render children?.()}
|
|
55
118
|
</nav>
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value?: QTabsProps["value"];
|
|
6
|
-
variant?: import("./props").QTabsVariants | undefined;
|
|
7
|
-
round?: boolean | undefined;
|
|
8
|
-
class?: string | undefined;
|
|
9
|
-
style?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
};
|
|
1
|
+
export type QTabEl = HTMLAnchorElement | HTMLButtonElement;
|
|
2
|
+
export type QTabsElementsContext = {
|
|
3
|
+
previous: QTabEl | null;
|
|
4
|
+
active: QTabEl | null;
|
|
17
5
|
};
|
|
18
|
-
type
|
|
19
|
-
|
|
20
|
-
export
|
|
21
|
-
export type QTabsSlots = typeof __propDef.slots;
|
|
22
|
-
export default class QTabs extends SvelteComponent<QTabsProps, QTabsEvents, QTabsSlots> {
|
|
23
|
-
}
|
|
6
|
+
import type { QTabsProps } from "./props";
|
|
7
|
+
declare const QTabs: import("svelte").Component<QTabsProps, {}, "value">;
|
|
8
|
+
export default QTabs;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QTabsDocsProps } from "./docs.props";
|
|
2
|
+
export const QTabsDocs = {
|
|
3
|
+
name: "QTabs",
|
|
4
|
+
description: "Tabs allow creating navigational tabs, enabling users to switch between different views or functional aspects.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QTabsDocsProps,
|
|
7
|
+
slots: [],
|
|
8
|
+
methods: [],
|
|
9
|
+
events: [],
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
+
// @quaffHash 34e1efd974e8b37c46e10e23636ef284
|
|
1
3
|
export const QTabsDocsProps = [
|
|
2
4
|
{
|
|
3
5
|
name: "value",
|
|
@@ -8,25 +10,17 @@ export const QTabsDocsProps = [
|
|
|
8
10
|
default: "",
|
|
9
11
|
},
|
|
10
12
|
{
|
|
11
|
-
name: "
|
|
12
|
-
type: "
|
|
13
|
-
optional:
|
|
14
|
-
clickableType:
|
|
13
|
+
name: "variant",
|
|
14
|
+
type: "QTabsVariants",
|
|
15
|
+
optional: true,
|
|
16
|
+
clickableType: true,
|
|
15
17
|
description: "",
|
|
16
18
|
default: "",
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
21
|
name: "round",
|
|
20
22
|
type: "boolean",
|
|
21
|
-
optional:
|
|
22
|
-
clickableType: false,
|
|
23
|
-
description: "",
|
|
24
|
-
default: "",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "smallIndicator",
|
|
28
|
-
type: "boolean",
|
|
29
|
-
optional: false,
|
|
23
|
+
optional: true,
|
|
30
24
|
clickableType: false,
|
|
31
25
|
description: "",
|
|
32
26
|
default: "",
|
|
@@ -36,7 +30,7 @@ export const QTabDocsProps = [
|
|
|
36
30
|
{
|
|
37
31
|
name: "name",
|
|
38
32
|
type: "string",
|
|
39
|
-
optional:
|
|
33
|
+
optional: false,
|
|
40
34
|
clickableType: false,
|
|
41
35
|
description: "",
|
|
42
36
|
default: "",
|
|
@@ -51,9 +45,9 @@ export const QTabDocsProps = [
|
|
|
51
45
|
},
|
|
52
46
|
{
|
|
53
47
|
name: "icon",
|
|
54
|
-
type: "
|
|
48
|
+
type: "MaterialSymbol | Snippet",
|
|
55
49
|
optional: true,
|
|
56
|
-
clickableType:
|
|
50
|
+
clickableType: true,
|
|
57
51
|
description: "",
|
|
58
52
|
default: "",
|
|
59
53
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
|
|
1
3
|
.q-tabs {
|
|
2
4
|
position: relative;
|
|
3
5
|
display: flex;
|
|
@@ -6,70 +8,111 @@
|
|
|
6
8
|
max-width: 100%;
|
|
7
9
|
overflow: auto;
|
|
8
10
|
scroll-behavior: smooth;
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
border-bottom: solid 0.0625rem var(--outline-4);
|
|
9
13
|
&::-webkit-scrollbar {
|
|
10
14
|
display: none;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
& > .q-tab {
|
|
18
|
+
position: relative;
|
|
14
19
|
box-sizing: border-box;
|
|
15
|
-
height:
|
|
20
|
+
min-height: 3rem;
|
|
16
21
|
min-width: max-content;
|
|
17
22
|
display: flex;
|
|
18
23
|
align-items: center;
|
|
19
24
|
justify-content: center;
|
|
20
25
|
flex: 1;
|
|
21
|
-
background-color:
|
|
26
|
+
background-color: var(--surface);
|
|
27
|
+
color: var(--on-surface);
|
|
22
28
|
border-radius: 0;
|
|
23
29
|
gap: 0;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
@include mixins.padding("x-md");
|
|
32
|
+
|
|
33
|
+
& .q-tab__icon {
|
|
34
|
+
margin-right: 0.25rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--active {
|
|
38
|
+
color: var(--primary);
|
|
39
|
+
}
|
|
24
40
|
|
|
25
|
-
|
|
26
|
-
|
|
41
|
+
&:is(:hover, :focus):not([aria-disabled])::after {
|
|
42
|
+
content: "";
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
background-color: var(--on-surface);
|
|
49
|
+
border-radius: none;
|
|
50
|
+
overflow: hidden;
|
|
27
51
|
}
|
|
28
52
|
|
|
29
|
-
&:
|
|
30
|
-
|
|
53
|
+
&:hover:not([aria-disabled])::after {
|
|
54
|
+
opacity: 0.08;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:focus:not([aria-disabled])::after {
|
|
58
|
+
opacity: 0.16;
|
|
31
59
|
}
|
|
32
60
|
}
|
|
33
61
|
|
|
34
|
-
&.
|
|
62
|
+
&.q-tabs--vertical {
|
|
35
63
|
flex-direction: column;
|
|
36
|
-
min-height: calc(var(--tab-count) * 48px);
|
|
37
64
|
width: fit-content;
|
|
38
65
|
align-items: stretch;
|
|
66
|
+
border-bottom: unset;
|
|
67
|
+
border-right: solid 0.0625rem var(--outline-4);
|
|
68
|
+
|
|
69
|
+
& > .q-tab {
|
|
70
|
+
@include mixins.padding("x-md");
|
|
71
|
+
}
|
|
39
72
|
|
|
40
73
|
&::after {
|
|
41
|
-
top: var(--indicator-position);
|
|
42
|
-
right: 0;
|
|
43
|
-
bottom: auto;
|
|
44
74
|
left: auto;
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
right: 0;
|
|
76
|
+
top: 0;
|
|
77
|
+
bottom: 0;
|
|
78
|
+
|
|
79
|
+
width: 0.125rem;
|
|
80
|
+
height: 100%;
|
|
81
|
+
|
|
82
|
+
transform-origin: top;
|
|
83
|
+
|
|
84
|
+
scale: 1 var(--indicator-size, 0);
|
|
85
|
+
translate: 0 var(--indicator-position, 0);
|
|
47
86
|
}
|
|
48
87
|
}
|
|
49
88
|
|
|
50
89
|
&::after {
|
|
51
90
|
content: "";
|
|
52
91
|
position: absolute;
|
|
53
|
-
|
|
54
|
-
right:
|
|
92
|
+
left: 0;
|
|
93
|
+
right: 0;
|
|
55
94
|
bottom: 0;
|
|
56
|
-
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
95
|
+
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 0.125rem;
|
|
98
|
+
|
|
59
99
|
border-radius: 0;
|
|
60
100
|
background: var(--primary);
|
|
61
|
-
transition: all 0.3s cubic-bezier(0.77, 0, 0.18, 1);
|
|
62
|
-
opacity: 0;
|
|
63
|
-
}
|
|
64
101
|
|
|
65
|
-
|
|
66
|
-
|
|
102
|
+
transform-origin: left;
|
|
103
|
+
transition:
|
|
104
|
+
scale 0.2s cubic-bezier(0.25, 0.92, 0.33, 1),
|
|
105
|
+
translate 0.2s cubic-bezier(0.25, 0.92, 0.33, 1);
|
|
106
|
+
|
|
107
|
+
scale: var(--indicator-size, 0) 1;
|
|
108
|
+
translate: var(--indicator-position, 0) 0;
|
|
67
109
|
}
|
|
68
110
|
|
|
69
|
-
&.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
111
|
+
&.q-tabs--primary::after {
|
|
112
|
+
translate: var(--indicator-position, 0) 0;
|
|
113
|
+
scale: var(--indicator-size, 0) 1;
|
|
114
|
+
|
|
115
|
+
height: 0.1875rem;
|
|
116
|
+
border-radius: 0.25rem 0.25rem 0px 0px;
|
|
74
117
|
}
|
|
75
118
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
4
|
export type QTabsVariants = "primary" | "secondary" | "vertical";
|
|
3
|
-
export interface QTabsProps extends
|
|
5
|
+
export interface QTabsProps extends HTMLAttributes<HTMLElement> {
|
|
4
6
|
value?: string;
|
|
5
|
-
variant
|
|
6
|
-
round
|
|
7
|
+
variant?: QTabsVariants;
|
|
8
|
+
round?: boolean;
|
|
7
9
|
}
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
name?: string;
|
|
10
|
+
export interface QTabProps extends HTMLAttributes<HTMLElement> {
|
|
11
|
+
name: string;
|
|
11
12
|
to?: string;
|
|
12
|
-
icon?:
|
|
13
|
+
icon?: MaterialSymbol | Snippet;
|
|
13
14
|
}
|
|
14
|
-
export declare const QTabPropsDefaults: QTabProps;
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export const QTabsPropsDefaults = {
|
|
3
|
-
value: undefined,
|
|
4
|
-
variant: "primary",
|
|
5
|
-
round: false,
|
|
6
|
-
...NativePropsDefaults,
|
|
7
|
-
};
|
|
8
|
-
export const QTabPropsDefaults = {
|
|
9
|
-
name: undefined,
|
|
10
|
-
to: undefined,
|
|
11
|
-
icon: undefined,
|
|
12
|
-
...NativePropsDefaults,
|
|
13
|
-
};
|
|
1
|
+
export {};
|
|
@@ -1,39 +1,22 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"q-toolbar",
|
|
11
|
-
"surface",
|
|
12
|
-
$ctx?.header?.fixed && "fixed",
|
|
13
|
-
inset && "q-toolbar--inset",
|
|
14
|
-
userClasses
|
|
15
|
-
]);
|
|
16
|
-
$:
|
|
17
|
-
heightStyle = ctx === void 0 ? isNumber(height) ? `${height}px` : height : void 0;
|
|
18
|
-
$:
|
|
19
|
-
if ($ctx?.header !== void 0) {
|
|
20
|
-
if (userStyles?.includes("display: none")) {
|
|
21
|
-
$ctx.header.display = false;
|
|
22
|
-
} else {
|
|
23
|
-
$ctx.header.display = true;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
$:
|
|
27
|
-
style = createStyles(
|
|
28
|
-
{
|
|
29
|
-
"--header-height": heightStyle
|
|
30
|
-
},
|
|
31
|
-
userStyles
|
|
32
|
-
);
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
inset = false,
|
|
4
|
+
border = false,
|
|
5
|
+
elevate = false,
|
|
6
|
+
height = 64,
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
} = $props();
|
|
33
10
|
</script>
|
|
34
11
|
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
12
|
+
<nav
|
|
13
|
+
{...props}
|
|
14
|
+
class="q-toolbar{props.class ? ` ${props.class}` : ''}"
|
|
15
|
+
class:q-toolbar--inset={inset}
|
|
16
|
+
class:q-toolbar--elevated={elevate}
|
|
17
|
+
class:q-toolbar--bordered={border}
|
|
18
|
+
role="toolbar"
|
|
19
|
+
style:--toolbar-height="{height}px"
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</nav>
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QToolbarProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
inset?: boolean | undefined;
|
|
7
|
-
height?: string | number | undefined;
|
|
8
|
-
class?: string | undefined;
|
|
9
|
-
style?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
type QToolbarProps_ = typeof __propDef.props;
|
|
19
|
-
export { QToolbarProps_ as QToolbarProps };
|
|
20
|
-
export type QToolbarEvents = typeof __propDef.events;
|
|
21
|
-
export type QToolbarSlots = typeof __propDef.slots;
|
|
22
|
-
export default class QToolbar extends SvelteComponent<QToolbarProps, QToolbarEvents, QToolbarSlots> {
|
|
23
|
-
}
|
|
2
|
+
declare const QToolbar: import("svelte").Component<QToolbarProps, {}, "">;
|
|
3
|
+
export default QToolbar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QToolbarDocsProps } from "./docs.props";
|
|
2
|
+
export const QToolbarDocs = {
|
|
3
|
+
name: "QToolbar",
|
|
4
|
+
description: "The Toolbar component is used to hold common actions and controls, often located at the top of an application or view.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QToolbarDocsProps,
|
|
7
|
+
slots: [],
|
|
8
|
+
methods: [],
|
|
9
|
+
events: [],
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -6,3 +6,11 @@ export declare const QToolbarDocsProps: {
|
|
|
6
6
|
description: string;
|
|
7
7
|
default: string;
|
|
8
8
|
}[];
|
|
9
|
+
export declare const QToolbarTitleDocsProps: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
optional: boolean;
|
|
13
|
+
clickableType: boolean;
|
|
14
|
+
description: string;
|
|
15
|
+
default: string;
|
|
16
|
+
}[];
|
|
@@ -1,18 +1,46 @@
|
|
|
1
|
+
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
+
// @quaffHash beedaeb7026ad26756370f4342f7a11e
|
|
1
3
|
export const QToolbarDocsProps = [
|
|
2
4
|
{
|
|
3
5
|
name: "inset",
|
|
4
6
|
type: "boolean",
|
|
5
|
-
optional:
|
|
7
|
+
optional: true,
|
|
6
8
|
clickableType: false,
|
|
7
9
|
description: "",
|
|
8
|
-
default: "",
|
|
10
|
+
default: "false",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "border",
|
|
14
|
+
type: "boolean",
|
|
15
|
+
optional: true,
|
|
16
|
+
clickableType: false,
|
|
17
|
+
description: "",
|
|
18
|
+
default: "false",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "elevate",
|
|
22
|
+
type: "boolean",
|
|
23
|
+
optional: true,
|
|
24
|
+
clickableType: false,
|
|
25
|
+
description: "",
|
|
26
|
+
default: "false",
|
|
9
27
|
},
|
|
10
28
|
{
|
|
11
29
|
name: "height",
|
|
12
|
-
type: "
|
|
13
|
-
optional:
|
|
30
|
+
type: "number",
|
|
31
|
+
optional: true,
|
|
32
|
+
clickableType: false,
|
|
33
|
+
description: "",
|
|
34
|
+
default: "64",
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
export const QToolbarTitleDocsProps = [
|
|
38
|
+
{
|
|
39
|
+
name: "shrink",
|
|
40
|
+
type: "boolean",
|
|
41
|
+
optional: true,
|
|
14
42
|
clickableType: false,
|
|
15
43
|
description: "",
|
|
16
|
-
default: "",
|
|
44
|
+
default: "false",
|
|
17
45
|
},
|
|
18
46
|
];
|