@pezeshk-book/modules 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/calendar/calendar.d.ts +1 -2
- package/dist/modules/calendar/calendar.js +3 -3
- package/dist/modules/calendar/calendar.js.map +1 -1
- package/dist/modules/calendar/icons/arrow-left-icon.d.ts +1 -2
- package/dist/modules/calendar/icons/arrow-left-icon.js +3 -3
- package/dist/modules/calendar/icons/arrow-left-icon.js.map +1 -1
- package/dist/modules/calendar/icons/arrow-right-icon.d.ts +1 -2
- package/dist/modules/calendar/icons/arrow-right-icon.js +3 -3
- package/dist/modules/calendar/icons/arrow-right-icon.js.map +1 -1
- package/dist/modules/calendar/sub-components/day/day.d.ts +1 -2
- package/dist/modules/calendar/sub-components/day/day.js +3 -3
- package/dist/modules/calendar/sub-components/day/day.js.map +1 -1
- package/dist/modules/calendar/sub-components/days/days.d.ts +1 -2
- package/dist/modules/calendar/sub-components/days/days.js +13 -18
- package/dist/modules/calendar/sub-components/days/days.js.map +1 -1
- package/dist/modules/calendar/sub-components/days-head/days-head.d.ts +1 -2
- package/dist/modules/calendar/sub-components/days-head/days-head.js +3 -22
- package/dist/modules/calendar/sub-components/days-head/days-head.js.map +1 -1
- package/dist/modules/countdown-timer/countdown.d.ts +1 -2
- package/dist/modules/countdown-timer/countdown.js +4 -9
- package/dist/modules/countdown-timer/countdown.js.map +1 -1
- package/dist/modules/data-table/complex/complex-data-table.d.ts +9 -0
- package/dist/modules/data-table/complex/complex-data-table.js +158 -0
- package/dist/modules/data-table/complex/complex-data-table.js.map +1 -0
- package/dist/modules/data-table/complex/complex-data-table.props.d.ts +23 -0
- package/dist/modules/data-table/complex/complex-data-table.props.js +2 -0
- package/dist/modules/data-table/complex/complex-data-table.props.js.map +1 -0
- package/dist/modules/data-table/complex/index.d.ts +2 -0
- package/dist/modules/data-table/complex/index.js +3 -0
- package/dist/modules/data-table/complex/index.js.map +1 -0
- package/dist/modules/data-table/data-table.d.ts +3 -0
- package/dist/modules/data-table/data-table.js +13 -0
- package/dist/modules/data-table/data-table.js.map +1 -0
- package/dist/modules/data-table/data-table.props.d.ts +5 -0
- package/dist/modules/data-table/data-table.props.js +2 -0
- package/dist/modules/data-table/data-table.props.js.map +1 -0
- package/dist/modules/data-table/hooks/use-window-dimensions.d.ts +5 -0
- package/dist/modules/data-table/hooks/use-window-dimensions.js +28 -0
- package/dist/modules/data-table/hooks/use-window-dimensions.js.map +1 -0
- package/dist/modules/data-table/images/index.d.ts +2 -0
- package/dist/modules/data-table/images/index.js +3 -0
- package/dist/modules/data-table/images/index.js.map +1 -0
- package/dist/modules/data-table/index.d.ts +2 -0
- package/dist/modules/data-table/index.js +3 -0
- package/dist/modules/data-table/index.js.map +1 -0
- package/dist/modules/data-table/simple/index.d.ts +2 -0
- package/dist/modules/data-table/simple/index.js +3 -0
- package/dist/modules/data-table/simple/index.js.map +1 -0
- package/dist/modules/data-table/simple/simple-data-table.d.ts +9 -0
- package/dist/modules/data-table/simple/simple-data-table.js +107 -0
- package/dist/modules/data-table/simple/simple-data-table.js.map +1 -0
- package/dist/modules/data-table/simple/simple-data-table.props.d.ts +11 -0
- package/dist/modules/data-table/simple/simple-data-table.props.js +2 -0
- package/dist/modules/data-table/simple/simple-data-table.props.js.map +1 -0
- package/dist/modules/pagination/icons/arrow-Right.d.ts +1 -2
- package/dist/modules/pagination/icons/arrow-Right.js +3 -3
- package/dist/modules/pagination/icons/arrow-Right.js.map +1 -1
- package/dist/modules/pagination/icons/arrow-left.d.ts +1 -2
- package/dist/modules/pagination/icons/arrow-left.js +3 -3
- package/dist/modules/pagination/icons/arrow-left.js.map +1 -1
- package/dist/modules/pagination/pagination.d.ts +1 -2
- package/dist/modules/pagination/pagination.js +6 -24
- package/dist/modules/pagination/pagination.js.map +1 -1
- package/dist/modules/slider/slider.d.ts +1 -2
- package/dist/modules/slider/slider.js +14 -23
- package/dist/modules/slider/slider.js.map +1 -1
- package/dist/stories/calendar/calendar.d.ts +1 -2
- package/dist/stories/calendar/calendar.js +2 -2
- package/dist/stories/calendar/calendar.js.map +1 -1
- package/dist/stories/calendar/calendar.stories.d.ts +6 -6
- package/dist/stories/calendar/calendar.stories.js +12 -9
- package/dist/stories/calendar/calendar.stories.js.map +1 -1
- package/dist/stories/count-down/count-down.d.ts +1 -2
- package/dist/stories/count-down/count-down.js +2 -2
- package/dist/stories/count-down/count-down.js.map +1 -1
- package/dist/stories/count-down/count-down.stories.d.ts +6 -6
- package/dist/stories/count-down/count-down.stories.js +10 -8
- package/dist/stories/count-down/count-down.stories.js.map +1 -1
- package/dist/stories/data-table/data-table-columns.d.ts +12 -0
- package/dist/stories/data-table/data-table-columns.js +70 -0
- package/dist/stories/data-table/data-table-columns.js.map +1 -0
- package/dist/stories/data-table/data-table.d.ts +5 -0
- package/dist/stories/data-table/data-table.js +13 -0
- package/dist/stories/data-table/data-table.js.map +1 -0
- package/dist/stories/data-table/data-table.stories.d.ts +6 -0
- package/dist/stories/data-table/data-table.stories.js +15 -0
- package/dist/stories/data-table/data-table.stories.js.map +1 -0
- package/dist/stories/data-table/dummy-data.d.ts +11 -0
- package/dist/stories/data-table/dummy-data.js +204 -0
- package/dist/stories/data-table/dummy-data.js.map +1 -0
- package/dist/stories/pagination/pagination.d.ts +1 -2
- package/dist/stories/pagination/pagination.js +2 -2
- package/dist/stories/pagination/pagination.js.map +1 -1
- package/dist/stories/pagination/pagination.stories.d.ts +6 -6
- package/dist/stories/pagination/pagination.stories.js +15 -12
- package/dist/stories/pagination/pagination.stories.js.map +1 -1
- package/dist/stories/slider/slider.d.ts +1 -2
- package/dist/stories/slider/slider.js +2 -13
- package/dist/stories/slider/slider.js.map +1 -1
- package/dist/stories/slider/slider.stories.d.ts +6 -6
- package/dist/stories/slider/slider.stories.js +10 -8
- package/dist/stories/slider/slider.stories.js.map +1 -1
- package/dist/stories/wrapper.d.ts +1 -1
- package/dist/stories/wrapper.js +3 -6
- package/dist/stories/wrapper.js.map +1 -1
- package/package.json +7 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
3
4
|
import Days from './sub-components/days/days';
|
|
4
5
|
import { daysInMonthEn, daysInMonthFa } from './config';
|
|
5
6
|
import formatDate from './shared/formatDate';
|
|
@@ -85,8 +86,7 @@ var Calender = function (props) {
|
|
|
85
86
|
setRangeDates([]);
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
|
-
return (
|
|
89
|
-
React.createElement(Days, { days: datepicker.days, monthName: datepicker.monthName, year: datepicker.year, selectedDay: datepicker.value, disablePreviousMonths: disablePreviousMonths, disableSubsequentMonths: disableSubsequentMonths, disablePreviousDays: disablePreviousDays, disableSubsequentDays: disableSubsequentDays, daysEventListeners: daysEventListeners, selectDateHandlers: selectDateHandler, selectDateRangeHandlers: selectDateRangeHandler, selected: new DateObject({ date: selected }).format(dateFormat), date: date, increaseMonth: function () { return changeMonths(1, 'inc'); }, decreaseMonth: function () { return changeMonths(-1, 'inc'); }, changeMonth: function (monthIndex) { return changeMonths(monthIndex, 'select'); }, isDatePicker: true, dateFormat: dateFormat, type: type, holidays: holidayList, variant: variant, rangeDate: dateRangePicker, rangeDates: rangeDates, size: size, changeYear: changeYear })));
|
|
89
|
+
return (_jsx(Div, __assign({ dir: 'rtl', className: 'items-center flex flex-col justify-center bg-white rounded py-4 !w-full' }, { children: _jsx(Days, { days: datepicker.days, monthName: datepicker.monthName, year: datepicker.year, selectedDay: datepicker.value, disablePreviousMonths: disablePreviousMonths, disableSubsequentMonths: disableSubsequentMonths, disablePreviousDays: disablePreviousDays, disableSubsequentDays: disableSubsequentDays, daysEventListeners: daysEventListeners, selectDateHandlers: selectDateHandler, selectDateRangeHandlers: selectDateRangeHandler, selected: new DateObject({ date: selected }).format(dateFormat), date: date, increaseMonth: function () { return changeMonths(1, 'inc'); }, decreaseMonth: function () { return changeMonths(-1, 'inc'); }, changeMonth: function (monthIndex) { return changeMonths(monthIndex, 'select'); }, isDatePicker: true, dateFormat: dateFormat, type: type, holidays: holidayList, variant: variant, rangeDate: dateRangePicker, rangeDates: rangeDates, size: size, changeYear: changeYear }) })));
|
|
90
90
|
};
|
|
91
91
|
export default Calender;
|
|
92
92
|
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../modules/calendar/calendar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../modules/calendar/calendar.tsx"],"names":[],"mappings":";;AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAS,MAAM,UAAU,CAAC;AAE/D,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,OAAO,MAAM,qCAAqC,CAAC;AAC1D,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAC7D,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAYzD,IAAM,QAAQ,GAAG,UAAC,KAAoB;IAElC,IAAA,KAYE,KAAK,WAZkB,EAAzB,UAAU,mBAAG,YAAY,KAAA,EACzB,KAWE,KAAK,aAXkB,EAAzB,YAAY,mBAAG,IAAI,IAAI,EAAE,KAAA,EACzB,KAUE,KAAK,sBAVsB,EAA7B,qBAAqB,mBAAG,KAAK,KAAA,EAC7B,KASE,KAAK,wBATwB,EAA/B,uBAAuB,mBAAG,KAAK,KAAA,EAC/B,KAQE,KAAK,oBARoB,EAA3B,mBAAmB,mBAAG,KAAK,KAAA,EAC3B,KAOE,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,MAAM,CAAC,UAAU,CAAC,EAC/D,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,cAAM,OAAA,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,EAAtB,CAAsB,EAC3C,aAAa,EAAE,cAAM,OAAA,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAvB,CAAuB,EAC5C,WAAW,EAAE,UAAC,UAAmB,IAAK,OAAA,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAlC,CAAkC,EACxE,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,GACtB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
var ArrowLeftIcon = function () {
|
|
3
|
-
return (
|
|
4
|
-
React.createElement("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" })));
|
|
4
|
+
return (_jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "6", height: "12", viewBox: "0 0 6 12" }, { children: _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" }) })));
|
|
5
5
|
};
|
|
6
6
|
export default ArrowLeftIcon;
|
|
7
7
|
//# sourceMappingURL=arrow-left-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-left-icon.js","sourceRoot":"","sources":["../../../../modules/calendar/icons/arrow-left-icon.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"arrow-left-icon.js","sourceRoot":"","sources":["../../../../modules/calendar/icons/arrow-left-icon.tsx"],"names":[],"mappings":";;AAAA,IAAM,aAAa,GAAG;IACpB,OAAO,CACL,uBAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,UAAU,gBAC9E,eACE,IAAI,EAAE,cAAc,EACpB,SAAS,EAAC,iBAAiB,eACjB,YAAY,EACtB,CAAC,EAAC,mKAAmK,GACrK,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
var ArrowRightIcon = function () {
|
|
3
|
-
return (
|
|
4
|
-
React.createElement("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" })));
|
|
4
|
+
return (_jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "6", height: "12", viewBox: "0 0 6 12" }, { children: _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" }) })));
|
|
5
5
|
};
|
|
6
6
|
export default ArrowRightIcon;
|
|
7
7
|
//# sourceMappingURL=arrow-right-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-right-icon.js","sourceRoot":"","sources":["../../../../modules/calendar/icons/arrow-right-icon.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"arrow-right-icon.js","sourceRoot":"","sources":["../../../../modules/calendar/icons/arrow-right-icon.tsx"],"names":[],"mappings":";;AAAA,IAAM,cAAc,GAAG;IACrB,OAAO,CACL,uBAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,UAAU,gBAC9E,eACE,IAAI,EAAE,cAAc,EACpB,SAAS,EAAC,iBAAiB,eACjB,YAAY,EACtB,CAAC,EAAC,mKAAmK,GACrK,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import classNames from '../../../../utils/class-names';
|
|
4
4
|
import { Button, Div } from '@pezeshk-book/ui-kit';
|
|
5
5
|
export var Day = function (props) {
|
|
6
6
|
var children = props.children, disabledDay = props.disabledDay, holidays = props.holidays, passedDay = props.passedDay, comingDay = props.comingDay, selectedDay = props.selectedDay, selected = props.selected, handleDay = props.handleDay, isRange = props.isRange, startRange = props.startRange, endRange = props.endRange;
|
|
7
7
|
if (!children) {
|
|
8
|
-
return
|
|
8
|
+
return _jsx(Div, __assign({}, props));
|
|
9
9
|
}
|
|
10
10
|
var color = passedDay ? 'control' : selected ? 'primary' : isRange ? 'slate' : selectedDay ? 'primary' : (disabledDay || holidays ? 'danger' : 'inherit');
|
|
11
11
|
var variant = selected ? 'filled' : (isRange ? 'outlined' : 'text');
|
|
12
|
-
return (
|
|
12
|
+
return (_jsx(Button, __assign({ disabled: comingDay || passedDay, variant: variant, rounded: isRange ? 'none' : 'medium', size: 'medium', shape: 'square', color: color, className: classNames(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 }, props)));
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=day.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"day.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/day/day.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"day.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/day/day.tsx"],"names":[],"mappings":";;AACA,OAAO,UAAU,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,CAAC,IAAM,GAAG,GAAG,UAAC,KAAe;IACzB,IAAA,QAAQ,GAAmH,KAAK,SAAxH,EAAE,WAAW,GAAsG,KAAK,YAA3G,EAAE,QAAQ,GAA4F,KAAK,SAAjG,EAAE,SAAS,GAAiF,KAAK,UAAtF,EAAE,SAAS,GAAsE,KAAK,UAA3E,EAAE,WAAW,GAAyD,KAAK,YAA9D,EAAE,QAAQ,GAA+C,KAAK,SAApD,EAAE,SAAS,GAAoC,KAAK,UAAzC,EAAE,OAAO,GAA2B,KAAK,QAAhC,EAAE,UAAU,GAAe,KAAK,WAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IAEzI,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,KAAC,GAAG,eAAK,KAAK,EAAG,CAAC;KAC1B;IAED,IAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5J,IAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACtE,OAAO,CACL,KAAC,MAAM,aACL,QAAQ,EAAE,SAAS,IAAI,SAAS,EAChC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EACpC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CACnB,OAAO,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,EAAE,EACpD,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,EAC1D,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,CACzD,EACD,OAAO,EAAE,SAAS,IACd,KAAK,EACT,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DaysProps } from './days.props';
|
|
3
2
|
declare const Days: {
|
|
4
|
-
(props: DaysProps): JSX.Element | null;
|
|
3
|
+
(props: DaysProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
4
|
defaultProps: {
|
|
6
5
|
monthName: string;
|
|
7
6
|
disableDays: never[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import DaysHead from '../days-head/days-head';
|
|
4
4
|
import { Day } from '../day/day';
|
|
5
5
|
import { chunk, fa, weekDayNames } from '../../config';
|
|
@@ -37,23 +37,18 @@ var Days = function (props) {
|
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
39
|
var weekDays = size === 'huge' || size === 'large' ? weekDayNames[type].normal : weekDayNames[type].short;
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
: ((_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'
|
|
53
|
-
? ((_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
|
|
54
|
-
: ((_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' ? function () { return handleDayClick(day); } : function () { return handleRangeClick(day); }, size: size }, boolDataset(day.disabled)), !day.disabled ? fa(day.day) : null));
|
|
55
|
-
})));
|
|
56
|
-
})))));
|
|
40
|
+
return (_jsxs(Div, __assign({ className: 'flex-1 flex-col self-center relative overflow-auto mx-1 bg-white' }, { children: [_jsx(DaysHead, { 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 }), _jsxs(Div, __assign({ className: 'flex-col items-center flex-1 gap-4', "data-testid": "days-wrapper" }, { children: [_jsx(Div, __assign({ dir: type === 'gregorian' ? 'ltr' : 'rtl', className: 'grid grid-cols-7 w-full' }, { children: weekDays.map(function (name) { return (_jsx(Text, __assign({ typography: 'xs', type: 'regular', color: 'black' }, { children: name }), name)); }) })), _jsx(Divider, { color: 'control' }), _jsx(Div, __assign({ className: 'flex-col w-full gap-y-4' }, { children: weeks.map(function (week, idx) {
|
|
41
|
+
return (_jsx(Div, __assign({ dir: type === 'gregorian' ? 'ltr' : 'rtl', className: 'grid grid-flow-col grid-cols-7 w-full', "data-testid": "days" }, { children: week.map(function (day, id) {
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
43
|
+
return (_jsx(Day, __assign({ passedDay: disablePreviousDays && (type === 'gregorian' ? day.gregorianDate : day.jalaliDate) < dates, comingDay: disableSubsequentDays && (type === 'gregorian' ? day.gregorianDate : day.jalaliDate) > dates, holidays: holidays && holidays.indexOf(day.gregorianDate) !== -1, "data-testid": "day-".concat(idx * 7 + id + 1), "data-fadate": "".concat(type === 'gregorian' ? day.gregorianDate : day.jalaliDate), disabledDay: week.length === 7 && id === 6, selectedDay: selectedDay === (type === 'gregorian' ? day.gregorianDate : day.jalaliDate), selected: variant === 'simple' ? (selected === day.jalaliDate || selected === day.gregorianDate)
|
|
44
|
+
: (((_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) ||
|
|
45
|
+
(((_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'
|
|
46
|
+
? ((_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
|
|
47
|
+
: ((_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'
|
|
48
|
+
? ((_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
|
|
49
|
+
: ((_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' ? function () { return handleDayClick(day); } : function () { return handleRangeClick(day); }, size: size }, boolDataset(day.disabled), { children: !day.disabled ? fa(day.day) : null }), type === 'gregorian' ? day.gregorianDate : day.jalaliDate));
|
|
50
|
+
}) }), "rdp-weeks-".concat(idx)));
|
|
51
|
+
}) }))] }))] })));
|
|
57
52
|
};
|
|
58
53
|
Days.defaultProps = {
|
|
59
54
|
monthName: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"days.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days/days.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"days.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days/days.tsx"],"names":[],"mappings":";;AACA,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAS,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,UAAU,MAAM,mBAAmB,C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,YAAY,GAAG;IAClB,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DaysHeadProps } from './days-head.props';
|
|
3
|
-
declare const DaysHead: ({ decreaseMonth, increaseMonth, monthName, year, disablePreviousMonths, disableSubsequentMonths, days, date, dateFormat, type, changeMonth, size, changeYear }: DaysHeadProps) => JSX.Element;
|
|
2
|
+
declare const DaysHead: ({ decreaseMonth, increaseMonth, monthName, year, disablePreviousMonths, disableSubsequentMonths, days, date, dateFormat, type, changeMonth, size, changeYear }: DaysHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default DaysHead;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Button, Div, Text, Popper, PopperContent, PopperHandler, TextField } from '@pezeshk-book/ui-kit';
|
|
3
4
|
import { ArrowLeftIcon, ArrowRightIcon } from '../../icons';
|
|
4
5
|
import DateObject from 'react-date-object';
|
|
@@ -36,27 +37,7 @@ var DaysHead = function (_a) {
|
|
|
36
37
|
var lastDaySideMonthCalendarShow = new DateObject(type === 'gregorian' ? { date: days.at(-1).gregorianDate, calendar: gregorian } : { date: days.at(-1).jalaliDate, calendar: persian }).add(amount, 'month').setDay(31).format(dateFormat);
|
|
37
38
|
return sideDatesMonth === lastDaySideMonthCalendarShow;
|
|
38
39
|
};
|
|
39
|
-
return (
|
|
40
|
-
React.createElement(Div, { className: 'w-full items-center justify-between h-12' },
|
|
41
|
-
React.createElement(Button, { ariaLabel: 'previousMonth', variant: 'text', size: 'small', color: 'control', className: 'flex items-center', onClick: decreaseMonth, shape: 'square', disabled: disablePreviousMonths && comparedFromCurrentMonth(-1) },
|
|
42
|
-
React.createElement(Div, { className: 'h-3 w-2.5 relative' },
|
|
43
|
-
React.createElement(ArrowRightIcon, null))),
|
|
44
|
-
React.createElement(Div, { className: 'flex items-center gap-2' },
|
|
45
|
-
React.createElement(Popper, { handlePopper: handleMonthPoppers, showPopper: monthPopper, position: 'bottom', className: 'flex-1 z-20' },
|
|
46
|
-
React.createElement(PopperHandler, null,
|
|
47
|
-
React.createElement(Text, { className: 'cursor-pointer', color: 'grey.900', type: 'bold', typography: 'lg' }, monthName)),
|
|
48
|
-
React.createElement(PopperContent, { className: 'shadow-xl mr-10 md:mr-14' },
|
|
49
|
-
React.createElement(Div, { className: classNames('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') }, type === 'gregorian' ? (React.createElement(Div, { className: 'grid grid-cols-3 gap-8 justify-between' }, gregorianMonths.map(function (month) { return (React.createElement(Button, { className: '!px-0', onClick: function () { return handleSelectMonth(month.value); }, variant: 'text', size: size }, month.name)); }))) : (React.createElement(Div, { className: 'grid grid-cols-3 gap-2' }, jalaliMonths.map(function (month) { return (React.createElement(Button, { className: '!px-0', onClick: function () { return handleSelectMonth(month.value); }, variant: 'text', size: size }, month.name)); })))))),
|
|
50
|
-
React.createElement(Popper, { handlePopper: handleYearPoppers, showPopper: yearPopper, position: 'bottom', className: 'flex-1 z-20' },
|
|
51
|
-
React.createElement(PopperHandler, null,
|
|
52
|
-
React.createElement(Text, { className: 'cursor-pointer', color: 'grey.900', type: 'bold', typography: 'lg' }, year)),
|
|
53
|
-
React.createElement(PopperContent, { className: 'shadow-xl md:ml-10 ml-8 rounded-lg' },
|
|
54
|
-
React.createElement(Div, { className: classNames('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') },
|
|
55
|
-
React.createElement(TextField, { value: selectedYear, onChange: handleYearValue, label: 'سال', size: size === 'tiny' || size === 'small' ? 'tiny' : 'medium' }),
|
|
56
|
-
React.createElement(Button, { onClick: handleChangeYear, size: size === 'tiny' || size === 'small' ? 'tiny' : 'medium' }, "\u0628\u0631\u0648 \u0628\u0647 \u0633\u0627\u0644"))))),
|
|
57
|
-
React.createElement(Button, { ariaLabel: 'nextMonth', variant: 'text', size: 'small', color: 'control', className: 'flex items-center', onClick: increaseMonth, shape: 'square', disabled: disableSubsequentMonths && comparedFromCurrentMonth(1) },
|
|
58
|
-
React.createElement(Div, { className: 'h-3 w-2.5 relative' },
|
|
59
|
-
React.createElement(ArrowLeftIcon, null))))));
|
|
40
|
+
return (_jsx(Div, __assign({ className: 'justify-center items-center bg-white w-full self-center mb-5' }, { children: _jsxs(Div, __assign({ className: 'w-full items-center justify-between h-12' }, { children: [_jsx(Button, __assign({ ariaLabel: 'previousMonth', variant: 'text', size: 'small', color: 'control', className: 'flex items-center', onClick: decreaseMonth, shape: 'square', disabled: disablePreviousMonths && comparedFromCurrentMonth(-1) }, { children: _jsx(Div, __assign({ className: 'h-3 w-2.5 relative' }, { children: _jsx(ArrowRightIcon, {}) })) })), _jsxs(Div, __assign({ className: 'flex items-center gap-2' }, { children: [_jsxs(Popper, __assign({ handlePopper: handleMonthPoppers, showPopper: monthPopper, position: 'bottom', className: 'flex-1 z-20' }, { children: [_jsx(PopperHandler, { children: _jsx(Text, __assign({ className: 'cursor-pointer', color: 'grey.900', type: 'bold', typography: 'lg' }, { children: monthName })) }), _jsx(PopperContent, __assign({ className: 'shadow-xl mr-10 md:mr-14' }, { children: _jsx(Div, __assign({ className: classNames('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' ? (_jsx(Div, __assign({ className: 'grid grid-cols-3 gap-8 justify-between' }, { children: gregorianMonths.map(function (month) { return (_jsx(Button, __assign({ className: '!px-0', onClick: function () { return handleSelectMonth(month.value); }, variant: 'text', size: size }, { children: month.name }))); }) }))) : (_jsx(Div, __assign({ className: 'grid grid-cols-3 gap-2' }, { children: jalaliMonths.map(function (month) { return (_jsx(Button, __assign({ className: '!px-0', onClick: function () { return handleSelectMonth(month.value); }, variant: 'text', size: size }, { children: month.name }))); }) }))) })) }))] })), _jsxs(Popper, __assign({ handlePopper: handleYearPoppers, showPopper: yearPopper, position: 'bottom', className: 'flex-1 z-20' }, { children: [_jsx(PopperHandler, { children: _jsx(Text, __assign({ className: 'cursor-pointer', color: 'grey.900', type: 'bold', typography: 'lg' }, { children: year })) }), _jsx(PopperContent, __assign({ className: 'shadow-xl md:ml-10 ml-8 rounded-lg' }, { children: _jsxs(Div, __assign({ className: classNames('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: [_jsx(TextField, { value: selectedYear, onChange: handleYearValue, label: 'سال', size: size === 'tiny' || size === 'small' ? 'tiny' : 'medium' }), _jsx(Button, __assign({ onClick: handleChangeYear, size: size === 'tiny' || size === 'small' ? 'tiny' : 'medium' }, { children: "\u0628\u0631\u0648 \u0628\u0647 \u0633\u0627\u0644" }))] })) }))] }))] })), _jsx(Button, __assign({ ariaLabel: 'nextMonth', variant: 'text', size: 'small', color: 'control', className: 'flex items-center', onClick: increaseMonth, shape: 'square', disabled: disableSubsequentMonths && comparedFromCurrentMonth(1) }, { children: _jsx(Div, __assign({ className: 'h-3 w-2.5 relative' }, { children: _jsx(ArrowLeftIcon, {}) })) }))] })) })));
|
|
60
41
|
};
|
|
61
42
|
export default DaysHead;
|
|
62
43
|
//# sourceMappingURL=days-head.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"days-head.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days-head/days-head.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"days-head.js","sourceRoot":"","sources":["../../../../../modules/calendar/sub-components/days-head/days-head.tsx"],"names":[],"mappings":";;AAE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AAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,wEAAqB,KACjH,IACQ,KACT,KACL,EACN,KAAC,MAAM,aAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,uBAAuB,IAAI,wBAAwB,CAAC,CAAC,CAAC,gBACzN,KAAC,GAAG,aAAC,SAAS,EAAE,oBAAoB,gBAClC,KAAC,aAAa,KAAE,IACZ,IACC,KACL,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CountdownProps } from './countdown.props';
|
|
3
|
-
declare const CountDown: ({ sec, parentCallback, reset, variant, className, textProps, initialColor }: CountdownProps) => JSX.Element;
|
|
2
|
+
declare const CountDown: ({ sec, parentCallback, reset, variant, className, textProps, initialColor }: CountdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export default CountDown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __assign } from "tslib";
|
|
3
|
-
import
|
|
3
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
5
|
import { classNames, Div, Text } from '@pezeshk-book/ui-kit';
|
|
5
6
|
var CountDown = function (_a) {
|
|
6
7
|
var sec = _a.sec, parentCallback = _a.parentCallback, reset = _a.reset, _b = _a.variant, variant = _b === void 0 ? 'contained' : _b, className = _a.className, textProps = _a.textProps, _c = _a.initialColor, initialColor = _c === void 0 ? 'primary' : _c;
|
|
@@ -48,14 +49,8 @@ var CountDown = function (_a) {
|
|
|
48
49
|
var remainingTime = (timerSec + timerMin * 60 + timerHour * 3600);
|
|
49
50
|
setColor((remainingTime <= (sec / 10) ? 'danger' : (remainingTime <= (sec * 30 / 100) ? 'warning' : initialColor)));
|
|
50
51
|
}, [timerSec]);
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
React.createElement(Text, __assign({ className: 'mx-1', typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps), ":"),
|
|
54
|
-
React.createElement(Text, __assign({ typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps), timerMin < 10 ? '0' + timerMin : timerMin),
|
|
55
|
-
sec >= 3600
|
|
56
|
-
? React.createElement(React.Fragment, null,
|
|
57
|
-
React.createElement(Text, __assign({ className: 'mx-1', typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps), ":"),
|
|
58
|
-
React.createElement(Text, __assign({ typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps), timerHour < 10 ? '0' + timerHour : timerHour)) : null));
|
|
52
|
+
return (_jsxs(Div, __assign({ dir: 'rtl', className: classNames('items-center justify-center h-full rounded', variant === 'contained' ? 'bg-primary' : 'bg-transparent', className) }, { children: [_jsx(Text, __assign({ typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps, { children: timerSec < 10 ? '0' + timerSec : timerSec })), _jsx(Text, __assign({ className: 'mx-1', typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps, { children: ":" })), _jsx(Text, __assign({ typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps, { children: timerMin < 10 ? '0' + timerMin : timerMin })), sec >= 3600
|
|
53
|
+
? _jsxs(_Fragment, { children: [_jsx(Text, __assign({ className: 'mx-1', typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps, { children: ":" })), _jsx(Text, __assign({ typography: 'base', color: variant === 'contained' ? 'white' : color }, textProps, { children: timerHour < 10 ? '0' + timerHour : timerHour }))] }) : null] })));
|
|
59
54
|
};
|
|
60
55
|
export default CountDown;
|
|
61
56
|
//# sourceMappingURL=countdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countdown.js","sourceRoot":"","sources":["../../../modules/countdown-timer/countdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"countdown.js","sourceRoot":"","sources":["../../../modules/countdown-timer/countdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE7D,IAAM,SAAS,GAAG,UAAC,EAAqH;QAAnH,GAAG,SAAA,EAAE,cAAc,oBAAA,EAAE,KAAK,WAAA,EAAE,eAAqB,EAArB,OAAO,mBAAG,WAAW,KAAA,EAAE,SAAS,eAAA,EAAE,SAAS,eAAA,EAAE,oBAAwB,EAAxB,YAAY,mBAAG,SAAS,KAAA;IAC9G,IAAA,KAA0B,QAAQ,CAAS,GAAG,CAAC,EAA9C,QAAQ,QAAA,EAAE,WAAW,QAAyB,CAAC;IAChD,IAAA,KAA0B,QAAQ,CAAS,CAAC,CAAC,EAA5C,QAAQ,QAAA,EAAE,WAAW,QAAuB,CAAC;IAC9C,IAAA,KAA4B,QAAQ,CAAS,CAAC,CAAC,EAA9C,SAAS,QAAA,EAAE,YAAY,QAAuB,CAAC;IAChD,IAAA,KAAoB,QAAQ,CAA+C,YAAY,CAAC,EAAvF,KAAK,QAAA,EAAE,QAAQ,QAAwE,CAAC;IAE/F,SAAS,CAAC;QACR,IAAI,GAAG,IAAI,IAAI,EAAE;YACf,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;YACrC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,I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AAK,EAAE,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAM,SAAS,cACtF,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,IACrC,EACN,GAAG,IAAI,IAAI;gBACV,CAAC,CAAC,8BACA,KAAC,IAAI,aAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAM,SAAS,qBAAU,EACtH,KAAC,IAAI,aAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAM,SAAS,cACtF,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,IACxC,IACN,CAAC,CAAC,CAAC,IAAI,KAER,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComplexDataTableProps } from './complex-data-table.props';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
declare module '@tanstack/react-table' {
|
|
4
|
+
interface TableMeta<TData extends RowData> {
|
|
5
|
+
updateData: (value: string, info?: string | object) => void;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
declare const ComplexDataTable: ({ header, data, column, mobileColumns, expandable, expandedComponent, serverSideSorting, isLoading, getCurrentPage, lastPage, perPage, currentPage, total, previousPage, nextPage, getLimit, columnOrder, updateData, select, selectedRows, }: ComplexDataTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ComplexDataTable;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { __assign, __spreadArray } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
4
|
+
import { Button, Checkbox, classNames, Div, FormControlLabel, Skeleton, Text } from '@pezeshk-book/ui-kit';
|
|
5
|
+
import Pagination from '../../pagination';
|
|
6
|
+
import { flexRender, getCoreRowModel, getExpandedRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
|
|
7
|
+
import useWindowDimensions from '../hooks/use-window-dimensions';
|
|
8
|
+
import { LogoImage } from '../images';
|
|
9
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
10
|
+
var ComplexDataTable = function (_a) {
|
|
11
|
+
var header = _a.header, data = _a.data, column = _a.column, mobileColumns = _a.mobileColumns, _b = _a.expandable, expandable = _b === void 0 ? false : _b, expandedComponent = _a.expandedComponent, serverSideSorting = _a.serverSideSorting, _c = _a.isLoading, isLoading = _c === void 0 ? false : _c, getCurrentPage = _a.getCurrentPage, lastPage = _a.lastPage, perPage = _a.perPage, currentPage = _a.currentPage, total = _a.total, previousPage = _a.previousPage, nextPage = _a.nextPage, getLimit = _a.getLimit, _d = _a.columnOrder, columnOrder = _d === void 0 ? false : _d, updateData = _a.updateData, select = _a.select, selectedRows = _a.selectedRows;
|
|
12
|
+
var _e = useState({}), rowSelection = _e[0], setRowSelection = _e[1];
|
|
13
|
+
var _f = useState([]), sorting = _f[0], setSorting = _f[1];
|
|
14
|
+
var _g = useState(0), scrollPosition = _g[0], setScrollPosition = _g[1];
|
|
15
|
+
var _h = useState(false), showGoTop = _h[0], setShowGoTop = _h[1];
|
|
16
|
+
var _j = useState({}), columnVisibility = _j[0], setColumnVisibility = _j[1];
|
|
17
|
+
var _k = useState([]), rowExpander = _k[0], setRowExpander = _k[1];
|
|
18
|
+
var dimensions = useWindowDimensions();
|
|
19
|
+
var handleMobileExpander = function (row) {
|
|
20
|
+
if (rowExpander.indexOf(row.index) === -1) {
|
|
21
|
+
setRowExpander(__spreadArray(__spreadArray([], rowExpander, true), [row.index], false));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
setRowExpander(function (value) { return value.filter(function (item) { return item !== row.index; }); });
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var columns = __spreadArray(__spreadArray([
|
|
28
|
+
{
|
|
29
|
+
id: 'mobileExpander',
|
|
30
|
+
accessorKey: 'mobileExpander',
|
|
31
|
+
header: function () { return null; },
|
|
32
|
+
cell: function (_a) {
|
|
33
|
+
var row = _a.row;
|
|
34
|
+
return (_jsx(Button, { onClick: function () { return handleMobileExpander(row); }, startAdornment: _jsxs("svg", __assign({ className: classNames('absolute transition-all duration-500', rowExpander.indexOf(row.index) !== -1 ? 'rotate-[225deg]' : ''), width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, { children: [_jsx("path", { d: 'M8 12H16', stroke: 'currentColor', strokeWidth: '1.5', strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M12 16V8', stroke: 'currentColor', strokeWidth: '1.5', strokeLinecap: 'round', strokeLinejoin: 'round' })] })), variant: 'text', size: 'tiny', className: '!p-0' }));
|
|
35
|
+
},
|
|
36
|
+
enableSorting: false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'select',
|
|
40
|
+
accessorKey: 'select',
|
|
41
|
+
header: function (_a) {
|
|
42
|
+
var table = _a.table;
|
|
43
|
+
return select ? (_jsx(Checkbox, { size: 'small', indeterminate: table.getIsSomeRowsSelected(), checked: table.getIsAllRowsSelected(), onChange: table.getToggleAllRowsSelectedHandler() })) : null;
|
|
44
|
+
},
|
|
45
|
+
cell: function (_a) {
|
|
46
|
+
var row = _a.row;
|
|
47
|
+
return row.getCanSelect() && select ? (_jsx(Checkbox, { size: 'small', onChange: row.getToggleSelectedHandler(), checked: row.getIsSelected() })) : null;
|
|
48
|
+
},
|
|
49
|
+
enableSorting: false
|
|
50
|
+
}
|
|
51
|
+
], column, true), [
|
|
52
|
+
{
|
|
53
|
+
id: 'expander',
|
|
54
|
+
accessorKey: 'expander',
|
|
55
|
+
header: function () { return null; },
|
|
56
|
+
cell: function (_a) {
|
|
57
|
+
var row = _a.row;
|
|
58
|
+
return row.getCanExpand() ? (_jsx(Button, __assign({ className: '!p-0', variant: 'text', size: 'tiny' }, {
|
|
59
|
+
onClick: row.getToggleExpandedHandler(),
|
|
60
|
+
style: { cursor: 'pointer' }
|
|
61
|
+
}, { children: _jsx("svg", __assign({ width: "20", height: "20", viewBox: "0 0 20 20", className: classNames('transition-all duration-300', row.getIsExpanded() ? 'rotate-180' : ''), xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.4107 6.91073C4.73614 6.5853 5.26378 6.5853 5.58922 6.91073L9.99996 11.3215L14.4107 6.91074C14.7361 6.5853 15.2638 6.5853 15.5892 6.91074C15.9147 7.23617 15.9147 7.76381 15.5892 8.08925L10.5892 13.0892C10.2638 13.4147 9.73614 13.4147 9.4107 13.0892L4.4107 8.08925C4.08527 7.76381 4.08527 7.23617 4.4107 6.91073Z", fill: "currentColor" }) })) }))) : null;
|
|
62
|
+
},
|
|
63
|
+
enableSorting: false
|
|
64
|
+
},
|
|
65
|
+
], false);
|
|
66
|
+
var table = useReactTable({
|
|
67
|
+
data: data,
|
|
68
|
+
columns: columns,
|
|
69
|
+
getCoreRowModel: getCoreRowModel(),
|
|
70
|
+
getSortedRowModel: getSortedRowModel(),
|
|
71
|
+
getRowCanExpand: function () { return true; },
|
|
72
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
73
|
+
state: {
|
|
74
|
+
columnVisibility: columnVisibility,
|
|
75
|
+
rowSelection: rowSelection,
|
|
76
|
+
sorting: sorting
|
|
77
|
+
},
|
|
78
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
79
|
+
onRowSelectionChange: setRowSelection,
|
|
80
|
+
onSortingChange: setSorting,
|
|
81
|
+
manualSorting: !!serverSideSorting,
|
|
82
|
+
meta: {
|
|
83
|
+
updateData: function (value, info) {
|
|
84
|
+
if (updateData) {
|
|
85
|
+
updateData(value, info);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
useEffect(function () {
|
|
91
|
+
if (selectedRows) {
|
|
92
|
+
selectedRows(table.getSelectedRowModel().rows.map(function (row) {
|
|
93
|
+
return row.original;
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
}, [rowSelection]);
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
window.addEventListener('scroll', handleVisibleButton);
|
|
99
|
+
});
|
|
100
|
+
useEffect(function () {
|
|
101
|
+
if (serverSideSorting && sorting.length > 0) {
|
|
102
|
+
serverSideSorting(sorting);
|
|
103
|
+
}
|
|
104
|
+
}, [sorting]);
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
var obj = {};
|
|
107
|
+
if (dimensions.width < 640) {
|
|
108
|
+
columns.forEach(function (value) {
|
|
109
|
+
if (value.id) {
|
|
110
|
+
obj[value.id] = mobileColumns === null || mobileColumns === void 0 ? void 0 : mobileColumns.includes(value.id);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
setColumnVisibility(__assign(__assign({}, obj), { mobileExpander: true, expander: expandable, select: select }));
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
columns.forEach(function (value) {
|
|
117
|
+
if (value.id) {
|
|
118
|
+
obj[value.id] = true;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
setColumnVisibility(__assign(__assign({}, obj), { mobileExpander: false, expander: expandable, select: select }));
|
|
122
|
+
}
|
|
123
|
+
}, [dimensions.width]);
|
|
124
|
+
var handleVisibleButton = function () {
|
|
125
|
+
var position = window.scrollY;
|
|
126
|
+
setScrollPosition(position);
|
|
127
|
+
if (scrollPosition > 150) {
|
|
128
|
+
return setShowGoTop(true);
|
|
129
|
+
}
|
|
130
|
+
else if (scrollPosition < 150) {
|
|
131
|
+
return setShowGoTop(false);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
var handleScrollUp = function () {
|
|
135
|
+
window.scrollTo({ behavior: 'smooth', top: 0 });
|
|
136
|
+
};
|
|
137
|
+
return (_jsxs(Div, __assign({ className: 'w-full flex-col relative' }, { children: [isLoading && data.length > 0 ? (_jsx(Div, __assign({ className: 'absolute bg-control bg-opacity-25 w-full h-full items-center justify-center z-50 rounded-xl' }, { children: _jsx(Div, __assign({ className: 'w-14 h-14 relative' }, { children: _jsx("img", { className: 'animate-bounce', src: LogoImage, alt: 'پزشک بوک' }) })) }))) : null, _jsx(Div, __assign({ className: 'gap-0 md:gap-4 flex-col md:flex-row' }, { children: columnOrder && table.getAllLeafColumns().map(function (column) {
|
|
138
|
+
if (column.id === 'mobileExpander' || column.id === 'expander') {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return (_jsx(FormControlLabel, __assign({ className: 'p-2', label: header[column.id] }, { children: _jsx(Checkbox, { checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler() }) }), column.id));
|
|
142
|
+
}) })), _jsxs(Div, __assign({ className: 'bg-white md:border w-full border-control-300 border-opacity-50 p-2 rounded-xl max-w-full flex-col relative' }, { children: [_jsxs("table", __assign({ className: 'w-full table-auto' }, { children: [_jsx("thead", __assign({ className: 'bg-control-50 h-14 sticky top-0 z-[9]' }, { children: table.getHeaderGroups().map(function (headerGroup) { return (_jsx("tr", { children: headerGroup.headers.map(function (header) { return (_jsx("th", __assign({ className: 'hover:cursor-pointer', onClick: header.column.getToggleSortingHandler() }, { children: _jsxs(Div, __assign({ className: 'justify-center items-center gap-1' }, { children: [header.column.getCanSort() ? (_jsx(Div, __assign({ className: 'text-control-800' }, { children: _jsx("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("g", { children: _jsxs("g", { children: [_jsx("path", { d: "M9.00999 20.5L3.98999 15.49", stroke: header.column.getIsSorted() === 'desc' ? 'currentColor' : '#A8A8A8', strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M9.01001 3.5V20.5", stroke: header.column.getIsSorted() === 'desc' ? 'currentColor' : '#A8A8A8', strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M14.99 3.5L20.01 8.51", stroke: header.column.getIsSorted() === 'asc' ? 'currentColor' : '#A8A8A8', strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M14.99 20.5V3.5", stroke: header.column.getIsSorted() === 'asc' ? 'currentColor' : '#A8A8A8', strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })] }) }) })) }))) : null, _jsx(Text, __assign({ color: header.column.getIsSorted() ? 'primary' : 'grey.800', typography: 'sm', type: 'bold' }, { children: header.isPlaceholder
|
|
143
|
+
? null
|
|
144
|
+
: flexRender(header.column.columnDef.header, header.getContext()) }))] })) }), header.id)); }) }, headerGroup.id)); }) })), isLoading && !data.length ? (_jsx("tbody", { children: __spreadArray([], new Array(15), true).map(function (_, index) { return (_jsx("tr", __assign({ className: 'h-16 hover:bg-primary-50' }, { children: table.getFlatHeaders().map(function (cell) {
|
|
145
|
+
return (_jsx("td", __assign({ className: 'px-1' }, { children: _jsx(Skeleton, { color: 'control', className: '!max-w-full !min-w-full' }) }), cell.id));
|
|
146
|
+
}) }), "loadingItem_".concat(index))); }) })) : !isLoading && !data.length ? (_jsx("tbody", { children: _jsx("tr", __assign({ className: 'h-48' }, { children: _jsx("td", __assign({ colSpan: table.getFlatHeaders().length }, { children: _jsx(Text, __assign({ typography: 'lg', type: 'bold' }, { children: "\u0627\u0637\u0644\u0627\u0639\u0627\u062A\u06CC \u0628\u0631\u0627\u06CC \u0646\u0645\u0627\u06CC\u0634 \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F!" })) })) })) })) : (_jsx("tbody", { children: table.getRowModel().rows.map(function (row, index) {
|
|
147
|
+
return (_jsxs(Fragment, { children: [_jsx(AnimatePresence, __assign({ mode: "wait" }, { children: _jsx(motion.tr, __assign({ initial: { y: 100, opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: -100, opacity: 0 }, transition: { duration: 0.5, delay: index * 0.1 }, className: classNames('h-16 hover:bg-primary-50', row.getIsSelected() && 'bg-slate-200') }, { children: row.getVisibleCells().map(function (cell) {
|
|
148
|
+
return (_jsx("td", __assign({ className: 'px-1' }, { children: _jsx(Div, __assign({ className: 'flex-col items-center' }, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) })) }), cell.id));
|
|
149
|
+
}) }), row ? row.id : 'empty') })), _jsx(AnimatePresence, { children: row.getIsExpanded() && (_jsx(motion.tr, __assign({ initial: { height: 0, opacity: 0 }, animate: { height: 'auto', opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.5, ease: 'easeInOut' } }, { children: _jsx("td", __assign({ colSpan: row.getVisibleCells().length }, { children: _jsx(motion.div, __assign({ initial: { height: 0, opacity: 0 }, animate: { height: row.getIsExpanded() ? 'auto' : 0, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.5, ease: 'easeInOut' }, className: 'flex flex-col overflow-hidden' }, { children: expandedComponent(row.original) })) })) }))) }), _jsx(AnimatePresence, { children: rowExpander.indexOf(row.index) !== -1 && (_jsx(motion.tr, __assign({ initial: { height: 0, opacity: 0 }, animate: { height: 'auto', opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.5, ease: 'easeInOut' }, className: classNames('bg-primary-50') }, { children: _jsx("td", __assign({ colSpan: row.getVisibleCells().length }, { children: _jsx(motion.div, __assign({ initial: { height: 0, opacity: 0 }, animate: { height: row.getVisibleCells().length ? 'auto' : 0, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: 0.5, ease: 'easeInOut' }, className: 'flex flex-col overflow-hidden' }, { children: row.getAllCells().map(function (mobileCell) {
|
|
150
|
+
if (!mobileCell.column.getIsVisible() && mobileCell.column.id !== 'expander') {
|
|
151
|
+
return (_jsxs(Div, __assign({ className: 'gap-2 p-2 items-start' }, { children: [_jsxs(Text, __assign({ typography: 'sm', type: 'bold' }, { children: [header[mobileCell.column.id], ":"] })), flexRender(mobileCell.column.columnDef.cell, mobileCell.getContext())] }), mobileCell.id));
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}) })) })) }))) })] }, row.id));
|
|
155
|
+
}) }))] })), _jsx(Button, __assign({ onClick: handleScrollUp, shape: 'square', rounded: 'full', className: classNames('rotate-180 sticky !p-0 bottom-1 self-center duration-500 transition', showGoTop ? 'opacity-100 translate-y-0 !h-auto !min-h-12' : 'translate-y-full opacity-0 !h-0 !min-h-[0px]') }, { children: _jsx("svg", __assign({ width: "20", height: "20", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.4107 6.91073C4.73614 6.5853 5.26378 6.5853 5.58922 6.91073L9.99996 11.3215L14.4107 6.91074C14.7361 6.5853 15.2638 6.5853 15.5892 6.91074C15.9147 7.23617 15.9147 7.76381 15.5892 8.08925L10.5892 13.0892C10.2638 13.4147 9.73614 13.4147 9.4107 13.0892L4.4107 8.08925C4.08527 7.76381 4.08527 7.23617 4.4107 6.91073Z", fill: "currentColor" }) })) })), !isLoading && data.length ? (_jsx(Div, __assign({ className: 'mt-4 bg-control-50 md:h-14 py-2 md:py-0 justify-center items-center rounded-b-xl flex-col' }, { children: _jsx(Pagination, { color: 'primary', variant: 'filled', getCurrentPage: getCurrentPage, isLoading: isLoading, lastPage: lastPage, perPage: perPage, currentPage: currentPage, total: total, nextPage: nextPage, previousPage: previousPage, getLimit: getLimit }) }))) : null] }))] })));
|
|
156
|
+
};
|
|
157
|
+
export default ComplexDataTable;
|
|
158
|
+
//# sourceMappingURL=complex-data-table.js.map
|