@rio-m3e/vue 0.6.2 → 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 +9 -2
- package/dist/chip/FilterChip.vue.js +12 -5
- package/dist/chip/InputChip.vue.d.ts +5 -1
- package/dist/chip/InputChip.vue.js +6 -2
- 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 +27 -4
- package/dist/date-picker/DatePicker.vue.js +15 -5
- package/dist/date-picker/DatePickerCalendar.vue.js +11 -13
- package/dist/date-picker/DatePickerDialog.vue.d.ts +26 -3
- package/dist/date-picker/DatePickerDialog.vue.js +66 -21
- package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
- package/dist/date-picker/DateRangePickerDialog.vue.d.ts +23 -3
- package/dist/date-picker/DateRangePickerDialog.vue.js +31 -17
- 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/Icon.vue.d.ts +13 -0
- package/dist/icon/Icon.vue.js +30 -0
- package/dist/icon/icons.d.ts +12 -0
- package/dist/icon/icons.js +12 -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 +69 -39
- package/dist/index.js +69 -39
- 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 +1 -0
- package/dist/menu/Menu.vue.js +12 -2
- package/dist/menu/MenuDivider.vue.d.ts +1 -0
- package/dist/menu/MenuDivider.vue.js +1 -0
- package/dist/menu/MenuGroup.vue.d.ts +1 -0
- package/dist/menu/MenuGroup.vue.js +1 -0
- package/dist/menu/MenuItem.vue.d.ts +1 -0
- package/dist/menu/MenuItem.vue.js +1 -0
- package/dist/menu/SubMenu.vue.d.ts +2 -1
- package/dist/menu/SubMenu.vue.js +7 -3
- 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 +2 -0
- package/dist/progress/CircularProgress.vue.js +6 -2
- package/dist/progress/LinearProgress.vue.d.ts +2 -0
- package/dist/progress/LinearProgress.vue.js +6 -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/rio/rio.d.ts +9 -1
- package/dist/rio/rio.js +11 -3
- 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 +8 -3
- package/dist/select/Select.vue.js +42 -30
- package/dist/select/SelectOption.vue.d.ts +5 -1
- package/dist/select/SelectOption.vue.js +9 -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 +2 -0
- package/dist/slider/RangeSlider.vue.js +4 -0
- package/dist/slider/Slider.vue.d.ts +2 -0
- package/dist/slider/Slider.vue.js +4 -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 +4 -1
- package/dist/split-button/SplitButton.vue.js +7 -2
- 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 +8 -1
- package/dist/time-picker/TimeInput.vue.js +6 -2
- package/dist/time-picker/TimePickerDialog.vue.d.ts +20 -4
- package/dist/time-picker/TimePickerDialog.vue.js +8 -3
- package/dist/time-picker/TimeScroll.vue.d.ts +16 -3
- package/dist/time-picker/TimeScroll.vue.js +8 -3
- 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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NavigationBarMessages, NavigationBarProps, NavigationBarValue } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/navigation-bar.css";
|
|
5
|
+
interface Props extends Omit<NavigationBarProps, 'active'> {
|
|
6
|
+
/** The value of the active destination's item, with `v-model`. */
|
|
7
|
+
modelValue?: NavigationBarValue;
|
|
8
|
+
/** A language tag, for badges' counts. Without it, the one provided, or the page's. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Replaces what a small badge says. */
|
|
11
|
+
messages?: Partial<NavigationBarMessages>;
|
|
12
|
+
/** The element whose scrolling hides the bar, with `hideOnScroll`. Defaults to the window. */
|
|
13
|
+
scrollTarget?: HTMLElement | null;
|
|
14
|
+
}
|
|
15
|
+
type __VLS_Slots = {
|
|
16
|
+
/** The destinations (`RioNavigationBarItem`) */
|
|
17
|
+
default?: () => unknown;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:modelValue": (value: NavigationBarValue) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: ((value: NavigationBarValue) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export { _default as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
2
|
+
import { navigationBarKey } from "./context.js";
|
|
3
|
+
import { createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderSlot, unref, useTemplateRef } from "vue";
|
|
4
|
+
import { attachNavigationBar, createNavigationBar } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
6
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
7
|
+
import "@rio-m3e/styles/navigation-bar.css";
|
|
8
|
+
// src/navigation-bar/NavigationBar.vue
|
|
9
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
|
+
__name: "NavigationBar",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {},
|
|
13
|
+
locale: {},
|
|
14
|
+
messages: {},
|
|
15
|
+
scrollTarget: {},
|
|
16
|
+
layout: {},
|
|
17
|
+
label: {},
|
|
18
|
+
color: {},
|
|
19
|
+
hideOnScroll: { type: Boolean }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue"],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
const resolvedLocale = useLocale(() => __props.locale);
|
|
25
|
+
const text = useMessages("navigationBar", resolvedLocale, () => __props.messages);
|
|
26
|
+
const bar = createNavigationBar({
|
|
27
|
+
props: () => ({
|
|
28
|
+
active: __props.modelValue,
|
|
29
|
+
layout: __props.layout,
|
|
30
|
+
label: __props.label,
|
|
31
|
+
color: __props.color,
|
|
32
|
+
hideOnScroll: __props.hideOnScroll
|
|
33
|
+
}),
|
|
34
|
+
onChange: (value) => emit("update:modelValue", value)
|
|
35
|
+
});
|
|
36
|
+
provide(navigationBarKey, {
|
|
37
|
+
isActive: bar.isActive,
|
|
38
|
+
choose: bar.choose,
|
|
39
|
+
locale: resolvedLocale,
|
|
40
|
+
messages: text
|
|
41
|
+
});
|
|
42
|
+
const root = useTemplateRef("root");
|
|
43
|
+
let handle;
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
handle = attachNavigationBar(root.value, {
|
|
46
|
+
hidesOnScroll: bar.hidesOnScroll,
|
|
47
|
+
target: () => __props.scrollTarget ?? void 0
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
onUpdated(() => handle?.update());
|
|
51
|
+
onBeforeUnmount(() => {
|
|
52
|
+
handle?.detach();
|
|
53
|
+
handle = void 0;
|
|
54
|
+
});
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createElementBlock("nav", mergeProps({
|
|
57
|
+
ref_key: "root",
|
|
58
|
+
ref: root
|
|
59
|
+
}, unref(bar).parts.root()), [createElementVNode("ul", normalizeProps(guardReactiveProps(unref(bar).parts.items())), [renderSlot(_ctx.$slots, "default")], 16)], 16);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AccentColor, NavigationBarValue } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
4
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
5
|
+
import "@rio-m3e/styles/navigation-bar.css";
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
/** Identifies the destination: the active one's is the bar's `v-model`. */
|
|
8
|
+
value?: NavigationBarValue;
|
|
9
|
+
/** The destination's name, under the icon or beside it */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Makes the item a link to this address. */
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* A badge on the icon: `true` for a small one, a dot, or a count or a short label for a large
|
|
15
|
+
* one. Its text is read after the destination's name.
|
|
16
|
+
*/
|
|
17
|
+
badge?: boolean | number | string;
|
|
18
|
+
/**
|
|
19
|
+
* The theme color it takes while active: `'primary'`, `'tertiary'`, `'error'`, or a static color
|
|
20
|
+
* of the theme. Without it, the spec's, or the bar's color.
|
|
21
|
+
*/
|
|
22
|
+
color?: AccentColor;
|
|
23
|
+
/** The app's own click, after the item has chosen its destination */
|
|
24
|
+
onClick?: (event: MouseEvent) => void;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_Slots = {
|
|
27
|
+
/** The icon, outlined, for an inactive destination */
|
|
28
|
+
default?: () => unknown;
|
|
29
|
+
/** The icon while the destination is active, filled, in place of the default one */
|
|
30
|
+
'active-icon'?: () => unknown;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export { _default as default };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import _sfc_main$1 from "../badge/Badge.vue.js";
|
|
2
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
3
|
+
import { useRipple } from "../ripple/ripple.js";
|
|
4
|
+
import { navigationBarKey } from "./context.js";
|
|
5
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useSlots, useTemplateRef, withCtx } from "vue";
|
|
6
|
+
import { createNavigationBarItem } from "@rio-m3e/core";
|
|
7
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
8
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
9
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
10
|
+
import "@rio-m3e/styles/navigation-bar.css";
|
|
11
|
+
// src/navigation-bar/NavigationBarItem.vue
|
|
12
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
__name: "NavigationBarItem",
|
|
15
|
+
props: {
|
|
16
|
+
value: {},
|
|
17
|
+
label: {},
|
|
18
|
+
href: {},
|
|
19
|
+
badge: { type: [
|
|
20
|
+
Boolean,
|
|
21
|
+
Number,
|
|
22
|
+
String
|
|
23
|
+
] },
|
|
24
|
+
color: {},
|
|
25
|
+
onClick: { type: Function }
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const slots = useSlots();
|
|
30
|
+
const attrs = useAttrs();
|
|
31
|
+
const rest = computed(() => {
|
|
32
|
+
const { class: _class, style: _style, ...others } = attrs;
|
|
33
|
+
return others;
|
|
34
|
+
});
|
|
35
|
+
const bar = inject(navigationBarKey, void 0);
|
|
36
|
+
const locale = bar?.locale ?? useLocale(() => void 0);
|
|
37
|
+
const messages = bar?.messages ?? useMessages("navigationBar", locale, () => void 0);
|
|
38
|
+
const item = createNavigationBarItem({
|
|
39
|
+
props: () => ({
|
|
40
|
+
value: props.value,
|
|
41
|
+
label: props.label,
|
|
42
|
+
href: props.href,
|
|
43
|
+
badge: props.badge,
|
|
44
|
+
locale: locale.value,
|
|
45
|
+
color: props.color
|
|
46
|
+
}),
|
|
47
|
+
bar: () => bar ?? {
|
|
48
|
+
isActive: () => false,
|
|
49
|
+
choose: () => {}
|
|
50
|
+
},
|
|
51
|
+
content: () => ({ activeIcon: !!slots["active-icon"] }),
|
|
52
|
+
messages: () => messages.value
|
|
53
|
+
});
|
|
54
|
+
const onClick = (event) => {
|
|
55
|
+
if (item.handleClick(event)) props.onClick?.(event);
|
|
56
|
+
};
|
|
57
|
+
useRipple(useTemplateRef("action"), useTemplateRef("state"));
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
return openBlock(), createElementBlock("li", mergeProps(unref(item).parts.root(), {
|
|
60
|
+
class: unref(attrs).class,
|
|
61
|
+
style: unref(attrs).style
|
|
62
|
+
}), [(openBlock(), createBlock(resolveDynamicComponent(unref(item).isLink() ? "a" : "button"), mergeProps({ ref: "action" }, {
|
|
63
|
+
...unref(item).parts.action(),
|
|
64
|
+
...rest.value
|
|
65
|
+
}, { onClick }), {
|
|
66
|
+
default: withCtx(() => [createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.content())), [
|
|
67
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.indicator())), null, 16),
|
|
68
|
+
createElementVNode("span", mergeProps({ ref: "state" }, unref(item).parts.state()), null, 16),
|
|
69
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.icon())), [unref(item).showsBadge() ? (openBlock(), createBlock(_sfc_main$1, {
|
|
70
|
+
key: 0,
|
|
71
|
+
value: unref(item).badgeValue(),
|
|
72
|
+
locale: unref(locale)
|
|
73
|
+
}, {
|
|
74
|
+
default: withCtx(() => [unref(item).showsActiveIcon() ? renderSlot(_ctx.$slots, "active-icon", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)]),
|
|
75
|
+
_: 3
|
|
76
|
+
}, 8, ["value", "locale"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(item).showsActiveIcon() ? renderSlot(_ctx.$slots, "active-icon", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 64))], 16),
|
|
77
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.label())), toDisplayString(__props.label), 17)
|
|
78
|
+
], 16)]),
|
|
79
|
+
_: 3
|
|
80
|
+
}, 16))], 16);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NavigationRailMessages, NavigationRailProps, NavigationRailValue } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
5
|
+
import "@rio-m3e/styles/navigation-rail.css";
|
|
6
|
+
interface Props extends Omit<NavigationRailProps, 'active' | 'expanded'> {
|
|
7
|
+
/** The value of the active destination's item, with `v-model`. */
|
|
8
|
+
modelValue?: NavigationRailValue;
|
|
9
|
+
/** A language tag, for the menu button's name and badges' counts. Without it, the one provided, or the page's. */
|
|
10
|
+
locale?: string;
|
|
11
|
+
/** Replaces the menu button's name, the modal's, and what a small badge says. */
|
|
12
|
+
messages?: Partial<NavigationRailMessages>;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = Props;
|
|
15
|
+
type __VLS_Slots = {
|
|
16
|
+
/** The destinations (`RioNavigationRailItem`) and sections (`RioNavigationRailSection`) */
|
|
17
|
+
default?: () => unknown;
|
|
18
|
+
/** A FAB above the destinations: bind `expanded` to its `extended`, so it extends with the rail. */
|
|
19
|
+
fab?: (props: {
|
|
20
|
+
expanded: boolean;
|
|
21
|
+
}) => unknown;
|
|
22
|
+
/** The menu button's icon while the rail is collapsed, in place of the one the app registered (`expand-rail`) */
|
|
23
|
+
'expand-icon'?: () => unknown;
|
|
24
|
+
/** The menu button's icon while the rail is expanded, in place of the one the app registered (`collapse-rail`) */
|
|
25
|
+
'collapse-icon'?: () => unknown;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_ModelProps = {
|
|
28
|
+
/** Whether the rail is expanded, with `v-model:expanded`. */
|
|
29
|
+
'expanded'?: boolean;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:modelValue": (value: NavigationRailValue) => any;
|
|
34
|
+
"update:expanded": (value: boolean) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((value: NavigationRailValue) => any) | undefined;
|
|
37
|
+
"onUpdate:expanded"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export { _default as default };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icon-button/IconButton.vue.js";
|
|
2
|
+
import _sfc_main$2 from "../icon/Icon.vue.js";
|
|
3
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
4
|
+
import { keepPresses } from "../overlay/presses.js";
|
|
5
|
+
import { navigationRailKey } from "./context.js";
|
|
6
|
+
import { Teleport, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, openBlock, provide, ref, renderSlot, toHandlers, unref, useModel, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
7
|
+
import { attachNavigationRail, createNavigationRail } from "@rio-m3e/core";
|
|
8
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
9
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
10
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
11
|
+
import "@rio-m3e/styles/navigation-rail.css";
|
|
12
|
+
// src/navigation-rail/NavigationRail.vue
|
|
13
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
14
|
+
__name: "NavigationRail",
|
|
15
|
+
props: /*@__PURE__*/ mergeModels({
|
|
16
|
+
modelValue: {},
|
|
17
|
+
locale: {},
|
|
18
|
+
messages: {},
|
|
19
|
+
modal: { type: Boolean },
|
|
20
|
+
hideWhenCollapsed: { type: Boolean },
|
|
21
|
+
align: {},
|
|
22
|
+
menu: { type: Boolean },
|
|
23
|
+
label: {},
|
|
24
|
+
color: {}
|
|
25
|
+
}, {
|
|
26
|
+
"expanded": {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
"expandedModifiers": {}
|
|
31
|
+
}),
|
|
32
|
+
emits: /*@__PURE__*/ mergeModels(["update:modelValue"], ["update:expanded"]),
|
|
33
|
+
setup(__props, { emit: __emit }) {
|
|
34
|
+
/** Whether the rail is expanded, with `v-model:expanded`. */
|
|
35
|
+
const expanded = useModel(__props, "expanded");
|
|
36
|
+
const emit = __emit;
|
|
37
|
+
const slots = useSlots();
|
|
38
|
+
const resolvedLocale = useLocale(() => __props.locale);
|
|
39
|
+
const text = useMessages("navigationRail", resolvedLocale, () => __props.messages);
|
|
40
|
+
/** Whether the modal still shows: from expanding until its closing motion ends */
|
|
41
|
+
const modalShown = ref(false);
|
|
42
|
+
const rail = createNavigationRail({
|
|
43
|
+
props: () => ({
|
|
44
|
+
active: __props.modelValue,
|
|
45
|
+
expanded: expanded.value,
|
|
46
|
+
modal: __props.modal,
|
|
47
|
+
hideWhenCollapsed: __props.hideWhenCollapsed,
|
|
48
|
+
align: __props.align,
|
|
49
|
+
menu: __props.menu,
|
|
50
|
+
label: __props.label,
|
|
51
|
+
color: __props.color
|
|
52
|
+
}),
|
|
53
|
+
content: () => ({ fab: !!slots.fab }),
|
|
54
|
+
modalShown: () => modalShown.value,
|
|
55
|
+
messages: () => text.value,
|
|
56
|
+
onChange: (value) => emit("update:modelValue", value),
|
|
57
|
+
onExpandedChange: (next) => expanded.value = next
|
|
58
|
+
});
|
|
59
|
+
watch(rail.modalOpen, (open) => {
|
|
60
|
+
if (open) modalShown.value = true;
|
|
61
|
+
});
|
|
62
|
+
provide(navigationRailKey, {
|
|
63
|
+
isActive: rail.isActive,
|
|
64
|
+
choose: rail.choose,
|
|
65
|
+
locale: resolvedLocale,
|
|
66
|
+
messages: text
|
|
67
|
+
});
|
|
68
|
+
const root = useTemplateRef("root");
|
|
69
|
+
const modalElement = useTemplateRef("modal");
|
|
70
|
+
let handle;
|
|
71
|
+
onMounted(async () => {
|
|
72
|
+
handle = attachNavigationRail(root.value, {
|
|
73
|
+
onExpandedChange: (next) => expanded.value = next,
|
|
74
|
+
onModalClosed: () => {
|
|
75
|
+
if (!rail.modalOpen()) modalShown.value = false;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
await nextTick();
|
|
79
|
+
handle?.sync(rail.modalOpen());
|
|
80
|
+
});
|
|
81
|
+
watch(rail.modalOpen, (open) => handle?.sync(open), { flush: "post" });
|
|
82
|
+
onBeforeUpdate(() => handle?.capture(rail.parts.panel()["data-expanded"] !== void 0));
|
|
83
|
+
onUpdated(() => handle?.update());
|
|
84
|
+
onBeforeUnmount(() => {
|
|
85
|
+
handle?.detach();
|
|
86
|
+
handle = void 0;
|
|
87
|
+
});
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
90
|
+
ref_key: "root",
|
|
91
|
+
ref: root
|
|
92
|
+
}, unref(rail).parts.root()), [
|
|
93
|
+
unref(rail).showsModal() ? (openBlock(), createElementBlock("dialog", mergeProps({
|
|
94
|
+
key: 0,
|
|
95
|
+
ref: "modal"
|
|
96
|
+
}, unref(rail).parts.modal(), toHandlers(unref(keepPresses), true)), null, 16)) : createCommentVNode("v-if", true),
|
|
97
|
+
createCommentVNode(" Moves into the modal and back, so the destinations stay mounted, with their state. The\n modal is there from the first render on. "),
|
|
98
|
+
(openBlock(), createBlock(Teleport, {
|
|
99
|
+
to: modalElement.value,
|
|
100
|
+
disabled: !unref(rail).inModal() || !modalElement.value
|
|
101
|
+
}, [createElementVNode("nav", normalizeProps(guardReactiveProps(unref(rail).parts.panel())), [unref(rail).showsHeader() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(rail).parts.header())), [unref(rail).showsMenu() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(rail).parts.menu())), [createVNode(_sfc_main$1, mergeProps({
|
|
102
|
+
label: unref(text).menu,
|
|
103
|
+
variant: "standard"
|
|
104
|
+
}, unref(rail).menuButton(), { onClick: _cache[0] || (_cache[0] = ($event) => unref(rail).toggle()) }), {
|
|
105
|
+
default: withCtx(() => [unref(rail).expanded() ? renderSlot(_ctx.$slots, "collapse-icon", {}, () => [createVNode(_sfc_main$2, { alias: unref(rail).menuIcon() }, null, 8, ["alias"])], void 0, 0) : renderSlot(_ctx.$slots, "expand-icon", {}, () => [createVNode(_sfc_main$2, { alias: unref(rail).menuIcon() }, null, 8, ["alias"])], void 0, 1)]),
|
|
106
|
+
_: 3
|
|
107
|
+
}, 16, ["label"])], 16)) : createCommentVNode("v-if", true), unref(rail).showsFab() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, unref(rail).parts.fab())), [renderSlot(_ctx.$slots, "fab", { expanded: unref(rail).expanded() })], 16)) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true), createElementVNode("ul", normalizeProps(guardReactiveProps(unref(rail).parts.items())), [renderSlot(_ctx.$slots, "default")], 16)], 16)], 8, ["to", "disabled"]))
|
|
108
|
+
], 16);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AccentColor, NavigationRailValue } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
4
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
5
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
6
|
+
import "@rio-m3e/styles/navigation-rail.css";
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** Identifies the destination: the active one's is the rail's `v-model`. */
|
|
9
|
+
value?: NavigationRailValue;
|
|
10
|
+
/** The destination's name, under the icon or beside it */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Makes the item a link to this address. */
|
|
13
|
+
href?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A badge on the icon: `true` for a small one, a dot, or a count or a short label for a large
|
|
16
|
+
* one. Its text is read after the destination's name.
|
|
17
|
+
*/
|
|
18
|
+
badge?: boolean | number | string;
|
|
19
|
+
/**
|
|
20
|
+
* The theme color it takes while active: `'primary'`, `'tertiary'`, `'error'`, or a static color
|
|
21
|
+
* of the theme. Without it, the spec's, or the rail's color.
|
|
22
|
+
*/
|
|
23
|
+
color?: AccentColor;
|
|
24
|
+
/** The app's own click, after the item has chosen its destination */
|
|
25
|
+
onClick?: (event: MouseEvent) => void;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_Slots = {
|
|
28
|
+
/** The icon, outlined, for an inactive destination */
|
|
29
|
+
default?: () => unknown;
|
|
30
|
+
/** The icon while the destination is active, filled, in place of the default one */
|
|
31
|
+
'active-icon'?: () => unknown;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export { _default as default };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import _sfc_main$1 from "../badge/Badge.vue.js";
|
|
2
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
3
|
+
import { useRipple } from "../ripple/ripple.js";
|
|
4
|
+
import { navigationRailKey } from "./context.js";
|
|
5
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useSlots, useTemplateRef, withCtx } from "vue";
|
|
6
|
+
import { createNavigationRailItem } from "@rio-m3e/core";
|
|
7
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
8
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
9
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
10
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
11
|
+
import "@rio-m3e/styles/navigation-rail.css";
|
|
12
|
+
// src/navigation-rail/NavigationRailItem.vue
|
|
13
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
__name: "NavigationRailItem",
|
|
16
|
+
props: {
|
|
17
|
+
value: {},
|
|
18
|
+
label: {},
|
|
19
|
+
href: {},
|
|
20
|
+
badge: { type: [
|
|
21
|
+
Boolean,
|
|
22
|
+
Number,
|
|
23
|
+
String
|
|
24
|
+
] },
|
|
25
|
+
color: {},
|
|
26
|
+
onClick: { type: Function }
|
|
27
|
+
},
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const slots = useSlots();
|
|
31
|
+
const attrs = useAttrs();
|
|
32
|
+
const rest = computed(() => {
|
|
33
|
+
const { class: _class, style: _style, ...others } = attrs;
|
|
34
|
+
return others;
|
|
35
|
+
});
|
|
36
|
+
const rail = inject(navigationRailKey, void 0);
|
|
37
|
+
const locale = rail?.locale ?? useLocale(() => void 0);
|
|
38
|
+
const messages = rail?.messages ?? useMessages("navigationRail", locale, () => void 0);
|
|
39
|
+
const item = createNavigationRailItem({
|
|
40
|
+
props: () => ({
|
|
41
|
+
value: props.value,
|
|
42
|
+
label: props.label,
|
|
43
|
+
href: props.href,
|
|
44
|
+
badge: props.badge,
|
|
45
|
+
locale: locale.value,
|
|
46
|
+
color: props.color
|
|
47
|
+
}),
|
|
48
|
+
rail: () => rail ?? {
|
|
49
|
+
isActive: () => false,
|
|
50
|
+
choose: () => {}
|
|
51
|
+
},
|
|
52
|
+
content: () => ({ activeIcon: !!slots["active-icon"] }),
|
|
53
|
+
messages: () => messages.value
|
|
54
|
+
});
|
|
55
|
+
const onClick = (event) => {
|
|
56
|
+
if (item.handleClick(event)) props.onClick?.(event);
|
|
57
|
+
};
|
|
58
|
+
useRipple(useTemplateRef("action"), useTemplateRef("state"));
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return openBlock(), createElementBlock("li", mergeProps(unref(item).parts.root(), {
|
|
61
|
+
class: unref(attrs).class,
|
|
62
|
+
style: unref(attrs).style
|
|
63
|
+
}), [(openBlock(), createBlock(resolveDynamicComponent(unref(item).isLink() ? "a" : "button"), mergeProps({ ref: "action" }, {
|
|
64
|
+
...unref(item).parts.action(),
|
|
65
|
+
...rest.value
|
|
66
|
+
}, { onClick }), {
|
|
67
|
+
default: withCtx(() => [createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.content())), [
|
|
68
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.indicator())), null, 16),
|
|
69
|
+
createElementVNode("span", mergeProps({ ref: "state" }, unref(item).parts.state()), null, 16),
|
|
70
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.icon())), [unref(item).showsBadge() ? (openBlock(), createBlock(_sfc_main$1, {
|
|
71
|
+
key: 0,
|
|
72
|
+
value: unref(item).badgeValue(),
|
|
73
|
+
locale: unref(locale)
|
|
74
|
+
}, {
|
|
75
|
+
default: withCtx(() => [unref(item).showsActiveIcon() ? renderSlot(_ctx.$slots, "active-icon", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)]),
|
|
76
|
+
_: 3
|
|
77
|
+
}, 8, ["value", "locale"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(item).showsActiveIcon() ? renderSlot(_ctx.$slots, "active-icon", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 64))], 16),
|
|
78
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.label())), toDisplayString(__props.label), 17)
|
|
79
|
+
], 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.underLabel())), toDisplayString(__props.label), 17)]),
|
|
80
|
+
_: 3
|
|
81
|
+
}, 16))], 16);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NavigationRailSectionProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
4
|
+
import "@rio-m3e/styles/navigation-rail.css";
|
|
5
|
+
type __VLS_Slots = {
|
|
6
|
+
/** The section's destinations (`RioNavigationRailItem`), which only an expanded rail shows */
|
|
7
|
+
default?: () => unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<NavigationRailSectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NavigationRailSectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export { _default as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, useId } from "vue";
|
|
2
|
+
import { createNavigationRailSection } from "@rio-m3e/core";
|
|
3
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
4
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
5
|
+
import "@rio-m3e/styles/navigation-rail.css";
|
|
6
|
+
// src/navigation-rail/NavigationRailSection.vue
|
|
7
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
|
+
__name: "NavigationRailSection",
|
|
9
|
+
props: { label: {} },
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const section = createNavigationRailSection({
|
|
12
|
+
props: () => ({ label: __props.label }),
|
|
13
|
+
ids: { label: `${useId()}-label` }
|
|
14
|
+
});
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return openBlock(), createElementBlock("li", normalizeProps(guardReactiveProps(unref(section).parts.root())), [unref(section).showsLabel() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(section).parts.label())), toDisplayString(__props.label), 17)) : createCommentVNode("v-if", true), createElementVNode("ul", normalizeProps(guardReactiveProps(unref(section).parts.items())), [renderSlot(_ctx.$slots, "default")], 16)], 16);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "@rio-m3e/styles/base/overflow.css";
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
/** The item in the row */
|
|
4
|
+
default?: () => unknown;
|
|
5
|
+
/** What the menu holds in its place, such as a `RioMenuItem` */
|
|
6
|
+
menu?: () => unknown;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export { _default as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { overflowKey, useOverflowItem } from "./overflow.js";
|
|
2
|
+
import { createElementBlock, defineComponent, openBlock, provide, renderSlot, useSlots, useTemplateRef } from "vue";
|
|
3
|
+
import "@rio-m3e/styles/base/overflow.css";
|
|
4
|
+
// src/overflow/OverflowItem.vue
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
__name: "OverflowItem",
|
|
7
|
+
setup(__props) {
|
|
8
|
+
const slots = useSlots();
|
|
9
|
+
const root = useTemplateRef("root");
|
|
10
|
+
useOverflowItem({
|
|
11
|
+
element: () => root.value,
|
|
12
|
+
menu: () => slots.menu?.()
|
|
13
|
+
});
|
|
14
|
+
provide(overflowKey, null);
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return openBlock(), createElementBlock("div", {
|
|
17
|
+
ref_key: "root",
|
|
18
|
+
ref: root,
|
|
19
|
+
class: "rio-overflow-item"
|
|
20
|
+
}, [renderSlot(_ctx.$slots, "default")], 512);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export { _sfc_main as default };
|