@mekari/pixel3-date-picker 0.0.1-dev.0 → 0.0.1-dev.2
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 +18 -0
- package/dist/calendar-panel.d.ts +18 -0
- package/dist/calendar-panel.js +31 -25
- package/dist/calendar-panel.mjs +6 -5
- package/dist/{chunk-3YYRUEIF.mjs → chunk-3RCUXNBN.mjs} +1 -1
- package/dist/{chunk-V36XV4LV.mjs → chunk-EYTJIMSM.mjs} +4 -3
- package/dist/chunk-IZITNJFI.mjs +15 -0
- package/dist/{chunk-EJCSF5VR.mjs → chunk-KTADGCWP.mjs} +5 -4
- package/dist/{chunk-Q3Z5ZITX.mjs → chunk-XQLKPPRN.mjs} +4 -0
- package/dist/{chunk-OY5PVQH5.mjs → chunk-ZS4JQRK3.mjs} +6 -4
- package/dist/components/calendar/index.mjs +2 -2
- package/dist/components/calendar/table-date.mjs +2 -2
- package/dist/components/calendar/table-month.mjs +1 -1
- package/dist/components/calendar/table-year.mjs +1 -1
- package/dist/components/parts/index.mjs +3 -3
- package/dist/date-picker.js +38 -31
- package/dist/date-picker.mjs +8 -7
- package/dist/index.js +38 -31
- package/dist/index.mjs +8 -7
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/modules/date-picker.context.d.mts +1 -1
- package/dist/modules/date-picker.context.d.ts +1 -1
- package/dist/modules/date-picker.hooks.d.mts +2 -2
- package/dist/modules/date-picker.hooks.d.ts +2 -2
- package/dist/modules/date-picker.hooks.js +18 -19
- package/dist/modules/date-picker.hooks.mjs +3 -2
- package/dist/modules/date-picker.locales.d.mts +3 -3
- package/dist/modules/date-picker.locales.d.ts +3 -3
- package/dist/modules/date-picker.locales.js +15 -14
- package/dist/modules/date-picker.locales.mjs +2 -1
- package/dist/modules/date-picker.props.d.mts +8 -0
- package/dist/modules/date-picker.props.d.ts +8 -0
- package/dist/modules/date-picker.props.js +4 -0
- package/dist/modules/date-picker.props.mjs +1 -1
- package/dist/utils/locale/af.d.mts +5 -0
- package/dist/utils/locale/af.d.ts +5 -0
- package/dist/utils/locale/af.js +35 -0
- package/dist/utils/locale/af.mjs +16 -0
- package/dist/utils/locale/ar-dz.d.mts +5 -0
- package/dist/utils/locale/ar-dz.d.ts +5 -0
- package/dist/utils/locale/ar-dz.js +35 -0
- package/dist/utils/locale/ar-dz.mjs +16 -0
- package/dist/utils/locale/ar-sa.d.mts +5 -0
- package/dist/utils/locale/ar-sa.d.ts +5 -0
- package/dist/utils/locale/ar-sa.js +35 -0
- package/dist/utils/locale/ar-sa.mjs +16 -0
- package/dist/utils/locale/ar.d.mts +5 -0
- package/dist/utils/locale/ar.d.ts +5 -0
- package/dist/utils/locale/ar.js +35 -0
- package/dist/utils/locale/ar.mjs +16 -0
- package/dist/utils/locale/az.d.mts +5 -0
- package/dist/utils/locale/az.d.ts +5 -0
- package/dist/utils/locale/az.js +35 -0
- package/dist/utils/locale/az.mjs +16 -0
- package/dist/utils/locale/be.d.mts +5 -0
- package/dist/utils/locale/be.d.ts +5 -0
- package/dist/utils/locale/be.js +35 -0
- package/dist/utils/locale/be.mjs +16 -0
- package/dist/utils/locale/bg.d.mts +5 -0
- package/dist/utils/locale/bg.d.ts +5 -0
- package/dist/utils/locale/bg.js +35 -0
- package/dist/utils/locale/bg.mjs +16 -0
- package/dist/utils/locale/bm.d.mts +5 -0
- package/dist/utils/locale/bm.d.ts +5 -0
- package/dist/utils/locale/bm.js +35 -0
- package/dist/utils/locale/bm.mjs +16 -0
- package/dist/utils/locale/bn.d.mts +5 -0
- package/dist/utils/locale/bn.d.ts +5 -0
- package/dist/utils/locale/bn.js +35 -0
- package/dist/utils/locale/bn.mjs +16 -0
- package/dist/utils/locale/ca.d.mts +5 -0
- package/dist/utils/locale/ca.d.ts +5 -0
- package/dist/utils/locale/ca.js +35 -0
- package/dist/utils/locale/ca.mjs +16 -0
- package/dist/utils/locale/cs.d.mts +5 -0
- package/dist/utils/locale/cs.d.ts +5 -0
- package/dist/utils/locale/cs.js +35 -0
- package/dist/utils/locale/cs.mjs +16 -0
- package/dist/utils/locale/cy.d.mts +5 -0
- package/dist/utils/locale/cy.d.ts +5 -0
- package/dist/utils/locale/cy.js +35 -0
- package/dist/utils/locale/cy.mjs +16 -0
- package/dist/utils/locale/da.d.mts +5 -0
- package/dist/utils/locale/da.d.ts +5 -0
- package/dist/utils/locale/da.js +35 -0
- package/dist/utils/locale/da.mjs +16 -0
- package/dist/utils/locale/de.d.mts +5 -0
- package/dist/utils/locale/de.d.ts +5 -0
- package/dist/utils/locale/de.js +35 -0
- package/dist/utils/locale/de.mjs +16 -0
- package/dist/utils/locale/el.d.mts +5 -0
- package/dist/utils/locale/el.d.ts +5 -0
- package/dist/utils/locale/el.js +35 -0
- package/dist/utils/locale/el.mjs +16 -0
- package/dist/utils/locale/en.d.mts +5 -0
- package/dist/utils/locale/en.d.ts +5 -0
- package/dist/utils/locale/en.js +35 -0
- package/dist/utils/locale/en.mjs +7 -0
- package/dist/utils/locale/eo.d.mts +5 -0
- package/dist/utils/locale/eo.d.ts +5 -0
- package/dist/utils/locale/eo.js +35 -0
- package/dist/utils/locale/eo.mjs +16 -0
- package/dist/utils/locale/es.d.mts +5 -0
- package/dist/utils/locale/es.d.ts +5 -0
- package/dist/utils/locale/es.js +35 -0
- package/dist/utils/locale/es.mjs +16 -0
- package/dist/utils/locale/et.d.mts +5 -0
- package/dist/utils/locale/et.d.ts +5 -0
- package/dist/utils/locale/et.js +35 -0
- package/dist/utils/locale/et.mjs +16 -0
- package/dist/utils/locale/fi.d.mts +5 -0
- package/dist/utils/locale/fi.d.ts +5 -0
- package/dist/utils/locale/fi.js +35 -0
- package/dist/utils/locale/fi.mjs +16 -0
- package/dist/utils/locale/fr.d.mts +5 -0
- package/dist/utils/locale/fr.d.ts +5 -0
- package/dist/utils/locale/fr.js +35 -0
- package/dist/utils/locale/fr.mjs +16 -0
- package/dist/utils/locale/gl.d.mts +5 -0
- package/dist/utils/locale/gl.d.ts +5 -0
- package/dist/utils/locale/gl.js +35 -0
- package/dist/utils/locale/gl.mjs +16 -0
- package/dist/utils/locale/gu.d.mts +5 -0
- package/dist/utils/locale/gu.d.ts +5 -0
- package/dist/utils/locale/gu.js +35 -0
- package/dist/utils/locale/gu.mjs +16 -0
- package/dist/utils/locale/he.d.mts +5 -0
- package/dist/utils/locale/he.d.ts +5 -0
- package/dist/utils/locale/he.js +35 -0
- package/dist/utils/locale/he.mjs +16 -0
- package/dist/utils/locale/hi.d.mts +5 -0
- package/dist/utils/locale/hi.d.ts +5 -0
- package/dist/utils/locale/hi.js +35 -0
- package/dist/utils/locale/hi.mjs +16 -0
- package/dist/utils/locale/hr.d.mts +5 -0
- package/dist/utils/locale/hr.d.ts +5 -0
- package/dist/utils/locale/hr.js +35 -0
- package/dist/utils/locale/hr.mjs +16 -0
- package/dist/utils/locale/hu.d.mts +5 -0
- package/dist/utils/locale/hu.d.ts +5 -0
- package/dist/utils/locale/hu.js +35 -0
- package/dist/utils/locale/hu.mjs +16 -0
- package/dist/utils/locale/id.d.mts +5 -0
- package/dist/utils/locale/id.d.ts +5 -0
- package/dist/utils/locale/id.js +35 -0
- package/dist/utils/locale/id.mjs +16 -0
- package/dist/utils/locale/is.d.mts +5 -0
- package/dist/utils/locale/is.d.ts +5 -0
- package/dist/utils/locale/is.js +35 -0
- package/dist/utils/locale/is.mjs +16 -0
- package/dist/utils/locale/it.d.mts +5 -0
- package/dist/utils/locale/it.d.ts +5 -0
- package/dist/utils/locale/it.js +35 -0
- package/dist/utils/locale/it.mjs +16 -0
- package/dist/utils/locale/ja.d.mts +5 -0
- package/dist/utils/locale/ja.d.ts +5 -0
- package/dist/utils/locale/ja.js +35 -0
- package/dist/utils/locale/ja.mjs +16 -0
- package/dist/utils/locale/ka.d.mts +5 -0
- package/dist/utils/locale/ka.d.ts +5 -0
- package/dist/utils/locale/ka.js +35 -0
- package/dist/utils/locale/ka.mjs +16 -0
- package/dist/utils/locale/kk.d.mts +5 -0
- package/dist/utils/locale/kk.d.ts +5 -0
- package/dist/utils/locale/kk.js +35 -0
- package/dist/utils/locale/kk.mjs +16 -0
- package/dist/utils/locale/ko.d.mts +5 -0
- package/dist/utils/locale/ko.d.ts +5 -0
- package/dist/utils/locale/ko.js +35 -0
- package/dist/utils/locale/ko.mjs +16 -0
- package/dist/utils/locale/lt.d.mts +5 -0
- package/dist/utils/locale/lt.d.ts +5 -0
- package/dist/utils/locale/lt.js +35 -0
- package/dist/utils/locale/lt.mjs +16 -0
- package/dist/utils/locale/lv.d.mts +5 -0
- package/dist/utils/locale/lv.d.ts +5 -0
- package/dist/utils/locale/lv.js +35 -0
- package/dist/utils/locale/lv.mjs +16 -0
- package/dist/utils/locale/mk.d.mts +5 -0
- package/dist/utils/locale/mk.d.ts +5 -0
- package/dist/utils/locale/mk.js +35 -0
- package/dist/utils/locale/mk.mjs +16 -0
- package/dist/utils/locale/mn.d.mts +5 -0
- package/dist/utils/locale/mn.d.ts +5 -0
- package/dist/utils/locale/mn.js +35 -0
- package/dist/utils/locale/mn.mjs +16 -0
- package/dist/utils/locale/ms.d.mts +5 -0
- package/dist/utils/locale/ms.d.ts +5 -0
- package/dist/utils/locale/ms.js +35 -0
- package/dist/utils/locale/ms.mjs +16 -0
- package/dist/utils/locale/nb.d.mts +5 -0
- package/dist/utils/locale/nb.d.ts +5 -0
- package/dist/utils/locale/nb.js +35 -0
- package/dist/utils/locale/nb.mjs +16 -0
- package/dist/utils/locale/nl-be.d.mts +5 -0
- package/dist/utils/locale/nl-be.d.ts +5 -0
- package/dist/utils/locale/nl-be.js +35 -0
- package/dist/utils/locale/nl-be.mjs +16 -0
- package/dist/utils/locale/nl.d.mts +5 -0
- package/dist/utils/locale/nl.d.ts +5 -0
- package/dist/utils/locale/nl.js +35 -0
- package/dist/utils/locale/nl.mjs +16 -0
- package/dist/utils/locale/pl.d.mts +5 -0
- package/dist/utils/locale/pl.d.ts +5 -0
- package/dist/utils/locale/pl.js +35 -0
- package/dist/utils/locale/pl.mjs +16 -0
- package/dist/utils/locale/pt-br.d.mts +5 -0
- package/dist/utils/locale/pt-br.d.ts +5 -0
- package/dist/utils/locale/pt-br.js +35 -0
- package/dist/utils/locale/pt-br.mjs +16 -0
- package/dist/utils/locale/pt.d.mts +5 -0
- package/dist/utils/locale/pt.d.ts +5 -0
- package/dist/utils/locale/pt.js +35 -0
- package/dist/utils/locale/pt.mjs +16 -0
- package/dist/utils/locale/ro.d.mts +5 -0
- package/dist/utils/locale/ro.d.ts +5 -0
- package/dist/utils/locale/ro.js +35 -0
- package/dist/utils/locale/ro.mjs +16 -0
- package/dist/utils/locale/ru.d.mts +5 -0
- package/dist/utils/locale/ru.d.ts +5 -0
- package/dist/utils/locale/ru.js +35 -0
- package/dist/utils/locale/ru.mjs +16 -0
- package/dist/utils/locale/sl.d.mts +5 -0
- package/dist/utils/locale/sl.d.ts +5 -0
- package/dist/utils/locale/sl.js +35 -0
- package/dist/utils/locale/sl.mjs +16 -0
- package/dist/utils/locale/sr.d.mts +5 -0
- package/dist/utils/locale/sr.d.ts +5 -0
- package/dist/utils/locale/sr.js +35 -0
- package/dist/utils/locale/sr.mjs +16 -0
- package/dist/utils/locale/sv.d.mts +5 -0
- package/dist/utils/locale/sv.d.ts +5 -0
- package/dist/utils/locale/sv.js +35 -0
- package/dist/utils/locale/sv.mjs +16 -0
- package/dist/utils/locale/ta.d.mts +5 -0
- package/dist/utils/locale/ta.d.ts +5 -0
- package/dist/utils/locale/ta.js +35 -0
- package/dist/utils/locale/ta.mjs +16 -0
- package/dist/utils/locale/te.d.mts +5 -0
- package/dist/utils/locale/te.d.ts +5 -0
- package/dist/utils/locale/te.js +35 -0
- package/dist/utils/locale/te.mjs +16 -0
- package/dist/utils/locale/th.d.mts +5 -0
- package/dist/utils/locale/th.d.ts +5 -0
- package/dist/utils/locale/th.js +35 -0
- package/dist/utils/locale/th.mjs +16 -0
- package/dist/utils/locale/tr.d.mts +5 -0
- package/dist/utils/locale/tr.d.ts +5 -0
- package/dist/utils/locale/tr.js +35 -0
- package/dist/utils/locale/tr.mjs +16 -0
- package/dist/utils/locale/ug-cn.d.mts +5 -0
- package/dist/utils/locale/ug-cn.d.ts +5 -0
- package/dist/utils/locale/ug-cn.js +35 -0
- package/dist/utils/locale/ug-cn.mjs +16 -0
- package/dist/utils/locale/uk.d.mts +5 -0
- package/dist/utils/locale/uk.d.ts +5 -0
- package/dist/utils/locale/uk.js +35 -0
- package/dist/utils/locale/uk.mjs +16 -0
- package/dist/utils/locale/vi.d.mts +5 -0
- package/dist/utils/locale/vi.d.ts +5 -0
- package/dist/utils/locale/vi.js +35 -0
- package/dist/utils/locale/vi.mjs +16 -0
- package/dist/utils/locale/zh-cn.d.mts +5 -0
- package/dist/utils/locale/zh-cn.d.ts +5 -0
- package/dist/utils/locale/zh-cn.js +45 -0
- package/dist/utils/locale/zh-cn.mjs +26 -0
- package/dist/utils/locale/zh-tw.d.mts +5 -0
- package/dist/utils/locale/zh-tw.d.ts +5 -0
- package/dist/utils/locale/zh-tw.js +45 -0
- package/dist/utils/locale/zh-tw.mjs +26 -0
- package/dist/utils/locale.types.d.mts +14 -0
- package/dist/utils/locale.types.d.ts +14 -0
- package/dist/utils/locale.types.js +18 -0
- package/dist/utils/locale.types.mjs +0 -0
- package/package.json +6 -6
- package/dist/{chunk-LVCRFE25.mjs → chunk-NU6HYEPT.mjs} +3 -3
package/dist/date-picker.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
7
|
var __export = (target, all) => {
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
|
|
31
21
|
// src/date-picker.tsx
|
|
@@ -658,7 +648,7 @@ var import_date_fns3 = require("date-fns");
|
|
|
658
648
|
// src/composables/useCalendar.ts
|
|
659
649
|
var import_vue15 = require("vue");
|
|
660
650
|
var import_date_fns2 = require("date-fns");
|
|
661
|
-
function useCalendar(date,
|
|
651
|
+
function useCalendar(date, locale2) {
|
|
662
652
|
const currentDate = (0, import_vue15.ref)(isValidDate(date) ? date : /* @__PURE__ */ new Date());
|
|
663
653
|
const currentPanel = (0, import_vue15.ref)("date");
|
|
664
654
|
const nextMonth = /* @__PURE__ */ __name(() => {
|
|
@@ -684,7 +674,7 @@ function useCalendar(date, locale) {
|
|
|
684
674
|
day: currentDate.value.getDay(),
|
|
685
675
|
month: currentDate.value.getMonth(),
|
|
686
676
|
year: currentDate.value.getFullYear(),
|
|
687
|
-
monthLabel:
|
|
677
|
+
monthLabel: locale2.value.months[currentDate.value.getMonth()]
|
|
688
678
|
};
|
|
689
679
|
});
|
|
690
680
|
const getDates = (0, import_vue15.computed)(() => {
|
|
@@ -693,14 +683,14 @@ function useCalendar(date, locale) {
|
|
|
693
683
|
month
|
|
694
684
|
} = getSplitDates.value;
|
|
695
685
|
const arr = getCalendar({
|
|
696
|
-
firstDayOfWeek:
|
|
686
|
+
firstDayOfWeek: locale2.value.formatLocale.firstDayOfWeek || 0,
|
|
697
687
|
year,
|
|
698
688
|
month
|
|
699
689
|
});
|
|
700
690
|
return arr;
|
|
701
691
|
});
|
|
702
692
|
const getMonths = (0, import_vue15.computed)(() => {
|
|
703
|
-
const monthsLocale =
|
|
693
|
+
const monthsLocale = locale2.value.formatLocale.monthsShort || locale2.value.months;
|
|
704
694
|
const months = monthsLocale.map((text, month) => {
|
|
705
695
|
return {
|
|
706
696
|
text,
|
|
@@ -896,6 +886,10 @@ var calendarPanelProps = {
|
|
|
896
886
|
type: Boolean,
|
|
897
887
|
default: false
|
|
898
888
|
},
|
|
889
|
+
isInline: {
|
|
890
|
+
type: Boolean,
|
|
891
|
+
default: false
|
|
892
|
+
},
|
|
899
893
|
isShowShortcut: {
|
|
900
894
|
type: Boolean,
|
|
901
895
|
default: true
|
|
@@ -1031,12 +1025,23 @@ var datePickerProps = {
|
|
|
1031
1025
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
1032
1026
|
var [DatePickerProvider, useDatePickerContext] = (0, import_pixel3_utils.usePixelCreateContext)("DatePickerContext");
|
|
1033
1027
|
|
|
1028
|
+
// src/utils/locale/en.ts
|
|
1029
|
+
var locale = {
|
|
1030
|
+
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
1031
|
+
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
1032
|
+
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
1033
|
+
weekdaysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1034
|
+
weekdaysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1035
|
+
firstDayOfWeek: 0,
|
|
1036
|
+
firstWeekContainsDate: 1
|
|
1037
|
+
};
|
|
1038
|
+
var en_default = locale;
|
|
1039
|
+
|
|
1034
1040
|
// src/modules/date-picker.locales.ts
|
|
1035
|
-
var import_en = __toESM(require("date-format-parse/lib/locale/en"));
|
|
1036
1041
|
var locales = {
|
|
1037
|
-
formatLocale:
|
|
1038
|
-
days:
|
|
1039
|
-
months:
|
|
1042
|
+
formatLocale: en_default,
|
|
1043
|
+
days: en_default.weekdaysMin,
|
|
1044
|
+
months: en_default.monthsShort,
|
|
1040
1045
|
yearFormat: "YYYY",
|
|
1041
1046
|
monthFormat: "MMM",
|
|
1042
1047
|
monthBeforeYear: true,
|
|
@@ -1062,7 +1067,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1062
1067
|
emit
|
|
1063
1068
|
}) {
|
|
1064
1069
|
const {
|
|
1065
|
-
locale
|
|
1070
|
+
locale: locale2
|
|
1066
1071
|
} = useDatePickerContext();
|
|
1067
1072
|
const restValue = (0, import_vue18.ref)(props.modelValue);
|
|
1068
1073
|
const {
|
|
@@ -1079,7 +1084,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1079
1084
|
getLabel,
|
|
1080
1085
|
changeMonth,
|
|
1081
1086
|
changeYear
|
|
1082
|
-
} = useCalendar(props.modelValue || props.defaultValue,
|
|
1087
|
+
} = useCalendar(props.modelValue || props.defaultValue, locale2);
|
|
1083
1088
|
function onSelectDate(date) {
|
|
1084
1089
|
currentPanelDate.value = date;
|
|
1085
1090
|
restValue.value = date;
|
|
@@ -1208,10 +1213,10 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1208
1213
|
return () => {
|
|
1209
1214
|
if (currentPanel.value === "date") {
|
|
1210
1215
|
return (0, import_vue17.createVNode)(TableDate, {
|
|
1211
|
-
"days":
|
|
1216
|
+
"days": locale2.value.days,
|
|
1212
1217
|
"dates": getDates.value,
|
|
1213
1218
|
"headerLabel": getLabel.value,
|
|
1214
|
-
"shortcutLabel":
|
|
1219
|
+
"shortcutLabel": locale2.value.todayText,
|
|
1215
1220
|
"onNext": nextMonth,
|
|
1216
1221
|
"onPrevious": previousMonth,
|
|
1217
1222
|
"onClickHeaderLabel": () => changePanel("year"),
|
|
@@ -1228,7 +1233,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1228
1233
|
"calendar": currentPanelDate.value,
|
|
1229
1234
|
"months": getMonths.value,
|
|
1230
1235
|
"headerLabel": getLabel.value,
|
|
1231
|
-
"shortcutLabel":
|
|
1236
|
+
"shortcutLabel": locale2.value.thisMonthText,
|
|
1232
1237
|
"onNext": nextYear,
|
|
1233
1238
|
"onPrevious": previousYear,
|
|
1234
1239
|
"onClickHeaderLabel": () => changePanel("year"),
|
|
@@ -1243,7 +1248,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1243
1248
|
return (0, import_vue17.createVNode)(TableYear, {
|
|
1244
1249
|
"years": getYears.value,
|
|
1245
1250
|
"headerLabel": getLabel.value,
|
|
1246
|
-
"shortcutLabel":
|
|
1251
|
+
"shortcutLabel": locale2.value.thisYearText,
|
|
1247
1252
|
"onNext": (year) => changeYear(year),
|
|
1248
1253
|
"onPrevious": (year) => changeYear(year),
|
|
1249
1254
|
"onSelect": onSelectYear,
|
|
@@ -1482,9 +1487,10 @@ var CalendarPanelRange = (0, import_vue18.defineComponent)({
|
|
|
1482
1487
|
"onUpdateCalendar": (value) => updateStartCalendar(value),
|
|
1483
1488
|
"calendar": calendars.value[0]
|
|
1484
1489
|
}), null);
|
|
1485
|
-
const rightNode = (0, import_vue17.createVNode)(CalendarPanel, (0, import_vue17.mergeProps)({
|
|
1490
|
+
const rightNode = props.isInline ? "" : (0, import_vue17.createVNode)(CalendarPanel, (0, import_vue17.mergeProps)({
|
|
1486
1491
|
"data-pixel-parts": "CalendarPanelRight"
|
|
1487
1492
|
}, calendarPanelAttrs, {
|
|
1493
|
+
"style": "margin-left: 16px;",
|
|
1488
1494
|
"onUpdateCalendar": (value) => updateEndCalendar(value),
|
|
1489
1495
|
"calendar": calendars.value[1]
|
|
1490
1496
|
}), null);
|
|
@@ -1559,7 +1565,7 @@ function useDatePicker(props, emit) {
|
|
|
1559
1565
|
}
|
|
1560
1566
|
return formatDate(innerValue.value);
|
|
1561
1567
|
});
|
|
1562
|
-
const
|
|
1568
|
+
const locale2 = (0, import_vue19.computed)(() => {
|
|
1563
1569
|
if (isObject(props.lang)) {
|
|
1564
1570
|
return getLocale(props.lang);
|
|
1565
1571
|
}
|
|
@@ -1650,14 +1656,14 @@ function useDatePicker(props, emit) {
|
|
|
1650
1656
|
function parseDate(value) {
|
|
1651
1657
|
const backupDate = /* @__PURE__ */ new Date();
|
|
1652
1658
|
return (0, import_date_format_parse.parse)(value, innerFormat.value, {
|
|
1653
|
-
locale:
|
|
1659
|
+
locale: locale2.value.formatLocale,
|
|
1654
1660
|
backupDate
|
|
1655
1661
|
});
|
|
1656
1662
|
}
|
|
1657
1663
|
__name(parseDate, "parseDate");
|
|
1658
1664
|
function formatDate(date) {
|
|
1659
1665
|
return (0, import_date_format_parse.format)(date, innerFormat.value, {
|
|
1660
|
-
locale:
|
|
1666
|
+
locale: locale2.value.formatLocale
|
|
1661
1667
|
});
|
|
1662
1668
|
}
|
|
1663
1669
|
__name(formatDate, "formatDate");
|
|
@@ -1735,7 +1741,7 @@ function useDatePicker(props, emit) {
|
|
|
1735
1741
|
onBlur,
|
|
1736
1742
|
handleForceFocusToInput,
|
|
1737
1743
|
text,
|
|
1738
|
-
locale,
|
|
1744
|
+
locale: locale2,
|
|
1739
1745
|
isInnerInvalid,
|
|
1740
1746
|
onEmitModelValue
|
|
1741
1747
|
};
|
|
@@ -1759,7 +1765,7 @@ var MpDatePicker = (0, import_vue21.defineComponent)({
|
|
|
1759
1765
|
text,
|
|
1760
1766
|
getId,
|
|
1761
1767
|
innerValue,
|
|
1762
|
-
locale,
|
|
1768
|
+
locale: locale2,
|
|
1763
1769
|
isOutside,
|
|
1764
1770
|
isPopoverOpen,
|
|
1765
1771
|
isInnerInvalid,
|
|
@@ -1772,7 +1778,7 @@ var MpDatePicker = (0, import_vue21.defineComponent)({
|
|
|
1772
1778
|
} = useDatePicker(props, emit);
|
|
1773
1779
|
DatePickerProvider({
|
|
1774
1780
|
rootProps: props,
|
|
1775
|
-
locale
|
|
1781
|
+
locale: locale2
|
|
1776
1782
|
});
|
|
1777
1783
|
return () => {
|
|
1778
1784
|
const {
|
|
@@ -1807,6 +1813,7 @@ var MpDatePicker = (0, import_vue21.defineComponent)({
|
|
|
1807
1813
|
});
|
|
1808
1814
|
const calendarPanelAttrs = {
|
|
1809
1815
|
type: props.type,
|
|
1816
|
+
isInline: props.isInline,
|
|
1810
1817
|
"onUpdate:modelValue": onEmitModelValue,
|
|
1811
1818
|
disabledDate: props.disabledDate,
|
|
1812
1819
|
disabledMonth: props.disabledMonth,
|
package/dist/date-picker.mjs
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MpDatePicker
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EYTJIMSM.mjs";
|
|
4
|
+
import "./chunk-KTADGCWP.mjs";
|
|
5
|
+
import "./chunk-XQLKPPRN.mjs";
|
|
6
6
|
import "./chunk-V6D6W7RO.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-NU6HYEPT.mjs";
|
|
8
8
|
import "./chunk-5PISTT2K.mjs";
|
|
9
9
|
import "./chunk-HJ4V3PM6.mjs";
|
|
10
10
|
import "./chunk-FTR7OMCT.mjs";
|
|
11
|
+
import "./chunk-J5BK7Z2U.mjs";
|
|
11
12
|
import "./chunk-AGAA7XTC.mjs";
|
|
12
13
|
import "./chunk-3VROFGJH.mjs";
|
|
13
14
|
import "./chunk-EQWT6VDG.mjs";
|
|
14
|
-
import "./chunk-J5BK7Z2U.mjs";
|
|
15
15
|
import "./chunk-NVULZQVI.mjs";
|
|
16
16
|
import "./chunk-JZ2KFYWF.mjs";
|
|
17
17
|
import "./chunk-VACMCDOZ.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-3RCUXNBN.mjs";
|
|
19
19
|
import "./chunk-26Y3AVJW.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-ZS4JQRK3.mjs";
|
|
21
|
+
import "./chunk-IZITNJFI.mjs";
|
|
21
22
|
import "./chunk-NIUQXHGQ.mjs";
|
|
22
23
|
import "./chunk-QZ7VFGWC.mjs";
|
|
23
24
|
export {
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
7
|
var __export = (target, all) => {
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
|
|
31
21
|
// src/index.ts
|
|
@@ -660,7 +650,7 @@ var import_date_fns3 = require("date-fns");
|
|
|
660
650
|
// src/composables/useCalendar.ts
|
|
661
651
|
var import_vue15 = require("vue");
|
|
662
652
|
var import_date_fns2 = require("date-fns");
|
|
663
|
-
function useCalendar(date,
|
|
653
|
+
function useCalendar(date, locale2) {
|
|
664
654
|
const currentDate = (0, import_vue15.ref)(isValidDate(date) ? date : /* @__PURE__ */ new Date());
|
|
665
655
|
const currentPanel = (0, import_vue15.ref)("date");
|
|
666
656
|
const nextMonth = /* @__PURE__ */ __name(() => {
|
|
@@ -686,7 +676,7 @@ function useCalendar(date, locale) {
|
|
|
686
676
|
day: currentDate.value.getDay(),
|
|
687
677
|
month: currentDate.value.getMonth(),
|
|
688
678
|
year: currentDate.value.getFullYear(),
|
|
689
|
-
monthLabel:
|
|
679
|
+
monthLabel: locale2.value.months[currentDate.value.getMonth()]
|
|
690
680
|
};
|
|
691
681
|
});
|
|
692
682
|
const getDates = (0, import_vue15.computed)(() => {
|
|
@@ -695,14 +685,14 @@ function useCalendar(date, locale) {
|
|
|
695
685
|
month
|
|
696
686
|
} = getSplitDates.value;
|
|
697
687
|
const arr = getCalendar({
|
|
698
|
-
firstDayOfWeek:
|
|
688
|
+
firstDayOfWeek: locale2.value.formatLocale.firstDayOfWeek || 0,
|
|
699
689
|
year,
|
|
700
690
|
month
|
|
701
691
|
});
|
|
702
692
|
return arr;
|
|
703
693
|
});
|
|
704
694
|
const getMonths = (0, import_vue15.computed)(() => {
|
|
705
|
-
const monthsLocale =
|
|
695
|
+
const monthsLocale = locale2.value.formatLocale.monthsShort || locale2.value.months;
|
|
706
696
|
const months = monthsLocale.map((text, month) => {
|
|
707
697
|
return {
|
|
708
698
|
text,
|
|
@@ -898,6 +888,10 @@ var calendarPanelProps = {
|
|
|
898
888
|
type: Boolean,
|
|
899
889
|
default: false
|
|
900
890
|
},
|
|
891
|
+
isInline: {
|
|
892
|
+
type: Boolean,
|
|
893
|
+
default: false
|
|
894
|
+
},
|
|
901
895
|
isShowShortcut: {
|
|
902
896
|
type: Boolean,
|
|
903
897
|
default: true
|
|
@@ -1033,12 +1027,23 @@ var datePickerProps = {
|
|
|
1033
1027
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
1034
1028
|
var [DatePickerProvider, useDatePickerContext] = (0, import_pixel3_utils.usePixelCreateContext)("DatePickerContext");
|
|
1035
1029
|
|
|
1030
|
+
// src/utils/locale/en.ts
|
|
1031
|
+
var locale = {
|
|
1032
|
+
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
1033
|
+
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
1034
|
+
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
1035
|
+
weekdaysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1036
|
+
weekdaysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1037
|
+
firstDayOfWeek: 0,
|
|
1038
|
+
firstWeekContainsDate: 1
|
|
1039
|
+
};
|
|
1040
|
+
var en_default = locale;
|
|
1041
|
+
|
|
1036
1042
|
// src/modules/date-picker.locales.ts
|
|
1037
|
-
var import_en = __toESM(require("date-format-parse/lib/locale/en"));
|
|
1038
1043
|
var locales = {
|
|
1039
|
-
formatLocale:
|
|
1040
|
-
days:
|
|
1041
|
-
months:
|
|
1044
|
+
formatLocale: en_default,
|
|
1045
|
+
days: en_default.weekdaysMin,
|
|
1046
|
+
months: en_default.monthsShort,
|
|
1042
1047
|
yearFormat: "YYYY",
|
|
1043
1048
|
monthFormat: "MMM",
|
|
1044
1049
|
monthBeforeYear: true,
|
|
@@ -1064,7 +1069,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1064
1069
|
emit
|
|
1065
1070
|
}) {
|
|
1066
1071
|
const {
|
|
1067
|
-
locale
|
|
1072
|
+
locale: locale2
|
|
1068
1073
|
} = useDatePickerContext();
|
|
1069
1074
|
const restValue = (0, import_vue18.ref)(props.modelValue);
|
|
1070
1075
|
const {
|
|
@@ -1081,7 +1086,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1081
1086
|
getLabel,
|
|
1082
1087
|
changeMonth,
|
|
1083
1088
|
changeYear
|
|
1084
|
-
} = useCalendar(props.modelValue || props.defaultValue,
|
|
1089
|
+
} = useCalendar(props.modelValue || props.defaultValue, locale2);
|
|
1085
1090
|
function onSelectDate(date) {
|
|
1086
1091
|
currentPanelDate.value = date;
|
|
1087
1092
|
restValue.value = date;
|
|
@@ -1210,10 +1215,10 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1210
1215
|
return () => {
|
|
1211
1216
|
if (currentPanel.value === "date") {
|
|
1212
1217
|
return (0, import_vue17.createVNode)(TableDate, {
|
|
1213
|
-
"days":
|
|
1218
|
+
"days": locale2.value.days,
|
|
1214
1219
|
"dates": getDates.value,
|
|
1215
1220
|
"headerLabel": getLabel.value,
|
|
1216
|
-
"shortcutLabel":
|
|
1221
|
+
"shortcutLabel": locale2.value.todayText,
|
|
1217
1222
|
"onNext": nextMonth,
|
|
1218
1223
|
"onPrevious": previousMonth,
|
|
1219
1224
|
"onClickHeaderLabel": () => changePanel("year"),
|
|
@@ -1230,7 +1235,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1230
1235
|
"calendar": currentPanelDate.value,
|
|
1231
1236
|
"months": getMonths.value,
|
|
1232
1237
|
"headerLabel": getLabel.value,
|
|
1233
|
-
"shortcutLabel":
|
|
1238
|
+
"shortcutLabel": locale2.value.thisMonthText,
|
|
1234
1239
|
"onNext": nextYear,
|
|
1235
1240
|
"onPrevious": previousYear,
|
|
1236
1241
|
"onClickHeaderLabel": () => changePanel("year"),
|
|
@@ -1245,7 +1250,7 @@ var CalendarPanel = (0, import_vue18.defineComponent)({
|
|
|
1245
1250
|
return (0, import_vue17.createVNode)(TableYear, {
|
|
1246
1251
|
"years": getYears.value,
|
|
1247
1252
|
"headerLabel": getLabel.value,
|
|
1248
|
-
"shortcutLabel":
|
|
1253
|
+
"shortcutLabel": locale2.value.thisYearText,
|
|
1249
1254
|
"onNext": (year) => changeYear(year),
|
|
1250
1255
|
"onPrevious": (year) => changeYear(year),
|
|
1251
1256
|
"onSelect": onSelectYear,
|
|
@@ -1484,9 +1489,10 @@ var CalendarPanelRange = (0, import_vue18.defineComponent)({
|
|
|
1484
1489
|
"onUpdateCalendar": (value) => updateStartCalendar(value),
|
|
1485
1490
|
"calendar": calendars.value[0]
|
|
1486
1491
|
}), null);
|
|
1487
|
-
const rightNode = (0, import_vue17.createVNode)(CalendarPanel, (0, import_vue17.mergeProps)({
|
|
1492
|
+
const rightNode = props.isInline ? "" : (0, import_vue17.createVNode)(CalendarPanel, (0, import_vue17.mergeProps)({
|
|
1488
1493
|
"data-pixel-parts": "CalendarPanelRight"
|
|
1489
1494
|
}, calendarPanelAttrs, {
|
|
1495
|
+
"style": "margin-left: 16px;",
|
|
1490
1496
|
"onUpdateCalendar": (value) => updateEndCalendar(value),
|
|
1491
1497
|
"calendar": calendars.value[1]
|
|
1492
1498
|
}), null);
|
|
@@ -1561,7 +1567,7 @@ function useDatePicker(props, emit) {
|
|
|
1561
1567
|
}
|
|
1562
1568
|
return formatDate(innerValue.value);
|
|
1563
1569
|
});
|
|
1564
|
-
const
|
|
1570
|
+
const locale2 = (0, import_vue19.computed)(() => {
|
|
1565
1571
|
if (isObject(props.lang)) {
|
|
1566
1572
|
return getLocale(props.lang);
|
|
1567
1573
|
}
|
|
@@ -1652,14 +1658,14 @@ function useDatePicker(props, emit) {
|
|
|
1652
1658
|
function parseDate(value) {
|
|
1653
1659
|
const backupDate = /* @__PURE__ */ new Date();
|
|
1654
1660
|
return (0, import_date_format_parse.parse)(value, innerFormat.value, {
|
|
1655
|
-
locale:
|
|
1661
|
+
locale: locale2.value.formatLocale,
|
|
1656
1662
|
backupDate
|
|
1657
1663
|
});
|
|
1658
1664
|
}
|
|
1659
1665
|
__name(parseDate, "parseDate");
|
|
1660
1666
|
function formatDate(date) {
|
|
1661
1667
|
return (0, import_date_format_parse.format)(date, innerFormat.value, {
|
|
1662
|
-
locale:
|
|
1668
|
+
locale: locale2.value.formatLocale
|
|
1663
1669
|
});
|
|
1664
1670
|
}
|
|
1665
1671
|
__name(formatDate, "formatDate");
|
|
@@ -1737,7 +1743,7 @@ function useDatePicker(props, emit) {
|
|
|
1737
1743
|
onBlur,
|
|
1738
1744
|
handleForceFocusToInput,
|
|
1739
1745
|
text,
|
|
1740
|
-
locale,
|
|
1746
|
+
locale: locale2,
|
|
1741
1747
|
isInnerInvalid,
|
|
1742
1748
|
onEmitModelValue
|
|
1743
1749
|
};
|
|
@@ -1761,7 +1767,7 @@ var MpDatePicker = (0, import_vue21.defineComponent)({
|
|
|
1761
1767
|
text,
|
|
1762
1768
|
getId,
|
|
1763
1769
|
innerValue,
|
|
1764
|
-
locale,
|
|
1770
|
+
locale: locale2,
|
|
1765
1771
|
isOutside,
|
|
1766
1772
|
isPopoverOpen,
|
|
1767
1773
|
isInnerInvalid,
|
|
@@ -1774,7 +1780,7 @@ var MpDatePicker = (0, import_vue21.defineComponent)({
|
|
|
1774
1780
|
} = useDatePicker(props, emit);
|
|
1775
1781
|
DatePickerProvider({
|
|
1776
1782
|
rootProps: props,
|
|
1777
|
-
locale
|
|
1783
|
+
locale: locale2
|
|
1778
1784
|
});
|
|
1779
1785
|
return () => {
|
|
1780
1786
|
const {
|
|
@@ -1809,6 +1815,7 @@ var MpDatePicker = (0, import_vue21.defineComponent)({
|
|
|
1809
1815
|
});
|
|
1810
1816
|
const calendarPanelAttrs = {
|
|
1811
1817
|
type: props.type,
|
|
1818
|
+
isInline: props.isInline,
|
|
1812
1819
|
"onUpdate:modelValue": onEmitModelValue,
|
|
1813
1820
|
disabledDate: props.disabledDate,
|
|
1814
1821
|
disabledMonth: props.disabledMonth,
|
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MpDatePicker
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EYTJIMSM.mjs";
|
|
4
|
+
import "./chunk-KTADGCWP.mjs";
|
|
5
|
+
import "./chunk-XQLKPPRN.mjs";
|
|
6
6
|
import "./chunk-V6D6W7RO.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-NU6HYEPT.mjs";
|
|
8
8
|
import "./chunk-5PISTT2K.mjs";
|
|
9
9
|
import "./chunk-HJ4V3PM6.mjs";
|
|
10
10
|
import "./chunk-FTR7OMCT.mjs";
|
|
11
|
+
import "./chunk-J5BK7Z2U.mjs";
|
|
11
12
|
import "./chunk-AGAA7XTC.mjs";
|
|
12
13
|
import "./chunk-3VROFGJH.mjs";
|
|
13
14
|
import "./chunk-EQWT6VDG.mjs";
|
|
14
|
-
import "./chunk-J5BK7Z2U.mjs";
|
|
15
15
|
import "./chunk-NVULZQVI.mjs";
|
|
16
16
|
import "./chunk-JZ2KFYWF.mjs";
|
|
17
17
|
import "./chunk-VACMCDOZ.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-3RCUXNBN.mjs";
|
|
19
19
|
import "./chunk-26Y3AVJW.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-ZS4JQRK3.mjs";
|
|
21
|
+
import "./chunk-IZITNJFI.mjs";
|
|
21
22
|
import "./chunk-NIUQXHGQ.mjs";
|
|
22
23
|
import "./chunk-QZ7VFGWC.mjs";
|
|
23
24
|
export {
|