@daoyi/nmtl-ui 2.0.1-beta.66 → 2.0.1-beta.68
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/lib/components/Filter.js
CHANGED
|
@@ -754,7 +754,9 @@ var Filter = function Filter(_ref) {
|
|
|
754
754
|
}, {
|
|
755
755
|
'filter__item--active': key === urlSearch[filterKey]
|
|
756
756
|
}),
|
|
757
|
-
onClick:
|
|
757
|
+
onClick: function onClick() {
|
|
758
|
+
return handleClick(key);
|
|
759
|
+
}
|
|
758
760
|
}, "".concat(title, "(").concat(count, ")"));
|
|
759
761
|
}));
|
|
760
762
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c as _objectWithoutProperties$1 } from './_rollupPluginBabelHelpers-ed61ffc0.js';
|
|
1
2
|
import * as React$2 from 'react';
|
|
2
3
|
import React__default, { Children, isValidElement, cloneElement } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -2544,7 +2545,7 @@ function defaultGetAriaLabel(type, page, selected) {
|
|
|
2544
2545
|
return "Go to ".concat(type, " page");
|
|
2545
2546
|
}
|
|
2546
2547
|
|
|
2547
|
-
var Pagination = /*#__PURE__*/React$2.forwardRef(function Pagination(props, ref) {
|
|
2548
|
+
var Pagination$1 = /*#__PURE__*/React$2.forwardRef(function Pagination(props, ref) {
|
|
2548
2549
|
props.boundaryCount;
|
|
2549
2550
|
var classes = props.classes,
|
|
2550
2551
|
className = props.className,
|
|
@@ -2597,9 +2598,9 @@ var Pagination = /*#__PURE__*/React$2.forwardRef(function Pagination(props, ref)
|
|
|
2597
2598
|
})));
|
|
2598
2599
|
})));
|
|
2599
2600
|
}); // @default tags synced with default values from usePagination
|
|
2600
|
-
var
|
|
2601
|
+
var MUIPagination = withStyles(styles$4, {
|
|
2601
2602
|
name: 'MuiPagination'
|
|
2602
|
-
})(Pagination);
|
|
2603
|
+
})(Pagination$1);
|
|
2603
2604
|
|
|
2604
2605
|
/**
|
|
2605
2606
|
* @ignore - internal component.
|
|
@@ -3605,28 +3606,33 @@ var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("pa
|
|
|
3605
3606
|
|
|
3606
3607
|
default_1 = ArrowRight.default = _default;
|
|
3607
3608
|
|
|
3608
|
-
var css_248z = ".
|
|
3609
|
+
var css_248z = ".ntml-pagination__center {\n display: flex;\n justify-content: center; }\n .ntml-pagination__center .MuiSvgIcon-colorSecondary {\n color: #509891; }\n\n.ntml-pagination__rightSide {\n position: relative;\n float: right;\n top: -36px; }\n .ntml-pagination__rightSide-showTotal {\n display: flex;\n align-items: center; }\n .ntml-pagination__rightSide-showTotal .MuiInput-root {\n width: 90px;\n height: 34px;\n margin: 0 8px;\n padding: 2px 8px 3px 20px;\n border-radius: 17px;\n background-color: rgba(222, 219, 202, 0.4);\n border: 0px; }\n .ntml-pagination__rightSide-showTotal .MuiNativeSelect-icon {\n color: #509891; }\n .ntml-pagination__rightSide-showTotal .MuiNativeSelect-select:not([multiple]) option,\n .ntml-pagination__rightSide-showTotal .MuiNativeSelect-select:not([multiple]) optgroup {\n background-color: rgba(222, 219, 202, 0.4); }\n\n@media only screen and (max-width: 767px) {\n .ntml-pagination__center-page {\n width: 48px;\n height: 48px;\n display: flex;\n background-color: rgba(222, 219, 202, 0.4);\n border-radius: 50%;\n align-items: center;\n justify-content: center; }\n .ntml-pagination__rightSide {\n position: relative;\n float: initial;\n top: 0;\n display: flex;\n justify-content: center;\n margin-top: 28px; } }\n";
|
|
3609
3610
|
styleInject(css_248z);
|
|
3610
3611
|
|
|
3611
|
-
var
|
|
3612
|
+
var _excluded = ["className", "pageSize", "total", "onChange"];
|
|
3613
|
+
var Pagination = function Pagination(_ref) {
|
|
3612
3614
|
var className = _ref.className,
|
|
3613
|
-
current = _ref.current,
|
|
3614
|
-
defaultCurrent = _ref.defaultCurrent,
|
|
3615
3615
|
pageSize = _ref.pageSize,
|
|
3616
3616
|
total = _ref.total,
|
|
3617
|
-
_onChange = _ref.onChange
|
|
3617
|
+
_onChange = _ref.onChange,
|
|
3618
|
+
props = _objectWithoutProperties$1(_ref, _excluded);
|
|
3618
3619
|
var count = Math.ceil(total / pageSize);
|
|
3619
3620
|
var pages = Array.from(Array(count).keys(), function (x) {
|
|
3620
3621
|
return x + 1;
|
|
3621
3622
|
});
|
|
3623
|
+
|
|
3624
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
3625
|
+
var current = Number.parseInt(props.current, 10) || 1;
|
|
3626
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
3627
|
+
var defaultCurrent = Number.parseInt(props.defaultCurrent, 10) || 1;
|
|
3622
3628
|
var handlePageSelected = function handlePageSelected(event) {
|
|
3623
3629
|
var page = Number.parseInt(event.target.value, 10);
|
|
3624
3630
|
_onChange(page);
|
|
3625
3631
|
};
|
|
3626
3632
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
3627
|
-
className: classNames('
|
|
3633
|
+
className: classNames('ntml-pagination', className)
|
|
3628
3634
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3629
|
-
className: "
|
|
3635
|
+
className: "ntml-pagination__center"
|
|
3630
3636
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3631
3637
|
style: {
|
|
3632
3638
|
display: 'flex',
|
|
@@ -3639,7 +3645,7 @@ var NmtlPagination = function NmtlPagination(_ref) {
|
|
|
3639
3645
|
}
|
|
3640
3646
|
}, /*#__PURE__*/React__default.createElement(default_1$1, {
|
|
3641
3647
|
color: "secondary"
|
|
3642
|
-
})), /*#__PURE__*/React__default.createElement(
|
|
3648
|
+
})), /*#__PURE__*/React__default.createElement(MUIPagination, {
|
|
3643
3649
|
color: "secondary",
|
|
3644
3650
|
count: count,
|
|
3645
3651
|
boundaryCount: 1,
|
|
@@ -3672,7 +3678,7 @@ var NmtlPagination = function NmtlPagination(_ref) {
|
|
|
3672
3678
|
}, page);
|
|
3673
3679
|
})), /*#__PURE__*/React__default.createElement("span", null, "\u9801\uFF0C\u5171"), count, /*#__PURE__*/React__default.createElement("span", null, "\u9801"))));
|
|
3674
3680
|
};
|
|
3675
|
-
|
|
3681
|
+
Pagination.defaultProps = {
|
|
3676
3682
|
className: undefined,
|
|
3677
3683
|
current: undefined,
|
|
3678
3684
|
defaultCurrent: 1,
|
|
@@ -3682,13 +3688,13 @@ NmtlPagination.defaultProps = {
|
|
|
3682
3688
|
};
|
|
3683
3689
|
|
|
3684
3690
|
/* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
|
|
3685
|
-
|
|
3691
|
+
Pagination.propTypes = {
|
|
3686
3692
|
/** Css Name */
|
|
3687
3693
|
className: PropTypes.string,
|
|
3688
3694
|
/** 当前页数 */
|
|
3689
|
-
current: PropTypes.number,
|
|
3695
|
+
current: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
3690
3696
|
/** 默认的当前页数 */
|
|
3691
|
-
defaultCurrent: PropTypes.number,
|
|
3697
|
+
defaultCurrent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
3692
3698
|
/** 每页条数 */
|
|
3693
3699
|
pageSize: PropTypes.number,
|
|
3694
3700
|
/** 数据总数 */
|
|
@@ -3697,4 +3703,4 @@ NmtlPagination.propTypes = {
|
|
|
3697
3703
|
onChange: PropTypes.func
|
|
3698
3704
|
};
|
|
3699
3705
|
|
|
3700
|
-
export {
|
|
3706
|
+
export { Pagination as default };
|
package/lib/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { default as ExportButton } from './components/ExportButton';
|
|
|
22
22
|
export { default as SNA } from './components/SNA';
|
|
23
23
|
export { default as BarChart } from './components/BarChart';
|
|
24
24
|
export { default as ForwardLink } from './components/ForwardLink';
|
|
25
|
-
export { default as
|
|
25
|
+
export { default as Pagination } from './components/Pagination';
|
|
26
26
|
|
|
27
27
|
export { default as ContactModal } from './components/ContactModal';
|
|
28
28
|
export { default as KeywordSearch } from './components/KeywordSearch';
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { default as ExportButton } from './components/ExportButton';
|
|
|
22
22
|
export { default as SNA } from './components/SNA';
|
|
23
23
|
export { default as BarChart } from './components/BarChart';
|
|
24
24
|
export { default as ForwardLink } from './components/ForwardLink';
|
|
25
|
-
export { default as
|
|
25
|
+
export { default as Pagination } from './components/Pagination';
|
|
26
26
|
|
|
27
27
|
export { default as ContactModal } from './components/ContactModal';
|
|
28
28
|
export { default as KeywordSearch } from './components/KeywordSearch';
|
package/package.json
CHANGED