@pezeshk-book/modules 1.0.4 → 1.1.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/calendar/calendar.d.ts +2 -1
- package/calendar/calendar.js +115 -88
- package/calendar/calendar.js.map +1 -1
- package/calendar/calendar.props.js +1 -1
- package/calendar/config/chunk.js +9 -10
- package/calendar/config/chunk.js.map +1 -1
- package/calendar/config/create-date-range.js +10 -11
- package/calendar/config/create-date-range.js.map +1 -1
- package/calendar/config/days-in-month.en.js +27 -27
- package/calendar/config/days-in-month.en.js.map +1 -1
- package/calendar/config/days-in-month.fa.js +27 -27
- package/calendar/config/days-in-month.fa.js.map +1 -1
- package/calendar/config/index.js +10 -10
- package/calendar/config/index.js.map +1 -1
- package/calendar/config/months.js +1 -1
- package/calendar/config/week-day.js +6 -6
- package/calendar/config/week-day.js.map +1 -1
- package/calendar/icons/arrow-left-icon.d.ts +1 -1
- package/calendar/icons/arrow-left-icon.js +5 -6
- package/calendar/icons/arrow-left-icon.js.map +1 -1
- package/calendar/icons/arrow-right-icon.d.ts +1 -1
- package/calendar/icons/arrow-right-icon.js +5 -6
- package/calendar/icons/arrow-right-icon.js.map +1 -1
- package/calendar/icons/index.js +6 -6
- package/calendar/icons/index.js.map +1 -1
- package/calendar/index.js +4 -4
- package/calendar/index.js.map +1 -1
- package/calendar/shared/formatDate.js +9 -10
- package/calendar/shared/formatDate.js.map +1 -1
- package/calendar/sub-components/day/day.d.ts +1 -1
- package/calendar/sub-components/day/day.js +9 -10
- package/calendar/sub-components/day/day.js.map +1 -1
- package/calendar/sub-components/day/day.props.js +1 -1
- package/calendar/sub-components/days/days.d.ts +1 -7
- package/calendar/sub-components/days/days.js +35 -39
- package/calendar/sub-components/days/days.js.map +1 -1
- package/calendar/sub-components/days/days.props.js +1 -1
- package/calendar/sub-components/days-head/days-head.d.ts +2 -1
- package/calendar/sub-components/days-head/days-head.js +26 -27
- package/calendar/sub-components/days-head/days-head.js.map +1 -1
- package/calendar/sub-components/days-head/days-head.props.js +1 -1
- package/countdown-timer/countdown.d.ts +1 -1
- package/countdown-timer/countdown.js +27 -28
- package/countdown-timer/countdown.js.map +1 -1
- package/countdown-timer/countdown.props.js +1 -1
- package/countdown-timer/index.js +4 -4
- package/countdown-timer/index.js.map +1 -1
- package/data-table/data-table.d.ts +1 -1
- package/data-table/data-table.js +9 -9
- package/data-table/data-table.js.map +1 -1
- package/data-table/data-table.props.js +1 -1
- package/data-table/default/default-data-table.d.ts +1 -1
- package/data-table/default/default-data-table.js +76 -83
- package/data-table/default/default-data-table.js.map +1 -1
- package/data-table/default/default-data-table.props.js +1 -1
- package/data-table/default/index.js +4 -4
- package/data-table/default/index.js.map +1 -1
- package/data-table/hooks/use-window-dimensions.js +14 -14
- package/data-table/hooks/use-window-dimensions.js.map +1 -1
- package/data-table/icons/add.d.ts +2 -2
- package/data-table/icons/add.js +5 -7
- package/data-table/icons/add.js.map +1 -1
- package/data-table/icons/arrow-down.d.ts +1 -1
- package/data-table/icons/arrow-down.js +5 -7
- package/data-table/icons/arrow-down.js.map +1 -1
- package/data-table/icons/index.js +8 -8
- package/data-table/icons/index.js.map +1 -1
- package/data-table/icons/sort.d.ts +1 -1
- package/data-table/icons/sort.js +5 -7
- package/data-table/icons/sort.js.map +1 -1
- package/data-table/index.js +4 -4
- package/data-table/index.js.map +1 -1
- package/data-table/simple/index.js +4 -4
- package/data-table/simple/index.js.map +1 -1
- package/data-table/simple/simple-data-table.d.ts +1 -1
- package/data-table/simple/simple-data-table.js +60 -59
- package/data-table/simple/simple-data-table.js.map +1 -1
- package/data-table/simple/simple-data-table.props.js +1 -1
- package/date-time-picker/date-time-picker.d.ts +1 -1
- package/date-time-picker/date-time-picker.js +25 -26
- package/date-time-picker/date-time-picker.js.map +1 -1
- package/date-time-picker/date-time-picker.props.js +1 -1
- package/date-time-picker/index.js +4 -4
- package/date-time-picker/index.js.map +1 -1
- package/index.js +16 -16
- package/index.js.map +1 -1
- package/package.json +12 -44
- package/pagination/icons/arrow-Right.d.ts +3 -3
- package/pagination/icons/arrow-Right.js +5 -7
- package/pagination/icons/arrow-Right.js.map +1 -1
- package/pagination/icons/arrow-left.d.ts +3 -3
- package/pagination/icons/arrow-left.js +5 -7
- package/pagination/icons/arrow-left.js.map +1 -1
- package/pagination/icons/index.js +6 -6
- package/pagination/icons/index.js.map +1 -1
- package/pagination/index.js +4 -4
- package/pagination/index.js.map +1 -1
- package/pagination/pagination.d.ts +1 -1
- package/pagination/pagination.js +26 -27
- package/pagination/pagination.js.map +1 -1
- package/pagination/pagination.props.js +1 -1
- package/pagination/use-pagination.d.ts +1 -1
- package/pagination/use-pagination.js +8 -8
- package/pagination/use-pagination.js.map +1 -1
- package/slider/index.js +4 -4
- package/slider/index.js.map +1 -1
- package/slider/slider.d.ts +2 -1
- package/slider/slider.js +63 -66
- package/slider/slider.js.map +1 -1
- package/slider/slider.props.js +1 -1
- package/tailwind-merge-config.js +6 -6
- package/tailwind-merge-config.js.map +1 -1
- package/time-picker/index.js +4 -4
- package/time-picker/index.js.map +1 -1
- package/time-picker/time-picker.d.ts +1 -1
- package/time-picker/time-picker.js +26 -28
- package/time-picker/time-picker.js.map +1 -1
- package/time-picker/time-picker.props.js +1 -1
- package/utils/class-names.js +3 -7
- package/utils/class-names.js.map +1 -1
- package/utils/persian-to-english-number.js +3 -3
- package/utils/persian-to-english-number.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"days-in-month.fa.js","sourceRoot":"","sources":["../../../calendar/config/days-in-month.fa.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"days-in-month.fa.js","sourceRoot":"","sources":["../../../calendar/config/days-in-month.fa.ts"],"names":[],"mappings":";;;;AAAA,0FAA0D;AAC1D,8FAA6D;AAC7D,kFAA2C;AAC3C,8FAA8D;AAEvD,MAAM,aAAa,GAAG,CAAC,IAAS,EAAE,UAAkB,EAAgB,EAAE;IAC3E,IA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CAAC,UAAU,CAAC,CAAC;QAC3I,MAAM,UAAU,GAAG,IAAI,2BAAU,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,iBAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACrH,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC1C,GAAG;YACH,aAAa,EAAE,IAAI,2BAAU,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,iBAAO,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAS,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;YAC7H,UAAU,EAAE,IAAI,2BAAU,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,iBAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;YACvG,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC;IAE1B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACnD,CAAC,CAAC;AA/BW,QAAA,aAAa,iBA+BxB"}
|
package/calendar/config/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.chunk = exports.weekDayNames = exports.fa = exports.daysInMonthFa = exports.daysInMonthEn = void 0;
|
|
4
|
-
|
|
5
|
-
exports
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
exports
|
|
11
|
-
|
|
12
|
-
exports
|
|
4
|
+
const week_day_1 = require("./week-day");
|
|
5
|
+
Object.defineProperty(exports, "fa", { enumerable: true, get: function () { return week_day_1.fa; } });
|
|
6
|
+
Object.defineProperty(exports, "weekDayNames", { enumerable: true, get: function () { return week_day_1.weekDayNames; } });
|
|
7
|
+
const chunk_1 = require("./chunk");
|
|
8
|
+
Object.defineProperty(exports, "chunk", { enumerable: true, get: function () { return chunk_1.chunk; } });
|
|
9
|
+
const days_in_month_en_1 = require("./days-in-month.en");
|
|
10
|
+
Object.defineProperty(exports, "daysInMonthEn", { enumerable: true, get: function () { return days_in_month_en_1.daysInMonthEn; } });
|
|
11
|
+
const days_in_month_fa_1 = require("./days-in-month.fa");
|
|
12
|
+
Object.defineProperty(exports, "daysInMonthFa", { enumerable: true, get: function () { return days_in_month_fa_1.daysInMonthFa; } });
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../calendar/config/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../calendar/config/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAQ5C,mFARO,aAAE,OAQP;AACF,6FATW,uBAAY,OASX;AARd,mCAAgC;AAS9B,sFATO,aAAK,OASP;AARP,yDAAwE;AAItE,8FAJO,gCAAa,OAIP;AAHf,yDAAmD;AAIjD,8FAJO,gCAAa,OAIP"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.weekDayNames = exports.fa = void 0;
|
|
4
|
-
|
|
4
|
+
const fa = (n) => {
|
|
5
5
|
if (process.env.NODE_ENV === 'test') {
|
|
6
6
|
return n;
|
|
7
7
|
}
|
|
8
8
|
return Number(n).toLocaleString('fa', {
|
|
9
|
-
useGrouping: false
|
|
9
|
+
useGrouping: false,
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
exports.fa = fa;
|
|
13
13
|
exports.weekDayNames = {
|
|
14
14
|
jalali: {
|
|
15
15
|
normal: ['شنبه', 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه'],
|
|
16
|
-
short: ['ش', 'ی', 'د', 'س', 'چ', 'پ', 'ج']
|
|
16
|
+
short: ['ش', 'ی', 'د', 'س', 'چ', 'پ', 'ج'],
|
|
17
17
|
},
|
|
18
18
|
gregorian: {
|
|
19
19
|
normal: ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
|
|
20
|
-
short: ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri']
|
|
21
|
-
}
|
|
20
|
+
short: ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
|
|
21
|
+
},
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=week-day.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"week-day.js","sourceRoot":"","sources":["../../../calendar/config/week-day.ts"],"names":[],"mappings":";;;AAAO,
|
|
1
|
+
{"version":3,"file":"week-day.js","sourceRoot":"","sources":["../../../calendar/config/week-day.ts"],"names":[],"mappings":";;;AAAO,MAAM,EAAE,GAAG,CAAC,CAAM,EAAE,EAAE;IAC3B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QACpC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE;QACpC,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;AACL,CAAC,CAAC;AAPW,QAAA,EAAE,MAOb;AAEW,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE;QACN,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC;QAC9E,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;KAC3C;IACD,SAAS,EAAE;QACT,MAAM,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC;QACtF,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;KACzD;CACF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ArrowLeftIcon: () => import("react
|
|
1
|
+
declare const ArrowLeftIcon: () => import("react").JSX.Element;
|
|
2
2
|
export default ArrowLeftIcon;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", width: "6", height: "12", viewBox: "0 0 6 12" }, { children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', transform: "rotate(-90 6 6)", "data-name": "Path 28691", d: "M5.29.253a1.121 1.121 0 0 1 1.419 0l5 4.28a.775.775 0 0 1 0 1.215 1.126 1.126 0 0 1-1.419 0L6 2.068l-4.287 3.68a1.126 1.126 0 0 1-1.419 0 .775.775 0 0 1 0-1.215z" }) })));
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ArrowLeftIcon = () => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "6", height: "12", viewBox: "0 0 6 12", children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', transform: "rotate(-90 6 6)", "data-name": "Path 28691", d: "M5.29.253a1.121 1.121 0 0 1 1.419 0l5 4.28a.775.775 0 0 1 0 1.215 1.126 1.126 0 0 1-1.419 0L6 2.068l-4.287 3.68a1.126 1.126 0 0 1-1.419 0 .775.775 0 0 1 0-1.215z" }) }));
|
|
7
6
|
};
|
|
8
|
-
exports
|
|
7
|
+
exports.default = ArrowLeftIcon;
|
|
9
8
|
//# sourceMappingURL=arrow-left-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-left-icon.js","sourceRoot":"","sources":["../../../calendar/icons/arrow-left-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-left-icon.js","sourceRoot":"","sources":["../../../calendar/icons/arrow-left-icon.tsx"],"names":[],"mappings":";;;AAAA,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,OAAO,CACL,gCAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,UAAU,YAC9E,iCACE,IAAI,EAAE,cAAc,EACpB,SAAS,EAAC,iBAAiB,eACjB,YAAY,EACtB,CAAC,EAAC,mKAAmK,GACrK,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ArrowRightIcon: () => import("react
|
|
1
|
+
declare const ArrowRightIcon: () => import("react").JSX.Element;
|
|
2
2
|
export default ArrowRightIcon;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", width: "6", height: "12", viewBox: "0 0 6 12" }, { children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', transform: "rotate(-90 6 6)", "data-name": "Path 28692", d: "M5.29 5.747a1.121 1.121 0 0 0 1.419 0l5-4.28a.775.775 0 0 0 0-1.215 1.126 1.126 0 0 0-1.419 0L6 3.932 1.713.252a1.126 1.126 0 0 0-1.419 0 .775.775 0 0 0 0 1.215z" }) })));
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ArrowRightIcon = () => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "6", height: "12", viewBox: "0 0 6 12", children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', transform: "rotate(-90 6 6)", "data-name": "Path 28692", d: "M5.29 5.747a1.121 1.121 0 0 0 1.419 0l5-4.28a.775.775 0 0 0 0-1.215 1.126 1.126 0 0 0-1.419 0L6 3.932 1.713.252a1.126 1.126 0 0 0-1.419 0 .775.775 0 0 0 0 1.215z" }) }));
|
|
7
6
|
};
|
|
8
|
-
exports
|
|
7
|
+
exports.default = ArrowRightIcon;
|
|
9
8
|
//# sourceMappingURL=arrow-right-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-right-icon.js","sourceRoot":"","sources":["../../../calendar/icons/arrow-right-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-right-icon.js","sourceRoot":"","sources":["../../../calendar/icons/arrow-right-icon.tsx"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,OAAO,CACL,gCAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,UAAU,YAC9E,iCACE,IAAI,EAAE,cAAc,EACpB,SAAS,EAAC,iBAAiB,eACjB,YAAY,EACtB,CAAC,EAAC,mKAAmK,GACrK,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
package/calendar/icons/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArrowRightIcon = exports.ArrowLeftIcon = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.ArrowLeftIcon = arrow_left_icon_1
|
|
7
|
-
|
|
8
|
-
exports.ArrowRightIcon = arrow_right_icon_1
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const arrow_left_icon_1 = tslib_1.__importDefault(require("./arrow-left-icon"));
|
|
6
|
+
exports.ArrowLeftIcon = arrow_left_icon_1.default;
|
|
7
|
+
const arrow_right_icon_1 = tslib_1.__importDefault(require("./arrow-right-icon"));
|
|
8
|
+
exports.ArrowRightIcon = arrow_right_icon_1.default;
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../calendar/icons/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../calendar/icons/index.ts"],"names":[],"mappings":";;;;AAAA,gFAA8C;AAI5C,wBAJK,yBAAa,CAIL;AAHf,kFAAgD;AAI9C,yBAJK,0BAAc,CAIL"}
|
package/calendar/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const calendar_1 = tslib_1.__importDefault(require("./calendar"));
|
|
5
|
+
exports.default = calendar_1.default;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/calendar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../calendar/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../calendar/index.ts"],"names":[],"mappings":";;;AAAA,kEAAkC;AAElC,kBAAe,kBAAQ,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = formatDate;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_date_object_1 = tslib_1.__importDefault(require("react-date-object"));
|
|
6
|
+
const persian_1 = tslib_1.__importDefault(require("react-date-object/calendars/persian"));
|
|
7
|
+
const gregorian_1 = tslib_1.__importDefault(require("react-date-object/calendars/gregorian"));
|
|
8
|
+
function formatDate(data, format = 'YYYY-MM-DD', type) {
|
|
9
9
|
if (data) {
|
|
10
|
-
|
|
11
|
-
date.calendar = type === 'gregorian' ? gregorian_1
|
|
10
|
+
const date = new react_date_object_1.default(data);
|
|
11
|
+
date.calendar = type === 'gregorian' ? gregorian_1.default : persian_1.default;
|
|
12
12
|
return date.format(format);
|
|
13
13
|
}
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
|
-
exports["default"] = formatDate;
|
|
17
16
|
//# sourceMappingURL=formatDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../../../calendar/shared/formatDate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../../../calendar/shared/formatDate.tsx"],"names":[],"mappings":";;AAIA,6BAOC;;AAXD,kFAA2C;AAC3C,0FAA0D;AAC1D,8FAA8D;AAE9D,SAAwB,UAAU,CAAC,IAA4B,EAAE,SAAiB,YAAY,EAAE,IAA4B;IAC1H,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,GAAG,IAAI,2BAAU,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAS,CAAC,CAAC,CAAC,iBAAO,CAAC;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DayProps } from './day.props';
|
|
2
|
-
export declare const Day: ({ children, disabledDay, holidays, passedDay, comingDay, selectedDay, selected, handleDay, isRange, startRange, endRange, ...rest }: DayProps) => import("react
|
|
2
|
+
export declare const Day: ({ children, disabledDay, holidays, passedDay, comingDay, selectedDay, selected, handleDay, isRange, startRange, endRange, ...rest }: DayProps) => import("react").JSX.Element;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Day = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var children = _a.children, disabledDay = _a.disabledDay, holidays = _a.holidays, passedDay = _a.passedDay, comingDay = _a.comingDay, selectedDay = _a.selectedDay, selected = _a.selected, handleDay = _a.handleDay, isRange = _a.isRange, startRange = _a.startRange, endRange = _a.endRange, rest = tslib_1.__rest(_a, ["children", "disabledDay", "holidays", "passedDay", "comingDay", "selectedDay", "selected", "handleDay", "isRange", "startRange", "endRange"]);
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const tailwind_merge_config_1 = tslib_1.__importDefault(require("../../../tailwind-merge-config"));
|
|
7
|
+
const ui_kit_1 = require("@pezeshk-book/ui-kit");
|
|
8
|
+
const Day = ({ children, disabledDay, holidays, passedDay, comingDay, selectedDay, selected, handleDay, isRange, startRange, endRange, ...rest }) => {
|
|
10
9
|
if (!children) {
|
|
11
10
|
return (0, jsx_runtime_1.jsx)(ui_kit_1.Div, {});
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(ui_kit_1.Button,
|
|
12
|
+
const color = passedDay ? 'control' : selected ? 'primary' : isRange ? 'slate' : selectedDay ? 'primary' : (disabledDay || holidays ? 'danger' : 'inherit');
|
|
13
|
+
const variant = selected ? 'filled' : (isRange ? 'outlined' : 'text');
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(ui_kit_1.Button, { disabled: comingDay || passedDay, variant: variant, rounded: isRange ? 'none' : 'medium', size: 'medium', shape: 'square', color: color, className: (0, tailwind_merge_config_1.default)(isRange ? 'border-l-0 border-r-0 border-dashed' : '', startRange && isRange ? 'rounded-r-lg rounded-l-none' : '', endRange && isRange ? 'rounded-l-lg rounded-r-none' : ''), onClick: handleDay, ...rest, children: children }));
|
|
16
15
|
};
|
|
17
16
|
exports.Day = Day;
|
|
18
17
|
//# sourceMappingURL=day.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"day.js","sourceRoot":"","sources":["../../../../calendar/sub-components/day/day.tsx"],"names":[],"mappings":";;;;;AACA,
|
|
1
|
+
{"version":3,"file":"day.js","sourceRoot":"","sources":["../../../../calendar/sub-components/day/day.tsx"],"names":[],"mappings":";;;;;AACA,mGAAqD;AACrD,iDAAmD;AAE5C,MAAM,GAAG,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EA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days.props';
|
|
2
|
-
declare const Days:
|
|
3
|
-
(props: DaysProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
defaultProps: {
|
|
5
|
-
monthName: string;
|
|
6
|
-
disableDays: never[];
|
|
7
|
-
};
|
|
8
|
-
};
|
|
2
|
+
declare const Days: (props: DaysProps) => import("react").JSX.Element | null;
|
|
9
3
|
export default Days;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const days_head_1 = tslib_1.__importDefault(require("../days-head/days-head"));
|
|
6
|
+
const day_1 = require("../day/day");
|
|
7
|
+
const config_1 = require("../../config");
|
|
8
|
+
const react_date_object_1 = tslib_1.__importDefault(require("react-date-object"));
|
|
9
|
+
const persian_1 = tslib_1.__importDefault(require("react-date-object/calendars/persian"));
|
|
10
|
+
const gregorian_1 = tslib_1.__importDefault(require("react-date-object/calendars/gregorian"));
|
|
11
|
+
const ui_kit_1 = require("@pezeshk-book/ui-kit");
|
|
12
|
+
const boolDataset = (arg) => {
|
|
13
13
|
if (arg) {
|
|
14
14
|
return {
|
|
15
|
-
'data-disable': arg
|
|
15
|
+
'data-disable': arg,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const Days = (props) => {
|
|
21
|
+
const { days, selected, selectDateHandlers, monthName = '', disablePreviousMonths, disableSubsequentMonths, disablePreviousDays, disableSubsequentDays, increaseMonth, decreaseMonth, selectedDay, year, date, dateFormat, type, holidays, variant, selectDateRangeHandlers, rangeDate, rangeDates, size, changeMonth, changeYear, disableBeforeDate, } = props;
|
|
22
|
+
const handleDayClick = (day) => {
|
|
23
23
|
selectDateHandlers(day);
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
const handleRangeClick = (day) => {
|
|
26
26
|
if (rangeDate.start && !rangeDate.end && rangeDate.start.gregorianDate < day.gregorianDate) {
|
|
27
27
|
selectDateRangeHandlers({ start: rangeDate.start, end: day });
|
|
28
28
|
}
|
|
@@ -33,50 +33,46 @@ var Days = function (props) {
|
|
|
33
33
|
selectDateRangeHandlers({ start: day, end: null });
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const weeks = (0, config_1.chunk)(days, 7);
|
|
37
|
+
const currentDate = new react_date_object_1.default({ date: new Date(), calendar: type === 'gregorian' ? gregorian_1.default : persian_1.default }).format(dateFormat);
|
|
38
38
|
if (!days.length) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const weekDays = size === 'huge' || size === 'large' ? config_1.weekDayNames[type].normal : config_1.weekDayNames[type].short;
|
|
42
|
+
const isBeforeDisabledDate = (dayDate) => {
|
|
43
43
|
if (!disableBeforeDate) {
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
const dayDateObj = new react_date_object_1.default({
|
|
47
47
|
date: dayDate,
|
|
48
48
|
format: dateFormat,
|
|
49
|
-
calendar: type === 'gregorian' ? gregorian_1
|
|
49
|
+
calendar: type === 'gregorian' ? gregorian_1.default : persian_1.default,
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
let disableDateObj = new react_date_object_1.default({
|
|
52
52
|
date: disableBeforeDate,
|
|
53
53
|
format: dateFormat,
|
|
54
|
-
calendar: gregorian_1
|
|
54
|
+
calendar: gregorian_1.default,
|
|
55
55
|
});
|
|
56
56
|
if (type === 'jalali') {
|
|
57
|
-
disableDateObj = disableDateObj.convert(persian_1
|
|
57
|
+
disableDateObj = disableDateObj.convert(persian_1.default);
|
|
58
58
|
}
|
|
59
59
|
return dayDateObj.valueOf() < disableDateObj.valueOf();
|
|
60
60
|
};
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)(ui_kit_1.Div,
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(ui_kit_1.Div,
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'flex-1 flex-col self-center overflow-auto mx-1 bg-white', children: [(0, jsx_runtime_1.jsx)(days_head_1.default, { year: year, monthName: monthName, days: days, date: date, dateFormat: dateFormat, disablePreviousMonths: disablePreviousMonths, disableSubsequentMonths: disableSubsequentMonths, increaseMonth: increaseMonth, decreaseMonth: decreaseMonth, changeMonth: changeMonth, changeYear: changeYear, type: type, size: size }), (0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'flex-col items-center flex-1 gap-4', "data-testid": "days-wrapper", children: [(0, jsx_runtime_1.jsx)(ui_kit_1.Div, { dir: type === 'gregorian' ? 'ltr' : 'rtl', className: 'grid grid-cols-7 w-full', children: weekDays.map(name => ((0, jsx_runtime_1.jsx)(ui_kit_1.Text, { typography: 'xs', type: 'regular', color: 'black', children: name }, name))) }), (0, jsx_runtime_1.jsx)(ui_kit_1.Divider, { color: 'control' }), (0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'flex-col w-full gap-y-4', children: weeks.map((week, idx) => {
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(ui_kit_1.Div, { dir: type === 'gregorian' ? 'ltr' : 'rtl', className: 'grid grid-flow-col grid-cols-7 w-full', "data-testid": "days", children: week.map((day, id) => {
|
|
63
63
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)(day_1.Day,
|
|
64
|
+
const dayDate = type === 'gregorian' ? day.gregorianDate : day.jalaliDate;
|
|
65
|
+
const isPassedDay = disablePreviousDays && dayDate < currentDate;
|
|
66
|
+
const isBeforeDisabled = isBeforeDisabledDate(dayDate);
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(day_1.Day, { passedDay: isPassedDay || isBeforeDisabled, comingDay: disableSubsequentDays && dayDate > currentDate, holidays: holidays && holidays.indexOf(day.gregorianDate) !== -1, "data-testid": `day-${idx * 7 + id + 1}`, "data-fadate": `${dayDate}`, disabledDay: week.length === 7 && id === 6, selectedDay: selectedDay === dayDate, selected: variant === 'simple' ? (selected === day.jalaliDate || selected === day.gregorianDate)
|
|
68
68
|
: (((_a = rangeDate.start) === null || _a === void 0 ? void 0 : _a.jalaliDate) === day.jalaliDate || ((_b = rangeDate.start) === null || _b === void 0 ? void 0 : _b.gregorianDate) === day.gregorianDate) ||
|
|
69
69
|
(((_c = rangeDate.end) === null || _c === void 0 ? void 0 : _c.jalaliDate) === day.jalaliDate || ((_d = rangeDate.end) === null || _d === void 0 ? void 0 : _d.gregorianDate) === day.gregorianDate), isRange: rangeDates.indexOf(day.gregorianDate) !== -1, startRange: type === 'jalali'
|
|
70
70
|
? ((_e = rangeDate.start) === null || _e === void 0 ? void 0 : _e.jalaliDate) === day.jalaliDate || ((_f = rangeDate.start) === null || _f === void 0 ? void 0 : _f.gregorianDate) === day.gregorianDate
|
|
71
71
|
: ((_g = rangeDate.end) === null || _g === void 0 ? void 0 : _g.jalaliDate) === day.jalaliDate || ((_h = rangeDate.end) === null || _h === void 0 ? void 0 : _h.gregorianDate) === day.gregorianDate, endRange: type === 'jalali'
|
|
72
72
|
? ((_j = rangeDate.end) === null || _j === void 0 ? void 0 : _j.jalaliDate) === day.jalaliDate || ((_k = rangeDate.end) === null || _k === void 0 ? void 0 : _k.gregorianDate) === day.gregorianDate
|
|
73
|
-
: ((_l = rangeDate.start) === null || _l === void 0 ? void 0 : _l.jalaliDate) === day.jalaliDate || ((_m = rangeDate.start) === null || _m === void 0 ? void 0 : _m.gregorianDate) === day.gregorianDate, handleDay: variant === 'simple' ?
|
|
74
|
-
}) }
|
|
75
|
-
}) })
|
|
73
|
+
: ((_l = rangeDate.start) === null || _l === void 0 ? void 0 : _l.jalaliDate) === day.jalaliDate || ((_m = rangeDate.start) === null || _m === void 0 ? void 0 : _m.gregorianDate) === day.gregorianDate, handleDay: variant === 'simple' ? () => handleDayClick(day) : () => handleRangeClick(day), size: size, ...boolDataset(day.disabled), children: !day.disabled ? (0, config_1.fa)(day.day) : null }, dayDate));
|
|
74
|
+
}) }, `rdp-weeks-${idx}`));
|
|
75
|
+
}) })] })] }));
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
monthName: '',
|
|
79
|
-
disableDays: []
|
|
80
|
-
};
|
|
81
|
-
exports["default"] = Days;
|
|
77
|
+
exports.default = Days;
|
|
82
78
|
//# sourceMappingURL=days.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"days.js","sourceRoot":"","sources":["../../../../calendar/sub-components/days/days.tsx"],"names":[],"mappings":";;;;AACA
|
|
1
|
+
{"version":3,"file":"days.js","sourceRoot":"","sources":["../../../../calendar/sub-components/days/days.tsx"],"names":[],"mappings":";;;;AACA,+EAA8C;AAC9C,oCAAiC;AACjC,yCAA8D;AAC9D,kFAA2C;AAC3C,0FAA0D;AAC1D,8FAA8D;AAC9D,iDAA0D;AAE1D,MAAM,WAAW,GAAG,CAAC,GAAY,EAAE,EAAE;IACnC,IAAI,GAAG,EAAE,CAAC;QACR,OAAO;YACL,cAAc,EAAE,GAAG;SACpB,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,KAAgB,EAAE,EAAE;IAChC,MAAM,EACJ,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,SAAS,GAAG,EAAE,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,WAAW,EACX,IAAI,EACJ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AAI,KAAK,QAAQ;4CACzB,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,GAAG,0CAAE,UAAU,MAAK,GAAG,CAAC,UAAU,IAAI,CAAA,MAAA,SAAS,CAAC,GAAG,0CAAE,aAAa,MAAK,GAAG,CAAC,aAAa;4CACpG,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,KAAK,0CAAE,UAAU,MAAK,GAAG,CAAC,UAAU,IAAI,CAAA,MAAA,SAAS,CAAC,KAAK,0CAAE,aAAa,MAAK,GAAG,CAAC,aAAa,EAE1G,SAAS,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,EACzF,IAAI,EAAE,IAAI,KACN,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,YAC5B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,WAAE,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAzB9B,OAAO,CA0BR,CACP,CAAC;gCACJ,CAAC,CAAC,IAnCwH,aAAa,GAAG,EAAE,CAoCxI,CACP,CAAC;wBACJ,CAAC,CAAC,GACE,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { DaysHeadProps } from './days-head.props';
|
|
2
|
-
declare const DaysHead: ({ decreaseMonth, increaseMonth, monthName, year, disablePreviousMonths, disableSubsequentMonths, days, date, dateFormat, type, changeMonth, size, changeYear }: DaysHeadProps) =>
|
|
3
|
+
declare const DaysHead: ({ decreaseMonth, increaseMonth, monthName, year, disablePreviousMonths, disableSubsequentMonths, days, date, dateFormat, type, changeMonth, size, changeYear }: DaysHeadProps) => React.JSX.Element;
|
|
3
4
|
export default DaysHead;
|
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var handleMonthPoppers = function () {
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ui_kit_1 = require("@pezeshk-book/ui-kit");
|
|
6
|
+
const icons_1 = require("../../icons");
|
|
7
|
+
const react_date_object_1 = tslib_1.__importDefault(require("react-date-object"));
|
|
8
|
+
const persian_1 = tslib_1.__importDefault(require("react-date-object/calendars/persian"));
|
|
9
|
+
const gregorian_1 = tslib_1.__importDefault(require("react-date-object/calendars/gregorian"));
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const tailwind_merge_config_1 = tslib_1.__importDefault(require("../../../tailwind-merge-config"));
|
|
12
|
+
const months_1 = require("../../config/months");
|
|
13
|
+
const persian_to_english_number_1 = require("../../../utils/persian-to-english-number");
|
|
14
|
+
const DaysHead = ({ decreaseMonth, increaseMonth, monthName, year, disablePreviousMonths, disableSubsequentMonths, days, date, dateFormat, type, changeMonth, size = 'medium', changeYear }) => {
|
|
15
|
+
const [monthPopper, setMonthPopper] = (0, react_1.useState)(false);
|
|
16
|
+
const [yearPopper, setYearPopper] = (0, react_1.useState)(false);
|
|
17
|
+
const [selectedYear, setSelectedYear] = (0, react_1.useState)('');
|
|
18
|
+
const handleMonthPoppers = () => {
|
|
20
19
|
setMonthPopper(!monthPopper);
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
const handleYearPoppers = () => {
|
|
23
22
|
setYearPopper(!yearPopper);
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
const handleSelectMonth = (value) => {
|
|
26
25
|
changeMonth(value);
|
|
27
26
|
handleMonthPoppers();
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
const handleYearValue = (e) => {
|
|
30
29
|
setSelectedYear(e.target.value);
|
|
31
30
|
};
|
|
32
|
-
|
|
31
|
+
const handleChangeYear = () => {
|
|
33
32
|
changeYear((0, persian_to_english_number_1.persianToEnglish)(selectedYear));
|
|
34
33
|
handleYearPoppers();
|
|
35
34
|
handleMonthPoppers();
|
|
36
35
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const comparedFromCurrentMonth = (amount) => {
|
|
37
|
+
const sideDatesMonth = new react_date_object_1.default({ date: date, calendar: type === 'gregorian' ? gregorian_1.default : persian_1.default }).add(amount, 'month').setDay(31).format(dateFormat);
|
|
38
|
+
const lastDaySideMonthCalendarShow = new react_date_object_1.default(type === 'gregorian' ? { date: days.at(-1).gregorianDate, calendar: gregorian_1.default } : { date: days.at(-1).jalaliDate, calendar: persian_1.default }).add(amount, 'month').setDay(31).format(dateFormat);
|
|
40
39
|
return sideDatesMonth === lastDaySideMonthCalendarShow;
|
|
41
40
|
};
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(ui_kit_1.Div,
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'justify-center items-center bg-white w-full self-center mb-5', children: (0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'w-full items-center justify-between h-12', children: [(0, jsx_runtime_1.jsx)(ui_kit_1.Button, { ariaLabel: 'previousMonth', variant: 'text', size: 'small', color: 'control', className: 'flex items-center', onClick: decreaseMonth, shape: 'square', disabled: disablePreviousMonths && comparedFromCurrentMonth(-1), children: (0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'h-3 w-2.5 relative', children: (0, jsx_runtime_1.jsx)(icons_1.ArrowRightIcon, {}) }) }), (0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'flex items-center gap-2 relative z-50', children: [(0, jsx_runtime_1.jsxs)(ui_kit_1.Popper, { handlePopper: handleMonthPoppers, showPopper: monthPopper, usePortal: false, className: 'flex-1', position: 'bottom', children: [(0, jsx_runtime_1.jsx)(ui_kit_1.PopperHandler, { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Text, { className: 'cursor-pointer', color: 'grey.900', type: 'bold', typography: 'lg', children: monthName }) }), (0, jsx_runtime_1.jsx)(ui_kit_1.PopperContent, { className: 'shadow-xl', children: (0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: (0, tailwind_merge_config_1.default)('bg-white p-2 md:w-48 w-40 items-center justify-center', size === 'medium' && 'w-56', size === 'large' && 'w-64', size === 'huge' && 'w-72'), children: type === 'gregorian' ? ((0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'grid grid-cols-3 gap-8 justify-between', children: months_1.gregorianMonths.map(month => ((0, jsx_runtime_1.jsx)(ui_kit_1.Button, { className: '!px-0', onClick: () => handleSelectMonth(month.value), variant: 'text', size: size, children: month.name }, month.name))) })) : ((0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'grid grid-cols-3 gap-2', children: months_1.jalaliMonths.map(month => ((0, jsx_runtime_1.jsx)(ui_kit_1.Button, { className: '!px-0', onClick: () => handleSelectMonth(month.value), variant: 'text', size: size, children: month.name }, month.name))) })) }) })] }), (0, jsx_runtime_1.jsxs)(ui_kit_1.Popper, { handlePopper: handleYearPoppers, showPopper: yearPopper, usePortal: false, className: 'flex-1', position: 'bottom', children: [(0, jsx_runtime_1.jsx)(ui_kit_1.PopperHandler, { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Text, { className: 'cursor-pointer', color: 'grey.900', type: 'bold', typography: 'lg', children: year }) }), (0, jsx_runtime_1.jsx)(ui_kit_1.PopperContent, { className: 'shadow-xl rounded-lg', children: (0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: (0, tailwind_merge_config_1.default)('bg-white px-2 py-8 md:w-48 w-40 items-center justify-center flex-col gap-4 rounded-lg', size === 'medium' && 'w-56', size === 'large' && 'w-64', size === 'huge' && 'w-72'), children: [(0, jsx_runtime_1.jsx)(ui_kit_1.TextField, { value: selectedYear, onChange: handleYearValue, label: 'سال', size: size === 'tiny' || size === 'small' ? 'tiny' : 'medium' }), (0, jsx_runtime_1.jsx)(ui_kit_1.Button, { onClick: handleChangeYear, size: size === 'tiny' || size === 'small' ? 'tiny' : 'medium', children: "\u0628\u0631\u0648 \u0628\u0647 \u0633\u0627\u0644" })] }) })] })] }), (0, jsx_runtime_1.jsx)(ui_kit_1.Button, { ariaLabel: 'nextMonth', variant: 'text', size: 'small', color: 'control', className: 'flex items-center', onClick: increaseMonth, shape: 'square', disabled: disableSubsequentMonths && comparedFromCurrentMonth(1), children: (0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'h-3 w-2.5 relative', children: (0, jsx_runtime_1.jsx)(icons_1.ArrowLeftIcon, {}) }) })] }) }));
|
|
43
42
|
};
|
|
44
|
-
exports
|
|
43
|
+
exports.default = DaysHead;
|
|
45
44
|
//# sourceMappingURL=days-head.js.map
|