react-native-bikram-sambat 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -213
- package/lib/commonjs/accessibility/labels.js +1 -2
- package/lib/commonjs/accessibility/labels.js.map +1 -1
- package/lib/commonjs/components/NepaliCalendar/CalendarDay.js +8 -41
- package/lib/commonjs/components/NepaliCalendar/CalendarDay.js.map +1 -1
- package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js +7 -24
- package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js.map +1 -1
- package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js +18 -6
- package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js.map +1 -1
- package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js +93 -61
- package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js.map +1 -1
- package/lib/commonjs/index.js +0 -22
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theme/default-theme.js +2 -22
- package/lib/commonjs/theme/default-theme.js.map +1 -1
- package/lib/commonjs/utils/date-helpers.js +0 -8
- package/lib/commonjs/utils/date-helpers.js.map +1 -1
- package/lib/module/accessibility/labels.js +1 -2
- package/lib/module/accessibility/labels.js.map +1 -1
- package/lib/module/components/NepaliCalendar/CalendarDay.js +8 -41
- package/lib/module/components/NepaliCalendar/CalendarDay.js.map +1 -1
- package/lib/module/components/NepaliCalendar/CalendarGrid.js +7 -24
- package/lib/module/components/NepaliCalendar/CalendarGrid.js.map +1 -1
- package/lib/module/components/NepaliCalendar/CalendarHeader.js +18 -6
- package/lib/module/components/NepaliCalendar/CalendarHeader.js.map +1 -1
- package/lib/module/components/NepaliCalendar/NepaliCalendar.js +96 -64
- package/lib/module/components/NepaliCalendar/NepaliCalendar.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/theme/default-theme.js +2 -22
- package/lib/module/theme/default-theme.js.map +1 -1
- package/lib/module/utils/date-helpers.js +0 -8
- package/lib/module/utils/date-helpers.js.map +1 -1
- package/lib/typescript/src/accessibility/labels.d.ts +1 -1
- package/lib/typescript/src/accessibility/labels.d.ts.map +1 -1
- package/lib/typescript/src/components/NepaliCalendar/CalendarDay.d.ts +1 -5
- package/lib/typescript/src/components/NepaliCalendar/CalendarDay.d.ts.map +1 -1
- package/lib/typescript/src/components/NepaliCalendar/CalendarGrid.d.ts +1 -4
- package/lib/typescript/src/components/NepaliCalendar/CalendarGrid.d.ts.map +1 -1
- package/lib/typescript/src/components/NepaliCalendar/CalendarHeader.d.ts +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/NepaliCalendar/NepaliCalendar.d.ts +1 -1
- package/lib/typescript/src/components/NepaliCalendar/NepaliCalendar.d.ts.map +1 -1
- package/lib/typescript/src/components/NepaliCalendar/types.d.ts +6 -10
- package/lib/typescript/src/components/NepaliCalendar/types.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/default-theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/types.d.ts +0 -10
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/date-helpers.d.ts +0 -4
- package/lib/typescript/src/utils/date-helpers.d.ts.map +1 -1
- package/package.json +2 -6
- package/src/accessibility/labels.ts +0 -2
- package/src/components/NepaliCalendar/CalendarDay.tsx +6 -65
- package/src/components/NepaliCalendar/CalendarGrid.tsx +12 -32
- package/src/components/NepaliCalendar/CalendarHeader.tsx +18 -2
- package/src/components/NepaliCalendar/NepaliCalendar.tsx +128 -56
- package/src/components/NepaliCalendar/types.ts +3 -12
- package/src/index.ts +0 -2
- package/src/theme/default-theme.ts +0 -20
- package/src/theme/types.ts +0 -10
- package/src/utils/date-helpers.ts +0 -12
- package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js +0 -185
- package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js.map +0 -1
- package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js +0 -148
- package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js.map +0 -1
- package/lib/commonjs/components/NepaliDatePicker/index.js +0 -20
- package/lib/commonjs/components/NepaliDatePicker/index.js.map +0 -1
- package/lib/commonjs/components/NepaliDatePicker/types.js +0 -6
- package/lib/commonjs/components/NepaliDatePicker/types.js.map +0 -1
- package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js +0 -187
- package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js.map +0 -1
- package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js +0 -275
- package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js.map +0 -1
- package/lib/commonjs/components/NepaliRangePicker/index.js +0 -57
- package/lib/commonjs/components/NepaliRangePicker/index.js.map +0 -1
- package/lib/commonjs/components/NepaliRangePicker/range-utils.js +0 -70
- package/lib/commonjs/components/NepaliRangePicker/range-utils.js.map +0 -1
- package/lib/commonjs/components/NepaliRangePicker/types.js +0 -6
- package/lib/commonjs/components/NepaliRangePicker/types.js.map +0 -1
- package/lib/module/components/NepaliDatePicker/DatePickerModal.js +0 -180
- package/lib/module/components/NepaliDatePicker/DatePickerModal.js.map +0 -1
- package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js +0 -143
- package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js.map +0 -1
- package/lib/module/components/NepaliDatePicker/index.js +0 -5
- package/lib/module/components/NepaliDatePicker/index.js.map +0 -1
- package/lib/module/components/NepaliDatePicker/types.js +0 -4
- package/lib/module/components/NepaliDatePicker/types.js.map +0 -1
- package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js +0 -182
- package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js.map +0 -1
- package/lib/module/components/NepaliRangePicker/RangePickerModal.js +0 -270
- package/lib/module/components/NepaliRangePicker/RangePickerModal.js.map +0 -1
- package/lib/module/components/NepaliRangePicker/index.js +0 -6
- package/lib/module/components/NepaliRangePicker/index.js.map +0 -1
- package/lib/module/components/NepaliRangePicker/range-utils.js +0 -61
- package/lib/module/components/NepaliRangePicker/range-utils.js.map +0 -1
- package/lib/module/components/NepaliRangePicker/types.js +0 -4
- package/lib/module/components/NepaliRangePicker/types.js.map +0 -1
- package/lib/typescript/src/components/NepaliDatePicker/DatePickerModal.d.ts +0 -4
- package/lib/typescript/src/components/NepaliDatePicker/DatePickerModal.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliDatePicker/NepaliDatePicker.d.ts +0 -4
- package/lib/typescript/src/components/NepaliDatePicker/NepaliDatePicker.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliDatePicker/index.d.ts +0 -4
- package/lib/typescript/src/components/NepaliDatePicker/index.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliDatePicker/types.d.ts +0 -50
- package/lib/typescript/src/components/NepaliDatePicker/types.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliRangePicker/NepaliRangePicker.d.ts +0 -4
- package/lib/typescript/src/components/NepaliRangePicker/NepaliRangePicker.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliRangePicker/RangePickerModal.d.ts +0 -4
- package/lib/typescript/src/components/NepaliRangePicker/RangePickerModal.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliRangePicker/index.d.ts +0 -5
- package/lib/typescript/src/components/NepaliRangePicker/index.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliRangePicker/range-utils.d.ts +0 -13
- package/lib/typescript/src/components/NepaliRangePicker/range-utils.d.ts.map +0 -1
- package/lib/typescript/src/components/NepaliRangePicker/types.d.ts +0 -61
- package/lib/typescript/src/components/NepaliRangePicker/types.d.ts.map +0 -1
- package/src/components/NepaliDatePicker/DatePickerModal.tsx +0 -220
- package/src/components/NepaliDatePicker/NepaliDatePicker.tsx +0 -171
- package/src/components/NepaliDatePicker/index.ts +0 -3
- package/src/components/NepaliDatePicker/types.ts +0 -70
- package/src/components/NepaliRangePicker/NepaliRangePicker.tsx +0 -206
- package/src/components/NepaliRangePicker/RangePickerModal.tsx +0 -336
- package/src/components/NepaliRangePicker/index.ts +0 -11
- package/src/components/NepaliRangePicker/range-utils.ts +0 -75
- package/src/components/NepaliRangePicker/types.ts +0 -84
|
@@ -48,13 +48,9 @@ function compareBSDate(a, b) {
|
|
|
48
48
|
}
|
|
49
49
|
export function createDateAccessibilityLabel(date, locale, options) {
|
|
50
50
|
const {
|
|
51
|
-
selected,
|
|
52
51
|
today,
|
|
53
52
|
disabled,
|
|
54
53
|
outsideMonth,
|
|
55
|
-
rangeStart,
|
|
56
|
-
rangeEnd,
|
|
57
|
-
inRange,
|
|
58
54
|
markedLabel
|
|
59
55
|
} = options;
|
|
60
56
|
const parts = [];
|
|
@@ -65,10 +61,6 @@ export function createDateAccessibilityLabel(date, locale, options) {
|
|
|
65
61
|
} catch {
|
|
66
62
|
parts.push(`${date.year}/${date.month}/${date.day}`);
|
|
67
63
|
}
|
|
68
|
-
if (rangeStart) parts.push('range start');
|
|
69
|
-
if (rangeEnd) parts.push('range end');
|
|
70
|
-
if (inRange && !rangeStart && !rangeEnd) parts.push('in selected range');
|
|
71
|
-
if (selected && !inRange) parts.push('selected');
|
|
72
64
|
if (today) parts.push('today');
|
|
73
65
|
if (disabled) parts.push('disabled');
|
|
74
66
|
if (outsideMonth) parts.push('outside month');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["formatBS","isValidBSDate","isBSDateInSupportedRange","getDefaultSupportedBSDate","safeFormatBSDate","date","pattern","locale","numerals","getSafeInitialBSDate","value","defaultValue","isDateDisabled","options","minDate","maxDate","disabledDates","dateKey","compareBSDate","Array","isArray","includes","a","b","year","month","day","createDateAccessibilityLabel","
|
|
1
|
+
{"version":3,"names":["formatBS","isValidBSDate","isBSDateInSupportedRange","getDefaultSupportedBSDate","safeFormatBSDate","date","pattern","locale","numerals","getSafeInitialBSDate","value","defaultValue","isDateDisabled","options","minDate","maxDate","disabledDates","dateKey","compareBSDate","Array","isArray","includes","a","b","year","month","day","createDateAccessibilityLabel","today","disabled","outsideMonth","markedLabel","parts","push","join","warnInvalidDateInDev","message","__DEV__","console","warn","warnOutOfRangeInDev","range","dateStr","String","padStart","min","max","warnMinMaxInDev"],"sourceRoot":"../../../src","sources":["utils/date-helpers.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,EAAEC,wBAAwB,EAAEC,yBAAyB,QAAQ,oBAAoB;AAGvG,OAAO,SAASC,gBAAgBA,CAC9BC,IAAoC,EACpCC,OAAe,EACfC,MAAoC,EACpCC,QAAwB,EACT;EACf,IAAI,CAACH,IAAI,EAAE,OAAO,IAAI;EACtB,IAAI,CAACJ,aAAa,CAACI,IAAI,CAAC,EAAE,OAAO,IAAI;EACrC,IAAI,CAACH,wBAAwB,CAACG,IAAI,CAAC,EAAE,OAAO,IAAI;EAEhD,IAAI;IACF,OAAOL,QAAQ,CAACK,IAAI,EAAEC,OAAO,EAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,CAAC;EACtD,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF;AAEA,OAAO,SAASC,oBAAoBA,CAClCC,KAAqC,EACrCC,YAAqC,EACxB;EACb,IAAID,KAAK,IAAIT,aAAa,CAACS,KAAK,CAAC,IAAIR,wBAAwB,CAACQ,KAAK,CAAC,EAAE;IACpE,OAAOA,KAAK;EACd;EAEA,IAAIC,YAAY,IAAIV,aAAa,CAACU,YAAY,CAAC,IAAIT,wBAAwB,CAACS,YAAY,CAAC,EAAE;IACzF,OAAOA,YAAY;EACrB;EAEA,OAAOR,yBAAyB,CAAC,CAAC;AACpC;AAEA,OAAO,SAASS,cAAcA,CAC5BP,IAAiB,EACjBQ,OAKC,EACQ;EACT,MAAM;IAAEC,OAAO;IAAEC,OAAO;IAAEC,aAAa;IAAEC;EAAQ,CA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@
|
|
|
1
1
|
import type { BSDateValue } from '../core/types';
|
|
2
2
|
import type { CalendarLocale } from '../core/locale';
|
|
3
|
-
export declare function getDayAccessibilityLabel(date: BSDateValue, locale: CalendarLocale,
|
|
3
|
+
export declare function getDayAccessibilityLabel(date: BSDateValue, locale: CalendarLocale, today: boolean, disabled: boolean): string;
|
|
4
4
|
export declare const HEADER_PREV_MONTH_LABEL = "Previous month";
|
|
5
5
|
export declare const HEADER_NEXT_MONTH_LABEL = "Next month";
|
|
6
6
|
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../../../src/accessibility/labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,cAAc,EACtB,
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../../../src/accessibility/labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,OAAO,GAChB,MAAM,CAOR;AAED,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AACxD,eAAO,MAAM,uBAAuB,eAAe,CAAC"}
|
|
@@ -5,17 +5,13 @@ import type { CalendarMarkedDate } from './types';
|
|
|
5
5
|
type CalendarDayProps = {
|
|
6
6
|
date: BSDateValue;
|
|
7
7
|
day: number;
|
|
8
|
-
selected: boolean;
|
|
9
8
|
today: boolean;
|
|
10
9
|
disabled: boolean;
|
|
11
10
|
inCurrentMonth: boolean;
|
|
12
11
|
marked?: CalendarMarkedDate;
|
|
13
12
|
numerals: 'latin' | 'devanagari';
|
|
14
13
|
theme: CalendarTheme;
|
|
15
|
-
onPress
|
|
16
|
-
rangeStart?: boolean;
|
|
17
|
-
rangeEnd?: boolean;
|
|
18
|
-
inRange?: boolean;
|
|
14
|
+
onPress?: () => void;
|
|
19
15
|
locale?: import('../../core/locale').CalendarLocale;
|
|
20
16
|
};
|
|
21
17
|
export declare const CalendarDay: React.NamedExoticComponent<CalendarDayProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarDay.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/CalendarDay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,
|
|
1
|
+
{"version":3,"file":"CalendarDay.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/CalendarDay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,OAAO,GAAG,YAAY,CAAC;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,mBAAmB,EAAE,cAAc,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,WAAW,8CA4FtB,CAAC"}
|
|
@@ -4,10 +4,8 @@ import type { CalendarMonthGrid } from '../../calendar';
|
|
|
4
4
|
import type { CalendarTheme } from '../../theme/types';
|
|
5
5
|
import type { CalendarLocale } from '../../core/locale';
|
|
6
6
|
import type { CalendarMarkedDate, CalendarDayRenderProps } from './types';
|
|
7
|
-
import type { DateRangeValue } from '../NepaliRangePicker/types';
|
|
8
7
|
type CalendarGridProps = {
|
|
9
8
|
grid: CalendarMonthGrid;
|
|
10
|
-
value: BSDateValue | null;
|
|
11
9
|
today: BSDateValue | null;
|
|
12
10
|
minDate: BSDateValue | undefined;
|
|
13
11
|
maxDate: BSDateValue | undefined;
|
|
@@ -15,9 +13,8 @@ type CalendarGridProps = {
|
|
|
15
13
|
theme: CalendarTheme;
|
|
16
14
|
markedDates: Record<string, CalendarMarkedDate> | undefined;
|
|
17
15
|
disabledDates: string[] | ((date: BSDateValue) => boolean) | undefined;
|
|
18
|
-
|
|
16
|
+
onDayPress: ((date: BSDateValue) => void) | undefined;
|
|
19
17
|
renderDay: ((props: CalendarDayRenderProps) => React.ReactNode) | undefined;
|
|
20
|
-
rangeValue?: DateRangeValue;
|
|
21
18
|
locale?: CalendarLocale;
|
|
22
19
|
};
|
|
23
20
|
export declare const CalendarGrid: React.NamedExoticComponent<CalendarGridProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/CalendarGrid.tsx"],"names":[],"mappings":"AAAA,O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oGvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/CalendarHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,aAAa,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AA2BF,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"CalendarHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/CalendarHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,aAAa,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AA2BF,eAAO,MAAM,cAAc,iDAwDzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NepaliCalendarProps } from './types';
|
|
3
|
-
export declare function NepaliCalendar({
|
|
3
|
+
export declare function NepaliCalendar({ year, month, defaultYear, defaultMonth, minDate, maxDate, locale, numerals, weekStartsOn, markedDates, theme, colorScheme, disabledDates, onDayPress, onMonthChange, onYearChange, renderDay, testID, }: NepaliCalendarProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=NepaliCalendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NepaliCalendar.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/NepaliCalendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NepaliCalendar.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/NepaliCalendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAejF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA+BnD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAkB,EAClB,YAAgB,EAChB,WAAW,EACX,KAAK,EACL,WAAsB,EACtB,aAAa,EACb,UAAU,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,MAAM,GACP,EAAE,mBAAmB,qBA+PrB"}
|
|
@@ -2,7 +2,6 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { BSDateValue } from '../../core/types';
|
|
3
3
|
import type { LocaleCode, CalendarLocale, NumeralSystem } from '../../core/locale';
|
|
4
4
|
import type { CalendarTheme } from '../../theme/types';
|
|
5
|
-
import type { DateRangeValue } from '../NepaliRangePicker/types';
|
|
6
5
|
export type CalendarMarkedDate = {
|
|
7
6
|
type?: 'dot' | 'holiday' | 'event' | 'disabled';
|
|
8
7
|
label?: string;
|
|
@@ -14,20 +13,13 @@ export type CalendarDayRenderProps = {
|
|
|
14
13
|
date: BSDateValue;
|
|
15
14
|
dateKey: string;
|
|
16
15
|
day: number;
|
|
17
|
-
selected: boolean;
|
|
18
16
|
today: boolean;
|
|
19
17
|
disabled: boolean;
|
|
20
18
|
inCurrentMonth: boolean;
|
|
21
19
|
marked?: CalendarMarkedDate;
|
|
22
|
-
onPress
|
|
23
|
-
rangeStart?: boolean;
|
|
24
|
-
rangeEnd?: boolean;
|
|
25
|
-
inRange?: boolean;
|
|
20
|
+
onPress?: () => void;
|
|
26
21
|
};
|
|
27
22
|
export type NepaliCalendarProps = {
|
|
28
|
-
value?: BSDateValue | null;
|
|
29
|
-
defaultValue?: BSDateValue;
|
|
30
|
-
onChange?: (date: BSDateValue) => void;
|
|
31
23
|
year?: number;
|
|
32
24
|
month?: number;
|
|
33
25
|
defaultYear?: number;
|
|
@@ -41,12 +33,16 @@ export type NepaliCalendarProps = {
|
|
|
41
33
|
theme?: Partial<CalendarTheme>;
|
|
42
34
|
colorScheme?: 'light' | 'dark' | 'system';
|
|
43
35
|
disabledDates?: string[] | ((date: BSDateValue) => boolean);
|
|
36
|
+
onDayPress?: (date: BSDateValue) => void;
|
|
44
37
|
onMonthChange?: (value: {
|
|
45
38
|
year: number;
|
|
46
39
|
month: number;
|
|
47
40
|
}) => void;
|
|
41
|
+
onYearChange?: (value: {
|
|
42
|
+
year: number;
|
|
43
|
+
month: number;
|
|
44
|
+
}) => void;
|
|
48
45
|
renderDay?: (props: CalendarDayRenderProps) => ReactNode;
|
|
49
|
-
rangeValue?: DateRangeValue;
|
|
50
46
|
testID?: string;
|
|
51
47
|
};
|
|
52
48
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/NepaliCalendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CA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
export * from './calendar';
|
|
3
3
|
export * from './components/NepaliCalendar';
|
|
4
|
-
export * from './components/NepaliDatePicker';
|
|
5
|
-
export * from './components/NepaliRangePicker';
|
|
6
4
|
export * from './theme';
|
|
7
5
|
export * from './accessibility';
|
|
8
6
|
export * from './utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/default-theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiB7C,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"default-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/default-theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiB7C,eAAO,MAAM,WAAW,EAAE,aA6BzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aA6BxB,CAAC"}
|
|
@@ -12,16 +12,6 @@ export type CalendarTheme = {
|
|
|
12
12
|
outsideMonthText: string;
|
|
13
13
|
border: string;
|
|
14
14
|
marker: string;
|
|
15
|
-
overlay: string;
|
|
16
|
-
modalBackground: string;
|
|
17
|
-
fieldBackground: string;
|
|
18
|
-
fieldBorder: string;
|
|
19
|
-
placeholderText: string;
|
|
20
|
-
rangeBackground: string;
|
|
21
|
-
rangeText: string;
|
|
22
|
-
rangeStartBackground: string;
|
|
23
|
-
rangeEndBackground: string;
|
|
24
|
-
danger: string;
|
|
25
15
|
};
|
|
26
16
|
radius: {
|
|
27
17
|
day: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,UAAU,EAAE;QACV,MAAM,EAAE,SAAS,CAAC;QAClB,OAAO,EAAE,SAAS,CAAC;QACnB,GAAG,EAAE,SAAS,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|
|
@@ -9,13 +9,9 @@ export declare function isDateDisabled(date: BSDateValue, options: {
|
|
|
9
9
|
dateKey: string;
|
|
10
10
|
}): boolean;
|
|
11
11
|
export declare function createDateAccessibilityLabel(date: BSDateValue, locale: CalendarLocale, options: {
|
|
12
|
-
selected?: boolean;
|
|
13
12
|
today?: boolean;
|
|
14
13
|
disabled?: boolean;
|
|
15
14
|
outsideMonth?: boolean;
|
|
16
|
-
rangeStart?: boolean;
|
|
17
|
-
rangeEnd?: boolean;
|
|
18
|
-
inRange?: boolean;
|
|
19
15
|
markedLabel?: string;
|
|
20
16
|
}): string;
|
|
21
17
|
export declare function warnInvalidDateInDev(message: string, value: unknown): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-helpers.d.ts","sourceRoot":"","sources":["../../../../src/utils/date-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,UAAU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AAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAeT;AAQD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE;IACP,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACA,MAAM,CAsBR;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,GACb,IAAI,CAIN;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAClC,IAAI,CAON;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,OAAO,EAAE,WAAW,GAAG,SAAS,GAC/B,IAAI,CAQN"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-bikram-sambat",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "React Native Bikram Sambat calendar
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "React Native Bikram Sambat calendar UI with AD to BS, BS to AD, and TypeScript date utilities.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -50,16 +50,12 @@
|
|
|
50
50
|
"bikram-sambat-calendar",
|
|
51
51
|
"nepali-calendar",
|
|
52
52
|
"nepali-date",
|
|
53
|
-
"nepali-date-picker",
|
|
54
|
-
"nepali date picker",
|
|
55
53
|
"bs-date",
|
|
56
54
|
"ad-bs",
|
|
57
55
|
"ad-to-bs",
|
|
58
56
|
"bs-to-ad",
|
|
59
57
|
"date-converter",
|
|
60
58
|
"calendar",
|
|
61
|
-
"datepicker",
|
|
62
|
-
"date-picker",
|
|
63
59
|
"nepal",
|
|
64
60
|
"nepali",
|
|
65
61
|
"typescript",
|
|
@@ -5,14 +5,12 @@ import { formatBS } from '../core/format';
|
|
|
5
5
|
export function getDayAccessibilityLabel(
|
|
6
6
|
date: BSDateValue,
|
|
7
7
|
locale: CalendarLocale,
|
|
8
|
-
selected: boolean,
|
|
9
8
|
today: boolean,
|
|
10
9
|
disabled: boolean
|
|
11
10
|
): string {
|
|
12
11
|
const dateStr = formatBS(date, 'yyyy MMMM d', { locale });
|
|
13
12
|
|
|
14
13
|
if (disabled) return `${dateStr}, disabled`;
|
|
15
|
-
if (selected) return `${dateStr}, selected`;
|
|
16
14
|
if (today) return `${dateStr}, today`;
|
|
17
15
|
|
|
18
16
|
return dateStr;
|
|
@@ -8,24 +8,19 @@ import type { CalendarMarkedDate } from './types';
|
|
|
8
8
|
type CalendarDayProps = {
|
|
9
9
|
date: BSDateValue;
|
|
10
10
|
day: number;
|
|
11
|
-
selected: boolean;
|
|
12
11
|
today: boolean;
|
|
13
12
|
disabled: boolean;
|
|
14
13
|
inCurrentMonth: boolean;
|
|
15
14
|
marked?: CalendarMarkedDate;
|
|
16
15
|
numerals: 'latin' | 'devanagari';
|
|
17
16
|
theme: CalendarTheme;
|
|
18
|
-
onPress
|
|
19
|
-
rangeStart?: boolean;
|
|
20
|
-
rangeEnd?: boolean;
|
|
21
|
-
inRange?: boolean;
|
|
17
|
+
onPress?: () => void;
|
|
22
18
|
locale?: import('../../core/locale').CalendarLocale;
|
|
23
19
|
};
|
|
24
20
|
|
|
25
21
|
export const CalendarDay = memo(function CalendarDay({
|
|
26
22
|
date,
|
|
27
23
|
day,
|
|
28
|
-
selected,
|
|
29
24
|
today,
|
|
30
25
|
disabled,
|
|
31
26
|
inCurrentMonth,
|
|
@@ -33,9 +28,6 @@ export const CalendarDay = memo(function CalendarDay({
|
|
|
33
28
|
numerals,
|
|
34
29
|
theme,
|
|
35
30
|
onPress,
|
|
36
|
-
rangeStart,
|
|
37
|
-
rangeEnd,
|
|
38
|
-
inRange,
|
|
39
31
|
locale,
|
|
40
32
|
}: CalendarDayProps) {
|
|
41
33
|
const displayDay = useMemo(
|
|
@@ -43,50 +35,22 @@ export const CalendarDay = memo(function CalendarDay({
|
|
|
43
35
|
[day, numerals]
|
|
44
36
|
);
|
|
45
37
|
|
|
46
|
-
const
|
|
38
|
+
const isPressable = Boolean(onPress) && !disabled;
|
|
47
39
|
|
|
48
40
|
const textColor = useMemo(() => {
|
|
49
41
|
if (disabled) return theme.colors.disabledText;
|
|
50
|
-
if (isRangeEndpoint) return theme.colors.primaryText;
|
|
51
|
-
if (inRange) return theme.colors.rangeText;
|
|
52
|
-
if (selected) return theme.colors.primaryText;
|
|
53
42
|
if (!inCurrentMonth) return theme.colors.outsideMonthText;
|
|
54
43
|
if (marked?.textColor) return marked.textColor;
|
|
55
44
|
return theme.colors.text;
|
|
56
45
|
}, [
|
|
57
46
|
disabled,
|
|
58
|
-
isRangeEndpoint,
|
|
59
|
-
inRange,
|
|
60
|
-
selected,
|
|
61
47
|
inCurrentMonth,
|
|
62
48
|
marked?.textColor,
|
|
63
49
|
theme.colors.disabledText,
|
|
64
|
-
theme.colors.primaryText,
|
|
65
|
-
theme.colors.rangeText,
|
|
66
50
|
theme.colors.outsideMonthText,
|
|
67
51
|
theme.colors.text,
|
|
68
52
|
]);
|
|
69
53
|
|
|
70
|
-
const backgroundColor = useMemo(() => {
|
|
71
|
-
if (isRangeEndpoint) {
|
|
72
|
-
return rangeStart
|
|
73
|
-
? theme.colors.rangeStartBackground
|
|
74
|
-
: theme.colors.rangeEndBackground;
|
|
75
|
-
}
|
|
76
|
-
if (inRange) return theme.colors.rangeBackground;
|
|
77
|
-
if (selected) return theme.colors.primary;
|
|
78
|
-
return undefined;
|
|
79
|
-
}, [
|
|
80
|
-
isRangeEndpoint,
|
|
81
|
-
rangeStart,
|
|
82
|
-
inRange,
|
|
83
|
-
selected,
|
|
84
|
-
theme.colors.rangeStartBackground,
|
|
85
|
-
theme.colors.rangeEndBackground,
|
|
86
|
-
theme.colors.rangeBackground,
|
|
87
|
-
theme.colors.primary,
|
|
88
|
-
]);
|
|
89
|
-
|
|
90
54
|
const accessibilityLabel = useMemo(() => {
|
|
91
55
|
const parts: string[] = [];
|
|
92
56
|
|
|
@@ -101,10 +65,6 @@ export const CalendarDay = memo(function CalendarDay({
|
|
|
101
65
|
parts.push(`${date.year}/${date.month}/${day}`);
|
|
102
66
|
}
|
|
103
67
|
|
|
104
|
-
if (rangeStart) parts.push('range start');
|
|
105
|
-
if (rangeEnd) parts.push('range end');
|
|
106
|
-
if (inRange && !rangeStart && !rangeEnd) parts.push('in selected range');
|
|
107
|
-
if (selected && !inRange) parts.push('selected');
|
|
108
68
|
if (today) parts.push('today');
|
|
109
69
|
if (disabled) parts.push('disabled');
|
|
110
70
|
if (!inCurrentMonth) parts.push('outside month');
|
|
@@ -115,10 +75,6 @@ export const CalendarDay = memo(function CalendarDay({
|
|
|
115
75
|
date,
|
|
116
76
|
day,
|
|
117
77
|
locale,
|
|
118
|
-
rangeStart,
|
|
119
|
-
rangeEnd,
|
|
120
|
-
inRange,
|
|
121
|
-
selected,
|
|
122
78
|
today,
|
|
123
79
|
disabled,
|
|
124
80
|
inCurrentMonth,
|
|
@@ -127,25 +83,21 @@ export const CalendarDay = memo(function CalendarDay({
|
|
|
127
83
|
|
|
128
84
|
const containerStyle = [
|
|
129
85
|
styles.dayContainer,
|
|
130
|
-
|
|
131
|
-
today && !isRangeEndpoint && !selected && !inRange && {
|
|
86
|
+
today && {
|
|
132
87
|
borderWidth: 1,
|
|
133
88
|
borderColor: theme.colors.todayBorder,
|
|
134
89
|
},
|
|
135
90
|
disabled && styles.dayDisabled,
|
|
136
|
-
inRange && !isRangeEndpoint && styles.dayInRange,
|
|
137
|
-
rangeStart && styles.dayRangeStart,
|
|
138
|
-
rangeEnd && styles.dayRangeEnd,
|
|
139
91
|
];
|
|
140
92
|
|
|
141
93
|
return (
|
|
142
94
|
<Pressable
|
|
143
95
|
style={containerStyle}
|
|
144
96
|
onPress={onPress}
|
|
145
|
-
disabled={
|
|
146
|
-
accessibilityRole=
|
|
97
|
+
disabled={!isPressable}
|
|
98
|
+
accessibilityRole={isPressable ? 'button' : undefined}
|
|
147
99
|
accessibilityLabel={accessibilityLabel}
|
|
148
|
-
accessibilityState={{ disabled
|
|
100
|
+
accessibilityState={{ disabled: disabled || !isPressable }}
|
|
149
101
|
>
|
|
150
102
|
<Text style={[styles.dayText, { color: textColor }]}>{displayDay}</Text>
|
|
151
103
|
{marked && !disabled && (
|
|
@@ -169,17 +121,6 @@ const styles = StyleSheet.create({
|
|
|
169
121
|
borderRadius: 20,
|
|
170
122
|
position: 'relative',
|
|
171
123
|
},
|
|
172
|
-
dayInRange: {
|
|
173
|
-
borderRadius: 0,
|
|
174
|
-
},
|
|
175
|
-
dayRangeStart: {
|
|
176
|
-
borderTopLeftRadius: 20,
|
|
177
|
-
borderBottomLeftRadius: 20,
|
|
178
|
-
},
|
|
179
|
-
dayRangeEnd: {
|
|
180
|
-
borderTopRightRadius: 20,
|
|
181
|
-
borderBottomRightRadius: 20,
|
|
182
|
-
},
|
|
183
124
|
dayText: {
|
|
184
125
|
fontSize: 15,
|
|
185
126
|
textAlign: 'center',
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import type { BSDateValue } from '../../core/types';
|
|
4
|
-
import { compareBS } from '../../core';
|
|
5
4
|
import type { CalendarMonthGrid } from '../../calendar';
|
|
6
5
|
import type { CalendarTheme } from '../../theme/types';
|
|
7
6
|
import type { CalendarLocale } from '../../core/locale';
|
|
8
7
|
import type { CalendarMarkedDate, CalendarDayRenderProps } from './types';
|
|
9
|
-
import type { DateRangeValue } from '../NepaliRangePicker/types';
|
|
10
|
-
import { isRangeStart, isRangeEnd, isDateInRange } from '../NepaliRangePicker/range-utils';
|
|
11
8
|
import { CalendarDay } from './CalendarDay';
|
|
12
9
|
|
|
13
10
|
type CalendarGridProps = {
|
|
14
11
|
grid: CalendarMonthGrid;
|
|
15
|
-
value: BSDateValue | null;
|
|
16
12
|
today: BSDateValue | null;
|
|
17
13
|
minDate: BSDateValue | undefined;
|
|
18
14
|
maxDate: BSDateValue | undefined;
|
|
@@ -20,23 +16,20 @@ type CalendarGridProps = {
|
|
|
20
16
|
theme: CalendarTheme;
|
|
21
17
|
markedDates: Record<string, CalendarMarkedDate> | undefined;
|
|
22
18
|
disabledDates: string[] | ((date: BSDateValue) => boolean) | undefined;
|
|
23
|
-
|
|
19
|
+
onDayPress: ((date: BSDateValue) => void) | undefined;
|
|
24
20
|
renderDay: ((props: CalendarDayRenderProps) => React.ReactNode) | undefined;
|
|
25
|
-
rangeValue?: DateRangeValue;
|
|
26
21
|
locale?: CalendarLocale;
|
|
27
22
|
};
|
|
28
23
|
|
|
29
24
|
export const CalendarGrid = memo(function CalendarGrid({
|
|
30
25
|
grid,
|
|
31
|
-
value,
|
|
32
26
|
today,
|
|
33
27
|
numerals,
|
|
34
28
|
theme,
|
|
35
29
|
markedDates,
|
|
36
30
|
disabledDates,
|
|
37
|
-
|
|
31
|
+
onDayPress,
|
|
38
32
|
renderDay,
|
|
39
|
-
rangeValue,
|
|
40
33
|
locale,
|
|
41
34
|
}: CalendarGridProps) {
|
|
42
35
|
const isDateDisabledByList = useCallback(
|
|
@@ -55,14 +48,15 @@ export const CalendarGrid = memo(function CalendarGrid({
|
|
|
55
48
|
);
|
|
56
49
|
|
|
57
50
|
const rows = useMemo(() => {
|
|
58
|
-
const hasRange = rangeValue?.start != null;
|
|
59
|
-
|
|
60
51
|
return grid.weeks.map((week, weekIndex) => (
|
|
61
52
|
<View key={weekIndex} style={styles.weekRow}>
|
|
62
53
|
{week.map((cell) => {
|
|
63
54
|
const dateKey = cell.key;
|
|
64
|
-
const
|
|
65
|
-
|
|
55
|
+
const isTodayCell =
|
|
56
|
+
today !== null &&
|
|
57
|
+
cell.date.year === today.year &&
|
|
58
|
+
cell.date.month === today.month &&
|
|
59
|
+
cell.date.day === today.day;
|
|
66
60
|
const marked = markedDates?.[dateKey];
|
|
67
61
|
const explicitlyDisabled = marked?.disabled ?? false;
|
|
68
62
|
const disabled =
|
|
@@ -70,13 +64,9 @@ export const CalendarGrid = memo(function CalendarGrid({
|
|
|
70
64
|
cell.isDisabled ||
|
|
71
65
|
isDateDisabledByList(cell.date, dateKey);
|
|
72
66
|
|
|
73
|
-
const rangeStart = hasRange && isRangeStart(cell.date, rangeValue!);
|
|
74
|
-
const rangeEnd = hasRange && isRangeEnd(cell.date, rangeValue!);
|
|
75
|
-
const inRange = hasRange && isDateInRange(cell.date, rangeValue!);
|
|
76
|
-
|
|
77
67
|
const handlePress = () => {
|
|
78
|
-
if (!disabled) {
|
|
79
|
-
|
|
68
|
+
if (!disabled && onDayPress) {
|
|
69
|
+
onDayPress(cell.date);
|
|
80
70
|
}
|
|
81
71
|
};
|
|
82
72
|
|
|
@@ -84,15 +74,11 @@ export const CalendarGrid = memo(function CalendarGrid({
|
|
|
84
74
|
date: cell.date,
|
|
85
75
|
dateKey,
|
|
86
76
|
day: cell.day,
|
|
87
|
-
selected: isSelected,
|
|
88
77
|
today: isTodayCell,
|
|
89
78
|
disabled,
|
|
90
79
|
inCurrentMonth: cell.inCurrentMonth,
|
|
91
80
|
marked,
|
|
92
|
-
onPress: handlePress,
|
|
93
|
-
rangeStart,
|
|
94
|
-
rangeEnd,
|
|
95
|
-
inRange,
|
|
81
|
+
onPress: onDayPress ? handlePress : undefined,
|
|
96
82
|
};
|
|
97
83
|
|
|
98
84
|
if (renderDay) {
|
|
@@ -108,17 +94,13 @@ export const CalendarGrid = memo(function CalendarGrid({
|
|
|
108
94
|
<CalendarDay
|
|
109
95
|
date={cell.date}
|
|
110
96
|
day={cell.day}
|
|
111
|
-
selected={isSelected}
|
|
112
97
|
today={isTodayCell}
|
|
113
98
|
disabled={disabled}
|
|
114
99
|
inCurrentMonth={cell.inCurrentMonth}
|
|
115
100
|
marked={marked}
|
|
116
101
|
numerals={numerals}
|
|
117
102
|
theme={theme}
|
|
118
|
-
onPress={handlePress}
|
|
119
|
-
rangeStart={rangeStart}
|
|
120
|
-
rangeEnd={rangeEnd}
|
|
121
|
-
inRange={inRange}
|
|
103
|
+
onPress={onDayPress ? handlePress : undefined}
|
|
122
104
|
locale={locale}
|
|
123
105
|
/>
|
|
124
106
|
</View>
|
|
@@ -128,15 +110,13 @@ export const CalendarGrid = memo(function CalendarGrid({
|
|
|
128
110
|
));
|
|
129
111
|
}, [
|
|
130
112
|
grid.weeks,
|
|
131
|
-
value,
|
|
132
113
|
today,
|
|
133
114
|
numerals,
|
|
134
115
|
theme,
|
|
135
116
|
markedDates,
|
|
136
117
|
isDateDisabledByList,
|
|
137
|
-
|
|
118
|
+
onDayPress,
|
|
138
119
|
renderDay,
|
|
139
|
-
rangeValue,
|
|
140
120
|
locale,
|
|
141
121
|
]);
|
|
142
122
|
|