@pezeshk-book/modules 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/modules/calendar/calendar.d.ts +4 -0
  4. package/dist/modules/calendar/calendar.js +49 -0
  5. package/dist/modules/calendar/calendar.js.map +1 -0
  6. package/dist/modules/calendar/calendar.props.d.ts +4 -0
  7. package/dist/modules/calendar/calendar.props.js +2 -0
  8. package/dist/modules/calendar/calendar.props.js.map +1 -0
  9. package/dist/modules/{calender → calendar}/config/chunk.js.map +1 -1
  10. package/dist/modules/{calender → calendar}/config/daysIn-month.d.ts +2 -3
  11. package/dist/modules/calendar/config/daysIn-month.js +31 -0
  12. package/dist/modules/calendar/config/daysIn-month.js.map +1 -0
  13. package/dist/modules/{calender → calendar}/config/index.d.ts +2 -2
  14. package/dist/modules/calendar/config/index.js +5 -0
  15. package/dist/modules/calendar/config/index.js.map +1 -0
  16. package/dist/modules/calendar/config/week-day.d.ts +2 -0
  17. package/dist/modules/calendar/config/week-day.js +10 -0
  18. package/dist/modules/calendar/config/week-day.js.map +1 -0
  19. package/dist/modules/calendar/icons/index.d.ts +4 -0
  20. package/dist/modules/calendar/icons/index.js +5 -0
  21. package/dist/modules/calendar/icons/index.js.map +1 -0
  22. package/dist/modules/calendar/index.d.ts +2 -0
  23. package/dist/modules/calendar/index.js +3 -0
  24. package/dist/modules/calendar/index.js.map +1 -0
  25. package/dist/modules/calendar/shared/formatDate.d.ts +1 -0
  26. package/dist/modules/calendar/shared/formatDate.js +11 -0
  27. package/dist/modules/calendar/shared/formatDate.js.map +1 -0
  28. package/dist/modules/calendar/sub-components/day/day.d.ts +3 -0
  29. package/dist/modules/calendar/sub-components/day/day.js +25 -0
  30. package/dist/modules/calendar/sub-components/day/day.js.map +1 -0
  31. package/dist/modules/{calender → calendar}/sub-components/day/day.props.d.ts +2 -1
  32. package/dist/modules/calendar/sub-components/day/day.props.js.map +1 -0
  33. package/dist/modules/calendar/sub-components/day/day.style.d.ts +1 -0
  34. package/dist/modules/calendar/sub-components/day/day.style.js +2 -0
  35. package/dist/modules/calendar/sub-components/day/day.style.js.map +1 -0
  36. package/dist/modules/{calender → calendar}/sub-components/days/days.d.ts +2 -2
  37. package/dist/modules/{calender → calendar}/sub-components/days/days.js +11 -7
  38. package/dist/modules/calendar/sub-components/days/days.js.map +1 -0
  39. package/dist/modules/{calender → calendar}/sub-components/days/days.props.d.ts +2 -0
  40. package/dist/modules/calendar/sub-components/days/days.props.js.map +1 -0
  41. package/dist/modules/calendar/sub-components/days-head/days-head.d.ts +4 -0
  42. package/dist/modules/{calender → calendar}/sub-components/days-head/days-head.js +7 -6
  43. package/dist/modules/calendar/sub-components/days-head/days-head.js.map +1 -0
  44. package/dist/modules/calendar/sub-components/days-head/days-head.props.js.map +1 -0
  45. package/dist/modules/slider/slider.d.ts +2 -2
  46. package/dist/stories/calendar/calendar.d.ts +6 -0
  47. package/dist/stories/calendar/calendar.js +11 -0
  48. package/dist/stories/calendar/calendar.js.map +1 -0
  49. package/dist/stories/calendar/calendar.stories.d.ts +6 -0
  50. package/dist/stories/calendar/calendar.stories.js +11 -0
  51. package/dist/stories/calendar/calendar.stories.js.map +1 -0
  52. package/dist/stories/slider.stories.d.ts +6 -0
  53. package/dist/stories/slider.stories.js +13 -0
  54. package/dist/stories/slider.stories.js.map +1 -0
  55. package/dist/stories/wrapper.d.ts +7 -0
  56. package/dist/stories/wrapper.js +11 -0
  57. package/dist/stories/wrapper.js.map +1 -0
  58. package/dist/utils/time-helper.d.ts +0 -1
  59. package/dist/utils/time-helper.js +6 -14
  60. package/dist/utils/time-helper.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/modules/calender/calender.d.ts +0 -4
  63. package/dist/modules/calender/calender.js +0 -46
  64. package/dist/modules/calender/calender.js.map +0 -1
  65. package/dist/modules/calender/calender.props.d.ts +0 -4
  66. package/dist/modules/calender/calender.props.js +0 -2
  67. package/dist/modules/calender/calender.props.js.map +0 -1
  68. package/dist/modules/calender/config/daysIn-month.js +0 -32
  69. package/dist/modules/calender/config/daysIn-month.js.map +0 -1
  70. package/dist/modules/calender/config/index.js +0 -5
  71. package/dist/modules/calender/config/index.js.map +0 -1
  72. package/dist/modules/calender/config/week-day.d.ts +0 -4
  73. package/dist/modules/calender/config/week-day.js +0 -18
  74. package/dist/modules/calender/config/week-day.js.map +0 -1
  75. package/dist/modules/calender/index.d.ts +0 -2
  76. package/dist/modules/calender/index.js +0 -3
  77. package/dist/modules/calender/index.js.map +0 -1
  78. package/dist/modules/calender/sub-components/day/day.d.ts +0 -3
  79. package/dist/modules/calender/sub-components/day/day.js +0 -21
  80. package/dist/modules/calender/sub-components/day/day.js.map +0 -1
  81. package/dist/modules/calender/sub-components/day/day.props.js.map +0 -1
  82. package/dist/modules/calender/sub-components/day/day.style.d.ts +0 -2
  83. package/dist/modules/calender/sub-components/day/day.style.js +0 -8
  84. package/dist/modules/calender/sub-components/day/day.style.js.map +0 -1
  85. package/dist/modules/calender/sub-components/days/days.js.map +0 -1
  86. package/dist/modules/calender/sub-components/days/days.props.js.map +0 -1
  87. package/dist/modules/calender/sub-components/days-head/days-head.d.ts +0 -4
  88. package/dist/modules/calender/sub-components/days-head/days-head.js.map +0 -1
  89. package/dist/modules/calender/sub-components/days-head/days-head.props.js.map +0 -1
  90. /package/dist/modules/{calender → calendar}/config/chunk.d.ts +0 -0
  91. /package/dist/modules/{calender → calendar}/config/chunk.js +0 -0
  92. /package/dist/modules/{calender → calendar}/sub-components/day/day.props.js +0 -0
  93. /package/dist/modules/{calender → calendar}/sub-components/days/days.props.js +0 -0
  94. /package/dist/modules/{calender → calendar}/sub-components/days-head/days-head.props.d.ts +0 -0
  95. /package/dist/modules/{calender → calendar}/sub-components/days-head/days-head.props.js +0 -0
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import Slider from './modules/slider';
2
- import Calendar from './modules/calender';
2
+ import Calendar from './modules/calendar';
3
3
  export { Slider, Calendar };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import Slider from './modules/slider';
2
- import Calendar from './modules/calender';
2
+ import Calendar from './modules/calendar';
3
3
  export { Slider, Calendar };
4
4
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { CalendarProps } from "./calendar.props";
3
+ declare const Calender: ({ selectedDate, onChange }: CalendarProps) => React.JSX.Element;
4
+ export default Calender;
@@ -0,0 +1,49 @@
1
+ import { __assign } from "tslib";
2
+ import React, { useEffect, useState } from "react";
3
+ import Days from "./sub-components/days/days";
4
+ import { daysInMonth } from "./config/daysIn-month";
5
+ import formatDate from './shared/formatDate';
6
+ import { Div } from '@pezeshk-book/ui-kit';
7
+ import DateObject from "react-date-object";
8
+ var Calender = function (_a) {
9
+ var _b = _a.selectedDate, selectedDate = _b === void 0 ? new Date() : _b, onChange = _a.onChange;
10
+ var date = new DateObject(selectedDate = new Date());
11
+ var _c = useState(''), startDate = _c[0], setStartDate = _c[1];
12
+ var _d = useState({
13
+ value: formatDate(selectedDate, 'YYYY/MM/DD'),
14
+ cloneDays: date,
15
+ monthName: "",
16
+ month: "",
17
+ year: "",
18
+ days: []
19
+ }), datepicker = _d[0], setDatepicker = _d[1];
20
+ useEffect(function () {
21
+ var _a = daysInMonth(datepicker.cloneDays), monthName = _a.monthName, month = _a.month, days = _a.days, year = _a.year;
22
+ setDatepicker(__assign(__assign({}, datepicker), { year: year, monthName: monthName, month: month, days: days, initialValue: null }));
23
+ });
24
+ var changeMonths = function (amount) {
25
+ setDatepicker(__assign(__assign({}, datepicker), { cloneDays: datepicker.cloneDays.add(amount, "month") }));
26
+ };
27
+ var selectDay = function (e) {
28
+ var faDate = e.target.dataset.fadate;
29
+ setDatepicker(__assign(__assign({}, datepicker), { value: faDate }));
30
+ };
31
+ var daysEventListeners = function () {
32
+ return {
33
+ onClick: selectDay
34
+ };
35
+ };
36
+ var startDateHandler = function (day) {
37
+ if (day) {
38
+ setStartDate(day.faDate);
39
+ }
40
+ else {
41
+ setStartDate('');
42
+ }
43
+ onChange(startDate);
44
+ };
45
+ return (React.createElement(Div, { dir: 'rtl', className: "items-center flex flex-col justify-center bg-white rounded py-4" },
46
+ React.createElement(Days, { days: datepicker.days, monthName: datepicker.monthName, year: datepicker.year, selectedDay: datepicker.value, daysEventListeners: daysEventListeners, selectStartDateHandler: startDateHandler, startDate: startDate, increaseMonth: function () { return changeMonths(1); }, decreaseMonth: function () { return changeMonths(-1); }, isDatePicker: true })));
47
+ };
48
+ export default Calender;
49
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../modules/calendar/calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAE9C,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAA;AACxC,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAY3C,IAAM,QAAQ,GAAG,UAAC,EAAoD;QAAnD,oBAAyB,EAAzB,YAAY,mBAAG,IAAI,IAAI,EAAE,KAAA,EAAE,QAAQ,cAAA;IAEpD,IAAM,IAAI,GAAG,IAAI,UAAU,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,CAAA;IAEhD,IAAA,KAA4B,QAAQ,CAAS,EAAE,CAAC,EAA/C,SAAS,QAAA,EAAE,YAAY,QAAwB,CAAC;IACjD,IAAA,KAA8B,QAAQ,CAAS;QACnD,KAAK,EAAE,UAAU,CAAC,YAAY,EAAE,YAAY,CAAC;QAC7C,SAAS,EAAE,IAAI;QACf,SAAS,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,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,SAAS,EAAE,UAAU,CAAC,SAAS,EAC/B,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,WAAW,EAAE,UAAU,CAAC,KAAK,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,gBAAgB,EACxC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAM,OAAA,YAAY,CAAC,CAAC,CAAC,EAAf,CAAe,EACpC,aAAa,EAAE,cAAM,OAAA,YAAY,CAAC,CAAC,CAAC,CAAC,EAAhB,CAAgB,EACrC,YAAY,SACZ,CACE,CACP,CAAC;AACJ,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,4 @@
1
+ export interface CalendarProps {
2
+ selectedDate: string | Date;
3
+ onChange: (e: any) => void;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=calendar.props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.props.js","sourceRoot":"","sources":["../../../modules/calendar/calendar.props.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../../../modules/calender/config/chunk.ts"],"names":[],"mappings":"AAAA,SAAS,KAAK,CAAC,KAAS,EAAE,KAAa,EAAE,GAAW;IAClD,IAAI,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,CAAC;KACX;IACD,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAClC,GAAG,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAEvC,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,KAAK,GAAG,CA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EAAE;QACvB,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;KACtC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,KAAU,EAAE,IAAS;IACzC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACzB,IAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IAChD,IAAI,CAAC,MAAM,IAAI,IAAI,GAAG,CAAC,EAAE;QACvB,OAAO,EAAE,CAAC;KACX;IACD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAM,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAEnD,OAAO,KAAK,GAAG,MAAM,EAAE;QACrB,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;KAC3D;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,6 +1,5 @@
1
- import { Moment } from "jalali-moment";
2
1
  export interface IDays {
3
- day: string;
2
+ day: number;
4
3
  utc: string;
5
4
  faDate: string;
6
5
  disabled: boolean;
@@ -12,4 +11,4 @@ export interface IDaysInMonth {
12
11
  today?: string;
13
12
  year: string;
14
13
  }
15
- export declare const daysInMonth: (date: Moment) => IDaysInMonth;
14
+ export declare const daysInMonth: (date: any) => IDaysInMonth;
@@ -0,0 +1,31 @@
1
+ import { __spreadArray } from "tslib";
2
+ import persian from "react-date-object/calendars/persian";
3
+ import persian_fa from "react-date-object/locales/persian_fa";
4
+ import DateObject from "react-date-object";
5
+ export var daysInMonth = function (date) {
6
+ date.calendar = persian;
7
+ date.locale = persian_fa;
8
+ var monthName = date.month.name;
9
+ var month = date.month, year = date.year;
10
+ var firstDayWeekDay = new DateObject({ date: "".concat(year, " ").concat(month, " 1"), calendar: persian }).weekDay.number;
11
+ // Calculate the number of empty cells needed before the first day of the month
12
+ var emptyCellsCount = (firstDayWeekDay + 6) % 7;
13
+ var lastDayOfPreviousMonth = new DateObject({ date: "".concat(year, " ").concat(month - 1, " 31"), calendar: persian });
14
+ // Calculate the empty days from the previous month
15
+ var emptyDays = __spreadArray([], Array(emptyCellsCount), true).map(function (_, i) { return lastDayOfPreviousMonth.month.length - emptyCellsCount + i + 1; });
16
+ // Create an array of day objects for the current month
17
+ var currentMonthDays = Array.from({ length: date.month.length }, function (_, i) {
18
+ var dayNumber = i + 1;
19
+ var utc = new DateObject({ date: ("".concat(year, " ").concat(month, " ").concat(dayNumber)), calendar: persian }).format("YYYY-MM-DD");
20
+ var faDate = new DateObject({ date: ("".concat(year, " ").concat(month, " ").concat(dayNumber)), calendar: persian }).format();
21
+ return { day: dayNumber, utc: utc, faDate: faDate, disabled: false };
22
+ });
23
+ var allDays = __spreadArray(__spreadArray([], emptyDays.map(function (day) { return ({
24
+ day: day,
25
+ utc: new DateObject({ date: ("".concat(year, " ").concat(month, " ").concat(day)), calendar: persian }).format("YYYY-MM-DD"),
26
+ faDate: new DateObject({ date: ("".concat(year, " ").concat(month, " ").concat(day)), calendar: persian }).format(),
27
+ disabled: true
28
+ }); }), true), currentMonthDays, true);
29
+ return { monthName: monthName, month: month, days: allDays, year: year };
30
+ };
31
+ //# sourceMappingURL=daysIn-month.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daysIn-month.js","sourceRoot":"","sources":["../../../../modules/calendar/config/daysIn-month.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,qCAAqC,CAAC;AAC1D,OAAO,UAAU,MAAM,sCAAsC,CAAC;AAC9D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAiB3C,M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,MAAM,CAAC,YAAY,CAAC,CAAC;QAC/G,IAAM,MAAM,GAAG,IAAI,UAAU,CAAC,EAAC,IAAI,EAAE,CAAC,UAAG,IAAI,cAAI,KAAK,cAAI,SAAS,CAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACtG,OAAO,EAAC,GAAG,EAAE,SAAS,EAAE,GAAG,KAAA,EAAE,MAAM,QAAA,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,IAAM,OAAO,mCAAO,SAAS,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,CAAC;QAC1C,GAAG,KAAA;QACH,GAAG,EAAE,IAAI,UAAU,CAAC,EAAC,IAAI,EAAE,CAAC,UAAG,IAAI,cAAI,KAAK,cAAI,GAAG,CAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QAChG,MAAM,EAAE,IAAI,UAAU,CAAC,EAAC,IAAI,EAAE,CAAC,UAAG,IAAI,cAAI,KAAK,cAAI,GAAG,CAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAC,MAAM,EAAE;QACvF,QAAQ,EAAE,IAAI;KACf,CAAC,EALyC,CAKzC,CAAC,SAAK,gBAAgB,OAAC,CAAC;IAE1B,OAAO,EAAC,SAAS,WAAA,EAAE,KAAK,OAAA,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,MAAA,EAAC,CAAC;AACjD,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { fa, formatJalaliDate, weekDayNames } from "./week-day";
1
+ import { fa, weekDayNames } from "./week-day";
2
2
  import { chunk } from './chunk';
3
3
  import { daysInMonth, IDays, IDaysInMonth } from './daysIn-month';
4
- export { daysInMonth, fa, formatJalaliDate, weekDayNames, chunk };
4
+ export { daysInMonth, fa, weekDayNames, chunk };
5
5
  export type { IDaysInMonth, IDays, };
@@ -0,0 +1,5 @@
1
+ import { fa, weekDayNames } from "./week-day";
2
+ import { chunk } from './chunk';
3
+ import { daysInMonth } from './daysIn-month';
4
+ export { daysInMonth, fa, weekDayNames, chunk };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/calendar/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAE,YAAY,EAAC,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,WAAW,EAAsB,MAAM,gBAAgB,CAAA;AAE/D,OAAO,EACL,WAAW,EACX,EAAE,EACF,YAAY,EACZ,KAAK,EACN,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const fa: (n: any) => any;
2
+ export declare const weekDayNames: string[];
@@ -0,0 +1,10 @@
1
+ export var fa = function (n) {
2
+ if (process.env.NODE_ENV === "test") {
3
+ return n;
4
+ }
5
+ return Number(n).toLocaleString("fa", {
6
+ useGrouping: false
7
+ });
8
+ };
9
+ export var weekDayNames = ["ش", "ی", "د", "س", "چ", "پ", "ج"];
10
+ //# sourceMappingURL=week-day.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"week-day.js","sourceRoot":"","sources":["../../../../modules/calendar/config/week-day.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,EAAE,GAAG,UAAC,CAAM;IACvB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;QACnC,OAAO,CAAC,CAAC;KACV;IACD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE;QACpC,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import ArrowLeftIcon from './arrow-left.svg';
2
+ import ArrowRightIcon from './arrow-right.svg';
3
+ import CalendarIcon from './calendar.svg';
4
+ export { CalendarIcon, ArrowLeftIcon, ArrowRightIcon };
@@ -0,0 +1,5 @@
1
+ import ArrowLeftIcon from './arrow-left.svg';
2
+ import ArrowRightIcon from './arrow-right.svg';
3
+ import CalendarIcon from './calendar.svg';
4
+ export { CalendarIcon, ArrowLeftIcon, ArrowRightIcon };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/calendar/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAC5C,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACf,CAAA"}
@@ -0,0 +1,2 @@
1
+ import Calendar from './calendar';
2
+ export default Calendar;
@@ -0,0 +1,3 @@
1
+ import Calendar from './calendar';
2
+ export default Calendar;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../modules/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,eAAe,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ export default function formatDate(data: Date | number | string, format: 'YYYY/MM/DD'): string | null;
@@ -0,0 +1,11 @@
1
+ import DateObject from "react-date-object";
2
+ import persian from "react-date-object/calendars/persian";
3
+ export default function formatDate(data, format) {
4
+ if (data) {
5
+ var date = new DateObject(data);
6
+ date.calendar = persian;
7
+ return date.format(format);
8
+ }
9
+ return null;
10
+ }
11
+ //# sourceMappingURL=formatDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../../../../modules/calendar/shared/formatDate.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,OAAO,MAAM,qCAAqC,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,IAA4B,EAAE,MAAoB;IACnF,IAAI,IAAI,EAAE;QACR,IAAM,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;QACjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;KAC5B;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { DayProps } from "./day.props";
3
+ export declare const Day: (props: DayProps) => React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { __assign } from "tslib";
2
+ import React from "react";
3
+ import { DAY_CONTAINER } from "./day.style";
4
+ import classNames from '../../../../utils/class-names';
5
+ import { Button } from '@pezeshk-book/ui-kit';
6
+ export var Day = function (props) {
7
+ var children = props.children, disabledDay = props.disabledDay, holidays = props.holidays, passedDay = props.passedDay, selectedDay = props.selectedDay, startDate = props.startDate, handleDay = props.handleDay;
8
+ if (!children) {
9
+ return React.createElement(Button, __assign({ variant: 'text', size: 'tiny', shape: 'square', className: classNames(DAY_CONTAINER, 'cursor-default') }, props));
10
+ }
11
+ if (passedDay) {
12
+ return React.createElement(Button, __assign({ size: 'tiny', variant: 'contained', color: 'control', shape: 'square', className: classNames(DAY_CONTAINER, 'cursor-not-allowed') }, props));
13
+ }
14
+ if (startDate) {
15
+ return React.createElement(Button, __assign({ size: 'tiny', variant: 'contained', color: 'success', shape: 'square', className: classNames(DAY_CONTAINER, 'cursor-pointer'), onClick: handleDay }, props));
16
+ }
17
+ if (disabledDay || holidays) {
18
+ return React.createElement(Button, __assign({ size: 'tiny', color: 'danger', shape: 'square', className: classNames(DAY_CONTAINER, 'cursor-pointer'), onClick: handleDay }, props));
19
+ }
20
+ if (selectedDay) {
21
+ return React.createElement(Button, __assign({ size: 'tiny', variant: 'contained', color: 'primary', shape: 'square', className: classNames(DAY_CONTAINER, 'cursor-pointer'), onClick: handleDay }, props));
22
+ }
23
+ return React.createElement(Button, __assign({ variant: 'text', size: 'tiny', shape: 'square', color: 'purple', className: classNames(DAY_CONTAINER), onClick: handleDay }, props));
24
+ };
25
+ //# sourceMappingURL=day.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"day.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/day/day.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,UAAU,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAA;AAE3C,MAAM,CAAC,IAAM,GAAG,GAAG,UAAC,KAAe;IAC1B,IAAA,QAAQ,GAAyE,KAAK,SAA9E,EAAE,WAAW,GAA4D,KAAK,YAAjE,EAAE,QAAQ,GAAkD,KAAK,SAAvD,EAAE,SAAS,GAAuC,KAAK,UAA5C,EAAE,WAAW,GAA0B,KAAK,YAA/B,EAAE,SAAS,GAAe,KAAK,UAApB,EAAE,SAAS,GAAI,KAAK,UAAT,CAAU;IAE9F,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,oBAAC,MAAM,aACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,UAAU,CACnB,aAAa,EACb,gBAAgB,CACjB,IACG,KAAK,EAAG,CAAA;KACf;IACD,IAAI,SAAS,EAAE;QACb,OAAO,oBAAC,MAAM,aACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,UAAU,CACnB,aAAa,EACb,oBAAoB,CACrB,IACG,KAAK,EAAG,CAAA;KACf;IACD,IAAI,SAAS,EAAE;QACb,OAAO,oBAAC,MAAM,aACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,UAAU,CACnB,aAAa,EACb,gBAAgB,CACjB,EACD,OAAO,EAAE,SAAS,IACd,KAAK,EAAG,CAAA;KACf;IACD,IAAI,WAAW,IAAI,QAAQ,EAAE;QAC3B,OAAO,oBAAC,MAAM,aACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,UAAU,CACnB,aAAa,EACb,gBAAgB,CACjB,EACD,OAAO,EAAE,SAAS,IACd,KAAK,EAAG,CAAC;KAChB;IACD,IAAI,WAAW,EAAE;QACf,OAAO,oBAAC,MAAM,aACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,UAAU,CACnB,aAAa,EACb,gBAAgB,CACjB,EACD,OAAO,EAAE,SAAS,IACd,KAAK,EAAG,CAAC;KAChB;IACD,OAAO,oBAAC,MAAM,aACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,UAAU,CACnB,aAAa,CACd,EACD,OAAO,EAAE,SAAS,IACd,KAAK,EAAG,CAAA;AAChB,CAAC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  export interface DayProps {
2
2
  isSelecting?: boolean;
3
- daysEvent?: () => void;
4
3
  selectedDay?: boolean;
4
+ startDate: boolean;
5
+ handleDay: () => void;
5
6
  children: any;
6
7
  disabledDay?: boolean;
7
8
  holidays?: boolean;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"day.props.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/day/day.props.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare const DAY_CONTAINER = "flex justify-center mx-2.5 md:mx-5 items-center my-2 text-center relative rounded-full font-family-medium";
@@ -0,0 +1,2 @@
1
+ export var DAY_CONTAINER = 'flex justify-center mx-2.5 md:mx-5 items-center my-2 text-center relative rounded-full font-family-medium';
2
+ //# sourceMappingURL=day.style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"day.style.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/day/day.style.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,aAAa,GAAG,2GAA2G,CAAA"}
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import { DaysProps } from './days.props';
3
3
  declare const Days: {
4
- (props: DaysProps): JSX.Element | null;
4
+ (props: DaysProps): React.JSX.Element | null;
5
5
  defaultProps: {
6
6
  monthName: string;
7
7
  disableDays: never[];
@@ -3,8 +3,8 @@ import React from "react";
3
3
  import DaysHead from "../days-head/days-head";
4
4
  import { Day } from "../day/day";
5
5
  import { chunk, fa, weekDayNames } from '../../config';
6
- import moment from "jalali-moment";
7
- import { convertDate } from "../../../../utils/time-helper";
6
+ import DateObject from "react-date-object";
7
+ import persian from "react-date-object/calendars/persian";
8
8
  import { Div, Text } from '@pezeshk-book/ui-kit';
9
9
  var boolDataset = function (arg) {
10
10
  if (arg) {
@@ -14,18 +14,22 @@ var boolDataset = function (arg) {
14
14
  }
15
15
  return null;
16
16
  };
17
- var tempHolidays = ['2022-09-17', '2022-09-25', '2022-09-27', '2022-10-05', '2022-12-27', '2023-02-04', '2023-02-11', '2023-02-18', '2023-03-08', '2023-03-20'];
17
+ var tempHolidays = ['2023-05-15', '2022-09-25', '2022-09-27', '2022-10-05', '2022-12-27', '2023-02-04', '2023-02-11', '2023-02-18', '2023-03-08', '2023-03-20'];
18
18
  var Days = function (props) {
19
- var days = props.days, daysEventListeners = props.daysEventListeners, monthName = props.monthName, increaseMonth = props.increaseMonth, decreaseMonth = props.decreaseMonth, selectedDay = props.selectedDay, year = props.year;
19
+ var days = props.days, startDate = props.startDate, selectStartDateHandler = props.selectStartDateHandler, monthName = props.monthName, increaseMonth = props.increaseMonth, decreaseMonth = props.decreaseMonth, selectedDay = props.selectedDay, year = props.year;
20
+ var handleDayClick = function (day) {
21
+ selectStartDateHandler(day);
22
+ };
23
+ var weeks = chunk(days, 7);
24
+ var date = new DateObject({ calendar: persian }).format("YYYY/MM/DD");
20
25
  if (!days.length) {
21
26
  return null;
22
27
  }
23
- var weeks = chunk(days, 7);
24
28
  return (React.createElement(Div, { className: 'flex-1 w-[390px] md:w-[560px] px-9 flex-col self-center relative overflow-auto mx-1 bg-white' },
25
29
  React.createElement(DaysHead, { year: year, monthName: monthName, increaseMonth: increaseMonth, decreaseMonth: decreaseMonth }),
26
30
  React.createElement(Div, { className: 'flex-col items-center flex-1 border-separate border-spacing-x-2', "data-testid": "days-wrapper" },
27
- React.createElement(Div, { className: 'items-center self-center w-full justify-between h-[29px] text-white border-b border-tertiary pb-2 mb-2 px-5 md:px-3 md:pr-6 !flex-row' }, weekDayNames.map(function (name) { return (React.createElement(Text, { type: "regular", typography: "lg", color: "grey.300", key: name }, name)); })),
28
- weeks.map(function (week, idx) { return (React.createElement("ul", { className: 'flex m-0 px-2 md:px-0 list-none w-full items-end justify-start self-center', "data-testid": "days", key: "rdp-weeks-".concat(idx) }, week.map(function (day, id) { return (React.createElement(Day, __assign({ key: day.utc, passedDay: convertDate(Date.now(), 'YYYY/MM/DD') === day.faDate ? false : !moment(day.faDate).isAfter(convertDate(Date.now(), 'YYYY/MM/DD')), holidays: tempHolidays.indexOf(day.utc) !== -1, "data-testid": "day-".concat(idx * 7 + id + 1), "data-fadate": "".concat(day.faDate), daysEvent: daysEventListeners, disabledDay: week.length === 7 && id === 6, selectedDay: selectedDay === day.faDate }, boolDataset(day.disabled)), !day.disabled ? fa(day.day) : null)); }))); }))));
31
+ React.createElement(Div, { className: 'items-center self-center w-full justify-between h-[29px] text-white border-b border-tertiary pb-2 mb-2 px-5 md:px-3 md:pr-6 !flex-row' }, weekDayNames.map(function (name) { return (React.createElement(Text, { type: "regular", typography: "lg", color: "black", key: name }, name)); })),
32
+ weeks.map(function (week, idx) { return (React.createElement("ul", { className: 'flex m-0 md:px-0 list-none w-full last:justify-start items-end justify-between self-center ', "data-testid": "days", key: "rdp-weeks-".concat(idx) }, week.map(function (day, id) { return (React.createElement(Day, __assign({ key: day.utc, passedDay: day.faDate < date, holidays: tempHolidays.indexOf(day.utc) !== -1, "data-testid": "day-".concat(idx * 7 + id + 1), "data-fadate": "".concat(day.faDate), disabledDay: week.length === 7 && id === 6, selectedDay: selectedDay === day.faDate, startDate: startDate === day.faDate, handleDay: function () { return handleDayClick(day); } }, boolDataset(day.disabled)), !day.disabled ? fa(day.day) : null)); }))); }))));
29
33
  };
30
34
  Days.defaultProps = {
31
35
  monthName: "",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"days.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days/days.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,KAAK,EAAE,EAAE,EAAS,YAAY,EAAC,MAAM,cAAc,CAAA;AAC3D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,OAAO,MAAM,qCAAqC,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,sBAAsB,CAAA;AAE9C,IAAM,WAAW,GAAG,UAAC,GAAY;IAC/B,IAAI,GAAG,EAAE;QACP,OAAO;YACL,cAAc,EAAE,GAAG;SACpB,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,IAAM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
  isDatePicker: boolean;
9
+ startDate: string;
10
+ selectStartDateHandler: any;
9
11
  year: string;
10
12
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"days.props.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days/days.props.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { DaysHeadProps } from "./days-head.props";
3
+ declare const DaysHead: (props: DaysHeadProps) => React.JSX.Element;
4
+ export default DaysHead;
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import moment from "jalali-moment";
3
3
  import { fa } from "../../config";
4
4
  import { Button, Div, Text } from '@pezeshk-book/ui-kit';
5
+ import { ArrowLeftIcon, ArrowRightIcon, CalendarIcon } from '../../icons';
5
6
  var DaysHead = function (props) {
6
7
  var decreaseMonth = props.decreaseMonth, increaseMonth = props.increaseMonth, monthName = props.monthName, endDate = props.endDate, startDate = props.startDate, year = props.year;
7
8
  var backDisable = "".concat(moment(startDate).locale("fa").format("jMMMM"), " ").concat(fa(moment(startDate).format("jYYYY"))) === monthName;
@@ -13,15 +14,15 @@ var DaysHead = function (props) {
13
14
  "\u0633\u0627\u0644 ",
14
15
  year)),
15
16
  React.createElement(Div, { className: 'items-center mr-8' },
16
- React.createElement(Button, { variant: "text", size: 'small', className: 'flex items-center', onClick: increaseMonth, shape: 'circle', disabled: forward },
17
+ React.createElement(Button, { variant: "text", size: 'small', className: 'flex items-center', onClick: increaseMonth, shape: 'square', disabled: forward },
17
18
  React.createElement(Div, { className: 'h-3 w-[6px] relative' },
18
- React.createElement(Text, null, "\u0645\u0627\u0647 \u0628\u0639\u062F"))),
19
- React.createElement(Text, { className: 'mx-1', color: "grey.900", type: 'bold', typography: "xxxl" }, monthName),
20
- React.createElement(Button, { variant: "text", size: 'small', className: 'flex items-center', onClick: decreaseMonth, shape: 'circle', disabled: backDisable },
19
+ React.createElement("img", { src: ArrowLeftIcon, className: 'w-full h-full object-contain', alt: 'ماه بعد' }))),
20
+ React.createElement(Text, { className: 'mx-1', color: "grey.900", type: 'bold', typography: "xxl" }, monthName),
21
+ React.createElement(Button, { variant: "text", size: 'small', className: 'flex items-center', onClick: decreaseMonth, shape: 'square', disabled: backDisable },
21
22
  React.createElement(Div, { className: 'h-3 w-[6px] relative' },
22
- React.createElement(Text, null, "\u0645\u0627\u0647 \u0642\u0628\u0644")))),
23
+ React.createElement("img", { src: ArrowRightIcon, className: 'w-full h-full object-contain', alt: 'ماه قبل' })))),
23
24
  React.createElement(Div, { className: 'relative w-[19px] h-[22px]' },
24
- React.createElement(Text, null, "\u062A\u0642\u0648\u06CC\u0645")))));
25
+ React.createElement("img", { src: CalendarIcon, alt: 'تقویم' })))));
25
26
  };
26
27
  export default DaysHead;
27
28
  //# sourceMappingURL=days-head.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"days-head.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days-head/days-head.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAC,MAAM,aAAa,CAAA;AAEvE,IAAM,QAAQ,GAAG,UAAC,KAAoB;IAC7B,IAAA,aAAa,GAAwD,KAAK,cAA7D,EAAE,aAAa,GAAyC,KAAK,cAA9C,EAAE,SAAS,GAA8B,KAAK,UAAnC,EAAE,OAAO,GAAqB,KAAK,QAA1B,EAAE,SAAS,GAAU,KAAK,UAAf,EAAE,IAAI,GAAI,KAAK,KAAT,CAAU;IAElF,IAAM,WAAW,GAAG,UAAG,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAI,EAA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,GAAG,IAAC,SAAS,EAAE,sBAAsB;wBACpC,6BAAK,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,8BAA8B,EAAE,GAAG,EAAE,SAAS,GAAG,CAClF,CACC,CACL;YACN,oBAAC,GAAG,IAAC,SAAS,EAAE,4BAA4B;gBAC1C,6BAAK,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,OAAO,GAAG,CACnC,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"days-head.props.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days-head/days-head.props.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { SliderProps } from './slider.props';
3
- declare const Slider: ({ children, delay, spaceBetween, slides, infiniteLoop, pauseOnMouseOver, autoMove, indicatorActiveColor, indicator, navigation, prevNavigation, nextNavigation, }: SliderProps) => JSX.Element;
3
+ declare const Slider: ({ children, delay, spaceBetween, slides, infiniteLoop, pauseOnMouseOver, autoMove, indicatorActiveColor, indicator, navigation, prevNavigation, nextNavigation, }: SliderProps) => React.JSX.Element;
4
4
  export default Slider;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CalendarProps } from "../../modules/calendar/calendar.props";
3
+ /**
4
+ * Primary UI component for user interaction
5
+ */
6
+ export declare const Calendar: ({ ...props }: CalendarProps) => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { __assign, __rest } from "tslib";
2
+ import React from 'react';
3
+ import CustomCalendar from '../../modules/calendar';
4
+ /**
5
+ * Primary UI component for user interaction
6
+ */
7
+ export var Calendar = function (_a) {
8
+ var props = __rest(_a, []);
9
+ return (React.createElement(CustomCalendar, __assign({}, props)));
10
+ };
11
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../stories/calendar/calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,wBAAwB,CAAA;AAGnD;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAC,EAAyB;QAArB,KAAK,cAAT,EAAU,CAAD;IAChC,OAAO,CACL,oBAAC,cAAc,eAAK,KAAK,EAAG,CAC7B,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
3
+ import { CalendarProps } from "../../modules/calendar/calendar.props";
4
+ declare const _default: ComponentMeta<({ ...props }: CalendarProps) => React.JSX.Element>;
5
+ export default _default;
6
+ export declare const Default: ComponentStory<({ ...props }: CalendarProps) => React.JSX.Element>;
@@ -0,0 +1,11 @@
1
+ import { __assign } from "tslib";
2
+ import React from "react";
3
+ import { Calendar } from "./calendar";
4
+ export default {
5
+ title: "Calendar",
6
+ component: Calendar,
7
+ argTypes: {}
8
+ };
9
+ var Template = function (args) { return React.createElement(Calendar, __assign({}, args)); };
10
+ export var Default = Template.bind({});
11
+ //# sourceMappingURL=calendar.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.stories.js","sourceRoot":"","sources":["../../../stories/calendar/calendar.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpC,eAAe;IACb,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,EAAE;CACqB,CAAC;AAEpC,IAAM,QAAQ,GAAoC,UAAC,IAAmB,IAAK,OAAA,oBAAC,QAAQ,eAAK,IAAI,EAAI,EAAtB,CAAsB,CAAC;AAElG,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
3
+ import { SliderProps } from "../modules/slider/slider.props";
4
+ declare const _default: ComponentMeta<({ children, delay, spaceBetween, slides, infiniteLoop, pauseOnMouseOver, autoMove, indicatorActiveColor, indicator, navigation, prevNavigation, nextNavigation, }: SliderProps) => React.JSX.Element>;
5
+ export default _default;
6
+ export declare const Default: ComponentStory<({ children, delay, spaceBetween, slides, infiniteLoop, pauseOnMouseOver, autoMove, indicatorActiveColor, indicator, navigation, prevNavigation, nextNavigation, }: SliderProps) => React.JSX.Element>;
@@ -0,0 +1,13 @@
1
+ import { __assign, __rest } from "tslib";
2
+ import React from "react";
3
+ import Slider from "../modules/slider/index";
4
+ export default {
5
+ title: "Slider",
6
+ component: Slider
7
+ };
8
+ var Template = function (_a) {
9
+ var args = __rest(_a, []);
10
+ return React.createElement(Slider, __assign({}, args));
11
+ };
12
+ export var Default = Template.bind({});
13
+ //# sourceMappingURL=slider.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slider.stories.js","sourceRoot":"","sources":["../../stories/slider.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAI7C,eAAe;IACb,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,MAAM;CACc,CAAC;AAElC,IAAM,QAAQ,GAAkC,UAAC,EAAsB;QAAlB,IAAI,cAAR,EAAS,CAAD;IAAmB,OAAA,oBAAC,MAAM,eAAK,IAAI,EAAI,CAAA;CAAA,CAAC;AAEjG,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from "react";
2
+ export declare const Wrapper: ({ title, children, className, titleColor }: {
3
+ title: string;
4
+ children: ReactNode;
5
+ className?: string | undefined;
6
+ titleColor?: string | undefined;
7
+ }) => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { Text } from "@pezeshk-book/ui-kit";
3
+ export var Wrapper = function (_a) {
4
+ var title = _a.title, children = _a.children, className = _a.className, titleColor = _a.titleColor;
5
+ return (React.createElement("div", { className: "flex gap-2 items-center ".concat(className) },
6
+ React.createElement(Text, { direction: 'ltr', align: "left", className: "".concat(titleColor, " min-w-[100px] whitespace-nowrap") },
7
+ title,
8
+ ":"),
9
+ children));
10
+ };
11
+ //# sourceMappingURL=wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../stories/wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,IAAI,EAAC,MAAM,sBAAsB,CAAC;AAE1C,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,EAAyH;QAAxH,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,UAAU,gBAAA;IAC7D,OAAO,CACL,6BAAK,SAAS,EAAE,kCAA2B,SAAS,CAAE;QACpD,oBAAC,IAAI,IAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAG,UAAU,qCAAkC;YAAG,KAAK;gBAAS;QACjH,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,5 +1,4 @@
1
1
  export declare const addDays: (date: any, number: number) => Date;
2
- export declare const convertDate: (date: string | number | Date, format?: string) => any;
3
2
  export declare const timeDifference: (date: Date) => number;
4
3
  export declare const timeIsAfter: (date: string | Date, timeDestination?: string | Date) => any;
5
4
  export declare const momentFormat: (format: string) => any;
@@ -2,26 +2,18 @@ export var addDays = function (date, number) {
2
2
  var newDate = new Date(date);
3
3
  return new Date(newDate.setDate(newDate.getDate() + number));
4
4
  };
5
- export var convertDate = function (date, format) {
6
- if (format === void 0) { format = "YYYY-MM-DD"; }
7
- if (date) {
8
- var moment_1 = require('jalali-moment');
9
- return moment_1(date).locale('fa').format(format);
10
- }
11
- return null;
12
- };
13
5
  export var timeDifference = function (date) {
14
6
  if (date) {
15
- var moment_2 = require('jalali-moment');
16
- return Math.abs(moment_2().diff(date, 'seconds'));
7
+ var moment = require('jalali-moment');
8
+ return Math.abs(moment().diff(date, 'seconds'));
17
9
  }
18
10
  return 0;
19
11
  };
20
12
  export var timeIsAfter = function (date, timeDestination) {
21
13
  if (timeDestination === void 0) { timeDestination = new Date(); }
22
14
  if (date) {
23
- var moment_3 = require('moment');
24
- return moment_3(date).isAfter(timeDestination);
15
+ var moment = require('moment');
16
+ return moment(date).isAfter(timeDestination);
25
17
  }
26
18
  return false;
27
19
  };
@@ -31,8 +23,8 @@ export var momentFormat = function (format) {
31
23
  };
32
24
  export var timePassed = function (date) {
33
25
  if (date) {
34
- var moment_4 = require('jalali-moment');
35
- return moment_4(date).locale("fa").fromNow();
26
+ var moment = require('jalali-moment');
27
+ return moment(date).locale("fa").fromNow();
36
28
  }
37
29
  return null;
38
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"time-helper.js","sourceRoot":"","sources":["../../utils/time-helper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,IAAS,EAAE,MAAc;IAC/C,IAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,IAA4B,EAAE,MAAqB;IAArB,uBAAA,EAAA,qBAAqB;IAC7E,IAAI,IAAI,EAAE;QACR,IAAI,QAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAEtC,OAAO,QAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC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AE,CAAC;KAC5C;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pezeshk-book/modules",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.ts",
6
6
  "module": "./dist/index.js",
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { CalenderProps } from "./calender.props";
3
- declare const Calender: (props: CalenderProps) => JSX.Element;
4
- export default Calender;
@@ -1,46 +0,0 @@
1
- import { __assign, __spreadArray } from "tslib";
2
- import React, { useEffect, useState } from "react";
3
- import moment from "jalali-moment";
4
- import Days from "./sub-components/days/days";
5
- import { daysInMonth } from './config';
6
- import { convertDate } from '../../utils/time-helper';
7
- import { Div } from '@pezeshk-book/ui-kit';
8
- var Calender = function (props) {
9
- var selectedDate = props.selectedDate, selectedDayCallback = props.selectedDayCallback;
10
- var _a = useState({
11
- value: convertDate(selectedDate, 'YYYY/MM/DD'),
12
- cloneDays: moment(selectedDate),
13
- monthName: "",
14
- year: "",
15
- days: []
16
- }), state = _a[0], setState = _a[1];
17
- useEffect(function () {
18
- var _a = daysInMonth(state.cloneDays), monthName = _a.monthName, days = _a.days, year = _a.year;
19
- setState(__assign(__assign({}, state), { days: days, monthName: monthName, initialValue: null, year: year }));
20
- }, []);
21
- useEffect(function () {
22
- if (state.cloneDays.isSame(state.cloneDays)) {
23
- var _a = daysInMonth(state.cloneDays), monthName = _a.monthName, days = _a.days, year = _a.year;
24
- setState(__assign(__assign({}, state), { days: __spreadArray(__spreadArray([], state.days.slice(state.days.length), true), days, true), monthName: monthName, year: year }));
25
- }
26
- }, [state.cloneDays]);
27
- var changeMonth = function (amount) {
28
- setState(__assign(__assign({}, state), { cloneDays: state.cloneDays.clone().add(amount, "month") }));
29
- };
30
- var selectDay = function (e) {
31
- var faDate = e.target.dataset.fadate;
32
- if (faDate) {
33
- selectedDayCallback(faDate);
34
- }
35
- setState(__assign(__assign({}, state), { value: faDate }));
36
- };
37
- var daysEventListeners = function () {
38
- return {
39
- onClick: selectDay
40
- };
41
- };
42
- return (React.createElement(Div, { dir: 'rtl', className: "items-center justify-center bg-white rounded py-4" },
43
- React.createElement(Days, { days: state.days, monthName: state.monthName, year: state.year, selectedDay: state.value, daysEventListeners: daysEventListeners, increaseMonth: function () { return changeMonth(1); }, decreaseMonth: function () { return changeMonth(-1); }, isDatePicker: true })));
44
- };
45
- export default Calender;
46
- //# sourceMappingURL=calender.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calender.js","sourceRoot":"","sources":["../../../modules/calender/calender.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAQ,MAAM,UAAU,CAAA;AAE3C,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAC,GAAG,EAAC,MAAM,sBAAsB,CAAA;AAWxC,IAAM,QAAQ,GAAG,UAAC,KAAoB;IAE7B,IAAA,YAAY,GAAyB,KAAK,aAA9B,EAAE,mBAAmB,GAAI,KAAK,oBAAT,CAAU;IAE5C,IAAA,KAAoB,QAAQ,CAAS;QACzC,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,YAAY,CAAC;QAC9C,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC;QAC/B,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACT,CAAC,EANK,KAAK,QAAA,EAAE,QAAQ,QAMpB,CAAC;IAEH,SAAS,CAAC;QACF,IAAA,KAA0B,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,EAArD,SAAS,eAAA,EAAE,IAAI,UAAA,EAAE,IAAI,UAAgC,CA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S,EAAE,mDAAmD;QAC7E,oBAAC,IAAI,IACH,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAE,KAAK,CAAC,KAAK,EACxB,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,cAAM,OAAA,WAAW,CAAC,CAAC,CAAC,EAAd,CAAc,EACnC,aAAa,EAAE,cAAM,OAAA,WAAW,CAAC,CAAC,CAAC,CAAC,EAAf,CAAe,EACpC,YAAY,SACZ,CACE,CACP,CAAC;AAEJ,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -1,4 +0,0 @@
1
- export interface CalenderProps {
2
- selectedDate: string | Date;
3
- selectedDayCallback: (date: string) => void;
4
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=calender.props.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calender.props.js","sourceRoot":"","sources":["../../../modules/calender/calender.props.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- import { __assign } from "tslib";
2
- import jalaiMoment from "jalali-moment";
3
- import moment from 'moment';
4
- var checkDateMonth = function (date, current) { return current.jMonth() < date.jMonth(); };
5
- var checkCurrentMonth = function (date) {
6
- return jalaiMoment().format("jYYYY/jMM") === date.format("jYYYY/jMM");
7
- };
8
- export var daysInMonth = function (date) {
9
- var days = [];
10
- var clonedDate = date.clone();
11
- var monthName = "".concat(clonedDate.locale("fa").format("jMMMM"));
12
- var year = "".concat(clonedDate.locale("fa").format("jYYYY"));
13
- var month = Number(date
14
- .clone()
15
- .locale("fa")
16
- .format("jM"));
17
- var firstDayOfWeek = date.clone().startOf("jMonth");
18
- var lastDayOfWeek = date.clone().endOf("jMonth");
19
- var today = checkCurrentMonth(date) ? { today: date.format("jDD") } : null;
20
- firstDayOfWeek.subtract((firstDayOfWeek.day() + 1) % 7, "days");
21
- while (firstDayOfWeek.isBefore(lastDayOfWeek)) {
22
- days.push({
23
- day: firstDayOfWeek.format("jDD"),
24
- utc: moment(new Date(firstDayOfWeek.toString())).format("YYYY-MM-DD"),
25
- faDate: firstDayOfWeek.format("jYYYY/jMM/jDD"),
26
- disabled: checkDateMonth(date, firstDayOfWeek)
27
- });
28
- firstDayOfWeek.add(1, "days");
29
- }
30
- return __assign({ monthName: monthName, month: month, days: days, year: year }, today);
31
- };
32
- //# sourceMappingURL=daysIn-month.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"daysIn-month.js","sourceRoot":"","sources":["../../../../modules/calender/config/daysIn-month.ts"],"names":[],"mappings":";AAAA,OAAO,WAAqB,MAAM,eAAe,CAAC;AAClD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAiB3B,IAAM,cAAc,GAAG,UAAC,IAAS,EAAE,OAAY,IAAK,OAAA,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAhC,CAAgC,CAAC;AACrF,IAAM,iBAAiB,GAAG,UAAC,IAAY;IACrC,OAAA,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;AAA9D,CAA8D,CAAC;AAEjE,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,IAAY;IACtC,IAAM,IAAI,GAAY,EAAE,CAAC;IACzB,IAAM,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAChC,IAAM,SAAS,GAAG,UAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAE,CAAC;IAC/D,IAAM,IAAI,GAAG,UAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAE,CAAC;IAE1D,IAAM,KAAK,GAAG,MAAM,CAClB,IAAI;SACD,KAAK,EAAE;SACP,MAAM,CAAC,IAAI,CAAC;SACZ,MAAM,CAAC,IAAI,CAAC,CAChB,CAAC;IAEF,IAAM,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACnD,IAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3E,cAAc,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IAEhE,OAAO,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;QAC7C,IAAI,CAAC,IAAI,CAAC;YACR,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC;YACjC,GAAG,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;YACrE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,eAAe,CAAC;YAC9C,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC;SAC/C,CAAC,CAAC;QACH,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;KAC/B;IACD,kBAAQ,SAAS,WAAA,EAAE,KAAK,OAAA,EAAE,IAAI,MAAA,EAAE,IAAI,MAAA,IAAK,KAAK,EAAE;AAClD,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { fa, formatJalaliDate, weekDayNames } from "./week-day";
2
- import { chunk } from './chunk';
3
- import { daysInMonth } from './daysIn-month';
4
- export { daysInMonth, fa, formatJalaliDate, weekDayNames, chunk };
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/calender/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,WAAW,EAAsB,MAAM,gBAAgB,CAAA;AAE/D,OAAO,EACL,WAAW,EACX,EAAE,EACF,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACN,CAAA"}
@@ -1,4 +0,0 @@
1
- import moment from "jalali-moment";
2
- export declare const fa: (n: any) => any;
3
- export declare const weekDayNames: string[];
4
- export declare const formatJalaliDate: (date: any) => moment.Moment | null;
@@ -1,18 +0,0 @@
1
- import moment from "jalali-moment";
2
- export var fa = function (n) {
3
- if (process.env.NODE_ENV === "test") {
4
- return n;
5
- }
6
- return Number(n).toLocaleString("fa", {
7
- useGrouping: false
8
- });
9
- };
10
- export var weekDayNames = ["ش", "ی", "د", "س", "چ", "پ", "ج"];
11
- export var formatJalaliDate = function (date) {
12
- var formattedDate = moment("".concat(date), "jYYYY/jMM/jDD");
13
- if (formattedDate.isValid()) {
14
- return formattedDate;
15
- }
16
- return null;
17
- };
18
- //# sourceMappingURL=week-day.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"week-day.js","sourceRoot":"","sources":["../../../../modules/calender/config/week-day.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,eAAe,CAAC;AAEnC,MAAM,CAAC,IAAM,EAAE,GAAG,UAAC,CAAM;IACvB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;QACnC,OAAO,CAAC,CAAC;KACV;IACD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE;QACpC,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;AACL,CAAC,CAAC;AACF,MAAM,CAAC,IAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAChE,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,IAAS;IACxC,IAAM,aAAa,GAAG,MAAM,CAAC,UAAG,IAAI,CAAE,EAAE,eAAe,CAAC,CAAC;IACzD,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE;QAC3B,OAAO,aAAa,CAAC;KACtB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import Calender from './calender';
2
- export default Calender;
@@ -1,3 +0,0 @@
1
- import Calender from './calender';
2
- export default Calender;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../modules/calender/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,eAAe,QAAQ,CAAC"}
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { DayProps } from "./day.props";
3
- export declare const Day: (props: DayProps) => JSX.Element;
@@ -1,21 +0,0 @@
1
- import { __assign } from "tslib";
2
- import React from "react";
3
- import { DAY_CONTAINER, NORMAL_DAY } from "./day.style";
4
- import classNames from '../../../../utils/class-names';
5
- import { Button } from '@pezeshk-book/ui-kit';
6
- export var Day = function (props) {
7
- var daysEvent = props.daysEvent, children = props.children, disabledDay = props.disabledDay, holidays = props.holidays, passedDay = props.passedDay, selectedDay = props.selectedDay;
8
- if (!children) {
9
- return React.createElement(Button, __assign({ variant: 'text', size: 'tiny', shape: 'circle', className: classNames(DAY_CONTAINER, 'cursor-default') }, props));
10
- }
11
- if (passedDay) {
12
- return React.createElement(Button, __assign({ size: 'tiny', variant: 'text', color: 'tertiary', shape: 'circle', className: classNames(DAY_CONTAINER, 'hover:text-secondary-dark cursor-default') }, props));
13
- }
14
- if (disabledDay || holidays) {
15
- return React.createElement(Button, __assign({ size: 'tiny', color: 'danger', shape: 'circle', className: classNames(DAY_CONTAINER, 'cursor-default') }, props));
16
- }
17
- return React.createElement(Button, __assign({ variant: selectedDay ? 'contained' : 'text', size: 'tiny', shape: 'circle', color: 'purple', className: classNames(DAY_CONTAINER, NORMAL_DAY(selectedDay)
18
- // @ts-ignore
19
- ) }, props, daysEvent ? daysEvent() : null));
20
- };
21
- //# sourceMappingURL=day.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"day.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/day/day.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,UAAU,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAA;AAE3C,MAAM,CAAC,IAAM,GAAG,GAAG,UAAC,KAAe;IAC1B,IAAA,SAAS,GAA6D,KAAK,UAAlE,EAAE,QAAQ,GAAmD,KAAK,SAAxD,EAAE,WAAW,GAAsC,KAAK,YAA3C,EAAE,QAAQ,GAA4B,KAAK,SAAjC,EAAE,SAAS,GAAiB,KAAK,UAAtB,EAAE,WAAW,GAAI,KAAK,YAAT,CAAU;IAEnF,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,oBAAC,MAAM,aAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAClF,aAAa,EACb,gBAAgB,CACjB,IAAM,KAAK,EAAI,CAAA;KACjB;IACD,IAAI,SAAS,EAAE;QACb,OAAO,oBAAC,MAAM,aAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CACrG,aAAa,EACb,0CAA0C,CAC3C,IAAM,KAAK,EAAI,CAAA;KACjB;IACD,IAAI,WAAW,IAAI,QAAQ,EAAE;QAC3B,OAAO,oBAAC,MAAM,aAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAClF,aAAa,EACb,gBAAgB,CACjB,IAAM,KAAK,EAAI,CAAC;KAClB;IACD,OAAO,oBAAC,MAAM,aAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAC/H,aAAa,EACb,UAAU,CAAC,WAAW,CAAC;QACvB,aAAa;SACd,IAAM,KAAK,EAAM,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,EAAI,CAAA;AACtD,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"day.props.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/day/day.props.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare const DAY_CONTAINER = "flex justify-center mx-2.5 md:mx-5 items-center my-2 text-center relative rounded-full font-family-medium text-m-lg";
2
- export declare const NORMAL_DAY: (selectedDay?: boolean) => "text-white" | "text-black hover:text-black";
@@ -1,8 +0,0 @@
1
- export var DAY_CONTAINER = 'flex justify-center mx-2.5 md:mx-5 items-center my-2 text-center relative rounded-full font-family-medium text-m-lg';
2
- export var NORMAL_DAY = function (selectedDay) {
3
- if (selectedDay) {
4
- return 'text-white';
5
- }
6
- return 'text-black hover:text-black';
7
- };
8
- //# sourceMappingURL=day.style.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"day.style.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/day/day.style.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,aAAa,GAAG,qHAAqH,CAAA;AAGlJ,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,WAAqB;IAC9C,IAAI,WAAW,EAAE;QACf,OAAO,YAAY,CAAA;KACpB;IAED,OAAO,6BAA6B,CAAA;AACtC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"days.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/days/days.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,KAAK,EAAE,EAAE,EAAS,YAAY,EAAC,MAAM,cAAc,CAAA;AAC3D,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,sBAAsB,CAAA;AAG9C,IAAM,WAAW,GAAG,UAAC,GAAY;IAC/B,IAAI,GAAG,EAAE;QACP,OAAO;YACL,cAAc,EAAE,GAAG;SACpB,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,IAAM,YAAY,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAA;AAEjK,IAAM,IAAI,GAAG,UAAC,KAAgB;IAG1B,IAAA,IAAI,GAOF,KAAK,KAPH,EACJ,kBAAkB,GAMhB,KAAK,mBANW,EAClB,SAAS,GAKP,KAAK,UALE,EACT,aAAa,GAIX,KAAK,cAJM,EACb,aAAa,GAGX,KAAK,cAHM,EACb,WAAW,GAET,KAAK,YAFI,EACX,IAAI,GACF,KAAK,KADH,CACG;IAET,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,IAAM,K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AAE,iBACzB,UAAG,GAAG,CAAC,MAAM,CAAE,EAC5B,SAAS,EAAE,kBAAkB,EAC7B,WAAW,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAC1C,WAAW,EAAE,WAAW,KAAK,GAAG,CAAC,MAAM,IACnC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,GAE5B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC/B,CACP,EAdkC,CAclC,CAAC,CACC,CACN,EAlByB,CAkBzB,CAAC,CACE,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAGD,IAAI,CAAC,YAAY,GAAG;IAClB,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,EAAE;CAChB,CAAA;AAED,eAAe,IAAI,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"days.props.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/days/days.props.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { DaysHeadProps } from "./days-head.props";
3
- declare const DaysHead: (props: DaysHeadProps) => JSX.Element;
4
- export default DaysHead;
@@ -1 +0,0 @@
1
- {"version":3,"file":"days-head.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/days-head/days-head.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAChC,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,sBAAsB,CAAA;AAEtD,IAAM,QAAQ,GAAG,UAAC,KAAoB;IAC7B,IAAA,aAAa,GAAwD,KAAK,cAA7D,EAAE,aAAa,GAAyC,KAAK,cAA9C,EAAE,SAAS,GAA8B,KAAK,UAAnC,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AC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW;oBACpI,oBAAC,GAAG,IAAC,SAAS,EAAE,sBAAsB;wBACpC,oBAAC,IAAI,gDAAe,CAChB,CACC,CACL;YACN,oBAAC,GAAG,IAAC,SAAS,EAAE,4BAA4B;gBAC1C,oBAAC,IAAI,yCAAa,CACd,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"days-head.props.js","sourceRoot":"","sources":["../../../../../modules/calender/sub-components/days-head/days-head.props.ts"],"names":[],"mappings":""}