@rio-m3e/vue 0.6.2 → 0.7.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 +91 -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 +9130 -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 +1 -0
- package/dist/checkbox/Checkbox.vue.js +3 -0
- package/dist/chip/AssistChip.vue.d.ts +1 -0
- package/dist/chip/AssistChip.vue.js +3 -0
- package/dist/chip/ChipSet.vue.d.ts +1 -0
- package/dist/chip/ChipSet.vue.js +4 -1
- package/dist/chip/FilterChip.vue.d.ts +9 -2
- package/dist/chip/FilterChip.vue.js +12 -5
- package/dist/chip/InputChip.vue.d.ts +5 -1
- package/dist/chip/InputChip.vue.js +6 -2
- package/dist/chip/SuggestionChip.vue.d.ts +1 -0
- package/dist/chip/SuggestionChip.vue.js +3 -0
- package/dist/date-picker/DatePicker.vue.d.ts +27 -4
- package/dist/date-picker/DatePicker.vue.js +15 -5
- package/dist/date-picker/DatePickerCalendar.vue.js +11 -13
- package/dist/date-picker/DatePickerDialog.vue.d.ts +26 -3
- package/dist/date-picker/DatePickerDialog.vue.js +66 -21
- package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
- package/dist/date-picker/DateRangePickerDialog.vue.d.ts +23 -3
- package/dist/date-picker/DateRangePickerDialog.vue.js +31 -17
- 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/Icon.vue.d.ts +13 -0
- package/dist/icon/Icon.vue.js +30 -0
- package/dist/icon/icons.d.ts +12 -0
- package/dist/icon/icons.js +12 -0
- package/dist/icon-button/IconButton.vue.d.ts +1 -0
- package/dist/icon-button/IconButton.vue.js +23 -2
- package/dist/ime/composing.js +24 -0
- package/dist/index.d.ts +69 -39
- package/dist/index.js +69 -39
- package/dist/list/List.vue.d.ts +1 -0
- package/dist/list/List.vue.js +4 -1
- package/dist/list/ListItem.vue.d.ts +7 -1
- package/dist/list/ListItem.vue.js +4 -1
- 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 +1 -0
- package/dist/menu/Menu.vue.js +12 -2
- package/dist/menu/MenuDivider.vue.d.ts +1 -0
- package/dist/menu/MenuDivider.vue.js +1 -0
- package/dist/menu/MenuGroup.vue.d.ts +1 -0
- package/dist/menu/MenuGroup.vue.js +1 -0
- package/dist/menu/MenuItem.vue.d.ts +1 -0
- package/dist/menu/MenuItem.vue.js +1 -0
- package/dist/menu/SubMenu.vue.d.ts +2 -1
- package/dist/menu/SubMenu.vue.js +7 -3
- 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 +2 -0
- package/dist/progress/CircularProgress.vue.js +6 -2
- package/dist/progress/LinearProgress.vue.d.ts +2 -0
- package/dist/progress/LinearProgress.vue.js +6 -2
- package/dist/radio/Radio.vue.d.ts +1 -0
- package/dist/radio/Radio.vue.js +4 -1
- package/dist/radio/RadioGroup.vue.d.ts +1 -0
- package/dist/radio/RadioGroup.vue.js +10 -2
- package/dist/rio/rio.d.ts +9 -1
- package/dist/rio/rio.js +11 -3
- 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 +8 -3
- package/dist/select/Select.vue.js +42 -30
- package/dist/select/SelectOption.vue.d.ts +5 -1
- package/dist/select/SelectOption.vue.js +9 -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 +2 -0
- package/dist/slider/RangeSlider.vue.js +4 -0
- package/dist/slider/Slider.vue.d.ts +2 -0
- package/dist/slider/Slider.vue.js +4 -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 +4 -1
- package/dist/split-button/SplitButton.vue.js +7 -2
- package/dist/switch/Switch.vue.d.ts +1 -0
- package/dist/switch/Switch.vue.js +3 -0
- package/dist/tabs/Tab.vue.d.ts +19 -0
- package/dist/tabs/Tab.vue.js +66 -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 +32 -0
- package/dist/tabs/Tabs.vue.js +95 -0
- package/dist/tabs/context.js +5 -0
- package/dist/text-field/TextField.vue.d.ts +8 -2
- package/dist/text-field/TextField.vue.js +91 -47
- package/dist/time-picker/TimeInput.vue.d.ts +8 -1
- package/dist/time-picker/TimeInput.vue.js +6 -2
- package/dist/time-picker/TimePickerDialog.vue.d.ts +20 -4
- package/dist/time-picker/TimePickerDialog.vue.js +8 -3
- package/dist/time-picker/TimeScroll.vue.d.ts +16 -3
- package/dist/time-picker/TimeScroll.vue.js +8 -3
- 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/package.json +6 -4
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { SelectProps, SelectSelected, SelectValue } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
2
3
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
3
5
|
import "@rio-m3e/styles/base/anchored-position.css";
|
|
4
|
-
import "@rio-m3e/styles/text-field.css";
|
|
5
6
|
import "@rio-m3e/styles/menu.css";
|
|
7
|
+
import "@rio-m3e/styles/text-field.css";
|
|
6
8
|
import "@rio-m3e/styles/select.css";
|
|
7
9
|
type Props = Omit<SelectProps, 'selected' | 'open'>;
|
|
8
10
|
type __VLS_Props = Props;
|
|
9
11
|
type __VLS_Slots = {
|
|
10
|
-
/** `RioSelectOption`s */
|
|
12
|
+
/** `RioSelectOption`s. Give each its `label` for the field to show it in a server render. */
|
|
11
13
|
default?: () => unknown;
|
|
12
14
|
/** An icon before the selection */
|
|
13
15
|
'leading-icon'?: () => unknown;
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The dropdown arrow, such as arrow_drop_down. It turns over while the list is open. Without one,
|
|
18
|
+
* the `dropdown` icon registered with `createRio`.
|
|
19
|
+
*/
|
|
15
20
|
'dropdown-icon'?: () => unknown;
|
|
16
21
|
/**
|
|
17
22
|
* The selection as the field shows it, in place of the selected options' labels separated by
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { keepPresses } from "../overlay/presses.js";
|
|
2
|
+
import _sfc_main$1 from "./AfterOptions.vue.js";
|
|
2
3
|
import { selectKey } from "./context.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
4
|
+
import _sfc_main$2 from "../icon/Icon.vue.js";
|
|
5
|
+
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderList, renderSlot, shallowReactive, toDisplayString, toHandlers, unref, useAttrs, useId, useModel, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
6
|
+
import { attachSelect, createSelect, inDocumentOrder, mergePartAttrs } from "@rio-m3e/core";
|
|
7
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
5
8
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
9
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
6
10
|
import "@rio-m3e/styles/base/anchored-position.css";
|
|
7
|
-
import "@rio-m3e/styles/text-field.css";
|
|
8
11
|
import "@rio-m3e/styles/menu.css";
|
|
12
|
+
import "@rio-m3e/styles/text-field.css";
|
|
9
13
|
import "@rio-m3e/styles/select.css";
|
|
10
14
|
// src/select/Select.vue
|
|
11
15
|
const _hoisted_1 = {
|
|
12
16
|
key: 0,
|
|
13
17
|
value: ""
|
|
14
18
|
};
|
|
15
|
-
const _hoisted_2 = ["value"];
|
|
19
|
+
const _hoisted_2 = ["value", "selected"];
|
|
16
20
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
21
|
inheritAttrs: false,
|
|
18
22
|
__name: "Select",
|
|
@@ -23,6 +27,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
23
27
|
supportingText: {},
|
|
24
28
|
error: { type: Boolean },
|
|
25
29
|
errorText: {},
|
|
30
|
+
color: {},
|
|
26
31
|
required: { type: Boolean },
|
|
27
32
|
disabled: { type: Boolean },
|
|
28
33
|
name: {},
|
|
@@ -47,14 +52,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
47
52
|
const slots = useSlots();
|
|
48
53
|
const entries = shallowReactive([]);
|
|
49
54
|
/** The options, in the order they appear once rendered */
|
|
50
|
-
const options = () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
value: entry.value(),
|
|
55
|
-
label: entry.label()
|
|
56
|
-
}));
|
|
57
|
-
};
|
|
55
|
+
const options = () => inDocumentOrder(entries, (entry) => entry.element()).map((entry) => ({
|
|
56
|
+
value: entry.value(),
|
|
57
|
+
label: entry.label()
|
|
58
|
+
}));
|
|
58
59
|
const id = useId();
|
|
59
60
|
const attrs = useAttrs();
|
|
60
61
|
const select = createSelect({
|
|
@@ -67,6 +68,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
67
68
|
supportingText: __props.supportingText,
|
|
68
69
|
error: __props.error,
|
|
69
70
|
errorText: __props.errorText,
|
|
71
|
+
color: __props.color,
|
|
70
72
|
required: __props.required,
|
|
71
73
|
disabled: __props.disabled,
|
|
72
74
|
name: __props.name,
|
|
@@ -130,6 +132,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
130
132
|
class: _ctx.$attrs.class,
|
|
131
133
|
style: _ctx.$attrs.style
|
|
132
134
|
}), [
|
|
135
|
+
createElementVNode("div", mergeProps({
|
|
136
|
+
ref_key: "listbox",
|
|
137
|
+
ref: listbox
|
|
138
|
+
}, unref(select).parts.listbox(), toHandlers(unref(keepPresses), true)), [renderSlot(_ctx.$slots, "default")], 16),
|
|
133
139
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(select).parts.frame())), [
|
|
134
140
|
unref(select).showsOutline() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(select).parts.outline())), [
|
|
135
141
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.outlineStart())), null, 16),
|
|
@@ -149,29 +155,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
149
155
|
..._ctx.$attrs,
|
|
150
156
|
class: void 0,
|
|
151
157
|
style: void 0
|
|
152
|
-
}, unref(select).parts.field())), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.value())), [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.
|
|
158
|
+
}, unref(select).parts.field())), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.value())), [createVNode(_sfc_main$1, null, {
|
|
159
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "value", {
|
|
160
|
+
selected: unref(select).selectedValues(),
|
|
161
|
+
labels: unref(select).selectedLabels()
|
|
162
|
+
}, () => [createTextVNode(toDisplayString(unref(select).valueText()), 1)])]),
|
|
163
|
+
_: 3
|
|
164
|
+
})], 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.sizer())), [createVNode(_sfc_main$1, null, {
|
|
165
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(select).sizerTexts(), (text, index) => {
|
|
166
|
+
return openBlock(), createElementBlock("span", { key: index }, toDisplayString(text), 1);
|
|
167
|
+
}), 128))]),
|
|
168
|
+
_: 1
|
|
169
|
+
})], 16)], 16)], 16),
|
|
170
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(select).parts.arrow())), [renderSlot(_ctx.$slots, "dropdown-icon", {}, () => [createVNode(_sfc_main$2, { alias: "dropdown" })])], 16),
|
|
159
171
|
createElementVNode("select", mergeProps({
|
|
160
172
|
ref_key: "native",
|
|
161
173
|
ref: native
|
|
162
|
-
}, unref(select).parts.native()), [!unref(select).multiple() ? (openBlock(), createElementBlock("option", _hoisted_1)) : createCommentVNode("v-if", true), (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
}, unref(select).parts.native()), [!unref(select).multiple() ? (openBlock(), createElementBlock("option", _hoisted_1)) : createCommentVNode("v-if", true), createVNode(_sfc_main$1, null, {
|
|
175
|
+
default: withCtx(() => [createCommentVNode(" `selected`, which a server render writes as the attribute, so it submits the\n selection before the page runs "), (openBlock(true), createElementBlock(Fragment, null, renderList(options(), (option) => {
|
|
176
|
+
return openBlock(), createElementBlock("option", {
|
|
177
|
+
key: unref(select).nativeValue(option.value),
|
|
178
|
+
value: unref(select).nativeValue(option.value),
|
|
179
|
+
selected: unref(select).isSelected(option.value)
|
|
180
|
+
}, toDisplayString(option.label), 9, _hoisted_2);
|
|
181
|
+
}), 128))]),
|
|
182
|
+
_: 1
|
|
183
|
+
})], 16)
|
|
168
184
|
], 16)
|
|
169
185
|
], 16),
|
|
170
|
-
unref(select).showsSupporting() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(select).parts.supporting())), [createCommentVNode(" A new element for the error text, so it arrives with its alert role. "), (openBlock(), createElementBlock("span", mergeProps({ key: unref(select).showsErrorText() ? "error" : "supporting" }, unref(select).parts.supportingText()), toDisplayString(unref(select).supportingTextNow()), 17))], 16)) : createCommentVNode("v-if", true)
|
|
171
|
-
createElementVNode("div", mergeProps({
|
|
172
|
-
ref_key: "listbox",
|
|
173
|
-
ref: listbox
|
|
174
|
-
}, unref(select).parts.listbox(), toHandlers(unref(keepPresses), true)), [renderSlot(_ctx.$slots, "default")], 16)
|
|
186
|
+
unref(select).showsSupporting() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(select).parts.supporting())), [createCommentVNode(" A new element for the error text, so it arrives with its alert role. "), (openBlock(), createElementBlock("span", mergeProps({ key: unref(select).showsErrorText() ? "error" : "supporting" }, unref(select).parts.supportingText()), toDisplayString(unref(select).supportingTextNow()), 17))], 16)) : createCommentVNode("v-if", true)
|
|
175
187
|
], 16);
|
|
176
188
|
};
|
|
177
189
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { SelectOptionProps } from "@rio-m3e/core";
|
|
2
2
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
3
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
4
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
4
5
|
import "@rio-m3e/styles/menu.css";
|
|
5
6
|
type __VLS_Slots = {
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The label as the option shows it. Without it, the `label` prop. The field shows the `label`
|
|
9
|
+
* prop while the option is selected, or else this text.
|
|
10
|
+
*/
|
|
7
11
|
default?: () => unknown;
|
|
8
12
|
/**
|
|
9
13
|
* A leading icon, hidden from assistive technology. `selected` lets it show a check mark next to
|
|
@@ -1,24 +1,28 @@
|
|
|
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";
|
|
7
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
7
8
|
import "@rio-m3e/styles/menu.css";
|
|
8
9
|
// src/select/SelectOption.vue
|
|
9
10
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
11
|
__name: "SelectOption",
|
|
11
12
|
props: {
|
|
12
13
|
value: {},
|
|
14
|
+
label: {},
|
|
13
15
|
disabled: { type: Boolean }
|
|
14
16
|
},
|
|
15
17
|
setup(__props) {
|
|
16
18
|
const slots = useSlots();
|
|
17
19
|
const select = inject(selectKey, void 0);
|
|
18
20
|
if (!select) throw new Error("RioSelectOption has to be inside a RioSelect.");
|
|
21
|
+
const text = ref("");
|
|
19
22
|
const option = createSelectOption({
|
|
20
23
|
props: () => ({
|
|
21
24
|
value: __props.value,
|
|
25
|
+
label: __props.label,
|
|
22
26
|
disabled: __props.disabled
|
|
23
27
|
}),
|
|
24
28
|
content: () => ({
|
|
@@ -27,15 +31,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
27
31
|
trailingText: !!slots["trailing-text"],
|
|
28
32
|
trailingIcon: !!slots["trailing-icon"]
|
|
29
33
|
}),
|
|
30
|
-
select: () => select
|
|
34
|
+
select: () => select,
|
|
35
|
+
text: () => text.value
|
|
31
36
|
});
|
|
32
37
|
const root = useTemplateRef("root");
|
|
33
38
|
const labelElement = useTemplateRef("label");
|
|
34
|
-
const text = ref("");
|
|
35
39
|
const read = () => text.value = labelElement.value?.textContent?.trim() ?? "";
|
|
36
40
|
const unregister = select.register({
|
|
37
41
|
value: () => __props.value,
|
|
38
|
-
label:
|
|
42
|
+
label: option.labelText,
|
|
39
43
|
element: () => root.value
|
|
40
44
|
});
|
|
41
45
|
onMounted(read);
|
|
@@ -48,7 +52,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
48
52
|
}, unref(option).parts.root(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(option).handleClick && unref(option).handleClick(...args)) }), [
|
|
49
53
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(option).parts.touch())), null, 16),
|
|
50
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),
|
|
51
|
-
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),
|
|
52
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),
|
|
53
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)
|
|
54
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,8 @@
|
|
|
1
1
|
import { RangeSliderProps, SliderMessages } 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";
|
|
5
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
4
6
|
import "@rio-m3e/styles/slider.css";
|
|
5
7
|
type __VLS_Props = Omit<RangeSliderProps, 'value'> & {
|
|
6
8
|
/** The start and the end of the range, with `v-model`. */
|
|
@@ -1,8 +1,10 @@
|
|
|
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";
|
|
7
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
6
8
|
import "@rio-m3e/styles/slider.css";
|
|
7
9
|
// src/slider/RangeSlider.vue
|
|
8
10
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
@@ -18,6 +20,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
18
20
|
valueIndicator: { type: Boolean },
|
|
19
21
|
format: { type: Function },
|
|
20
22
|
locale: {},
|
|
23
|
+
color: {},
|
|
21
24
|
disabled: { type: Boolean },
|
|
22
25
|
softDisabled: { type: Boolean },
|
|
23
26
|
modelValue: {},
|
|
@@ -43,6 +46,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
43
46
|
locale: locale.value,
|
|
44
47
|
disabled: props.disabled,
|
|
45
48
|
softDisabled: props.softDisabled,
|
|
49
|
+
color: props.color,
|
|
46
50
|
name: props.name
|
|
47
51
|
}),
|
|
48
52
|
messages: () => messages.value,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SliderProps } 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";
|
|
5
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
4
6
|
import "@rio-m3e/styles/slider.css";
|
|
5
7
|
type __VLS_Props = Omit<SliderProps, 'value'> & {
|
|
6
8
|
/** The value, with `v-model`. */
|
|
@@ -1,8 +1,10 @@
|
|
|
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";
|
|
7
|
+
import "@rio-m3e/styles/base/direction.css";
|
|
6
8
|
import "@rio-m3e/styles/slider.css";
|
|
7
9
|
// src/slider/Slider.vue
|
|
8
10
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
@@ -19,6 +21,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
19
21
|
valueIndicator: { type: Boolean },
|
|
20
22
|
format: { type: Function },
|
|
21
23
|
locale: {},
|
|
24
|
+
color: {},
|
|
22
25
|
disabled: { type: Boolean },
|
|
23
26
|
softDisabled: { type: Boolean },
|
|
24
27
|
modelValue: {}
|
|
@@ -44,6 +47,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
44
47
|
locale: locale.value,
|
|
45
48
|
disabled: props.disabled,
|
|
46
49
|
softDisabled: props.softDisabled,
|
|
50
|
+
color: props.color,
|
|
47
51
|
centered: props.centered
|
|
48
52
|
}),
|
|
49
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 };
|