@uiw/react-pagination
Advanced tools
Comparing version 4.21.23 to 5.0.0-bate.2.0
import { IProps, HTMLUlProps } from '@uiw/utils'; | ||
import './style/index.less'; | ||
export * from './style'; | ||
export interface PaginationProps extends IProps, Omit<HTMLUlProps, 'onChange'> { | ||
@@ -26,1 +26,2 @@ prefixCls?: string; | ||
export default function Pagination(props: PaginationProps): JSX.Element; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,2 +8,3 @@ "use strict"; | ||
}); | ||
var _exportNames = {}; | ||
exports["default"] = Pagination; | ||
@@ -15,2 +16,14 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _reactSelect = _interopRequireDefault(require("@uiw/react-select")); | ||
var _style = require("./style"); | ||
Object.keys(_style).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _style[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _style[key]; | ||
} | ||
}); | ||
}); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
@@ -151,3 +164,3 @@ var _excluded = ["className", "style", "prefixCls", "alignment", "size", "total", "pageSize", "pageSizeOptions", "current", "onChange", "onShowSizeChange", "divider"]; | ||
}; | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({ | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_style.PaginationStyleBaseUL, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({ | ||
className: cls, | ||
@@ -158,5 +171,12 @@ style: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, style), {}, { | ||
}, other), {}, { | ||
params: { | ||
isDivider: divider, | ||
size: size | ||
}, | ||
children: [initPageSoure.map(function (item, idx) { | ||
// eslint-disable-next-line jsx-a11y/anchor-is-valid | ||
var label = /*#__PURE__*/(0, _jsxRuntime.jsx)("a", { | ||
var label = /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.PaginationStyleBaseLIA, { | ||
params: { | ||
size: size | ||
}, | ||
children: item.label | ||
@@ -166,7 +186,19 @@ }); | ||
// eslint-disable-next-line jsx-a11y/anchor-is-valid | ||
label = /*#__PURE__*/(0, _jsxRuntime.jsx)("a", { | ||
label = /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.PaginationStyleBaseLIA, { | ||
params: { | ||
type: item.type, | ||
isArrow: true, | ||
size: size, | ||
disabled: item.disabled | ||
}, | ||
className: "arrow ".concat(item.type) | ||
}); | ||
} | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.PaginationStyleBaseLI, { | ||
params: { | ||
disabled: item.disabled, | ||
active: item.active, | ||
size: size, | ||
isDivider: divider | ||
}, | ||
className: [item.active ? 'active' : null, item.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim(), | ||
@@ -178,3 +210,7 @@ onClick: function onClick() { | ||
}, idx); | ||
}), pageSizeOptions.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("li", { | ||
}), pageSizeOptions.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_style.PaginationStyleBaseLI, { | ||
params: { | ||
isOptions: true, | ||
size: size | ||
}, | ||
className: "".concat(prefixCls, "-options"), | ||
@@ -195,3 +231,2 @@ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect["default"], { | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=index.js.map |
import { IProps, HTMLUlProps } from '@uiw/utils'; | ||
import './style/index.less'; | ||
export * from './style'; | ||
export interface PaginationProps extends IProps, Omit<HTMLUlProps, 'onChange'> { | ||
@@ -26,1 +26,2 @@ prefixCls?: string; | ||
export default function Pagination(props: PaginationProps): JSX.Element; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,5 +6,6 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import Select from '@uiw/react-select'; | ||
import "./style/index.css"; | ||
import { PaginationStyleBaseUL, PaginationStyleBaseLI, PaginationStyleBaseLIA } from './style'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
export * from './style'; | ||
export default function Pagination(props) { | ||
@@ -131,3 +132,3 @@ var { | ||
}; | ||
return /*#__PURE__*/_jsxs("ul", _extends({ | ||
return /*#__PURE__*/_jsxs(PaginationStyleBaseUL, _extends({ | ||
className: cls, | ||
@@ -138,5 +139,12 @@ style: _extends({}, style, { | ||
}, other, { | ||
params: { | ||
isDivider: divider, | ||
size | ||
}, | ||
children: [initPageSoure.map((item, idx) => { | ||
// eslint-disable-next-line jsx-a11y/anchor-is-valid | ||
var label = /*#__PURE__*/_jsx("a", { | ||
var label = /*#__PURE__*/_jsx(PaginationStyleBaseLIA, { | ||
params: { | ||
size | ||
}, | ||
children: item.label | ||
@@ -146,7 +154,19 @@ }); | ||
// eslint-disable-next-line jsx-a11y/anchor-is-valid | ||
label = /*#__PURE__*/_jsx("a", { | ||
label = /*#__PURE__*/_jsx(PaginationStyleBaseLIA, { | ||
params: { | ||
type: item.type, | ||
isArrow: true, | ||
size, | ||
disabled: item.disabled | ||
}, | ||
className: "arrow " + item.type | ||
}); | ||
} | ||
return /*#__PURE__*/_jsx("li", { | ||
return /*#__PURE__*/_jsx(PaginationStyleBaseLI, { | ||
params: { | ||
disabled: item.disabled, | ||
active: item.active, | ||
size, | ||
isDivider: divider | ||
}, | ||
className: [item.active ? 'active' : null, item.disabled ? 'disabled' : null].filter(Boolean).join(' ').trim(), | ||
@@ -156,3 +176,7 @@ onClick: () => handleClick(item), | ||
}, idx); | ||
}), pageSizeOptions.length > 0 && /*#__PURE__*/_jsx("li", { | ||
}), pageSizeOptions.length > 0 && /*#__PURE__*/_jsx(PaginationStyleBaseLI, { | ||
params: { | ||
isOptions: true, | ||
size | ||
}, | ||
className: prefixCls + "-options", | ||
@@ -159,0 +183,0 @@ children: /*#__PURE__*/_jsx(Select, { |
{ | ||
"name": "@uiw/react-pagination", | ||
"version": "4.21.23", | ||
"version": "5.0.0-bate.2.0", | ||
"description": "Pagination component", | ||
@@ -44,8 +44,9 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"react": ">=16.9.0", | ||
"react-dom": ">=16.9.0" | ||
"react-dom": ">=16.9.0", | ||
"styled-components": ">=5.3.5" | ||
}, | ||
"dependencies": { | ||
"@uiw/react-select": "^4.21.23", | ||
"@uiw/utils": "^4.21.23" | ||
"@uiw/react-select": "^5.0.0-bate.2.0", | ||
"@uiw/utils": "^5.0.0-bate.2.0" | ||
} | ||
} |
@@ -18,7 +18,8 @@ Pagination 分页 | ||
```jsx mdx:preview&bg=#fff | ||
```jsx mdx:preview&background=transparent&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Pagination, Divider } from 'uiw'; | ||
export default function Demo() { | ||
const Demo = () => { | ||
const [pageObj, setPageObj] = React.useState({ | ||
@@ -54,2 +55,4 @@ current: 2, | ||
} | ||
export default Demo | ||
``` | ||
@@ -59,15 +62,14 @@ | ||
```jsx mdx:preview&bg=#fff | ||
```jsx mdx:preview&background=transparent&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Pagination, Divider } from 'uiw'; | ||
export default function Demo() { | ||
return ( | ||
<div> | ||
<Pagination size="small" current={1} pageSize={5} pageSizeOptions={[5, 10, 20, 30]} total={249} /> | ||
<Divider /> | ||
<Pagination size="small" current={1} pageSize={10} total={50} /> | ||
</div> | ||
); | ||
function Demo() { | ||
return <div> | ||
<Pagination size="small" current={1} pageSize={5} pageSizeOptions={[5, 10, 20, 30]} total={249} /> | ||
<Divider /> | ||
<Pagination size="small" current={1} pageSize={10} total={50} /> | ||
</div> | ||
} | ||
export default Demo | ||
``` | ||
@@ -79,37 +81,37 @@ | ||
```jsx mdx:preview&bg=#fff | ||
```jsx mdx:preview&background=transparent&codeSandbox=true&codePen=true | ||
import React from 'react'; | ||
import { Pagination, Divider } from 'uiw'; | ||
export default function Demo() { | ||
return ( | ||
<div> | ||
<Pagination | ||
current={5} | ||
total={250} | ||
onChange={(pageNumber) => { | ||
console.log(`pageNumber:${pageNumber}`) | ||
}} | ||
/> | ||
<Divider /> | ||
<Pagination | ||
current={1} | ||
alignment="center" | ||
total={250} | ||
onChange={(pageNumber) => { | ||
console.log(`pageNumber:${pageNumber}`) | ||
}} | ||
/> | ||
<Divider /> | ||
<Pagination | ||
current={25} | ||
alignment="right" | ||
total={250} | ||
onChange={(pageNumber) => { | ||
console.log(`pageNumber:${pageNumber}`) | ||
}} | ||
/> | ||
</div> | ||
); | ||
function Demo() { | ||
return <div> | ||
<Pagination | ||
current={5} | ||
total={250} | ||
onChange={(pageNumber) => { | ||
console.log(`pageNumber:${pageNumber}`) | ||
}} | ||
/> | ||
<Divider /> | ||
<Pagination | ||
current={1} | ||
alignment="center" | ||
total={250} | ||
onChange={(pageNumber) => { | ||
console.log(`pageNumber:${pageNumber}`) | ||
}} | ||
/> | ||
<Divider /> | ||
<Pagination | ||
current={25} | ||
alignment="right" | ||
total={250} | ||
onChange={(pageNumber) => { | ||
console.log(`pageNumber:${pageNumber}`) | ||
}} | ||
/> | ||
</div> | ||
} | ||
export default Demo | ||
``` | ||
@@ -116,0 +118,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110866
16
1181
127
5
1
+ Added@emotion/is-prop-valid@1.2.2(transitive)
+ Added@emotion/memoize@0.8.1(transitive)
+ Added@emotion/unitless@0.8.1(transitive)
+ Added@types/stylis@4.2.5(transitive)
+ Added@uiw/react-select@5.0.0-bate-9(transitive)
+ Added@uiw/utils@5.0.0-bate-9(transitive)
+ Addedcamelize@1.0.1(transitive)
+ Addedcss-color-keywords@1.0.0(transitive)
+ Addedcss-to-react-native@3.2.0(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.38(transitive)
+ Addedpostcss-value-parser@4.2.0(transitive)
+ Addedshallowequal@1.1.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedstyled-components@6.1.13(transitive)
+ Addedstylis@4.3.2(transitive)
+ Addedtslib@2.6.2(transitive)
- Removed@uiw/react-select@4.22.3(transitive)
- Removed@uiw/utils@4.22.3(transitive)
Updated@uiw/utils@^5.0.0-bate.2.0