@rio-m3e/vue 0.7.0 → 0.8.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/dist/app-bar/AppBar.vue.js +3 -1
- package/dist/app-bar/context.js +3 -0
- package/dist/browser/rio-vue.css +366 -78
- package/dist/browser/rio-vue.global.js +21 -21
- package/dist/browser/rio-vue.js +21 -21
- 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 +19 -3
- package/dist/chip/FilterChip.vue.js +54 -8
- 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/icon-button/IconButton.vue.d.ts +1 -0
- package/dist/icon-button/IconButton.vue.js +3 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +8 -6
- package/dist/list/ListItem.vue.d.ts +7 -1
- package/dist/list/ListItem.vue.js +12 -3
- package/dist/radio/Radio.vue.d.ts +1 -0
- package/dist/radio/Radio.vue.js +3 -0
- package/dist/radio/RadioGroup.vue.d.ts +1 -0
- package/dist/radio/RadioGroup.vue.js +3 -0
- package/dist/rio/rio.js +2 -0
- package/dist/select/Select.vue.d.ts +1 -0
- package/dist/select/Select.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 +8 -1
- package/dist/tabs/Tab.vue.js +51 -26
- package/dist/tabs/Tabs.vue.d.ts +2 -0
- package/dist/tabs/Tabs.vue.js +21 -7
- package/dist/text-field/TextField.vue.d.ts +1 -0
- package/dist/text-field/TextField.vue.js +3 -0
- package/dist/theme/ThemeProvider.vue.d.ts +22 -0
- package/dist/theme/ThemeProvider.vue.js +26 -0
- package/dist/theme/context.d.ts +7 -0
- package/dist/theme/context.js +7 -0
- package/dist/tooltip/Tooltip.vue.js +10 -3
- package/package.json +4 -4
package/dist/tabs/Tab.vue.d.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { TabProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/density.css";
|
|
2
4
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
5
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
6
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
7
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
5
8
|
import "@rio-m3e/styles/tabs.css";
|
|
6
9
|
type __VLS_Props = Omit<TabProps, 'locale'>;
|
|
7
10
|
type __VLS_Slots = {
|
|
8
11
|
/** The icon: over the label in primary tabs, beside it in secondary ones, or alone */
|
|
9
12
|
default?: () => unknown;
|
|
10
13
|
};
|
|
11
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
click: (event: MouseEvent) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
19
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
20
|
declare const _default: typeof __VLS_export;
|
|
14
21
|
type __VLS_WithSlots<T, S> = T & {
|
package/dist/tabs/Tab.vue.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import _sfc_main$1 from "../badge/Badge.vue.js";
|
|
2
2
|
import { useLocale, useMessages } from "../locale/locale.js";
|
|
3
3
|
import { vRipple } from "../ripple/ripple.js";
|
|
4
|
+
import _sfc_main$2 from "../tooltip/Tooltip.vue.js";
|
|
4
5
|
import { tabsKey } from "./context.js";
|
|
5
|
-
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, onBeforeUnmount, openBlock, renderSlot, toDisplayString, unref, useSlots, useTemplateRef, withCtx, withDirectives } from "vue";
|
|
6
|
-
import { createTab } from "@rio-m3e/core";
|
|
6
|
+
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, h, inject, mergeProps, normalizeProps, onBeforeUnmount, openBlock, renderSlot, toDisplayString, unref, useSlots, useTemplateRef, withCtx, withDirectives } from "vue";
|
|
7
|
+
import { createTab, mergePartAttrs } from "@rio-m3e/core";
|
|
8
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
9
|
+
import "@rio-m3e/styles/base/density.css";
|
|
7
10
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
8
11
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
9
12
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
13
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
10
14
|
import "@rio-m3e/styles/tabs.css";
|
|
11
15
|
// src/tabs/Tab.vue
|
|
12
16
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
|
+
inheritAttrs: false,
|
|
13
18
|
__name: "Tab",
|
|
14
19
|
props: {
|
|
15
20
|
value: {},
|
|
@@ -18,10 +23,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
18
23
|
Boolean,
|
|
19
24
|
Number,
|
|
20
25
|
String
|
|
21
|
-
] }
|
|
26
|
+
] },
|
|
27
|
+
disabled: { type: Boolean },
|
|
28
|
+
softDisabled: { type: Boolean }
|
|
22
29
|
},
|
|
23
|
-
|
|
30
|
+
emits: ["click"],
|
|
31
|
+
setup(__props, { emit: __emit }) {
|
|
24
32
|
const props = __props;
|
|
33
|
+
const emit = __emit;
|
|
25
34
|
const slots = useSlots();
|
|
26
35
|
const tabs = inject(tabsKey, void 0);
|
|
27
36
|
const locale = tabs?.locale ?? useLocale(() => void 0);
|
|
@@ -31,35 +40,51 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
31
40
|
value: props.value,
|
|
32
41
|
label: props.label,
|
|
33
42
|
badge: props.badge,
|
|
34
|
-
locale: locale.value
|
|
43
|
+
locale: locale.value,
|
|
44
|
+
disabled: props.disabled,
|
|
45
|
+
softDisabled: props.softDisabled
|
|
35
46
|
}),
|
|
36
47
|
tabs: () => tabs,
|
|
37
48
|
content: () => ({ icon: !!slots.default }),
|
|
38
|
-
messages: () => messages.value
|
|
49
|
+
messages: () => messages.value,
|
|
50
|
+
onClick: (event) => emit("click", event)
|
|
39
51
|
});
|
|
52
|
+
/** Wraps the tab in a plain tooltip of its label while it shows its icon alone. */
|
|
53
|
+
const WithTooltip = (_, { slots }) => tab.showsTooltip() ? h(_sfc_main$2, { text: props.label }, slots) : slots.default?.();
|
|
40
54
|
const root = useTemplateRef("root");
|
|
41
|
-
const unregister = tabs?.register(() => props.value, () => root.value);
|
|
55
|
+
const unregister = tabs?.register(() => props.value, () => root.value, () => !!props.disabled);
|
|
42
56
|
onBeforeUnmount(() => unregister?.());
|
|
43
57
|
return (_ctx, _cache) => {
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
return openBlock(), createBlock(WithTooltip, null, {
|
|
59
|
+
default: withCtx(() => [withDirectives((openBlock(), createElementBlock("button", mergeProps({
|
|
60
|
+
ref_key: "root",
|
|
61
|
+
ref: root
|
|
62
|
+
}, unref(mergePartAttrs)({
|
|
63
|
+
..._ctx.$attrs,
|
|
64
|
+
class: void 0,
|
|
65
|
+
style: void 0
|
|
66
|
+
}, unref(tab).parts.root()), {
|
|
67
|
+
class: _ctx.$attrs.class,
|
|
68
|
+
style: _ctx.$attrs.style,
|
|
69
|
+
onClick: _cache[0] || (_cache[0] = (...args) => unref(tab).handleClick && unref(tab).handleClick(...args))
|
|
70
|
+
}), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.touch())), null, 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.content())), [
|
|
71
|
+
unref(tab).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(tab).parts.icon())), [unref(tab).badgeOnIcon() ? (openBlock(), createBlock(_sfc_main$1, {
|
|
72
|
+
key: 0,
|
|
73
|
+
value: unref(tab).badgeValue(),
|
|
74
|
+
locale: unref(locale)
|
|
75
|
+
}, {
|
|
76
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
77
|
+
_: 3
|
|
78
|
+
}, 8, ["value", "locale"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16)) : createCommentVNode("v-if", true),
|
|
79
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.label())), toDisplayString(__props.label), 17),
|
|
80
|
+
unref(tab).showsInlineBadge() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(tab).parts.badge())), [createVNode(_sfc_main$1, {
|
|
81
|
+
value: unref(tab).badgeValue(),
|
|
82
|
+
locale: unref(locale)
|
|
83
|
+
}, null, 8, ["value", "locale"])], 16)) : createCommentVNode("v-if", true),
|
|
84
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.indicator())), null, 16)
|
|
85
|
+
], 16)], 16)), [[unref(vRipple)]])]),
|
|
86
|
+
_: 3
|
|
87
|
+
});
|
|
63
88
|
};
|
|
64
89
|
}
|
|
65
90
|
});
|
package/dist/tabs/Tabs.vue.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TabValue, TabsMessages, TabsProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/density.css";
|
|
2
4
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
3
5
|
import "@rio-m3e/styles/tabs.css";
|
|
4
6
|
interface Props extends Omit<TabsProps, 'selected'> {
|
package/dist/tabs/Tabs.vue.js
CHANGED
|
@@ -2,6 +2,8 @@ import { useLocale, useMessages } from "../locale/locale.js";
|
|
|
2
2
|
import { tabGroupKey, tabsKey } from "./context.js";
|
|
3
3
|
import { createElementBlock, createElementVNode, defineComponent, inject, mergeModels, mergeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderSlot, shallowRef, unref, useModel, useTemplateRef, watch } from "vue";
|
|
4
4
|
import { attachTabs, createTabs, inDocumentOrder, mergePartAttrs } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
6
|
+
import "@rio-m3e/styles/base/density.css";
|
|
5
7
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
6
8
|
import "@rio-m3e/styles/tabs.css";
|
|
7
9
|
// src/tabs/Tabs.vue
|
|
@@ -16,7 +18,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
16
18
|
scrollable: { type: Boolean },
|
|
17
19
|
align: {},
|
|
18
20
|
iconOnly: { type: Boolean },
|
|
19
|
-
|
|
21
|
+
tooltips: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: () => void 0
|
|
24
|
+
},
|
|
25
|
+
label: {},
|
|
26
|
+
color: {},
|
|
27
|
+
density: {}
|
|
20
28
|
}, {
|
|
21
29
|
"modelValue": {},
|
|
22
30
|
"modelModifiers": {}
|
|
@@ -28,8 +36,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
28
36
|
const group = inject(tabGroupKey, void 0);
|
|
29
37
|
const registered = shallowRef([]);
|
|
30
38
|
/**
|
|
31
|
-
* The tabs' values in the page's order, once each has its element; until then, as they
|
|
32
|
-
* as on a server
|
|
39
|
+
* The tabs' values, in the page's order, once each has its element; until then, as they
|
|
40
|
+
* registered, as on a server
|
|
33
41
|
*/
|
|
34
42
|
const values = () => inDocumentOrder(registered.value, (tab) => tab.element()).map((tab) => tab.value());
|
|
35
43
|
const tabs = createTabs({
|
|
@@ -39,11 +47,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
39
47
|
scrollable: __props.scrollable,
|
|
40
48
|
align: __props.align,
|
|
41
49
|
iconOnly: __props.iconOnly,
|
|
42
|
-
|
|
50
|
+
tooltips: __props.tooltips,
|
|
51
|
+
label: __props.label,
|
|
52
|
+
color: __props.color,
|
|
53
|
+
density: __props.density
|
|
43
54
|
}),
|
|
44
55
|
onChange: (next) => model.value = next,
|
|
45
56
|
group: () => group,
|
|
46
|
-
values
|
|
57
|
+
values,
|
|
58
|
+
disabled: (value) => registered.value.some((tab) => tab.value() === value && tab.disabled())
|
|
47
59
|
});
|
|
48
60
|
const resolvedLocale = useLocale(() => __props.locale);
|
|
49
61
|
const text = useMessages("tabs", resolvedLocale, () => __props.messages);
|
|
@@ -54,12 +66,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
54
66
|
ids: tabs.ids,
|
|
55
67
|
variant: tabs.variant,
|
|
56
68
|
iconOnly: tabs.iconOnly,
|
|
69
|
+
tooltips: tabs.tooltips,
|
|
57
70
|
locale: resolvedLocale,
|
|
58
71
|
messages: text,
|
|
59
|
-
register(value, element) {
|
|
72
|
+
register(value, element, disabled) {
|
|
60
73
|
const tab = {
|
|
61
74
|
value,
|
|
62
|
-
element
|
|
75
|
+
element,
|
|
76
|
+
disabled
|
|
63
77
|
};
|
|
64
78
|
registered.value = [...registered.value, tab];
|
|
65
79
|
return () => registered.value = registered.value.filter((other) => other !== tab);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TextFieldMessages, TextFieldProps } from "@rio-m3e/core";
|
|
2
2
|
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/density.css";
|
|
3
4
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
5
|
import "@rio-m3e/styles/text-field.css";
|
|
5
6
|
interface Props extends Omit<TextFieldProps, 'value'> {
|
|
@@ -3,6 +3,7 @@ import { useLocale, useMessages } from "../locale/locale.js";
|
|
|
3
3
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useSlots, useTemplateRef, vModelDynamic, vModelText, withDirectives } from "vue";
|
|
4
4
|
import { attachTextField, createTextField, mergePartAttrs } from "@rio-m3e/core";
|
|
5
5
|
import "@rio-m3e/styles/base/accent.css";
|
|
6
|
+
import "@rio-m3e/styles/base/density.css";
|
|
6
7
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
7
8
|
import "@rio-m3e/styles/text-field.css";
|
|
8
9
|
// src/text-field/TextField.vue
|
|
@@ -24,6 +25,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
24
25
|
error: { type: Boolean },
|
|
25
26
|
errorText: {},
|
|
26
27
|
color: {},
|
|
28
|
+
density: {},
|
|
27
29
|
maxlength: {},
|
|
28
30
|
required: { type: Boolean },
|
|
29
31
|
disabled: { type: Boolean },
|
|
@@ -66,6 +68,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
66
68
|
error: __props.error,
|
|
67
69
|
errorText: __props.errorText,
|
|
68
70
|
color: __props.color,
|
|
71
|
+
density: __props.density,
|
|
69
72
|
maxlength: __props.maxlength,
|
|
70
73
|
required: __props.required,
|
|
71
74
|
disabled: __props.disabled,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RioThemeOptions } from "../rio/rio.js";
|
|
2
|
+
import "@rio-m3e/styles/theme-provider.css";
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/**
|
|
5
|
+
* The theme for what is inside, over the one around it: what it leaves out, or gives as
|
|
6
|
+
* `undefined`, as the shapes or the typefaces, stays the outer theme's. Its `colorScheme` makes
|
|
7
|
+
* the part light or dark; without one, the part follows the page's.
|
|
8
|
+
*/
|
|
9
|
+
theme?: Partial<RioThemeOptions>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
};
|
|
14
|
+
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>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export { _default as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { localeKey } from "../locale/locale.js";
|
|
2
|
+
import { themeKey } from "./context.js";
|
|
3
|
+
import { computed, createElementBlock, defineComponent, guardReactiveProps, inject, normalizeProps, openBlock, provide, renderSlot, unref } from "vue";
|
|
4
|
+
import { createThemeProvider, resolveLocale } from "@rio-m3e/core";
|
|
5
|
+
import { createThemeStyle, languageHeightOf, nestThemeOptions } from "@rio-m3e/tokens";
|
|
6
|
+
import "@rio-m3e/styles/theme-provider.css";
|
|
7
|
+
// src/theme/ThemeProvider.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
__name: "ThemeProvider",
|
|
10
|
+
props: { theme: {} },
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const outer = inject(themeKey, void 0);
|
|
13
|
+
const locale = inject(localeKey, void 0);
|
|
14
|
+
/** The options, nested over the outer theme's, which a provider inside nests its own over */
|
|
15
|
+
const nested = computed(() => nestThemeOptions(outer?.value, __props.theme));
|
|
16
|
+
provide(themeKey, nested);
|
|
17
|
+
const provider = createThemeProvider({ style: () => createThemeStyle({
|
|
18
|
+
...nested.value,
|
|
19
|
+
languageHeight: nested.value.languageHeight ?? languageHeightOf(resolveLocale(locale?.value))
|
|
20
|
+
}) });
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(provider).parts.root())), [renderSlot(_ctx.$slots, "default")], 16);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RioThemeOptions } from "../rio/rio.js";
|
|
2
|
+
import { ComputedRef, InjectionKey } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* What `createRio` and each `RioThemeProvider` give what is inside them: the theme's options,
|
|
5
|
+
* which a provider inside nests its own over
|
|
6
|
+
*/
|
|
7
|
+
export declare const themeKey: InjectionKey<ComputedRef<Partial<RioThemeOptions> | undefined>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { appBarKey } from "../app-bar/context.js";
|
|
1
2
|
import { keepPresses } from "../overlay/presses.js";
|
|
2
|
-
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, watch } from "vue";
|
|
3
|
+
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, guardReactiveProps, inject, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, watch } from "vue";
|
|
3
4
|
import { attachTooltip, createTooltip } from "@rio-m3e/core";
|
|
4
5
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
5
6
|
import "@rio-m3e/styles/base/anchored-position.css";
|
|
@@ -31,6 +32,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
31
32
|
const open = useModel(__props, "open");
|
|
32
33
|
const slots = useSlots();
|
|
33
34
|
const id = useId();
|
|
35
|
+
const appBar = inject(appBarKey, null);
|
|
36
|
+
/** Whether the element's name already holds the text, as `attachTooltip` finds */
|
|
37
|
+
const repeatsName = ref(false);
|
|
34
38
|
const tooltip = createTooltip({
|
|
35
39
|
props: () => ({
|
|
36
40
|
variant: __props.variant,
|
|
@@ -48,7 +52,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
48
52
|
root: `${id}-tooltip`,
|
|
49
53
|
subhead: `${id}-subhead`,
|
|
50
54
|
supportingText: `${id}-text`
|
|
51
|
-
}
|
|
55
|
+
},
|
|
56
|
+
inAppBar: () => !!appBar,
|
|
57
|
+
repeatsName: () => repeatsName.value
|
|
52
58
|
});
|
|
53
59
|
const trigger = useTemplateRef("trigger");
|
|
54
60
|
const root = useTemplateRef("root");
|
|
@@ -58,7 +64,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
58
64
|
placement: tooltip.placement,
|
|
59
65
|
persistent: tooltip.persistent,
|
|
60
66
|
interactive: tooltip.interactive,
|
|
61
|
-
onOpenChange: (next) => open.value = next
|
|
67
|
+
onOpenChange: (next) => open.value = next,
|
|
68
|
+
onRepeatsNameChange: (next) => repeatsName.value = next
|
|
62
69
|
});
|
|
63
70
|
handle.sync(open.value);
|
|
64
71
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rio-m3e/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Vue components for Rio, a Material 3 Expressive implementation",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "LegenLee",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@rio-m3e/core": "^0.
|
|
33
|
-
"@rio-m3e/styles": "^0.
|
|
34
|
-
"@rio-m3e/tokens": "^0.
|
|
32
|
+
"@rio-m3e/core": "^0.8.0",
|
|
33
|
+
"@rio-m3e/styles": "^0.8.0",
|
|
34
|
+
"@rio-m3e/tokens": "^0.8.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@fontsource/roboto": "^5.3.0",
|