zaman-backoffice 1.0.4 → 1.2.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/components/CalendarItem/CalendarItem.styled.d.ts +10 -10
- package/dist/components/CalendarItem/CalendarItem.types.d.ts +7 -7
- package/dist/components/CalendarItem/index.d.ts +1 -1
- package/dist/components/CalendarWrapper/CalendarWrapper.styled.d.ts +5 -5
- package/dist/components/CalendarWrapper/index.d.ts +1 -1
- package/dist/components/FloatingElement/FloatingElement.d.ts +4 -4
- package/dist/components/FloatingElement/FloatingElement.styled.d.ts +4 -4
- package/dist/components/FloatingElement/FloatingElement.types.d.ts +7 -7
- package/dist/components/FloatingElement/index.d.ts +1 -1
- package/dist/components/Header/Header.d.ts +4 -3
- package/dist/components/Header/Header.styled.d.ts +12 -12
- package/dist/components/Header/Header.types.d.ts +6 -6
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -2
- package/dist/components/IconButton/IconButton.styled.d.ts +4 -4
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/Icons/ChevronLeft/index.d.ts +3 -2
- package/dist/components/Icons/ChevronRight/index.d.ts +3 -2
- package/dist/components/Modal/Modal.d.ts +4 -3
- package/dist/components/Modal/Modal.styled.d.ts +4 -4
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/types.d.ts +6 -6
- package/dist/components/MonthPicker/Month.styled.d.ts +4 -4
- package/dist/components/MonthPicker/MonthPicker.d.ts +4 -3
- package/dist/components/MonthPicker/MonthPicker.types.d.ts +4 -4
- package/dist/components/MonthPicker/index.d.ts +1 -1
- package/dist/components/RenderCalendar/RenderCalendar.d.ts +4 -3
- package/dist/components/RenderCalendar/RenderCalendar.types.d.ts +9 -9
- package/dist/components/RenderCalendar/index.d.ts +1 -1
- package/dist/components/YearPicker/YearPicker.d.ts +4 -3
- package/dist/components/YearPicker/YearPicker.styled.d.ts +4 -4
- package/dist/components/YearPicker/YearPicker.types.d.ts +4 -4
- package/dist/components/YearPicker/index.d.ts +1 -1
- package/dist/constants.d.ts +5 -5
- package/dist/hooks/useCalendarHandlers.d.ts +20 -19
- package/dist/hooks/useClickOutside.d.ts +3 -3
- package/dist/hooks/useSlideCalendar.d.ts +13 -12
- package/dist/hooks/useTimePicker.d.ts +19 -19
- package/dist/index.cjs.js +41 -41
- package/dist/index.d.ts +4 -4
- package/dist/index.js +28 -28
- package/dist/packages/Calendar/Calendar.d.ts +4 -4
- package/dist/packages/Calendar/Calendar.styled.d.ts +20 -20
- package/dist/packages/Calendar/Calendar.types.d.ts +21 -19
- package/dist/packages/Calendar/index.d.ts +2 -2
- package/dist/packages/CalendarProvider/CalendarProvider.d.ts +4 -3
- package/dist/packages/CalendarProvider/CalendarProvider.types.d.ts +5 -5
- package/dist/packages/CalendarProvider/index.d.ts +2 -2
- package/dist/packages/DatePicker/DatePicker.d.ts +4 -3
- package/dist/packages/DatePicker/DatePicker.types.d.ts +15 -15
- package/dist/packages/DatePicker/index.d.ts +2 -2
- package/dist/packages/TimePicker/TimePicker.d.ts +4 -3
- package/dist/packages/TimePicker/TimePicker.styled.d.ts +37 -37
- package/dist/packages/TimePicker/TimePicker.types.d.ts +14 -14
- package/dist/packages/TimePicker/components/Numbers/Numbers.d.ts +4 -3
- package/dist/packages/TimePicker/components/Numbers/Numbers.styled.d.ts +9 -9
- package/dist/packages/TimePicker/components/Numbers/Numbers.types.d.ts +13 -13
- package/dist/packages/TimePicker/components/Numbers/index.d.ts +1 -1
- package/dist/packages/TimePicker/index.d.ts +2 -2
- package/dist/style/animation.d.ts +12 -2
- package/dist/style/classNames.d.ts +7 -7
- package/dist/style/colorPallete.d.ts +1 -1
- package/dist/style/colors.d.ts +5 -5
- package/dist/style/hexToHSL.d.ts +6 -6
- package/dist/style/radius.d.ts +7 -7
- package/dist/types.d.ts +41 -41
- package/dist/utils/dateHelper/dateHelper.d.ts +15 -15
- package/dist/utils/dateHelper/index.d.ts +1 -1
- package/dist/utils/dateTimeFormat/dateTimeFormat.d.ts +13 -13
- package/dist/utils/dateTimeFormat/index.d.ts +1 -1
- package/dist/utils/format/format.d.ts +4 -4
- package/dist/utils/format/format.types.d.ts +10 -10
- package/dist/utils/format/index.d.ts +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/locale.d.ts +6 -6
- package/dist/utils/locales/en.d.ts +3 -3
- package/dist/utils/locales/fa.d.ts +3 -3
- package/dist/utils/locales/index.d.ts +3 -3
- package/dist/utils/locales/locales.types.d.ts +12 -12
- package/dist/utils/month/index.d.ts +1 -1
- package/dist/utils/month/month.d.ts +5 -5
- package/dist/utils/month/month.types.d.ts +10 -10
- package/dist/utils/timePicker.d.ts +36 -36
- package/package.json +5 -5
@@ -1,14 +1,14 @@
|
|
1
|
-
import type { InputHTMLAttributes } from 'react';
|
2
|
-
import type { BaseProps, DatePickerValue } from '../../types';
|
3
|
-
export interface onChangePayload {
|
4
|
-
hour: number;
|
5
|
-
minute: number;
|
6
|
-
timeConvention?: 'am' | 'pm';
|
7
|
-
}
|
8
|
-
export interface TimePickerProps extends BaseProps {
|
9
|
-
defaultValue?: DatePickerValue;
|
10
|
-
clockTime?: 12 | 24;
|
11
|
-
onChange?: (payload: onChangePayload) => void;
|
12
|
-
inputClass?: string;
|
13
|
-
inputAttributes?: InputHTMLAttributes<HTMLInputElement>;
|
14
|
-
}
|
1
|
+
import type { InputHTMLAttributes } from 'react';
|
2
|
+
import type { BaseProps, DatePickerValue } from '../../types';
|
3
|
+
export interface onChangePayload {
|
4
|
+
hour: number;
|
5
|
+
minute: number;
|
6
|
+
timeConvention?: 'am' | 'pm';
|
7
|
+
}
|
8
|
+
export interface TimePickerProps extends BaseProps {
|
9
|
+
defaultValue?: DatePickerValue;
|
10
|
+
clockTime?: 12 | 24;
|
11
|
+
onChange?: (payload: onChangePayload) => void;
|
12
|
+
inputClass?: string;
|
13
|
+
inputAttributes?: InputHTMLAttributes<HTMLInputElement>;
|
14
|
+
}
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
export
|
1
|
+
import React from 'react';
|
2
|
+
import type { NumbersProps } from './Numbers.types';
|
3
|
+
export declare const Hours: (props: NumbersProps) => React.JSX.Element;
|
4
|
+
export default Hours;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { NumbersItemProps } from './Numbers.types';
|
2
|
-
export declare const MinuteWithAnimation: import("@emotion/styled").StyledComponent<{
|
3
|
-
theme?: import("@emotion/react").Theme
|
4
|
-
as?:
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
6
|
-
export declare const NumbersItem: import("@emotion/styled").StyledComponent<{
|
7
|
-
theme?: import("@emotion/react").Theme
|
8
|
-
as?:
|
9
|
-
} & NumbersItemProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
1
|
+
import type { NumbersItemProps } from './Numbers.types';
|
2
|
+
export declare const MinuteWithAnimation: import("@emotion/styled").StyledComponent<{
|
3
|
+
theme?: import("@emotion/react").Theme;
|
4
|
+
as?: React.ElementType;
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
6
|
+
export declare const NumbersItem: import("@emotion/styled").StyledComponent<{
|
7
|
+
theme?: import("@emotion/react").Theme;
|
8
|
+
as?: React.ElementType;
|
9
|
+
} & NumbersItemProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
@@ -1,13 +1,13 @@
|
|
1
|
-
export interface NumbersProps {
|
2
|
-
insideHour: boolean;
|
3
|
-
hourSelecting: boolean;
|
4
|
-
clockTime: 12 | 24;
|
5
|
-
}
|
6
|
-
export interface NumbersItemProps {
|
7
|
-
idx: number;
|
8
|
-
clockHalfWidth?: number;
|
9
|
-
numbersPadd?: number;
|
10
|
-
top?: string;
|
11
|
-
insideHour?: boolean;
|
12
|
-
isSelectedNumber?: boolean;
|
13
|
-
}
|
1
|
+
export interface NumbersProps {
|
2
|
+
insideHour: boolean;
|
3
|
+
hourSelecting: boolean;
|
4
|
+
clockTime: 12 | 24;
|
5
|
+
}
|
6
|
+
export interface NumbersItemProps {
|
7
|
+
idx: number;
|
8
|
+
clockHalfWidth?: number;
|
9
|
+
numbersPadd?: number;
|
10
|
+
top?: string;
|
11
|
+
insideHour?: boolean;
|
12
|
+
isSelectedNumber?: boolean;
|
13
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './Numbers';
|
1
|
+
export { default } from './Numbers';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { default } from './TimePicker';
|
2
|
-
export type { TimePickerProps } from './TimePicker.types';
|
1
|
+
export { default } from './TimePicker';
|
2
|
+
export type { TimePickerProps } from './TimePicker.types';
|
@@ -1,2 +1,12 @@
|
|
1
|
-
export declare const slideDown:
|
2
|
-
|
1
|
+
export declare const slideDown: {
|
2
|
+
name: string;
|
3
|
+
styles: string;
|
4
|
+
anim: 1;
|
5
|
+
toString: () => string;
|
6
|
+
} & string;
|
7
|
+
export declare const fade: {
|
8
|
+
name: string;
|
9
|
+
styles: string;
|
10
|
+
anim: 1;
|
11
|
+
toString: () => string;
|
12
|
+
} & string;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export declare const MonthYearButton = "zm-MonthYearButton";
|
2
|
-
export declare const IconNextButton = "zm-IconNextButton";
|
3
|
-
export declare const IconPrevButton = "zm-IconPrevButton";
|
4
|
-
export declare const HeaderClass = "zm-Header";
|
5
|
-
export declare const DaysButton = "zm-DaysButton";
|
6
|
-
export declare const MonthPickerButton = "zm-MonthPickerButton";
|
7
|
-
export declare const YearPickerButton = "zm-YearPickerButton";
|
1
|
+
export declare const MonthYearButton = "zm-MonthYearButton";
|
2
|
+
export declare const IconNextButton = "zm-IconNextButton";
|
3
|
+
export declare const IconPrevButton = "zm-IconPrevButton";
|
4
|
+
export declare const HeaderClass = "zm-Header";
|
5
|
+
export declare const DaysButton = "zm-DaysButton";
|
6
|
+
export declare const MonthPickerButton = "zm-MonthPickerButton";
|
7
|
+
export declare const YearPickerButton = "zm-YearPickerButton";
|
@@ -1 +1 @@
|
|
1
|
-
export declare const makeColorPallet: (accentColor: string) => Record<number, string>;
|
1
|
+
export declare const makeColorPallet: (accentColor: string) => Record<number, string>;
|
package/dist/style/colors.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export declare const gray: Record<number, string>;
|
2
|
-
declare const _default: {
|
3
|
-
gray: Record<number, string>;
|
4
|
-
};
|
5
|
-
export default _default;
|
1
|
+
export declare const gray: Record<number, string>;
|
2
|
+
declare const _default: {
|
3
|
+
gray: Record<number, string>;
|
4
|
+
};
|
5
|
+
export default _default;
|
package/dist/style/hexToHSL.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export declare function hexToHSL(hex: string): {
|
2
|
-
h: number;
|
3
|
-
s: number;
|
4
|
-
l: number;
|
5
|
-
};
|
6
|
-
export default hexToHSL;
|
1
|
+
export declare function hexToHSL(hex: string): {
|
2
|
+
h: number;
|
3
|
+
s: number;
|
4
|
+
l: number;
|
5
|
+
};
|
6
|
+
export default hexToHSL;
|
package/dist/style/radius.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
export type Radius = 'thin' | 'x1' | 'x2' | 'x3' | 'x4';
|
2
|
-
interface radiusObject {
|
3
|
-
wrapper: number;
|
4
|
-
calendarItem: number;
|
5
|
-
}
|
6
|
-
export declare const radius: Record<Radius, radiusObject>;
|
7
|
-
export {};
|
1
|
+
export type Radius = 'thin' | 'x1' | 'x2' | 'x3' | 'x4';
|
2
|
+
interface radiusObject {
|
3
|
+
wrapper: number;
|
4
|
+
calendarItem: number;
|
5
|
+
}
|
6
|
+
export declare const radius: Record<Radius, radiusObject>;
|
7
|
+
export {};
|
package/dist/types.d.ts
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
import '@emotion/react';
|
2
|
-
import type { Radius } from './style/radius';
|
3
|
-
export type DatePickerValue = number | Date | string;
|
4
|
-
export type Locales = 'fa' | 'en';
|
5
|
-
export type Directions = 'rtl' | 'ltr';
|
6
|
-
export type DaysRange = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
7
|
-
export type Pickers = 'days' | 'year' | 'month';
|
8
|
-
export type Positions = 'right' | 'left' | 'center';
|
9
|
-
export interface BaseProps {
|
10
|
-
round?: Radius;
|
11
|
-
accentColor?: string;
|
12
|
-
locale?: Locales;
|
13
|
-
direction?: Directions;
|
14
|
-
}
|
15
|
-
export interface onDatePickerChangePayload {
|
16
|
-
value: Date;
|
17
|
-
}
|
18
|
-
export interface onRangeDatePickerChangePayload {
|
19
|
-
from: Date;
|
20
|
-
to: Date;
|
21
|
-
}
|
22
|
-
interface MyProps1 {
|
23
|
-
range: true;
|
24
|
-
myMethod: (arg: onRangeDatePickerChangePayload) => void;
|
25
|
-
}
|
26
|
-
interface MyProps2 {
|
27
|
-
range: false;
|
28
|
-
myMethod: (arg: onDatePickerChangePayload) => void;
|
29
|
-
}
|
30
|
-
export type CalendarTypeProps = MyProps1 | MyProps2;
|
31
|
-
declare module '@emotion/react' {
|
32
|
-
interface Theme {
|
33
|
-
colors: {
|
34
|
-
gray: Record<number, string>;
|
35
|
-
primary: Record<number, string>;
|
36
|
-
};
|
37
|
-
round: Radius;
|
38
|
-
direction: Directions;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
export {};
|
1
|
+
import '@emotion/react';
|
2
|
+
import type { Radius } from './style/radius';
|
3
|
+
export type DatePickerValue = number | Date | string;
|
4
|
+
export type Locales = 'fa' | 'en';
|
5
|
+
export type Directions = 'rtl' | 'ltr';
|
6
|
+
export type DaysRange = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
7
|
+
export type Pickers = 'days' | 'year' | 'month';
|
8
|
+
export type Positions = 'right' | 'left' | 'center';
|
9
|
+
export interface BaseProps {
|
10
|
+
round?: Radius;
|
11
|
+
accentColor?: string;
|
12
|
+
locale?: Locales;
|
13
|
+
direction?: Directions;
|
14
|
+
}
|
15
|
+
export interface onDatePickerChangePayload {
|
16
|
+
value: Date;
|
17
|
+
}
|
18
|
+
export interface onRangeDatePickerChangePayload {
|
19
|
+
from: Date;
|
20
|
+
to: Date;
|
21
|
+
}
|
22
|
+
interface MyProps1 {
|
23
|
+
range: true;
|
24
|
+
myMethod: (arg: onRangeDatePickerChangePayload) => void;
|
25
|
+
}
|
26
|
+
interface MyProps2 {
|
27
|
+
range: false;
|
28
|
+
myMethod: (arg: onDatePickerChangePayload) => void;
|
29
|
+
}
|
30
|
+
export type CalendarTypeProps = MyProps1 | MyProps2;
|
31
|
+
declare module '@emotion/react' {
|
32
|
+
interface Theme {
|
33
|
+
colors: {
|
34
|
+
gray: Record<number, string>;
|
35
|
+
primary: Record<number, string>;
|
36
|
+
};
|
37
|
+
round: Radius;
|
38
|
+
direction: Directions;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
export {};
|
@@ -1,15 +1,15 @@
|
|
1
|
-
export declare const sameMonth: (date: Date, date2: Date) => boolean;
|
2
|
-
export declare const sameDay: (date?: Date, date2?: Date) => boolean;
|
3
|
-
export declare const getYears: (date: Date, from?: number, to?: number) => number[];
|
4
|
-
export declare const selectMonth: (date: Date, selectedMonth: number) => Date;
|
5
|
-
export declare const selectYear: (date: Date, selectedYear: number) => Date;
|
6
|
-
export declare const isInBetween: (day: Date, from?: Date | null, to?: Date | null) => boolean;
|
7
|
-
declare const _default: {
|
8
|
-
sameMonth: (date: Date, date2: Date) => boolean;
|
9
|
-
sameDay: (date?: Date
|
10
|
-
getYears: (date: Date, from?: number, to?: number) => number[];
|
11
|
-
selectMonth: (date: Date, selectedMonth: number) => Date;
|
12
|
-
selectYear: (date: Date, selectedYear: number) => Date;
|
13
|
-
isInBetween: (day: Date, from?: Date | null
|
14
|
-
};
|
15
|
-
export default _default;
|
1
|
+
export declare const sameMonth: (date: Date, date2: Date) => boolean;
|
2
|
+
export declare const sameDay: (date?: Date, date2?: Date) => boolean;
|
3
|
+
export declare const getYears: (date: Date, from?: number, to?: number) => number[];
|
4
|
+
export declare const selectMonth: (date: Date, selectedMonth: number) => Date;
|
5
|
+
export declare const selectYear: (date: Date, selectedYear: number) => Date;
|
6
|
+
export declare const isInBetween: (day: Date, from?: Date | null, to?: Date | null) => boolean;
|
7
|
+
declare const _default: {
|
8
|
+
sameMonth: (date: Date, date2: Date) => boolean;
|
9
|
+
sameDay: (date?: Date, date2?: Date) => boolean;
|
10
|
+
getYears: (date: Date, from?: number, to?: number) => number[];
|
11
|
+
selectMonth: (date: Date, selectedMonth: number) => Date;
|
12
|
+
selectYear: (date: Date, selectedYear: number) => Date;
|
13
|
+
isInBetween: (day: Date, from?: Date | null, to?: Date | null) => boolean;
|
14
|
+
};
|
15
|
+
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './dateHelper';
|
1
|
+
export { default } from './dateHelper';
|
@@ -1,13 +1,13 @@
|
|
1
|
-
export declare const getDateFormat: (date: Date, options: Intl.DateTimeFormatOptions, numberingSystem?: string) => string;
|
2
|
-
export declare const getDayOfMonth: (date: Date) => number;
|
3
|
-
export declare const getDayString: (date: Date, numberingSystem?: string) => string;
|
4
|
-
export declare const getYear: (date: Date, numberingSystem?: string) => string;
|
5
|
-
export declare const getYear2Digit: (date: Date, numberingSystem?: string) => string;
|
6
|
-
export declare const getMonthName: (date: Date, numberingSystem?: string) => string;
|
7
|
-
export declare const getMonth: (date: Date, numberingSystem?: string) => string;
|
8
|
-
declare const _default: {
|
9
|
-
getDayOfMonth: (date: Date) => number;
|
10
|
-
getMonth: (date: Date, numberingSystem?: string
|
11
|
-
getMonthName: (date: Date, numberingSystem?: string
|
12
|
-
};
|
13
|
-
export default _default;
|
1
|
+
export declare const getDateFormat: (date: Date, options: Intl.DateTimeFormatOptions, numberingSystem?: string) => string;
|
2
|
+
export declare const getDayOfMonth: (date: Date) => number;
|
3
|
+
export declare const getDayString: (date: Date, numberingSystem?: string) => string;
|
4
|
+
export declare const getYear: (date: Date, numberingSystem?: string) => string;
|
5
|
+
export declare const getYear2Digit: (date: Date, numberingSystem?: string) => string;
|
6
|
+
export declare const getMonthName: (date: Date, numberingSystem?: string) => string;
|
7
|
+
export declare const getMonth: (date: Date, numberingSystem?: string) => string;
|
8
|
+
declare const _default: {
|
9
|
+
getDayOfMonth: (date: Date) => number;
|
10
|
+
getMonth: (date: Date, numberingSystem?: string) => string;
|
11
|
+
getMonthName: (date: Date, numberingSystem?: string) => string;
|
12
|
+
};
|
13
|
+
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './dateTimeFormat';
|
1
|
+
export { default } from './dateTimeFormat';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { type formatFunctions, type Formats } from './format.types';
|
2
|
-
export declare const formats: Record<Formats, formatFunctions>;
|
3
|
-
export declare const formatDate: (date: Date, format: string, numberingSystem?: string) => string;
|
4
|
-
export default formatDate;
|
1
|
+
import { type formatFunctions, type Formats } from './format.types';
|
2
|
+
export declare const formats: Record<Formats, formatFunctions>;
|
3
|
+
export declare const formatDate: (date: Date, format: string, numberingSystem?: string) => string;
|
4
|
+
export default formatDate;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
export type formatFunctions = (date: Date, numberingSystem?: string) => string;
|
2
|
-
export declare enum Formats {
|
3
|
-
M = "M",
|
4
|
-
MM = "MM",
|
5
|
-
MMMM = "MMMM",
|
6
|
-
YY = "YY",
|
7
|
-
YYYY = "YYYY",
|
8
|
-
DD = "DD",
|
9
|
-
D = "D"
|
10
|
-
}
|
1
|
+
export type formatFunctions = (date: Date, numberingSystem?: string) => string;
|
2
|
+
export declare enum Formats {
|
3
|
+
M = "M",
|
4
|
+
MM = "MM",
|
5
|
+
MMMM = "MMMM",
|
6
|
+
YY = "YY",
|
7
|
+
YYYY = "YYYY",
|
8
|
+
DD = "DD",
|
9
|
+
D = "D"
|
10
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './format';
|
1
|
+
export { default } from './format';
|
package/dist/utils/index.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export declare const isRtl: () => boolean;
|
2
|
-
export declare const localizeNumber: (n: string | number) => string | number;
|
3
|
-
export declare const weekDayNames: string[];
|
1
|
+
export declare const isRtl: () => boolean;
|
2
|
+
export declare const localizeNumber: (n: string | number) => string | number;
|
3
|
+
export declare const weekDayNames: string[];
|
package/dist/utils/locale.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
declare const localeCache: {
|
2
|
-
localeDefault: string;
|
3
|
-
setLocale(locale?: string): void;
|
4
|
-
readonly locale: string;
|
5
|
-
};
|
6
|
-
export default localeCache;
|
1
|
+
declare const localeCache: {
|
2
|
+
localeDefault: string;
|
3
|
+
setLocale(locale?: string): void;
|
4
|
+
readonly locale: string;
|
5
|
+
};
|
6
|
+
export default localeCache;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type { LocalesTypes } from './locales.types';
|
2
|
-
export declare const en: LocalesTypes;
|
3
|
-
export default en;
|
1
|
+
import type { LocalesTypes } from './locales.types';
|
2
|
+
export declare const en: LocalesTypes;
|
3
|
+
export default en;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type { LocalesTypes } from './locales.types';
|
2
|
-
export declare const fa: LocalesTypes;
|
3
|
-
export default fa;
|
1
|
+
import type { LocalesTypes } from './locales.types';
|
2
|
+
export declare const fa: LocalesTypes;
|
3
|
+
export default fa;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type { LocalesTypes } from './locales.types';
|
2
|
-
declare const locales: Record<string, LocalesTypes>;
|
3
|
-
export default locales;
|
1
|
+
import type { LocalesTypes } from './locales.types';
|
2
|
+
declare const locales: Record<string, LocalesTypes>;
|
3
|
+
export default locales;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
interface localesNames {
|
2
|
-
key: number;
|
3
|
-
name: string;
|
4
|
-
}
|
5
|
-
export interface LocalesTypes {
|
6
|
-
shortWeekDays: localesNames[];
|
7
|
-
months: localesNames[];
|
8
|
-
format: string;
|
9
|
-
am: string;
|
10
|
-
pm: string;
|
11
|
-
}
|
12
|
-
export {};
|
1
|
+
interface localesNames {
|
2
|
+
key: number;
|
3
|
+
name: string;
|
4
|
+
}
|
5
|
+
export interface LocalesTypes {
|
6
|
+
shortWeekDays: localesNames[];
|
7
|
+
months: localesNames[];
|
8
|
+
format: string;
|
9
|
+
am: string;
|
10
|
+
pm: string;
|
11
|
+
}
|
12
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './month';
|
1
|
+
export { default } from './month';
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import 'dayjs/locale/fa';
|
2
|
-
import type { DaysInMonth } from './month.types';
|
3
|
-
import { type DatePickerValue } from '../../types';
|
4
|
-
declare const getDays: (date: DatePickerValue | undefined) => DaysInMonth;
|
5
|
-
export default getDays;
|
1
|
+
import 'dayjs/locale/fa';
|
2
|
+
import type { DaysInMonth } from './month.types';
|
3
|
+
import { type DatePickerValue } from '../../types';
|
4
|
+
declare const getDays: (date: DatePickerValue | undefined) => DaysInMonth;
|
5
|
+
export default getDays;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
export interface WeekDays {
|
2
|
-
date: Date;
|
3
|
-
disabled: boolean;
|
4
|
-
}
|
5
|
-
export interface DaysInMonth {
|
6
|
-
id: number;
|
7
|
-
monthName: string;
|
8
|
-
middleOfMonth: Date;
|
9
|
-
weeks: WeekDays[][];
|
10
|
-
}
|
1
|
+
export interface WeekDays {
|
2
|
+
date: Date;
|
3
|
+
disabled: boolean;
|
4
|
+
}
|
5
|
+
export interface DaysInMonth {
|
6
|
+
id: number;
|
7
|
+
monthName: string;
|
8
|
+
middleOfMonth: Date;
|
9
|
+
weeks: WeekDays[][];
|
10
|
+
}
|
@@ -1,36 +1,36 @@
|
|
1
|
-
import type React from 'react';
|
2
|
-
/**
|
3
|
-
* numberPosition functions
|
4
|
-
* These functions find position X-axis and Y-axis from half of the clock width
|
5
|
-
* Its start from 30 deg and each time this degree increase as much as 30 deg
|
6
|
-
*/
|
7
|
-
export declare function numberPositionX(idx: number, width?: number, padding?: number): number;
|
8
|
-
export declare function numberPositionY(idx: number, width?: number, padding?: number): number;
|
9
|
-
export declare const center: {
|
10
|
-
x: number;
|
11
|
-
y: number;
|
12
|
-
};
|
13
|
-
export declare const radianToDeg: (rad: number) => number;
|
14
|
-
export declare const calculateOffset: (elem: unknown) => {
|
15
|
-
offsetX: number;
|
16
|
-
offsetY: number;
|
17
|
-
};
|
18
|
-
export declare const getValue: (deg: number, delta: number, steps: number) => number;
|
19
|
-
/**
|
20
|
-
* calculate the value from where the mouse clicked or tapped
|
21
|
-
* step1: calculate deg from the center of the circle not (0, 0)
|
22
|
-
* step1-1: calculate deg with atan2 but instead of using atan2 in this way (y, x) -
|
23
|
-
* I used atan2(x, y) because atan2(y, x) get an angel from (0, 0) not the center of the circle
|
24
|
-
* step-2: decrease atan2 by Math.PI because- * this function returns two degrees that one of them is valid and another isn't. like 90 deg and -90deg and -90deg should be 270
|
25
|
-
* step3: delta: determine the distance of each place that is clicked by the user. calculating the distance between the center of the circle
|
26
|
-
* step4: make value by division deg into the hour or minutes angles. in the hour is 30 deg and in minutes is 6 deg
|
27
|
-
*/
|
28
|
-
interface IGetAngelValues {
|
29
|
-
value: number;
|
30
|
-
delta: number;
|
31
|
-
}
|
32
|
-
export declare const getAngelValues: (e: React.MouseEvent | React.TouchEvent, steps?: number) => IGetAngelValues;
|
33
|
-
export declare const hours: number[];
|
34
|
-
export declare const hours24: number[];
|
35
|
-
export declare const minutes: number[];
|
36
|
-
export {};
|
1
|
+
import type React from 'react';
|
2
|
+
/**
|
3
|
+
* numberPosition functions
|
4
|
+
* These functions find position X-axis and Y-axis from half of the clock width
|
5
|
+
* Its start from 30 deg and each time this degree increase as much as 30 deg
|
6
|
+
*/
|
7
|
+
export declare function numberPositionX(idx: number, width?: number, padding?: number): number;
|
8
|
+
export declare function numberPositionY(idx: number, width?: number, padding?: number): number;
|
9
|
+
export declare const center: {
|
10
|
+
x: number;
|
11
|
+
y: number;
|
12
|
+
};
|
13
|
+
export declare const radianToDeg: (rad: number) => number;
|
14
|
+
export declare const calculateOffset: (elem: unknown) => {
|
15
|
+
offsetX: number;
|
16
|
+
offsetY: number;
|
17
|
+
};
|
18
|
+
export declare const getValue: (deg: number, delta: number, steps: number) => number;
|
19
|
+
/**
|
20
|
+
* calculate the value from where the mouse clicked or tapped
|
21
|
+
* step1: calculate deg from the center of the circle not (0, 0)
|
22
|
+
* step1-1: calculate deg with atan2 but instead of using atan2 in this way (y, x) -
|
23
|
+
* I used atan2(x, y) because atan2(y, x) get an angel from (0, 0) not the center of the circle
|
24
|
+
* step-2: decrease atan2 by Math.PI because- * this function returns two degrees that one of them is valid and another isn't. like 90 deg and -90deg and -90deg should be 270
|
25
|
+
* step3: delta: determine the distance of each place that is clicked by the user. calculating the distance between the center of the circle
|
26
|
+
* step4: make value by division deg into the hour or minutes angles. in the hour is 30 deg and in minutes is 6 deg
|
27
|
+
*/
|
28
|
+
interface IGetAngelValues {
|
29
|
+
value: number;
|
30
|
+
delta: number;
|
31
|
+
}
|
32
|
+
export declare const getAngelValues: (e: React.MouseEvent | React.TouchEvent, steps?: number) => IGetAngelValues;
|
33
|
+
export declare const hours: number[];
|
34
|
+
export declare const hours24: number[];
|
35
|
+
export declare const minutes: number[];
|
36
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "zaman-backoffice",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "thanks to the zaman team. just needed to add the ability to have a controlled input value",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"scripts": {
|
@@ -9,14 +9,13 @@
|
|
9
9
|
"test": "NODE_ENV=test jest",
|
10
10
|
"test:watch": "NODE_ENV=test jest --watchAll",
|
11
11
|
"test:update": "NODE_ENV=test jest -- -u",
|
12
|
-
"build": "
|
12
|
+
"build": "rimraf dist && rollup -c --bundleConfigAsCjs",
|
13
13
|
"dev": "vite",
|
14
14
|
"watch": "rollup -c rollup.config.js -w",
|
15
15
|
"lint:fix": "eslint --fix src",
|
16
16
|
"format": "prettier src --write",
|
17
17
|
"prepare": "husky install"
|
18
18
|
},
|
19
|
-
|
20
19
|
"keywords": [
|
21
20
|
"datepicker",
|
22
21
|
"farsi",
|
@@ -25,7 +24,6 @@
|
|
25
24
|
],
|
26
25
|
"author": "ali zakerinia",
|
27
26
|
"license": "MIT",
|
28
|
-
|
29
27
|
"devDependencies": {
|
30
28
|
"@babel/core": "^7.21.0",
|
31
29
|
"@babel/preset-env": "^7.20.2",
|
@@ -65,6 +63,7 @@
|
|
65
63
|
"prettier": "^3.1.1",
|
66
64
|
"react": "^18.2.0",
|
67
65
|
"react-dom": "^18.2.0",
|
66
|
+
"rimraf": "^6.0.1",
|
68
67
|
"rollup": "^3.15.0",
|
69
68
|
"rollup-plugin-esbuild": "^5.0.0",
|
70
69
|
"ts-jest": "^29.0.5",
|
@@ -75,6 +74,7 @@
|
|
75
74
|
"dependencies": {
|
76
75
|
"@emotion/react": "^11.10.5",
|
77
76
|
"@emotion/styled": "^11.10.5",
|
78
|
-
"dayjs": "^1.11.7"
|
77
|
+
"dayjs": "^1.11.7",
|
78
|
+
"lodash": "^4.17.21"
|
79
79
|
}
|
80
80
|
}
|