@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,6 +1,6 @@
|
|
|
1
1
|
import { vRipple } from "../ripple/ripple.js";
|
|
2
2
|
import { selectKey } from "./context.js";
|
|
3
|
-
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, unref, useSlots, useTemplateRef, withDirectives } from "vue";
|
|
3
|
+
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, unref, useSlots, useTemplateRef, withDirectives } from "vue";
|
|
4
4
|
import { createSelectOption } from "@rio-m3e/core";
|
|
5
5
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
6
6
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -11,15 +11,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
11
11
|
__name: "SelectOption",
|
|
12
12
|
props: {
|
|
13
13
|
value: {},
|
|
14
|
+
label: {},
|
|
14
15
|
disabled: { type: Boolean }
|
|
15
16
|
},
|
|
16
17
|
setup(__props) {
|
|
17
18
|
const slots = useSlots();
|
|
18
19
|
const select = inject(selectKey, void 0);
|
|
19
20
|
if (!select) throw new Error("RioSelectOption has to be inside a RioSelect.");
|
|
21
|
+
const text = ref("");
|
|
20
22
|
const option = createSelectOption({
|
|
21
23
|
props: () => ({
|
|
22
24
|
value: __props.value,
|
|
25
|
+
label: __props.label,
|
|
23
26
|
disabled: __props.disabled
|
|
24
27
|
}),
|
|
25
28
|
content: () => ({
|
|
@@ -28,15 +31,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
28
31
|
trailingText: !!slots["trailing-text"],
|
|
29
32
|
trailingIcon: !!slots["trailing-icon"]
|
|
30
33
|
}),
|
|
31
|
-
select: () => select
|
|
34
|
+
select: () => select,
|
|
35
|
+
text: () => text.value
|
|
32
36
|
});
|
|
33
37
|
const root = useTemplateRef("root");
|
|
34
38
|
const labelElement = useTemplateRef("label");
|
|
35
|
-
const text = ref("");
|
|
36
39
|
const read = () => text.value = labelElement.value?.textContent?.trim() ?? "";
|
|
37
40
|
const unregister = select.register({
|
|
38
41
|
value: () => __props.value,
|
|
39
|
-
label:
|
|
42
|
+
label: option.labelText,
|
|
40
43
|
element: () => root.value
|
|
41
44
|
});
|
|
42
45
|
onMounted(read);
|
|
@@ -49,7 +52,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
49
52
|
}, unref(option).parts.root(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(option).handleClick && unref(option).handleClick(...args)) }), [
|
|
50
53
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(option).parts.touch())), null, 16),
|
|
51
54
|
unref(option).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(option).parts.icon())), [renderSlot(_ctx.$slots, "icon", { selected: unref(option).selected() })], 16)) : createCommentVNode("v-if", true),
|
|
52
|
-
createElementVNode("span", normalizeProps(guardReactiveProps(unref(option).parts.text())), [createElementVNode("span", mergeProps({ ref: "label" }, unref(option).parts.label()), [renderSlot(_ctx.$slots, "default")], 16), unref(option).showsSupportingText() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(option).parts.supportingText())), [renderSlot(_ctx.$slots, "supporting-text")], 16)) : createCommentVNode("v-if", true)], 16),
|
|
55
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(option).parts.text())), [createElementVNode("span", mergeProps({ ref: "label" }, unref(option).parts.label()), [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(unref(option).labelText()), 1)])], 16), unref(option).showsSupportingText() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(option).parts.supportingText())), [renderSlot(_ctx.$slots, "supporting-text")], 16)) : createCommentVNode("v-if", true)], 16),
|
|
53
56
|
unref(option).showsTrailingText() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(option).parts.trailingText())), [renderSlot(_ctx.$slots, "trailing-text")], 16)) : createCommentVNode("v-if", true),
|
|
54
57
|
unref(option).showsTrailingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 2 }, unref(option).parts.trailingIcon())), [renderSlot(_ctx.$slots, "trailing-icon")], 16)) : createCommentVNode("v-if", true)
|
|
55
58
|
], 16)), [[unref(vRipple)]]);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SheetMessages, SideSheetProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
3
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
4
|
+
import "@rio-m3e/styles/sheet.css";
|
|
5
|
+
interface Props extends Omit<SideSheetProps, 'open'> {
|
|
6
|
+
/** Names the sheet. Without it, give the sheet an `aria-label`. */
|
|
7
|
+
headline?: string;
|
|
8
|
+
/** A language tag, for the buttons' names. Without it, the one provided, or the page's. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Replaces the sheet's own words: its name, and the buttons'. */
|
|
11
|
+
messages?: Partial<SheetMessages>;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Props = Props;
|
|
14
|
+
type __VLS_Slots = {
|
|
15
|
+
/** The content, which scrolls when it doesn't fit */
|
|
16
|
+
default?: () => unknown;
|
|
17
|
+
/** Buttons below the content, as Save and Cancel */
|
|
18
|
+
actions?: () => unknown;
|
|
19
|
+
/** The back button's icon, in place of the one the app registered (`back`) */
|
|
20
|
+
'back-icon'?: () => unknown;
|
|
21
|
+
/** The close button's icon, in place of the one the app registered (`close`) */
|
|
22
|
+
'close-icon'?: () => unknown;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_ModelProps = {
|
|
25
|
+
/** Whether the sheet is shown, with `v-model:open`. */
|
|
26
|
+
'open'?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
29
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:open": (value: boolean) => any;
|
|
31
|
+
back: (event: MouseEvent) => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
33
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
34
|
+
onBack?: ((event: MouseEvent) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export { _default as default };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icon-button/IconButton.vue.js";
|
|
2
|
+
import _sfc_main$2 from "../icon/Icon.vue.js";
|
|
3
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
4
|
+
import { keepPresses } from "../overlay/presses.js";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
6
|
+
import { attachSideSheet, createSideSheet } from "@rio-m3e/core";
|
|
7
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
8
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
9
|
+
import "@rio-m3e/styles/sheet.css";
|
|
10
|
+
// src/side-sheet/SideSheet.vue
|
|
11
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
12
|
+
__name: "SideSheet",
|
|
13
|
+
props: /*@__PURE__*/ mergeModels({
|
|
14
|
+
headline: {},
|
|
15
|
+
locale: {},
|
|
16
|
+
messages: {},
|
|
17
|
+
modal: { type: Boolean },
|
|
18
|
+
backButton: { type: Boolean }
|
|
19
|
+
}, {
|
|
20
|
+
"open": {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
"openModifiers": {}
|
|
25
|
+
}),
|
|
26
|
+
emits: /*@__PURE__*/ mergeModels(["back"], ["update:open"]),
|
|
27
|
+
setup(__props, { emit: __emit }) {
|
|
28
|
+
/** Whether the sheet is shown, with `v-model:open`. */
|
|
29
|
+
const open = useModel(__props, "open");
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const slots = useSlots();
|
|
32
|
+
const text = useMessages("sheet", useLocale(() => __props.locale), () => __props.messages);
|
|
33
|
+
const id = useId();
|
|
34
|
+
const sheet = createSideSheet({
|
|
35
|
+
props: () => ({
|
|
36
|
+
open: open.value,
|
|
37
|
+
modal: __props.modal,
|
|
38
|
+
backButton: __props.backButton
|
|
39
|
+
}),
|
|
40
|
+
content: () => ({
|
|
41
|
+
headline: !!__props.headline,
|
|
42
|
+
actions: !!slots.actions
|
|
43
|
+
}),
|
|
44
|
+
messages: () => text.value,
|
|
45
|
+
ids: { headline: `${id}-headline` },
|
|
46
|
+
onOpenChange: (next) => open.value = next
|
|
47
|
+
});
|
|
48
|
+
const shown = ref(open.value);
|
|
49
|
+
watch(open, (next) => {
|
|
50
|
+
if (next) shown.value = true;
|
|
51
|
+
else if (!sheet.modal()) shown.value = false;
|
|
52
|
+
});
|
|
53
|
+
const rendered = computed(() => !sheet.modal() || shown.value);
|
|
54
|
+
const root = useTemplateRef("root");
|
|
55
|
+
let handle;
|
|
56
|
+
watch(root, (element) => {
|
|
57
|
+
const before = handle;
|
|
58
|
+
handle = element ? attachSideSheet(element, {
|
|
59
|
+
onOpenChange: (next) => open.value = next,
|
|
60
|
+
onClosed: () => {
|
|
61
|
+
if (!open.value) shown.value = false;
|
|
62
|
+
},
|
|
63
|
+
from: before
|
|
64
|
+
}) : void 0;
|
|
65
|
+
before?.detach();
|
|
66
|
+
handle?.sync(open.value);
|
|
67
|
+
}, { flush: "post" });
|
|
68
|
+
watch(open, (next) => handle?.sync(next), { flush: "post" });
|
|
69
|
+
onBeforeUnmount(() => handle?.detach());
|
|
70
|
+
return (_ctx, _cache) => {
|
|
71
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(sheet).modal() ? "dialog" : "div"), mergeProps({
|
|
72
|
+
ref_key: "root",
|
|
73
|
+
ref: root
|
|
74
|
+
}, unref(sheet).parts.root(), toHandlers(unref(sheet).modal() ? unref(keepPresses) : {})), {
|
|
75
|
+
default: withCtx(() => [rendered.value ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(sheet).parts.panel())), [
|
|
76
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(sheet).parts.header())), [
|
|
77
|
+
unref(sheet).showsBack() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(sheet).parts.back())), [createVNode(_sfc_main$1, {
|
|
78
|
+
label: unref(text).back,
|
|
79
|
+
variant: "standard",
|
|
80
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("back", $event))
|
|
81
|
+
}, {
|
|
82
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "back-icon", {}, () => [createVNode(_sfc_main$2, { alias: "back" })])]),
|
|
83
|
+
_: 3
|
|
84
|
+
}, 8, ["label"])], 16)) : createCommentVNode("v-if", true),
|
|
85
|
+
unref(sheet).showsHeadline() ? (openBlock(), createElementBlock("h2", normalizeProps(mergeProps({ key: 1 }, unref(sheet).parts.headline())), toDisplayString(__props.headline), 17)) : createCommentVNode("v-if", true),
|
|
86
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(sheet).parts.close())), [createVNode(_sfc_main$1, {
|
|
87
|
+
label: unref(text).close,
|
|
88
|
+
variant: "standard",
|
|
89
|
+
onClick: unref(sheet).handleClose
|
|
90
|
+
}, {
|
|
91
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$2, { alias: "close" })])]),
|
|
92
|
+
_: 3
|
|
93
|
+
}, 8, ["label", "onClick"])], 16)
|
|
94
|
+
], 16),
|
|
95
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(sheet).parts.content())), [renderSlot(_ctx.$slots, "default")], 16),
|
|
96
|
+
unref(sheet).showsActions() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(sheet).parts.actions())), [renderSlot(_ctx.$slots, "actions")], 16)) : createCommentVNode("v-if", true)
|
|
97
|
+
], 16)) : createCommentVNode("v-if", true)]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 16);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
export { _sfc_main as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLocale, useMessages } from "../locale/locale.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, toDisplayString, unref, useModel, useTemplateRef } from "vue";
|
|
3
3
|
import { attachSlider, createRangeSlider } 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/base/direction.css";
|
|
@@ -19,6 +20,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
19
20
|
valueIndicator: { type: Boolean },
|
|
20
21
|
format: { type: Function },
|
|
21
22
|
locale: {},
|
|
23
|
+
color: {},
|
|
22
24
|
disabled: { type: Boolean },
|
|
23
25
|
softDisabled: { type: Boolean },
|
|
24
26
|
modelValue: {},
|
|
@@ -44,6 +46,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
44
46
|
locale: locale.value,
|
|
45
47
|
disabled: props.disabled,
|
|
46
48
|
softDisabled: props.softDisabled,
|
|
49
|
+
color: props.color,
|
|
47
50
|
name: props.name
|
|
48
51
|
}),
|
|
49
52
|
messages: () => messages.value,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLocale } from "../locale/locale.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, unref, useModel, useSlots, useTemplateRef } from "vue";
|
|
3
3
|
import { attachSlider, createSlider, mergePartAttrs } 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/base/direction.css";
|
|
@@ -20,6 +21,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
20
21
|
valueIndicator: { type: Boolean },
|
|
21
22
|
format: { type: Function },
|
|
22
23
|
locale: {},
|
|
24
|
+
color: {},
|
|
23
25
|
disabled: { type: Boolean },
|
|
24
26
|
softDisabled: { type: Boolean },
|
|
25
27
|
modelValue: {}
|
|
@@ -45,6 +47,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
45
47
|
locale: locale.value,
|
|
46
48
|
disabled: props.disabled,
|
|
47
49
|
softDisabled: props.softDisabled,
|
|
50
|
+
color: props.color,
|
|
48
51
|
centered: props.centered
|
|
49
52
|
}),
|
|
50
53
|
content: () => ({ icon: !!slots.icon }),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SnackbarMessages, SnackbarProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/snackbar.css";
|
|
3
|
+
interface Props extends SnackbarProps {
|
|
4
|
+
/** The message. The default slot takes richer content instead. */
|
|
5
|
+
message?: string;
|
|
6
|
+
/** A language tag, for the close button's name. Without it, the one provided, or the page's. */
|
|
7
|
+
locale?: string;
|
|
8
|
+
/** Replaces the close button's name. */
|
|
9
|
+
messages?: Partial<SnackbarMessages>;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
/** The message, in place of the `message` prop */
|
|
13
|
+
default?: () => unknown;
|
|
14
|
+
/** The close button's icon, in place of the one the app registered (`close`) */
|
|
15
|
+
'close-icon'?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
action: () => any;
|
|
19
|
+
dismiss: () => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
21
|
+
onAction?: (() => any) | undefined;
|
|
22
|
+
onDismiss?: (() => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export { _default as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
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";
|
|
5
|
+
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
6
|
+
import { createSnackbar } from "@rio-m3e/core";
|
|
7
|
+
import "@rio-m3e/styles/snackbar.css";
|
|
8
|
+
// src/snackbar/Snackbar.vue
|
|
9
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
|
+
__name: "Snackbar",
|
|
11
|
+
props: {
|
|
12
|
+
message: {},
|
|
13
|
+
locale: {},
|
|
14
|
+
messages: {},
|
|
15
|
+
action: {},
|
|
16
|
+
dismissible: { type: Boolean },
|
|
17
|
+
actionOnNewLine: { type: Boolean }
|
|
18
|
+
},
|
|
19
|
+
emits: ["action", "dismiss"],
|
|
20
|
+
setup(__props, { emit: __emit }) {
|
|
21
|
+
const emit = __emit;
|
|
22
|
+
const text = useMessages("snackbar", useLocale(() => __props.locale), () => __props.messages);
|
|
23
|
+
const snackbar = createSnackbar({ props: () => ({
|
|
24
|
+
action: __props.action,
|
|
25
|
+
dismissible: __props.dismissible,
|
|
26
|
+
actionOnNewLine: __props.actionOnNewLine
|
|
27
|
+
}) });
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(snackbar).parts.root())), [createElementVNode("div", normalizeProps(guardReactiveProps(unref(snackbar).parts.supportingText())), [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.message), 1)])], 16), unref(snackbar).showsActions() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(snackbar).parts.actions())), [unref(snackbar).showsAction() ? (openBlock(), createBlock(_sfc_main$1, {
|
|
30
|
+
key: 0,
|
|
31
|
+
variant: "text",
|
|
32
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("action"))
|
|
33
|
+
}, {
|
|
34
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.action), 1)]),
|
|
35
|
+
_: 1
|
|
36
|
+
})) : createCommentVNode("v-if", true), unref(snackbar).showsDismiss() ? (openBlock(), createBlock(_sfc_main$2, {
|
|
37
|
+
key: 1,
|
|
38
|
+
label: unref(text).dismiss,
|
|
39
|
+
variant: "standard",
|
|
40
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("dismiss"))
|
|
41
|
+
}, {
|
|
42
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$3, { alias: "close" })])]),
|
|
43
|
+
_: 3
|
|
44
|
+
}, 8, ["label"])) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true)], 16);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SnackbarController } from "./snackbar.js";
|
|
2
|
+
import { ComponentPublicInstance } from "vue";
|
|
3
|
+
import { SnackbarEntry, SnackbarHostProps, SnackbarMessages } from "@rio-m3e/core";
|
|
4
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
5
|
+
import "@rio-m3e/styles/snackbar.css";
|
|
6
|
+
interface Props extends Omit<SnackbarHostProps, 'anchor'> {
|
|
7
|
+
/**
|
|
8
|
+
* What else the snackbar keeps clear of, besides Rio's FABs, toolbars, and navigation bars: an
|
|
9
|
+
* element, a component's template ref, or a selector for some.
|
|
10
|
+
*/
|
|
11
|
+
anchor?: string | Element | ComponentPublicInstance | null;
|
|
12
|
+
/** A language tag, for the close button's name. Without it, the one provided, or the page's. */
|
|
13
|
+
locale?: string;
|
|
14
|
+
/** Replaces the close button's name. */
|
|
15
|
+
messages?: Partial<SnackbarMessages>;
|
|
16
|
+
}
|
|
17
|
+
type __VLS_Slots = {
|
|
18
|
+
/** The app's content: `useSnackbar()` inside it shows snackbars here. */
|
|
19
|
+
default?: () => unknown;
|
|
20
|
+
/**
|
|
21
|
+
* The snackbar, in place of a `RioSnackbar` with the request's message and buttons: a
|
|
22
|
+
* `RioSnackbar` of the app's own, with `action` and `dismiss` on its buttons.
|
|
23
|
+
*/
|
|
24
|
+
snackbar?: (props: {
|
|
25
|
+
snackbar: SnackbarEntry;
|
|
26
|
+
/** Ends the snackbar with its action. */
|
|
27
|
+
action: () => void;
|
|
28
|
+
/** Ends the snackbar, dismissed. */
|
|
29
|
+
dismiss: () => void;
|
|
30
|
+
}) => unknown;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, SnackbarController, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export { _default as default };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { keepPresses } from "../overlay/presses.js";
|
|
2
|
+
import _sfc_main$1 from "./Snackbar.vue.js";
|
|
3
|
+
import { snackbarKey } from "./snackbar.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, ref, renderSlot, toDisplayString, toHandlers, unref, useTemplateRef, watch } from "vue";
|
|
5
|
+
import { attachSnackbarHost, createSnackbarHost, createSnackbarQueue, mergePartAttrs } from "@rio-m3e/core";
|
|
6
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
7
|
+
import "@rio-m3e/styles/snackbar.css";
|
|
8
|
+
// src/snackbar/SnackbarHost.vue
|
|
9
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "SnackbarHost",
|
|
12
|
+
props: {
|
|
13
|
+
anchor: {},
|
|
14
|
+
locale: {},
|
|
15
|
+
messages: {},
|
|
16
|
+
align: {},
|
|
17
|
+
offset: {},
|
|
18
|
+
shortcut: {}
|
|
19
|
+
},
|
|
20
|
+
setup(__props, { expose: __expose }) {
|
|
21
|
+
/** How far the snackbar is moved to clear what stays put on the screen, as core reports it */
|
|
22
|
+
const clearance = ref({
|
|
23
|
+
lift: 0,
|
|
24
|
+
start: 0,
|
|
25
|
+
end: 0
|
|
26
|
+
});
|
|
27
|
+
/** What the status region holds, as core gives it */
|
|
28
|
+
const announcement = ref("");
|
|
29
|
+
const host = createSnackbarHost({
|
|
30
|
+
props: () => ({
|
|
31
|
+
align: __props.align,
|
|
32
|
+
offset: __props.offset,
|
|
33
|
+
anchor: __props.anchor && typeof __props.anchor === "object" && "$el" in __props.anchor ? __props.anchor.$el : __props.anchor,
|
|
34
|
+
shortcut: __props.shortcut
|
|
35
|
+
}),
|
|
36
|
+
clearance: () => clearance.value
|
|
37
|
+
});
|
|
38
|
+
const changes = ref(0);
|
|
39
|
+
const queue = createSnackbarQueue({ onChange: () => changes.value++ });
|
|
40
|
+
const current = computed(() => {
|
|
41
|
+
changes.value;
|
|
42
|
+
return queue.current();
|
|
43
|
+
});
|
|
44
|
+
const action = () => queue.end("action");
|
|
45
|
+
const dismiss = () => queue.end("dismissed");
|
|
46
|
+
const controller = {
|
|
47
|
+
show: queue.show,
|
|
48
|
+
dismiss
|
|
49
|
+
};
|
|
50
|
+
provide(snackbarKey, controller);
|
|
51
|
+
__expose(controller);
|
|
52
|
+
const root = useTemplateRef("root");
|
|
53
|
+
let handle;
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
handle = attachSnackbarHost(root.value, {
|
|
56
|
+
queue,
|
|
57
|
+
placement: host.placement,
|
|
58
|
+
onClearanceChange: (next) => clearance.value = next,
|
|
59
|
+
onAnnounce: (message) => announcement.value = message,
|
|
60
|
+
shortcut: () => __props.shortcut
|
|
61
|
+
});
|
|
62
|
+
handle.sync();
|
|
63
|
+
});
|
|
64
|
+
watch(changes, () => handle?.sync(), { flush: "post" });
|
|
65
|
+
onUpdated(() => handle?.update());
|
|
66
|
+
onBeforeUnmount(() => {
|
|
67
|
+
handle?.detach();
|
|
68
|
+
queue.clear();
|
|
69
|
+
});
|
|
70
|
+
return (_ctx, _cache) => {
|
|
71
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
72
|
+
renderSlot(_ctx.$slots, "default"),
|
|
73
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(host).parts.live())), toDisplayString(announcement.value), 17),
|
|
74
|
+
createElementVNode("div", mergeProps({
|
|
75
|
+
ref_key: "root",
|
|
76
|
+
ref: root
|
|
77
|
+
}, unref(mergePartAttrs)({
|
|
78
|
+
..._ctx.$attrs,
|
|
79
|
+
class: void 0,
|
|
80
|
+
style: void 0
|
|
81
|
+
}, unref(host).parts.root()), {
|
|
82
|
+
class: _ctx.$attrs.class,
|
|
83
|
+
style: _ctx.$attrs.style
|
|
84
|
+
}, toHandlers(unref(keepPresses), true)), [current.value ? renderSlot(_ctx.$slots, "snackbar", {
|
|
85
|
+
snackbar: current.value,
|
|
86
|
+
action,
|
|
87
|
+
dismiss
|
|
88
|
+
}, () => [(openBlock(), createBlock(_sfc_main$1, {
|
|
89
|
+
key: current.value.id,
|
|
90
|
+
message: current.value.message,
|
|
91
|
+
action: current.value.action,
|
|
92
|
+
dismissible: current.value.dismissible,
|
|
93
|
+
"action-on-new-line": current.value.actionOnNewLine,
|
|
94
|
+
locale: __props.locale,
|
|
95
|
+
messages: __props.messages,
|
|
96
|
+
onAction: action,
|
|
97
|
+
onDismiss: dismiss
|
|
98
|
+
}, null, 8, [
|
|
99
|
+
"message",
|
|
100
|
+
"action",
|
|
101
|
+
"dismissible",
|
|
102
|
+
"action-on-new-line",
|
|
103
|
+
"locale",
|
|
104
|
+
"messages"
|
|
105
|
+
]))], void 0, 0) : createCommentVNode("v-if", true)], 16)
|
|
106
|
+
], 64);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InjectionKey } from "vue";
|
|
2
|
+
import { SnackbarRequest, SnackbarResult } from "@rio-m3e/core";
|
|
3
|
+
/** Shows snackbars in the nearest `RioSnackbarHost` around the component. */
|
|
4
|
+
export interface SnackbarController {
|
|
5
|
+
/**
|
|
6
|
+
* Queues a snackbar: the host shows one at a time, in the order asked. The promise settles as it
|
|
7
|
+
* ends: `'action'` when its action was pressed, `'dismissed'` otherwise.
|
|
8
|
+
*/
|
|
9
|
+
show(request: SnackbarRequest): Promise<SnackbarResult>;
|
|
10
|
+
/** Dismisses the snackbar on the screen, or the one about to show. */
|
|
11
|
+
dismiss(): void;
|
|
12
|
+
}
|
|
13
|
+
/** What `RioSnackbarHost` provides to the components inside it */
|
|
14
|
+
export declare const snackbarKey: InjectionKey<SnackbarController>;
|
|
15
|
+
/** The nearest `RioSnackbarHost`'s snackbars. Call it in `setup`, inside a host. */
|
|
16
|
+
export declare function useSnackbar(): SnackbarController;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inject } from "vue";
|
|
2
|
+
// src/snackbar/snackbar.ts
|
|
3
|
+
/** What `RioSnackbarHost` provides to the components inside it */
|
|
4
|
+
const snackbarKey = Symbol("RioSnackbar");
|
|
5
|
+
/** The nearest `RioSnackbarHost`'s snackbars. Call it in `setup`, inside a host. */
|
|
6
|
+
function useSnackbar() {
|
|
7
|
+
const controller = inject(snackbarKey, void 0);
|
|
8
|
+
if (!controller) throw new Error("useSnackbar() needs a RioSnackbarHost around the component.");
|
|
9
|
+
return controller;
|
|
10
|
+
}
|
|
11
|
+
export { snackbarKey, useSnackbar };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SplitButtonProps } 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";
|
|
@@ -22,11 +23,11 @@ declare const __VLS_base: import("vue").DefineComponent<SplitButtonProps, {
|
|
|
22
23
|
leading: Readonly<import("vue").ShallowRef<HTMLButtonElement | null>>;
|
|
23
24
|
trailing: Readonly<import("vue").ShallowRef<HTMLButtonElement | null>>;
|
|
24
25
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
-
click: (event: MouseEvent) => any;
|
|
26
26
|
"update:open": (open: boolean) => any;
|
|
27
|
+
click: (event: MouseEvent) => any;
|
|
27
28
|
}, string, import("vue").PublicProps, Readonly<SplitButtonProps> & Readonly<{
|
|
28
|
-
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
29
29
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
30
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
30
31
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -3,6 +3,7 @@ import { vCornerMorph } from "../corner-morph/corner-morph.js";
|
|
|
3
3
|
import _sfc_main$1 from "../icon/Icon.vue.js";
|
|
4
4
|
import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, renderSlot, unref, useSlots, useTemplateRef, withDirectives } from "vue";
|
|
5
5
|
import { attachSplitButtonMenuIcon, createSplitButton } from "@rio-m3e/core";
|
|
6
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
6
7
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
7
8
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
8
9
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -18,6 +19,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
18
19
|
label: {},
|
|
19
20
|
variant: {},
|
|
20
21
|
size: {},
|
|
22
|
+
color: {},
|
|
21
23
|
open: { type: Boolean },
|
|
22
24
|
popup: {},
|
|
23
25
|
disabled: { type: Boolean },
|
|
@@ -34,6 +36,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
34
36
|
label: __props.label,
|
|
35
37
|
variant: __props.variant,
|
|
36
38
|
size: __props.size,
|
|
39
|
+
color: __props.color,
|
|
37
40
|
open: __props.open,
|
|
38
41
|
popup: __props.popup,
|
|
39
42
|
disabled: __props.disabled,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SwitchProps } 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";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useRipple } from "../ripple/ripple.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, unref, useSlots, useTemplateRef } from "vue";
|
|
3
3
|
import { attachCheckable, attachSwitchHandle, createSwitch, mergePartAttrs } from "@rio-m3e/core";
|
|
4
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
5
|
+
import "@rio-m3e/styles/base/density.css";
|
|
4
6
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
5
7
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
6
8
|
import "@rio-m3e/styles/base/ripple.css";
|
|
@@ -11,6 +13,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
11
13
|
__name: "Switch",
|
|
12
14
|
props: {
|
|
13
15
|
selected: { type: Boolean },
|
|
16
|
+
color: {},
|
|
17
|
+
density: {},
|
|
14
18
|
disabled: { type: Boolean },
|
|
15
19
|
softDisabled: { type: Boolean }
|
|
16
20
|
},
|
|
@@ -25,6 +29,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
25
29
|
const sw = createSwitch({
|
|
26
30
|
props: () => ({
|
|
27
31
|
selected: __props.selected,
|
|
32
|
+
color: __props.color,
|
|
33
|
+
density: __props.density,
|
|
28
34
|
disabled: __props.disabled,
|
|
29
35
|
softDisabled: __props.softDisabled
|
|
30
36
|
}),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TabProps } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
3
|
+
import "@rio-m3e/styles/base/density.css";
|
|
4
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
5
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
6
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
7
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
8
|
+
import "@rio-m3e/styles/tabs.css";
|
|
9
|
+
type __VLS_Props = Omit<TabProps, 'locale'>;
|
|
10
|
+
type __VLS_Slots = {
|
|
11
|
+
/** The icon: over the label in primary tabs, beside it in secondary ones, or alone */
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
click: (event: MouseEvent) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export { _default as default };
|