@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.
- package/README.md +99 -4
- package/dist/app-bar/AppBar.vue.d.ts +42 -0
- package/dist/app-bar/AppBar.vue.js +93 -0
- package/dist/app-bar/context.js +3 -0
- package/dist/badge/Badge.vue.d.ts +15 -0
- package/dist/badge/Badge.vue.js +28 -0
- package/dist/bottom-sheet/BottomSheet.vue.d.ts +34 -0
- package/dist/bottom-sheet/BottomSheet.vue.js +82 -0
- package/dist/browser/rio-vue.css +9418 -0
- package/dist/browser/rio-vue.global.js +600 -0
- package/dist/browser/rio-vue.js +600 -0
- package/dist/button/Button.vue.d.ts +1 -0
- package/dist/button/Button.vue.js +23 -2
- package/dist/button-group/ButtonGroup.vue.d.ts +6 -1
- package/dist/button-group/ButtonGroup.vue.js +27 -4
- package/dist/button-group/context.js +4 -2
- package/dist/card/Card.vue.d.ts +24 -0
- package/dist/card/Card.vue.js +44 -0
- package/dist/card/CardActions.vue.d.ts +14 -0
- package/dist/card/CardActions.vue.js +14 -0
- package/dist/card/CardContent.vue.d.ts +14 -0
- package/dist/card/CardContent.vue.js +14 -0
- package/dist/card/CardHeader.vue.d.ts +27 -0
- package/dist/card/CardHeader.vue.js +34 -0
- package/dist/card/CardMedia.vue.d.ts +14 -0
- package/dist/card/CardMedia.vue.js +14 -0
- package/dist/checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/checkbox/Checkbox.vue.js +6 -0
- package/dist/chip/AssistChip.vue.d.ts +2 -0
- package/dist/chip/AssistChip.vue.js +6 -0
- package/dist/chip/ChipSet.vue.d.ts +2 -0
- package/dist/chip/ChipSet.vue.js +7 -1
- package/dist/chip/FilterChip.vue.d.ts +22 -5
- package/dist/chip/FilterChip.vue.js +57 -8
- package/dist/chip/InputChip.vue.d.ts +2 -0
- package/dist/chip/InputChip.vue.js +6 -0
- package/dist/chip/SuggestionChip.vue.d.ts +2 -0
- package/dist/chip/SuggestionChip.vue.js +6 -0
- package/dist/date-picker/DatePicker.vue.d.ts +16 -3
- package/dist/date-picker/DatePicker.vue.js +13 -4
- package/dist/date-picker/DatePickerCalendar.vue.js +1 -4
- package/dist/date-picker/DatePickerDialog.vue.d.ts +17 -3
- package/dist/date-picker/DatePickerDialog.vue.js +66 -22
- package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
- package/dist/date-picker/DateRangePickerDialog.vue.d.ts +17 -3
- package/dist/date-picker/DateRangePickerDialog.vue.js +29 -16
- package/dist/dialog/Dialog.vue.d.ts +11 -2
- package/dist/dialog/Dialog.vue.js +35 -5
- package/dist/divider/Divider.vue.d.ts +5 -0
- package/dist/divider/Divider.vue.js +21 -0
- package/dist/fab/Fab.vue.d.ts +27 -0
- package/dist/fab/Fab.vue.js +70 -0
- package/dist/fab-menu/FabMenu.vue.d.ts +34 -0
- package/dist/fab-menu/FabMenu.vue.js +76 -0
- package/dist/fab-menu/FabMenuItem.vue.d.ts +22 -0
- package/dist/fab-menu/FabMenuItem.vue.js +29 -0
- package/dist/fab-menu/context.js +4 -0
- package/dist/icon-button/IconButton.vue.d.ts +2 -0
- package/dist/icon-button/IconButton.vue.js +26 -2
- package/dist/ime/composing.js +24 -0
- package/dist/index.d.ts +70 -40
- package/dist/index.js +70 -40
- package/dist/list/List.vue.d.ts +1 -0
- package/dist/list/List.vue.js +4 -1
- package/dist/list/ListItem.vue.d.ts +13 -1
- package/dist/list/ListItem.vue.js +15 -3
- package/dist/loading-indicator/LoadingIndicator.vue.d.ts +1 -0
- package/dist/loading-indicator/LoadingIndicator.vue.js +4 -1
- package/dist/menu/Menu.vue.d.ts +2 -2
- package/dist/menu/Menu.vue.js +11 -2
- package/dist/navigation-bar/NavigationBar.vue.d.ts +31 -0
- package/dist/navigation-bar/NavigationBar.vue.js +63 -0
- package/dist/navigation-bar/NavigationBarItem.vue.d.ts +40 -0
- package/dist/navigation-bar/NavigationBarItem.vue.js +84 -0
- package/dist/navigation-bar/context.js +3 -0
- package/dist/navigation-rail/NavigationRail.vue.d.ts +46 -0
- package/dist/navigation-rail/NavigationRail.vue.js +112 -0
- package/dist/navigation-rail/NavigationRailItem.vue.d.ts +41 -0
- package/dist/navigation-rail/NavigationRailItem.vue.js +85 -0
- package/dist/navigation-rail/NavigationRailSection.vue.d.ts +17 -0
- package/dist/navigation-rail/NavigationRailSection.vue.js +20 -0
- package/dist/navigation-rail/context.js +3 -0
- package/dist/overflow/OverflowItem.vue.d.ts +16 -0
- package/dist/overflow/OverflowItem.vue.js +24 -0
- package/dist/overflow/OverflowMenu.vue.js +94 -0
- package/dist/overflow/overflow.js +79 -0
- package/dist/progress/CircularProgress.vue.d.ts +1 -0
- package/dist/progress/CircularProgress.vue.js +5 -2
- package/dist/progress/LinearProgress.vue.d.ts +1 -0
- package/dist/progress/LinearProgress.vue.js +5 -2
- package/dist/radio/Radio.vue.d.ts +2 -0
- package/dist/radio/Radio.vue.js +7 -1
- package/dist/radio/RadioGroup.vue.d.ts +2 -0
- package/dist/radio/RadioGroup.vue.js +13 -2
- package/dist/rio/rio.js +2 -0
- package/dist/scroll-field/ScrollField.vue.d.ts +1 -0
- package/dist/scroll-field/ScrollField.vue.js +3 -0
- package/dist/search/Search.vue.d.ts +58 -0
- package/dist/search/Search.vue.js +161 -0
- package/dist/select/AfterOptions.vue.js +11 -0
- package/dist/select/Select.vue.d.ts +6 -4
- package/dist/select/Select.vue.js +44 -31
- package/dist/select/SelectOption.vue.d.ts +4 -1
- package/dist/select/SelectOption.vue.js +8 -5
- package/dist/side-sheet/SideSheet.vue.d.ts +43 -0
- package/dist/side-sheet/SideSheet.vue.js +103 -0
- package/dist/slider/RangeSlider.vue.d.ts +1 -0
- package/dist/slider/RangeSlider.vue.js +3 -0
- package/dist/slider/Slider.vue.d.ts +1 -0
- package/dist/slider/Slider.vue.js +3 -0
- package/dist/snackbar/Snackbar.vue.d.ts +31 -0
- package/dist/snackbar/Snackbar.vue.js +48 -0
- package/dist/snackbar/SnackbarHost.vue.d.ts +40 -0
- package/dist/snackbar/SnackbarHost.vue.js +110 -0
- package/dist/snackbar/snackbar.d.ts +16 -0
- package/dist/snackbar/snackbar.js +11 -0
- package/dist/split-button/SplitButton.vue.d.ts +3 -2
- package/dist/split-button/SplitButton.vue.js +3 -0
- package/dist/switch/Switch.vue.d.ts +2 -0
- package/dist/switch/Switch.vue.js +6 -0
- package/dist/tabs/Tab.vue.d.ts +26 -0
- package/dist/tabs/Tab.vue.js +91 -0
- package/dist/tabs/TabGroup.vue.d.ts +22 -0
- package/dist/tabs/TabGroup.vue.js +25 -0
- package/dist/tabs/TabPanel.vue.d.ts +15 -0
- package/dist/tabs/TabPanel.vue.js +20 -0
- package/dist/tabs/Tabs.vue.d.ts +34 -0
- package/dist/tabs/Tabs.vue.js +109 -0
- package/dist/tabs/context.js +5 -0
- package/dist/text-field/TextField.vue.d.ts +9 -2
- package/dist/text-field/TextField.vue.js +94 -47
- package/dist/theme/ThemeProvider.vue.d.ts +22 -0
- package/dist/theme/ThemeProvider.vue.js +26 -0
- package/dist/theme/context.d.ts +7 -0
- package/dist/theme/context.js +7 -0
- package/dist/time-picker/TimeInput.vue.d.ts +7 -1
- package/dist/time-picker/TimeInput.vue.js +5 -2
- package/dist/time-picker/TimePickerDialog.vue.d.ts +9 -3
- package/dist/time-picker/TimePickerDialog.vue.js +5 -2
- package/dist/time-picker/TimeScroll.vue.d.ts +7 -1
- package/dist/time-picker/TimeScroll.vue.js +5 -2
- package/dist/toolbar/FabPlace.vue.js +14 -0
- package/dist/toolbar/Toolbar.vue.d.ts +34 -0
- package/dist/toolbar/Toolbar.vue.js +115 -0
- package/dist/toolbar/context.js +3 -0
- package/dist/tooltip/Tooltip.vue.js +10 -3
- package/package.json +6 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DatePickerMessages } from "@rio-m3e/core";
|
|
1
|
+
import { AccentColor, DatePickerMessages, DialogVariant } 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/base/state-layer.css";
|
|
@@ -21,6 +22,17 @@ type __VLS_Props = {
|
|
|
21
22
|
initialMode?: 'calendar' | 'input';
|
|
22
23
|
/** A Clear button at the start of Cancel and OK */
|
|
23
24
|
clearable?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The theme color it takes in place of the spec's accents: `'secondary'`, `'tertiary'`,
|
|
27
|
+
* `'error'`, or a static color of the theme. Its buttons take it too.
|
|
28
|
+
*/
|
|
29
|
+
color?: AccentColor;
|
|
30
|
+
/**
|
|
31
|
+
* `'full-screen'`, covering the window under a bar with a close button and Save; `'basic'`, a
|
|
32
|
+
* basic dialog; or `'adaptive'`, full-screen in a compact window, narrower than 600px, and basic
|
|
33
|
+
* in a wider one. Defaults to `'adaptive'`.
|
|
34
|
+
*/
|
|
35
|
+
variant?: DialogVariant;
|
|
24
36
|
};
|
|
25
37
|
type __VLS_Slots = {
|
|
26
38
|
/**
|
|
@@ -33,6 +45,8 @@ type __VLS_Slots = {
|
|
|
33
45
|
* `calendar` icon registered with `createRio`.
|
|
34
46
|
*/
|
|
35
47
|
'calendar-icon'?: () => unknown;
|
|
48
|
+
/** The full-screen picker's close icon, in place of the one the app registered (`close`) */
|
|
49
|
+
'close-icon'?: () => unknown;
|
|
36
50
|
};
|
|
37
51
|
type __VLS_ModelProps = {
|
|
38
52
|
/** The range's start, `YYYY-MM-DD`, with `v-model:start`. It changes on OK. */
|
|
@@ -44,13 +58,13 @@ type __VLS_ModelProps = {
|
|
|
44
58
|
};
|
|
45
59
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
46
60
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
+
"update:open": (value: boolean) => any;
|
|
47
62
|
"update:start": (value: string | undefined) => any;
|
|
48
63
|
"update:end": (value: string | undefined) => any;
|
|
49
|
-
"update:open": (value: boolean) => any;
|
|
50
64
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
65
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
51
66
|
"onUpdate:start"?: ((value: string | undefined) => any) | undefined;
|
|
52
67
|
"onUpdate:end"?: ((value: string | undefined) => any) | undefined;
|
|
53
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
54
68
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
69
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
56
70
|
declare const _default: typeof __VLS_export;
|
|
@@ -5,8 +5,9 @@ import { keepPresses } from "../overlay/presses.js";
|
|
|
5
5
|
import _sfc_main$3 from "../text-field/TextField.vue.js";
|
|
6
6
|
import _sfc_main$4 from "./DateRangeCalendar.vue.js";
|
|
7
7
|
import _sfc_main$5 from "../icon/Icon.vue.js";
|
|
8
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps,
|
|
9
|
-
import {
|
|
8
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, reactive, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
9
|
+
import { attachDatePickerDialog, createDateRangePickerDialog, initialDateRangePickerState } from "@rio-m3e/core";
|
|
10
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
10
11
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
11
12
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
12
13
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -23,7 +24,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
23
24
|
firstDayOfWeek: {},
|
|
24
25
|
messages: {},
|
|
25
26
|
initialMode: {},
|
|
26
|
-
clearable: { type: Boolean }
|
|
27
|
+
clearable: { type: Boolean },
|
|
28
|
+
color: {},
|
|
29
|
+
variant: {}
|
|
27
30
|
}, {
|
|
28
31
|
"start": {},
|
|
29
32
|
"startModifiers": {},
|
|
@@ -52,6 +55,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
52
55
|
const messages = useMessages("datePicker", locale, () => props.messages);
|
|
53
56
|
const state = reactive(initialDateRangePickerState(start.value, end.value, locale.value, props));
|
|
54
57
|
const rendered = ref(open.value);
|
|
58
|
+
const compact = ref(false);
|
|
55
59
|
const id = useId();
|
|
56
60
|
const dialog = createDateRangePickerDialog({
|
|
57
61
|
props: () => ({
|
|
@@ -62,12 +66,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
62
66
|
max: props.max,
|
|
63
67
|
locale: locale.value,
|
|
64
68
|
clearable: props.clearable,
|
|
69
|
+
color: props.color,
|
|
65
70
|
initialMode: props.initialMode,
|
|
71
|
+
variant: props.variant,
|
|
66
72
|
rendered: rendered.value
|
|
67
73
|
}),
|
|
68
74
|
isDateDisabled: (date) => !!props.isDateDisabled?.(date),
|
|
69
75
|
messages: () => messages.value,
|
|
70
76
|
state: () => state,
|
|
77
|
+
compact: () => compact.value,
|
|
71
78
|
ids: {
|
|
72
79
|
title: `${id}-title`,
|
|
73
80
|
headline: `${id}-headline`
|
|
@@ -86,31 +93,39 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
86
93
|
rendered.value = true;
|
|
87
94
|
});
|
|
88
95
|
const root = useTemplateRef("root");
|
|
89
|
-
const calendar = useTemplateRef("calendar");
|
|
90
96
|
let handle;
|
|
91
97
|
onMounted(() => {
|
|
92
|
-
handle =
|
|
98
|
+
handle = attachDatePickerDialog(root.value, {
|
|
93
99
|
onOpenChange: (next) => open.value = next,
|
|
94
100
|
onClosed: () => {
|
|
95
101
|
if (!open.value) rendered.value = false;
|
|
96
102
|
},
|
|
97
|
-
|
|
103
|
+
onCompactChange: (next) => compact.value = next
|
|
98
104
|
});
|
|
99
105
|
handle.sync(open.value);
|
|
100
106
|
});
|
|
101
107
|
watch(open, (next) => handle?.sync(next), { flush: "post" });
|
|
102
|
-
|
|
103
|
-
await nextTick();
|
|
104
|
-
if (!open.value) return;
|
|
105
|
-
if (next === "calendar") calendar.value?.focus();
|
|
106
|
-
else root.value?.querySelector("input")?.focus();
|
|
107
|
-
});
|
|
108
|
+
onUpdated(() => handle?.update());
|
|
108
109
|
onBeforeUnmount(() => handle?.detach());
|
|
109
110
|
return (_ctx, _cache) => {
|
|
110
111
|
return openBlock(), createElementBlock("dialog", mergeProps({
|
|
111
112
|
ref_key: "root",
|
|
112
113
|
ref: root
|
|
113
114
|
}, unref(dialog).parts.root(), toHandlers(unref(keepPresses), true)), [rendered.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
115
|
+
unref(dialog).showsBar() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(dialog).parts.bar())), [createVNode(_sfc_main$2, {
|
|
116
|
+
label: unref(messages).close,
|
|
117
|
+
variant: "standard",
|
|
118
|
+
onClick: unref(dialog).cancel
|
|
119
|
+
}, {
|
|
120
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$5, { alias: "close" })])]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, ["label", "onClick"]), createVNode(_sfc_main$1, {
|
|
123
|
+
variant: "text",
|
|
124
|
+
onClick: unref(dialog).confirm
|
|
125
|
+
}, {
|
|
126
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).save), 1)]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["onClick"])], 16)) : createCommentVNode("v-if", true),
|
|
114
129
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(dialog).parts.header())), [
|
|
115
130
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(dialog).parts.title())), toDisplayString(unref(messages).rangeTitle), 17),
|
|
116
131
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(dialog).parts.headline())), toDisplayString(unref(dialog).headline()), 17),
|
|
@@ -125,9 +140,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
125
140
|
], 16),
|
|
126
141
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(dialog).parts.divider())), null, 16),
|
|
127
142
|
unref(dialog).calendarMode() ? (openBlock(), createBlock(_sfc_main$4, {
|
|
128
|
-
key:
|
|
129
|
-
ref_key: "calendar",
|
|
130
|
-
ref: calendar,
|
|
143
|
+
key: 1,
|
|
131
144
|
focused: state.focused,
|
|
132
145
|
"onUpdate:focused": _cache[0] || (_cache[0] = ($event) => state.focused = $event),
|
|
133
146
|
"first-month": state.firstMonth,
|
|
@@ -155,7 +168,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
155
168
|
"is-date-disabled",
|
|
156
169
|
"onSelect"
|
|
157
170
|
])) : createCommentVNode("v-if", true),
|
|
158
|
-
unref(dialog).inputMode() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key:
|
|
171
|
+
unref(dialog).inputMode() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, unref(dialog).parts.input())), [createVNode(_sfc_main$3, mergeProps(unref(dialog).startField(), {
|
|
159
172
|
"model-value": state.startText,
|
|
160
173
|
variant: "outlined",
|
|
161
174
|
label: unref(messages).startDate,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { DialogCancelEvent, DialogProps } from "@rio-m3e/core";
|
|
1
|
+
import { DialogCancelEvent, DialogMessages, DialogProps } from "@rio-m3e/core";
|
|
2
2
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
3
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
4
|
import "@rio-m3e/styles/dialog.css";
|
|
5
5
|
interface Props extends Omit<DialogProps, 'open'> {
|
|
6
6
|
/** States what the dialog is for, and names it. Without it, give the dialog an `aria-label`. */
|
|
7
7
|
headline?: string;
|
|
8
|
+
/** A language tag, for the close and Cancel buttons. Without it, the one provided, or the page's. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Replaces the close and Cancel buttons' names. */
|
|
11
|
+
messages?: Partial<DialogMessages>;
|
|
8
12
|
}
|
|
9
13
|
type __VLS_Props = Props;
|
|
10
14
|
type __VLS_Slots = {
|
|
@@ -12,8 +16,13 @@ type __VLS_Slots = {
|
|
|
12
16
|
default?: () => unknown;
|
|
13
17
|
/** An icon above the headline, which centers both */
|
|
14
18
|
icon?: () => unknown;
|
|
15
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Up to two buttons: the dismissing one first, then the confirming one. A full-screen or adaptive
|
|
21
|
+
* dialog draws its own close or Cancel button, so give it only the confirming one.
|
|
22
|
+
*/
|
|
16
23
|
actions?: () => unknown;
|
|
24
|
+
/** The full-screen dialog's close icon, in place of the one the app registered (`close`) */
|
|
25
|
+
'close-icon'?: () => unknown;
|
|
17
26
|
};
|
|
18
27
|
type __VLS_ModelProps = {
|
|
19
28
|
/** Whether the dialog is shown, with `v-model:open`. */
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import _sfc_main$1 from "../button/Button.vue.js";
|
|
2
|
+
import _sfc_main$2 from "../icon-button/IconButton.vue.js";
|
|
3
|
+
import _sfc_main$3 from "../icon/Icon.vue.js";
|
|
4
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
1
5
|
import { keepPresses } from "../overlay/presses.js";
|
|
2
|
-
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, watch } from "vue";
|
|
6
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
3
7
|
import { attachDialog, createDialog } from "@rio-m3e/core";
|
|
4
8
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
5
9
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
@@ -9,6 +13,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
9
13
|
__name: "Dialog",
|
|
10
14
|
props: /*@__PURE__*/ mergeModels({
|
|
11
15
|
headline: {},
|
|
16
|
+
locale: {},
|
|
17
|
+
messages: {},
|
|
18
|
+
variant: {},
|
|
12
19
|
role: {}
|
|
13
20
|
}, {
|
|
14
21
|
"open": {
|
|
@@ -23,15 +30,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
23
30
|
const open = useModel(__props, "open");
|
|
24
31
|
const emit = __emit;
|
|
25
32
|
const slots = useSlots();
|
|
33
|
+
const text = useMessages("dialog", useLocale(() => __props.locale), () => __props.messages);
|
|
26
34
|
const id = useId();
|
|
27
35
|
const overflow = ref({
|
|
28
36
|
top: false,
|
|
29
37
|
bottom: false,
|
|
30
38
|
focusable: false
|
|
31
39
|
});
|
|
40
|
+
const compact = ref(false);
|
|
32
41
|
const dialog = createDialog({
|
|
33
42
|
props: () => ({
|
|
34
43
|
open: open.value,
|
|
44
|
+
variant: __props.variant,
|
|
35
45
|
role: __props.role
|
|
36
46
|
}),
|
|
37
47
|
content: () => ({
|
|
@@ -43,7 +53,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
43
53
|
ids: {
|
|
44
54
|
headline: `${id}-headline`,
|
|
45
55
|
content: `${id}-content`
|
|
46
|
-
}
|
|
56
|
+
},
|
|
57
|
+
compact: () => compact.value
|
|
47
58
|
});
|
|
48
59
|
const rendered = ref(open.value);
|
|
49
60
|
watch(open, (next) => {
|
|
@@ -56,6 +67,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
56
67
|
onCancel: (event) => emit("cancel", event),
|
|
57
68
|
onOpenChange: (next) => open.value = next,
|
|
58
69
|
onOverflowChange: (next) => overflow.value = next,
|
|
70
|
+
onCompactChange: (next) => compact.value = next,
|
|
59
71
|
onClosed: () => {
|
|
60
72
|
if (!open.value) rendered.value = false;
|
|
61
73
|
}
|
|
@@ -70,10 +82,28 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
70
82
|
ref_key: "root",
|
|
71
83
|
ref: root
|
|
72
84
|
}, unref(dialog).parts.root(), toHandlers(unref(keepPresses), true)), [rendered.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
73
|
-
unref(dialog).
|
|
74
|
-
|
|
85
|
+
unref(dialog).fullScreen() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(dialog).parts.header())), [
|
|
86
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(dialog).parts.dismiss())), [createVNode(_sfc_main$2, {
|
|
87
|
+
label: unref(text).close,
|
|
88
|
+
variant: "standard",
|
|
89
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(handle)?.dismiss())
|
|
90
|
+
}, {
|
|
91
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$3, { alias: "close" })])]),
|
|
92
|
+
_: 3
|
|
93
|
+
}, 8, ["label"])], 16),
|
|
94
|
+
unref(dialog).showsHeadline() ? (openBlock(), createElementBlock("h2", normalizeProps(mergeProps({ key: 0 }, unref(dialog).parts.headline())), toDisplayString(__props.headline), 17)) : createCommentVNode("v-if", true),
|
|
95
|
+
unref(dialog).showsActions() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, unref(dialog).parts.actions())), [renderSlot(_ctx.$slots, "actions")], 16)) : createCommentVNode("v-if", true)
|
|
96
|
+
], 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(dialog).showsIcon() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(dialog).parts.icon())), [renderSlot(_ctx.$slots, "icon")], 16)) : createCommentVNode("v-if", true), unref(dialog).showsHeadline() ? (openBlock(), createElementBlock("h2", normalizeProps(mergeProps({ key: 1 }, unref(dialog).parts.headline())), toDisplayString(__props.headline), 17)) : createCommentVNode("v-if", true)], 64)),
|
|
97
|
+
createCommentVNode(" In one place either way, so it stays mounted, with its focus, as an adaptive dialog switches "),
|
|
75
98
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(dialog).parts.content())), [renderSlot(_ctx.$slots, "default")], 16),
|
|
76
|
-
unref(dialog).showsActions() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, unref(dialog).parts.actions())), [
|
|
99
|
+
!unref(dialog).fullScreen() && unref(dialog).showsActions() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, unref(dialog).parts.actions())), [unref(dialog).showsDismiss() ? (openBlock(), createBlock(_sfc_main$1, {
|
|
100
|
+
key: 0,
|
|
101
|
+
variant: "text",
|
|
102
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(handle)?.dismiss())
|
|
103
|
+
}, {
|
|
104
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(text).cancel), 1)]),
|
|
105
|
+
_: 1
|
|
106
|
+
})) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "actions")], 16)) : createCommentVNode("v-if", true)
|
|
77
107
|
], 64)) : createCommentVNode("v-if", true)], 16);
|
|
78
108
|
};
|
|
79
109
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DividerProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/divider.css";
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<DividerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DividerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export { _default as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createElementBlock, defineComponent, guardReactiveProps, normalizeProps, openBlock, unref } from "vue";
|
|
2
|
+
import { createDivider } from "@rio-m3e/core";
|
|
3
|
+
import "@rio-m3e/styles/divider.css";
|
|
4
|
+
// src/divider/Divider.vue
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
__name: "Divider",
|
|
7
|
+
props: {
|
|
8
|
+
orientation: {},
|
|
9
|
+
inset: {}
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const divider = createDivider({ props: () => ({
|
|
13
|
+
orientation: __props.orientation,
|
|
14
|
+
inset: __props.inset
|
|
15
|
+
}) });
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(divider).parts.root())), null, 16);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FabProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
4
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
5
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
6
|
+
import "@rio-m3e/styles/fab.css";
|
|
7
|
+
interface Props extends FabProps {
|
|
8
|
+
/** The element whose scrolling shrinks the FAB, with `shrinkOnScroll`. Defaults to the window. */
|
|
9
|
+
scrollTarget?: HTMLElement | null;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
/** The icon. Hidden from assistive technology; `label` names the FAB. */
|
|
13
|
+
default?: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
click: (event: MouseEvent) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
18
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export { _default as default };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { vRipple } from "../ripple/ripple.js";
|
|
2
|
+
import { toolbarFabKey } from "../toolbar/context.js";
|
|
3
|
+
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, onBeforeUnmount, onUpdated, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, useSlots, useTemplateRef, watch, withCtx, withDirectives } from "vue";
|
|
4
|
+
import { attachFab, createFab } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
6
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
7
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
8
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
9
|
+
import "@rio-m3e/styles/fab.css";
|
|
10
|
+
// src/fab/Fab.vue
|
|
11
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
12
|
+
__name: "Fab",
|
|
13
|
+
props: {
|
|
14
|
+
scrollTarget: {},
|
|
15
|
+
label: {},
|
|
16
|
+
size: {},
|
|
17
|
+
variant: {},
|
|
18
|
+
color: {},
|
|
19
|
+
extended: { type: Boolean },
|
|
20
|
+
shrinkOnScroll: { type: Boolean },
|
|
21
|
+
type: {},
|
|
22
|
+
href: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["click"],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const slots = useSlots();
|
|
28
|
+
/** Whether the content has scrolled down, as `attachFab` reports it */
|
|
29
|
+
const shrunk = ref(false);
|
|
30
|
+
const paired = inject(toolbarFabKey, null);
|
|
31
|
+
const fab = createFab({
|
|
32
|
+
props: () => ({
|
|
33
|
+
label: __props.label,
|
|
34
|
+
size: __props.size,
|
|
35
|
+
variant: __props.variant,
|
|
36
|
+
color: __props.color,
|
|
37
|
+
extended: __props.extended,
|
|
38
|
+
shrinkOnScroll: __props.shrinkOnScroll,
|
|
39
|
+
type: __props.type,
|
|
40
|
+
href: __props.href
|
|
41
|
+
}),
|
|
42
|
+
content: () => ({ icon: !!slots.default }),
|
|
43
|
+
onClick: (event) => emit("click", event),
|
|
44
|
+
shrunk: () => shrunk.value,
|
|
45
|
+
inherited: () => paired?.fab()
|
|
46
|
+
});
|
|
47
|
+
const root = useTemplateRef("root");
|
|
48
|
+
let handle;
|
|
49
|
+
watch(root, (element) => {
|
|
50
|
+
handle?.detach();
|
|
51
|
+
handle = element ? attachFab(element, {
|
|
52
|
+
shrinksOnScroll: fab.shrinksOnScroll,
|
|
53
|
+
target: () => __props.scrollTarget ?? void 0,
|
|
54
|
+
onShrunkChange: (next) => shrunk.value = next
|
|
55
|
+
}) : void 0;
|
|
56
|
+
}, { flush: "post" });
|
|
57
|
+
onUpdated(() => handle?.update());
|
|
58
|
+
onBeforeUnmount(() => handle?.detach());
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(fab).isLink() ? "a" : "button"), mergeProps({
|
|
61
|
+
ref_key: "root",
|
|
62
|
+
ref: root
|
|
63
|
+
}, unref(fab).parts.root(), { onClick: unref(fab).handleClick }), {
|
|
64
|
+
default: withCtx(() => [unref(fab).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(fab).parts.icon())), [renderSlot(_ctx.$slots, "default")], 16)) : createCommentVNode("v-if", true), createElementVNode("span", normalizeProps(guardReactiveProps(unref(fab).parts.label())), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(fab).parts.text())), toDisplayString(__props.label), 17)], 16)]),
|
|
65
|
+
_: 3
|
|
66
|
+
}, 16, ["onClick"])), [[unref(vRipple)]]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FabMenuProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
4
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
5
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
6
|
+
import "@rio-m3e/styles/fab-menu.css";
|
|
7
|
+
type Props = Omit<FabMenuProps, 'open'>;
|
|
8
|
+
type __VLS_Props = Props;
|
|
9
|
+
type __VLS_Slots = {
|
|
10
|
+
/** `RioFabMenuItem`s, two to six */
|
|
11
|
+
default?: () => unknown;
|
|
12
|
+
/** The FAB's icon. Hidden from assistive technology; `label` names the menu. */
|
|
13
|
+
icon?: () => unknown;
|
|
14
|
+
/** The close button's icon, in place of the one the app registered (`close`) */
|
|
15
|
+
'close-icon'?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_ModelProps = {
|
|
18
|
+
/** Whether the items show, with `v-model:open` */
|
|
19
|
+
'open'?: boolean;
|
|
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:open": (value: boolean) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
25
|
+
"onUpdate:open"?: ((value: boolean) => 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;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export { _default as default };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icon/Icon.vue.js";
|
|
2
|
+
import { vRipple } from "../ripple/ripple.js";
|
|
3
|
+
import { fabMenuKey } from "./context.js";
|
|
4
|
+
import { createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, renderSlot, shallowRef, unref, useId, useModel, useTemplateRef, watch, withDirectives } from "vue";
|
|
5
|
+
import { attachFabMenu, createFabMenu } from "@rio-m3e/core";
|
|
6
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
7
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
8
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
9
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
10
|
+
import "@rio-m3e/styles/fab-menu.css";
|
|
11
|
+
// src/fab-menu/FabMenu.vue
|
|
12
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
13
|
+
__name: "FabMenu",
|
|
14
|
+
props: /*@__PURE__*/ mergeModels({
|
|
15
|
+
label: {},
|
|
16
|
+
size: {},
|
|
17
|
+
variant: {},
|
|
18
|
+
color: {}
|
|
19
|
+
}, {
|
|
20
|
+
"open": {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
"openModifiers": {}
|
|
25
|
+
}),
|
|
26
|
+
emits: ["update:open"],
|
|
27
|
+
setup(__props) {
|
|
28
|
+
/** Whether the items show, with `v-model:open` */
|
|
29
|
+
const open = useModel(__props, "open");
|
|
30
|
+
/** The items' room, as `attachFabMenu` reports it */
|
|
31
|
+
const room = shallowRef();
|
|
32
|
+
const menu = createFabMenu({
|
|
33
|
+
props: () => ({
|
|
34
|
+
label: __props.label,
|
|
35
|
+
open: open.value,
|
|
36
|
+
size: __props.size,
|
|
37
|
+
variant: __props.variant,
|
|
38
|
+
color: __props.color
|
|
39
|
+
}),
|
|
40
|
+
onOpenChange: (next) => open.value = next,
|
|
41
|
+
id: `${useId()}-items`,
|
|
42
|
+
room: () => room.value
|
|
43
|
+
});
|
|
44
|
+
provide(fabMenuKey, { close: menu.close });
|
|
45
|
+
const root = useTemplateRef("root");
|
|
46
|
+
const button = useTemplateRef("button");
|
|
47
|
+
const list = useTemplateRef("list");
|
|
48
|
+
let handle;
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
handle = attachFabMenu({
|
|
51
|
+
root: root.value,
|
|
52
|
+
button: button.value,
|
|
53
|
+
list: list.value
|
|
54
|
+
}, {
|
|
55
|
+
onClose: () => open.value = false,
|
|
56
|
+
onRoomChange: (next) => room.value = next
|
|
57
|
+
});
|
|
58
|
+
handle.sync(open.value);
|
|
59
|
+
});
|
|
60
|
+
watch(open, (next) => handle?.sync(next), { flush: "post" });
|
|
61
|
+
onBeforeUnmount(() => handle?.detach());
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
64
|
+
ref_key: "root",
|
|
65
|
+
ref: root
|
|
66
|
+
}, unref(menu).parts.root()), [withDirectives((openBlock(), createElementBlock("button", mergeProps({
|
|
67
|
+
ref_key: "button",
|
|
68
|
+
ref: button
|
|
69
|
+
}, unref(menu).parts.button(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(menu).handleButtonClick && unref(menu).handleButtonClick(...args)) }), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(menu).parts.icon())), [renderSlot(_ctx.$slots, "icon")], 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(menu).parts.closeIcon())), [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$1, { alias: "close" })])], 16)], 16)), [[unref(vRipple)]]), createElementVNode("div", mergeProps({
|
|
70
|
+
ref_key: "list",
|
|
71
|
+
ref: list
|
|
72
|
+
}, unref(menu).parts.list()), [renderSlot(_ctx.$slots, "default")], 16)], 16);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FabMenuItemProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
4
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
5
|
+
import "@rio-m3e/styles/fab-menu.css";
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
/** The icon, before the label. Hidden from assistive technology; `label` names the item. */
|
|
8
|
+
icon?: () => unknown;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<FabMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
click: (event: MouseEvent) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<FabMenuItemProps> & Readonly<{
|
|
13
|
+
onClick?: ((event: MouseEvent) => 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;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export { _default as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { vRipple } from "../ripple/ripple.js";
|
|
2
|
+
import { fabMenuKey } from "./context.js";
|
|
3
|
+
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, useSlots, withDirectives } from "vue";
|
|
4
|
+
import { createFabMenuItem } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
6
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
7
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
8
|
+
import "@rio-m3e/styles/fab-menu.css";
|
|
9
|
+
// src/fab-menu/FabMenuItem.vue
|
|
10
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
11
|
+
__name: "FabMenuItem",
|
|
12
|
+
props: { label: {} },
|
|
13
|
+
emits: ["click"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const emit = __emit;
|
|
16
|
+
const slots = useSlots();
|
|
17
|
+
const menu = inject(fabMenuKey, void 0);
|
|
18
|
+
const item = createFabMenuItem({
|
|
19
|
+
props: () => ({ label: __props.label }),
|
|
20
|
+
content: () => ({ icon: !!slots.icon }),
|
|
21
|
+
menu: () => menu,
|
|
22
|
+
onClick: (event) => emit("click", event)
|
|
23
|
+
});
|
|
24
|
+
return (_ctx, _cache) => {
|
|
25
|
+
return withDirectives((openBlock(), createElementBlock("button", mergeProps(unref(item).parts.root(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(item).handleClick && unref(item).handleClick(...args)) }), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.content())), [unref(item).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(item).parts.icon())), [renderSlot(_ctx.$slots, "icon")], 16)) : createCommentVNode("v-if", true), createElementVNode("span", normalizeProps(guardReactiveProps(unref(item).parts.label())), toDisplayString(__props.label), 17)], 16)], 16)), [[unref(vRipple)]]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export { _sfc_main as default };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IconButtonProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/density.css";
|
|
2
4
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
5
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
6
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { useButtonGroupItem } from "../button-group/context.js";
|
|
2
|
+
import { useOverflowItem } from "../overflow/overflow.js";
|
|
2
3
|
import { vRipple } from "../ripple/ripple.js";
|
|
3
4
|
import { vCornerMorph } from "../corner-morph/corner-morph.js";
|
|
4
|
-
import { createBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, unref, useSlots, withCtx, withDirectives } from "vue";
|
|
5
|
+
import { createBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, unref, useSlots, useTemplateRef, withCtx, withDirectives } from "vue";
|
|
5
6
|
import { createIconButton } 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/focus-ring.css";
|
|
7
10
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
8
11
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -18,6 +21,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
18
21
|
size: {},
|
|
19
22
|
width: {},
|
|
20
23
|
shape: {},
|
|
24
|
+
color: {},
|
|
25
|
+
density: {},
|
|
21
26
|
toggle: { type: Boolean },
|
|
22
27
|
selected: { type: Boolean },
|
|
23
28
|
disabled: { type: Boolean },
|
|
@@ -36,6 +41,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
36
41
|
size: __props.size,
|
|
37
42
|
width: __props.width,
|
|
38
43
|
shape: __props.shape,
|
|
44
|
+
color: __props.color,
|
|
45
|
+
density: __props.density,
|
|
39
46
|
toggle: __props.toggle,
|
|
40
47
|
selected: __props.selected,
|
|
41
48
|
disabled: __props.disabled,
|
|
@@ -50,8 +57,25 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
50
57
|
onClick: (event) => emit("click", event),
|
|
51
58
|
onChange: item.onChange
|
|
52
59
|
});
|
|
60
|
+
const root = useTemplateRef("root");
|
|
61
|
+
useOverflowItem({
|
|
62
|
+
element: () => root.value,
|
|
63
|
+
label: () => __props.label,
|
|
64
|
+
icon: () => button.showsSelectedIcon() ? slots["selected-icon"]?.() : slots.default?.(),
|
|
65
|
+
disabled: () => {
|
|
66
|
+
const p = item.props();
|
|
67
|
+
return !!(p.disabled || p.softDisabled);
|
|
68
|
+
},
|
|
69
|
+
selected: () => {
|
|
70
|
+
const p = item.props();
|
|
71
|
+
return p.toggle ? !!p.selected : void 0;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
53
74
|
return (_ctx, _cache) => {
|
|
54
|
-
return withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(button).isLink() ? "a" : "button"), mergeProps(
|
|
75
|
+
return withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(button).isLink() ? "a" : "button"), mergeProps({
|
|
76
|
+
ref_key: "root",
|
|
77
|
+
ref: root
|
|
78
|
+
}, unref(button).parts.root(), { onClick: unref(button).handleClick }), {
|
|
55
79
|
default: withCtx(() => [createElementVNode("span", normalizeProps(guardReactiveProps(unref(button).parts.touch())), null, 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(button).parts.icon())), [unref(button).showsSelectedIcon() ? renderSlot(_ctx.$slots, "selected-icon", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16)]),
|
|
56
80
|
_: 3
|
|
57
81
|
}, 16, ["onClick"])), [[unref(vRipple)], [unref(vCornerMorph)]]);
|