@rio-m3e/vue 0.4.0 → 0.6.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/NOTICE +6 -0
- package/dist/button/Button.vue.d.ts +3 -2
- package/dist/button/Button.vue.js +14 -8
- package/dist/checkbox/Checkbox.vue.d.ts +1 -0
- package/dist/checkbox/Checkbox.vue.js +8 -11
- package/dist/chip/AssistChip.vue.d.ts +25 -0
- package/dist/chip/AssistChip.vue.js +50 -0
- package/dist/chip/ChipSet.vue.d.ts +23 -0
- package/dist/chip/ChipSet.vue.js +53 -0
- package/dist/chip/FilterChip.vue.d.ts +33 -0
- package/dist/chip/FilterChip.vue.js +68 -0
- package/dist/chip/InputChip.vue.d.ts +37 -0
- package/dist/chip/InputChip.vue.js +82 -0
- package/dist/chip/SuggestionChip.vue.d.ts +24 -0
- package/dist/chip/SuggestionChip.vue.js +50 -0
- package/dist/chip/context.js +17 -0
- package/dist/corner-morph/corner-morph.js +19 -0
- package/dist/date-picker/DatePicker.vue.d.ts +67 -0
- package/dist/date-picker/DatePicker.vue.js +239 -0
- package/dist/date-picker/DatePickerCalendar.vue.js +146 -0
- package/dist/date-picker/DatePickerDialog.vue.d.ts +58 -0
- package/dist/date-picker/DatePickerDialog.vue.js +191 -0
- package/dist/date-picker/DateRangeCalendar.vue.js +89 -0
- package/dist/date-picker/DateRangePickerDialog.vue.d.ts +56 -0
- package/dist/date-picker/DateRangePickerDialog.vue.js +208 -0
- package/dist/dialog/Dialog.vue.js +12 -13
- package/dist/icon-button/IconButton.vue.d.ts +3 -2
- package/dist/icon-button/IconButton.vue.js +10 -4
- package/dist/index.d.ts +41 -17
- package/dist/index.js +41 -17
- package/dist/list/List.vue.d.ts +23 -0
- package/dist/list/List.vue.js +61 -0
- package/dist/list/ListItem.vue.d.ts +49 -0
- package/dist/list/ListItem.vue.js +106 -0
- package/dist/list/context.js +12 -0
- package/dist/loading-indicator/LoadingIndicator.vue.d.ts +5 -0
- package/dist/loading-indicator/LoadingIndicator.vue.js +45 -0
- package/dist/locale/LocaleProvider.vue.d.ts +16 -0
- package/dist/locale/LocaleProvider.vue.js +14 -0
- package/dist/locale/locale.d.ts +16 -0
- package/dist/locale/locale.js +27 -0
- package/dist/menu/Menu.vue.js +9 -4
- package/dist/menu/SubMenu.vue.js +36 -17
- package/dist/overlay/presses.js +9 -0
- package/dist/progress/CircularProgress.vue.d.ts +5 -0
- package/dist/progress/CircularProgress.vue.js +54 -0
- package/dist/progress/LinearProgress.vue.d.ts +4 -0
- package/dist/progress/LinearProgress.vue.js +62 -0
- package/dist/radio/Radio.vue.d.ts +3 -2
- package/dist/radio/Radio.vue.js +17 -16
- package/dist/rio/rio.d.ts +32 -0
- package/dist/rio/rio.js +32 -0
- package/dist/ripple/ripple.js +14 -1
- package/dist/scroll-field/ScrollField.vue.d.ts +19 -0
- package/dist/scroll-field/ScrollField.vue.js +121 -0
- package/dist/select/Select.vue.d.ts +46 -0
- package/dist/select/Select.vue.js +179 -0
- package/dist/select/SelectOption.vue.d.ts +30 -0
- package/dist/select/SelectOption.vue.js +58 -0
- package/dist/select/context.js +3 -0
- package/dist/slider/RangeSlider.vue.d.ts +17 -0
- package/dist/slider/RangeSlider.vue.js +92 -0
- package/dist/slider/Slider.vue.d.ts +25 -0
- package/dist/slider/Slider.vue.js +102 -0
- package/dist/split-button/SplitButton.vue.d.ts +3 -2
- package/dist/split-button/SplitButton.vue.js +4 -3
- package/dist/switch/Switch.vue.js +33 -8
- package/dist/text-field/TextField.vue.js +8 -11
- package/dist/time-picker/TimeInput.vue.d.ts +26 -0
- package/dist/time-picker/TimeInput.vue.js +73 -0
- package/dist/time-picker/TimePickerBody.vue.js +72 -0
- package/dist/time-picker/TimePickerDialog.vue.d.ts +51 -0
- package/dist/time-picker/TimePickerDialog.vue.js +137 -0
- package/dist/time-picker/TimeScroll.vue.d.ts +38 -0
- package/dist/time-picker/TimeScroll.vue.js +81 -0
- package/dist/tooltip/Tooltip.vue.js +10 -22
- package/package.json +4 -4
- package/dist/shape-morph/shape-morph.js +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted,
|
|
2
|
-
import { attachTextField, createTextField } from "@rio-m3e/core";
|
|
1
|
+
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, renderSlot, toDisplayString, unref, useAttrs, useId, useModel, useSlots, useTemplateRef, vModelDynamic, vModelText, withDirectives } from "vue";
|
|
2
|
+
import { attachTextField, createTextField, mergePartAttrs } from "@rio-m3e/core";
|
|
3
3
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
4
|
import "@rio-m3e/styles/text-field.css";
|
|
5
5
|
// src/text-field/TextField.vue
|
|
@@ -69,7 +69,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
69
69
|
const input = useTemplateRef("input");
|
|
70
70
|
let handle;
|
|
71
71
|
onMounted(() => handle = attachTextField(container.value, () => input.value));
|
|
72
|
-
onUpdated(() => handle?.update());
|
|
73
72
|
onBeforeUnmount(() => handle?.detach());
|
|
74
73
|
return (_ctx, _cache) => {
|
|
75
74
|
return openBlock(), createElementBlock("div", mergeProps(unref(field).parts.root(), {
|
|
@@ -95,22 +94,20 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
95
94
|
ref_key: "input",
|
|
96
95
|
ref: input,
|
|
97
96
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
|
|
98
|
-
}, {
|
|
97
|
+
}, unref(mergePartAttrs)({
|
|
99
98
|
..._ctx.$attrs,
|
|
100
99
|
class: void 0,
|
|
101
|
-
style: void 0
|
|
102
|
-
|
|
103
|
-
}), null, 16)), [[vModelDynamic, model.value]]) : withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
|
|
100
|
+
style: void 0
|
|
101
|
+
}, unref(field).parts.input())), null, 16)), [[vModelDynamic, model.value]]) : withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
|
|
104
102
|
key: 2,
|
|
105
103
|
ref_key: "input",
|
|
106
104
|
ref: input,
|
|
107
105
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => model.value = $event)
|
|
108
|
-
}, {
|
|
106
|
+
}, unref(mergePartAttrs)({
|
|
109
107
|
..._ctx.$attrs,
|
|
110
108
|
class: void 0,
|
|
111
|
-
style: void 0
|
|
112
|
-
|
|
113
|
-
}), null, 16)), [[vModelText, model.value]]),
|
|
109
|
+
style: void 0
|
|
110
|
+
}, unref(field).parts.textarea())), null, 16)), [[vModelText, model.value]]),
|
|
114
111
|
unref(field).showsSuffix() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 3 }, unref(field).parts.suffix())), toDisplayString(__props.suffix), 17)) : createCommentVNode("v-if", true)
|
|
115
112
|
], 16),
|
|
116
113
|
unref(field).showsTrailingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.trailingIcon())), [renderSlot(_ctx.$slots, "trailing-icon")], 16)) : createCommentVNode("v-if", true)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HourCycle, TimePickerMessages } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
5
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
6
|
+
import "@rio-m3e/styles/time-picker.css";
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** A language tag. Without it, the one provided, or the document's, or the browser's. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Overrides the language's clock: 12 hours with AM and PM, or 24. */
|
|
11
|
+
hourCycle?: HourCycle;
|
|
12
|
+
/** Replaces any of the text the picker shows. */
|
|
13
|
+
messages?: Partial<TimePickerMessages>;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_ModelProps = {
|
|
16
|
+
/** The time, `HH:MM` on a 24-hour clock, with `v-model`. */
|
|
17
|
+
modelValue?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
20
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export { _default as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
2
|
+
import _sfc_main$1 from "./TimePickerBody.vue.js";
|
|
3
|
+
import { createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, toDisplayString, unref, useId, useModel, useTemplateRef, watch } from "vue";
|
|
4
|
+
import { attachTimePicker, createTimePicker, initialTimePickerState } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
6
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
7
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
8
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
9
|
+
import "@rio-m3e/styles/time-picker.css";
|
|
10
|
+
// src/time-picker/TimeInput.vue
|
|
11
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
12
|
+
__name: "TimeInput",
|
|
13
|
+
props: /*@__PURE__*/ mergeModels({
|
|
14
|
+
locale: {},
|
|
15
|
+
hourCycle: {},
|
|
16
|
+
messages: {}
|
|
17
|
+
}, {
|
|
18
|
+
"modelValue": {},
|
|
19
|
+
"modelModifiers": {}
|
|
20
|
+
}),
|
|
21
|
+
emits: ["update:modelValue"],
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
/** The time, `HH:MM` on a 24-hour clock, with `v-model`. */
|
|
25
|
+
const model = useModel(__props, "modelValue");
|
|
26
|
+
const locale = useLocale(() => props.locale);
|
|
27
|
+
const messages = useMessages("timePicker", locale, () => props.messages);
|
|
28
|
+
const state = reactive({
|
|
29
|
+
...initialTimePickerState(model.value),
|
|
30
|
+
mode: "input"
|
|
31
|
+
});
|
|
32
|
+
const id = useId();
|
|
33
|
+
const picker = createTimePicker({
|
|
34
|
+
variant: "inline",
|
|
35
|
+
props: () => ({
|
|
36
|
+
value: model.value,
|
|
37
|
+
locale: locale.value,
|
|
38
|
+
hourCycle: props.hourCycle
|
|
39
|
+
}),
|
|
40
|
+
messages: () => messages.value,
|
|
41
|
+
state: () => state,
|
|
42
|
+
ids: { error: `${id}-error` },
|
|
43
|
+
onChange: (next) => model.value = next,
|
|
44
|
+
onStateChange: (next) => Object.assign(state, next)
|
|
45
|
+
});
|
|
46
|
+
picker.valueChanged();
|
|
47
|
+
watch([
|
|
48
|
+
model,
|
|
49
|
+
locale,
|
|
50
|
+
() => props.hourCycle
|
|
51
|
+
], () => picker.valueChanged());
|
|
52
|
+
const root = useTemplateRef("root");
|
|
53
|
+
let handle;
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
handle = attachTimePicker(root.value, {
|
|
56
|
+
selection: () => state.selection,
|
|
57
|
+
hourCycle: picker.hourCycle,
|
|
58
|
+
onPick: picker.dialPick,
|
|
59
|
+
onPeriod: picker.selectPeriod,
|
|
60
|
+
onHover: picker.hover
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
watch(state, () => handle?.sync(), { flush: "post" });
|
|
64
|
+
onBeforeUnmount(() => handle?.detach());
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
67
|
+
ref_key: "root",
|
|
68
|
+
ref: root
|
|
69
|
+
}, unref(picker).parts.root()), [createVNode(_sfc_main$1, { picker: unref(picker) }, null, 8, ["picker"]), unref(picker).showsError() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(picker).parts.error())), toDisplayString(unref(picker).error()), 17)) : createCommentVNode("v-if", true)], 16);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { vRipple } from "../ripple/ripple.js";
|
|
2
|
+
import { vCornerMorph } from "../corner-morph/corner-morph.js";
|
|
3
|
+
import _sfc_main$1 from "../scroll-field/ScrollField.vue.js";
|
|
4
|
+
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, toDisplayString, unref, withDirectives, withKeys } from "vue";
|
|
5
|
+
// src/time-picker/TimePickerBody.vue
|
|
6
|
+
const _hoisted_1 = ["value"];
|
|
7
|
+
const _hoisted_2 = ["value"];
|
|
8
|
+
const _hoisted_3 = ["onClick"];
|
|
9
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
|
+
__name: "TimePickerBody",
|
|
11
|
+
props: { picker: {} },
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
/** A scroll field's props, its value as `v-model`'s, and its root's attributes */
|
|
15
|
+
const scrollField = (field) => {
|
|
16
|
+
const { value, ...rest } = props.picker.scrollField(field);
|
|
17
|
+
const { parts } = props.picker;
|
|
18
|
+
return {
|
|
19
|
+
...field === "hour" ? parts.hourField() : parts.minuteField(),
|
|
20
|
+
...rest,
|
|
21
|
+
modelValue: value
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
return (_ctx, _cache) => {
|
|
25
|
+
return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(__props.picker.parts.body())), [
|
|
26
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(__props.picker.parts.fields())), [__props.picker.textInput() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
27
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.unit())), [createElementVNode("input", mergeProps(__props.picker.parts.hourField(), {
|
|
28
|
+
value: __props.picker.hourText(),
|
|
29
|
+
onInput: _cache[0] || (_cache[0] = ($event) => __props.picker.hourInput($event.target.value)),
|
|
30
|
+
onChange: _cache[1] || (_cache[1] = (...args) => __props.picker.commitText && __props.picker.commitText(...args)),
|
|
31
|
+
onKeydown: _cache[2] || (_cache[2] = withKeys((...args) => __props.picker.commitText && __props.picker.commitText(...args), ["enter"]))
|
|
32
|
+
}), null, 16, _hoisted_1), createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.hourLabel())), toDisplayString(__props.picker.fieldNames()[0]), 17)], 16),
|
|
33
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.separator())), ":", 16),
|
|
34
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.unit())), [createElementVNode("input", mergeProps(__props.picker.parts.minuteField(), {
|
|
35
|
+
value: __props.picker.minuteText(),
|
|
36
|
+
onInput: _cache[3] || (_cache[3] = ($event) => __props.picker.minuteInput($event.target.value)),
|
|
37
|
+
onChange: _cache[4] || (_cache[4] = (...args) => __props.picker.commitText && __props.picker.commitText(...args)),
|
|
38
|
+
onKeydown: _cache[5] || (_cache[5] = withKeys((...args) => __props.picker.commitText && __props.picker.commitText(...args), ["enter"]))
|
|
39
|
+
}), null, 16, _hoisted_2), createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.minuteLabel())), toDisplayString(__props.picker.fieldNames()[1]), 17)], 16)
|
|
40
|
+
], 64)) : __props.picker.showsScroll() ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
41
|
+
createCommentVNode(" The fields don't take typed text: Space and Enter switch to the text input. "),
|
|
42
|
+
createVNode(_sfc_main$1, mergeProps(scrollField("hour"), {
|
|
43
|
+
editing: false,
|
|
44
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => __props.picker.scrollPick("hour", $event)),
|
|
45
|
+
"onUpdate:editing": __props.picker.handleScrollEditing
|
|
46
|
+
}), null, 16, ["onUpdate:editing"]),
|
|
47
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.separator())), ":", 16),
|
|
48
|
+
createVNode(_sfc_main$1, mergeProps(scrollField("minute"), {
|
|
49
|
+
editing: false,
|
|
50
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => __props.picker.scrollPick("minute", $event)),
|
|
51
|
+
"onUpdate:editing": __props.picker.handleScrollEditing
|
|
52
|
+
}), null, 16, ["onUpdate:editing"])
|
|
53
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
54
|
+
withDirectives((openBlock(), createElementBlock("button", mergeProps(__props.picker.parts.hourField(), { onClick: _cache[8] || (_cache[8] = ($event) => __props.picker.selectField("hour")) }), [createTextVNode(toDisplayString(__props.picker.hourText()), 1)], 16)), [[unref(vRipple)]]),
|
|
55
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.separator())), ":", 16),
|
|
56
|
+
withDirectives((openBlock(), createElementBlock("button", mergeProps(__props.picker.parts.minuteField(), { onClick: _cache[9] || (_cache[9] = ($event) => __props.picker.selectField("minute")) }), [createTextVNode(toDisplayString(__props.picker.minuteText()), 1)], 16)), [[unref(vRipple)]])
|
|
57
|
+
], 64))], 16),
|
|
58
|
+
__props.picker.showsPeriod() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, __props.picker.parts.period())), [withDirectives((openBlock(), createElementBlock("button", mergeProps(__props.picker.parts.am(), { onClick: _cache[10] || (_cache[10] = ($event) => __props.picker.selectPeriod(false)) }), [createTextVNode(toDisplayString(__props.picker.periodNames()[0]) + " ", 1), createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.periodTouch())), null, 16)], 16)), [[unref(vRipple)], [unref(vCornerMorph)]]), withDirectives((openBlock(), createElementBlock("button", mergeProps(__props.picker.parts.pm(), { onClick: _cache[11] || (_cache[11] = ($event) => __props.picker.selectPeriod(true)) }), [createTextVNode(toDisplayString(__props.picker.periodNames()[1]) + " ", 1), createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.periodTouch())), null, 16)], 16)), [[unref(vRipple)], [unref(vCornerMorph)]])], 16)) : createCommentVNode("v-if", true),
|
|
59
|
+
__props.picker.showsToggle() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, __props.picker.parts.toggle())), [renderSlot(_ctx.$slots, "toggle")], 16)) : createCommentVNode("v-if", true),
|
|
60
|
+
__props.picker.showsDial() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, __props.picker.parts.dial())), [
|
|
61
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.dialTrack())), null, 16),
|
|
62
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.dialHandle())), null, 16),
|
|
63
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(__props.picker.parts.dialCenter())), null, 16),
|
|
64
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.picker.dialItems(), (item) => {
|
|
65
|
+
return openBlock(), createElementBlock("button", mergeProps({ key: `${item.value}` }, { ref_for: true }, __props.picker.parts.dialItem(item), { onClick: ($event) => __props.picker.handleNumberClick($event, item.value) }), toDisplayString(item.label), 17, _hoisted_3);
|
|
66
|
+
}), 128))
|
|
67
|
+
], 16)) : createCommentVNode("v-if", true)
|
|
68
|
+
], 16);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HourCycle, TimePickerKind, TimePickerLayout, TimePickerMessages, TimePickerMode } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
5
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
6
|
+
import "@rio-m3e/styles/dialog.css";
|
|
7
|
+
import "@rio-m3e/styles/time-picker.css";
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
/** A language tag. Without it, the one provided, or the document's, or the browser's. */
|
|
10
|
+
locale?: string;
|
|
11
|
+
/** Overrides the language's clock: 12 hours with AM and PM, or 24. */
|
|
12
|
+
hourCycle?: HourCycle;
|
|
13
|
+
/** The dial beside the fields, or below them. Defaults to `'auto'`, from the window's height. */
|
|
14
|
+
layout?: TimePickerLayout;
|
|
15
|
+
/** The picker, which switches to the text input: the dial, or scroll fields. Defaults to `'dial'`. */
|
|
16
|
+
picker?: TimePickerKind;
|
|
17
|
+
/** What each opening starts in: the picker, or the text input. Defaults to `'picker'`. */
|
|
18
|
+
initialMode?: TimePickerMode;
|
|
19
|
+
/** Replaces any of the text the dialog shows. */
|
|
20
|
+
messages?: Partial<TimePickerMessages>;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_Slots = {
|
|
23
|
+
/** The mode button's icon on the dial or the scroll fields, which switches to the text input */
|
|
24
|
+
'keyboard-icon'?: () => unknown;
|
|
25
|
+
/** The mode button's icon in the text input, which switches back to the dial */
|
|
26
|
+
'clock-icon'?: () => unknown;
|
|
27
|
+
/** The mode button's icon in the text input, which switches back to the scroll fields */
|
|
28
|
+
'swipe-icon'?: () => unknown;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_ModelProps = {
|
|
31
|
+
/** The time, `HH:MM` on a 24-hour clock, with `v-model`. It changes on OK. */
|
|
32
|
+
modelValue?: string | undefined;
|
|
33
|
+
/** Whether the dialog is shown, with `v-model:open`. */
|
|
34
|
+
'open'?: boolean;
|
|
35
|
+
};
|
|
36
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
37
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
39
|
+
"update:open": (value: boolean) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
42
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
43
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export { _default as default };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import _sfc_main$1 from "../button/Button.vue.js";
|
|
2
|
+
import _sfc_main$2 from "../icon-button/IconButton.vue.js";
|
|
3
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
4
|
+
import { keepPresses } from "../overlay/presses.js";
|
|
5
|
+
import _sfc_main$3 from "./TimePickerBody.vue.js";
|
|
6
|
+
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
7
|
+
import { attachDialog, attachTimePicker, createTimePicker, initialTimePickerState } from "@rio-m3e/core";
|
|
8
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
9
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
10
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
11
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
12
|
+
import "@rio-m3e/styles/dialog.css";
|
|
13
|
+
import "@rio-m3e/styles/time-picker.css";
|
|
14
|
+
// src/time-picker/TimePickerDialog.vue
|
|
15
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
16
|
+
__name: "TimePickerDialog",
|
|
17
|
+
props: /*@__PURE__*/ mergeModels({
|
|
18
|
+
locale: {},
|
|
19
|
+
hourCycle: {},
|
|
20
|
+
layout: {},
|
|
21
|
+
picker: {},
|
|
22
|
+
initialMode: {},
|
|
23
|
+
messages: {}
|
|
24
|
+
}, {
|
|
25
|
+
"modelValue": {},
|
|
26
|
+
"modelModifiers": {},
|
|
27
|
+
"open": {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
"openModifiers": {}
|
|
32
|
+
}),
|
|
33
|
+
emits: ["update:modelValue", "update:open"],
|
|
34
|
+
setup(__props) {
|
|
35
|
+
const props = __props;
|
|
36
|
+
/** The time, `HH:MM` on a 24-hour clock, with `v-model`. It changes on OK. */
|
|
37
|
+
const model = useModel(__props, "modelValue");
|
|
38
|
+
/** Whether the dialog is shown, with `v-model:open`. */
|
|
39
|
+
const open = useModel(__props, "open");
|
|
40
|
+
const locale = useLocale(() => props.locale);
|
|
41
|
+
const messages = useMessages("timePicker", locale, () => props.messages);
|
|
42
|
+
const state = reactive(initialTimePickerState(model.value));
|
|
43
|
+
const rendered = ref(open.value);
|
|
44
|
+
const id = useId();
|
|
45
|
+
const picker = createTimePicker({
|
|
46
|
+
variant: "dialog",
|
|
47
|
+
props: () => ({
|
|
48
|
+
value: model.value,
|
|
49
|
+
open: open.value,
|
|
50
|
+
locale: locale.value,
|
|
51
|
+
hourCycle: props.hourCycle,
|
|
52
|
+
layout: props.layout,
|
|
53
|
+
picker: props.picker,
|
|
54
|
+
initialMode: props.initialMode,
|
|
55
|
+
rendered: rendered.value
|
|
56
|
+
}),
|
|
57
|
+
messages: () => messages.value,
|
|
58
|
+
state: () => state,
|
|
59
|
+
ids: { error: `${id}-error` },
|
|
60
|
+
onChange: (next) => model.value = next,
|
|
61
|
+
onOpenChange: (next) => open.value = next,
|
|
62
|
+
onStateChange: (next) => Object.assign(state, next)
|
|
63
|
+
});
|
|
64
|
+
if (open.value) picker.opened();
|
|
65
|
+
watch(open, (next) => {
|
|
66
|
+
if (!next) return;
|
|
67
|
+
picker.opened();
|
|
68
|
+
rendered.value = true;
|
|
69
|
+
});
|
|
70
|
+
const root = useTemplateRef("root");
|
|
71
|
+
let dialogHandle;
|
|
72
|
+
let handle;
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
dialogHandle = attachDialog(root.value, {
|
|
75
|
+
onOpenChange: (next) => open.value = next,
|
|
76
|
+
onClosed: () => {
|
|
77
|
+
if (!open.value) rendered.value = false;
|
|
78
|
+
},
|
|
79
|
+
initialFocus: () => root.value?.querySelector("[data-field=\"hour\"]")
|
|
80
|
+
});
|
|
81
|
+
dialogHandle.sync(open.value);
|
|
82
|
+
handle = attachTimePicker(root.value, {
|
|
83
|
+
selection: () => state.selection,
|
|
84
|
+
hourCycle: picker.hourCycle,
|
|
85
|
+
onPick: picker.dialPick,
|
|
86
|
+
onPeriod: picker.selectPeriod,
|
|
87
|
+
onHover: picker.hover
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
watch(open, (next) => dialogHandle?.sync(next), { flush: "post" });
|
|
91
|
+
watch(state, () => handle?.sync(), { flush: "post" });
|
|
92
|
+
onBeforeUnmount(() => {
|
|
93
|
+
dialogHandle?.detach();
|
|
94
|
+
handle?.detach();
|
|
95
|
+
});
|
|
96
|
+
const onKeydown = (event) => {
|
|
97
|
+
if (event.key !== "Enter" || state.mode !== "input") return;
|
|
98
|
+
if (!event.target.matches("input")) return;
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
picker.confirm();
|
|
101
|
+
};
|
|
102
|
+
return (_ctx, _cache) => {
|
|
103
|
+
return openBlock(), createElementBlock("dialog", mergeProps({
|
|
104
|
+
ref_key: "root",
|
|
105
|
+
ref: root
|
|
106
|
+
}, unref(picker).parts.root(), { onKeydown }, toHandlers(unref(keepPresses), true)), [rendered.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
107
|
+
createVNode(_sfc_main$3, { picker: unref(picker) }, null, 8, ["picker"]),
|
|
108
|
+
unref(picker).showsError() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(picker).parts.error())), toDisplayString(unref(picker).error()), 17)) : createCommentVNode("v-if", true),
|
|
109
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(picker).parts.actions())), [
|
|
110
|
+
createVNode(_sfc_main$2, {
|
|
111
|
+
variant: "standard",
|
|
112
|
+
label: unref(picker).modeButtonLabel(),
|
|
113
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(picker).switchMode())
|
|
114
|
+
}, {
|
|
115
|
+
default: withCtx(() => [unref(picker).modeButtonIcon() === "keyboard" ? renderSlot(_ctx.$slots, "keyboard-icon", {}, void 0, void 0, 0) : unref(picker).modeButtonIcon() === "clock" ? renderSlot(_ctx.$slots, "clock-icon", {}, void 0, void 0, 1) : renderSlot(_ctx.$slots, "swipe-icon", {}, void 0, void 0, 2)]),
|
|
116
|
+
_: 3
|
|
117
|
+
}, 8, ["label"]),
|
|
118
|
+
createVNode(_sfc_main$1, {
|
|
119
|
+
variant: "text",
|
|
120
|
+
onClick: unref(picker).cancel
|
|
121
|
+
}, {
|
|
122
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).cancel), 1)]),
|
|
123
|
+
_: 1
|
|
124
|
+
}, 8, ["onClick"]),
|
|
125
|
+
createVNode(_sfc_main$1, {
|
|
126
|
+
variant: "text",
|
|
127
|
+
onClick: unref(picker).confirm
|
|
128
|
+
}, {
|
|
129
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).ok), 1)]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["onClick"])
|
|
132
|
+
], 16)
|
|
133
|
+
], 64)) : createCommentVNode("v-if", true)], 16);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HourCycle, TimePickerMessages } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
|
+
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
|
+
import "@rio-m3e/styles/base/state-layer.css";
|
|
5
|
+
import "@rio-m3e/styles/base/touch-target.css";
|
|
6
|
+
import "@rio-m3e/styles/time-picker.css";
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** A language tag. Without it, the one provided, or the document's, or the browser's. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Overrides the language's clock: 12 hours with AM and PM, or 24. */
|
|
11
|
+
hourCycle?: HourCycle;
|
|
12
|
+
/** Replaces any of the text the picker shows. */
|
|
13
|
+
messages?: Partial<TimePickerMessages>;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {
|
|
16
|
+
/** The mode button's icon on the scroll fields, which switches to the text input */
|
|
17
|
+
'keyboard-icon'?: () => unknown;
|
|
18
|
+
/** The mode button's icon in the text input, which switches back to the scroll fields */
|
|
19
|
+
'swipe-icon'?: () => unknown;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_ModelProps = {
|
|
22
|
+
/** The time, `HH:MM` on a 24-hour clock, with `v-model`. */
|
|
23
|
+
modelValue?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export { _default as default };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icon-button/IconButton.vue.js";
|
|
2
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
3
|
+
import _sfc_main$2 from "./TimePickerBody.vue.js";
|
|
4
|
+
import { createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
5
|
+
import { attachTimePicker, createTimePicker, initialTimePickerState } from "@rio-m3e/core";
|
|
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/base/touch-target.css";
|
|
10
|
+
import "@rio-m3e/styles/time-picker.css";
|
|
11
|
+
// src/time-picker/TimeScroll.vue
|
|
12
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
13
|
+
__name: "TimeScroll",
|
|
14
|
+
props: /*@__PURE__*/ mergeModels({
|
|
15
|
+
locale: {},
|
|
16
|
+
hourCycle: {},
|
|
17
|
+
messages: {}
|
|
18
|
+
}, {
|
|
19
|
+
"modelValue": {},
|
|
20
|
+
"modelModifiers": {}
|
|
21
|
+
}),
|
|
22
|
+
emits: ["update:modelValue"],
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
/** The time, `HH:MM` on a 24-hour clock, with `v-model`. */
|
|
26
|
+
const model = useModel(__props, "modelValue");
|
|
27
|
+
const locale = useLocale(() => props.locale);
|
|
28
|
+
const messages = useMessages("timePicker", locale, () => props.messages);
|
|
29
|
+
const state = reactive(initialTimePickerState(model.value));
|
|
30
|
+
const id = useId();
|
|
31
|
+
const picker = createTimePicker({
|
|
32
|
+
variant: "scroll",
|
|
33
|
+
props: () => ({
|
|
34
|
+
value: model.value,
|
|
35
|
+
locale: locale.value,
|
|
36
|
+
hourCycle: props.hourCycle
|
|
37
|
+
}),
|
|
38
|
+
messages: () => messages.value,
|
|
39
|
+
state: () => state,
|
|
40
|
+
ids: { error: `${id}-error` },
|
|
41
|
+
onChange: (next) => model.value = next,
|
|
42
|
+
onStateChange: (next) => Object.assign(state, next)
|
|
43
|
+
});
|
|
44
|
+
picker.valueChanged();
|
|
45
|
+
watch([
|
|
46
|
+
model,
|
|
47
|
+
locale,
|
|
48
|
+
() => props.hourCycle
|
|
49
|
+
], () => picker.valueChanged());
|
|
50
|
+
const root = useTemplateRef("root");
|
|
51
|
+
let handle;
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
handle = attachTimePicker(root.value, {
|
|
54
|
+
selection: () => state.selection,
|
|
55
|
+
hourCycle: picker.hourCycle,
|
|
56
|
+
onPick: picker.dialPick,
|
|
57
|
+
onPeriod: picker.selectPeriod,
|
|
58
|
+
onHover: picker.hover
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
watch(state, () => handle?.sync(), { flush: "post" });
|
|
62
|
+
onBeforeUnmount(() => handle?.detach());
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
65
|
+
ref_key: "root",
|
|
66
|
+
ref: root
|
|
67
|
+
}, unref(picker).parts.root()), [createVNode(_sfc_main$2, { picker: unref(picker) }, {
|
|
68
|
+
toggle: withCtx(() => [createVNode(_sfc_main$1, {
|
|
69
|
+
variant: "standard",
|
|
70
|
+
label: unref(picker).modeButtonLabel(),
|
|
71
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(picker).switchMode())
|
|
72
|
+
}, {
|
|
73
|
+
default: withCtx(() => [unref(picker).modeButtonIcon() === "keyboard" ? renderSlot(_ctx.$slots, "keyboard-icon", {}, void 0, void 0, 0) : renderSlot(_ctx.$slots, "swipe-icon", {}, void 0, void 0, 1)]),
|
|
74
|
+
_: 3
|
|
75
|
+
}, 8, ["label"])]),
|
|
76
|
+
_: 3
|
|
77
|
+
}, 8, ["picker"]), unref(picker).showsError() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(picker).parts.error())), toDisplayString(unref(picker).error()), 17)) : createCommentVNode("v-if", true)], 16);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export { _sfc_main as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { keepPresses } from "../overlay/presses.js";
|
|
2
|
+
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useSlots, useTemplateRef, watch } from "vue";
|
|
2
3
|
import { attachTooltip, createTooltip } from "@rio-m3e/core";
|
|
3
4
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
5
|
import "@rio-m3e/styles/base/anchored-position.css";
|
|
@@ -68,27 +69,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
68
69
|
return openBlock(), createElementBlock("span", mergeProps({
|
|
69
70
|
ref_key: "trigger",
|
|
70
71
|
ref: trigger
|
|
71
|
-
}, unref(tooltip).parts.trigger()), [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, unref(tooltip).parts.
|
|
78
|
-
|
|
79
|
-
onAuxclick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
|
|
80
|
-
onDblclick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
|
|
81
|
-
onPointerdown: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"])),
|
|
82
|
-
onPointerup: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"])),
|
|
83
|
-
onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {}, ["stop"])),
|
|
84
|
-
onMouseup: _cache[6] || (_cache[6] = withModifiers(() => {}, ["stop"])),
|
|
85
|
-
onContextmenu: _cache[7] || (_cache[7] = withModifiers(() => {}, ["stop"]))
|
|
86
|
-
}), [
|
|
87
|
-
unref(tooltip).showsSubhead() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(tooltip).parts.subhead())), toDisplayString(__props.subhead), 17)) : createCommentVNode("v-if", true),
|
|
88
|
-
createElementVNode("span", normalizeProps(guardReactiveProps(unref(tooltip).parts.supportingText())), [renderSlot(_ctx.$slots, "content", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 16),
|
|
89
|
-
unref(tooltip).showsActions() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(tooltip).parts.actions())), [renderSlot(_ctx.$slots, "actions")], 16)) : createCommentVNode("v-if", true)
|
|
90
|
-
], 16)
|
|
91
|
-
], 16);
|
|
72
|
+
}, unref(tooltip).parts.trigger()), [renderSlot(_ctx.$slots, "default"), createElementVNode("span", mergeProps({
|
|
73
|
+
ref_key: "root",
|
|
74
|
+
ref: root
|
|
75
|
+
}, unref(tooltip).parts.root(), toHandlers(unref(keepPresses), true)), [
|
|
76
|
+
unref(tooltip).showsSubhead() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(tooltip).parts.subhead())), toDisplayString(__props.subhead), 17)) : createCommentVNode("v-if", true),
|
|
77
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(tooltip).parts.supportingText())), [renderSlot(_ctx.$slots, "content", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 16),
|
|
78
|
+
unref(tooltip).showsActions() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(tooltip).parts.actions())), [renderSlot(_ctx.$slots, "actions")], 16)) : createCommentVNode("v-if", true)
|
|
79
|
+
], 16)], 16);
|
|
92
80
|
};
|
|
93
81
|
}
|
|
94
82
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rio-m3e/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Vue components for Rio, a Material 3 Expressive implementation",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "LegenLee",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@rio-m3e/core": "^0.
|
|
31
|
-
"@rio-m3e/styles": "^0.
|
|
30
|
+
"@rio-m3e/core": "^0.6.0",
|
|
31
|
+
"@rio-m3e/styles": "^0.6.0",
|
|
32
|
+
"@rio-m3e/tokens": "^0.6.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@fontsource/roboto": "^5.3.0",
|
|
35
36
|
"@mdi/js": "^7.4.47",
|
|
36
37
|
"@rio-m3e/testing": "^0.0.0",
|
|
37
|
-
"@rio-m3e/tokens": "^0.4.0",
|
|
38
38
|
"tsdown": "0.23.7",
|
|
39
39
|
"typescript": "~6.0.3",
|
|
40
40
|
"unplugin-vue": "^8.0.1",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { attachShapeMorph } from "@rio-m3e/core";
|
|
2
|
-
import "@rio-m3e/styles/base/shape-morph.css";
|
|
3
|
-
// src/shape-morph/shape-morph.ts
|
|
4
|
-
const handles = /* @__PURE__ */ new WeakMap();
|
|
5
|
-
/**
|
|
6
|
-
* Springs an element's corner radius toward `--rio-shape-morph-target` whenever its state
|
|
7
|
-
* attributes change. Used inside Rio's components; not exported yet.
|
|
8
|
-
*/
|
|
9
|
-
const vShapeMorph = {
|
|
10
|
-
mounted(el) {
|
|
11
|
-
handles.set(el, attachShapeMorph(el));
|
|
12
|
-
},
|
|
13
|
-
beforeUnmount(el) {
|
|
14
|
-
handles.get(el)?.detach();
|
|
15
|
-
handles.delete(el);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export { vShapeMorph };
|