@rio-m3e/vue 0.7.0 → 0.8.1

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.
Files changed (62) hide show
  1. package/dist/app-bar/AppBar.vue.js +3 -1
  2. package/dist/app-bar/context.js +3 -0
  3. package/dist/browser/rio-vue.css +366 -78
  4. package/dist/browser/rio-vue.global.js +21 -21
  5. package/dist/browser/rio-vue.js +21 -21
  6. package/dist/button-group/ButtonGroup.vue.d.ts +30 -20
  7. package/dist/button-group/ButtonGroup.vue.js +2 -1
  8. package/dist/checkbox/Checkbox.vue.d.ts +1 -0
  9. package/dist/checkbox/Checkbox.vue.js +3 -0
  10. package/dist/chip/AssistChip.vue.d.ts +1 -0
  11. package/dist/chip/AssistChip.vue.js +3 -0
  12. package/dist/chip/ChipSet.vue.d.ts +27 -16
  13. package/dist/chip/ChipSet.vue.js +6 -2
  14. package/dist/chip/FilterChip.vue.d.ts +19 -3
  15. package/dist/chip/FilterChip.vue.js +54 -8
  16. package/dist/chip/InputChip.vue.d.ts +1 -0
  17. package/dist/chip/InputChip.vue.js +3 -0
  18. package/dist/chip/SuggestionChip.vue.d.ts +1 -0
  19. package/dist/chip/SuggestionChip.vue.js +3 -0
  20. package/dist/date-picker/DatePicker.vue.js +14 -11
  21. package/dist/date-picker/DatePickerDialog.vue.js +13 -9
  22. package/dist/date-picker/DateRangePickerDialog.vue.js +19 -17
  23. package/dist/icon-button/IconButton.vue.d.ts +1 -0
  24. package/dist/icon-button/IconButton.vue.js +3 -0
  25. package/dist/index.d.ts +8 -6
  26. package/dist/index.js +8 -6
  27. package/dist/list/List.vue.d.ts +26 -16
  28. package/dist/list/List.vue.js +2 -1
  29. package/dist/list/ListItem.vue.d.ts +7 -1
  30. package/dist/list/ListItem.vue.js +12 -3
  31. package/dist/model/model.d.ts +8 -0
  32. package/dist/model/model.js +15 -0
  33. package/dist/navigation-bar/NavigationBar.vue.d.ts +21 -16
  34. package/dist/navigation-bar/NavigationBar.vue.js +1 -0
  35. package/dist/navigation-rail/NavigationRail.vue.d.ts +33 -32
  36. package/dist/navigation-rail/NavigationRail.vue.js +1 -0
  37. package/dist/overflow/OverflowMenu.vue.js +10 -12
  38. package/dist/radio/Radio.vue.d.ts +1 -0
  39. package/dist/radio/Radio.vue.js +3 -0
  40. package/dist/radio/RadioGroup.vue.d.ts +23 -21
  41. package/dist/radio/RadioGroup.vue.js +10 -8
  42. package/dist/rio/rio.js +2 -0
  43. package/dist/scroll-field/ScrollField.vue.d.ts +28 -12
  44. package/dist/scroll-field/ScrollField.vue.js +6 -4
  45. package/dist/select/Select.vue.d.ts +42 -39
  46. package/dist/select/Select.vue.js +8 -5
  47. package/dist/switch/Switch.vue.d.ts +1 -0
  48. package/dist/switch/Switch.vue.js +3 -0
  49. package/dist/tabs/Tab.vue.d.ts +8 -1
  50. package/dist/tabs/Tab.vue.js +51 -26
  51. package/dist/tabs/TabGroup.vue.d.ts +22 -18
  52. package/dist/tabs/TabGroup.vue.js +5 -5
  53. package/dist/tabs/Tabs.vue.d.ts +24 -21
  54. package/dist/tabs/Tabs.vue.js +28 -15
  55. package/dist/text-field/TextField.vue.d.ts +28 -26
  56. package/dist/text-field/TextField.vue.js +15 -16
  57. package/dist/theme/ThemeProvider.vue.d.ts +22 -0
  58. package/dist/theme/ThemeProvider.vue.js +26 -0
  59. package/dist/theme/context.d.ts +7 -0
  60. package/dist/theme/context.js +7 -0
  61. package/dist/tooltip/Tooltip.vue.js +10 -3
  62. package/package.json +6 -5
@@ -1,4 +1,5 @@
1
1
  import { useLocale } from "../locale/locale.js";
2
+ import { useValueModel } from "../model/model.js";
2
3
  import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, isMemoSame, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderList, toDisplayString, unref, useId, useModel, useTemplateRef } from "vue";
3
4
  import { attachScrollField, createScrollField } from "@rio-m3e/core";
4
5
  import "@rio-m3e/styles/base/accent.css";
@@ -12,8 +13,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
12
13
  min: {},
13
14
  max: {},
14
15
  step: {},
15
- options: {},
16
- format: { type: Function },
17
16
  label: {},
18
17
  loop: { type: Boolean },
19
18
  size: {},
@@ -24,7 +23,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
24
23
  color: {},
25
24
  disabled: { type: Boolean },
26
25
  softDisabled: { type: Boolean },
27
- modelValue: {}
26
+ modelValue: {},
27
+ options: {},
28
+ format: { type: Function },
29
+ modelModifiers: {}
28
30
  },
29
31
  emits: [
30
32
  "update:modelValue",
@@ -33,7 +35,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
33
35
  ],
34
36
  setup(__props) {
35
37
  const props = __props;
36
- const model = useModel(props, "modelValue");
38
+ const model = useValueModel(() => props.modelValue);
37
39
  const editing = useModel(props, "editing");
38
40
  const invalid = useModel(props, "invalid");
39
41
  const locale = useLocale(() => props.locale);
@@ -1,51 +1,54 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { SelectProps, SelectSelected, SelectValue } from "@rio-m3e/core";
2
3
  import "@rio-m3e/styles/base/accent.css";
4
+ import "@rio-m3e/styles/base/density.css";
3
5
  import "@rio-m3e/styles/base/reduced-motion.css";
4
6
  import "@rio-m3e/styles/base/direction.css";
5
7
  import "@rio-m3e/styles/base/anchored-position.css";
6
8
  import "@rio-m3e/styles/menu.css";
7
9
  import "@rio-m3e/styles/text-field.css";
8
10
  import "@rio-m3e/styles/select.css";
9
- type Props = Omit<SelectProps, 'selected' | 'open'>;
10
- type __VLS_Props = Props;
11
- type __VLS_Slots = {
12
- /** `RioSelectOption`s. Give each its `label` for the field to show it in a server render. */
13
- default?: () => unknown;
14
- /** An icon before the selection */
15
- 'leading-icon'?: () => unknown;
16
- /**
17
- * The dropdown arrow, such as arrow_drop_down. It turns over while the list is open. Without one,
18
- * the `dropdown` icon registered with `createRio`.
19
- */
20
- 'dropdown-icon'?: () => unknown;
21
- /**
22
- * The selection as the field shows it, in place of the selected options' labels separated by
23
- * commas. `labels` are in the order of the options.
24
- */
25
- value?: (props: {
26
- selected: SelectValue[];
27
- labels: string[];
28
- }) => unknown;
29
- };
30
- type __VLS_ModelProps = {
11
+ export interface Props<T extends SelectSelected> extends Omit<SelectProps, 'selected' | 'open'> {
31
12
  /** The selected value, or with `multiple`, the selected values, with `v-model`. */
32
- modelValue?: SelectSelected;
33
- /** Whether the list is open, with `v-model:open`. The select keeps it when it isn't bound. */
34
- 'open'?: boolean;
35
- };
36
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
37
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
38
- "update:open": (value: boolean) => any;
39
- "update:modelValue": (value: SelectSelected) => any;
40
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
41
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
42
- "onUpdate:modelValue"?: ((value: SelectSelected) => any) | undefined;
43
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
- declare const _default: typeof __VLS_export;
46
- type __VLS_WithSlots<T, S> = T & {
47
- new (): {
48
- $slots: S;
13
+ modelValue?: T;
14
+ /** The modifiers given to `v-model`, as `.trim` */
15
+ modelModifiers?: ModelModifiers;
16
+ }
17
+ declare const __VLS_export: <T extends SelectSelected>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
18
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<T> & {
19
+ /** Whether the list is open, with `v-model:open`. The select keeps it when it isn't bound. */
20
+ open?: boolean;
21
+ }) & {
22
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
23
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
24
+ }> & (typeof globalThis extends {
25
+ __VLS_PROPS_FALLBACK: infer P;
26
+ } ? P : {});
27
+ expose: (exposed: {}) => void;
28
+ attrs: any;
29
+ slots: {
30
+ /** `RioSelectOption`s. Give each its `label` for the field to show it in a server render. */
31
+ default?: () => unknown;
32
+ /** An icon before the selection */
33
+ 'leading-icon'?: () => unknown;
34
+ /**
35
+ * The dropdown arrow, such as arrow_drop_down. It turns over while the list is open. Without one,
36
+ * the `dropdown` icon registered with `createRio`.
37
+ */
38
+ 'dropdown-icon'?: () => unknown;
39
+ /**
40
+ * The selection as the field shows it, in place of the selected options' labels separated by
41
+ * commas. `labels` are in the order of the options.
42
+ */
43
+ value?: (props: {
44
+ selected: SelectValue[];
45
+ labels: string[];
46
+ }) => unknown;
49
47
  };
48
+ emit: ((evt: "update:modelValue", value: T) => void) & ((event: "update:open", value: boolean) => void);
49
+ }>) => import("vue").VNode & {
50
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
50
51
  };
52
+ declare const _default: typeof __VLS_export;
53
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
51
54
  export { _default as default };
@@ -1,10 +1,12 @@
1
1
  import { keepPresses } from "../overlay/presses.js";
2
+ import { useValueModel } from "../model/model.js";
2
3
  import _sfc_main$1 from "./AfterOptions.vue.js";
3
4
  import { selectKey } from "./context.js";
4
5
  import _sfc_main$2 from "../icon/Icon.vue.js";
5
6
  import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderList, renderSlot, shallowReactive, toDisplayString, toHandlers, unref, useAttrs, useId, useModel, useSlots, useTemplateRef, watch, withCtx } from "vue";
6
7
  import { attachSelect, createSelect, inDocumentOrder, mergePartAttrs } from "@rio-m3e/core";
7
8
  import "@rio-m3e/styles/base/accent.css";
9
+ import "@rio-m3e/styles/base/density.css";
8
10
  import "@rio-m3e/styles/base/reduced-motion.css";
9
11
  import "@rio-m3e/styles/base/direction.css";
10
12
  import "@rio-m3e/styles/base/anchored-position.css";
@@ -21,6 +23,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
21
23
  inheritAttrs: false,
22
24
  __name: "Select",
23
25
  props: /*@__PURE__*/ mergeModels({
26
+ modelValue: {},
27
+ modelModifiers: {},
24
28
  variant: {},
25
29
  label: {},
26
30
  multiple: { type: Boolean },
@@ -28,6 +32,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
28
32
  error: { type: Boolean },
29
33
  errorText: {},
30
34
  color: {},
35
+ density: {},
31
36
  required: { type: Boolean },
32
37
  disabled: { type: Boolean },
33
38
  name: {},
@@ -35,18 +40,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
35
40
  menuVariant: {},
36
41
  instant: { type: Boolean }
37
42
  }, {
38
- "modelValue": {},
39
- "modelModifiers": {},
40
43
  "open": {
41
44
  type: Boolean,
42
45
  default: false
43
46
  },
44
47
  "openModifiers": {}
45
48
  }),
46
- emits: ["update:modelValue", "update:open"],
49
+ emits: /*@__PURE__*/ mergeModels(["update:modelValue"], ["update:open"]),
47
50
  setup(__props) {
48
- /** The selected value, or with `multiple`, the selected values, with `v-model`. */
49
- const model = useModel(__props, "modelValue");
51
+ const model = useValueModel(() => __props.modelValue);
50
52
  /** Whether the list is open, with `v-model:open`. The select keeps it when it isn't bound. */
51
53
  const open = useModel(__props, "open");
52
54
  const slots = useSlots();
@@ -69,6 +71,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
69
71
  error: __props.error,
70
72
  errorText: __props.errorText,
71
73
  color: __props.color,
74
+ density: __props.density,
72
75
  required: __props.required,
73
76
  disabled: __props.disabled,
74
77
  name: __props.name,
@@ -1,5 +1,6 @@
1
1
  import { SwitchProps } 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/focus-ring.css";
4
5
  import "@rio-m3e/styles/base/reduced-motion.css";
5
6
  import "@rio-m3e/styles/base/ripple.css";
@@ -2,6 +2,7 @@ import { useRipple } from "../ripple/ripple.js";
2
2
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, unref, useSlots, useTemplateRef } from "vue";
3
3
  import { attachCheckable, attachSwitchHandle, createSwitch, mergePartAttrs } from "@rio-m3e/core";
4
4
  import "@rio-m3e/styles/base/accent.css";
5
+ import "@rio-m3e/styles/base/density.css";
5
6
  import "@rio-m3e/styles/base/focus-ring.css";
6
7
  import "@rio-m3e/styles/base/reduced-motion.css";
7
8
  import "@rio-m3e/styles/base/ripple.css";
@@ -13,6 +14,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
13
14
  props: {
14
15
  selected: { type: Boolean },
15
16
  color: {},
17
+ density: {},
16
18
  disabled: { type: Boolean },
17
19
  softDisabled: { type: Boolean }
18
20
  },
@@ -28,6 +30,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
28
30
  props: () => ({
29
31
  selected: __props.selected,
30
32
  color: __props.color,
33
+ density: __props.density,
31
34
  disabled: __props.disabled,
32
35
  softDisabled: __props.softDisabled
33
36
  }),
@@ -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, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
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 & {
@@ -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
- setup(__props) {
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 withDirectives((openBlock(), createElementBlock("button", mergeProps({
45
- ref_key: "root",
46
- ref: root
47
- }, unref(tab).parts.root(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(tab).handleClick && unref(tab).handleClick(...args)) }), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.content())), [
48
- unref(tab).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(tab).parts.icon())), [unref(tab).badgeOnIcon() ? (openBlock(), createBlock(_sfc_main$1, {
49
- key: 0,
50
- value: unref(tab).badgeValue(),
51
- locale: unref(locale)
52
- }, {
53
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
54
- _: 3
55
- }, 8, ["value", "locale"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16)) : createCommentVNode("v-if", true),
56
- createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.label())), toDisplayString(__props.label), 17),
57
- unref(tab).showsInlineBadge() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(tab).parts.badge())), [createVNode(_sfc_main$1, {
58
- value: unref(tab).badgeValue(),
59
- locale: unref(locale)
60
- }, null, 8, ["value", "locale"])], 16)) : createCommentVNode("v-if", true),
61
- createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.indicator())), null, 16)
62
- ], 16)], 16)), [[unref(vRipple)]]);
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
  });
@@ -1,22 +1,26 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { TabValue } from "@rio-m3e/core";
2
- type __VLS_Slots = {
3
- /** A `RioTabs` and its `RioTabPanel`s, wherever they sit inside */
4
- default?: () => unknown;
5
- };
6
- type __VLS_ModelProps = {
7
- /** The selected tab's value, with `v-model`, for the tab list and the panels inside the group */
8
- modelValue?: TabValue | undefined;
9
- };
10
- declare const __VLS_base: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- "update:modelValue": (value: TabValue | undefined) => any;
12
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
13
- "onUpdate:modelValue"?: ((value: TabValue | undefined) => any) | undefined;
14
- }>, {}, {}, {}, {}, 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;
3
+ declare const __VLS_export: <T extends TabValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
5
+ /** The selected tab's value, with `v-model`, for the tab list and the panels inside the group */
6
+ modelValue?: T;
7
+ /** The modifiers given to `v-model`, as `.trim` */
8
+ modelModifiers?: ModelModifiers;
9
+ } & {
10
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
11
+ }> & (typeof globalThis extends {
12
+ __VLS_PROPS_FALLBACK: infer P;
13
+ } ? P : {});
14
+ expose: (exposed: {}) => void;
15
+ attrs: any;
16
+ slots: {
17
+ /** A `RioTabs` and its `RioTabPanel`s, wherever they sit inside */
18
+ default?: () => unknown;
20
19
  };
20
+ emit: (evt: "update:modelValue", value: T) => void;
21
+ }>) => import("vue").VNode & {
22
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
21
23
  };
24
+ declare const _default: typeof __VLS_export;
25
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
22
26
  export { _default as default };
@@ -1,17 +1,17 @@
1
+ import { useValueModel } from "../model/model.js";
1
2
  import { tabGroupKey } from "./context.js";
2
- import { defineComponent, provide, renderSlot, useId, useModel } from "vue";
3
+ import { defineComponent, provide, renderSlot, useId } from "vue";
3
4
  import { createTabGroup } from "@rio-m3e/core";
4
5
  // src/tabs/TabGroup.vue
5
- /** The selected tab's value, with `v-model`, for the tab list and the panels inside the group */
6
6
  const _sfc_main = /*@__PURE__*/ defineComponent({
7
7
  __name: "TabGroup",
8
8
  props: {
9
- "modelValue": {},
10
- "modelModifiers": {}
9
+ modelValue: {},
10
+ modelModifiers: {}
11
11
  },
12
12
  emits: ["update:modelValue"],
13
13
  setup(__props) {
14
- const model = useModel(__props, "modelValue");
14
+ const model = useValueModel(() => __props.modelValue);
15
15
  provide(tabGroupKey, createTabGroup({
16
16
  props: () => ({ selected: model.value }),
17
17
  onChange: (next) => model.value = next,
@@ -1,32 +1,35 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { TabValue, TabsMessages, TabsProps } from "@rio-m3e/core";
3
+ import "@rio-m3e/styles/base/accent.css";
4
+ import "@rio-m3e/styles/base/density.css";
2
5
  import "@rio-m3e/styles/base/reduced-motion.css";
3
6
  import "@rio-m3e/styles/tabs.css";
4
- interface Props extends Omit<TabsProps, 'selected'> {
7
+ export interface Props<T extends TabValue> extends Omit<TabsProps, 'selected'> {
8
+ /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
9
+ modelValue?: T;
5
10
  /** A language tag, for badges' counts. Without it, the one provided, or the page's. */
6
11
  locale?: string;
7
12
  /** Replaces what a small badge says. */
8
13
  messages?: Partial<TabsMessages>;
14
+ /** The modifiers given to `v-model`, as `.trim` */
15
+ modelModifiers?: ModelModifiers;
9
16
  }
10
- type __VLS_Props = Props;
11
- type __VLS_Slots = {
12
- /** The tabs (`RioTab`) */
13
- default?: () => unknown;
14
- };
15
- type __VLS_ModelProps = {
16
- /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
17
- modelValue?: TabValue | undefined;
18
- };
19
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
20
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
- "update:modelValue": (value: TabValue | undefined) => any;
22
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
- "onUpdate:modelValue"?: ((value: TabValue | undefined) => any) | undefined;
24
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
- declare const _default: typeof __VLS_export;
27
- type __VLS_WithSlots<T, S> = T & {
28
- new (): {
29
- $slots: S;
17
+ declare const __VLS_export: <T extends TabValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
18
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<Props<T> & {
19
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
20
+ }> & (typeof globalThis extends {
21
+ __VLS_PROPS_FALLBACK: infer P;
22
+ } ? P : {});
23
+ expose: (exposed: {}) => void;
24
+ attrs: any;
25
+ slots: {
26
+ /** The tabs (`RioTab`) */
27
+ default?: () => unknown;
30
28
  };
29
+ emit: (evt: "update:modelValue", value: T) => void;
30
+ }>) => import("vue").VNode & {
31
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
31
32
  };
33
+ declare const _default: typeof __VLS_export;
34
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
32
35
  export { _default as default };
@@ -1,7 +1,10 @@
1
1
  import { useLocale, useMessages } from "../locale/locale.js";
2
+ import { useValueModel } from "../model/model.js";
2
3
  import { tabGroupKey, tabsKey } from "./context.js";
3
- import { createElementBlock, createElementVNode, defineComponent, inject, mergeModels, mergeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderSlot, shallowRef, unref, useModel, useTemplateRef, watch } from "vue";
4
+ import { createElementBlock, createElementVNode, defineComponent, inject, mergeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderSlot, shallowRef, unref, useTemplateRef, watch } from "vue";
4
5
  import { attachTabs, createTabs, inDocumentOrder, mergePartAttrs } from "@rio-m3e/core";
6
+ import "@rio-m3e/styles/base/accent.css";
7
+ import "@rio-m3e/styles/base/density.css";
5
8
  import "@rio-m3e/styles/base/reduced-motion.css";
6
9
  import "@rio-m3e/styles/tabs.css";
7
10
  // src/tabs/Tabs.vue
@@ -9,27 +12,31 @@ import "@rio-m3e/styles/tabs.css";
9
12
  const _sfc_main = /*@__PURE__*/ defineComponent({
10
13
  inheritAttrs: false,
11
14
  __name: "Tabs",
12
- props: /*@__PURE__*/ mergeModels({
15
+ props: {
16
+ modelValue: {},
13
17
  locale: {},
14
18
  messages: {},
19
+ modelModifiers: {},
15
20
  variant: {},
16
21
  scrollable: { type: Boolean },
17
22
  align: {},
18
23
  iconOnly: { type: Boolean },
19
- label: {}
20
- }, {
21
- "modelValue": {},
22
- "modelModifiers": {}
23
- }),
24
+ tooltips: {
25
+ type: Boolean,
26
+ default: () => void 0
27
+ },
28
+ label: {},
29
+ color: {},
30
+ density: {}
31
+ },
24
32
  emits: ["update:modelValue"],
25
33
  setup(__props) {
26
- /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
27
- const model = useModel(__props, "modelValue");
34
+ const model = useValueModel(() => __props.modelValue);
28
35
  const group = inject(tabGroupKey, void 0);
29
36
  const registered = shallowRef([]);
30
37
  /**
31
- * The tabs' values in the page's order, once each has its element; until then, as they registered,
32
- * as on a server
38
+ * The tabs' values, in the page's order, once each has its element; until then, as they
39
+ * registered, as on a server
33
40
  */
34
41
  const values = () => inDocumentOrder(registered.value, (tab) => tab.element()).map((tab) => tab.value());
35
42
  const tabs = createTabs({
@@ -39,11 +46,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
39
46
  scrollable: __props.scrollable,
40
47
  align: __props.align,
41
48
  iconOnly: __props.iconOnly,
42
- label: __props.label
49
+ tooltips: __props.tooltips,
50
+ label: __props.label,
51
+ color: __props.color,
52
+ density: __props.density
43
53
  }),
44
54
  onChange: (next) => model.value = next,
45
55
  group: () => group,
46
- values
56
+ values,
57
+ disabled: (value) => registered.value.some((tab) => tab.value() === value && tab.disabled())
47
58
  });
48
59
  const resolvedLocale = useLocale(() => __props.locale);
49
60
  const text = useMessages("tabs", resolvedLocale, () => __props.messages);
@@ -54,12 +65,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
54
65
  ids: tabs.ids,
55
66
  variant: tabs.variant,
56
67
  iconOnly: tabs.iconOnly,
68
+ tooltips: tabs.tooltips,
57
69
  locale: resolvedLocale,
58
70
  messages: text,
59
- register(value, element) {
71
+ register(value, element, disabled) {
60
72
  const tab = {
61
73
  value,
62
- element
74
+ element,
75
+ disabled
63
76
  };
64
77
  registered.value = [...registered.value, tab];
65
78
  return () => registered.value = registered.value.filter((other) => other !== tab);