@helpdice/ui 2.5.8-beta.0 → 2.5.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/auto-complete/index.js +549 -491
- package/dist/avatar/index.js +82 -45
- package/dist/badge/index.js +69 -27
- package/dist/breadcrumbs/index.js +107 -56
- package/dist/button/button.icon.d.ts +3 -15
- package/dist/button/button.small.d.ts +3 -15
- package/dist/button/index.js +143 -155
- package/dist/button-dropdown/index.js +96 -83
- package/dist/button-group/index.js +61 -21
- package/dist/capacity/index.js +61 -22
- package/dist/card/index.js +147 -123
- package/dist/carousal/index.js +349 -328
- package/dist/checkbox/index.js +72 -67
- package/dist/circular-progress/CircularProgress.d.ts +17 -0
- package/dist/circular-progress/index.d.ts +3 -4
- package/dist/circular-progress/index.js +713 -336
- package/dist/circular-progress/useCircularProgress.d.ts +12 -0
- package/dist/code/index.js +70 -26
- package/dist/col/index.js +61 -24
- package/dist/collapse/index.js +102 -52
- package/dist/container/index.js +187 -188
- package/dist/copy-to-clipboard/index.js +158 -208
- package/dist/description/index.js +64 -23
- package/dist/display/index.js +64 -23
- package/dist/divider/index.js +62 -22
- package/dist/dot/index.js +63 -23
- package/dist/drawer/index.js +74 -61
- package/dist/fieldset/index.js +127 -63
- package/dist/form/index.js +15 -40
- package/dist/grid/index.js +74 -29
- package/dist/html-renderer/index.js +3 -2
- package/dist/image/index.js +163 -104
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4173 -3745
- package/dist/input/index.js +466 -419
- package/dist/keyboard/index.js +73 -29
- package/dist/linear-progress/index.js +27 -24
- package/dist/link/index.js +78 -36
- package/dist/list/index.js +118 -63
- package/dist/loadable/index.js +76 -27
- package/dist/loading/index.js +70 -29
- package/dist/menu/index.js +53 -47
- package/dist/modal/index.js +225 -178
- package/dist/note/index.js +64 -23
- package/dist/notetip/index.js +54 -45
- package/dist/notetip/note-tip.d.ts +2 -0
- package/dist/page/index.js +102 -51
- package/dist/pagination/index.js +180 -123
- package/dist/placeholder/index.js +545 -534
- package/dist/popover/index.js +94 -81
- package/dist/progress/index.js +66 -27
- package/dist/radio/index.js +94 -48
- package/dist/rating/index.js +78 -38
- package/dist/row/index.js +62 -25
- package/dist/search-bar/index.js +172 -162
- package/dist/select/index.js +364 -327
- package/dist/slider/index.js +91 -47
- package/dist/snippet/index.js +39 -39
- package/dist/spacer/index.js +58 -19
- package/dist/spinner/index.js +69 -28
- package/dist/swipe/index.js +28 -13
- package/dist/table/index.js +2217 -1973
- package/dist/table/table-body.d.ts +4 -2
- package/dist/table/table-cell.d.ts +4 -2
- package/dist/table/table-types.d.ts +2 -0
- package/dist/table/table.d.ts +4 -1
- package/dist/tabs/index.js +61 -59
- package/dist/tag/index.js +16 -20
- package/dist/text/index.js +178 -180
- package/dist/textarea/index.js +220 -214
- package/dist/toggle/index.js +75 -33
- package/dist/tooltip/index.d.ts +1 -2
- package/dist/tooltip/index.js +59 -52
- package/dist/tooltip/tooltip-content.d.ts +1 -1
- package/dist/tooltip/tooltip.d.ts +2 -1
- package/dist/tree/index.js +176 -115
- package/dist/use-scale/index.js +50 -13
- package/dist/user/index.js +146 -96
- package/esm/button/button.icon.d.ts +3 -15
- package/esm/button/button.icon.js +22 -22
- package/esm/button/button.js +4 -4
- package/esm/button/button.small.d.ts +3 -15
- package/esm/button/button.small.js +20 -21
- package/esm/circular-progress/CircularProgress.d.ts +17 -0
- package/esm/circular-progress/CircularProgress.js +110 -0
- package/esm/circular-progress/index.d.ts +3 -4
- package/esm/circular-progress/index.js +3 -4
- package/esm/circular-progress/useCircularProgress.d.ts +12 -0
- package/esm/circular-progress/useCircularProgress.js +35 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +1 -1
- package/esm/list/list-item.js +11 -11
- package/esm/notetip/note-tip.d.ts +2 -0
- package/esm/notetip/note-tip.js +8 -5
- package/esm/skeleton/index.js +9 -4
- package/esm/table/table-body.d.ts +4 -2
- package/esm/table/table-body.js +9 -4
- package/esm/table/table-cell.d.ts +4 -2
- package/esm/table/table-cell.js +19 -3
- package/esm/table/table-types.d.ts +2 -0
- package/esm/table/table.d.ts +4 -1
- package/esm/table/table.js +13 -6
- package/esm/tooltip/index.d.ts +1 -2
- package/esm/tooltip/tooltip-content.d.ts +1 -1
- package/esm/tooltip/tooltip-content.js +5 -5
- package/esm/tooltip/tooltip.d.ts +2 -1
- package/esm/tooltip/tooltip.js +6 -5
- package/package.json +3 -3
- package/dist/circular-progress/CircularProgressbar.d.ts +0 -10
- package/dist/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
- package/dist/circular-progress/Path.d.ts +0 -9
- package/dist/circular-progress/buildStyles.d.ts +0 -12
- package/dist/circular-progress/constants.d.ts +0 -5
- package/dist/circular-progress/types.d.ts +0 -50
- package/esm/circular-progress/CircularProgressbar.d.ts +0 -10
- package/esm/circular-progress/CircularProgressbar.js +0 -118
- package/esm/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
- package/esm/circular-progress/CircularProgressbarWithChildren.js +0 -32
- package/esm/circular-progress/Path.d.ts +0 -9
- package/esm/circular-progress/Path.js +0 -52
- package/esm/circular-progress/buildStyles.d.ts +0 -12
- package/esm/circular-progress/buildStyles.js +0 -45
- package/esm/circular-progress/constants.d.ts +0 -5
- package/esm/circular-progress/constants.js +0 -5
- package/esm/circular-progress/types.d.ts +0 -50
- package/esm/circular-progress/types.js +0 -1
package/dist/pagination/index.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var theme = require('@helpdice/theme');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
|
|
8
9
|
function _arrayLikeToArray(r, a) {
|
|
9
10
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -64,14 +65,13 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, _extends.apply(null, arguments);
|
|
68
|
+
function _defineProperty(e, r, t) {
|
|
69
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
70
|
+
value: t,
|
|
71
|
+
enumerable: true,
|
|
72
|
+
configurable: true,
|
|
73
|
+
writable: true
|
|
74
|
+
}) : e[r] = t, e;
|
|
75
75
|
}
|
|
76
76
|
function _iterableToArray(r) {
|
|
77
77
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
@@ -109,6 +109,27 @@ function _nonIterableRest() {
|
|
|
109
109
|
function _nonIterableSpread() {
|
|
110
110
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
111
111
|
}
|
|
112
|
+
function ownKeys(e, r) {
|
|
113
|
+
var t = Object.keys(e);
|
|
114
|
+
if (Object.getOwnPropertySymbols) {
|
|
115
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
116
|
+
r && (o = o.filter(function (r) {
|
|
117
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
118
|
+
})), t.push.apply(t, o);
|
|
119
|
+
}
|
|
120
|
+
return t;
|
|
121
|
+
}
|
|
122
|
+
function _objectSpread2(e) {
|
|
123
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
124
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
125
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
126
|
+
_defineProperty(e, r, t[r]);
|
|
127
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
128
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return e;
|
|
132
|
+
}
|
|
112
133
|
function _objectWithoutProperties(e, t) {
|
|
113
134
|
if (null == e) return {};
|
|
114
135
|
var o,
|
|
@@ -135,6 +156,20 @@ function _slicedToArray(r, e) {
|
|
|
135
156
|
function _toConsumableArray(r) {
|
|
136
157
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
137
158
|
}
|
|
159
|
+
function _toPrimitive(t, r) {
|
|
160
|
+
if ("object" != typeof t || !t) return t;
|
|
161
|
+
var e = t[Symbol.toPrimitive];
|
|
162
|
+
if (void 0 !== e) {
|
|
163
|
+
var i = e.call(t, r);
|
|
164
|
+
if ("object" != typeof i) return i;
|
|
165
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
166
|
+
}
|
|
167
|
+
return ("string" === r ? String : Number)(t);
|
|
168
|
+
}
|
|
169
|
+
function _toPropertyKey(t) {
|
|
170
|
+
var i = _toPrimitive(t, "string");
|
|
171
|
+
return "symbol" == typeof i ? i : i + "";
|
|
172
|
+
}
|
|
138
173
|
function _unsupportedIterableToArray(r, a) {
|
|
139
174
|
if (r) {
|
|
140
175
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
@@ -743,16 +778,19 @@ var PaginationItem = function PaginationItem(_ref) {
|
|
|
743
778
|
if (disabled) return;
|
|
744
779
|
onClick && onClick(event);
|
|
745
780
|
};
|
|
746
|
-
return /*#__PURE__*/
|
|
747
|
-
className: _JSXStyle.dynamic([["3250617587", [theme$1.palette.accents_7, theme$1.layout.radius, theme$1.palette.background, hover, theme$1.palette.accents_6, theme$1.palette.background, theme$1.expressiveness.shadowSmall, activeHover, theme$1.expressiveness.shadowMedium, theme$1.palette.accents_4, theme$1.palette.accents_2]]])
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
781
|
+
return /*#__PURE__*/jsxRuntime.jsxs("li", {
|
|
782
|
+
className: _JSXStyle.dynamic([["3250617587", [theme$1.palette.accents_7, theme$1.layout.radius, theme$1.palette.background, hover, theme$1.palette.accents_6, theme$1.palette.background, theme$1.expressiveness.shadowSmall, activeHover, theme$1.expressiveness.shadowMedium, theme$1.palette.accents_4, theme$1.palette.accents_2]]]),
|
|
783
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("button", _objectSpread2(_objectSpread2({
|
|
784
|
+
onClick: clickHandler
|
|
785
|
+
}, props), {}, {
|
|
786
|
+
className: _JSXStyle.dynamic([["3250617587", [theme$1.palette.accents_7, theme$1.layout.radius, theme$1.palette.background, hover, theme$1.palette.accents_6, theme$1.palette.background, theme$1.expressiveness.shadowSmall, activeHover, theme$1.expressiveness.shadowMedium, theme$1.palette.accents_4, theme$1.palette.accents_2]]]) + " " + (props && props.className != null && props.className || classes || ""),
|
|
787
|
+
children: children
|
|
788
|
+
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
789
|
+
id: "3250617587",
|
|
790
|
+
dynamic: [theme$1.palette.accents_7, theme$1.layout.radius, theme$1.palette.background, hover, theme$1.palette.accents_6, theme$1.palette.background, theme$1.expressiveness.shadowSmall, activeHover, theme$1.expressiveness.shadowMedium, theme$1.palette.accents_4, theme$1.palette.accents_2],
|
|
791
|
+
children: "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme$1.palette.accents_7, ";border-radius:").concat(theme$1.layout.radius, ";background-color:").concat(theme$1.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme$1.palette.accents_6, ";color:").concat(theme$1.palette.background, ";box-shadow:").concat(theme$1.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme$1.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme$1.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme$1.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")
|
|
792
|
+
})]
|
|
793
|
+
});
|
|
756
794
|
};
|
|
757
795
|
PaginationItem.displayName = 'PaginationItem';
|
|
758
796
|
|
|
@@ -787,12 +825,14 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
|
|
|
787
825
|
var _usePaginationContext = usePaginationContext(),
|
|
788
826
|
update = _usePaginationContext.update,
|
|
789
827
|
isFirst = _usePaginationContext.isFirst;
|
|
790
|
-
return /*#__PURE__*/
|
|
828
|
+
return /*#__PURE__*/jsxRuntime.jsx(PaginationItem, _objectSpread2(_objectSpread2({
|
|
791
829
|
onClick: function onClick() {
|
|
792
830
|
return update && update('prev');
|
|
793
831
|
},
|
|
794
832
|
disabled: isFirst
|
|
795
|
-
}, props),
|
|
833
|
+
}, props), {}, {
|
|
834
|
+
children: children
|
|
835
|
+
}));
|
|
796
836
|
};
|
|
797
837
|
PaginationPrevious.displayName = 'PaginationPrevious';
|
|
798
838
|
|
|
@@ -803,12 +843,14 @@ var PaginationNext = function PaginationNext(_ref) {
|
|
|
803
843
|
var _usePaginationContext = usePaginationContext(),
|
|
804
844
|
update = _usePaginationContext.update,
|
|
805
845
|
isLast = _usePaginationContext.isLast;
|
|
806
|
-
return /*#__PURE__*/
|
|
846
|
+
return /*#__PURE__*/jsxRuntime.jsx(PaginationItem, _objectSpread2(_objectSpread2({
|
|
807
847
|
onClick: function onClick() {
|
|
808
848
|
return update && update('next');
|
|
809
849
|
},
|
|
810
850
|
disabled: isLast
|
|
811
|
-
}, props),
|
|
851
|
+
}, props), {}, {
|
|
852
|
+
children: children
|
|
853
|
+
}));
|
|
812
854
|
};
|
|
813
855
|
PaginationNext.displayName = 'PaginationNext';
|
|
814
856
|
|
|
@@ -819,7 +861,7 @@ var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
|
819
861
|
_useState2 = _slicedToArray(_useState, 2),
|
|
820
862
|
showMore = _useState2[0],
|
|
821
863
|
setShowMore = _useState2[1];
|
|
822
|
-
return /*#__PURE__*/
|
|
864
|
+
return /*#__PURE__*/jsxRuntime.jsxs(PaginationItem, {
|
|
823
865
|
onClick: function onClick(e) {
|
|
824
866
|
return _onClick && _onClick(e);
|
|
825
867
|
},
|
|
@@ -828,52 +870,56 @@ var PaginationEllipsis = function PaginationEllipsis(_ref) {
|
|
|
828
870
|
},
|
|
829
871
|
onMouseLeave: function onMouseLeave() {
|
|
830
872
|
return setShowMore(false);
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
873
|
+
},
|
|
874
|
+
children: [showMore ? /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
875
|
+
viewBox: "0 0 24 24",
|
|
876
|
+
stroke: "currentColor",
|
|
877
|
+
strokeWidth: "1.5",
|
|
878
|
+
strokeLinecap: "round",
|
|
879
|
+
strokeLinejoin: "round",
|
|
880
|
+
fill: "none",
|
|
881
|
+
shapeRendering: "geometricPrecision",
|
|
882
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]) + " " + "more",
|
|
883
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
884
|
+
d: "M13 17l5-5-5-5",
|
|
885
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
886
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
887
|
+
d: "M6 17l5-5-5-5",
|
|
888
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
889
|
+
})]
|
|
890
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
891
|
+
viewBox: "0 0 24 24",
|
|
892
|
+
strokeWidth: "1.5",
|
|
893
|
+
strokeLinecap: "round",
|
|
894
|
+
strokeLinejoin: "round",
|
|
895
|
+
fill: "none",
|
|
896
|
+
shapeRendering: "geometricPrecision",
|
|
897
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]),
|
|
898
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
899
|
+
cx: "12",
|
|
900
|
+
cy: "12",
|
|
901
|
+
r: "1",
|
|
902
|
+
fill: "currentColor",
|
|
903
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
904
|
+
}), /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
905
|
+
cx: "19",
|
|
906
|
+
cy: "12",
|
|
907
|
+
r: "1",
|
|
908
|
+
fill: "currentColor",
|
|
909
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
910
|
+
}), /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
911
|
+
cx: "5",
|
|
912
|
+
cy: "12",
|
|
913
|
+
r: "1",
|
|
914
|
+
fill: "currentColor",
|
|
915
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
916
|
+
})]
|
|
917
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
918
|
+
id: "2928474255",
|
|
919
|
+
dynamic: [isBefore ? '180deg' : '0deg'],
|
|
920
|
+
children: "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")
|
|
921
|
+
})]
|
|
922
|
+
});
|
|
877
923
|
};
|
|
878
924
|
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
879
925
|
|
|
@@ -898,13 +944,13 @@ var PaginationPages = function PaginationPages(_ref) {
|
|
|
898
944
|
return _toConsumableArray(new Array(showPages));
|
|
899
945
|
}, [showPages]);
|
|
900
946
|
var renderItem = React.useCallback(function (value, active) {
|
|
901
|
-
return /*#__PURE__*/
|
|
902
|
-
key: "pagination-item-".concat(value),
|
|
947
|
+
return /*#__PURE__*/jsxRuntime.jsx(PaginationItem, {
|
|
903
948
|
active: value === active,
|
|
904
949
|
onClick: function onClick() {
|
|
905
950
|
return setPage(value);
|
|
906
|
-
}
|
|
907
|
-
|
|
951
|
+
},
|
|
952
|
+
children: value
|
|
953
|
+
}, "pagination-item-".concat(value));
|
|
908
954
|
}, []);
|
|
909
955
|
var startPages = pagesArray.map(function (_, index) {
|
|
910
956
|
var value = index + 2;
|
|
@@ -913,13 +959,13 @@ var PaginationPages = function PaginationPages(_ref) {
|
|
|
913
959
|
var middlePages = pagesArray.map(function (_, index) {
|
|
914
960
|
var middleIndexNumber = middleNumber - (index + 1);
|
|
915
961
|
var value = current - middleIndexNumber;
|
|
916
|
-
return /*#__PURE__*/
|
|
917
|
-
key: "pagination-middle-".concat(index),
|
|
962
|
+
return /*#__PURE__*/jsxRuntime.jsx(PaginationItem, {
|
|
918
963
|
active: index + 1 === middleNumber,
|
|
919
964
|
onClick: function onClick() {
|
|
920
965
|
return setPage(value);
|
|
921
|
-
}
|
|
922
|
-
|
|
966
|
+
},
|
|
967
|
+
children: value
|
|
968
|
+
}, "pagination-middle-".concat(index));
|
|
923
969
|
});
|
|
924
970
|
var endPages = pagesArray.map(function (_, index) {
|
|
925
971
|
var value = count - (showPages - index);
|
|
@@ -927,34 +973,36 @@ var PaginationPages = function PaginationPages(_ref) {
|
|
|
927
973
|
});
|
|
928
974
|
if (count <= limit) {
|
|
929
975
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
930
|
-
return /*#__PURE__*/
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
976
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
977
|
+
children: _toConsumableArray(new Array(count)).map(function (_, index) {
|
|
978
|
+
var value = index + 1;
|
|
979
|
+
return /*#__PURE__*/jsxRuntime.jsx(PaginationItem, {
|
|
980
|
+
active: value === current,
|
|
981
|
+
onClick: function onClick() {
|
|
982
|
+
return setPage(value);
|
|
983
|
+
},
|
|
984
|
+
children: value
|
|
985
|
+
}, "pagination-item-".concat(value));
|
|
986
|
+
})
|
|
987
|
+
});
|
|
940
988
|
/* eslint-enable */
|
|
941
989
|
}
|
|
942
|
-
return /*#__PURE__*/
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
})
|
|
990
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
991
|
+
children: [renderItem(1, current), showBeforeEllipsis && /*#__PURE__*/jsxRuntime.jsx(PaginationEllipsis, {
|
|
992
|
+
isBefore: true,
|
|
993
|
+
onClick: function onClick() {
|
|
994
|
+
return setPage(function (last) {
|
|
995
|
+
return last - 5 >= 1 ? last - 5 : 1;
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
}, "pagination-ellipsis-before"), showBeforeEllipsis && showAfterEllipsis ? middlePages : showBeforeEllipsis ? endPages : startPages, showAfterEllipsis && /*#__PURE__*/jsxRuntime.jsx(PaginationEllipsis, {
|
|
999
|
+
onClick: function onClick() {
|
|
1000
|
+
return setPage(function (last) {
|
|
1001
|
+
return last + 5 <= count ? last + 5 : count;
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
}, "pagination-ellipsis-after"), renderItem(count, current)]
|
|
1005
|
+
});
|
|
958
1006
|
};
|
|
959
1007
|
PaginationPages.displayName = 'PaginationPages';
|
|
960
1008
|
|
|
@@ -1143,11 +1191,13 @@ var withScale = function withScale(Render) {
|
|
|
1143
1191
|
getScaleProps: generateGetScaleProps(props),
|
|
1144
1192
|
getAllScaleProps: generateGetAllScaleProps(props)
|
|
1145
1193
|
};
|
|
1146
|
-
return /*#__PURE__*/
|
|
1147
|
-
value: value
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1194
|
+
return /*#__PURE__*/jsxRuntime.jsx(ScaleContext.Provider, {
|
|
1195
|
+
value: value,
|
|
1196
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Render, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1197
|
+
ref: ref,
|
|
1198
|
+
children: children
|
|
1199
|
+
}))
|
|
1200
|
+
});
|
|
1151
1201
|
});
|
|
1152
1202
|
ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
|
|
1153
1203
|
return ScaleFC;
|
|
@@ -1184,8 +1234,12 @@ var PaginationComponent = function PaginationComponent(_ref) {
|
|
|
1184
1234
|
var hasChildren = function hasChildren(c) {
|
|
1185
1235
|
return React.Children.count(c) > 0;
|
|
1186
1236
|
};
|
|
1187
|
-
var prevDefault = /*#__PURE__*/
|
|
1188
|
-
|
|
1237
|
+
var prevDefault = /*#__PURE__*/jsxRuntime.jsx(PaginationPrevious, {
|
|
1238
|
+
children: "prev"
|
|
1239
|
+
});
|
|
1240
|
+
var nextDefault = /*#__PURE__*/jsxRuntime.jsx(PaginationNext, {
|
|
1241
|
+
children: "next"
|
|
1242
|
+
});
|
|
1189
1243
|
return [hasChildren(prevChildren) ? prevChildren : prevDefault, hasChildren(nextChildren) ? nextChildren : nextDefault];
|
|
1190
1244
|
}, [prevChildren, nextChildren]),
|
|
1191
1245
|
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
@@ -1218,19 +1272,22 @@ var PaginationComponent = function PaginationComponent(_ref) {
|
|
|
1218
1272
|
setPage(customPage);
|
|
1219
1273
|
}
|
|
1220
1274
|
}, [customPage]);
|
|
1221
|
-
return /*#__PURE__*/
|
|
1222
|
-
value: values
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1275
|
+
return /*#__PURE__*/jsxRuntime.jsxs(PaginationContext.Provider, {
|
|
1276
|
+
value: values,
|
|
1277
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("nav", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1278
|
+
className: _JSXStyle.dynamic([["3826701357", [SCALES.font(2), SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || ""),
|
|
1279
|
+
children: [prevItem, /*#__PURE__*/jsxRuntime.jsx(PaginationPages, {
|
|
1280
|
+
count: count,
|
|
1281
|
+
current: page,
|
|
1282
|
+
limit: limit,
|
|
1283
|
+
setPage: setPage
|
|
1284
|
+
}), nextItem]
|
|
1285
|
+
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1286
|
+
id: "3826701357",
|
|
1287
|
+
dynamic: [SCALES.font(2), SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)],
|
|
1288
|
+
children: "nav.__jsx-style-dynamic-selector{font-variant:tabular-nums;font-feature-settings:'tnum';--pagination-size:".concat(SCALES.font(2), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}nav.__jsx-style-dynamic-selector button:last-of-type{margin-right:0;}")
|
|
1289
|
+
})]
|
|
1290
|
+
});
|
|
1234
1291
|
};
|
|
1235
1292
|
PaginationComponent.displayName = 'Pagination';
|
|
1236
1293
|
var Pagination = withScale(PaginationComponent);
|