v-calendar-3 1.1.0 → 1.1.1
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 +13 -1
- package/dist/cjs/index.js +16 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +49 -33
- package/dist/es/index.js.map +1 -1
- package/dist/iife/index.js +1 -1
- package/dist/iife/index.js.map +1 -1
- package/dist/mjs/index.mjs +49 -33
- package/dist/mjs/index.mjs.map +1 -1
- package/dist/types/components/DatePicker/DatePicker.vue.d.ts +91 -3
- package/dist/types/index.d.cts +185 -40
- package/dist/types/index.d.mts +185 -40
- package/dist/types/index.d.ts +185 -40
- package/dist/types/use/calendar.d.ts +44 -3
- package/dist/types/use/datePicker.d.ts +45 -6
- package/package.json +6 -3
- package/src/components/DatePicker/DatePicker.vue +20 -4
- package/src/index.ts +11 -0
- package/src/use/calendar.ts +11 -4
- package/src/use/datePicker.ts +18 -5
- package/web-types.json +273 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A maintained Vue 3 calendar and date picker with TypeScript declarations,
|
|
|
4
4
|
timezone support, keyboard navigation, touch interaction, and responsive theme
|
|
5
5
|
handling.
|
|
6
6
|
|
|
7
|
-
Current version: `1.1.
|
|
7
|
+
Current version: `1.1.1`
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -17,6 +17,7 @@ Current version: `1.1.0`
|
|
|
17
17
|
- Keyboard navigation, Escape handling, Pointer Events, and touch support
|
|
18
18
|
- SSR-safe browser access and iframe-aware theme/popover handling
|
|
19
19
|
- ESM, Node ESM, CommonJS, IIFE, CSS, and TypeScript declaration builds
|
|
20
|
+
- Vue component metadata for PhpStorm and other JetBrains IDEs
|
|
20
21
|
|
|
21
22
|
## Requirements
|
|
22
23
|
|
|
@@ -75,6 +76,10 @@ const selectedDate = ref<Date | null>(new Date());
|
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
The component prefix defaults to `V` and can be changed during plugin setup.
|
|
79
|
+
The package publishes global component types for the default `VCalendar`,
|
|
80
|
+
`VDatePicker`, `VPopover`, and `VPopoverRow` names. Custom prefixes are runtime
|
|
81
|
+
configuration and must be declared in the consuming application's
|
|
82
|
+
`GlobalComponents` interface if template autocomplete is required.
|
|
78
83
|
|
|
79
84
|
```ts
|
|
80
85
|
app.use(VCalendar, {
|
|
@@ -127,6 +132,13 @@ app.use(setupCalendar, {
|
|
|
127
132
|
});
|
|
128
133
|
```
|
|
129
134
|
|
|
135
|
+
The package ships both Vue TypeScript declarations and JetBrains Web Types.
|
|
136
|
+
PhpStorm can therefore complete component props and navigate from imported
|
|
137
|
+
`Calendar` and `DatePicker` tags to their declarations without application-side
|
|
138
|
+
shims. After changing between local `file:` package versions, let the package
|
|
139
|
+
manager refresh the link and ask PhpStorm to reload the project indexes if it
|
|
140
|
+
still shows cached generic Vue metadata.
|
|
141
|
+
|
|
130
142
|
## Date picker modes
|
|
131
143
|
|
|
132
144
|
The default model is a JavaScript `Date`. Use the `range` modifier for date
|
package/dist/cjs/index.js
CHANGED
|
@@ -7929,8 +7929,7 @@ function useSlot(slotKey) {
|
|
|
7929
7929
|
}
|
|
7930
7930
|
//#endregion
|
|
7931
7931
|
//#region src/use/calendar.ts
|
|
7932
|
-
var
|
|
7933
|
-
...propsDef$2,
|
|
7932
|
+
var calendarPropsDef = {
|
|
7934
7933
|
view: {
|
|
7935
7934
|
type: String,
|
|
7936
7935
|
default: "monthly",
|
|
@@ -7976,6 +7975,10 @@ var propsDef$1 = {
|
|
|
7976
7975
|
trimWeeks: Boolean,
|
|
7977
7976
|
disablePageSwipe: Boolean
|
|
7978
7977
|
};
|
|
7978
|
+
var propsDef$1 = {
|
|
7979
|
+
...propsDef$2,
|
|
7980
|
+
...calendarPropsDef
|
|
7981
|
+
};
|
|
7979
7982
|
var emitsDef = [
|
|
7980
7983
|
"dayclick",
|
|
7981
7984
|
"daymouseenter",
|
|
@@ -9700,6 +9703,7 @@ var Calendar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(Calendar_
|
|
|
9700
9703
|
var contextKey = Symbol("__vc_date_picker_context__");
|
|
9701
9704
|
var propsDef = {
|
|
9702
9705
|
...propsDef$2,
|
|
9706
|
+
...calendarPropsDef,
|
|
9703
9707
|
mode: {
|
|
9704
9708
|
type: String,
|
|
9705
9709
|
default: "date"
|
|
@@ -10681,6 +10685,7 @@ var DatePickerPopover_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
10681
10685
|
});
|
|
10682
10686
|
//#endregion
|
|
10683
10687
|
//#region src/components/DatePicker/DatePicker.vue?vue&type=script&lang.ts
|
|
10688
|
+
var forwardedCalendarPropNames = Object.keys(calendarPropsDef).filter((name) => name !== "attributes");
|
|
10684
10689
|
var DatePicker_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
10685
10690
|
inheritAttrs: false,
|
|
10686
10691
|
emits,
|
|
@@ -10692,8 +10697,10 @@ var DatePicker_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
|
10692
10697
|
setup(props, ctx) {
|
|
10693
10698
|
const datePicker = createDatePicker(props, ctx);
|
|
10694
10699
|
const slotCtx = (0, vue.reactive)(omit(datePicker, "calendarRef", "popoverRef"));
|
|
10700
|
+
const forwardedCalendarProps = (0, vue.computed)(() => Object.fromEntries(forwardedCalendarPropNames.map((name) => [name, props[name]])));
|
|
10695
10701
|
return {
|
|
10696
10702
|
...datePicker,
|
|
10703
|
+
forwardedCalendarProps,
|
|
10697
10704
|
slotCtx
|
|
10698
10705
|
};
|
|
10699
10706
|
}
|
|
@@ -10703,7 +10710,13 @@ var DatePicker_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
|
10703
10710
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10704
10711
|
const _component_DatePickerPopover = (0, vue.resolveComponent)("DatePickerPopover");
|
|
10705
10712
|
const _component_DatePickerBase = (0, vue.resolveComponent)("DatePickerBase");
|
|
10706
|
-
return _ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.renderSlot)(_ctx.$slots, "default", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(_ctx.slotCtx))), (0, vue.createVNode)(_component_DatePickerPopover, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(
|
|
10713
|
+
return _ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.renderSlot)(_ctx.$slots, "default", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(_ctx.slotCtx))), (0, vue.createVNode)(_component_DatePickerPopover, (0, vue.normalizeProps)((0, vue.guardReactiveProps)({
|
|
10714
|
+
..._ctx.forwardedCalendarProps,
|
|
10715
|
+
..._ctx.$attrs
|
|
10716
|
+
})), null, 16)], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)(_component_DatePickerBase, (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 1 }, {
|
|
10717
|
+
..._ctx.forwardedCalendarProps,
|
|
10718
|
+
..._ctx.$attrs
|
|
10719
|
+
})), null, 16));
|
|
10707
10720
|
}
|
|
10708
10721
|
var DatePicker_default = /*#__PURE__*/ _plugin_vue_export_helper_default(DatePicker_vue_vue_type_script_lang_default, [["render", _sfc_render]]);
|
|
10709
10722
|
//#endregion
|