@rio-m3e/vue 0.6.3 → 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.
Files changed (147) hide show
  1. package/README.md +99 -4
  2. package/dist/app-bar/AppBar.vue.d.ts +42 -0
  3. package/dist/app-bar/AppBar.vue.js +93 -0
  4. package/dist/app-bar/context.js +3 -0
  5. package/dist/badge/Badge.vue.d.ts +15 -0
  6. package/dist/badge/Badge.vue.js +28 -0
  7. package/dist/bottom-sheet/BottomSheet.vue.d.ts +34 -0
  8. package/dist/bottom-sheet/BottomSheet.vue.js +82 -0
  9. package/dist/browser/rio-vue.css +9418 -0
  10. package/dist/browser/rio-vue.global.js +600 -0
  11. package/dist/browser/rio-vue.js +600 -0
  12. package/dist/button/Button.vue.d.ts +1 -0
  13. package/dist/button/Button.vue.js +23 -2
  14. package/dist/button-group/ButtonGroup.vue.d.ts +6 -1
  15. package/dist/button-group/ButtonGroup.vue.js +27 -4
  16. package/dist/button-group/context.js +4 -2
  17. package/dist/card/Card.vue.d.ts +24 -0
  18. package/dist/card/Card.vue.js +44 -0
  19. package/dist/card/CardActions.vue.d.ts +14 -0
  20. package/dist/card/CardActions.vue.js +14 -0
  21. package/dist/card/CardContent.vue.d.ts +14 -0
  22. package/dist/card/CardContent.vue.js +14 -0
  23. package/dist/card/CardHeader.vue.d.ts +27 -0
  24. package/dist/card/CardHeader.vue.js +34 -0
  25. package/dist/card/CardMedia.vue.d.ts +14 -0
  26. package/dist/card/CardMedia.vue.js +14 -0
  27. package/dist/checkbox/Checkbox.vue.d.ts +2 -0
  28. package/dist/checkbox/Checkbox.vue.js +6 -0
  29. package/dist/chip/AssistChip.vue.d.ts +2 -0
  30. package/dist/chip/AssistChip.vue.js +6 -0
  31. package/dist/chip/ChipSet.vue.d.ts +2 -0
  32. package/dist/chip/ChipSet.vue.js +7 -1
  33. package/dist/chip/FilterChip.vue.d.ts +22 -5
  34. package/dist/chip/FilterChip.vue.js +57 -8
  35. package/dist/chip/InputChip.vue.d.ts +2 -0
  36. package/dist/chip/InputChip.vue.js +6 -0
  37. package/dist/chip/SuggestionChip.vue.d.ts +2 -0
  38. package/dist/chip/SuggestionChip.vue.js +6 -0
  39. package/dist/date-picker/DatePicker.vue.d.ts +16 -3
  40. package/dist/date-picker/DatePicker.vue.js +13 -4
  41. package/dist/date-picker/DatePickerCalendar.vue.js +1 -4
  42. package/dist/date-picker/DatePickerDialog.vue.d.ts +17 -3
  43. package/dist/date-picker/DatePickerDialog.vue.js +66 -22
  44. package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
  45. package/dist/date-picker/DateRangePickerDialog.vue.d.ts +17 -3
  46. package/dist/date-picker/DateRangePickerDialog.vue.js +29 -16
  47. package/dist/dialog/Dialog.vue.d.ts +11 -2
  48. package/dist/dialog/Dialog.vue.js +35 -5
  49. package/dist/divider/Divider.vue.d.ts +5 -0
  50. package/dist/divider/Divider.vue.js +21 -0
  51. package/dist/fab/Fab.vue.d.ts +27 -0
  52. package/dist/fab/Fab.vue.js +70 -0
  53. package/dist/fab-menu/FabMenu.vue.d.ts +34 -0
  54. package/dist/fab-menu/FabMenu.vue.js +76 -0
  55. package/dist/fab-menu/FabMenuItem.vue.d.ts +22 -0
  56. package/dist/fab-menu/FabMenuItem.vue.js +29 -0
  57. package/dist/fab-menu/context.js +4 -0
  58. package/dist/icon-button/IconButton.vue.d.ts +2 -0
  59. package/dist/icon-button/IconButton.vue.js +26 -2
  60. package/dist/ime/composing.js +24 -0
  61. package/dist/index.d.ts +70 -40
  62. package/dist/index.js +70 -40
  63. package/dist/list/List.vue.d.ts +1 -0
  64. package/dist/list/List.vue.js +4 -1
  65. package/dist/list/ListItem.vue.d.ts +13 -1
  66. package/dist/list/ListItem.vue.js +15 -3
  67. package/dist/loading-indicator/LoadingIndicator.vue.d.ts +1 -0
  68. package/dist/loading-indicator/LoadingIndicator.vue.js +4 -1
  69. package/dist/menu/Menu.vue.d.ts +2 -2
  70. package/dist/menu/Menu.vue.js +11 -2
  71. package/dist/navigation-bar/NavigationBar.vue.d.ts +31 -0
  72. package/dist/navigation-bar/NavigationBar.vue.js +63 -0
  73. package/dist/navigation-bar/NavigationBarItem.vue.d.ts +40 -0
  74. package/dist/navigation-bar/NavigationBarItem.vue.js +84 -0
  75. package/dist/navigation-bar/context.js +3 -0
  76. package/dist/navigation-rail/NavigationRail.vue.d.ts +46 -0
  77. package/dist/navigation-rail/NavigationRail.vue.js +112 -0
  78. package/dist/navigation-rail/NavigationRailItem.vue.d.ts +41 -0
  79. package/dist/navigation-rail/NavigationRailItem.vue.js +85 -0
  80. package/dist/navigation-rail/NavigationRailSection.vue.d.ts +17 -0
  81. package/dist/navigation-rail/NavigationRailSection.vue.js +20 -0
  82. package/dist/navigation-rail/context.js +3 -0
  83. package/dist/overflow/OverflowItem.vue.d.ts +16 -0
  84. package/dist/overflow/OverflowItem.vue.js +24 -0
  85. package/dist/overflow/OverflowMenu.vue.js +94 -0
  86. package/dist/overflow/overflow.js +79 -0
  87. package/dist/progress/CircularProgress.vue.d.ts +1 -0
  88. package/dist/progress/CircularProgress.vue.js +5 -2
  89. package/dist/progress/LinearProgress.vue.d.ts +1 -0
  90. package/dist/progress/LinearProgress.vue.js +5 -2
  91. package/dist/radio/Radio.vue.d.ts +2 -0
  92. package/dist/radio/Radio.vue.js +7 -1
  93. package/dist/radio/RadioGroup.vue.d.ts +2 -0
  94. package/dist/radio/RadioGroup.vue.js +13 -2
  95. package/dist/rio/rio.js +2 -0
  96. package/dist/scroll-field/ScrollField.vue.d.ts +1 -0
  97. package/dist/scroll-field/ScrollField.vue.js +3 -0
  98. package/dist/search/Search.vue.d.ts +58 -0
  99. package/dist/search/Search.vue.js +161 -0
  100. package/dist/select/AfterOptions.vue.js +11 -0
  101. package/dist/select/Select.vue.d.ts +6 -4
  102. package/dist/select/Select.vue.js +44 -31
  103. package/dist/select/SelectOption.vue.d.ts +4 -1
  104. package/dist/select/SelectOption.vue.js +8 -5
  105. package/dist/side-sheet/SideSheet.vue.d.ts +43 -0
  106. package/dist/side-sheet/SideSheet.vue.js +103 -0
  107. package/dist/slider/RangeSlider.vue.d.ts +1 -0
  108. package/dist/slider/RangeSlider.vue.js +3 -0
  109. package/dist/slider/Slider.vue.d.ts +1 -0
  110. package/dist/slider/Slider.vue.js +3 -0
  111. package/dist/snackbar/Snackbar.vue.d.ts +31 -0
  112. package/dist/snackbar/Snackbar.vue.js +48 -0
  113. package/dist/snackbar/SnackbarHost.vue.d.ts +40 -0
  114. package/dist/snackbar/SnackbarHost.vue.js +110 -0
  115. package/dist/snackbar/snackbar.d.ts +16 -0
  116. package/dist/snackbar/snackbar.js +11 -0
  117. package/dist/split-button/SplitButton.vue.d.ts +3 -2
  118. package/dist/split-button/SplitButton.vue.js +3 -0
  119. package/dist/switch/Switch.vue.d.ts +2 -0
  120. package/dist/switch/Switch.vue.js +6 -0
  121. package/dist/tabs/Tab.vue.d.ts +26 -0
  122. package/dist/tabs/Tab.vue.js +91 -0
  123. package/dist/tabs/TabGroup.vue.d.ts +22 -0
  124. package/dist/tabs/TabGroup.vue.js +25 -0
  125. package/dist/tabs/TabPanel.vue.d.ts +15 -0
  126. package/dist/tabs/TabPanel.vue.js +20 -0
  127. package/dist/tabs/Tabs.vue.d.ts +34 -0
  128. package/dist/tabs/Tabs.vue.js +109 -0
  129. package/dist/tabs/context.js +5 -0
  130. package/dist/text-field/TextField.vue.d.ts +9 -2
  131. package/dist/text-field/TextField.vue.js +94 -47
  132. package/dist/theme/ThemeProvider.vue.d.ts +22 -0
  133. package/dist/theme/ThemeProvider.vue.js +26 -0
  134. package/dist/theme/context.d.ts +7 -0
  135. package/dist/theme/context.js +7 -0
  136. package/dist/time-picker/TimeInput.vue.d.ts +7 -1
  137. package/dist/time-picker/TimeInput.vue.js +5 -2
  138. package/dist/time-picker/TimePickerDialog.vue.d.ts +9 -3
  139. package/dist/time-picker/TimePickerDialog.vue.js +5 -2
  140. package/dist/time-picker/TimeScroll.vue.d.ts +7 -1
  141. package/dist/time-picker/TimeScroll.vue.js +5 -2
  142. package/dist/toolbar/FabPlace.vue.js +14 -0
  143. package/dist/toolbar/Toolbar.vue.d.ts +34 -0
  144. package/dist/toolbar/Toolbar.vue.js +115 -0
  145. package/dist/toolbar/context.js +3 -0
  146. package/dist/tooltip/Tooltip.vue.js +10 -3
  147. package/package.json +6 -4
@@ -1,5 +1,6 @@
1
1
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, unref, useTemplateRef } from "vue";
2
2
  import { attachCircularProgress, createCircularProgress } from "@rio-m3e/core";
3
+ import "@rio-m3e/styles/base/accent.css";
3
4
  import "@rio-m3e/styles/base/direction.css";
4
5
  import "@rio-m3e/styles/progress.css";
5
6
  // src/progress/CircularProgress.vue
@@ -10,7 +11,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
10
11
  value: {},
11
12
  max: {},
12
13
  wavy: { type: Boolean },
13
- thickness: {}
14
+ thickness: {},
15
+ color: {}
14
16
  },
15
17
  setup(__props) {
16
18
  const progress = createCircularProgress({ props: () => ({
@@ -18,7 +20,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
18
20
  max: __props.max,
19
21
  wavy: __props.wavy,
20
22
  thickness: __props.thickness,
21
- size: __props.size
23
+ size: __props.size,
24
+ color: __props.color
22
25
  }) });
23
26
  const root = useTemplateRef("root");
24
27
  const indicator = useTemplateRef("indicator");
@@ -1,3 +1,4 @@
1
+ import "@rio-m3e/styles/base/accent.css";
1
2
  import "@rio-m3e/styles/base/direction.css";
2
3
  import "@rio-m3e/styles/progress.css";
3
4
  declare const __VLS_export: import("vue").DefineComponent<import("@rio-m3e/core").ProgressCommonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("@rio-m3e/core").ProgressCommonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,5 +1,6 @@
1
1
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, unref, useTemplateRef } from "vue";
2
2
  import { attachLinearProgress, createLinearProgress } from "@rio-m3e/core";
3
+ import "@rio-m3e/styles/base/accent.css";
3
4
  import "@rio-m3e/styles/base/direction.css";
4
5
  import "@rio-m3e/styles/progress.css";
5
6
  // src/progress/LinearProgress.vue
@@ -9,14 +10,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
9
10
  value: {},
10
11
  max: {},
11
12
  wavy: { type: Boolean },
12
- thickness: {}
13
+ thickness: {},
14
+ color: {}
13
15
  },
14
16
  setup(__props) {
15
17
  const progress = createLinearProgress({ props: () => ({
16
18
  value: __props.value,
17
19
  max: __props.max,
18
20
  wavy: __props.wavy,
19
- thickness: __props.thickness
21
+ thickness: __props.thickness,
22
+ color: __props.color
20
23
  }) });
21
24
  const root = useTemplateRef("root");
22
25
  const indicator = useTemplateRef("indicator");
@@ -1,4 +1,6 @@
1
1
  import { RadioProps, RadioValue } 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/ripple.css";
@@ -2,6 +2,8 @@ import { useRipple } from "../ripple/ripple.js";
2
2
  import { radioGroupKey } from "./context.js";
3
3
  import { createElementBlock, createElementVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, unref, useTemplateRef } from "vue";
4
4
  import { attachCheckable, createRadio, 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/focus-ring.css";
6
8
  import "@rio-m3e/styles/base/reduced-motion.css";
7
9
  import "@rio-m3e/styles/base/ripple.css";
@@ -13,6 +15,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
13
15
  props: {
14
16
  value: {},
15
17
  selected: { type: Boolean },
18
+ color: {},
19
+ density: {},
16
20
  disabled: { type: Boolean },
17
21
  softDisabled: { type: Boolean }
18
22
  },
@@ -23,7 +27,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
23
27
  const radio = createRadio({
24
28
  props: () => ({
25
29
  selected: isSelected(),
26
- disabled: __props.disabled,
30
+ color: __props.color,
31
+ density: __props.density,
32
+ disabled: __props.disabled || group?.disabled() || void 0,
27
33
  softDisabled: __props.softDisabled
28
34
  }),
29
35
  name: () => group?.name() ?? "",
@@ -1,4 +1,6 @@
1
1
  import { RadioGroupProps, RadioValue } 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/radio.css";
3
5
  interface Props extends RadioGroupProps {
4
6
  /** The `name` the radio buttons submit their value under. Defaults to a unique one. */
@@ -1,13 +1,18 @@
1
1
  import { radioGroupKey } from "./context.js";
2
2
  import { createElementBlock, defineComponent, mergeModels, mergeProps, nextTick, onBeforeUnmount, onMounted, openBlock, provide, renderSlot, unref, useId, useModel, useTemplateRef, watch } from "vue";
3
3
  import { attachRadioGroup, createRadioGroup } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/accent.css";
5
+ import "@rio-m3e/styles/base/density.css";
4
6
  import "@rio-m3e/styles/radio.css";
5
7
  // src/radio/RadioGroup.vue
6
8
  const _sfc_main = /*@__PURE__*/ defineComponent({
7
9
  __name: "RadioGroup",
8
10
  props: /*@__PURE__*/ mergeModels({
9
11
  name: {},
10
- label: {}
12
+ label: {},
13
+ color: {},
14
+ density: {},
15
+ disabled: { type: Boolean }
11
16
  }, {
12
17
  "modelValue": {},
13
18
  "modelModifiers": {}
@@ -16,13 +21,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
16
21
  setup(__props) {
17
22
  /** The selected radio button's value, with `v-model`. */
18
23
  const model = useModel(__props, "modelValue");
19
- const group = createRadioGroup({ props: () => ({ label: __props.label }) });
24
+ const group = createRadioGroup({ props: () => ({
25
+ label: __props.label,
26
+ color: __props.color,
27
+ density: __props.density,
28
+ disabled: __props.disabled
29
+ }) });
20
30
  const id = useId();
21
31
  const inputs = /* @__PURE__ */ new Set();
22
32
  const resync = () => void nextTick(() => inputs.forEach((input) => input.sync()));
23
33
  watch(model, resync);
24
34
  provide(radioGroupKey, {
25
35
  name: () => __props.name ?? `${id}-radio`,
36
+ disabled: group.disabled,
26
37
  isSelected: (value) => model.value === value,
27
38
  select: (value) => model.value = value,
28
39
  register(input) {
package/dist/rio/rio.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { iconsKey } from "../icon/icons.js";
2
2
  import { localeKey, messagesKey } from "../locale/locale.js";
3
+ import { themeKey } from "../theme/context.js";
3
4
  import { computed, effectScope, toRef, toValue, watchEffect } from "vue";
4
5
  import { resolveLocale } from "@rio-m3e/core";
5
6
  import { attachTheme, createThemeCss, languageHeightOf } from "@rio-m3e/tokens";
@@ -21,6 +22,7 @@ function createRio(options = {}) {
21
22
  },
22
23
  install(app) {
23
24
  app.provide(localeKey, toRef(options.locale));
25
+ app.provide(themeKey, computed(() => toValue(options.theme)));
24
26
  app.provide(iconsKey, computed(() => toValue(options.icons)));
25
27
  app.provide(messagesKey, computed(() => ({
26
28
  messages: toValue(options.messages),
@@ -1,4 +1,5 @@
1
1
  import { ScrollFieldProps, ScrollFieldValue } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/accent.css";
2
3
  import "@rio-m3e/styles/base/focus-ring.css";
3
4
  import "@rio-m3e/styles/base/reduced-motion.css";
4
5
  import "@rio-m3e/styles/scroll-field.css";
@@ -1,6 +1,7 @@
1
1
  import { useLocale } from "../locale/locale.js";
2
2
  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
3
  import { attachScrollField, createScrollField } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/accent.css";
4
5
  import "@rio-m3e/styles/base/focus-ring.css";
5
6
  import "@rio-m3e/styles/base/reduced-motion.css";
6
7
  import "@rio-m3e/styles/scroll-field.css";
@@ -20,6 +21,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
20
21
  invalid: { type: Boolean },
21
22
  locale: {},
22
23
  name: {},
24
+ color: {},
23
25
  disabled: { type: Boolean },
24
26
  softDisabled: { type: Boolean },
25
27
  modelValue: {}
@@ -53,6 +55,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
53
55
  invalid: invalid.value,
54
56
  locale: locale.value,
55
57
  name: props.name,
58
+ color: props.color,
56
59
  disabled: props.disabled,
57
60
  softDisabled: props.softDisabled
58
61
  }),
@@ -0,0 +1,58 @@
1
+ import { SearchMessages, SearchProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/focus-ring.css";
3
+ import "@rio-m3e/styles/base/reduced-motion.css";
4
+ import "@rio-m3e/styles/search.css";
5
+ interface Props extends Omit<SearchProps, 'open' | 'value'> {
6
+ /**
7
+ * A language tag, for the hinted text and the buttons. Without it, the one provided, or the
8
+ * page's.
9
+ */
10
+ locale?: string;
11
+ /** Replaces the hinted text's default, the buttons' names, and what the status announces. */
12
+ messages?: Partial<SearchMessages>;
13
+ }
14
+ type __VLS_Props = Props;
15
+ type __VLS_Slots = {
16
+ /** The suggestions or results, as a `RioList`, shown in the view */
17
+ default?: () => unknown;
18
+ /**
19
+ * Before the hinted text in the bar: a search icon by default (`search`), or an icon button,
20
+ * such as a menu button. The view shows a back button there.
21
+ */
22
+ leading?: () => unknown;
23
+ /**
24
+ * Up to two icon buttons, or one and an avatar, after the text, in the bar and in the view.
25
+ * `open` tells which.
26
+ */
27
+ trailing?: (props: {
28
+ open: boolean;
29
+ }) => unknown;
30
+ /** The view's back button's icon, in place of the one the app registered (`back`) */
31
+ 'back-icon'?: () => unknown;
32
+ /** The view's clear button's icon, in place of the one the app registered (`close`) */
33
+ 'clear-icon'?: () => unknown;
34
+ };
35
+ type __VLS_ModelProps = {
36
+ /** The query, with `v-model` */
37
+ modelValue?: string;
38
+ /** Whether the search view is open, with `v-model:open` */
39
+ 'open'?: boolean;
40
+ };
41
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
42
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
+ "update:open": (value: boolean) => any;
44
+ "update:modelValue": (value: string) => any;
45
+ search: (value: string) => any;
46
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
47
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
48
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
49
+ onSearch?: ((value: string) => any) | undefined;
50
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
52
+ declare const _default: typeof __VLS_export;
53
+ type __VLS_WithSlots<T, S> = T & {
54
+ new (): {
55
+ $slots: S;
56
+ };
57
+ };
58
+ export { _default as default };
@@ -0,0 +1,161 @@
1
+ import _sfc_main$1 from "../icon-button/IconButton.vue.js";
2
+ import { useComposingInput } from "../ime/composing.js";
3
+ import _sfc_main$2 from "../icon/Icon.vue.js";
4
+ import { useLocale, useMessages } from "../locale/locale.js";
5
+ import { keepPresses } from "../overlay/presses.js";
6
+ import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, shallowRef, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, vModelDynamic, watch, withCtx, withDirectives } from "vue";
7
+ import { attachSearch, createSearch, mergePartAttrs } from "@rio-m3e/core";
8
+ import "@rio-m3e/styles/base/focus-ring.css";
9
+ import "@rio-m3e/styles/base/reduced-motion.css";
10
+ import "@rio-m3e/styles/search.css";
11
+ // src/search/Search.vue
12
+ const _sfc_main = /*@__PURE__*/ defineComponent({
13
+ inheritAttrs: false,
14
+ __name: "Search",
15
+ props: /*@__PURE__*/ mergeModels({
16
+ locale: {},
17
+ messages: {},
18
+ placeholder: {},
19
+ layout: {},
20
+ disabled: { type: Boolean }
21
+ }, {
22
+ "modelValue": { default: "" },
23
+ "modelModifiers": {},
24
+ "open": {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ "openModifiers": {}
29
+ }),
30
+ emits: /*@__PURE__*/ mergeModels(["search"], ["update:modelValue", "update:open"]),
31
+ setup(__props, { emit: __emit }) {
32
+ /** The query, with `v-model` */
33
+ const model = useModel(__props, "modelValue");
34
+ /** Whether the search view is open, with `v-model:open` */
35
+ const open = useModel(__props, "open");
36
+ const emit = __emit;
37
+ const slots = useSlots();
38
+ const text = useMessages("search", useLocale(() => __props.locale), () => __props.messages);
39
+ const id = useId();
40
+ const compact = ref(false);
41
+ const results = ref(false);
42
+ const announcing = ref(false);
43
+ /** Where a docked view goes, as `attachSearch` reports it */
44
+ const place = shallowRef();
45
+ const search = createSearch({
46
+ props: () => ({
47
+ open: open.value,
48
+ value: model.value,
49
+ placeholder: __props.placeholder,
50
+ layout: __props.layout,
51
+ disabled: __props.disabled
52
+ }),
53
+ content: () => ({
54
+ leading: !!slots.leading,
55
+ trailing: !!slots.trailing
56
+ }),
57
+ messages: () => text.value,
58
+ ids: {
59
+ view: `${id}-view`,
60
+ text: `${id}-text`
61
+ },
62
+ compact: () => compact.value,
63
+ results: () => results.value,
64
+ announcing: () => announcing.value,
65
+ place: () => place.value,
66
+ onOpenChange: (next) => open.value = next,
67
+ onChange: (next) => model.value = next,
68
+ onSearch: (value) => emit("search", value)
69
+ });
70
+ const { onComposition, onInput } = useComposingInput((next) => model.value = String(next));
71
+ const bar = useTemplateRef("bar");
72
+ const field = useTemplateRef("field");
73
+ const view = useTemplateRef("view");
74
+ const input = useTemplateRef("input");
75
+ const list = useTemplateRef("results");
76
+ let handle;
77
+ onMounted(() => {
78
+ handle = attachSearch({
79
+ bar: bar.value,
80
+ field: field.value,
81
+ view: view.value,
82
+ input: input.value,
83
+ results: list.value
84
+ }, {
85
+ onOpenChange: (next) => open.value = next,
86
+ onResultsChange: (next) => results.value = next,
87
+ onAnnounceChange: (next) => announcing.value = next,
88
+ onCompactChange: (next) => compact.value = next,
89
+ onPlaceChange: (next) => place.value = next
90
+ });
91
+ handle.sync(open.value);
92
+ });
93
+ watch(open, (next) => handle?.sync(next), { flush: "post" });
94
+ onUpdated(() => handle?.update());
95
+ onBeforeUnmount(() => handle?.detach());
96
+ const clear = () => {
97
+ search.clear();
98
+ handle?.focusInput();
99
+ };
100
+ return (_ctx, _cache) => {
101
+ return openBlock(), createElementBlock("div", mergeProps(unref(search).parts.root(), {
102
+ class: _ctx.$attrs.class,
103
+ style: _ctx.$attrs.style
104
+ }), [createElementVNode("div", mergeProps({
105
+ ref_key: "bar",
106
+ ref: bar
107
+ }, unref(search).parts.bar()), [
108
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(search).parts.leading())), [renderSlot(_ctx.$slots, "leading", {}, () => [createVNode(_sfc_main$2, { alias: "search" })])], 16),
109
+ createElementVNode("button", mergeProps({
110
+ ref_key: "field",
111
+ ref: field
112
+ }, unref(search).parts.field(), {
113
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(search).handleFieldClick && unref(search).handleFieldClick(...args)),
114
+ onKeydown: _cache[1] || (_cache[1] = (...args) => unref(search).handleFieldKeydown && unref(search).handleFieldKeydown(...args))
115
+ }), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(search).parts.text())), toDisplayString(unref(search).fieldText()), 17)], 16),
116
+ unref(search).showsTrailing() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(search).parts.trailing())), [renderSlot(_ctx.$slots, "trailing", { open: false })], 16)) : createCommentVNode("v-if", true)
117
+ ], 16), createElementVNode("dialog", mergeProps({
118
+ ref_key: "view",
119
+ ref: view
120
+ }, unref(search).parts.view(), toHandlers(unref(keepPresses), true)), [
121
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(search).parts.header())), [
122
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(search).parts.back())), [createVNode(_sfc_main$1, {
123
+ label: unref(text).back,
124
+ variant: "standard",
125
+ onClick: unref(search).close
126
+ }, {
127
+ default: withCtx(() => [renderSlot(_ctx.$slots, "back-icon", {}, () => [createVNode(_sfc_main$2, { alias: "back" })])]),
128
+ _: 3
129
+ }, 8, ["label", "onClick"])], 16),
130
+ createElementVNode("form", mergeProps(unref(search).parts.form(), { onSubmit: _cache[6] || (_cache[6] = (...args) => unref(search).handleSubmit && unref(search).handleSubmit(...args)) }), [createCommentVNode(" v-model, which keeps the input as it is while an IME composes, and onInput "), withDirectives(createElementVNode("input", mergeProps({
131
+ ref_key: "input",
132
+ ref: input,
133
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => model.value = $event),
134
+ onCompositionstart: _cache[3] || (_cache[3] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
135
+ onCompositionend: _cache[4] || (_cache[4] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
136
+ onInput: _cache[5] || (_cache[5] = (...args) => unref(onInput) && unref(onInput)(...args))
137
+ }, unref(mergePartAttrs)({
138
+ ..._ctx.$attrs,
139
+ class: void 0,
140
+ style: void 0
141
+ }, unref(search).parts.input())), null, 16), [[vModelDynamic, model.value]])], 16),
142
+ unref(search).showsClear() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(search).parts.clear())), [createVNode(_sfc_main$1, {
143
+ label: unref(text).clear,
144
+ variant: "standard",
145
+ onClick: clear
146
+ }, {
147
+ default: withCtx(() => [renderSlot(_ctx.$slots, "clear-icon", {}, () => [createVNode(_sfc_main$2, { alias: "close" })])]),
148
+ _: 3
149
+ }, 8, ["label"])], 16)) : createCommentVNode("v-if", true),
150
+ unref(search).showsTrailing() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, unref(search).parts.viewTrailing())), [renderSlot(_ctx.$slots, "trailing", { open: true })], 16)) : createCommentVNode("v-if", true)
151
+ ], 16),
152
+ createElementVNode("div", mergeProps({
153
+ ref_key: "results",
154
+ ref: results
155
+ }, unref(search).parts.results()), [renderSlot(_ctx.$slots, "default")], 16),
156
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(search).parts.status())), toDisplayString(unref(search).statusText()), 17)
157
+ ], 16)], 16);
158
+ };
159
+ }
160
+ });
161
+ export { _sfc_main as default };
@@ -0,0 +1,11 @@
1
+ import { defineComponent, renderSlot } from "vue";
2
+ // src/select/AfterOptions.vue
3
+ const _sfc_main = /*@__PURE__*/ defineComponent({
4
+ __name: "AfterOptions",
5
+ setup(__props) {
6
+ return (_ctx, _cache) => {
7
+ return renderSlot(_ctx.$slots, "default");
8
+ };
9
+ }
10
+ });
11
+ export { _sfc_main as default };
@@ -1,14 +1,16 @@
1
1
  import { SelectProps, SelectSelected, SelectValue } 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/base/direction.css";
4
6
  import "@rio-m3e/styles/base/anchored-position.css";
5
- import "@rio-m3e/styles/text-field.css";
6
7
  import "@rio-m3e/styles/menu.css";
8
+ import "@rio-m3e/styles/text-field.css";
7
9
  import "@rio-m3e/styles/select.css";
8
10
  type Props = Omit<SelectProps, 'selected' | 'open'>;
9
11
  type __VLS_Props = Props;
10
12
  type __VLS_Slots = {
11
- /** `RioSelectOption`s */
13
+ /** `RioSelectOption`s. Give each its `label` for the field to show it in a server render. */
12
14
  default?: () => unknown;
13
15
  /** An icon before the selection */
14
16
  'leading-icon'?: () => unknown;
@@ -34,11 +36,11 @@ type __VLS_ModelProps = {
34
36
  };
35
37
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
36
38
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
- "update:modelValue": (value: SelectSelected) => any;
38
39
  "update:open": (value: boolean) => any;
40
+ "update:modelValue": (value: SelectSelected) => any;
39
41
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
40
- "onUpdate:modelValue"?: ((value: SelectSelected) => any) | undefined;
41
42
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
43
+ "onUpdate:modelValue"?: ((value: SelectSelected) => any) | undefined;
42
44
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
45
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
44
46
  declare const _default: typeof __VLS_export;
@@ -1,20 +1,23 @@
1
1
  import { keepPresses } from "../overlay/presses.js";
2
+ import _sfc_main$1 from "./AfterOptions.vue.js";
2
3
  import { selectKey } from "./context.js";
3
- import _sfc_main$1 from "../icon/Icon.vue.js";
4
- 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 } from "vue";
5
- import { attachSelect, createSelect, mergePartAttrs } from "@rio-m3e/core";
4
+ import _sfc_main$2 from "../icon/Icon.vue.js";
5
+ 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
+ import { attachSelect, createSelect, inDocumentOrder, mergePartAttrs } from "@rio-m3e/core";
7
+ import "@rio-m3e/styles/base/accent.css";
8
+ import "@rio-m3e/styles/base/density.css";
6
9
  import "@rio-m3e/styles/base/reduced-motion.css";
7
10
  import "@rio-m3e/styles/base/direction.css";
8
11
  import "@rio-m3e/styles/base/anchored-position.css";
9
- import "@rio-m3e/styles/text-field.css";
10
12
  import "@rio-m3e/styles/menu.css";
13
+ import "@rio-m3e/styles/text-field.css";
11
14
  import "@rio-m3e/styles/select.css";
12
15
  // src/select/Select.vue
13
16
  const _hoisted_1 = {
14
17
  key: 0,
15
18
  value: ""
16
19
  };
17
- const _hoisted_2 = ["value"];
20
+ const _hoisted_2 = ["value", "selected"];
18
21
  const _sfc_main = /*@__PURE__*/ defineComponent({
19
22
  inheritAttrs: false,
20
23
  __name: "Select",
@@ -25,6 +28,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
25
28
  supportingText: {},
26
29
  error: { type: Boolean },
27
30
  errorText: {},
31
+ color: {},
32
+ density: {},
28
33
  required: { type: Boolean },
29
34
  disabled: { type: Boolean },
30
35
  name: {},
@@ -49,14 +54,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
49
54
  const slots = useSlots();
50
55
  const entries = shallowReactive([]);
51
56
  /** The options, in the order they appear once rendered */
52
- const options = () => {
53
- const sorted = [...entries];
54
- if (sorted.every((entry) => entry.element())) sorted.sort((a, b) => a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
55
- return sorted.map((entry) => ({
56
- value: entry.value(),
57
- label: entry.label()
58
- }));
59
- };
57
+ const options = () => inDocumentOrder(entries, (entry) => entry.element()).map((entry) => ({
58
+ value: entry.value(),
59
+ label: entry.label()
60
+ }));
60
61
  const id = useId();
61
62
  const attrs = useAttrs();
62
63
  const select = createSelect({
@@ -69,6 +70,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
69
70
  supportingText: __props.supportingText,
70
71
  error: __props.error,
71
72
  errorText: __props.errorText,
73
+ color: __props.color,
74
+ density: __props.density,
72
75
  required: __props.required,
73
76
  disabled: __props.disabled,
74
77
  name: __props.name,
@@ -132,6 +135,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
132
135
  class: _ctx.$attrs.class,
133
136
  style: _ctx.$attrs.style
134
137
  }), [
138
+ createElementVNode("div", mergeProps({
139
+ ref_key: "listbox",
140
+ ref: listbox
141
+ }, unref(select).parts.listbox(), toHandlers(unref(keepPresses), true)), [renderSlot(_ctx.$slots, "default")], 16),
135
142
  createElementVNode("div", normalizeProps(guardReactiveProps(unref(select).parts.frame())), [
136
143
  unref(select).showsOutline() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(select).parts.outline())), [
137
144
  createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.outlineStart())), null, 16),
@@ -151,29 +158,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
151
158
  ..._ctx.$attrs,
152
159
  class: void 0,
153
160
  style: void 0
154
- }, unref(select).parts.field())), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.value())), [renderSlot(_ctx.$slots, "value", {
155
- selected: unref(select).selectedValues(),
156
- labels: unref(select).selectedLabels()
157
- }, () => [createTextVNode(toDisplayString(unref(select).valueText()), 1)])], 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.sizer())), [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(select).sizerTexts(), (text, index) => {
158
- return openBlock(), createElementBlock("span", { key: index }, toDisplayString(text), 1);
159
- }), 128))], 16)], 16)], 16),
160
- createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.arrow())), [renderSlot(_ctx.$slots, "dropdown-icon", {}, () => [createVNode(_sfc_main$1, { alias: "dropdown" })])], 16),
161
+ }, unref(select).parts.field())), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.value())), [createVNode(_sfc_main$1, null, {
162
+ default: withCtx(() => [renderSlot(_ctx.$slots, "value", {
163
+ selected: unref(select).selectedValues(),
164
+ labels: unref(select).selectedLabels()
165
+ }, () => [createTextVNode(toDisplayString(unref(select).valueText()), 1)])]),
166
+ _: 3
167
+ })], 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.sizer())), [createVNode(_sfc_main$1, null, {
168
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(select).sizerTexts(), (text, index) => {
169
+ return openBlock(), createElementBlock("span", { key: index }, toDisplayString(text), 1);
170
+ }), 128))]),
171
+ _: 1
172
+ })], 16)], 16)], 16),
173
+ createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.arrow())), [renderSlot(_ctx.$slots, "dropdown-icon", {}, () => [createVNode(_sfc_main$2, { alias: "dropdown" })])], 16),
161
174
  createElementVNode("select", mergeProps({
162
175
  ref_key: "native",
163
176
  ref: native
164
- }, unref(select).parts.native()), [!unref(select).multiple() ? (openBlock(), createElementBlock("option", _hoisted_1)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(options(), (option) => {
165
- return openBlock(), createElementBlock("option", {
166
- key: unref(select).nativeValue(option.value),
167
- value: unref(select).nativeValue(option.value)
168
- }, toDisplayString(option.label), 9, _hoisted_2);
169
- }), 128))], 16)
177
+ }, unref(select).parts.native()), [!unref(select).multiple() ? (openBlock(), createElementBlock("option", _hoisted_1)) : createCommentVNode("v-if", true), createVNode(_sfc_main$1, null, {
178
+ default: withCtx(() => [createCommentVNode(" `selected`, which a server render writes as the attribute, so it submits the\n selection before the page runs "), (openBlock(true), createElementBlock(Fragment, null, renderList(options(), (option) => {
179
+ return openBlock(), createElementBlock("option", {
180
+ key: unref(select).nativeValue(option.value),
181
+ value: unref(select).nativeValue(option.value),
182
+ selected: unref(select).isSelected(option.value)
183
+ }, toDisplayString(option.label), 9, _hoisted_2);
184
+ }), 128))]),
185
+ _: 1
186
+ })], 16)
170
187
  ], 16)
171
188
  ], 16),
172
- unref(select).showsSupporting() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(select).parts.supporting())), [createCommentVNode(" A new element for the error text, so it arrives with its alert role. "), (openBlock(), createElementBlock("span", mergeProps({ key: unref(select).showsErrorText() ? "error" : "supporting" }, unref(select).parts.supportingText()), toDisplayString(unref(select).supportingTextNow()), 17))], 16)) : createCommentVNode("v-if", true),
173
- createElementVNode("div", mergeProps({
174
- ref_key: "listbox",
175
- ref: listbox
176
- }, unref(select).parts.listbox(), toHandlers(unref(keepPresses), true)), [renderSlot(_ctx.$slots, "default")], 16)
189
+ unref(select).showsSupporting() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(select).parts.supporting())), [createCommentVNode(" A new element for the error text, so it arrives with its alert role. "), (openBlock(), createElementBlock("span", mergeProps({ key: unref(select).showsErrorText() ? "error" : "supporting" }, unref(select).parts.supportingText()), toDisplayString(unref(select).supportingTextNow()), 17))], 16)) : createCommentVNode("v-if", true)
177
190
  ], 16);
178
191
  };
179
192
  }
@@ -4,7 +4,10 @@ import "@rio-m3e/styles/base/state-layer.css";
4
4
  import "@rio-m3e/styles/base/direction.css";
5
5
  import "@rio-m3e/styles/menu.css";
6
6
  type __VLS_Slots = {
7
- /** The label, which the field shows while the option is selected */
7
+ /**
8
+ * The label as the option shows it. Without it, the `label` prop. The field shows the `label`
9
+ * prop while the option is selected, or else this text.
10
+ */
8
11
  default?: () => unknown;
9
12
  /**
10
13
  * A leading icon, hidden from assistive technology. `selected` lets it show a check mark next to