@pezeshk-book/modules 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/calendar/calendar.d.ts +2 -1
- package/calendar/calendar.js +115 -88
- package/calendar/calendar.js.map +1 -1
- package/calendar/calendar.props.js +1 -1
- package/calendar/config/chunk.js +9 -10
- package/calendar/config/chunk.js.map +1 -1
- package/calendar/config/create-date-range.js +10 -11
- package/calendar/config/create-date-range.js.map +1 -1
- package/calendar/config/days-in-month.en.js +27 -27
- package/calendar/config/days-in-month.en.js.map +1 -1
- package/calendar/config/days-in-month.fa.js +27 -27
- package/calendar/config/days-in-month.fa.js.map +1 -1
- package/calendar/config/index.js +10 -10
- package/calendar/config/index.js.map +1 -1
- package/calendar/config/months.js +1 -1
- package/calendar/config/week-day.js +6 -6
- package/calendar/config/week-day.js.map +1 -1
- package/calendar/icons/arrow-left-icon.d.ts +1 -1
- package/calendar/icons/arrow-left-icon.js +5 -6
- package/calendar/icons/arrow-left-icon.js.map +1 -1
- package/calendar/icons/arrow-right-icon.d.ts +1 -1
- package/calendar/icons/arrow-right-icon.js +5 -6
- package/calendar/icons/arrow-right-icon.js.map +1 -1
- package/calendar/icons/index.js +6 -6
- package/calendar/icons/index.js.map +1 -1
- package/calendar/index.js +4 -4
- package/calendar/index.js.map +1 -1
- package/calendar/shared/formatDate.js +9 -10
- package/calendar/shared/formatDate.js.map +1 -1
- package/calendar/sub-components/day/day.d.ts +1 -1
- package/calendar/sub-components/day/day.js +9 -10
- package/calendar/sub-components/day/day.js.map +1 -1
- package/calendar/sub-components/day/day.props.js +1 -1
- package/calendar/sub-components/days/days.d.ts +1 -7
- package/calendar/sub-components/days/days.js +35 -39
- package/calendar/sub-components/days/days.js.map +1 -1
- package/calendar/sub-components/days/days.props.js +1 -1
- package/calendar/sub-components/days-head/days-head.d.ts +2 -1
- package/calendar/sub-components/days-head/days-head.js +26 -27
- package/calendar/sub-components/days-head/days-head.js.map +1 -1
- package/calendar/sub-components/days-head/days-head.props.js +1 -1
- package/countdown-timer/countdown.d.ts +1 -1
- package/countdown-timer/countdown.js +27 -28
- package/countdown-timer/countdown.js.map +1 -1
- package/countdown-timer/countdown.props.js +1 -1
- package/countdown-timer/index.js +4 -4
- package/countdown-timer/index.js.map +1 -1
- package/data-table/data-table.d.ts +1 -1
- package/data-table/data-table.js +9 -9
- package/data-table/data-table.js.map +1 -1
- package/data-table/data-table.props.js +1 -1
- package/data-table/default/default-data-table.d.ts +1 -1
- package/data-table/default/default-data-table.js +76 -83
- package/data-table/default/default-data-table.js.map +1 -1
- package/data-table/default/default-data-table.props.js +1 -1
- package/data-table/default/index.js +4 -4
- package/data-table/default/index.js.map +1 -1
- package/data-table/hooks/use-window-dimensions.js +14 -14
- package/data-table/hooks/use-window-dimensions.js.map +1 -1
- package/data-table/icons/add.d.ts +2 -2
- package/data-table/icons/add.js +5 -7
- package/data-table/icons/add.js.map +1 -1
- package/data-table/icons/arrow-down.d.ts +1 -1
- package/data-table/icons/arrow-down.js +5 -7
- package/data-table/icons/arrow-down.js.map +1 -1
- package/data-table/icons/index.js +8 -8
- package/data-table/icons/index.js.map +1 -1
- package/data-table/icons/sort.d.ts +1 -1
- package/data-table/icons/sort.js +5 -7
- package/data-table/icons/sort.js.map +1 -1
- package/data-table/index.js +4 -4
- package/data-table/index.js.map +1 -1
- package/data-table/simple/index.js +4 -4
- package/data-table/simple/index.js.map +1 -1
- package/data-table/simple/simple-data-table.d.ts +1 -1
- package/data-table/simple/simple-data-table.js +60 -59
- package/data-table/simple/simple-data-table.js.map +1 -1
- package/data-table/simple/simple-data-table.props.js +1 -1
- package/date-time-picker/date-time-picker.d.ts +1 -1
- package/date-time-picker/date-time-picker.js +25 -26
- package/date-time-picker/date-time-picker.js.map +1 -1
- package/date-time-picker/date-time-picker.props.js +1 -1
- package/date-time-picker/index.js +4 -4
- package/date-time-picker/index.js.map +1 -1
- package/index.js +16 -16
- package/index.js.map +1 -1
- package/package.json +12 -44
- package/pagination/icons/arrow-Right.d.ts +3 -3
- package/pagination/icons/arrow-Right.js +5 -7
- package/pagination/icons/arrow-Right.js.map +1 -1
- package/pagination/icons/arrow-left.d.ts +3 -3
- package/pagination/icons/arrow-left.js +5 -7
- package/pagination/icons/arrow-left.js.map +1 -1
- package/pagination/icons/index.js +6 -6
- package/pagination/icons/index.js.map +1 -1
- package/pagination/index.js +4 -4
- package/pagination/index.js.map +1 -1
- package/pagination/pagination.d.ts +1 -1
- package/pagination/pagination.js +26 -27
- package/pagination/pagination.js.map +1 -1
- package/pagination/pagination.props.js +1 -1
- package/pagination/use-pagination.d.ts +1 -1
- package/pagination/use-pagination.js +8 -8
- package/pagination/use-pagination.js.map +1 -1
- package/slider/index.js +4 -4
- package/slider/index.js.map +1 -1
- package/slider/slider.d.ts +2 -1
- package/slider/slider.js +63 -66
- package/slider/slider.js.map +1 -1
- package/slider/slider.props.js +1 -1
- package/tailwind-merge-config.js +6 -6
- package/tailwind-merge-config.js.map +1 -1
- package/time-picker/index.js +4 -4
- package/time-picker/index.js.map +1 -1
- package/time-picker/time-picker.d.ts +1 -1
- package/time-picker/time-picker.js +26 -28
- package/time-picker/time-picker.js.map +1 -1
- package/time-picker/time-picker.props.js +1 -1
- package/utils/class-names.js +3 -7
- package/utils/class-names.js.map +1 -1
- package/utils/persian-to-english-number.js +3 -3
- package/utils/persian-to-english-number.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-picker.js","sourceRoot":"","sources":["../../date-time-picker/date-time-picker.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb
|
|
1
|
+
{"version":3,"file":"date-time-picker.js","sourceRoot":"","sources":["../../date-time-picker/date-time-picker.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,iCAAoD;AAEpD,iDAAmD;AACnD,mEAAmC;AACnC,yEAAwC;AACxC,6FAA+C;AAE/C,MAAM,cAAc,GAAG,CAAC,EAC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
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const date_time_picker_1 = tslib_1.__importDefault(require("./date-time-picker"));
|
|
5
|
+
exports.default = date_time_picker_1.default;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../date-time-picker/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../date-time-picker/index.ts"],"names":[],"mappings":";;;AAAA,kFAAgD;AAEhD,kBAAe,0BAAc,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DateTimePicker = exports.TimePicker = exports.DataTable = exports.CountDown = exports.Pagination = exports.Calendar = exports.Slider = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.Slider = slider_1
|
|
7
|
-
|
|
8
|
-
exports.Calendar = calendar_1
|
|
9
|
-
|
|
10
|
-
exports.Pagination = pagination_1
|
|
11
|
-
|
|
12
|
-
exports.CountDown = countdown_1
|
|
13
|
-
|
|
14
|
-
exports.DataTable = data_table_1
|
|
15
|
-
|
|
16
|
-
exports.TimePicker = time_picker_1
|
|
17
|
-
|
|
18
|
-
exports.DateTimePicker = date_time_picker_1
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const slider_1 = tslib_1.__importDefault(require("./slider/slider"));
|
|
6
|
+
exports.Slider = slider_1.default;
|
|
7
|
+
const calendar_1 = tslib_1.__importDefault(require("./calendar/calendar"));
|
|
8
|
+
exports.Calendar = calendar_1.default;
|
|
9
|
+
const pagination_1 = tslib_1.__importDefault(require("./pagination/pagination"));
|
|
10
|
+
exports.Pagination = pagination_1.default;
|
|
11
|
+
const countdown_1 = tslib_1.__importDefault(require("./countdown-timer/countdown"));
|
|
12
|
+
exports.CountDown = countdown_1.default;
|
|
13
|
+
const data_table_1 = tslib_1.__importDefault(require("./data-table/data-table"));
|
|
14
|
+
exports.DataTable = data_table_1.default;
|
|
15
|
+
const time_picker_1 = tslib_1.__importDefault(require("./time-picker/time-picker"));
|
|
16
|
+
exports.TimePicker = time_picker_1.default;
|
|
17
|
+
const date_time_picker_1 = tslib_1.__importDefault(require("./date-time-picker/date-time-picker"));
|
|
18
|
+
exports.DateTimePicker = date_time_picker_1.default;
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAAA,qEAAqC;AASnC,iBATK,gBAAM,CASL;AARR,2EAA2C;AASzC,mBATK,kBAAQ,CASL;AARV,iFAAiD;AAS/C,qBATK,oBAAU,CASL;AARZ,oFAAoD;AASlD,oBATK,mBAAS,CASL;AARX,iFAAgD;AAS9C,oBATK,oBAAS,CASL;AARX,oFAAmD;AASjD,qBATK,qBAAU,CASL;AARZ,mGAAiE;AAS/D,yBATK,0BAAc,CASL"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pezeshk-book/modules",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"types": "./index.d.ts",
|
|
5
|
-
"main": "./index.
|
|
6
|
-
"module": "./index.js",
|
|
5
|
+
"main": "./index.js",
|
|
7
6
|
"author": "PezeshkBook Company",
|
|
8
7
|
"description": "Slider Module for use in React or Next.js.",
|
|
9
8
|
"homepage": "https://pbkit.pezeshkbook.com",
|
|
@@ -19,48 +18,17 @@
|
|
|
19
18
|
"tailwind"
|
|
20
19
|
],
|
|
21
20
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"
|
|
24
|
-
"tailwindcss": "^4.1.12",
|
|
25
|
-
"@pezeshk-book/ui-kit": "^1.0.6",
|
|
26
|
-
"react-date-object": "2.1.7",
|
|
27
|
-
"use-debounce": "^10.0.3",
|
|
21
|
+
"@emotion/is-prop-valid": "^1.4.0",
|
|
22
|
+
"@pezeshk-book/ui-kit": "1.1.1",
|
|
28
23
|
"@tanstack/react-table": "^8.20.5",
|
|
29
|
-
"motion": "^11.17.0"
|
|
24
|
+
"motion": "^11.17.0",
|
|
25
|
+
"react-date-object": "2.1.7",
|
|
26
|
+
"tailwind-merge": "^3.3.1",
|
|
27
|
+
"tslib": "^2.8.1",
|
|
28
|
+
"use-debounce": "^10.0.3"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|
|
32
|
-
"react": "19.0
|
|
33
|
-
"react-dom": "19.0
|
|
34
|
-
}
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/jest": "^27.5.2",
|
|
37
|
-
"@types/node": "^16.18.10",
|
|
38
|
-
"@types/react": "^19.1.11",
|
|
39
|
-
"@types/react-dom": "^19.0.0",
|
|
40
|
-
"prop-types": "^15.8.1",
|
|
41
|
-
"react": "19.0.2",
|
|
42
|
-
"react-dom": "19.0.2",
|
|
43
|
-
"react-scripts": "5.0.1",
|
|
44
|
-
"typescript": "^4.9.4",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^8.48.1",
|
|
46
|
-
"@typescript-eslint/parser": "^8.48.1",
|
|
47
|
-
"eslint": "^8",
|
|
48
|
-
"eslint-config-next": "^15.4.7"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"start": "react-scripts start",
|
|
52
|
-
"test": "react-scripts test",
|
|
53
|
-
"eject": "react-scripts eject"
|
|
54
|
-
},
|
|
55
|
-
"eslintConfig": {
|
|
56
|
-
"extends": [
|
|
57
|
-
"react-app",
|
|
58
|
-
"react-app/jest"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"browserslist": [
|
|
62
|
-
">0.2%",
|
|
63
|
-
"not dead",
|
|
64
|
-
"not op_mini all"
|
|
65
|
-
]
|
|
31
|
+
"react": "^19.2.0",
|
|
32
|
+
"react-dom": "^19.2.0"
|
|
33
|
+
}
|
|
66
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const ArrowRight: ({ fill, className }: {
|
|
2
|
-
fill?: string
|
|
3
|
-
className?: string
|
|
4
|
-
}) => import("react
|
|
2
|
+
fill?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
}) => import("react").JSX.Element;
|
|
5
5
|
export default ArrowRight;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _b = _a.fill, fill = _b === void 0 ? 'none' : _b, _c = _a.className, className = _c === void 0 ? 'h-3 w-3' : _c;
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", width: "256", height: "256", viewBox: "0 0 256 256", fill: fill, className: className }, { children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', strokeMiterlimit: "10", strokeWidth: "0", d: "M24.64 90L20.36 85.72 61.08 45 20.36 4.28 24.64 0 69.64 45z", transform: "matrix(2.81 0 0 2.81 1.407 1.407)" }) })));
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ArrowRight = ({ fill = 'none', className = 'h-3 w-3' }) => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "256", height: "256", viewBox: "0 0 256 256", fill: fill, className: className, children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', strokeMiterlimit: "10", strokeWidth: "0", d: "M24.64 90L20.36 85.72 61.08 45 20.36 4.28 24.64 0 69.64 45z", transform: "matrix(2.81 0 0 2.81 1.407 1.407)" }) }));
|
|
8
6
|
};
|
|
9
|
-
exports
|
|
7
|
+
exports.default = ArrowRight;
|
|
10
8
|
//# sourceMappingURL=arrow-Right.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-Right.js","sourceRoot":"","sources":["../../../pagination/icons/arrow-Right.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-Right.js","sourceRoot":"","sources":["../../../pagination/icons/arrow-Right.tsx"],"names":[],"mappings":";;;AAAA,MAAM,UAAU,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,SAAS,GAAG,SAAS,EAAuC,EAAE,EAAE;IACnG,OAAO,CACL,gCACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,OAAO,EAAC,aAAa,EACrB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,YAEpB,iCACE,IAAI,EAAE,cAAc,EACpB,gBAAgB,EAAC,IAAI,EACrB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,6DAA6D,EAC/D,SAAS,EAAC,mCAAmC,GAC7C,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _b = _a.fill, fill = _b === void 0 ? 'none' : _b, _c = _a.className, className = _c === void 0 ? 'h-3 w-3' : _c;
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)("svg", tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", width: "256", height: "256", viewBox: "0 0 256 256", className: className, fill: fill }, { children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', strokeMiterlimit: "10", strokeWidth: "0", d: "M65.36 0L69.64 4.28 28.92 45 69.64 85.72 65.36 90 20.36 45z", transform: "matrix(2.81 0 0 2.81 1.407 1.407)" }) })));
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ArrowLeft = ({ fill = 'none', className = 'h-3 w-3' }) => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "256", height: "256", viewBox: "0 0 256 256", className: className, fill: fill, children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', strokeMiterlimit: "10", strokeWidth: "0", d: "M65.36 0L69.64 4.28 28.92 45 69.64 85.72 65.36 90 20.36 45z", transform: "matrix(2.81 0 0 2.81 1.407 1.407)" }) }));
|
|
8
6
|
};
|
|
9
|
-
exports
|
|
7
|
+
exports.default = ArrowLeft;
|
|
10
8
|
//# sourceMappingURL=arrow-left.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-left.js","sourceRoot":"","sources":["../../../pagination/icons/arrow-left.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arrow-left.js","sourceRoot":"","sources":["../../../pagination/icons/arrow-left.tsx"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,SAAS,GAAG,SAAS,EAAuC,EAAE,EAAE;IAClG,OAAO,CACL,gCACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,OAAO,EAAC,aAAa,EACrB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,YAEV,iCACE,IAAI,EAAE,cAAc,EACpB,gBAAgB,EAAC,IAAI,EACrB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,6DAA6D,EAC/D,SAAS,EAAC,mCAAmC,GAC7C,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArrowLeft = exports.ArrowRight = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.ArrowLeft = arrow_left_1
|
|
7
|
-
|
|
8
|
-
exports.ArrowRight = arrow_Right_1
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const arrow_left_1 = tslib_1.__importDefault(require("./arrow-left"));
|
|
6
|
+
exports.ArrowLeft = arrow_left_1.default;
|
|
7
|
+
const arrow_Right_1 = tslib_1.__importDefault(require("./arrow-Right"));
|
|
8
|
+
exports.ArrowRight = arrow_Right_1.default;
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../pagination/icons/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../pagination/icons/index.ts"],"names":[],"mappings":";;;;AAAA,sEAAqC;AAKnC,oBALK,oBAAS,CAKL;AAJX,wEAAuC;AAGrC,qBAHK,qBAAU,CAGL"}
|
package/pagination/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const pagination_1 = tslib_1.__importDefault(require("./pagination"));
|
|
5
|
+
exports.default = pagination_1.default;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/pagination/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../pagination/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../pagination/index.ts"],"names":[],"mappings":";;;AAAA,sEAAsC;AAEtC,kBAAe,oBAAU,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaginationProps } from './pagination.props';
|
|
2
|
-
export declare const Pagination: ({ isLoading, currentPage, lastPage, getCurrentPage, previousPage, nextPage, perPage, total, getLimit, hasLimit, showTotal, color, variant, rounded, type }: PaginationProps) => import("react
|
|
2
|
+
export declare const Pagination: ({ isLoading, currentPage, lastPage, getCurrentPage, previousPage, nextPage, perPage, total, getLimit, hasLimit, showTotal, color, variant, rounded, type }: PaginationProps) => import("react").JSX.Element;
|
|
3
3
|
export default Pagination;
|
package/pagination/pagination.js
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Pagination = void 0;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ui_kit_1 = require("@pezeshk-book/ui-kit");
|
|
9
|
+
const icons_1 = require("./icons");
|
|
10
|
+
const use_pagination_1 = tslib_1.__importDefault(require("./use-pagination"));
|
|
11
|
+
const Limits = [
|
|
12
12
|
{
|
|
13
13
|
id: '10',
|
|
14
|
-
count: 10
|
|
14
|
+
count: 10,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
id: '25',
|
|
18
|
-
count: 25
|
|
18
|
+
count: 25,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: '50',
|
|
22
|
-
count: 50
|
|
22
|
+
count: 50,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
id: '75',
|
|
26
|
-
count: 75
|
|
26
|
+
count: 75,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
id: '100',
|
|
30
|
-
count: 100
|
|
30
|
+
count: 100,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
id: '250',
|
|
34
|
-
count: 250
|
|
34
|
+
count: 250,
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
id: '500',
|
|
38
|
-
count: 500
|
|
38
|
+
count: 500,
|
|
39
39
|
},
|
|
40
40
|
];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var position = Limits.find(function (value) {
|
|
41
|
+
const Pagination = ({ isLoading, currentPage = 1, lastPage, getCurrentPage, previousPage, nextPage, perPage = 10, total = 0, getLimit, hasLimit = true, showTotal = true, color = 'control', variant = 'outlined', rounded = 'medium', type = 'default' }) => {
|
|
42
|
+
const pageNumbers = (0, use_pagination_1.default)(currentPage, lastPage, type);
|
|
43
|
+
const [limit, setLimit] = (0, react_1.useState)(perPage.toString());
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
45
|
+
const position = Limits.find((value) => {
|
|
47
46
|
return perPage <= value.count;
|
|
48
47
|
});
|
|
49
|
-
setLimit(
|
|
48
|
+
setLimit(prevState => (position === null || position === void 0 ? void 0 : position.id) ? position === null || position === void 0 ? void 0 : position.id : prevState);
|
|
50
49
|
}, [perPage]);
|
|
51
|
-
|
|
50
|
+
const limitHandler = (event) => {
|
|
52
51
|
setLimit(event);
|
|
53
52
|
if (getLimit && hasLimit) {
|
|
54
53
|
getLimit(event);
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
|
-
return ((0, jsx_runtime_1.jsxs)(ui_kit_1.Div,
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Button,
|
|
59
|
-
}) : null, (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Button,
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'flex-col-reverse sm:flex-row w-full justify-between items-center gap-y-2 px-4', children: [(0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'flex justify-start items-center', children: (0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'items-center gap-6 justify-start md:absolute', children: [showTotal ? ((0, jsx_runtime_1.jsx)(ui_kit_1.Text, { color: 'grey.500', className: 'text-ellipsis whitespace-nowrap', children: `نمایش ${(currentPage - 1) * parseInt(limit) + 1} تا ${lastPage === currentPage ? total : parseInt(limit) * currentPage} از ${total}` })) : null, hasLimit ? ((0, jsx_runtime_1.jsx)(ui_kit_1.Div, { className: 'w-20', children: (0, jsx_runtime_1.jsx)(ui_kit_1.Select, { disabled: isLoading, id: 'id', size: 'small', value: limit, onChange: limitHandler, text: 'count', optionsList: Limits, variant: 'outlined', color: 'control' }) })) : null] }) }), (0, jsx_runtime_1.jsxs)("ul", { dir: 'ltr', className: 'flex flex-row gap-x-0.5 md:gap-x-2 items-center md:justify-start justify-center', children: [(0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Button, { disabled: currentPage === 1 || isLoading, variant: variant, shape: 'square', size: 'small', onClick: previousPage, ariaLabel: 'previousPage', loading: isLoading, color: color, rounded: rounded, className: '!px-0', children: (0, jsx_runtime_1.jsx)(icons_1.ArrowLeft, {}) }) }), type === 'default' ? pageNumbers.map((number) => {
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Button, { disabled: number === currentPage || number === '...' || isLoading, variant: variant, shape: 'square', rounded: rounded, size: 'small', color: color, className: '!px-0', ariaLabel: number.toString(), onClick: () => getCurrentPage(+number), children: number }) }, `pagination_${number}`));
|
|
58
|
+
}) : null, (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ui_kit_1.Button, { disabled: lastPage === currentPage || isLoading, variant: variant, shape: 'square', size: 'small', rounded: rounded, onClick: nextPage, ariaLabel: 'nextPage', loading: isLoading, color: color, className: '!px-0', children: (0, jsx_runtime_1.jsx)(icons_1.ArrowRight, {}) }) }), type === 'simple' ? ((0, jsx_runtime_1.jsxs)(ui_kit_1.Div, { className: 'gap-2', children: [(0, jsx_runtime_1.jsxs)(ui_kit_1.Text, { typography: 'sm', children: [currentPage, " / ", lastPage] }), (0, jsx_runtime_1.jsx)(ui_kit_1.Text, { typography: 'sm', children: "\u0635\u0641\u062D\u0647" })] })) : null] })] }));
|
|
60
59
|
};
|
|
61
60
|
exports.Pagination = Pagination;
|
|
62
|
-
exports
|
|
61
|
+
exports.default = exports.Pagination;
|
|
63
62
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../pagination/pagination.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AAEb
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../pagination/pagination.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AAEb,iCAA4C;AAC5C,iDAAiE;AACjE,mCAAgD;AAEhD,8EAA6C;AAE7C,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,EAAE;KACV;IACD;QACE,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,EAAE;KACV;IACD;QACE,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,EAAE;KACV;IACD;QACE,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,EAAE;KACV;IACD;QACE,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,GAAG;KACX;IACD;QACE,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,GAAG;KACX;IACD;QACE,EAAE,EAAE,KAAK;QACT,KAAK,EAA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age: number, lastPage: number, type:
|
|
1
|
+
declare const usePagination: (currentPage: number, lastPage: number, type: "simple" | "default") => (string | number)[];
|
|
2
2
|
export default usePagination;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const usePagination = (currentPage, lastPage, type) => {
|
|
4
4
|
if (type === 'simple') {
|
|
5
5
|
return [];
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
let situation = 'NONE';
|
|
8
8
|
if (lastPage > 7) {
|
|
9
9
|
if ((currentPage <= 4)) {
|
|
10
10
|
situation = 'BEGINNING';
|
|
@@ -16,10 +16,10 @@ var usePagination = function (currentPage, lastPage, type) {
|
|
|
16
16
|
situation = 'MIDDLE';
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
const temp = [];
|
|
20
20
|
switch (situation) {
|
|
21
21
|
case 'BEGINNING': {
|
|
22
|
-
for (
|
|
22
|
+
for (let i = 1; i <= 5; i++) {
|
|
23
23
|
temp.push(i);
|
|
24
24
|
}
|
|
25
25
|
temp.push('...', lastPage);
|
|
@@ -30,19 +30,19 @@ var usePagination = function (currentPage, lastPage, type) {
|
|
|
30
30
|
return temp;
|
|
31
31
|
}
|
|
32
32
|
case 'END': {
|
|
33
|
-
for (
|
|
33
|
+
for (let i = lastPage; i > (lastPage - 5); i--) {
|
|
34
34
|
temp.push(i);
|
|
35
35
|
}
|
|
36
36
|
temp.push('...', 1);
|
|
37
37
|
return temp.reverse();
|
|
38
38
|
}
|
|
39
39
|
default: {
|
|
40
|
-
for (
|
|
40
|
+
for (let i = 1; i <= lastPage; i++) {
|
|
41
41
|
temp.push(i);
|
|
42
42
|
}
|
|
43
43
|
return temp;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
exports
|
|
47
|
+
exports.default = usePagination;
|
|
48
48
|
//# sourceMappingURL=use-pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination.js","sourceRoot":"","sources":["../../pagination/use-pagination.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"use-pagination.js","sourceRoot":"","sources":["../../pagination/use-pagination.ts"],"names":[],"mappings":";;AAAA,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAE,QAAgB,EAAE,IAA0B,EAAE,EAAE;IAC1F,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,SAAS,GAAG,MAAM,CAAC;IACvB,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,EAAE,CAAC;YACvB,SAAS,GAAG,WAAW,CAAC;QAC1B,CAAC;aAAM,IAAI,QAAQ,GAAG,WAAW,IAAI,CAAC,EAAE,CAAC;YACvC,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC;aAAM,IAAI,WAAW,GAAG,CAAC,IAAI,QAAQ,GAAG,WAAW,GAAG,CAAC,EAAE,CAAC;YACzD,SAAS,GAAG,QAAQ,CAAC;QACvB,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAA2B,EAAE,CAAC;IAExC,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;YACpF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,KAAK,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/C,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;QAED,OAAQ,CAAC,CAAC,CAAC;YACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;gBACnC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|
package/slider/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const slider_1 = tslib_1.__importDefault(require("./slider"));
|
|
5
|
+
exports.default = slider_1.default;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/slider/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../slider/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../slider/index.ts"],"names":[],"mappings":";;;AAAA,8DAA8B;AAE9B,kBAAe,gBAAM,CAAC"}
|
package/slider/slider.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SliderProps } from './slider.props';
|
|
2
|
-
declare const Slider: ({ children, delay, spaceBetween, slides, infiniteLoop, pauseOnMouseOver, autoMove, indicatorActiveColor, indicator, navigation, prevNavigation, nextNavigation, direction, rows, navigationColor, tabletSlides, mobileSlides, indicatorClassName, }: SliderProps) =>
|
|
3
|
+
declare const Slider: ({ children, delay, spaceBetween, slides, infiniteLoop, pauseOnMouseOver, autoMove, indicatorActiveColor, indicator, navigation, prevNavigation, nextNavigation, direction, rows, navigationColor, tabletSlides, mobileSlides, indicatorClassName, }: SliderProps) => React.JSX.Element;
|
|
3
4
|
export default Slider;
|