@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.
Files changed (103) hide show
  1. package/dist/calendar-panel.d.mts +231 -0
  2. package/dist/calendar-panel.d.ts +231 -0
  3. package/dist/calendar-panel.js +1498 -0
  4. package/dist/calendar-panel.mjs +25 -0
  5. package/dist/chunk-26Y3AVJW.mjs +115 -0
  6. package/dist/chunk-3VROFGJH.mjs +34 -0
  7. package/dist/chunk-3YYRUEIF.mjs +257 -0
  8. package/dist/chunk-5PISTT2K.mjs +131 -0
  9. package/dist/chunk-AGAA7XTC.mjs +20 -0
  10. package/dist/chunk-EJCSF5VR.mjs +492 -0
  11. package/dist/chunk-EQWT6VDG.mjs +34 -0
  12. package/dist/chunk-FTR7OMCT.mjs +0 -0
  13. package/dist/chunk-HJ4V3PM6.mjs +125 -0
  14. package/dist/chunk-J5BK7Z2U.mjs +46 -0
  15. package/dist/chunk-JZ2KFYWF.mjs +127 -0
  16. package/dist/chunk-LVCRFE25.mjs +153 -0
  17. package/dist/chunk-NIUQXHGQ.mjs +56 -0
  18. package/dist/chunk-NVULZQVI.mjs +119 -0
  19. package/dist/chunk-OY5PVQH5.mjs +31 -0
  20. package/dist/chunk-Q3Z5ZITX.mjs +155 -0
  21. package/dist/chunk-QZ7VFGWC.mjs +6 -0
  22. package/dist/chunk-V36XV4LV.mjs +129 -0
  23. package/dist/chunk-V6D6W7RO.mjs +0 -0
  24. package/dist/chunk-VACMCDOZ.mjs +8 -0
  25. package/dist/components/calendar/index.d.mts +11 -0
  26. package/dist/components/calendar/index.d.ts +11 -0
  27. package/dist/components/calendar/index.js +548 -0
  28. package/dist/components/calendar/index.mjs +23 -0
  29. package/dist/components/calendar/table-date.d.mts +97 -0
  30. package/dist/components/calendar/table-date.d.ts +97 -0
  31. package/dist/components/calendar/table-date.js +305 -0
  32. package/dist/components/calendar/table-date.mjs +13 -0
  33. package/dist/components/calendar/table-month.d.mts +90 -0
  34. package/dist/components/calendar/table-month.d.ts +90 -0
  35. package/dist/components/calendar/table-month.js +294 -0
  36. package/dist/components/calendar/table-month.mjs +14 -0
  37. package/dist/components/calendar/table-year.d.mts +71 -0
  38. package/dist/components/calendar/table-year.d.ts +71 -0
  39. package/dist/components/calendar/table-year.js +288 -0
  40. package/dist/components/calendar/table-year.mjs +14 -0
  41. package/dist/components/parts/date.d.mts +38 -0
  42. package/dist/components/parts/date.d.ts +38 -0
  43. package/dist/components/parts/date.js +70 -0
  44. package/dist/components/parts/date.mjs +7 -0
  45. package/dist/components/parts/day.d.mts +6 -0
  46. package/dist/components/parts/day.d.ts +6 -0
  47. package/dist/components/parts/day.js +44 -0
  48. package/dist/components/parts/day.mjs +7 -0
  49. package/dist/components/parts/index.d.mts +9 -0
  50. package/dist/components/parts/index.d.ts +9 -0
  51. package/dist/components/parts/index.js +157 -0
  52. package/dist/components/parts/index.mjs +20 -0
  53. package/dist/components/parts/month.d.mts +29 -0
  54. package/dist/components/parts/month.d.ts +29 -0
  55. package/dist/components/parts/month.js +58 -0
  56. package/dist/components/parts/month.mjs +7 -0
  57. package/dist/components/parts/year.d.mts +29 -0
  58. package/dist/components/parts/year.d.ts +29 -0
  59. package/dist/components/parts/year.js +58 -0
  60. package/dist/components/parts/year.mjs +7 -0
  61. package/dist/composables/useCalendar.d.mts +90 -0
  62. package/dist/composables/useCalendar.d.ts +90 -0
  63. package/dist/composables/useCalendar.js +184 -0
  64. package/dist/composables/useCalendar.mjs +8 -0
  65. package/dist/composables/useCalendarRange.d.mts +277 -0
  66. package/dist/composables/useCalendarRange.d.ts +277 -0
  67. package/dist/composables/useCalendarRange.js +160 -0
  68. package/dist/composables/useCalendarRange.mjs +8 -0
  69. package/dist/date-picker.d.mts +237 -0
  70. package/dist/date-picker.d.ts +237 -0
  71. package/dist/date-picker.js +1851 -0
  72. package/dist/date-picker.mjs +25 -0
  73. package/dist/index.d.mts +3 -0
  74. package/dist/index.d.ts +3 -0
  75. package/dist/index.js +1853 -0
  76. package/dist/index.mjs +25 -0
  77. package/dist/metafile-cjs.json +1 -0
  78. package/dist/metafile-esm.json +1 -0
  79. package/dist/modules/date-picker.context.d.mts +20 -0
  80. package/dist/modules/date-picker.context.d.ts +20 -0
  81. package/dist/modules/date-picker.context.js +33 -0
  82. package/dist/modules/date-picker.context.mjs +9 -0
  83. package/dist/modules/date-picker.hooks.d.mts +53 -0
  84. package/dist/modules/date-picker.hooks.d.ts +53 -0
  85. package/dist/modules/date-picker.hooks.js +337 -0
  86. package/dist/modules/date-picker.hooks.mjs +10 -0
  87. package/dist/modules/date-picker.locales.d.mts +27 -0
  88. package/dist/modules/date-picker.locales.d.ts +27 -0
  89. package/dist/modules/date-picker.locales.js +84 -0
  90. package/dist/modules/date-picker.locales.mjs +8 -0
  91. package/dist/modules/date-picker.props.d.mts +217 -0
  92. package/dist/modules/date-picker.props.d.ts +217 -0
  93. package/dist/modules/date-picker.props.js +181 -0
  94. package/dist/modules/date-picker.props.mjs +11 -0
  95. package/dist/utils/base.d.mts +20 -0
  96. package/dist/utils/base.d.ts +20 -0
  97. package/dist/utils/base.js +80 -0
  98. package/dist/utils/base.mjs +13 -0
  99. package/dist/utils/date.d.mts +19 -0
  100. package/dist/utils/date.d.ts +19 -0
  101. package/dist/utils/date.js +147 -0
  102. package/dist/utils/date.mjs +29 -0
  103. package/package.json +49 -0
@@ -0,0 +1,294 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/components/calendar/table-month.tsx
22
+ var table_month_exports = {};
23
+ __export(table_month_exports, {
24
+ TableMonth: () => TableMonth
25
+ });
26
+ module.exports = __toCommonJS(table_month_exports);
27
+ var import_vue9 = require("vue");
28
+ var import_vue10 = require("vue");
29
+ var import_pixel3_button = require("@mekari/pixel3-button");
30
+
31
+ // src/components/parts/date.tsx
32
+ var import_vue = require("vue");
33
+ var import_vue2 = require("vue");
34
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
35
+ var Date2 = (0, import_vue2.defineComponent)({
36
+ name: "Date",
37
+ props: {
38
+ status: {
39
+ type: String
40
+ },
41
+ isDisabled: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ isShowPinbar: {
46
+ type: Boolean,
47
+ default: false
48
+ }
49
+ },
50
+ setup(props, {
51
+ slots
52
+ }) {
53
+ return () => {
54
+ const dateItemClasses = (0, import_recipes.dateItemRecipe)({
55
+ status: props.status
56
+ });
57
+ const {
58
+ root,
59
+ pinbar
60
+ } = (0, import_recipes.pinbarSlotRecipe)();
61
+ return (0, import_vue.createVNode)("button", {
62
+ "disabled": props.isDisabled,
63
+ "data-status": props.status,
64
+ "class": dateItemClasses
65
+ }, [slots.default(), props.isShowPinbar && (0, import_vue.createVNode)("div", {
66
+ "class": root
67
+ }, [(0, import_vue.createVNode)("div", {
68
+ "class": pinbar
69
+ }, null)])]);
70
+ };
71
+ }
72
+ });
73
+
74
+ // src/components/parts/day.tsx
75
+ var import_vue3 = require("vue");
76
+ var import_vue4 = require("vue");
77
+ var import_recipes2 = require("@mekari/pixel3-styled-system/recipes");
78
+ var Day = (0, import_vue4.defineComponent)({
79
+ name: "Day",
80
+ setup(props, {
81
+ slots
82
+ }) {
83
+ return () => {
84
+ return (0, import_vue3.createVNode)("div", {
85
+ "class": (0, import_recipes2.dayItemRecipe)()
86
+ }, [slots.default()]);
87
+ };
88
+ }
89
+ });
90
+
91
+ // src/components/parts/month.tsx
92
+ var import_vue5 = require("vue");
93
+ var import_vue6 = require("vue");
94
+ var import_recipes3 = require("@mekari/pixel3-styled-system/recipes");
95
+ var Month = (0, import_vue6.defineComponent)({
96
+ name: "Month",
97
+ props: {
98
+ status: {
99
+ type: String
100
+ },
101
+ isDisabled: {
102
+ type: Boolean,
103
+ default: false
104
+ }
105
+ },
106
+ setup(props, {
107
+ slots
108
+ }) {
109
+ return () => {
110
+ const classes = (0, import_recipes3.monthItemRecipe)({
111
+ status: props.status
112
+ });
113
+ return (0, import_vue5.createVNode)("button", {
114
+ "disabled": props.isDisabled,
115
+ "data-status": props.status,
116
+ "class": classes
117
+ }, [slots.default()]);
118
+ };
119
+ }
120
+ });
121
+
122
+ // src/components/parts/year.tsx
123
+ var import_vue7 = require("vue");
124
+ var import_vue8 = require("vue");
125
+ var import_recipes4 = require("@mekari/pixel3-styled-system/recipes");
126
+ var YearItem = (0, import_vue8.defineComponent)({
127
+ name: "YearItem",
128
+ props: {
129
+ status: {
130
+ type: String
131
+ },
132
+ isDisabled: {
133
+ type: Boolean,
134
+ default: false
135
+ }
136
+ },
137
+ setup(props, {
138
+ slots
139
+ }) {
140
+ return () => {
141
+ const classes = (0, import_recipes4.yearItemRecipe)({
142
+ status: props.status
143
+ });
144
+ return (0, import_vue7.createVNode)("button", {
145
+ "disabled": props.isDisabled,
146
+ "data-status": props.status,
147
+ "class": classes
148
+ }, [slots.default()]);
149
+ };
150
+ }
151
+ });
152
+
153
+ // src/utils/base.ts
154
+ function chunk(arr, size) {
155
+ if (!Array.isArray(arr)) {
156
+ return [];
157
+ }
158
+ const result = [];
159
+ const len = arr.length;
160
+ let i = 0;
161
+ size = size || len;
162
+ while (i < len) {
163
+ result.push(arr.slice(i, i += size));
164
+ }
165
+ return result;
166
+ }
167
+ __name(chunk, "chunk");
168
+
169
+ // src/utils/date.ts
170
+ var import_date_fns = require("date-fns");
171
+ function createDate(y, M = 0, d = 1, h = 0, m = 0, s = 0, ms = 0) {
172
+ const date = new Date(y, M, d, h, m, s, ms);
173
+ if (y < 100 && y >= 0) {
174
+ date.setFullYear(y);
175
+ }
176
+ return date;
177
+ }
178
+ __name(createDate, "createDate");
179
+
180
+ // src/components/calendar/table-month.tsx
181
+ var import_recipes5 = require("@mekari/pixel3-styled-system/recipes");
182
+ var TableMonth = (0, import_vue10.defineComponent)({
183
+ name: "TableMonth",
184
+ props: {
185
+ calendar: {
186
+ type: Date,
187
+ default: () => /* @__PURE__ */ new Date()
188
+ },
189
+ months: {
190
+ type: Array,
191
+ default: () => []
192
+ },
193
+ headerLabel: {
194
+ type: String,
195
+ default: ""
196
+ },
197
+ shortcutLabel: {
198
+ type: String,
199
+ default: ""
200
+ },
201
+ getMonthStatus: {
202
+ type: Function,
203
+ default: () => {
204
+ }
205
+ },
206
+ isShowShortcut: {
207
+ type: Boolean
208
+ }
209
+ },
210
+ emits: ["next", "previous", "select", "clickHeaderLabel", "mouseEnter", "mouseLeave"],
211
+ setup(props, {
212
+ emit
213
+ }) {
214
+ const {
215
+ headerRoot,
216
+ headerLabel,
217
+ monthItemRoot,
218
+ monthItemWrapper,
219
+ shortcutLabelWrapper
220
+ } = (0, import_recipes5.tableMonthSlotRecipe)();
221
+ const getMonths = (0, import_vue10.computed)(() => {
222
+ return chunk(props.months, 3);
223
+ });
224
+ const getCalendarYear = (0, import_vue10.computed)(() => props.calendar.getFullYear());
225
+ function onNextButton() {
226
+ emit("next");
227
+ }
228
+ __name(onNextButton, "onNextButton");
229
+ function onPreviousButton() {
230
+ emit("previous", "previousMonth");
231
+ }
232
+ __name(onPreviousButton, "onPreviousButton");
233
+ function onSelectMonth(month, year) {
234
+ emit("select", month, year);
235
+ }
236
+ __name(onSelectMonth, "onSelectMonth");
237
+ function getMonthAttrs(month) {
238
+ const {
239
+ status,
240
+ isDisabled
241
+ } = props.getMonthStatus(month, getCalendarYear.value);
242
+ return {
243
+ status: isDisabled ? "disabled" : status,
244
+ isDisabled,
245
+ onClick: () => onSelectMonth(month, getCalendarYear.value),
246
+ onMouseenter: () => {
247
+ emit("mouseEnter", createDate(getCalendarYear.value, month));
248
+ },
249
+ onMouseleave: () => {
250
+ emit("mouseLeave");
251
+ }
252
+ };
253
+ }
254
+ __name(getMonthAttrs, "getMonthAttrs");
255
+ return () => {
256
+ return (0, import_vue9.createVNode)("div", null, [(0, import_vue9.createVNode)("div", {
257
+ "data-pixel-parts": "Header",
258
+ "class": headerRoot
259
+ }, [(0, import_vue9.createVNode)(import_pixel3_button.MpButton, {
260
+ "left-icon": "chevrons-left",
261
+ "variant": "ghost",
262
+ "size": "sm",
263
+ "onClick": onPreviousButton
264
+ }, null), (0, import_vue9.createVNode)("button", {
265
+ "class": headerLabel,
266
+ "onClick": () => emit("clickHeaderLabel")
267
+ }, [props.headerLabel]), (0, import_vue9.createVNode)(import_pixel3_button.MpButton, {
268
+ "right-icon": "chevrons-right",
269
+ "variant": "ghost",
270
+ "size": "sm",
271
+ "onClick": onNextButton
272
+ }, null)]), (0, import_vue9.createVNode)("div", {
273
+ "data-pixel-parts": "Content",
274
+ "class": monthItemRoot
275
+ }, [getMonths.value.map((data) => (0, import_vue9.createVNode)("div", {
276
+ "class": monthItemWrapper
277
+ }, [data.map((month) => (0, import_vue9.createVNode)(Month, getMonthAttrs(month.month), {
278
+ default: () => [" ", month.text, " "]
279
+ }))]))]), props.isShowShortcut && (0, import_vue9.createVNode)("div", {
280
+ "data-pixel-parts": "Shortcut",
281
+ "class": shortcutLabelWrapper
282
+ }, [(0, import_vue9.createVNode)(import_pixel3_button.MpButton, {
283
+ "variant": "ghost",
284
+ "onClick": () => onSelectMonth((/* @__PURE__ */ new Date()).getMonth(), getCalendarYear.value)
285
+ }, {
286
+ default: () => [props.shortcutLabel]
287
+ })])]);
288
+ };
289
+ }
290
+ });
291
+ // Annotate the CommonJS export names for ESM import in node:
292
+ 0 && (module.exports = {
293
+ TableMonth
294
+ });
@@ -0,0 +1,14 @@
1
+ import {
2
+ TableMonth
3
+ } from "../../chunk-5PISTT2K.mjs";
4
+ import "../../chunk-FTR7OMCT.mjs";
5
+ import "../../chunk-AGAA7XTC.mjs";
6
+ import "../../chunk-3VROFGJH.mjs";
7
+ import "../../chunk-EQWT6VDG.mjs";
8
+ import "../../chunk-J5BK7Z2U.mjs";
9
+ import "../../chunk-26Y3AVJW.mjs";
10
+ import "../../chunk-NIUQXHGQ.mjs";
11
+ import "../../chunk-QZ7VFGWC.mjs";
12
+ export {
13
+ TableMonth
14
+ };
@@ -0,0 +1,71 @@
1
+ import * as vue from 'vue';
2
+ import { PropType } from 'vue';
3
+ import * as vue_jsx_runtime from 'vue/jsx-runtime';
4
+ import { YearVariants } from '../parts/year.mjs';
5
+ import '@mekari/pixel3-styled-system/types';
6
+ import '@mekari/pixel3-styled-system/css';
7
+ import '@mekari/pixel3-styled-system/recipes';
8
+
9
+ declare const TableYear: vue.DefineComponent<{
10
+ years: {
11
+ type: PropType<number[]>;
12
+ default: () => never[];
13
+ };
14
+ headerLabel: {
15
+ type: PropType<string>;
16
+ default: string;
17
+ };
18
+ shortcutLabel: {
19
+ type: PropType<string>;
20
+ default: string;
21
+ };
22
+ getYearStatus: {
23
+ type: PropType<(date: number) => {
24
+ status: YearVariants['status'];
25
+ isDisabled: boolean;
26
+ }>;
27
+ default: () => void;
28
+ };
29
+ isShowShortcut: {
30
+ type: PropType<boolean>;
31
+ };
32
+ }, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("mouseEnter" | "mouseLeave" | "next" | "previous" | "select")[], "mouseEnter" | "mouseLeave" | "next" | "previous" | "select", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
33
+ years: {
34
+ type: PropType<number[]>;
35
+ default: () => never[];
36
+ };
37
+ headerLabel: {
38
+ type: PropType<string>;
39
+ default: string;
40
+ };
41
+ shortcutLabel: {
42
+ type: PropType<string>;
43
+ default: string;
44
+ };
45
+ getYearStatus: {
46
+ type: PropType<(date: number) => {
47
+ status: YearVariants['status'];
48
+ isDisabled: boolean;
49
+ }>;
50
+ default: () => void;
51
+ };
52
+ isShowShortcut: {
53
+ type: PropType<boolean>;
54
+ };
55
+ }>> & {
56
+ onMouseEnter?: ((...args: any[]) => any) | undefined;
57
+ onMouseLeave?: ((...args: any[]) => any) | undefined;
58
+ onNext?: ((...args: any[]) => any) | undefined;
59
+ onPrevious?: ((...args: any[]) => any) | undefined;
60
+ onSelect?: ((...args: any[]) => any) | undefined;
61
+ }, {
62
+ getYearStatus: (date: number) => {
63
+ status: YearVariants['status'];
64
+ isDisabled: boolean;
65
+ };
66
+ headerLabel: string;
67
+ shortcutLabel: string;
68
+ years: number[];
69
+ }, {}>;
70
+
71
+ export { TableYear };
@@ -0,0 +1,71 @@
1
+ import * as vue from 'vue';
2
+ import { PropType } from 'vue';
3
+ import * as vue_jsx_runtime from 'vue/jsx-runtime';
4
+ import { YearVariants } from '../parts/year.js';
5
+ import '@mekari/pixel3-styled-system/types';
6
+ import '@mekari/pixel3-styled-system/css';
7
+ import '@mekari/pixel3-styled-system/recipes';
8
+
9
+ declare const TableYear: vue.DefineComponent<{
10
+ years: {
11
+ type: PropType<number[]>;
12
+ default: () => never[];
13
+ };
14
+ headerLabel: {
15
+ type: PropType<string>;
16
+ default: string;
17
+ };
18
+ shortcutLabel: {
19
+ type: PropType<string>;
20
+ default: string;
21
+ };
22
+ getYearStatus: {
23
+ type: PropType<(date: number) => {
24
+ status: YearVariants['status'];
25
+ isDisabled: boolean;
26
+ }>;
27
+ default: () => void;
28
+ };
29
+ isShowShortcut: {
30
+ type: PropType<boolean>;
31
+ };
32
+ }, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("mouseEnter" | "mouseLeave" | "next" | "previous" | "select")[], "mouseEnter" | "mouseLeave" | "next" | "previous" | "select", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
33
+ years: {
34
+ type: PropType<number[]>;
35
+ default: () => never[];
36
+ };
37
+ headerLabel: {
38
+ type: PropType<string>;
39
+ default: string;
40
+ };
41
+ shortcutLabel: {
42
+ type: PropType<string>;
43
+ default: string;
44
+ };
45
+ getYearStatus: {
46
+ type: PropType<(date: number) => {
47
+ status: YearVariants['status'];
48
+ isDisabled: boolean;
49
+ }>;
50
+ default: () => void;
51
+ };
52
+ isShowShortcut: {
53
+ type: PropType<boolean>;
54
+ };
55
+ }>> & {
56
+ onMouseEnter?: ((...args: any[]) => any) | undefined;
57
+ onMouseLeave?: ((...args: any[]) => any) | undefined;
58
+ onNext?: ((...args: any[]) => any) | undefined;
59
+ onPrevious?: ((...args: any[]) => any) | undefined;
60
+ onSelect?: ((...args: any[]) => any) | undefined;
61
+ }, {
62
+ getYearStatus: (date: number) => {
63
+ status: YearVariants['status'];
64
+ isDisabled: boolean;
65
+ };
66
+ headerLabel: string;
67
+ shortcutLabel: string;
68
+ years: number[];
69
+ }, {}>;
70
+
71
+ export { TableYear };