@mekari/pixel3-date-picker 0.0.1-dev.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/dist/calendar-panel.d.mts +231 -0
- package/dist/calendar-panel.d.ts +231 -0
- package/dist/calendar-panel.js +1498 -0
- package/dist/calendar-panel.mjs +25 -0
- package/dist/chunk-26Y3AVJW.mjs +115 -0
- package/dist/chunk-3VROFGJH.mjs +34 -0
- package/dist/chunk-3YYRUEIF.mjs +257 -0
- package/dist/chunk-5PISTT2K.mjs +131 -0
- package/dist/chunk-AGAA7XTC.mjs +20 -0
- package/dist/chunk-EJCSF5VR.mjs +492 -0
- package/dist/chunk-EQWT6VDG.mjs +34 -0
- package/dist/chunk-FTR7OMCT.mjs +0 -0
- package/dist/chunk-HJ4V3PM6.mjs +125 -0
- package/dist/chunk-J5BK7Z2U.mjs +46 -0
- package/dist/chunk-JZ2KFYWF.mjs +127 -0
- package/dist/chunk-LVCRFE25.mjs +153 -0
- package/dist/chunk-NIUQXHGQ.mjs +56 -0
- package/dist/chunk-NVULZQVI.mjs +119 -0
- package/dist/chunk-OY5PVQH5.mjs +31 -0
- package/dist/chunk-Q3Z5ZITX.mjs +155 -0
- package/dist/chunk-QZ7VFGWC.mjs +6 -0
- package/dist/chunk-V36XV4LV.mjs +129 -0
- package/dist/chunk-V6D6W7RO.mjs +0 -0
- package/dist/chunk-VACMCDOZ.mjs +8 -0
- package/dist/components/calendar/index.d.mts +11 -0
- package/dist/components/calendar/index.d.ts +11 -0
- package/dist/components/calendar/index.js +548 -0
- package/dist/components/calendar/index.mjs +23 -0
- package/dist/components/calendar/table-date.d.mts +97 -0
- package/dist/components/calendar/table-date.d.ts +97 -0
- package/dist/components/calendar/table-date.js +305 -0
- package/dist/components/calendar/table-date.mjs +13 -0
- package/dist/components/calendar/table-month.d.mts +90 -0
- package/dist/components/calendar/table-month.d.ts +90 -0
- package/dist/components/calendar/table-month.js +294 -0
- package/dist/components/calendar/table-month.mjs +14 -0
- package/dist/components/calendar/table-year.d.mts +71 -0
- package/dist/components/calendar/table-year.d.ts +71 -0
- package/dist/components/calendar/table-year.js +288 -0
- package/dist/components/calendar/table-year.mjs +14 -0
- package/dist/components/parts/date.d.mts +38 -0
- package/dist/components/parts/date.d.ts +38 -0
- package/dist/components/parts/date.js +70 -0
- package/dist/components/parts/date.mjs +7 -0
- package/dist/components/parts/day.d.mts +6 -0
- package/dist/components/parts/day.d.ts +6 -0
- package/dist/components/parts/day.js +44 -0
- package/dist/components/parts/day.mjs +7 -0
- package/dist/components/parts/index.d.mts +9 -0
- package/dist/components/parts/index.d.ts +9 -0
- package/dist/components/parts/index.js +157 -0
- package/dist/components/parts/index.mjs +20 -0
- package/dist/components/parts/month.d.mts +29 -0
- package/dist/components/parts/month.d.ts +29 -0
- package/dist/components/parts/month.js +58 -0
- package/dist/components/parts/month.mjs +7 -0
- package/dist/components/parts/year.d.mts +29 -0
- package/dist/components/parts/year.d.ts +29 -0
- package/dist/components/parts/year.js +58 -0
- package/dist/components/parts/year.mjs +7 -0
- package/dist/composables/useCalendar.d.mts +90 -0
- package/dist/composables/useCalendar.d.ts +90 -0
- package/dist/composables/useCalendar.js +184 -0
- package/dist/composables/useCalendar.mjs +8 -0
- package/dist/composables/useCalendarRange.d.mts +277 -0
- package/dist/composables/useCalendarRange.d.ts +277 -0
- package/dist/composables/useCalendarRange.js +160 -0
- package/dist/composables/useCalendarRange.mjs +8 -0
- package/dist/date-picker.d.mts +237 -0
- package/dist/date-picker.d.ts +237 -0
- package/dist/date-picker.js +1851 -0
- package/dist/date-picker.mjs +25 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1853 -0
- package/dist/index.mjs +25 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/modules/date-picker.context.d.mts +20 -0
- package/dist/modules/date-picker.context.d.ts +20 -0
- package/dist/modules/date-picker.context.js +33 -0
- package/dist/modules/date-picker.context.mjs +9 -0
- package/dist/modules/date-picker.hooks.d.mts +53 -0
- package/dist/modules/date-picker.hooks.d.ts +53 -0
- package/dist/modules/date-picker.hooks.js +337 -0
- package/dist/modules/date-picker.hooks.mjs +10 -0
- package/dist/modules/date-picker.locales.d.mts +27 -0
- package/dist/modules/date-picker.locales.d.ts +27 -0
- package/dist/modules/date-picker.locales.js +84 -0
- package/dist/modules/date-picker.locales.mjs +8 -0
- package/dist/modules/date-picker.props.d.mts +217 -0
- package/dist/modules/date-picker.props.d.ts +217 -0
- package/dist/modules/date-picker.props.js +181 -0
- package/dist/modules/date-picker.props.mjs +11 -0
- package/dist/utils/base.d.mts +20 -0
- package/dist/utils/base.d.ts +20 -0
- package/dist/utils/base.js +80 -0
- package/dist/utils/base.mjs +13 -0
- package/dist/utils/date.d.mts +19 -0
- package/dist/utils/date.d.ts +19 -0
- package/dist/utils/date.js +147 -0
- package/dist/utils/date.mjs +29 -0
- package/package.json +49 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CalendarPanel,
|
|
3
|
+
CalendarPanelRange
|
|
4
|
+
} from "./chunk-EJCSF5VR.mjs";
|
|
5
|
+
import {
|
|
6
|
+
datePickerProps
|
|
7
|
+
} from "./chunk-Q3Z5ZITX.mjs";
|
|
8
|
+
import {
|
|
9
|
+
DatePickerProvider
|
|
10
|
+
} from "./chunk-VACMCDOZ.mjs";
|
|
11
|
+
import {
|
|
12
|
+
useDatePicker
|
|
13
|
+
} from "./chunk-3YYRUEIF.mjs";
|
|
14
|
+
import {
|
|
15
|
+
__name
|
|
16
|
+
} from "./chunk-QZ7VFGWC.mjs";
|
|
17
|
+
|
|
18
|
+
// src/date-picker.tsx
|
|
19
|
+
import { isVNode as _isVNode, mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
|
20
|
+
import { defineComponent } from "vue";
|
|
21
|
+
import { MpInput, MpInputGroup, MpInputRightAddon } from "@mekari/pixel3-input";
|
|
22
|
+
import { MpPopover, MpPopoverTrigger, MpPopoverContent } from "@mekari/pixel3-popover";
|
|
23
|
+
import { MpIcon } from "@mekari/pixel3-icon";
|
|
24
|
+
import { datePickerSlotRecipe } from "@mekari/pixel3-styled-system/recipes";
|
|
25
|
+
function _isSlot(s) {
|
|
26
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !_isVNode(s);
|
|
27
|
+
}
|
|
28
|
+
__name(_isSlot, "_isSlot");
|
|
29
|
+
var MpDatePicker = defineComponent({
|
|
30
|
+
name: "MpDatePicker",
|
|
31
|
+
props: datePickerProps,
|
|
32
|
+
emits: ["update:modelValue", "error"],
|
|
33
|
+
setup(props, {
|
|
34
|
+
emit
|
|
35
|
+
}) {
|
|
36
|
+
const {
|
|
37
|
+
text,
|
|
38
|
+
getId,
|
|
39
|
+
innerValue,
|
|
40
|
+
locale,
|
|
41
|
+
isOutside,
|
|
42
|
+
isPopoverOpen,
|
|
43
|
+
isInnerInvalid,
|
|
44
|
+
isUseRange,
|
|
45
|
+
onOpenPopover,
|
|
46
|
+
onBlur,
|
|
47
|
+
onClear,
|
|
48
|
+
onInputChange,
|
|
49
|
+
onEmitModelValue
|
|
50
|
+
} = useDatePicker(props, emit);
|
|
51
|
+
DatePickerProvider({
|
|
52
|
+
rootProps: props,
|
|
53
|
+
locale
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
const {
|
|
57
|
+
root,
|
|
58
|
+
popoverContent
|
|
59
|
+
} = datePickerSlotRecipe();
|
|
60
|
+
const inputNode = _createVNode(MpInputGroup, null, {
|
|
61
|
+
default: () => [_createVNode(MpInput, {
|
|
62
|
+
"id": getId,
|
|
63
|
+
"placeholder": props.placeholder,
|
|
64
|
+
"isClearable": props.isClearable,
|
|
65
|
+
"isDisabled": props.isDisabled,
|
|
66
|
+
"isInvalid": props.isInvalid || isInnerInvalid.value,
|
|
67
|
+
"isReadOnly": props.isReadOnly,
|
|
68
|
+
"modelValue": text.value,
|
|
69
|
+
"onInput": onInputChange,
|
|
70
|
+
"onClear": onClear,
|
|
71
|
+
"onFocus": () => onOpenPopover(),
|
|
72
|
+
"onBlur": (e) => {
|
|
73
|
+
if (isOutside.value) {
|
|
74
|
+
onBlur();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const target = e.target;
|
|
78
|
+
target.focus();
|
|
79
|
+
}
|
|
80
|
+
}, null), _createVNode(MpInputRightAddon, null, {
|
|
81
|
+
default: () => [_createVNode(MpIcon, {
|
|
82
|
+
"name": "calendar"
|
|
83
|
+
}, null)]
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
const calendarPanelAttrs = {
|
|
87
|
+
type: props.type,
|
|
88
|
+
"onUpdate:modelValue": onEmitModelValue,
|
|
89
|
+
disabledDate: props.disabledDate,
|
|
90
|
+
disabledMonth: props.disabledMonth,
|
|
91
|
+
disabledYear: props.disabledYear
|
|
92
|
+
};
|
|
93
|
+
const panelNode = isUseRange.value ? _createVNode(CalendarPanelRange, _mergeProps(calendarPanelAttrs, {
|
|
94
|
+
"modelValue": innerValue.value
|
|
95
|
+
}), null) : _createVNode(CalendarPanel, _mergeProps(calendarPanelAttrs, {
|
|
96
|
+
"modelValue": innerValue.value
|
|
97
|
+
}), null);
|
|
98
|
+
const withPopover = _createVNode(MpPopover, {
|
|
99
|
+
"id": getId,
|
|
100
|
+
"isManual": true,
|
|
101
|
+
"isOpen": isPopoverOpen.value,
|
|
102
|
+
"isKeepAlive": props.isKeepAlive,
|
|
103
|
+
"usePortal": props.usePortal
|
|
104
|
+
}, {
|
|
105
|
+
default: () => [_createVNode(MpPopoverTrigger, null, _isSlot(inputNode) ? inputNode : {
|
|
106
|
+
default: () => [inputNode]
|
|
107
|
+
}), _createVNode(MpPopoverContent, {
|
|
108
|
+
"class": popoverContent,
|
|
109
|
+
"style": {
|
|
110
|
+
width: props.isRange ? "590px" : ""
|
|
111
|
+
},
|
|
112
|
+
"onMouseenter": () => isOutside.value = false,
|
|
113
|
+
"onMouseleave": () => isOutside.value = true
|
|
114
|
+
}, _isSlot(panelNode) ? panelNode : {
|
|
115
|
+
default: () => [panelNode]
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
return _createVNode("div", {
|
|
119
|
+
"class": root,
|
|
120
|
+
"onMouseenter": () => isOutside.value = false,
|
|
121
|
+
"onMouseleave": () => isOutside.value = true
|
|
122
|
+
}, [props.isInline ? panelNode : withPopover]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
MpDatePicker
|
|
129
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { TableDate } from './table-date.mjs';
|
|
2
|
+
export { TableMonth } from './table-month.mjs';
|
|
3
|
+
export { TableYear } from './table-year.mjs';
|
|
4
|
+
import 'vue';
|
|
5
|
+
import 'vue/jsx-runtime';
|
|
6
|
+
import '../parts/date.mjs';
|
|
7
|
+
import '@mekari/pixel3-styled-system/types';
|
|
8
|
+
import '@mekari/pixel3-styled-system/css';
|
|
9
|
+
import '@mekari/pixel3-styled-system/recipes';
|
|
10
|
+
import '../parts/month.mjs';
|
|
11
|
+
import '../parts/year.mjs';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { TableDate } from './table-date.js';
|
|
2
|
+
export { TableMonth } from './table-month.js';
|
|
3
|
+
export { TableYear } from './table-year.js';
|
|
4
|
+
import 'vue';
|
|
5
|
+
import 'vue/jsx-runtime';
|
|
6
|
+
import '../parts/date.js';
|
|
7
|
+
import '@mekari/pixel3-styled-system/types';
|
|
8
|
+
import '@mekari/pixel3-styled-system/css';
|
|
9
|
+
import '@mekari/pixel3-styled-system/recipes';
|
|
10
|
+
import '../parts/month.js';
|
|
11
|
+
import '../parts/year.js';
|