mehdi-akbari-calendar 0.1.0 → 0.1.3
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/components/Calendar/Calendar.d.ts +11 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/internal/CalendarHeader.d.ts +12 -0
- package/dist/components/internal/CalendarHeader.d.ts.map +1 -0
- package/dist/components/internal/DayCell.d.ts +16 -0
- package/dist/components/internal/DayCell.d.ts.map +1 -0
- package/dist/components/internal/MonthPickerView.d.ts +11 -0
- package/dist/components/internal/MonthPickerView.d.ts.map +1 -0
- package/dist/components/internal/MonthView.d.ts +17 -0
- package/dist/components/internal/MonthView.d.ts.map +1 -0
- package/dist/components/internal/YearView.d.ts +10 -0
- package/dist/components/internal/YearView.d.ts.map +1 -0
- package/dist/hooks/useCalendar.d.ts +37 -0
- package/dist/hooks/useCalendar.d.ts.map +1 -0
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -9
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +0 -18
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +7 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/dateAdapter.d.ts +36 -0
- package/dist/utils/dateAdapter.d.ts.map +1 -0
- package/package.json +27 -23
- package/dist/index.d.mts +0 -11
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DateRange } from '../../types';
|
|
3
|
+
import type { UseCalendarOptions } from '../../hooks/useCalendar';
|
|
4
|
+
export type { DateRange };
|
|
5
|
+
export interface PersianCalendarProps extends Omit<UseCalendarOptions, 'range'> {
|
|
6
|
+
onDateSelect?: (date: Date | null) => void;
|
|
7
|
+
range?: DateRange;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const PersianCalendar: React.FC<PersianCalendarProps>;
|
|
11
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,YAAY,EAAE,SAAS,EAAE,CAAC;AAS1B,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAC7E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuF1D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CalendarHeaderProps {
|
|
3
|
+
title: string;
|
|
4
|
+
calendarType: 'jalali' | 'gregorian';
|
|
5
|
+
onToggleCalendarType: () => void;
|
|
6
|
+
onNext: () => void;
|
|
7
|
+
onPrev: () => void;
|
|
8
|
+
onTitleClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const CalendarHeader: React.FC<CalendarHeaderProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=CalendarHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarHeader.d.ts","sourceRoot":"","sources":["../../../src/components/internal/CalendarHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkC1B,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,QAAQ,GAAG,WAAW,CAAC;IACrC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiCxD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateFunctions } from '../../utils/dateAdapter';
|
|
3
|
+
export interface DayCellProps {
|
|
4
|
+
date: Date;
|
|
5
|
+
isCurrentMonth: boolean;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
isToday: boolean;
|
|
8
|
+
isInRange?: boolean;
|
|
9
|
+
isRangeStart?: boolean;
|
|
10
|
+
isRangeEnd?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
onClick: (date: Date) => void;
|
|
13
|
+
dateFns: DateFunctions;
|
|
14
|
+
}
|
|
15
|
+
export declare const DayCell: React.FC<DayCellProps>;
|
|
16
|
+
//# sourceMappingURL=DayCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayCell.d.ts","sourceRoot":"","sources":["../../../src/components/internal/DayCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,IAAI,CAAC;IACX,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IAEjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9B,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAqC1C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateFunctions } from '../../utils/dateAdapter';
|
|
3
|
+
interface MonthPickerViewProps {
|
|
4
|
+
months: Date[];
|
|
5
|
+
onSelectMonth: (monthIndex: number) => void;
|
|
6
|
+
isCurrentMonth: (monthIndex: number) => boolean;
|
|
7
|
+
dateFns: DateFunctions;
|
|
8
|
+
}
|
|
9
|
+
export declare const MonthPickerView: React.FC<MonthPickerViewProps>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=MonthPickerView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonthPickerView.d.ts","sourceRoot":"","sources":["../../../src/components/internal/MonthPickerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAChD,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuB1D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateFunctions } from '../../utils/dateAdapter';
|
|
3
|
+
interface MonthViewProps {
|
|
4
|
+
daysOfMonth: Date[];
|
|
5
|
+
weekDays: string[];
|
|
6
|
+
dateFns: DateFunctions;
|
|
7
|
+
onSelectDate: (date: Date) => void;
|
|
8
|
+
isDateSelected: (date: Date) => boolean;
|
|
9
|
+
isInRange: (date: Date) => boolean;
|
|
10
|
+
isRangeStart: (date: Date) => boolean;
|
|
11
|
+
isRangeEnd: (date: Date) => boolean;
|
|
12
|
+
isSameMonthAsCurrent: (date: Date) => boolean;
|
|
13
|
+
isToday: (date: Date) => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const MonthView: React.FC<MonthViewProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=MonthView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonthView.d.ts","sourceRoot":"","sources":["../../../src/components/internal/MonthView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,UAAU,cAAc;IACtB,WAAW,EAAE,IAAI,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAExC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACnC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACtC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACpC,oBAAoB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAC9C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAwC9C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface YearViewProps {
|
|
3
|
+
years: number[];
|
|
4
|
+
onSelectYear: (year: number) => void;
|
|
5
|
+
isCurrentYear: (year: number) => boolean;
|
|
6
|
+
isYearDisabled: (year: number) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const YearView: React.FC<YearViewProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=YearView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YearView.d.ts","sourceRoot":"","sources":["../../../src/components/internal/YearView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3C;AAGD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8B5C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CalendarViewMode, DateRange, CalendarType } from '../types';
|
|
2
|
+
export interface UseCalendarOptions {
|
|
3
|
+
initialDate?: Date;
|
|
4
|
+
minYear?: number;
|
|
5
|
+
maxYear?: number;
|
|
6
|
+
initialCalendarType?: CalendarType;
|
|
7
|
+
range?: DateRange;
|
|
8
|
+
}
|
|
9
|
+
export declare const useCalendar: ({ initialDate, minYear, maxYear, initialCalendarType, range }?: UseCalendarOptions) => {
|
|
10
|
+
viewMode: CalendarViewMode;
|
|
11
|
+
currentDate: Date;
|
|
12
|
+
selectedDate: Date | null;
|
|
13
|
+
daysOfMonth: Date[];
|
|
14
|
+
monthsOfYear: Date[];
|
|
15
|
+
yearsOfDecade: number[];
|
|
16
|
+
headerTitle: string;
|
|
17
|
+
calendarType: CalendarType;
|
|
18
|
+
weekDays: string[];
|
|
19
|
+
dateFns: import("../utils/dateAdapter").DateFunctions;
|
|
20
|
+
toggleCalendarType: () => void;
|
|
21
|
+
goToNext: () => void;
|
|
22
|
+
goToPrev: () => void;
|
|
23
|
+
handleSelectDay: (date: Date) => void;
|
|
24
|
+
handleSelectMonth: (monthIndex: number) => void;
|
|
25
|
+
handleSelectYear: (year: number) => void;
|
|
26
|
+
handleHeaderClick: () => void;
|
|
27
|
+
isSameMonthAsCurrent: (date: Date) => boolean;
|
|
28
|
+
isDateSelected: (date: Date) => boolean;
|
|
29
|
+
isInRange: (date: Date) => boolean;
|
|
30
|
+
isRangeStart: (date: Date) => boolean;
|
|
31
|
+
isRangeEnd: (date: Date) => boolean;
|
|
32
|
+
isToday: (date: Date) => boolean;
|
|
33
|
+
isCurrentMonth: (monthIndex: number) => boolean;
|
|
34
|
+
isCurrentYear: (year: number) => boolean;
|
|
35
|
+
isYearDisabled: (year: number) => boolean;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=useCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalendar.d.ts","sourceRoot":"","sources":["../../src/hooks/useCalendar.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAS1E,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,GAAI,gEAMzB,kBAAuB;;;;;;;;;;;;;;4BAoDmB,IAAI;oCAOI,MAAM;6BAKb,MAAM;;iCAiEnB,IAAI;2BAlDO,IAAI,KAAG,OAAO;sBAQnB,IAAI,KAAG,OAAO;yBAKX,IAAI,KAAG,OAAO;uBAIhB,IAAI,KAAG,OAAO;oBAsClC,IAAI;iCACS,MAAM;0BACb,MAAM;2BACL,MAAM;CAEhC,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var index_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(index_exports);
|
|
19
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// src/index.ts\r\n\r\n/**\r\n * This is the main entry point for non-React functionalities and types.\r\n * It allows users to import types or utility functions without pulling in React.\r\n */\r\n\r\nexport * from \"./types\";\r\n\r\n// In the future, you could also export utility functions from here:\r\n// export * from \"./utils/dateAdapter\";"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* This is the main entry point for non-React functionalities and types.
|
|
3
|
+
* It allows users to import types or utility functions without pulling in React.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
to: Date | null;
|
|
7
|
-
}
|
|
8
|
-
type CalendarType = 'jalali' | 'gregorian';
|
|
9
|
-
type CalendarViewMode = 'day' | 'month' | 'year';
|
|
10
|
-
|
|
11
|
-
export type { CalendarType, CalendarViewMode, DateRange };
|
|
5
|
+
export * from "./types";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/index.ts
|
|
17
|
-
var index_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(index_exports);
|
|
19
1
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the entry point for React components.
|
|
3
|
+
* It exports the main PersianCalendar component and its related types.
|
|
4
|
+
*/
|
|
5
|
+
export { PersianCalendar, type PersianCalendarProps } from "./components/Calendar/Calendar";
|
|
6
|
+
export * from "./types";
|
|
7
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAG5F,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a date range with a start and end date.
|
|
3
|
+
*/
|
|
4
|
+
export interface DateRange {
|
|
5
|
+
from: Date | null;
|
|
6
|
+
to: Date | null;
|
|
7
|
+
}
|
|
8
|
+
export type CalendarType = 'jalali' | 'gregorian';
|
|
9
|
+
export type CalendarViewMode = 'day' | 'month' | 'year';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CalendarType } from '../types';
|
|
2
|
+
export interface DateFunctions {
|
|
3
|
+
startOfMonth: (date: Date) => Date;
|
|
4
|
+
endOfMonth: (date: Date) => Date;
|
|
5
|
+
startOfWeek: (date: Date) => Date;
|
|
6
|
+
endOfWeek: (date: Date) => Date;
|
|
7
|
+
eachDayOfInterval: (interval: {
|
|
8
|
+
start: Date;
|
|
9
|
+
end: Date;
|
|
10
|
+
}) => Date[];
|
|
11
|
+
isSameMonth: (dateLeft: Date, dateRight: Date) => boolean;
|
|
12
|
+
isSameDay: (dateLeft: Date, dateRight: Date) => boolean;
|
|
13
|
+
format: (date: Date, formatStr: string) => string;
|
|
14
|
+
addMonths: (date: Date, amount: number) => Date;
|
|
15
|
+
subMonths: (date: Date, amount: number) => Date;
|
|
16
|
+
getYear: (date: Date) => number;
|
|
17
|
+
setYear: (date: Date, year: number) => Date;
|
|
18
|
+
getMonth: (date: Date) => number;
|
|
19
|
+
setMonth: (date: Date, month: number) => Date;
|
|
20
|
+
startOfYear: (date: Date) => Date;
|
|
21
|
+
eachMonthOfInterval: (interval: {
|
|
22
|
+
start: Date;
|
|
23
|
+
end: Date;
|
|
24
|
+
}) => Date[];
|
|
25
|
+
endOfYear: (date: Date) => Date;
|
|
26
|
+
addYears: (date: Date, amount: number) => Date;
|
|
27
|
+
subYears: (date: Date, amount: number) => Date;
|
|
28
|
+
isDate: (value: any) => boolean;
|
|
29
|
+
isWithinInterval: (date: Date, interval: {
|
|
30
|
+
start: Date;
|
|
31
|
+
end: Date;
|
|
32
|
+
}) => boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const getDateFunctions: (type: CalendarType) => DateFunctions;
|
|
35
|
+
export declare const getWeekDays: (type: CalendarType) => string[];
|
|
36
|
+
//# sourceMappingURL=dateAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateAdapter.d.ts","sourceRoot":"","sources":["../../src/utils/dateAdapter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK7C,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,iBAAiB,EAAE,CAAC,QAAQ,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,KAAK,IAAI,EAAE,CAAC;IACpE,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC;IAC1D,SAAS,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC;IACxD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC,mBAAmB,EAAE,CAAC,QAAQ,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,KAAK,IAAI,EAAE,CAAC;IACtE,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;IAChC,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC;CACjF;AAED,eAAO,MAAM,gBAAgB,GAAI,MAAM,YAAY,KAAG,aAiCrD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,aAM7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mehdi-akbari-calendar",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A professional and customizable Persian (Jalali) calendar component for React.",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"module": "./dist/index.mjs",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
"README.md",
|
|
11
|
-
"LICENSE"
|
|
10
|
+
"dist"
|
|
12
11
|
],
|
|
13
12
|
"exports": {
|
|
14
13
|
".": {
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
}
|
|
18
22
|
},
|
|
19
23
|
"./react": {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./dist/index.react.d.ts",
|
|
26
|
+
"default": "./dist/index.react.mjs"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./dist/index.react.d.ts",
|
|
30
|
+
"default": "./dist/index.react.js"
|
|
31
|
+
}
|
|
24
32
|
},
|
|
25
33
|
"./styles.css": "./dist/styles.css"
|
|
26
34
|
},
|
|
27
35
|
"scripts": {
|
|
28
|
-
"
|
|
36
|
+
"clean": "npx rimraf dist",
|
|
37
|
+
"build:js": "tsup",
|
|
38
|
+
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
39
|
+
"build": "npm run clean && npm run build:js && npm run build:types && copyfiles -u 1 src/styles.css dist",
|
|
29
40
|
"dev": "tsup --watch",
|
|
30
|
-
"prepublishOnly": "npm run build"
|
|
31
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
41
|
+
"prepublishOnly": "npm run build"
|
|
32
42
|
},
|
|
33
43
|
"peerDependencies": {
|
|
34
44
|
"react": ">=18",
|
|
@@ -43,8 +53,10 @@
|
|
|
43
53
|
"@types/react": "^18.3.3",
|
|
44
54
|
"@types/react-dom": "^18.3.0",
|
|
45
55
|
"copyfiles": "^2.4.1",
|
|
56
|
+
"npx": "^10.2.2",
|
|
46
57
|
"react": "^18.3.1",
|
|
47
58
|
"react-dom": "^18.3.1",
|
|
59
|
+
"rimraf": "^5.0.7",
|
|
48
60
|
"tsup": "^8.1.0",
|
|
49
61
|
"typescript": "^5.4.5"
|
|
50
62
|
},
|
|
@@ -57,13 +69,5 @@
|
|
|
57
69
|
"ui-component"
|
|
58
70
|
],
|
|
59
71
|
"author": "Mehdi Akbari",
|
|
60
|
-
"license": "MIT"
|
|
61
|
-
"homepage": "https://github.com/your-username/persian-react-calendar#readme",
|
|
62
|
-
"repository": {
|
|
63
|
-
"type": "git",
|
|
64
|
-
"url": "git+https://github.com/your-username/persian-react-calendar.git"
|
|
65
|
-
},
|
|
66
|
-
"bugs": {
|
|
67
|
-
"url": "https://github.com/your-username/persian-react-calendar/issues"
|
|
68
|
-
}
|
|
72
|
+
"license": "MIT"
|
|
69
73
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a date range with a start and end date.
|
|
3
|
-
*/
|
|
4
|
-
interface DateRange {
|
|
5
|
-
from: Date | null;
|
|
6
|
-
to: Date | null;
|
|
7
|
-
}
|
|
8
|
-
type CalendarType = 'jalali' | 'gregorian';
|
|
9
|
-
type CalendarViewMode = 'day' | 'month' | 'year';
|
|
10
|
-
|
|
11
|
-
export type { CalendarType, CalendarViewMode, DateRange };
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|