@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,9 +1,12 @@
|
|
|
1
|
+
import { useLocale, useMessages } from "../locale/locale.js";
|
|
1
2
|
import { useRipple } from "../ripple/ripple.js";
|
|
2
3
|
import { useChipSetItem } from "./context.js";
|
|
3
4
|
import _sfc_main$1 from "../icon/Icon.vue.js";
|
|
4
5
|
import { useIconOfAlias } from "../icon/icons.js";
|
|
5
|
-
import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, unref, useSlots, useTemplateRef } from "vue";
|
|
6
|
-
import { createFilterChip } from "@rio-m3e/core";
|
|
6
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef } from "vue";
|
|
7
|
+
import { createFilterChip, mergePartAttrs } from "@rio-m3e/core";
|
|
8
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
9
|
+
import "@rio-m3e/styles/base/density.css";
|
|
7
10
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
8
11
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
9
12
|
import "@rio-m3e/styles/base/touch-target.css";
|
|
@@ -11,6 +14,7 @@ import "@rio-m3e/styles/base/ripple.css";
|
|
|
11
14
|
import "@rio-m3e/styles/chip.css";
|
|
12
15
|
// src/chip/FilterChip.vue
|
|
13
16
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
|
+
inheritAttrs: false,
|
|
14
18
|
__name: "FilterChip",
|
|
15
19
|
props: {
|
|
16
20
|
selected: { type: Boolean },
|
|
@@ -18,17 +22,31 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
18
22
|
value: {},
|
|
19
23
|
menu: { type: Boolean },
|
|
20
24
|
open: { type: Boolean },
|
|
25
|
+
removable: { type: Boolean },
|
|
26
|
+
color: {},
|
|
27
|
+
density: {},
|
|
21
28
|
disabled: { type: Boolean },
|
|
22
|
-
softDisabled: { type: Boolean }
|
|
29
|
+
softDisabled: { type: Boolean },
|
|
30
|
+
locale: {},
|
|
31
|
+
messages: {}
|
|
23
32
|
},
|
|
24
33
|
emits: [
|
|
25
34
|
"click",
|
|
26
35
|
"update:selected",
|
|
27
|
-
"update:open"
|
|
36
|
+
"update:open",
|
|
37
|
+
"remove"
|
|
28
38
|
],
|
|
29
39
|
setup(__props, { emit: __emit }) {
|
|
30
40
|
const emit = __emit;
|
|
31
41
|
const slots = useSlots();
|
|
42
|
+
const attrs = useAttrs();
|
|
43
|
+
const rest = computed(() => ({
|
|
44
|
+
...attrs,
|
|
45
|
+
class: void 0,
|
|
46
|
+
style: void 0
|
|
47
|
+
}));
|
|
48
|
+
const text = useMessages("chip", useLocale(() => __props.locale), () => __props.messages);
|
|
49
|
+
const id = useId();
|
|
32
50
|
const item = useChipSetItem();
|
|
33
51
|
const grouped = () => !!item.set && item.set.selection() !== "none" && __props.value !== void 0 && !__props.menu;
|
|
34
52
|
const checkIcon = useIconOfAlias("check");
|
|
@@ -40,6 +58,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
40
58
|
value: __props.value,
|
|
41
59
|
menu: __props.menu,
|
|
42
60
|
open: __props.open,
|
|
61
|
+
removable: __props.removable,
|
|
62
|
+
color: __props.color,
|
|
63
|
+
density: __props.density,
|
|
43
64
|
disabled: __props.disabled,
|
|
44
65
|
softDisabled: __props.softDisabled
|
|
45
66
|
}),
|
|
@@ -55,17 +76,45 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
55
76
|
if (grouped()) item.set.select(__props.value, next);
|
|
56
77
|
else emit("update:selected", next);
|
|
57
78
|
},
|
|
58
|
-
onOpenChange: (next) => emit("update:open", next)
|
|
79
|
+
onOpenChange: (next) => emit("update:open", next),
|
|
80
|
+
messages: () => text.value,
|
|
81
|
+
ids: {
|
|
82
|
+
label: `${id}-label`,
|
|
83
|
+
removeBefore: `${id}-remove-before`,
|
|
84
|
+
removeAfter: `${id}-remove-after`
|
|
85
|
+
},
|
|
86
|
+
onRemove: () => emit("remove")
|
|
59
87
|
});
|
|
60
|
-
useRipple(useTemplateRef("
|
|
88
|
+
useRipple(useTemplateRef("toggle"), useTemplateRef("state"));
|
|
61
89
|
return (_ctx, _cache) => {
|
|
62
|
-
return openBlock(), createElementBlock("
|
|
90
|
+
return unref(chip).removable() ? (openBlock(), createElementBlock("span", mergeProps({ key: 0 }, unref(chip).parts.root(), {
|
|
91
|
+
class: unref(attrs).class,
|
|
92
|
+
style: unref(attrs).style,
|
|
93
|
+
onKeydown: _cache[2] || (_cache[2] = (...args) => unref(chip).handleKeydown && unref(chip).handleKeydown(...args))
|
|
94
|
+
}), [
|
|
95
|
+
createElementVNode("span", mergeProps({ ref: "state" }, unref(chip).parts.state()), null, 16),
|
|
96
|
+
createElementVNode("button", mergeProps({ ref: "toggle" }, unref(mergePartAttrs)(rest.value, unref(chip).parts.action()), { onClick: _cache[0] || (_cache[0] = (...args) => unref(chip).handleClick && unref(chip).handleClick(...args)) }), [
|
|
97
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(chip).parts.touch())), null, 16),
|
|
98
|
+
unref(chip).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(chip).parts.icon())), [unref(chip).showsSelectedIcon() ? renderSlot(_ctx.$slots, "selected-icon", {}, () => [createVNode(_sfc_main$1, { alias: "check" })], void 0, 0) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)], 16)) : createCommentVNode("v-if", true),
|
|
99
|
+
createElementVNode("span", normalizeProps(guardReactiveProps(unref(chip).parts.label())), [renderSlot(_ctx.$slots, "default")], 16)
|
|
100
|
+
], 16),
|
|
101
|
+
createElementVNode("button", mergeProps(unref(chip).parts.remove(), { onClick: _cache[1] || (_cache[1] = (...args) => unref(chip).handleRemoveClick && unref(chip).handleRemoveClick(...args)) }), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(chip).parts.removeTouch())), null, 16), createElementVNode("span", normalizeProps(guardReactiveProps(unref(chip).parts.removeIcon())), [renderSlot(_ctx.$slots, "remove-icon", {}, () => [createVNode(_sfc_main$1, { alias: "remove" })])], 16)], 16),
|
|
102
|
+
unref(chip).showsRemoveBefore() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(chip).parts.removeBefore())), toDisplayString(unref(chip).removeText().before), 17)) : createCommentVNode("v-if", true),
|
|
103
|
+
unref(chip).showsRemoveAfter() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(chip).parts.removeAfter())), toDisplayString(unref(chip).removeText().after), 17)) : createCommentVNode("v-if", true)
|
|
104
|
+
], 16)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
105
|
+
key: 1,
|
|
106
|
+
ref: "toggle"
|
|
107
|
+
}, unref(mergePartAttrs)(rest.value, unref(chip).parts.root()), {
|
|
108
|
+
class: unref(attrs).class,
|
|
109
|
+
style: unref(attrs).style,
|
|
110
|
+
onClick: _cache[3] || (_cache[3] = (...args) => unref(chip).handleClick && unref(chip).handleClick(...args))
|
|
111
|
+
}), [
|
|
63
112
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(chip).parts.touch())), null, 16),
|
|
64
113
|
createElementVNode("span", mergeProps({ ref: "state" }, unref(chip).parts.state()), null, 16),
|
|
65
114
|
unref(chip).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(chip).parts.icon())), [unref(chip).showsSelectedIcon() ? renderSlot(_ctx.$slots, "selected-icon", {}, () => [createVNode(_sfc_main$1, { alias: "check" })], void 0, 0) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)], 16)) : createCommentVNode("v-if", true),
|
|
66
115
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(chip).parts.label())), [renderSlot(_ctx.$slots, "default")], 16),
|
|
67
116
|
unref(chip).showsTrailing() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(chip).parts.trailing())), [renderSlot(_ctx.$slots, "dropdown-icon", {}, () => [createVNode(_sfc_main$1, { alias: "dropdown" })])], 16)) : createCommentVNode("v-if", true)
|
|
68
|
-
], 16);
|
|
117
|
+
], 16));
|
|
69
118
|
};
|
|
70
119
|
}
|
|
71
120
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ChipMessages, InputChipProps } 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/touch-target.css";
|
|
@@ -4,6 +4,8 @@ import { useChipSetItem } from "./context.js";
|
|
|
4
4
|
import _sfc_main$1 from "../icon/Icon.vue.js";
|
|
5
5
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, withCtx } from "vue";
|
|
6
6
|
import { createInputChip, mergePartAttrs } from "@rio-m3e/core";
|
|
7
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
8
|
+
import "@rio-m3e/styles/base/density.css";
|
|
7
9
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
8
10
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
9
11
|
import "@rio-m3e/styles/base/touch-target.css";
|
|
@@ -15,6 +17,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
15
17
|
__name: "InputChip",
|
|
16
18
|
props: {
|
|
17
19
|
removeOnly: { type: Boolean },
|
|
20
|
+
color: {},
|
|
21
|
+
density: {},
|
|
18
22
|
disabled: { type: Boolean },
|
|
19
23
|
softDisabled: { type: Boolean },
|
|
20
24
|
locale: {},
|
|
@@ -38,6 +42,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
38
42
|
const chip = createInputChip({
|
|
39
43
|
props: () => ({
|
|
40
44
|
removeOnly: props.removeOnly,
|
|
45
|
+
color: props.color,
|
|
46
|
+
density: props.density,
|
|
41
47
|
disabled: props.disabled,
|
|
42
48
|
softDisabled: props.softDisabled
|
|
43
49
|
}),
|
|
@@ -2,6 +2,8 @@ import { useRipple } from "../ripple/ripple.js";
|
|
|
2
2
|
import { useChipSetItem } from "./context.js";
|
|
3
3
|
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, unref, useSlots, useTemplateRef, withCtx } from "vue";
|
|
4
4
|
import { createSuggestionChip } from "@rio-m3e/core";
|
|
5
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
6
|
+
import "@rio-m3e/styles/base/density.css";
|
|
5
7
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
6
8
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
7
9
|
import "@rio-m3e/styles/base/touch-target.css";
|
|
@@ -13,6 +15,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
13
15
|
props: {
|
|
14
16
|
elevated: { type: Boolean },
|
|
15
17
|
href: {},
|
|
18
|
+
color: {},
|
|
19
|
+
density: {},
|
|
16
20
|
disabled: { type: Boolean },
|
|
17
21
|
softDisabled: { type: Boolean }
|
|
18
22
|
},
|
|
@@ -25,6 +29,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
25
29
|
props: () => ({
|
|
26
30
|
elevated: __props.elevated,
|
|
27
31
|
href: __props.href,
|
|
32
|
+
color: __props.color,
|
|
33
|
+
density: __props.density,
|
|
28
34
|
disabled: __props.disabled,
|
|
29
35
|
softDisabled: __props.softDisabled
|
|
30
36
|
}),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DatePickerMessages, DatePickerVariant, TextFieldVariant } from "@rio-m3e/core";
|
|
1
|
+
import { AccentColor, DatePickerMessages, DatePickerVariant, DialogVariant, TextFieldVariant } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
2
3
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
3
4
|
import "@rio-m3e/styles/base/anchored-position.css";
|
|
4
5
|
import "@rio-m3e/styles/date-picker.css";
|
|
@@ -30,8 +31,18 @@ type __VLS_Props = {
|
|
|
30
31
|
messages?: Partial<DatePickerMessages>;
|
|
31
32
|
/** A Clear button at the start of Cancel and OK */
|
|
32
33
|
clearable?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The theme color it takes in place of the spec's accents: `'secondary'`, `'tertiary'`,
|
|
36
|
+
* `'error'`, or a static color of the theme. Its buttons take it too.
|
|
37
|
+
*/
|
|
38
|
+
color?: AccentColor;
|
|
33
39
|
/** Modal: what the dialog starts in, the calendar or the text input. */
|
|
34
40
|
initialMode?: 'calendar' | 'input';
|
|
41
|
+
/**
|
|
42
|
+
* Modal: the dialog's look, as `RioDatePickerDialog`'s `variant`: `'basic'`, `'full-screen'`, or
|
|
43
|
+
* `'adaptive'`, full-screen in a compact window. Defaults to `'basic'`.
|
|
44
|
+
*/
|
|
45
|
+
dialogVariant?: DialogVariant;
|
|
35
46
|
};
|
|
36
47
|
type __VLS_Slots = {
|
|
37
48
|
/**
|
|
@@ -52,6 +63,8 @@ type __VLS_Slots = {
|
|
|
52
63
|
* Modal: the switch to the text input. Without one, the `edit` icon registered with `createRio`.
|
|
53
64
|
*/
|
|
54
65
|
'edit-icon'?: () => unknown;
|
|
66
|
+
/** Modal, full-screen: the close icon, in place of the one the app registered (`close`) */
|
|
67
|
+
'close-icon'?: () => unknown;
|
|
55
68
|
};
|
|
56
69
|
type __VLS_ModelProps = {
|
|
57
70
|
/** The date, `YYYY-MM-DD`, with `v-model`. */
|
|
@@ -61,11 +74,11 @@ type __VLS_ModelProps = {
|
|
|
61
74
|
};
|
|
62
75
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
63
76
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
64
|
-
"update:modelValue": (value: string | undefined) => any;
|
|
65
77
|
"update:open": (value: boolean) => any;
|
|
78
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
66
79
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
67
|
-
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
68
80
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
81
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
69
82
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
70
83
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
71
84
|
declare const _default: typeof __VLS_export;
|
|
@@ -8,6 +8,7 @@ import _sfc_main$5 from "./DatePickerDialog.vue.js";
|
|
|
8
8
|
import _sfc_main$6 from "../icon/Icon.vue.js";
|
|
9
9
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, renderSlot, toDisplayString, toHandlers, unref, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
10
10
|
import { attachDatePickerMenu, createDatePicker, initialDatePickerState } from "@rio-m3e/core";
|
|
11
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
11
12
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
12
13
|
import "@rio-m3e/styles/base/anchored-position.css";
|
|
13
14
|
import "@rio-m3e/styles/date-picker.css";
|
|
@@ -32,7 +33,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
32
33
|
firstDayOfWeek: {},
|
|
33
34
|
messages: {},
|
|
34
35
|
clearable: { type: Boolean },
|
|
35
|
-
|
|
36
|
+
color: {},
|
|
37
|
+
initialMode: {},
|
|
38
|
+
dialogVariant: {}
|
|
36
39
|
}, {
|
|
37
40
|
"modelValue": {},
|
|
38
41
|
"modelModifiers": {},
|
|
@@ -65,7 +68,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
65
68
|
min: props.min,
|
|
66
69
|
max: props.max,
|
|
67
70
|
locale: locale.value,
|
|
68
|
-
clearable: props.clearable
|
|
71
|
+
clearable: props.clearable,
|
|
72
|
+
color: props.color
|
|
69
73
|
}),
|
|
70
74
|
isDateDisabled: (date) => !!props.isDateDisabled?.(date),
|
|
71
75
|
messages: () => messages.value,
|
|
@@ -213,13 +217,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
213
217
|
"first-day-of-week": __props.firstDayOfWeek,
|
|
214
218
|
messages: unref(messages),
|
|
215
219
|
"initial-mode": __props.initialMode,
|
|
216
|
-
|
|
220
|
+
variant: __props.dialogVariant,
|
|
221
|
+
clearable: __props.clearable,
|
|
222
|
+
color: __props.color
|
|
217
223
|
}, {
|
|
218
224
|
"previous-icon": withCtx(() => [renderSlot(_ctx.$slots, "previous-icon")]),
|
|
219
225
|
"next-icon": withCtx(() => [renderSlot(_ctx.$slots, "next-icon")]),
|
|
220
226
|
"dropdown-icon": withCtx(() => [renderSlot(_ctx.$slots, "dropdown-icon")]),
|
|
221
227
|
"edit-icon": withCtx(() => [renderSlot(_ctx.$slots, "edit-icon")]),
|
|
222
228
|
"calendar-icon": withCtx(() => [renderSlot(_ctx.$slots, "calendar-icon")]),
|
|
229
|
+
"close-icon": withCtx(() => [renderSlot(_ctx.$slots, "close-icon")]),
|
|
223
230
|
_: 3
|
|
224
231
|
}, 8, [
|
|
225
232
|
"modelValue",
|
|
@@ -231,7 +238,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
231
238
|
"first-day-of-week",
|
|
232
239
|
"messages",
|
|
233
240
|
"initial-mode",
|
|
234
|
-
"
|
|
241
|
+
"variant",
|
|
242
|
+
"clearable",
|
|
243
|
+
"color"
|
|
235
244
|
])], 16))
|
|
236
245
|
], 16);
|
|
237
246
|
};
|
|
@@ -34,7 +34,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
34
34
|
"update:focused",
|
|
35
35
|
"update:view"
|
|
36
36
|
]),
|
|
37
|
-
setup(__props, {
|
|
37
|
+
setup(__props, { emit: __emit }) {
|
|
38
38
|
const props = __props;
|
|
39
39
|
const month = useModel(__props, "month");
|
|
40
40
|
const focused = useModel(__props, "focused");
|
|
@@ -76,9 +76,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
76
76
|
});
|
|
77
77
|
onUpdated(() => handle?.sync());
|
|
78
78
|
onBeforeUnmount(() => handle?.detach());
|
|
79
|
-
__expose({
|
|
80
|
-
/** Focuses the date that takes the focus, or the option shown in a list. */
|
|
81
|
-
focus: () => handle?.focus() });
|
|
82
79
|
return (_ctx, _cache) => {
|
|
83
80
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
84
81
|
ref_key: "root",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DatePickerMessages } from "@rio-m3e/core";
|
|
1
|
+
import { AccentColor, DatePickerMessages, DialogVariant } from "@rio-m3e/core";
|
|
2
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
2
3
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
3
4
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
4
5
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -24,6 +25,17 @@ type __VLS_Props = {
|
|
|
24
25
|
initialMode?: 'calendar' | 'input';
|
|
25
26
|
/** A Clear button at the start of Cancel and OK */
|
|
26
27
|
clearable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The theme color it takes in place of the spec's accents: `'secondary'`, `'tertiary'`,
|
|
30
|
+
* `'error'`, or a static color of the theme. Its buttons take it too.
|
|
31
|
+
*/
|
|
32
|
+
color?: AccentColor;
|
|
33
|
+
/**
|
|
34
|
+
* `'basic'`, a basic dialog; `'full-screen'`, covering the window under a bar with a close button
|
|
35
|
+
* and Save, its months one under another; or `'adaptive'`, full-screen in a compact window,
|
|
36
|
+
* narrower than 600px, and basic in a wider one. Defaults to `'basic'`.
|
|
37
|
+
*/
|
|
38
|
+
variant?: DialogVariant;
|
|
27
39
|
};
|
|
28
40
|
type __VLS_Slots = {
|
|
29
41
|
/** Without one, the `previous` icon registered with `createRio`. */
|
|
@@ -42,6 +54,8 @@ type __VLS_Slots = {
|
|
|
42
54
|
* `calendar` icon registered with `createRio`.
|
|
43
55
|
*/
|
|
44
56
|
'calendar-icon'?: () => unknown;
|
|
57
|
+
/** The full-screen picker's close icon, in place of the one the app registered (`close`) */
|
|
58
|
+
'close-icon'?: () => unknown;
|
|
45
59
|
};
|
|
46
60
|
type __VLS_ModelProps = {
|
|
47
61
|
/** The chosen date, `YYYY-MM-DD`, with `v-model`. It changes on OK. */
|
|
@@ -51,11 +65,11 @@ type __VLS_ModelProps = {
|
|
|
51
65
|
};
|
|
52
66
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
53
67
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
-
"update:modelValue": (value: string | undefined) => any;
|
|
55
68
|
"update:open": (value: boolean) => any;
|
|
69
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
56
70
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
57
|
-
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
58
71
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
72
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
59
73
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
74
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
61
75
|
declare const _default: typeof __VLS_export;
|
|
@@ -4,9 +4,11 @@ import { useLocale, useMessages } from "../locale/locale.js";
|
|
|
4
4
|
import { keepPresses } from "../overlay/presses.js";
|
|
5
5
|
import _sfc_main$3 from "../text-field/TextField.vue.js";
|
|
6
6
|
import _sfc_main$4 from "./DatePickerCalendar.vue.js";
|
|
7
|
-
import _sfc_main$5 from "
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
7
|
+
import _sfc_main$5 from "./DateRangeCalendar.vue.js";
|
|
8
|
+
import _sfc_main$6 from "../icon/Icon.vue.js";
|
|
9
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, reactive, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
10
|
+
import { attachDatePickerDialog, createDatePickerDialog, initialDatePickerState } from "@rio-m3e/core";
|
|
11
|
+
import "@rio-m3e/styles/base/accent.css";
|
|
10
12
|
import "@rio-m3e/styles/base/focus-ring.css";
|
|
11
13
|
import "@rio-m3e/styles/base/reduced-motion.css";
|
|
12
14
|
import "@rio-m3e/styles/base/state-layer.css";
|
|
@@ -23,7 +25,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
23
25
|
firstDayOfWeek: {},
|
|
24
26
|
messages: {},
|
|
25
27
|
initialMode: {},
|
|
26
|
-
clearable: { type: Boolean }
|
|
28
|
+
clearable: { type: Boolean },
|
|
29
|
+
color: {},
|
|
30
|
+
variant: {}
|
|
27
31
|
}, {
|
|
28
32
|
"modelValue": {},
|
|
29
33
|
"modelModifiers": {},
|
|
@@ -44,6 +48,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
44
48
|
const messages = useMessages("datePicker", locale, () => props.messages);
|
|
45
49
|
const state = reactive(initialDatePickerState(model.value, locale.value, props));
|
|
46
50
|
const rendered = ref(open.value);
|
|
51
|
+
const compact = ref(false);
|
|
47
52
|
const id = useId();
|
|
48
53
|
const dialog = createDatePickerDialog({
|
|
49
54
|
props: () => ({
|
|
@@ -53,12 +58,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
53
58
|
max: props.max,
|
|
54
59
|
locale: locale.value,
|
|
55
60
|
clearable: props.clearable,
|
|
61
|
+
color: props.color,
|
|
56
62
|
initialMode: props.initialMode,
|
|
63
|
+
variant: props.variant,
|
|
57
64
|
rendered: rendered.value
|
|
58
65
|
}),
|
|
59
66
|
isDateDisabled: (date) => !!props.isDateDisabled?.(date),
|
|
60
67
|
messages: () => messages.value,
|
|
61
68
|
state: () => state,
|
|
69
|
+
compact: () => compact.value,
|
|
62
70
|
ids: {
|
|
63
71
|
title: `${id}-title`,
|
|
64
72
|
headline: `${id}-headline`
|
|
@@ -74,31 +82,42 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
74
82
|
rendered.value = true;
|
|
75
83
|
});
|
|
76
84
|
const root = useTemplateRef("root");
|
|
77
|
-
const calendar = useTemplateRef("calendar");
|
|
78
85
|
let handle;
|
|
79
86
|
onMounted(() => {
|
|
80
|
-
handle =
|
|
87
|
+
handle = attachDatePickerDialog(root.value, {
|
|
81
88
|
onOpenChange: (next) => open.value = next,
|
|
82
89
|
onClosed: () => {
|
|
83
90
|
if (!open.value) rendered.value = false;
|
|
84
91
|
},
|
|
85
|
-
|
|
92
|
+
onCompactChange: (next) => compact.value = next
|
|
86
93
|
});
|
|
87
94
|
handle.sync(open.value);
|
|
88
95
|
});
|
|
89
96
|
watch(open, (next) => handle?.sync(next), { flush: "post" });
|
|
90
|
-
watch(() =>
|
|
91
|
-
|
|
92
|
-
if (!open.value) return;
|
|
93
|
-
if (next === "calendar") calendar.value?.focus();
|
|
94
|
-
else root.value?.querySelector("input")?.focus();
|
|
97
|
+
watch(() => dialog.fullScreen(), () => {
|
|
98
|
+
if (rendered.value) dialog.fullScreenChanged();
|
|
95
99
|
});
|
|
100
|
+
onUpdated(() => handle?.update());
|
|
96
101
|
onBeforeUnmount(() => handle?.detach());
|
|
97
102
|
return (_ctx, _cache) => {
|
|
98
103
|
return openBlock(), createElementBlock("dialog", mergeProps({
|
|
99
104
|
ref_key: "root",
|
|
100
105
|
ref: root
|
|
101
106
|
}, unref(dialog).parts.root(), toHandlers(unref(keepPresses), true)), [rendered.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
107
|
+
unref(dialog).showsBar() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(dialog).parts.bar())), [createVNode(_sfc_main$2, {
|
|
108
|
+
label: unref(messages).close,
|
|
109
|
+
variant: "standard",
|
|
110
|
+
onClick: unref(dialog).cancel
|
|
111
|
+
}, {
|
|
112
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$6, { alias: "close" })])]),
|
|
113
|
+
_: 3
|
|
114
|
+
}, 8, ["label", "onClick"]), createVNode(_sfc_main$1, {
|
|
115
|
+
variant: "text",
|
|
116
|
+
onClick: unref(dialog).confirm
|
|
117
|
+
}, {
|
|
118
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).save), 1)]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["onClick"])], 16)) : createCommentVNode("v-if", true),
|
|
102
121
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(dialog).parts.header())), [
|
|
103
122
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(dialog).parts.title())), toDisplayString(unref(messages).title), 17),
|
|
104
123
|
createElementVNode("span", normalizeProps(guardReactiveProps(unref(dialog).parts.headline())), toDisplayString(unref(dialog).headline()), 17),
|
|
@@ -107,21 +126,46 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
107
126
|
label: unref(dialog).modeButtonLabel(),
|
|
108
127
|
onClick: unref(dialog).switchMode
|
|
109
128
|
}, {
|
|
110
|
-
default: withCtx(() => [state.mode === "calendar" ? renderSlot(_ctx.$slots, "edit-icon", {}, () => [createVNode(_sfc_main$
|
|
129
|
+
default: withCtx(() => [state.mode === "calendar" ? renderSlot(_ctx.$slots, "edit-icon", {}, () => [createVNode(_sfc_main$6, { alias: "edit" })], void 0, 0) : renderSlot(_ctx.$slots, "calendar-icon", {}, () => [createVNode(_sfc_main$6, { alias: "calendar" })], void 0, 1)]),
|
|
111
130
|
_: 3
|
|
112
131
|
}, 8, ["label", "onClick"])
|
|
113
132
|
], 16),
|
|
114
133
|
createElementVNode("div", normalizeProps(guardReactiveProps(unref(dialog).parts.divider())), null, 16),
|
|
115
|
-
unref(dialog).calendarMode() ? (openBlock(), createBlock(_sfc_main$
|
|
116
|
-
key:
|
|
117
|
-
|
|
118
|
-
|
|
134
|
+
unref(dialog).calendarMode() && unref(dialog).fullScreen() ? (openBlock(), createBlock(_sfc_main$5, {
|
|
135
|
+
key: 1,
|
|
136
|
+
focused: state.focused,
|
|
137
|
+
"onUpdate:focused": _cache[0] || (_cache[0] = ($event) => state.focused = $event),
|
|
138
|
+
"first-month": state.firstMonth,
|
|
139
|
+
"onUpdate:firstMonth": _cache[1] || (_cache[1] = ($event) => state.firstMonth = $event),
|
|
140
|
+
"last-month": state.lastMonth,
|
|
141
|
+
"onUpdate:lastMonth": _cache[2] || (_cache[2] = ($event) => state.lastMonth = $event),
|
|
142
|
+
selection: "single",
|
|
143
|
+
start: state.draft,
|
|
144
|
+
min: __props.min,
|
|
145
|
+
max: __props.max,
|
|
146
|
+
locale: unref(locale),
|
|
147
|
+
"first-day-of-week": __props.firstDayOfWeek,
|
|
148
|
+
"is-date-disabled": __props.isDateDisabled,
|
|
149
|
+
onSelect: unref(dialog).select
|
|
150
|
+
}, null, 8, [
|
|
151
|
+
"focused",
|
|
152
|
+
"first-month",
|
|
153
|
+
"last-month",
|
|
154
|
+
"start",
|
|
155
|
+
"min",
|
|
156
|
+
"max",
|
|
157
|
+
"locale",
|
|
158
|
+
"first-day-of-week",
|
|
159
|
+
"is-date-disabled",
|
|
160
|
+
"onSelect"
|
|
161
|
+
])) : unref(dialog).calendarMode() ? (openBlock(), createBlock(_sfc_main$4, {
|
|
162
|
+
key: 2,
|
|
119
163
|
month: state.month,
|
|
120
|
-
"onUpdate:month": _cache[
|
|
164
|
+
"onUpdate:month": _cache[3] || (_cache[3] = ($event) => state.month = $event),
|
|
121
165
|
focused: state.focused,
|
|
122
|
-
"onUpdate:focused": _cache[
|
|
166
|
+
"onUpdate:focused": _cache[4] || (_cache[4] = ($event) => state.focused = $event),
|
|
123
167
|
view: state.view,
|
|
124
|
-
"onUpdate:view": _cache[
|
|
168
|
+
"onUpdate:view": _cache[5] || (_cache[5] = ($event) => state.view = $event),
|
|
125
169
|
variant: "modal",
|
|
126
170
|
selected: state.draft,
|
|
127
171
|
min: __props.min,
|
|
@@ -149,12 +193,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
149
193
|
"messages",
|
|
150
194
|
"onSelect"
|
|
151
195
|
])) : createCommentVNode("v-if", true),
|
|
152
|
-
unref(dialog).inputMode() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key:
|
|
196
|
+
unref(dialog).inputMode() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 3 }, unref(dialog).parts.input())), [createVNode(_sfc_main$3, mergeProps(unref(dialog).field(), {
|
|
153
197
|
"model-value": state.text,
|
|
154
198
|
variant: "outlined",
|
|
155
199
|
label: unref(messages).fieldLabel,
|
|
156
200
|
autocomplete: "off",
|
|
157
|
-
"onUpdate:modelValue": _cache[
|
|
201
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = (text) => unref(dialog).textInput(String(text))),
|
|
158
202
|
onKeydown: unref(dialog).handleFieldKeydown
|
|
159
203
|
}), null, 16, [
|
|
160
204
|
"model-value",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { vRipple } from "../ripple/ripple.js";
|
|
2
|
-
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderList, toDisplayString, unref, useModel, useTemplateRef, withDirectives } from "vue";
|
|
2
|
+
import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderList, shallowRef, toDisplayString, unref, useModel, useTemplateRef, withDirectives } from "vue";
|
|
3
3
|
import { attachRangeCalendar, createRangeCalendar } from "@rio-m3e/core";
|
|
4
4
|
// src/date-picker/DateRangeCalendar.vue
|
|
5
5
|
const _hoisted_1 = ["onClick"];
|
|
@@ -8,6 +8,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
8
8
|
props: /*@__PURE__*/ mergeModels({
|
|
9
9
|
start: {},
|
|
10
10
|
end: {},
|
|
11
|
+
selection: {},
|
|
11
12
|
min: {},
|
|
12
13
|
max: {},
|
|
13
14
|
locale: {},
|
|
@@ -26,19 +27,23 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
26
27
|
"update:firstMonth",
|
|
27
28
|
"update:lastMonth"
|
|
28
29
|
]),
|
|
29
|
-
setup(__props, {
|
|
30
|
+
setup(__props, { emit: __emit }) {
|
|
30
31
|
const props = __props;
|
|
31
32
|
const focused = useModel(__props, "focused");
|
|
32
33
|
const firstMonth = useModel(__props, "firstMonth");
|
|
33
34
|
const lastMonth = useModel(__props, "lastMonth");
|
|
34
35
|
const emit = __emit;
|
|
36
|
+
/** The months in view, as `attachRangeCalendar` reports them */
|
|
37
|
+
const inView = shallowRef();
|
|
35
38
|
const calendar = createRangeCalendar({
|
|
36
39
|
props: () => ({
|
|
37
40
|
start: props.start,
|
|
38
41
|
end: props.end,
|
|
42
|
+
selection: props.selection,
|
|
39
43
|
focused: focused.value,
|
|
40
44
|
firstMonth: firstMonth.value,
|
|
41
45
|
lastMonth: lastMonth.value,
|
|
46
|
+
inView: inView.value,
|
|
42
47
|
min: props.min,
|
|
43
48
|
max: props.max,
|
|
44
49
|
locale: props.locale,
|
|
@@ -59,14 +64,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
59
64
|
calendar: () => calendar,
|
|
60
65
|
focused: () => focused.value,
|
|
61
66
|
onConfirm: (date) => emit("select", date, true),
|
|
62
|
-
onEdge: calendar.extend
|
|
67
|
+
onEdge: calendar.extend,
|
|
68
|
+
onInViewChange: (next) => inView.value = next
|
|
63
69
|
});
|
|
64
70
|
});
|
|
65
71
|
onUpdated(() => handle?.sync());
|
|
66
72
|
onBeforeUnmount(() => handle?.detach());
|
|
67
|
-
__expose({
|
|
68
|
-
/** Focuses the date that takes the focus. */
|
|
69
|
-
focus: () => handle?.focus() });
|
|
70
73
|
return (_ctx, _cache) => {
|
|
71
74
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
72
75
|
ref_key: "root",
|
|
@@ -74,14 +77,20 @@ focus: () => handle?.focus() });
|
|
|
74
77
|
}, unref(calendar).parts.root()), [createElementVNode("div", normalizeProps(guardReactiveProps(unref(calendar).parts.weekdays())), [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(calendar).weekdays(), (day) => {
|
|
75
78
|
return openBlock(), createElementBlock("span", mergeProps({ key: day }, { ref_for: true }, unref(calendar).parts.weekday(day)), toDisplayString(unref(calendar).weekdayText(day)), 17);
|
|
76
79
|
}), 128))], 16), createElementVNode("div", normalizeProps(guardReactiveProps(unref(calendar).parts.months())), [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(calendar).months(), (month) => {
|
|
77
|
-
return openBlock(), createElementBlock("div", mergeProps({ key: month }, { ref_for: true }, unref(calendar).parts.month(month)), [createElementVNode("div", mergeProps({ ref_for: true }, unref(calendar).parts.subhead(month)), toDisplayString(unref(calendar).monthText(month)), 17),
|
|
80
|
+
return openBlock(), createElementBlock("div", mergeProps({ key: month }, { ref_for: true }, unref(calendar).parts.month(month)), [createElementVNode("div", mergeProps({ ref_for: true }, unref(calendar).parts.subhead(month)), toDisplayString(unref(calendar).monthText(month)), 17), unref(calendar).rendersDays(month) ? (openBlock(), createElementBlock("table", mergeProps({
|
|
81
|
+
key: 0,
|
|
82
|
+
ref_for: true
|
|
83
|
+
}, unref(calendar).parts.grid(month)), [createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(calendar).weeks(month), (week) => {
|
|
78
84
|
return openBlock(), createElementBlock("tr", { key: week[0] }, [(openBlock(true), createElementBlock(Fragment, null, renderList(week, (date) => {
|
|
79
85
|
return openBlock(), createElementBlock("td", mergeProps({ key: date }, { ref_for: true }, unref(calendar).parts.cell(date, month)), [unref(calendar).showsDay(date, month) ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
|
|
80
86
|
key: 0,
|
|
81
87
|
ref_for: true
|
|
82
88
|
}, unref(calendar).parts.day(date), { onClick: ($event) => unref(calendar).handleDayClick(date) }), [createTextVNode(toDisplayString(unref(calendar).dayText(date)), 1)], 16, _hoisted_1)), [[unref(vRipple)]]) : createCommentVNode("v-if", true)], 16);
|
|
83
89
|
}), 128))]);
|
|
84
|
-
}), 128))])], 16)
|
|
90
|
+
}), 128))])], 16)) : (openBlock(), createElementBlock("div", mergeProps({
|
|
91
|
+
key: 1,
|
|
92
|
+
ref_for: true
|
|
93
|
+
}, unref(calendar).parts.placeholder(month)), null, 16))], 16);
|
|
85
94
|
}), 128))], 16)], 16);
|
|
86
95
|
};
|
|
87
96
|
}
|