@rio-m3e/vue 0.8.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.
@@ -1,31 +1,32 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { RadioGroupProps, RadioValue } from "@rio-m3e/core";
2
3
  import "@rio-m3e/styles/base/accent.css";
3
4
  import "@rio-m3e/styles/base/density.css";
4
5
  import "@rio-m3e/styles/radio.css";
5
- interface Props extends RadioGroupProps {
6
+ export interface Props<T extends RadioValue> extends RadioGroupProps {
7
+ /** The selected radio button's value, with `v-model`. */
8
+ modelValue?: T;
6
9
  /** The `name` the radio buttons submit their value under. Defaults to a unique one. */
7
10
  name?: string;
11
+ /** The modifiers given to `v-model`, as `.trim` */
12
+ modelModifiers?: ModelModifiers;
8
13
  }
9
- type __VLS_Props = Props;
10
- type __VLS_Slots = {
11
- /** `RioRadio`s, each in a `<label>` with its text */
12
- default?: () => unknown;
13
- };
14
- type __VLS_ModelProps = {
15
- /** The selected radio button's value, with `v-model`. */
16
- modelValue?: RadioValue | undefined;
17
- };
18
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
- "update:modelValue": (value: RadioValue | undefined) => any;
21
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
- "onUpdate:modelValue"?: ((value: RadioValue | undefined) => 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;
14
+ declare const __VLS_export: <T extends RadioValue>(__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<{
15
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<Props<T> & {
16
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
17
+ }> & (typeof globalThis extends {
18
+ __VLS_PROPS_FALLBACK: infer P;
19
+ } ? P : {});
20
+ expose: (exposed: {}) => void;
21
+ attrs: any;
22
+ slots: {
23
+ /** `RioRadio`s, each in a `<label>` with its text */
24
+ default?: () => unknown;
29
25
  };
26
+ emit: (evt: "update:modelValue", value: T) => void;
27
+ }>) => import("vue").VNode & {
28
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
30
29
  };
30
+ declare const _default: typeof __VLS_export;
31
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
31
32
  export { _default as default };
@@ -1,5 +1,6 @@
1
1
  import { radioGroupKey } from "./context.js";
2
- import { createElementBlock, defineComponent, mergeModels, mergeProps, nextTick, onBeforeUnmount, onMounted, openBlock, provide, renderSlot, unref, useId, useModel, useTemplateRef, watch } from "vue";
2
+ import { useValueModel } from "../model/model.js";
3
+ import { createElementBlock, defineComponent, mergeProps, nextTick, onBeforeUnmount, onMounted, openBlock, provide, renderSlot, unref, useId, useTemplateRef, watch } from "vue";
3
4
  import { attachRadioGroup, createRadioGroup } from "@rio-m3e/core";
4
5
  import "@rio-m3e/styles/base/accent.css";
5
6
  import "@rio-m3e/styles/base/density.css";
@@ -7,20 +8,18 @@ import "@rio-m3e/styles/radio.css";
7
8
  // src/radio/RadioGroup.vue
8
9
  const _sfc_main = /*@__PURE__*/ defineComponent({
9
10
  __name: "RadioGroup",
10
- props: /*@__PURE__*/ mergeModels({
11
+ props: {
12
+ modelValue: {},
11
13
  name: {},
14
+ modelModifiers: {},
12
15
  label: {},
13
16
  color: {},
14
17
  density: {},
15
18
  disabled: { type: Boolean }
16
- }, {
17
- "modelValue": {},
18
- "modelModifiers": {}
19
- }),
19
+ },
20
20
  emits: ["update:modelValue"],
21
21
  setup(__props) {
22
- /** The selected radio button's value, with `v-model`. */
23
- const model = useModel(__props, "modelValue");
22
+ const model = useValueModel(() => __props.modelValue);
24
23
  const group = createRadioGroup({ props: () => ({
25
24
  label: __props.label,
26
25
  color: __props.color,
@@ -1,20 +1,36 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { ScrollFieldProps, ScrollFieldValue } from "@rio-m3e/core";
2
3
  import "@rio-m3e/styles/base/accent.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/scroll-field.css";
6
- type __VLS_Props = Omit<ScrollFieldProps, 'value'> & {
7
- /** The value in the middle, with `v-model`. */
8
- modelValue?: ScrollFieldValue;
7
+ declare const __VLS_export: <T extends ScrollFieldValue>(__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<{
8
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(Omit<ScrollFieldProps, "value" | "options" | "format"> & {
9
+ /** The value in the middle, with `v-model`. */
10
+ modelValue?: T;
11
+ /** The values it takes, in order, in place of `min`, `max`, and `step`. */
12
+ options?: readonly T[];
13
+ /**
14
+ * Writes a value. By default, a number is written in the language's digits, with at least two
15
+ * of them, and text as it is.
16
+ */
17
+ format?: (value: T) => string;
18
+ /** The modifiers given to `v-model`, as `.trim` */
19
+ modelModifiers?: ModelModifiers;
20
+ }) & {
21
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
22
+ "onUpdate:editing"?: ((editing: boolean) => any) | undefined;
23
+ "onUpdate:invalid"?: ((invalid: boolean) => any) | undefined;
24
+ }> & (typeof globalThis extends {
25
+ __VLS_PROPS_FALLBACK: infer P;
26
+ } ? P : {});
27
+ expose: (exposed: {}) => void;
28
+ attrs: any;
29
+ slots: {};
30
+ emit: ((evt: "update:modelValue", value: T) => void) & ((evt: "update:editing", editing: boolean) => void) & ((evt: "update:invalid", invalid: boolean) => void);
31
+ }>) => import("vue").VNode & {
32
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
9
33
  };
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- "update:modelValue": (value: ScrollFieldValue) => any;
12
- "update:editing": (editing: boolean) => any;
13
- "update:invalid": (invalid: boolean) => any;
14
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
- "onUpdate:modelValue"?: ((value: ScrollFieldValue) => any) | undefined;
16
- "onUpdate:editing"?: ((editing: boolean) => any) | undefined;
17
- "onUpdate:invalid"?: ((invalid: boolean) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
34
  declare const _default: typeof __VLS_export;
35
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
20
36
  export { _default as default };
@@ -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,3 +1,4 @@
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";
3
4
  import "@rio-m3e/styles/base/density.css";
@@ -7,46 +8,47 @@ import "@rio-m3e/styles/base/anchored-position.css";
7
8
  import "@rio-m3e/styles/menu.css";
8
9
  import "@rio-m3e/styles/text-field.css";
9
10
  import "@rio-m3e/styles/select.css";
10
- type Props = Omit<SelectProps, 'selected' | 'open'>;
11
- type __VLS_Props = Props;
12
- type __VLS_Slots = {
13
- /** `RioSelectOption`s. Give each its `label` for the field to show it in a server render. */
14
- default?: () => unknown;
15
- /** An icon before the selection */
16
- 'leading-icon'?: () => unknown;
17
- /**
18
- * The dropdown arrow, such as arrow_drop_down. It turns over while the list is open. Without one,
19
- * the `dropdown` icon registered with `createRio`.
20
- */
21
- 'dropdown-icon'?: () => unknown;
22
- /**
23
- * The selection as the field shows it, in place of the selected options' labels separated by
24
- * commas. `labels` are in the order of the options.
25
- */
26
- value?: (props: {
27
- selected: SelectValue[];
28
- labels: string[];
29
- }) => unknown;
30
- };
31
- type __VLS_ModelProps = {
11
+ export interface Props<T extends SelectSelected> extends Omit<SelectProps, 'selected' | 'open'> {
32
12
  /** The selected value, or with `multiple`, the selected values, with `v-model`. */
33
- modelValue?: SelectSelected;
34
- /** Whether the list is open, with `v-model:open`. The select keeps it when it isn't bound. */
35
- 'open'?: boolean;
36
- };
37
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
38
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
- "update:open": (value: boolean) => any;
40
- "update:modelValue": (value: SelectSelected) => any;
41
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
42
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
43
- "onUpdate:modelValue"?: ((value: SelectSelected) => any) | undefined;
44
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
46
- declare const _default: typeof __VLS_export;
47
- type __VLS_WithSlots<T, S> = T & {
48
- new (): {
49
- $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;
50
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>>;
51
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]; }) & {};
52
54
  export { _default as default };
@@ -1,4 +1,5 @@
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";
@@ -22,6 +23,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
22
23
  inheritAttrs: false,
23
24
  __name: "Select",
24
25
  props: /*@__PURE__*/ mergeModels({
26
+ modelValue: {},
27
+ modelModifiers: {},
25
28
  variant: {},
26
29
  label: {},
27
30
  multiple: { type: Boolean },
@@ -37,18 +40,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
37
40
  menuVariant: {},
38
41
  instant: { type: Boolean }
39
42
  }, {
40
- "modelValue": {},
41
- "modelModifiers": {},
42
43
  "open": {
43
44
  type: Boolean,
44
45
  default: false
45
46
  },
46
47
  "openModifiers": {}
47
48
  }),
48
- emits: ["update:modelValue", "update:open"],
49
+ emits: /*@__PURE__*/ mergeModels(["update:modelValue"], ["update:open"]),
49
50
  setup(__props) {
50
- /** The selected value, or with `multiple`, the selected values, with `v-model`. */
51
- const model = useModel(__props, "modelValue");
51
+ const model = useValueModel(() => __props.modelValue);
52
52
  /** Whether the list is open, with `v-model:open`. The select keeps it when it isn't bound. */
53
53
  const open = useModel(__props, "open");
54
54
  const slots = useSlots();
@@ -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,34 +1,35 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { TabValue, TabsMessages, TabsProps } from "@rio-m3e/core";
2
3
  import "@rio-m3e/styles/base/accent.css";
3
4
  import "@rio-m3e/styles/base/density.css";
4
5
  import "@rio-m3e/styles/base/reduced-motion.css";
5
6
  import "@rio-m3e/styles/tabs.css";
6
- 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;
7
10
  /** A language tag, for badges' counts. Without it, the one provided, or the page's. */
8
11
  locale?: string;
9
12
  /** Replaces what a small badge says. */
10
13
  messages?: Partial<TabsMessages>;
14
+ /** The modifiers given to `v-model`, as `.trim` */
15
+ modelModifiers?: ModelModifiers;
11
16
  }
12
- type __VLS_Props = Props;
13
- type __VLS_Slots = {
14
- /** The tabs (`RioTab`) */
15
- default?: () => unknown;
16
- };
17
- type __VLS_ModelProps = {
18
- /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
19
- modelValue?: TabValue | undefined;
20
- };
21
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
22
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
- "update:modelValue": (value: TabValue | undefined) => any;
24
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
- "onUpdate:modelValue"?: ((value: TabValue | undefined) => any) | undefined;
26
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
- declare const _default: typeof __VLS_export;
29
- type __VLS_WithSlots<T, S> = T & {
30
- new (): {
31
- $slots: S;
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;
32
28
  };
29
+ emit: (evt: "update:modelValue", value: T) => void;
30
+ }>) => import("vue").VNode & {
31
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
33
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]; }) & {};
34
35
  export { _default as default };
@@ -1,6 +1,7 @@
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";
5
6
  import "@rio-m3e/styles/base/accent.css";
6
7
  import "@rio-m3e/styles/base/density.css";
@@ -11,9 +12,11 @@ import "@rio-m3e/styles/tabs.css";
11
12
  const _sfc_main = /*@__PURE__*/ defineComponent({
12
13
  inheritAttrs: false,
13
14
  __name: "Tabs",
14
- props: /*@__PURE__*/ mergeModels({
15
+ props: {
16
+ modelValue: {},
15
17
  locale: {},
16
18
  messages: {},
19
+ modelModifiers: {},
17
20
  variant: {},
18
21
  scrollable: { type: Boolean },
19
22
  align: {},
@@ -25,14 +28,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
25
28
  label: {},
26
29
  color: {},
27
30
  density: {}
28
- }, {
29
- "modelValue": {},
30
- "modelModifiers": {}
31
- }),
31
+ },
32
32
  emits: ["update:modelValue"],
33
33
  setup(__props) {
34
- /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
35
- const model = useModel(__props, "modelValue");
34
+ const model = useValueModel(() => __props.modelValue);
36
35
  const group = inject(tabGroupKey, void 0);
37
36
  const registered = shallowRef([]);
38
37
  /**
@@ -1,39 +1,40 @@
1
+ import { ModelModifiers } from "../model/model.js";
1
2
  import { TextFieldMessages, TextFieldProps } from "@rio-m3e/core";
2
3
  import "@rio-m3e/styles/base/accent.css";
3
4
  import "@rio-m3e/styles/base/density.css";
4
5
  import "@rio-m3e/styles/base/reduced-motion.css";
5
6
  import "@rio-m3e/styles/text-field.css";
6
- interface Props extends Omit<TextFieldProps, 'value'> {
7
+ export interface Props<T extends string | number> extends Omit<TextFieldProps, 'value'> {
8
+ /**
9
+ * The text in the field, with `v-model`. With `type="number"` it is a number, as Vue's `v-model`
10
+ * on an input makes it, or `''` once the field is emptied. Without one, the field starts empty.
11
+ */
12
+ modelValue?: T;
7
13
  /** A language tag for what the field says to assistive technology, as the counter's label */
8
14
  locale?: string;
9
15
  /** Replaces any of what the field says to assistive technology. */
10
16
  messages?: Partial<TextFieldMessages>;
17
+ /** The modifiers given to `v-model`, as `.trim` */
18
+ modelModifiers?: ModelModifiers;
11
19
  }
12
- type __VLS_Props = Props;
13
- type __VLS_Slots = {
14
- /** An icon before the text, such as a search icon */
15
- 'leading-icon'?: () => unknown;
16
- /** An icon or an icon button after the text, such as a clear button or an error icon */
17
- 'trailing-icon'?: () => unknown;
18
- };
19
- type __VLS_ModelProps = {
20
- /**
21
- * The text in the field, with `v-model`. With `type="number"` it is a number, as Vue's `v-model`
22
- * on an input makes it.
23
- */
24
- modelValue?: string | number;
25
- };
26
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
27
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
- "update:modelValue": (value: string | number) => any;
29
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
- "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
31
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
- declare const _default: typeof __VLS_export;
34
- type __VLS_WithSlots<T, S> = T & {
35
- new (): {
36
- $slots: S;
20
+ declare const __VLS_export: <T extends string | number>(__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<{
21
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<Props<T> & {
22
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
23
+ }> & (typeof globalThis extends {
24
+ __VLS_PROPS_FALLBACK: infer P;
25
+ } ? P : {});
26
+ expose: (exposed: {}) => void;
27
+ attrs: any;
28
+ slots: {
29
+ /** An icon before the text, such as a search icon */
30
+ 'leading-icon'?: () => unknown;
31
+ /** An icon or an icon button after the text, such as a clear button or an error icon */
32
+ 'trailing-icon'?: () => unknown;
37
33
  };
34
+ emit: (evt: "update:modelValue", value: T) => void;
35
+ }>) => import("vue").VNode & {
36
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
38
37
  };
38
+ declare const _default: typeof __VLS_export;
39
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
39
40
  export { _default as default };
@@ -1,6 +1,7 @@
1
1
  import { useComposingInput } from "../ime/composing.js";
2
2
  import { useLocale, useMessages } from "../locale/locale.js";
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";
3
+ import { useValueModel } from "../model/model.js";
4
+ import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, isRef, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, shallowRef, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, vModelDynamic, vModelText, withDirectives } from "vue";
4
5
  import { attachTextField, createTextField, mergePartAttrs } from "@rio-m3e/core";
5
6
  import "@rio-m3e/styles/base/accent.css";
6
7
  import "@rio-m3e/styles/base/density.css";
@@ -10,9 +11,11 @@ import "@rio-m3e/styles/text-field.css";
10
11
  const _sfc_main = /*@__PURE__*/ defineComponent({
11
12
  inheritAttrs: false,
12
13
  __name: "TextField",
13
- props: /*@__PURE__*/ mergeModels({
14
+ props: {
15
+ modelValue: {},
14
16
  locale: {},
15
17
  messages: {},
18
+ modelModifiers: {},
16
19
  variant: {},
17
20
  label: {},
18
21
  multiline: { type: Boolean },
@@ -34,17 +37,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
34
37
  type: Boolean,
35
38
  default: () => void 0
36
39
  }
37
- }, {
38
- "modelValue": { default: "" },
39
- "modelModifiers": {}
40
- }),
40
+ },
41
41
  emits: ["update:modelValue"],
42
42
  setup(__props) {
43
- /**
44
- * The text in the field, with `v-model`. With `type="number"` it is a number, as Vue's `v-model`
45
- * on an input makes it.
46
- */
47
- const model = useModel(__props, "modelValue");
43
+ const model = useValueModel(() => __props.modelValue);
48
44
  const slots = useSlots();
49
45
  const id = useId();
50
46
  const attrs = useAttrs();
@@ -57,7 +53,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
57
53
  props: () => ({
58
54
  variant: __props.variant,
59
55
  label: __props.label,
60
- value: String(model.value),
56
+ value: String(model.value ?? ""),
61
57
  multiline: __props.multiline,
62
58
  rows: __props.rows,
63
59
  grow: __props.grow,
@@ -130,7 +126,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
130
126
  key: 1,
131
127
  ref_key: "input",
132
128
  ref: input,
133
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
129
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
134
130
  onCompositionstart: _cache[1] || (_cache[1] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
135
131
  onCompositionend: _cache[2] || (_cache[2] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
136
132
  onInput: _cache[3] || (_cache[3] = (...args) => unref(onInput) && unref(onInput)(...args))
@@ -138,11 +134,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
138
134
  ..._ctx.$attrs,
139
135
  class: void 0,
140
136
  style: void 0
141
- }, unref(field).parts.input())), null, 16)), [[vModelDynamic, model.value]]) : withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
137
+ }, unref(field).parts.input())), null, 16)), [[vModelDynamic, unref(model)]]) : withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
142
138
  key: 2,
143
139
  ref_key: "input",
144
140
  ref: input,
145
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => model.value = $event),
141
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(model) ? model.value = $event : null),
146
142
  onCompositionstart: _cache[5] || (_cache[5] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
147
143
  onCompositionend: _cache[6] || (_cache[6] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
148
144
  onInput: _cache[7] || (_cache[7] = (...args) => unref(onInput) && unref(onInput)(...args))
@@ -150,7 +146,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
150
146
  ..._ctx.$attrs,
151
147
  class: void 0,
152
148
  style: void 0
153
- }, unref(field).parts.textarea())), null, 16)), [[vModelText, model.value]]),
149
+ }, unref(field).parts.textarea())), null, 16)), [[vModelText, unref(model)]]),
154
150
  unref(field).showsSuffix() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 3 }, unref(field).parts.suffix())), toDisplayString(__props.suffix), 17)) : createCommentVNode("v-if", true)
155
151
  ], 16),
156
152
  unref(field).showsTrailingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.trailingIcon())), [renderSlot(_ctx.$slots, "trailing-icon")], 16)) : createCommentVNode("v-if", true)