@m3ui-vue/m3ui-vue 1.0.3 → 1.1.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 (101) hide show
  1. package/dist/API.md +75 -11
  2. package/dist/MMenuItem-BOkcVtEe.js +809 -0
  3. package/dist/MMenuItem-BOkcVtEe.js.map +1 -0
  4. package/dist/{MSlider-CdNIH7jc.js → MSlider-BXsBv0ox.js} +208 -182
  5. package/dist/MSlider-BXsBv0ox.js.map +1 -0
  6. package/dist/{MTextField-B4X92vH_.js → MTextField-rML9jnXs.js} +2 -2
  7. package/dist/{MTextField-B4X92vH_.js.map → MTextField-rML9jnXs.js.map} +1 -1
  8. package/dist/api.json +1 -1
  9. package/dist/code-editor.js +1 -1
  10. package/dist/components/MBottomSheet.vue.d.ts +20 -1
  11. package/dist/components/MDialog.vue.d.ts +17 -8
  12. package/dist/components/MDragDropList.vue.d.ts +1 -1
  13. package/dist/components/MMap.vue.d.ts +4 -4
  14. package/dist/components/MMapControl.vue.d.ts +20 -3
  15. package/dist/components/MMapMarker.vue.d.ts +5 -2
  16. package/dist/components/MMapPopup.vue.d.ts +5 -3
  17. package/dist/components/MMenuItem.vue.d.ts +2 -2
  18. package/dist/components/MSeekBar.vue.d.ts +122 -0
  19. package/dist/components/MSplitButton.vue.d.ts +2 -2
  20. package/dist/components/_MMapAttribution.vue.d.ts +7 -0
  21. package/dist/composables/_mapPin.d.ts +5 -0
  22. package/dist/composables/_popupPosition.d.ts +12 -0
  23. package/dist/composables/_useCalendarMonth.d.ts +24 -0
  24. package/dist/composables/_useEscapeStack.d.ts +3 -0
  25. package/dist/composables/_useScrollLock.d.ts +8 -0
  26. package/dist/composables/_useSheetMotion.d.ts +16 -1
  27. package/dist/composables/useLocale.d.ts +8 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/locales/index.js +56 -0
  30. package/dist/locales/index.js.map +1 -1
  31. package/dist/m3ui-vue.css +1 -1
  32. package/dist/m3ui.js +5276 -4718
  33. package/dist/m3ui.js.map +1 -1
  34. package/dist/map.js +777 -641
  35. package/dist/map.js.map +1 -1
  36. package/dist/rich-text-editor.js +8 -8
  37. package/dist/styles.css +1 -1
  38. package/dist/{useLocale-b5-hzsL3.js → useLocale-CqQrhWFl.js} +9 -1
  39. package/dist/useLocale-CqQrhWFl.js.map +1 -0
  40. package/package.json +1 -1
  41. package/src/__tests__/MDialog.test.ts +30 -0
  42. package/src/__tests__/MMap.test.ts +132 -2
  43. package/src/__tests__/MSeekBar.test.ts +170 -0
  44. package/src/__tests__/MShape.test.ts +20 -0
  45. package/src/__tests__/MTooltip.test.ts +110 -0
  46. package/src/__tests__/_fakeMaplibre.ts +3 -0
  47. package/src/__tests__/calendarMonth.test.ts +59 -0
  48. package/src/__tests__/pickerModals.test.ts +128 -0
  49. package/src/__tests__/popupPosition.test.ts +224 -0
  50. package/src/__tests__/scrollLock.test.ts +110 -0
  51. package/src/__tests__/sheets.test.ts +158 -0
  52. package/src/components/MAutocomplete.vue +2 -4
  53. package/src/components/MBottomSheet.vue +211 -13
  54. package/src/components/MCommandPalette.vue +4 -6
  55. package/src/components/MContextMenu.vue +19 -5
  56. package/src/components/MDatePicker.vue +29 -70
  57. package/src/components/MDatePickerModal.vue +116 -172
  58. package/src/components/MDateRangePicker.vue +29 -51
  59. package/src/components/MDateRangePickerModal.vue +84 -162
  60. package/src/components/MDialog.vue +87 -63
  61. package/src/components/MLightbox.vue +6 -3
  62. package/src/components/MMap.vue +74 -28
  63. package/src/components/MMapControl.vue +121 -7
  64. package/src/components/MMapIdentify.vue +2 -1
  65. package/src/components/MMapMarker.vue +14 -7
  66. package/src/components/MMapPopup.vue +8 -4
  67. package/src/components/MMenu.vue +31 -12
  68. package/src/components/MMenuItem.vue +21 -4
  69. package/src/components/MMultiAutocomplete.vue +2 -4
  70. package/src/components/MMultiSelect.vue +2 -4
  71. package/src/components/MNavigationDrawer.vue +2 -8
  72. package/src/components/MNavigationRail.vue +2 -3
  73. package/src/components/MSearchBar.vue +2 -5
  74. package/src/components/MSeekBar.vue +593 -0
  75. package/src/components/MSelect.vue +2 -8
  76. package/src/components/MShape.vue +22 -8
  77. package/src/components/MSplitButton.vue +23 -7
  78. package/src/components/MSpotlightSearch.vue +4 -6
  79. package/src/components/MTimePicker.vue +23 -6
  80. package/src/components/MTimePickerModal.vue +213 -226
  81. package/src/components/MTooltip.vue +99 -3
  82. package/src/components/_MMapAttribution.vue +81 -0
  83. package/src/composables/_mapPin.ts +25 -0
  84. package/src/composables/_popupPosition.ts +39 -0
  85. package/src/composables/_useCalendarMonth.ts +74 -0
  86. package/src/composables/_useEscapeStack.ts +33 -0
  87. package/src/composables/_useScrollLock.ts +41 -0
  88. package/src/composables/_useSheetMotion.ts +82 -20
  89. package/src/composables/useLocale.ts +16 -0
  90. package/src/index.ts +2 -0
  91. package/src/locales/de.ts +8 -0
  92. package/src/locales/es.ts +8 -0
  93. package/src/locales/fr.ts +8 -0
  94. package/src/locales/ja.ts +8 -0
  95. package/src/locales/ko.ts +8 -0
  96. package/src/locales/pt.ts +8 -0
  97. package/src/locales/zh.ts +8 -0
  98. package/dist/MMenuItem-DFyXflk9.js +0 -707
  99. package/dist/MMenuItem-DFyXflk9.js.map +0 -1
  100. package/dist/MSlider-CdNIH7jc.js.map +0 -1
  101. package/dist/useLocale-b5-hzsL3.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-b5-hzsL3.js";
1
+ import { i as e } from "./useLocale-CqQrhWFl.js";
2
2
  import { t } from "./MIcon-DLOkQduI.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
@@ -3,8 +3,22 @@ type __VLS_Props = {
3
3
  modelValue: boolean;
4
4
  /** Sheet header title */
5
5
  title?: string;
6
- /** Use max-h-[92vh] instead of the default max-h-[60vh] */
6
+ /**
7
+ * Tallest the sheet gets, as a CSS length (`'480px'`, `'70dvh'`); past it the content scrolls. Default 60vh,
8
+ * or the whole screen with `partial`
9
+ */
10
+ maxHeight?: string;
11
+ /** @deprecated Use `max-height="92vh"` */
7
12
  fullHeight?: boolean;
13
+ /**
14
+ * Opens a sheet taller than this share of the screen partially expanded (`true` = half, or a ratio
15
+ * like 0.4); dragging the handle or the content up expands it fully
16
+ */
17
+ partial?: boolean | number;
18
+ /** Fully (true) or partially (false) expanded, with `partial` (v-model:expanded) */
19
+ expanded?: boolean;
20
+ /** Squares the top corners while the expanded sheet fills the screen, as Android's views sheet does */
21
+ squareCornersWhenFull?: boolean;
8
22
  };
9
23
  declare var __VLS_21: {}, __VLS_23: {};
10
24
  type __VLS_Slots = {} & {
@@ -14,10 +28,15 @@ type __VLS_Slots = {} & {
14
28
  };
15
29
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
30
  "update:modelValue": (args_0: boolean) => any;
31
+ "update:expanded": (args_0: boolean) => any;
17
32
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
33
  "onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
34
+ "onUpdate:expanded"?: ((args_0: boolean) => any) | undefined;
19
35
  }>, {
36
+ expanded: boolean;
20
37
  fullHeight: boolean;
38
+ partial: boolean | number;
39
+ squareCornersWhenFull: boolean;
21
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
42
  declare const _default: typeof __VLS_export;
@@ -21,22 +21,30 @@ type __VLS_Props = {
21
21
  * turned off
22
22
  */
23
23
  closable?: boolean;
24
+ /**
25
+ * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default
26
+ * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves
27
+ * (the date and time pickers). `title` then only names it for assistive technology
28
+ */
29
+ bare?: boolean;
24
30
  };
25
- declare var __VLS_20: {}, __VLS_22: {}, __VLS_24: {}, __VLS_26: {}, __VLS_41: {}, __VLS_43: {}, __VLS_45: {};
31
+ declare var __VLS_13: {}, __VLS_22: {}, __VLS_24: {}, __VLS_26: {}, __VLS_28: {}, __VLS_43: {}, __VLS_45: {}, __VLS_47: {};
26
32
  type __VLS_Slots = {} & {
27
- icon?: (props: typeof __VLS_20) => any;
33
+ default?: (props: typeof __VLS_13) => any;
34
+ } & {
35
+ icon?: (props: typeof __VLS_22) => any;
28
36
  } & {
29
- title?: (props: typeof __VLS_22) => any;
37
+ title?: (props: typeof __VLS_24) => any;
30
38
  } & {
31
- default?: (props: typeof __VLS_24) => any;
39
+ default?: (props: typeof __VLS_26) => any;
32
40
  } & {
33
- actions?: (props: typeof __VLS_26) => any;
41
+ actions?: (props: typeof __VLS_28) => any;
34
42
  } & {
35
- title?: (props: typeof __VLS_41) => any;
43
+ title?: (props: typeof __VLS_43) => any;
36
44
  } & {
37
- actions?: (props: typeof __VLS_43) => any;
45
+ actions?: (props: typeof __VLS_45) => any;
38
46
  } & {
39
- default?: (props: typeof __VLS_45) => any;
47
+ default?: (props: typeof __VLS_47) => any;
40
48
  };
41
49
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
42
50
  "update:modelValue": (args_0: boolean) => any;
@@ -48,6 +56,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
48
56
  fullscreen: boolean;
49
57
  maxWidth: string;
50
58
  persistent: boolean;
59
+ bare: boolean;
51
60
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
61
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
53
62
  declare const _default: typeof __VLS_export;
@@ -46,8 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
46
46
  }) => any) | undefined;
47
47
  }>, {
48
48
  disabled: boolean;
49
- handle: boolean;
50
49
  bare: boolean;
50
+ handle: boolean;
51
51
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
52
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
53
53
  declare const _default: typeof __VLS_export;
@@ -25,7 +25,7 @@ type __VLS_Props = {
25
25
  fullscreen?: boolean | MapControlPosition;
26
26
  /** A metric scale bar: `false`, or a corner (`true` is bottom-left) */
27
27
  scale?: boolean | MapControlPosition;
28
- /** The style's attribution, compact: `false`, or a corner (`true` is bottom-right). Most tile providers require it */
28
+ /** The credits of the style's sources, an info button that opens into a pill: `false`, or a corner (`true` is bottom-right). Most tile providers require it */
29
29
  attribution?: boolean | MapControlPosition;
30
30
  /** Anything else for MapLibre's `Map` constructor (`maxZoom`, `maxBounds`, `cooperativeGestures`…) */
31
31
  options?: Partial<Omit<Maplibre.MapOptions, 'container' | 'style'>>;
@@ -35,9 +35,9 @@ type __VLS_Props = {
35
35
  */
36
36
  adapter?: MapAdapter;
37
37
  };
38
- declare var __VLS_1: {};
38
+ declare var __VLS_6: {};
39
39
  type __VLS_Slots = {} & {
40
- default?: (props: typeof __VLS_1) => any;
40
+ default?: (props: typeof __VLS_6) => any;
41
41
  };
42
42
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
43
43
  /** The MapLibre map, once loaded */
@@ -60,9 +60,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
60
60
  fullscreen: boolean | MapControlPosition;
61
61
  navigation: boolean | MapControlPosition;
62
62
  scale: boolean | MapControlPosition;
63
+ attribution: boolean | MapControlPosition;
63
64
  persist: boolean | string;
64
65
  geolocate: boolean | MapControlPosition;
65
- attribution: boolean | MapControlPosition;
66
66
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
67
67
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
68
68
  declare const _default: typeof __VLS_export;
@@ -4,13 +4,30 @@ type __VLS_Props = {
4
4
  position?: MapControlPosition;
5
5
  /** Draw it as a control group (a surface with dividers between buttons), like MapLibre's zoom buttons */
6
6
  group?: boolean;
7
+ /** Expanded into its `#panel` (v-model:expanded) */
8
+ expanded?: boolean;
9
+ /** Springs the control's size when its content changes size (expanding, or anything else) */
10
+ animate?: boolean;
11
+ };
12
+ declare var __VLS_1: {
13
+ close: () => void;
14
+ }, __VLS_3: {
15
+ expanded: boolean;
16
+ toggle: () => void;
7
17
  };
8
- declare var __VLS_1: {};
9
18
  type __VLS_Slots = {} & {
10
- default?: (props: typeof __VLS_1) => any;
19
+ panel?: (props: typeof __VLS_1) => any;
20
+ } & {
21
+ default?: (props: typeof __VLS_3) => any;
11
22
  };
12
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
23
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ "update:expanded": (args_0: boolean) => any;
25
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
26
+ "onUpdate:expanded"?: ((args_0: boolean) => any) | undefined;
27
+ }>, {
28
+ animate: boolean;
13
29
  position: MapControlPosition;
30
+ expanded: boolean;
14
31
  group: boolean;
15
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
33
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -6,9 +6,12 @@ type __VLS_Props = {
6
6
  color?: string;
7
7
  /** Let the user drag it */
8
8
  draggable?: boolean;
9
- /** Which part of the marker sits on `lngLat`. Defaults to `bottom` for the pin, `center` for custom content */
9
+ /**
10
+ * Which part of the marker sits on `lngLat`. By default the pin's tip (MapLibre's placement: its center, offset
11
+ * `[0, -14]`), and the center of custom content
12
+ */
10
13
  anchor?: Maplibre.PositionAnchor;
11
- /** Offset in pixels, `[x, y]` */
14
+ /** Offset in pixels, `[x, y]`. The pin's default is MapLibre's `[0, -14]`, which puts its tip on `lngLat` */
12
15
  offset?: [number, number];
13
16
  /** Rotation in degrees */
14
17
  rotation?: number;
@@ -10,8 +10,11 @@ type __VLS_Props = {
10
10
  closeOnClick?: boolean;
11
11
  /** Where the popup sits relative to `lngLat`. By default MapLibre picks the side with room */
12
12
  anchor?: Maplibre.PositionAnchor;
13
- /** Offset in pixels from `lngLat` */
14
- offset?: number;
13
+ /**
14
+ * Offset from `lngLat`: pixels, `[x, y]`, or one per side (`{ bottom: [0, -38], … }`, MapLibre's `Offset`).
15
+ * By default none: its tip touches the point
16
+ */
17
+ offset?: Maplibre.Offset;
15
18
  /** Maximum width (CSS) */
16
19
  maxWidth?: string;
17
20
  };
@@ -27,7 +30,6 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
27
30
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
31
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
29
32
  }>, {
30
- offset: number;
31
33
  open: boolean;
32
34
  maxWidth: string;
33
35
  closeButton: boolean;
@@ -21,11 +21,11 @@ type __VLS_Props = {
21
21
  */
22
22
  selectedIcon?: string;
23
23
  };
24
- declare var __VLS_21: {}, __VLS_40: {};
24
+ declare var __VLS_21: {}, __VLS_42: {};
25
25
  type __VLS_Slots = {} & {
26
26
  default?: (props: typeof __VLS_21) => any;
27
27
  } & {
28
- children?: (props: typeof __VLS_40) => any;
28
+ children?: (props: typeof __VLS_42) => any;
29
29
  };
30
30
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
31
  click: () => any;
@@ -0,0 +1,122 @@
1
+ export interface SeekBarChapter {
2
+ /** Where the chapter starts, in seconds */
3
+ start: number;
4
+ /** Shown in the preview while the pointer is over it */
5
+ title?: string;
6
+ }
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
10
+ /** Playback position in seconds (v-model) */
11
+ modelValue: number;
12
+ /** Media length in seconds; 0, NaN or Infinity (not loaded yet, a live stream) disables seeking */
13
+ duration: number;
14
+ /** How much is loaded: up to a time, or time ranges (`[[start, end], …]`, like a media element's `buffered`) */
15
+ buffered?: number | [number, number][];
16
+ /** Chapter starts, drawn as gaps in the track; their titles show in the preview */
17
+ chapters?: SeekBarChapter[];
18
+ /** The media is playing: the bar moves on its own between updates, and the wavy line waves */
19
+ playing?: boolean;
20
+ /** Playback speed, for that motion between updates */
21
+ playbackRate?: number;
22
+ /** Updates the v-model continuously while dragging (the media follows the thumb), not only on release */
23
+ live?: boolean;
24
+ /** `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing */
25
+ variant?: "slider" | "line" | "wavy";
26
+ /** Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video) */
27
+ size?: "xs" | "sm" | "md";
28
+ /** Where the elapsed and total time go */
29
+ time?: "below" | "sides" | "none";
30
+ /** The end label shows the remaining time (`-1:23`) instead of the total; clicking it switches (v-model:remaining) */
31
+ remaining?: boolean;
32
+ /** Formats a time in seconds. Default `m:ss`, or `h:mm:ss` for media an hour or longer */
33
+ format?: (seconds: number) => string;
34
+ /** Seconds the arrow keys move; Page Up/Down move 10% */
35
+ keyStep?: number;
36
+ /** Shows the time (and chapter) above the pointer while hovering or dragging */
37
+ preview?: boolean;
38
+ /** Played part and thumb: an M3 role (`primary`, `secondary`, `tertiary`, `error`) or any CSS color */
39
+ color?: string;
40
+ /** Unplayed track: an M3 role or any CSS color. Default secondary-container */
41
+ trackColor?: string;
42
+ /** The time labels' color, as a CSS color (white over a video, say). Default on-surface-variant */
43
+ timeColor?: string;
44
+ /** Disables seeking */
45
+ disabled?: boolean;
46
+ /** Accessible name. Default the locale's `seekBar` */
47
+ label?: string;
48
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
49
+ "update:modelValue": (args_0: number) => any;
50
+ seek: (args_0: number) => any;
51
+ "scrub-start": (args_0: number) => any;
52
+ scrub: (args_0: number) => any;
53
+ "update:remaining": (args_0: boolean) => any;
54
+ }, string, import("vue").PublicProps, Readonly<{
55
+ /** Playback position in seconds (v-model) */
56
+ modelValue: number;
57
+ /** Media length in seconds; 0, NaN or Infinity (not loaded yet, a live stream) disables seeking */
58
+ duration: number;
59
+ /** How much is loaded: up to a time, or time ranges (`[[start, end], …]`, like a media element's `buffered`) */
60
+ buffered?: number | [number, number][];
61
+ /** Chapter starts, drawn as gaps in the track; their titles show in the preview */
62
+ chapters?: SeekBarChapter[];
63
+ /** The media is playing: the bar moves on its own between updates, and the wavy line waves */
64
+ playing?: boolean;
65
+ /** Playback speed, for that motion between updates */
66
+ playbackRate?: number;
67
+ /** Updates the v-model continuously while dragging (the media follows the thumb), not only on release */
68
+ live?: boolean;
69
+ /** `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing */
70
+ variant?: "slider" | "line" | "wavy";
71
+ /** Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video) */
72
+ size?: "xs" | "sm" | "md";
73
+ /** Where the elapsed and total time go */
74
+ time?: "below" | "sides" | "none";
75
+ /** The end label shows the remaining time (`-1:23`) instead of the total; clicking it switches (v-model:remaining) */
76
+ remaining?: boolean;
77
+ /** Formats a time in seconds. Default `m:ss`, or `h:mm:ss` for media an hour or longer */
78
+ format?: (seconds: number) => string;
79
+ /** Seconds the arrow keys move; Page Up/Down move 10% */
80
+ keyStep?: number;
81
+ /** Shows the time (and chapter) above the pointer while hovering or dragging */
82
+ preview?: boolean;
83
+ /** Played part and thumb: an M3 role (`primary`, `secondary`, `tertiary`, `error`) or any CSS color */
84
+ color?: string;
85
+ /** Unplayed track: an M3 role or any CSS color. Default secondary-container */
86
+ trackColor?: string;
87
+ /** The time labels' color, as a CSS color (white over a video, say). Default on-surface-variant */
88
+ timeColor?: string;
89
+ /** Disables seeking */
90
+ disabled?: boolean;
91
+ /** Accessible name. Default the locale's `seekBar` */
92
+ label?: string;
93
+ }> & Readonly<{
94
+ "onUpdate:modelValue"?: ((args_0: number) => any) | undefined;
95
+ onSeek?: ((args_0: number) => any) | undefined;
96
+ "onScrub-start"?: ((args_0: number) => any) | undefined;
97
+ onScrub?: ((args_0: number) => any) | undefined;
98
+ "onUpdate:remaining"?: ((args_0: boolean) => any) | undefined;
99
+ }>, {
100
+ color: string;
101
+ time: "below" | "sides" | "none";
102
+ size: "xs" | "sm" | "md";
103
+ playing: boolean;
104
+ variant: "slider" | "line" | "wavy";
105
+ disabled: boolean;
106
+ preview: boolean;
107
+ playbackRate: number;
108
+ live: boolean;
109
+ remaining: boolean;
110
+ keyStep: number;
111
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
112
+ preview?: (props: {
113
+ time: number;
114
+ formatted: string;
115
+ chapter: SeekBarChapter | null;
116
+ }) => any;
117
+ }>;
118
+ type __VLS_WithSlots<T, S> = T & {
119
+ new (): {
120
+ $slots: S;
121
+ };
122
+ };
@@ -22,11 +22,11 @@ type __VLS_Props = {
22
22
  /** Any CSS color for the press ripple; defaults to the button's content color */
23
23
  rippleColor?: string;
24
24
  };
25
- declare var __VLS_34: {
25
+ declare var __VLS_38: {
26
26
  close: () => boolean;
27
27
  };
28
28
  type __VLS_Slots = {} & {
29
- menu?: (props: typeof __VLS_34) => any;
29
+ menu?: (props: typeof __VLS_38) => any;
30
30
  };
31
31
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
32
  click: (args_0: MouseEvent) => any;
@@ -0,0 +1,7 @@
1
+ import type { MapControlPosition } from './MMap.vue';
2
+ type __VLS_Props = {
3
+ position: MapControlPosition;
4
+ };
5
+ declare const __VLS_export: 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>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type * as Maplibre from 'maplibre-gl';
2
+ /** The default pin's offset with its default (center) anchor */
3
+ export declare const PIN_OFFSET: [number, number];
4
+ /** Offsets for a popup at a pin's point, per side, as MapLibre's Marker.setPopup gives them */
5
+ export declare const PIN_POPUP_OFFSET: Record<Maplibre.PositionAnchor, [number, number]>;
@@ -0,0 +1,12 @@
1
+ /** Compose's MenuHorizontalMargin (8dp). */
2
+ export declare const POPUP_MARGIN = 8;
3
+ /** The first candidate start position that keeps `size` inside `viewport`, else centered or clamped. */
4
+ export declare function fitPopup(candidates: number[], size: number, viewport: number, margin?: number): number;
5
+ /**
6
+ * A dropdown's left edge: aligned with the anchor's start or end edge (`align` picks which is tried first), else
7
+ * against the window edge on the anchor's side (MenuAnchorPosition.Below's xCandidates).
8
+ */
9
+ export declare function dropdownX(anchor: {
10
+ left: number;
11
+ right: number;
12
+ }, width: number, viewport: number, align: 'start' | 'end', margin?: number): number;
@@ -0,0 +1,24 @@
1
+ import { type Ref } from 'vue';
2
+ export interface CalendarDay {
3
+ /** Day of the month */
4
+ date: number;
5
+ /** In the month shown (not the neighbors' days filling its first and last week) */
6
+ current: boolean;
7
+ iso: string;
8
+ disabled: boolean;
9
+ }
10
+ /** YYYY-MM-DD for a year, a 0-based month and a day; months and days past their range roll over, as Date does */
11
+ export declare function isoDate(y: number, m: number, d: number): string;
12
+ export declare function useCalendarMonth(viewDate: Ref<Date>, opts: {
13
+ locale: () => string;
14
+ min: () => string | undefined;
15
+ max: () => string | undefined;
16
+ }): {
17
+ weekdays: import("vue").ComputedRef<string[]>;
18
+ monthLabel: import("vue").ComputedRef<string>;
19
+ days: import("vue").ComputedRef<CalendarDay[]>;
20
+ isOutOfRange: (iso: string) => boolean;
21
+ isToday: (iso: string) => boolean;
22
+ prevMonth: () => void;
23
+ nextMonth: () => void;
24
+ };
@@ -0,0 +1,3 @@
1
+ import { type WatchSource } from 'vue';
2
+ /** Calls `onEscape` on Escape while `active`, unless something opened later is on top of it. */
3
+ export declare function useEscapeStack(active: WatchSource<boolean>, onEscape: () => void): void;
@@ -0,0 +1,8 @@
1
+ import { type WatchSource } from 'vue';
2
+ /**
3
+ * Locks the page's scroll while `active` is true (from the start too: a dialog mounted open locks it), and releases
4
+ * it when it turns false or the component unmounts. Without `active`, drive it with the returned `set`.
5
+ */
6
+ export declare function useScrollLock(active?: WatchSource<boolean>): {
7
+ set: (on: boolean) => void;
8
+ };
@@ -1,7 +1,22 @@
1
- export declare function useSheetMotion(axis: 'x' | 'y', onDismiss: () => void): {
1
+ export interface SheetMotionOptions {
2
+ /** Resting offsets while open, as fractions of the panel's size (0 = fully open). Default [0]. */
3
+ anchors?: (panel: HTMLElement) => number[];
4
+ /** The anchor an open lands on. Default 0. */
5
+ openAt?: (panel: HTMLElement) => number;
6
+ /** The sheet is heading for this resting anchor (on open, a drag release or snapTo). */
7
+ onAnchor?: (anchor: number, panel: HTMLElement | null) => void;
8
+ /** A drag took over the panel (true) or let go (false). */
9
+ onDrag?: (active: boolean) => void;
10
+ }
11
+ export declare function useSheetMotion(axis: 'x' | 'y', onDismiss: () => void, opts?: SheetMotionOptions): {
2
12
  onEnter: (el: Element, done: () => void) => void;
3
13
  onLeave: (el: Element, done: () => void) => void;
4
14
  onDragStart: (e: PointerEvent) => void;
5
15
  onDragMove: (e: PointerEvent) => void;
6
16
  onDragEnd: () => void;
17
+ dragStart: (from: Element, pos: number) => void;
18
+ dragMove: (pos: number) => number;
19
+ dragEnd: () => void;
20
+ snapTo: (anchor: number) => void;
21
+ target: () => number;
7
22
  };
@@ -25,6 +25,10 @@ export interface M3Locale {
25
25
  maxSizePrefix: string;
26
26
  remove: string;
27
27
  selectDate: string;
28
+ ok: string;
29
+ dateToggleInput: string;
30
+ dateToggleCalendar: string;
31
+ dateInputLabel: string;
28
32
  selectTime: string;
29
33
  timeHourSelection: string;
30
34
  timeMinuteSelection: string;
@@ -35,6 +39,10 @@ export interface M3Locale {
35
39
  sheetExpand: string;
36
40
  sheetCollapse: string;
37
41
  sheetDismiss: string;
42
+ seekBar: string;
43
+ seekBarValue: string;
44
+ seekBarShowRemaining: string;
45
+ seekBarShowDuration: string;
38
46
  selectRange: string;
39
47
  pickStart: string;
40
48
  pickEnd: string;
package/dist/index.d.ts CHANGED
@@ -135,6 +135,7 @@ export { default as MScheduler } from './components/MScheduler.vue';
135
135
  export { default as MScrollable } from './components/MScrollable.vue';
136
136
  export { default as MSearchBar } from './components/MSearchBar.vue';
137
137
  export { default as MSection } from './components/MSection.vue';
138
+ export { default as MSeekBar } from './components/MSeekBar.vue';
138
139
  export { default as MSegmentedButton } from './components/MSegmentedButton.vue';
139
140
  export { default as MScrollField } from './components/MScrollField.vue';
140
141
  export { default as MSelect } from './components/MSelect.vue';
@@ -204,6 +205,7 @@ export type { SpeedDialItem } from './components/MFab.vue';
204
205
  export type { FabMenuItem } from './components/MFabMenu.vue';
205
206
  export type { NavRailItem } from './components/MNavigationRail.vue';
206
207
  export type { SchedulerEvent } from './components/MScheduler.vue';
208
+ export type { SeekBarChapter } from './components/MSeekBar.vue';
207
209
  export type { SegmentedOption } from './components/MSegmentedButton.vue';
208
210
  export type { SpotlightResult } from './components/MSpotlightSearch.vue';
209
211
  export type { StepItem } from './components/MStepper.vue';
@@ -24,6 +24,10 @@ var e = {
24
24
  maxSizePrefix: "Máx.",
25
25
  remove: "Eliminar",
26
26
  selectDate: "Seleccionar fecha",
27
+ ok: "Aceptar",
28
+ dateToggleInput: "Cambiar a entrada de texto",
29
+ dateToggleCalendar: "Cambiar a calendario",
30
+ dateInputLabel: "Fecha",
27
31
  selectTime: "Seleccionar hora",
28
32
  timeHourSelection: "Seleccionar hora",
29
33
  timeMinuteSelection: "Seleccionar minutos",
@@ -34,6 +38,10 @@ var e = {
34
38
  sheetExpand: "Expandir hoja inferior",
35
39
  sheetCollapse: "Contraer hoja inferior",
36
40
  sheetDismiss: "Cerrar hoja inferior",
41
+ seekBar: "Buscar posición",
42
+ seekBarValue: "{position} de {duration}",
43
+ seekBarShowRemaining: "Mostrar tiempo restante",
44
+ seekBarShowDuration: "Mostrar duración total",
37
45
  selectRange: "Seleccionar rango",
38
46
  pickStart: "Seleccionar inicio",
39
47
  pickEnd: "Seleccionar fin",
@@ -200,6 +208,10 @@ var e = {
200
208
  maxSizePrefix: "Max.",
201
209
  remove: "Supprimer",
202
210
  selectDate: "Sélectionner la date",
211
+ ok: "OK",
212
+ dateToggleInput: "Passer à la saisie de texte",
213
+ dateToggleCalendar: "Passer au calendrier",
214
+ dateInputLabel: "Date",
203
215
  selectTime: "Sélectionner l'heure",
204
216
  timeHourSelection: "Sélectionner l'heure",
205
217
  timeMinuteSelection: "Sélectionner les minutes",
@@ -210,6 +222,10 @@ var e = {
210
222
  sheetExpand: "Développer la feuille inférieure",
211
223
  sheetCollapse: "Réduire la feuille inférieure",
212
224
  sheetDismiss: "Fermer la feuille inférieure",
225
+ seekBar: "Rechercher",
226
+ seekBarValue: "{position} sur {duration}",
227
+ seekBarShowRemaining: "Afficher le temps restant",
228
+ seekBarShowDuration: "Afficher la durée totale",
213
229
  selectRange: "Sélectionner la plage",
214
230
  pickStart: "Sélectionner le début",
215
231
  pickEnd: "Sélectionner la fin",
@@ -376,6 +392,10 @@ var e = {
376
392
  maxSizePrefix: "Máx.",
377
393
  remove: "Remover",
378
394
  selectDate: "Selecionar data",
395
+ ok: "OK",
396
+ dateToggleInput: "Mudar para entrada de texto",
397
+ dateToggleCalendar: "Mudar para calendário",
398
+ dateInputLabel: "Data",
379
399
  selectTime: "Selecionar hora",
380
400
  timeHourSelection: "Selecionar hora",
381
401
  timeMinuteSelection: "Selecionar minutos",
@@ -386,6 +406,10 @@ var e = {
386
406
  sheetExpand: "Expandir página inferior",
387
407
  sheetCollapse: "Recolher página inferior",
388
408
  sheetDismiss: "Dispensar página inferior",
409
+ seekBar: "Procurar posição",
410
+ seekBarValue: "{position} de {duration}",
411
+ seekBarShowRemaining: "Mostrar tempo restante",
412
+ seekBarShowDuration: "Mostrar duração total",
389
413
  selectRange: "Selecionar intervalo",
390
414
  pickStart: "Selecionar início",
391
415
  pickEnd: "Selecionar fim",
@@ -552,6 +576,10 @@ var e = {
552
576
  maxSizePrefix: "Max.",
553
577
  remove: "Entfernen",
554
578
  selectDate: "Datum auswählen",
579
+ ok: "OK",
580
+ dateToggleInput: "Zur Texteingabe wechseln",
581
+ dateToggleCalendar: "Zum Kalender wechseln",
582
+ dateInputLabel: "Datum",
555
583
  selectTime: "Uhrzeit auswählen",
556
584
  timeHourSelection: "Stunde auswählen",
557
585
  timeMinuteSelection: "Minuten auswählen",
@@ -562,6 +590,10 @@ var e = {
562
590
  sheetExpand: "Ansicht am unteren Rand maximieren",
563
591
  sheetCollapse: "Ansicht am unteren Rand minimieren",
564
592
  sheetDismiss: "Ansicht am unteren Rand schließen",
593
+ seekBar: "Spulen",
594
+ seekBarValue: "{position} von {duration}",
595
+ seekBarShowRemaining: "Verbleibende Zeit anzeigen",
596
+ seekBarShowDuration: "Gesamtdauer anzeigen",
565
597
  selectRange: "Bereich auswählen",
566
598
  pickStart: "Anfang auswählen",
567
599
  pickEnd: "Ende auswählen",
@@ -728,6 +760,10 @@ var e = {
728
760
  maxSizePrefix: "最大",
729
761
  remove: "削除",
730
762
  selectDate: "日付を選択",
763
+ ok: "OK",
764
+ dateToggleInput: "テキスト入力に切り替え",
765
+ dateToggleCalendar: "カレンダーに切り替え",
766
+ dateInputLabel: "日付",
731
767
  selectTime: "時刻を選択",
732
768
  timeHourSelection: "時間を選択",
733
769
  timeMinuteSelection: "分を選択",
@@ -738,6 +774,10 @@ var e = {
738
774
  sheetExpand: "ボトムシートを開く",
739
775
  sheetCollapse: "ボトムシートを折りたたむ",
740
776
  sheetDismiss: "ボトムシートを閉じる",
777
+ seekBar: "シーク",
778
+ seekBarValue: "{position} / {duration}",
779
+ seekBarShowRemaining: "残り時間を表示",
780
+ seekBarShowDuration: "合計時間を表示",
741
781
  selectRange: "範囲を選択",
742
782
  pickStart: "開始を選択",
743
783
  pickEnd: "終了を選択",
@@ -904,6 +944,10 @@ var e = {
904
944
  maxSizePrefix: "最大",
905
945
  remove: "移除",
906
946
  selectDate: "选择日期",
947
+ ok: "确定",
948
+ dateToggleInput: "切换到文本输入",
949
+ dateToggleCalendar: "切换到日历",
950
+ dateInputLabel: "日期",
907
951
  selectTime: "选择时间",
908
952
  timeHourSelection: "选择小时",
909
953
  timeMinuteSelection: "选择分钟",
@@ -914,6 +958,10 @@ var e = {
914
958
  sheetExpand: "展开底部动作条",
915
959
  sheetCollapse: "收起底部动作条",
916
960
  sheetDismiss: "关闭底部动作条",
961
+ seekBar: "拖动进度",
962
+ seekBarValue: "{position} / {duration}",
963
+ seekBarShowRemaining: "显示剩余时间",
964
+ seekBarShowDuration: "显示总时长",
917
965
  selectRange: "选择范围",
918
966
  pickStart: "选择开始",
919
967
  pickEnd: "选择结束",
@@ -1080,6 +1128,10 @@ var e = {
1080
1128
  maxSizePrefix: "최대",
1081
1129
  remove: "삭제",
1082
1130
  selectDate: "날짜 선택",
1131
+ ok: "확인",
1132
+ dateToggleInput: "텍스트 입력으로 전환",
1133
+ dateToggleCalendar: "달력으로 전환",
1134
+ dateInputLabel: "날짜",
1083
1135
  selectTime: "시간 선택",
1084
1136
  timeHourSelection: "시간 선택",
1085
1137
  timeMinuteSelection: "분 선택",
@@ -1090,6 +1142,10 @@ var e = {
1090
1142
  sheetExpand: "하단 시트 펼치기",
1091
1143
  sheetCollapse: "하단 시트 접기",
1092
1144
  sheetDismiss: "하단 시트 닫기",
1145
+ seekBar: "탐색",
1146
+ seekBarValue: "{position} / {duration}",
1147
+ seekBarShowRemaining: "남은 시간 표시",
1148
+ seekBarShowDuration: "전체 시간 표시",
1093
1149
  selectRange: "범위 선택",
1094
1150
  pickStart: "시작 선택",
1095
1151
  pickEnd: "종료 선택",