@rio-m3e/vue 0.6.3 → 0.7.0
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 +99 -4
- package/dist/app-bar/AppBar.vue.d.ts +42 -0
- package/dist/app-bar/AppBar.vue.js +91 -0
- package/dist/badge/Badge.vue.d.ts +15 -0
- package/dist/badge/Badge.vue.js +28 -0
- package/dist/bottom-sheet/BottomSheet.vue.d.ts +34 -0
- package/dist/bottom-sheet/BottomSheet.vue.js +82 -0
- package/dist/browser/rio-vue.css +9130 -0
- package/dist/browser/rio-vue.global.js +600 -0
- package/dist/browser/rio-vue.js +600 -0
- package/dist/button/Button.vue.d.ts +1 -0
- package/dist/button/Button.vue.js +23 -2
- package/dist/button-group/ButtonGroup.vue.d.ts +6 -1
- package/dist/button-group/ButtonGroup.vue.js +27 -4
- package/dist/button-group/context.js +4 -2
- package/dist/card/Card.vue.d.ts +24 -0
- package/dist/card/Card.vue.js +44 -0
- package/dist/card/CardActions.vue.d.ts +14 -0
- package/dist/card/CardActions.vue.js +14 -0
- package/dist/card/CardContent.vue.d.ts +14 -0
- package/dist/card/CardContent.vue.js +14 -0
- package/dist/card/CardHeader.vue.d.ts +27 -0
- package/dist/card/CardHeader.vue.js +34 -0
- package/dist/card/CardMedia.vue.d.ts +14 -0
- package/dist/card/CardMedia.vue.js +14 -0
- package/dist/checkbox/Checkbox.vue.d.ts +1 -0
- package/dist/checkbox/Checkbox.vue.js +3 -0
- package/dist/chip/AssistChip.vue.d.ts +1 -0
- package/dist/chip/AssistChip.vue.js +3 -0
- package/dist/chip/ChipSet.vue.d.ts +1 -0
- package/dist/chip/ChipSet.vue.js +4 -1
- package/dist/chip/FilterChip.vue.d.ts +3 -2
- package/dist/chip/FilterChip.vue.js +3 -0
- package/dist/chip/InputChip.vue.d.ts +1 -0
- package/dist/chip/InputChip.vue.js +3 -0
- package/dist/chip/SuggestionChip.vue.d.ts +1 -0
- package/dist/chip/SuggestionChip.vue.js +3 -0
- package/dist/date-picker/DatePicker.vue.d.ts +16 -3
- package/dist/date-picker/DatePicker.vue.js +13 -4
- package/dist/date-picker/DatePickerCalendar.vue.js +1 -4
- package/dist/date-picker/DatePickerDialog.vue.d.ts +17 -3
- package/dist/date-picker/DatePickerDialog.vue.js +66 -22
- package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
- package/dist/date-picker/DateRangePickerDialog.vue.d.ts +17 -3
- package/dist/date-picker/DateRangePickerDialog.vue.js +29 -16
- package/dist/dialog/Dialog.vue.d.ts +11 -2
- package/dist/dialog/Dialog.vue.js +35 -5
- package/dist/divider/Divider.vue.d.ts +5 -0
- package/dist/divider/Divider.vue.js +21 -0
- package/dist/fab/Fab.vue.d.ts +27 -0
- package/dist/fab/Fab.vue.js +70 -0
- package/dist/fab-menu/FabMenu.vue.d.ts +34 -0
- package/dist/fab-menu/FabMenu.vue.js +76 -0
- package/dist/fab-menu/FabMenuItem.vue.d.ts +22 -0
- package/dist/fab-menu/FabMenuItem.vue.js +29 -0
- package/dist/fab-menu/context.js +4 -0
- package/dist/icon-button/IconButton.vue.d.ts +1 -0
- package/dist/icon-button/IconButton.vue.js +23 -2
- package/dist/ime/composing.js +24 -0
- package/dist/index.d.ts +68 -40
- package/dist/index.js +68 -40
- package/dist/list/List.vue.d.ts +1 -0
- package/dist/list/List.vue.js +4 -1
- package/dist/list/ListItem.vue.d.ts +7 -1
- package/dist/list/ListItem.vue.js +4 -1
- package/dist/loading-indicator/LoadingIndicator.vue.d.ts +1 -0
- package/dist/loading-indicator/LoadingIndicator.vue.js +4 -1
- package/dist/menu/Menu.vue.d.ts +2 -2
- package/dist/menu/Menu.vue.js +11 -2
- package/dist/navigation-bar/NavigationBar.vue.d.ts +31 -0
- package/dist/navigation-bar/NavigationBar.vue.js +63 -0
- package/dist/navigation-bar/NavigationBarItem.vue.d.ts +40 -0
- package/dist/navigation-bar/NavigationBarItem.vue.js +84 -0
- package/dist/navigation-bar/context.js +3 -0
- package/dist/navigation-rail/NavigationRail.vue.d.ts +46 -0
- package/dist/navigation-rail/NavigationRail.vue.js +112 -0
- package/dist/navigation-rail/NavigationRailItem.vue.d.ts +41 -0
- package/dist/navigation-rail/NavigationRailItem.vue.js +85 -0
- package/dist/navigation-rail/NavigationRailSection.vue.d.ts +17 -0
- package/dist/navigation-rail/NavigationRailSection.vue.js +20 -0
- package/dist/navigation-rail/context.js +3 -0
- package/dist/overflow/OverflowItem.vue.d.ts +16 -0
- package/dist/overflow/OverflowItem.vue.js +24 -0
- package/dist/overflow/OverflowMenu.vue.js +94 -0
- package/dist/overflow/overflow.js +79 -0
- package/dist/progress/CircularProgress.vue.d.ts +1 -0
- package/dist/progress/CircularProgress.vue.js +5 -2
- package/dist/progress/LinearProgress.vue.d.ts +1 -0
- package/dist/progress/LinearProgress.vue.js +5 -2
- package/dist/radio/Radio.vue.d.ts +1 -0
- package/dist/radio/Radio.vue.js +4 -1
- package/dist/radio/RadioGroup.vue.d.ts +1 -0
- package/dist/radio/RadioGroup.vue.js +10 -2
- package/dist/scroll-field/ScrollField.vue.d.ts +1 -0
- package/dist/scroll-field/ScrollField.vue.js +3 -0
- package/dist/search/Search.vue.d.ts +58 -0
- package/dist/search/Search.vue.js +161 -0
- package/dist/select/AfterOptions.vue.js +11 -0
- package/dist/select/Select.vue.d.ts +5 -4
- package/dist/select/Select.vue.js +41 -31
- package/dist/select/SelectOption.vue.d.ts +4 -1
- package/dist/select/SelectOption.vue.js +8 -5
- package/dist/side-sheet/SideSheet.vue.d.ts +43 -0
- package/dist/side-sheet/SideSheet.vue.js +103 -0
- package/dist/slider/RangeSlider.vue.d.ts +1 -0
- package/dist/slider/RangeSlider.vue.js +3 -0
- package/dist/slider/Slider.vue.d.ts +1 -0
- package/dist/slider/Slider.vue.js +3 -0
- package/dist/snackbar/Snackbar.vue.d.ts +31 -0
- package/dist/snackbar/Snackbar.vue.js +48 -0
- package/dist/snackbar/SnackbarHost.vue.d.ts +40 -0
- package/dist/snackbar/SnackbarHost.vue.js +110 -0
- package/dist/snackbar/snackbar.d.ts +16 -0
- package/dist/snackbar/snackbar.js +11 -0
- package/dist/split-button/SplitButton.vue.d.ts +3 -2
- package/dist/split-button/SplitButton.vue.js +3 -0
- package/dist/switch/Switch.vue.d.ts +1 -0
- package/dist/switch/Switch.vue.js +3 -0
- package/dist/tabs/Tab.vue.d.ts +19 -0
- package/dist/tabs/Tab.vue.js +66 -0
- package/dist/tabs/TabGroup.vue.d.ts +22 -0
- package/dist/tabs/TabGroup.vue.js +25 -0
- package/dist/tabs/TabPanel.vue.d.ts +15 -0
- package/dist/tabs/TabPanel.vue.js +20 -0
- package/dist/tabs/Tabs.vue.d.ts +32 -0
- package/dist/tabs/Tabs.vue.js +95 -0
- package/dist/tabs/context.js +5 -0
- package/dist/text-field/TextField.vue.d.ts +8 -2
- package/dist/text-field/TextField.vue.js +91 -47
- package/dist/time-picker/TimeInput.vue.d.ts +7 -1
- package/dist/time-picker/TimeInput.vue.js +5 -2
- package/dist/time-picker/TimePickerDialog.vue.d.ts +9 -3
- package/dist/time-picker/TimePickerDialog.vue.js +5 -2
- package/dist/time-picker/TimeScroll.vue.d.ts +7 -1
- package/dist/time-picker/TimeScroll.vue.js +5 -2
- package/dist/toolbar/FabPlace.vue.js +14 -0
- package/dist/toolbar/Toolbar.vue.d.ts +34 -0
- package/dist/toolbar/Toolbar.vue.js +115 -0
- package/dist/toolbar/context.js +3 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -1,13 +1,108 @@
|
|
|
1
1
|
# @rio-m3e/vue
|
|
2
2
|
|
|
3
|
-
Vue components for [Rio](https://github.com/LegenLee/rio), a Material 3 Expressive implementation
|
|
3
|
+
Vue components for [Rio](https://github.com/LegenLee/rio), a Material 3 Expressive implementation.
|
|
4
|
+
|
|
5
|
+
Rio is in early development. Before 1.0, any minor version may break the API.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
4
8
|
|
|
5
9
|
```sh
|
|
6
|
-
pnpm add @rio-m3e/vue
|
|
10
|
+
pnpm add @rio-m3e/vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
It needs Vue 3.5 or later, and installs `@rio-m3e/core`, `@rio-m3e/styles`, and `@rio-m3e/tokens` for you. Rio loads no fonts: load Roboto yourself, as with `@fontsource/roboto`.
|
|
14
|
+
|
|
15
|
+
## Set up
|
|
16
|
+
|
|
17
|
+
Install `createRio` before mounting the app. It writes the theme as `--rio-*` CSS variables and, with `locale`, sets the language for the whole app; without one, components follow the page's `<html lang>`, then the browser's language:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
// main.ts
|
|
21
|
+
import { createRio } from '@rio-m3e/vue';
|
|
22
|
+
import { createApp } from 'vue';
|
|
23
|
+
import App from './App.vue';
|
|
24
|
+
|
|
25
|
+
createApp(App)
|
|
26
|
+
.use(createRio({ theme: { sourceColor: '#6750a4' } }))
|
|
27
|
+
.mount('#app');
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Rio ships no icons. Give them in a component's slot, or once to `createRio`'s `icons` for the icons the components draw on their own, such as a select's arrow ([Icons](https://legenlee.github.io/rio/guide/icons)).
|
|
31
|
+
|
|
32
|
+
## Use
|
|
33
|
+
|
|
34
|
+
Each component imports its own styles.
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import { mdiHeart, mdiHeartOutline } from '@mdi/js';
|
|
39
|
+
import { RioButton, RioIcon, RioIconButton, RioSwitch } from '@rio-m3e/vue';
|
|
40
|
+
import { ref } from 'vue';
|
|
41
|
+
|
|
42
|
+
const favorite = ref(false);
|
|
43
|
+
const wifi = ref(true);
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<RioButton variant="tonal">Save</RioButton>
|
|
48
|
+
|
|
49
|
+
<RioIconButton v-model:selected="favorite" label="Add to favorites" toggle variant="standard">
|
|
50
|
+
<RioIcon :icon="{ type: 'svg', path: mdiHeartOutline }" />
|
|
51
|
+
<template #selected-icon>
|
|
52
|
+
<RioIcon :icon="{ type: 'svg', path: mdiHeart }" />
|
|
53
|
+
</template>
|
|
54
|
+
</RioIconButton>
|
|
55
|
+
|
|
56
|
+
<label><RioSwitch v-model:selected="wifi" /> Wi-Fi</label>
|
|
57
|
+
</template>
|
|
7
58
|
```
|
|
8
59
|
|
|
9
|
-
|
|
60
|
+
## Components
|
|
61
|
+
|
|
62
|
+
Each page has live examples, the API, and how the component follows the spec.
|
|
63
|
+
|
|
64
|
+
- [App bar](https://legenlee.github.io/rio/components/app-bar): `RioAppBar`
|
|
65
|
+
- [Badge](https://legenlee.github.io/rio/components/badge): `RioBadge`
|
|
66
|
+
- [Bottom sheet](https://legenlee.github.io/rio/components/bottom-sheet): `RioBottomSheet`
|
|
67
|
+
- [Button](https://legenlee.github.io/rio/components/button): `RioButton`
|
|
68
|
+
- [Button group](https://legenlee.github.io/rio/components/button-group): `RioButtonGroup`
|
|
69
|
+
- [Card](https://legenlee.github.io/rio/components/card): `RioCard`, `RioCardMedia`, `RioCardHeader`, `RioCardContent`, `RioCardActions`
|
|
70
|
+
- [Checkbox](https://legenlee.github.io/rio/components/checkbox): `RioCheckbox`
|
|
71
|
+
- [Chips](https://legenlee.github.io/rio/components/chip): `RioChipSet`, `RioAssistChip`, `RioFilterChip`, `RioInputChip`, `RioSuggestionChip`
|
|
72
|
+
- [Date picker](https://legenlee.github.io/rio/components/date-picker): `RioDatePicker`, `RioDatePickerDialog`, `RioDateRangePickerDialog`
|
|
73
|
+
- [Dialog](https://legenlee.github.io/rio/components/dialog): `RioDialog`
|
|
74
|
+
- [Divider](https://legenlee.github.io/rio/components/divider): `RioDivider`
|
|
75
|
+
- [FAB](https://legenlee.github.io/rio/components/fab): `RioFab`
|
|
76
|
+
- [FAB menu](https://legenlee.github.io/rio/components/fab-menu): `RioFabMenu`, `RioFabMenuItem`
|
|
77
|
+
- [Icon](https://legenlee.github.io/rio/components/icon): `RioIcon`
|
|
78
|
+
- [Icon button](https://legenlee.github.io/rio/components/icon-button): `RioIconButton`
|
|
79
|
+
- [Lists](https://legenlee.github.io/rio/components/list): `RioList`, `RioListItem`
|
|
80
|
+
- [Loading indicator](https://legenlee.github.io/rio/components/loading-indicator): `RioLoadingIndicator`
|
|
81
|
+
- [Menu](https://legenlee.github.io/rio/components/menu): `RioMenu`, `RioMenuItem`, `RioMenuGroup`, `RioMenuDivider`, `RioSubMenu`
|
|
82
|
+
- [Navigation bar](https://legenlee.github.io/rio/components/navigation-bar): `RioNavigationBar`, `RioNavigationBarItem`
|
|
83
|
+
- [Navigation rail](https://legenlee.github.io/rio/components/navigation-rail): `RioNavigationRail`, `RioNavigationRailItem`, `RioNavigationRailSection`
|
|
84
|
+
- [Progress indicators](https://legenlee.github.io/rio/components/progress-indicator): `RioLinearProgress`, `RioCircularProgress`
|
|
85
|
+
- [Radio button](https://legenlee.github.io/rio/components/radio-button): `RioRadioGroup`, `RioRadio`
|
|
86
|
+
- [Scroll fields](https://legenlee.github.io/rio/components/scroll-field): `RioScrollField`
|
|
87
|
+
- [Search](https://legenlee.github.io/rio/components/search): `RioSearch`
|
|
88
|
+
- [Select](https://legenlee.github.io/rio/components/select): `RioSelect`, `RioSelectOption`
|
|
89
|
+
- [Side sheet](https://legenlee.github.io/rio/components/side-sheet): `RioSideSheet`
|
|
90
|
+
- [Slider](https://legenlee.github.io/rio/components/slider): `RioSlider`, `RioRangeSlider`
|
|
91
|
+
- [Snackbar](https://legenlee.github.io/rio/components/snackbar): `RioSnackbarHost`, `useSnackbar`, `RioSnackbar`
|
|
92
|
+
- [Split button](https://legenlee.github.io/rio/components/split-button): `RioSplitButton`
|
|
93
|
+
- [Switch](https://legenlee.github.io/rio/components/switch): `RioSwitch`
|
|
94
|
+
- [Tabs](https://legenlee.github.io/rio/components/tabs): `RioTabGroup`, `RioTabs`, `RioTab`, `RioTabPanel`
|
|
95
|
+
- [Text field](https://legenlee.github.io/rio/components/text-field): `RioTextField`
|
|
96
|
+
- [Time picker](https://legenlee.github.io/rio/components/time-picker): `RioTimePickerDialog`, `RioTimeInput`, `RioTimeScroll`
|
|
97
|
+
- [Toolbar](https://legenlee.github.io/rio/components/toolbar): `RioToolbar`
|
|
98
|
+
- [Tooltip](https://legenlee.github.io/rio/components/tooltip): `RioTooltip`
|
|
99
|
+
|
|
100
|
+
`RioOverflowItem` puts content of your own into an overflow menu: in an app bar's trailing buttons, a toolbar, or a button group ([Overflow menu](https://legenlee.github.io/rio/components/toolbar#overflow-menu)).
|
|
101
|
+
|
|
102
|
+
`RioLocaleProvider` sets the language for part of a page ([Languages](https://legenlee.github.io/rio/guide/languages)), and the `v-ripple` directive draws the press ripple on an element of your own.
|
|
103
|
+
|
|
104
|
+
The [docs](https://legenlee.github.io/rio/) start with [Getting started](https://legenlee.github.io/rio/guide/getting-started).
|
|
10
105
|
|
|
11
|
-
|
|
106
|
+
## License
|
|
12
107
|
|
|
13
108
|
Licensed under the Apache License 2.0.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AppBarProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/app-bar.css";
|
|
3
|
+
interface Props extends AppBarProps {
|
|
4
|
+
/** The headline's text. The `headline` slot takes its place, as for a logo. */
|
|
5
|
+
headline?: string;
|
|
6
|
+
/** The subtitle's text. The `subtitle` slot takes its place. */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** The element whose scrolling fills the bar, and moves it. Defaults to the window. */
|
|
9
|
+
scrollTarget?: HTMLElement | null;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
/** A leading button, such as Back or a menu */
|
|
13
|
+
leading?: () => unknown;
|
|
14
|
+
/**
|
|
15
|
+
* The headline, in place of `headline`, as an image or a logo. A collapsing bar renders it again
|
|
16
|
+
* beside the buttons, as a copy hidden from assistive technology and out of reach: `copy` tells
|
|
17
|
+
* the two apart, so the copy can leave out ids.
|
|
18
|
+
*/
|
|
19
|
+
headline?: (props: {
|
|
20
|
+
copy: boolean;
|
|
21
|
+
}) => unknown;
|
|
22
|
+
/** The subtitle, in place of `subtitle` */
|
|
23
|
+
subtitle?: () => unknown;
|
|
24
|
+
/**
|
|
25
|
+
* Trailing buttons, up to two, or an avatar. With `overflow`, the buttons that don't fit go into
|
|
26
|
+
* a menu, last first.
|
|
27
|
+
*/
|
|
28
|
+
trailing?: () => unknown;
|
|
29
|
+
/** A search app bar's search, a `RioSearch`, in place of the headline and subtitle */
|
|
30
|
+
search?: () => unknown;
|
|
31
|
+
/** The "More options" button's icon, in place of the one the app registered (`more`) */
|
|
32
|
+
'more-icon'?: () => unknown;
|
|
33
|
+
};
|
|
34
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export { _default as default };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import _sfc_main$1 from "../overflow/OverflowMenu.vue.js";
|
|
2
|
+
import { useOverflowHost } from "../overflow/overflow.js";
|
|
3
|
+
import { createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, defineComponent, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
4
|
+
import { appBarTrailingRoom, attachAppBar, createAppBar } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/app-bar.css";
|
|
6
|
+
// src/app-bar/AppBar.vue
|
|
7
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
|
+
__name: "AppBar",
|
|
9
|
+
props: {
|
|
10
|
+
headline: {},
|
|
11
|
+
subtitle: {},
|
|
12
|
+
scrollTarget: {},
|
|
13
|
+
variant: {},
|
|
14
|
+
align: {},
|
|
15
|
+
headingLevel: {},
|
|
16
|
+
scrolled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: () => void 0
|
|
19
|
+
},
|
|
20
|
+
scrollBehavior: {},
|
|
21
|
+
overflow: { type: Boolean },
|
|
22
|
+
maxItems: {}
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const slots = useSlots();
|
|
26
|
+
const targetScrolled = ref(false);
|
|
27
|
+
const bar = createAppBar({
|
|
28
|
+
props: () => ({
|
|
29
|
+
variant: __props.variant,
|
|
30
|
+
align: __props.align,
|
|
31
|
+
headingLevel: __props.headingLevel,
|
|
32
|
+
scrolled: __props.scrolled,
|
|
33
|
+
scrollBehavior: __props.scrollBehavior,
|
|
34
|
+
overflow: __props.overflow,
|
|
35
|
+
maxItems: __props.maxItems
|
|
36
|
+
}),
|
|
37
|
+
content: () => ({
|
|
38
|
+
leading: !!slots.leading,
|
|
39
|
+
headline: !!slots.headline || !!__props.headline,
|
|
40
|
+
subtitle: !!slots.subtitle || !!__props.subtitle,
|
|
41
|
+
trailing: !!slots.trailing,
|
|
42
|
+
search: !!slots.search
|
|
43
|
+
}),
|
|
44
|
+
scrolled: () => targetScrolled.value,
|
|
45
|
+
overflowing: () => more.overflowing()
|
|
46
|
+
});
|
|
47
|
+
const root = useTemplateRef("root");
|
|
48
|
+
let handle;
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
handle = attachAppBar(root.value, {
|
|
51
|
+
target: () => __props.scrollTarget ?? void 0,
|
|
52
|
+
onScrolledChange: (next) => targetScrolled.value = next,
|
|
53
|
+
scrollBehavior: bar.scrollBehavior
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
onUpdated(() => handle?.update());
|
|
57
|
+
watch(() => __props.scrollTarget, () => handle?.update());
|
|
58
|
+
const more = useOverflowHost({
|
|
59
|
+
overflow: bar.overflow,
|
|
60
|
+
container: useTemplateRef("trailing"),
|
|
61
|
+
room: () => root.value ? appBarTrailingRoom(root.value) : Infinity
|
|
62
|
+
});
|
|
63
|
+
onBeforeUnmount(() => handle?.detach());
|
|
64
|
+
return (_ctx, _cache) => {
|
|
65
|
+
return openBlock(), createElementBlock("header", mergeProps({
|
|
66
|
+
ref_key: "root",
|
|
67
|
+
ref: root
|
|
68
|
+
}, unref(bar).parts.root()), [
|
|
69
|
+
unref(bar).showsLeading() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(bar).parts.leading())), [renderSlot(_ctx.$slots, "leading")], 16)) : createCommentVNode("v-if", true),
|
|
70
|
+
unref(bar).showsCollapsedHeadline() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, unref(bar).parts.collapsedHeadline())), [renderSlot(_ctx.$slots, "headline", { copy: true }, () => [createTextVNode(toDisplayString(__props.headline), 1)])], 16)) : createCommentVNode("v-if", true),
|
|
71
|
+
unref(bar).showsText() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, unref(bar).parts.text())), [unref(bar).showsHeadline() ? (openBlock(), createBlock(resolveDynamicComponent(unref(bar).headingTag()), normalizeProps(mergeProps({ key: 0 }, unref(bar).parts.headline())), {
|
|
72
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "headline", { copy: false }, () => [createTextVNode(toDisplayString(__props.headline), 1)])]),
|
|
73
|
+
_: 3
|
|
74
|
+
}, 16)) : createCommentVNode("v-if", true), unref(bar).showsSubtitle() ? (openBlock(), createElementBlock("p", normalizeProps(mergeProps({ key: 1 }, unref(bar).parts.subtitle())), [renderSlot(_ctx.$slots, "subtitle", {}, () => [createTextVNode(toDisplayString(__props.subtitle), 1)])], 16)) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true),
|
|
75
|
+
unref(bar).showsSearch() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 3 }, unref(bar).parts.search())), [renderSlot(_ctx.$slots, "search")], 16)) : createCommentVNode("v-if", true),
|
|
76
|
+
unref(bar).showsTrailing() ? (openBlock(), createElementBlock("div", mergeProps({
|
|
77
|
+
key: 4,
|
|
78
|
+
ref: "trailing"
|
|
79
|
+
}, unref(bar).parts.trailing()), [renderSlot(_ctx.$slots, "trailing"), unref(more).enabled() ? (openBlock(), createBlock(_sfc_main$1, {
|
|
80
|
+
key: 0,
|
|
81
|
+
host: unref(more)
|
|
82
|
+
}, createSlots({ _: 2 }, [_ctx.$slots["more-icon"] ? {
|
|
83
|
+
name: "icon",
|
|
84
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "more-icon")]),
|
|
85
|
+
key: "0"
|
|
86
|
+
} : void 0]), 1032, ["host"])) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true)
|
|
87
|
+
], 16);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BadgeProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/badge.css";
|
|
3
|
+
type __VLS_Slots = {
|
|
4
|
+
/** What the badge marks, as an icon: the badge sits at its upper trailing corner. */
|
|
5
|
+
default?: () => unknown;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<BadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export { _default as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useLocale } from "../locale/locale.js";
|
|
2
|
+
import { createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, useSlots } from "vue";
|
|
3
|
+
import { createBadge } from "@rio-m3e/core";
|
|
4
|
+
import "@rio-m3e/styles/badge.css";
|
|
5
|
+
// src/badge/Badge.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
__name: "Badge",
|
|
8
|
+
props: {
|
|
9
|
+
value: {},
|
|
10
|
+
max: {},
|
|
11
|
+
locale: {},
|
|
12
|
+
color: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const slots = useSlots();
|
|
16
|
+
const resolvedLocale = useLocale(() => __props.locale);
|
|
17
|
+
const badge = createBadge({ props: () => ({
|
|
18
|
+
value: __props.value,
|
|
19
|
+
max: __props.max,
|
|
20
|
+
locale: resolvedLocale.value,
|
|
21
|
+
color: __props.color
|
|
22
|
+
}) });
|
|
23
|
+
return (_ctx, _cache) => {
|
|
24
|
+
return slots.default ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(badge).parts.anchor())), [renderSlot(_ctx.$slots, "default"), createElementVNode("span", normalizeProps(guardReactiveProps(unref(badge).parts.root())), toDisplayString(unref(badge).label()), 17)], 16)) : (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(badge).parts.root())), toDisplayString(unref(badge).label()), 17));
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BottomSheetProps, SheetMessages } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
5
|
+
import "@rio-m3e/styles/sheet.css";
|
|
6
|
+
interface Props extends Omit<BottomSheetProps, 'open'> {
|
|
7
|
+
/** A language tag, for the drag handle's name. Without it, the one provided, or the page's. */
|
|
8
|
+
locale?: string;
|
|
9
|
+
/** Replaces the sheet's own words: its name, and the drag handle's. */
|
|
10
|
+
messages?: Partial<SheetMessages>;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = Props;
|
|
13
|
+
type __VLS_Slots = {
|
|
14
|
+
/** The content: a list of actions, or anything else */
|
|
15
|
+
default?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_ModelProps = {
|
|
18
|
+
/** Whether the sheet is shown, with `v-model:open`. */
|
|
19
|
+
'open'?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
22
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
"update:open": (value: boolean) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
25
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export { _default as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
2
|
+
import { keepPresses } from "../overlay/presses.js";
|
|
3
|
+
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, shallowRef, toHandlers, unref, useModel, useTemplateRef, watch } from "vue";
|
|
4
|
+
import { attachBottomSheet, createBottomSheet } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
6
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
7
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
8
|
+
import "@rio-m3e/styles/sheet.css";
|
|
9
|
+
// src/bottom-sheet/BottomSheet.vue
|
|
10
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
11
|
+
__name: "BottomSheet",
|
|
12
|
+
props: /*@__PURE__*/ mergeModels({
|
|
13
|
+
locale: {},
|
|
14
|
+
messages: {},
|
|
15
|
+
label: {},
|
|
16
|
+
dragHandle: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: () => void 0
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
"open": {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
"openModifiers": {}
|
|
26
|
+
}),
|
|
27
|
+
emits: ["update:open"],
|
|
28
|
+
setup(__props) {
|
|
29
|
+
/** Whether the sheet is shown, with `v-model:open`. */
|
|
30
|
+
const open = useModel(__props, "open");
|
|
31
|
+
const text = useMessages("sheet", useLocale(() => __props.locale), () => __props.messages);
|
|
32
|
+
/** The height it is at, as `attachBottomSheet` and the drag handle set it */
|
|
33
|
+
const detent = ref("expanded");
|
|
34
|
+
/** What `attachBottomSheet` measured */
|
|
35
|
+
const layout = shallowRef();
|
|
36
|
+
/** Whether the content is scrolled from its top */
|
|
37
|
+
const scrolled = ref(false);
|
|
38
|
+
const sheet = createBottomSheet({
|
|
39
|
+
props: () => ({
|
|
40
|
+
open: open.value,
|
|
41
|
+
label: __props.label,
|
|
42
|
+
dragHandle: __props.dragHandle
|
|
43
|
+
}),
|
|
44
|
+
messages: () => text.value,
|
|
45
|
+
detent: () => detent.value,
|
|
46
|
+
layout: () => layout.value,
|
|
47
|
+
scrolled: () => scrolled.value,
|
|
48
|
+
onDetentChange: (next) => detent.value = next,
|
|
49
|
+
onOpenChange: (next) => open.value = next
|
|
50
|
+
});
|
|
51
|
+
const rendered = ref(open.value);
|
|
52
|
+
watch(open, (next) => {
|
|
53
|
+
if (next) rendered.value = true;
|
|
54
|
+
});
|
|
55
|
+
const root = useTemplateRef("root");
|
|
56
|
+
let handle;
|
|
57
|
+
onMounted(() => {
|
|
58
|
+
handle = attachBottomSheet(root.value, {
|
|
59
|
+
onOpenChange: (next) => open.value = next,
|
|
60
|
+
onDetentChange: (next) => detent.value = next,
|
|
61
|
+
onLayoutChange: (next) => layout.value = next,
|
|
62
|
+
onScrolledChange: (next) => scrolled.value = next,
|
|
63
|
+
onClosed: () => {
|
|
64
|
+
if (!open.value) rendered.value = false;
|
|
65
|
+
},
|
|
66
|
+
detent: sheet.detent,
|
|
67
|
+
dragHandle: sheet.showsHandle
|
|
68
|
+
});
|
|
69
|
+
handle.sync(open.value);
|
|
70
|
+
});
|
|
71
|
+
watch(open, (next) => handle?.sync(next), { flush: "post" });
|
|
72
|
+
onUpdated(() => handle?.update());
|
|
73
|
+
onBeforeUnmount(() => handle?.detach());
|
|
74
|
+
return (_ctx, _cache) => {
|
|
75
|
+
return openBlock(), createElementBlock("dialog", mergeProps({
|
|
76
|
+
ref_key: "root",
|
|
77
|
+
ref: root
|
|
78
|
+
}, unref(sheet).parts.root(), toHandlers(unref(keepPresses), true)), [rendered.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(sheet).showsHandle() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(sheet).parts.header())), [createElementVNode("button", mergeProps(unref(sheet).parts.handle(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(sheet).handleHandleClick && unref(sheet).handleHandleClick(...args)) }), null, 16)], 16)) : createCommentVNode("v-if", true), createElementVNode("div", normalizeProps(guardReactiveProps(unref(sheet).parts.content())), [renderSlot(_ctx.$slots, "default")], 16)], 64)) : createCommentVNode("v-if", true)], 16);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export { _sfc_main as default };
|