@unicom-cloud/ui 0.8.96 → 0.8.98
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/Affix.js +1 -1
- package/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Tour.js +63 -0
- package/Trigger.js +1 -1
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +56 -56
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +125 -129
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useId.js +8 -8
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +9 -7
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +53 -55
- package/development/index.js +9 -9
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +684 -675
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +222 -230
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +226 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +96 -99
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +60 -65
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +107 -107
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +58 -58
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +77 -78
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +337 -346
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/config-provider/interface.d.ts +6 -0
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +2 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +77 -73
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +48 -49
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +281 -278
- package/utils/intersectionObserver.js +4 -0
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
package/pagination/PageJumper.js
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useContext as
|
|
1
|
+
import { jsxs as g, jsx as o, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import j from "lodash/isFunction";
|
|
3
|
+
import F from "lodash/isPlainObject";
|
|
4
|
+
import h from "lodash/isUndefined";
|
|
5
|
+
import { useContext as I, useState as J, useRef as R, useEffect as T } from "react";
|
|
6
6
|
import "../config-provider/ConfigProvider.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
n.simple && m(n.current);
|
|
7
|
+
import w from "../input/Input.js";
|
|
8
|
+
import E from "../config-provider/context.js";
|
|
9
|
+
function y(n) {
|
|
10
|
+
const x = n.simple ? n.current : void 0, { locale: u } = I(E), [e, l] = J(x), c = R();
|
|
11
|
+
T(() => {
|
|
12
|
+
n.simple && l(n.current);
|
|
14
13
|
}, [n.simple, n.current]);
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
const { onPageChange: t, totalPages:
|
|
20
|
-
if (
|
|
14
|
+
const N = (t) => {
|
|
15
|
+
const a = parseInt(t, 10);
|
|
16
|
+
l(isNaN(a) ? void 0 : a);
|
|
17
|
+
}, m = () => {
|
|
18
|
+
const { onPageChange: t, totalPages: a, current: p, simple: d } = n;
|
|
19
|
+
if (h(e))
|
|
21
20
|
return;
|
|
22
|
-
if (e ===
|
|
23
|
-
|
|
21
|
+
if (e === p) {
|
|
22
|
+
d || l(void 0);
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
},
|
|
25
|
+
let i = isNaN(Number(e)) ? p : Number(e);
|
|
26
|
+
i < 1 ? i = 1 : i > a && (i = a), l(d ? i : void 0), j(t) && t(i);
|
|
27
|
+
}, P = () => {
|
|
29
28
|
const t = c.current.dom;
|
|
30
29
|
String(e) && t && t.setSelectionRange(0, String(e).length);
|
|
31
|
-
}, { rootPrefixCls:
|
|
30
|
+
}, { rootPrefixCls: C, totalPages: f, simple: s, size: v, disabled: b } = n, r = `${C}-jumper`, $ = {
|
|
32
31
|
showJumper: !0,
|
|
33
|
-
...
|
|
32
|
+
...F(s) ? s : {}
|
|
34
33
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
!
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
return /* @__PURE__ */ g("div", { className: `${r}`, children: [
|
|
35
|
+
!s && /* @__PURE__ */ o("span", { className: `${r}-text-goto`, children: u?.Pagination?.goto }),
|
|
36
|
+
$.showJumper ? /* @__PURE__ */ o(
|
|
37
|
+
w,
|
|
39
38
|
{
|
|
40
39
|
_ignorePropsFromGlobal: !0,
|
|
41
40
|
ref: (t) => c.current = t,
|
|
42
|
-
className: `${
|
|
43
|
-
value:
|
|
44
|
-
size:
|
|
45
|
-
disabled:
|
|
46
|
-
onChange:
|
|
47
|
-
onPressEnter:
|
|
48
|
-
onFocus:
|
|
49
|
-
onBlur:
|
|
41
|
+
className: `${r}-input`,
|
|
42
|
+
value: h(e) ? void 0 : e.toString(),
|
|
43
|
+
size: v,
|
|
44
|
+
disabled: b || !f,
|
|
45
|
+
onChange: N,
|
|
46
|
+
onPressEnter: m,
|
|
47
|
+
onFocus: P,
|
|
48
|
+
onBlur: m
|
|
50
49
|
}
|
|
51
50
|
) : /* @__PURE__ */ o("span", { children: e }),
|
|
52
|
-
!
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */ o("span", { className: `${
|
|
51
|
+
!s && /* @__PURE__ */ o("span", { className: `${r}-text-goto-suffix`, children: u?.Pagination?.page }),
|
|
52
|
+
s && /* @__PURE__ */ g(S, { children: [
|
|
53
|
+
/* @__PURE__ */ o("span", { className: `${r}-separator`, children: "/" }),
|
|
55
54
|
/* @__PURE__ */ o("span", { children: f })
|
|
56
55
|
] })
|
|
57
56
|
] });
|
|
58
57
|
}
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
y as default
|
|
61
60
|
};
|
package/pagination/PageOption.js
CHANGED
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import d, { useRef as C, useContext as O } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return /* @__PURE__ */ n(
|
|
4
|
+
import r from "../select/Select.js";
|
|
5
|
+
import x from "../config-provider/context.js";
|
|
6
|
+
function z(s) {
|
|
7
|
+
const p = () => {
|
|
8
|
+
}, c = r.Option, l = [10, 20, 30, 40, 50], n = C(null), { locale: i } = O(x), {
|
|
9
|
+
onPageSizeChange: f = p,
|
|
10
|
+
rootPrefixCls: g,
|
|
11
|
+
sizeOptions: o = l,
|
|
12
|
+
pageSize: a = 10,
|
|
13
|
+
size: m,
|
|
14
|
+
selectProps: u,
|
|
15
|
+
disabled: P
|
|
16
|
+
} = s;
|
|
17
|
+
return /* @__PURE__ */ t(
|
|
19
18
|
"div",
|
|
20
19
|
{
|
|
21
|
-
ref:
|
|
22
|
-
className: `${
|
|
23
|
-
"aria-label":
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
|
|
20
|
+
ref: n,
|
|
21
|
+
className: `${g}-option`,
|
|
22
|
+
"aria-label": i?.Pagination?.pageSize,
|
|
23
|
+
children: /* @__PURE__ */ t(
|
|
24
|
+
r,
|
|
26
25
|
{
|
|
27
|
-
value:
|
|
28
|
-
onChange: (
|
|
29
|
-
|
|
26
|
+
value: o.indexOf(a) !== -1 ? a : o[0],
|
|
27
|
+
onChange: (e) => {
|
|
28
|
+
f(e);
|
|
30
29
|
},
|
|
31
|
-
size:
|
|
32
|
-
getPopupContainer: () =>
|
|
33
|
-
disabled:
|
|
34
|
-
...
|
|
35
|
-
children:
|
|
36
|
-
var s;
|
|
37
|
-
return /* @__PURE__ */ n(g, { value: o, children: `${o} ${(s = e == null ? void 0 : e.Pagination) == null ? void 0 : s.countPerPage}` }, o);
|
|
38
|
-
})
|
|
30
|
+
size: m,
|
|
31
|
+
getPopupContainer: () => n.current,
|
|
32
|
+
disabled: P,
|
|
33
|
+
...u,
|
|
34
|
+
children: o.map((e) => /* @__PURE__ */ t(c, { value: e, children: `${e} ${i?.Pagination?.countPerPage}` }, e))
|
|
39
35
|
}
|
|
40
36
|
)
|
|
41
37
|
}
|
|
42
38
|
);
|
|
43
39
|
}
|
|
44
|
-
const
|
|
40
|
+
const b = d.memo(z);
|
|
45
41
|
export {
|
|
46
|
-
|
|
42
|
+
b as default
|
|
47
43
|
};
|
package/pagination/Pagination.js
CHANGED
|
@@ -1,247 +1,246 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as E, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import D, { forwardRef as Ne, useContext as we, useEffect as W, createElement as P } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { pickDataAttributes as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
4
|
+
import $e from "../components/common/hooks/useMergeProps.js";
|
|
5
|
+
import q from "../components/common/hooks/useMergeValue.js";
|
|
6
|
+
import ve from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import { pickDataAttributes as be } from "../components/common/utils/pick.js";
|
|
8
|
+
import w, { StepPager as $, JumpPager as R } from "./PageItem.js";
|
|
9
|
+
import G from "./PageJumper.js";
|
|
10
|
+
import Me from "./PageOption.js";
|
|
11
11
|
import { StepType as m } from "./interface.js";
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
return Math.ceil(d /
|
|
12
|
+
import je from "../config-provider/context.js";
|
|
13
|
+
const ke = 1, K = 10;
|
|
14
|
+
function O(g = K, d) {
|
|
15
|
+
return Math.ceil(d / g);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
return Math.min(
|
|
17
|
+
function Je(g, d) {
|
|
18
|
+
const v = Math.floor(d / 2) - 1, b = Math.max(g, 0);
|
|
19
|
+
return Math.min(b, v);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
21
|
+
function H(g) {
|
|
22
|
+
return g && g.length ? g[0] : K;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const Ae = {
|
|
25
25
|
total: 0,
|
|
26
26
|
pageSizeChangeResetCurrent: !0,
|
|
27
27
|
bufferSize: 2
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
var D, $, W;
|
|
29
|
+
function Ee(g, d) {
|
|
31
30
|
const {
|
|
32
|
-
getPrefixCls:
|
|
33
|
-
size:
|
|
34
|
-
locale:
|
|
35
|
-
componentConfig:
|
|
36
|
-
rtl:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
getPrefixCls: F,
|
|
32
|
+
size: v,
|
|
33
|
+
locale: b,
|
|
34
|
+
componentConfig: Q,
|
|
35
|
+
rtl: U
|
|
36
|
+
} = we(je), r = $e(
|
|
37
|
+
g,
|
|
38
|
+
Ae,
|
|
39
|
+
Q?.Pagination
|
|
41
40
|
), {
|
|
42
|
-
total:
|
|
43
|
-
pageSize:
|
|
44
|
-
current:
|
|
45
|
-
showMore:
|
|
46
|
-
sizeOptions:
|
|
47
|
-
pageSizeChangeResetCurrent:
|
|
48
|
-
defaultCurrent:
|
|
49
|
-
defaultPageSize:
|
|
50
|
-
pageOption:
|
|
41
|
+
total: X,
|
|
42
|
+
pageSize: Y,
|
|
43
|
+
current: I,
|
|
44
|
+
showMore: Z,
|
|
45
|
+
sizeOptions: C,
|
|
46
|
+
pageSizeChangeResetCurrent: T,
|
|
47
|
+
defaultCurrent: ee,
|
|
48
|
+
defaultPageSize: te,
|
|
49
|
+
pageOption: ne = {}
|
|
51
50
|
// 潘启宝添加
|
|
52
|
-
} =
|
|
53
|
-
defaultValue:
|
|
54
|
-
value:
|
|
55
|
-
}), [
|
|
56
|
-
|
|
51
|
+
} = r, [e, M] = q(ke, {
|
|
52
|
+
defaultValue: ee,
|
|
53
|
+
value: I
|
|
54
|
+
}), [f, V] = q(
|
|
55
|
+
H(C),
|
|
57
56
|
{
|
|
58
|
-
defaultValue:
|
|
59
|
-
value:
|
|
57
|
+
defaultValue: te,
|
|
58
|
+
value: Y
|
|
60
59
|
}
|
|
61
|
-
), h =
|
|
62
|
-
|
|
60
|
+
), h = X, oe = !!Z;
|
|
61
|
+
I && !r.onChange && console.warn(
|
|
63
62
|
"Warning: you have provide current prop for pagination but without onChange handler , this will cause no-change when you change page. "
|
|
64
63
|
);
|
|
65
|
-
function
|
|
66
|
-
const n =
|
|
64
|
+
function ae(t, l) {
|
|
65
|
+
const n = O(t, l);
|
|
67
66
|
return e > n ? n : e;
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
"pageSize" in
|
|
68
|
+
W(() => {
|
|
69
|
+
if (C && !C.includes(f)) {
|
|
70
|
+
const l = H(C);
|
|
71
|
+
"pageSize" in r || V(l);
|
|
73
72
|
}
|
|
74
|
-
}, [
|
|
75
|
-
const t =
|
|
76
|
-
t !== e && !("current" in
|
|
77
|
-
}, [h, e,
|
|
78
|
-
const
|
|
79
|
-
const { onChange: n } =
|
|
80
|
-
n
|
|
81
|
-
},
|
|
82
|
-
const { onPageSizeChange:
|
|
73
|
+
}, [C]), W(() => {
|
|
74
|
+
const t = ae(f, h);
|
|
75
|
+
t !== e && !("current" in r) && M(t);
|
|
76
|
+
}, [h, e, f]);
|
|
77
|
+
const B = (t = e, l = f) => {
|
|
78
|
+
const { onChange: n } = r;
|
|
79
|
+
n?.(t, l);
|
|
80
|
+
}, re = (t) => {
|
|
81
|
+
const { onPageSizeChange: l } = r, n = O(t, h), a = {
|
|
83
82
|
pageSize: t
|
|
84
83
|
};
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
"current" in
|
|
84
|
+
T ? a.current = 1 : a.current = e > n ? n : e, "pageSize" in r || V(a.pageSize), !("current" in r) && e !== a.current && M(a.current), l?.(t, a.current), B(T ? 1 : a.current, t);
|
|
85
|
+
}, j = (t) => {
|
|
86
|
+
"current" in r || M(t), B(t);
|
|
88
87
|
}, {
|
|
89
|
-
className:
|
|
90
|
-
style:
|
|
91
|
-
pageItemStyle:
|
|
92
|
-
activePageItemStyle:
|
|
93
|
-
showTotal:
|
|
94
|
-
sizeCanChange:
|
|
95
|
-
sizeOptions:
|
|
96
|
-
simple:
|
|
97
|
-
mini:
|
|
98
|
-
showJumper:
|
|
99
|
-
selectProps:
|
|
100
|
-
icons:
|
|
101
|
-
disabled:
|
|
102
|
-
itemRender:
|
|
103
|
-
hideOnSinglePage:
|
|
104
|
-
} =
|
|
105
|
-
|
|
106
|
-
`${
|
|
88
|
+
className: ie,
|
|
89
|
+
style: se,
|
|
90
|
+
pageItemStyle: le,
|
|
91
|
+
activePageItemStyle: ue,
|
|
92
|
+
showTotal: S,
|
|
93
|
+
sizeCanChange: ce,
|
|
94
|
+
sizeOptions: pe,
|
|
95
|
+
simple: x,
|
|
96
|
+
mini: ge,
|
|
97
|
+
showJumper: k,
|
|
98
|
+
selectProps: fe,
|
|
99
|
+
icons: me,
|
|
100
|
+
disabled: z,
|
|
101
|
+
itemRender: he,
|
|
102
|
+
hideOnSinglePage: Pe
|
|
103
|
+
} = r, de = r.size || v, o = F?.("pagination"), y = ge ? "mini" : de, Ce = ve(
|
|
104
|
+
o,
|
|
105
|
+
`${o}-size-${y}`,
|
|
107
106
|
{
|
|
108
|
-
[`${
|
|
109
|
-
[`${
|
|
110
|
-
[`${
|
|
107
|
+
[`${o}-simple`]: x,
|
|
108
|
+
[`${o}-disabled`]: z,
|
|
109
|
+
[`${o}-rtl`]: U
|
|
111
110
|
},
|
|
112
|
-
|
|
111
|
+
ie
|
|
113
112
|
);
|
|
114
|
-
let
|
|
115
|
-
const i = [],
|
|
116
|
-
if (
|
|
113
|
+
let J;
|
|
114
|
+
const i = [], s = O(f, h), p = Je(r.bufferSize, s);
|
|
115
|
+
if (Pe && s <= 1)
|
|
117
116
|
return null;
|
|
118
117
|
const u = {
|
|
119
|
-
onClick:
|
|
120
|
-
rootPrefixCls:
|
|
121
|
-
simple:
|
|
118
|
+
onClick: j,
|
|
119
|
+
rootPrefixCls: o,
|
|
120
|
+
simple: x,
|
|
122
121
|
current: e,
|
|
123
|
-
allPages:
|
|
124
|
-
icons:
|
|
125
|
-
disabled:
|
|
126
|
-
pageItemStyle:
|
|
127
|
-
activePageItemStyle:
|
|
128
|
-
itemRender:
|
|
122
|
+
allPages: s,
|
|
123
|
+
icons: me,
|
|
124
|
+
disabled: z,
|
|
125
|
+
pageItemStyle: le,
|
|
126
|
+
activePageItemStyle: ue,
|
|
127
|
+
itemRender: he
|
|
129
128
|
};
|
|
130
|
-
if (
|
|
131
|
-
const t = `${
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */ c(
|
|
129
|
+
if (x) {
|
|
130
|
+
const t = `${o}-item-simple`;
|
|
131
|
+
J = /* @__PURE__ */ E("ul", { className: `${o}-list`, children: [
|
|
132
|
+
/* @__PURE__ */ c($, { ...u, type: m.previous }, "previous"),
|
|
134
133
|
/* @__PURE__ */ c("li", { className: `${t}-pager`, children: /* @__PURE__ */ c(
|
|
135
|
-
|
|
134
|
+
G,
|
|
136
135
|
{
|
|
137
|
-
disabled:
|
|
138
|
-
rootPrefixCls:
|
|
139
|
-
totalPages:
|
|
136
|
+
disabled: z,
|
|
137
|
+
rootPrefixCls: o,
|
|
138
|
+
totalPages: s,
|
|
140
139
|
current: e,
|
|
141
|
-
onPageChange:
|
|
140
|
+
onPageChange: j,
|
|
142
141
|
simple: {
|
|
143
|
-
showJumper: typeof
|
|
142
|
+
showJumper: typeof k == "boolean" ? k : !0
|
|
144
143
|
},
|
|
145
|
-
size:
|
|
144
|
+
size: y
|
|
146
145
|
}
|
|
147
146
|
) }),
|
|
148
|
-
/* @__PURE__ */ c(
|
|
147
|
+
/* @__PURE__ */ c($, { ...u, type: m.next }, "next")
|
|
149
148
|
] });
|
|
150
149
|
} else {
|
|
151
|
-
const t = 3 + p,
|
|
150
|
+
const t = 3 + p, l = s - 2 - p;
|
|
152
151
|
if (
|
|
153
152
|
// beginPage(1 page) + bufferSize * 2 + endPage(1 page) + ...(2 pages)
|
|
154
|
-
|
|
153
|
+
s <= 4 + p * 2 || e === t && e === l
|
|
155
154
|
)
|
|
156
|
-
for (let n = 1; n <=
|
|
157
|
-
i.push(/* @__PURE__ */ P(
|
|
155
|
+
for (let n = 1; n <= s; n++)
|
|
156
|
+
i.push(/* @__PURE__ */ P(w, { ...u, key: n, pageNum: n }));
|
|
158
157
|
else {
|
|
159
|
-
let n = 1, a =
|
|
160
|
-
e > t && e <
|
|
161
|
-
for (let
|
|
162
|
-
i.push(/* @__PURE__ */ c(
|
|
163
|
-
const
|
|
164
|
-
|
|
158
|
+
let n = 1, a = s, L = !0, _ = !0;
|
|
159
|
+
e > t && e < l ? (a = e + p, n = e - p) : e <= t ? (L = !1, n = 1, a = Math.max(t, p + e)) : e >= l && (_ = !1, a = s, n = Math.min(l, e - p));
|
|
160
|
+
for (let N = n; N <= a; N++)
|
|
161
|
+
i.push(/* @__PURE__ */ c(w, { pageNum: N, ...u }, N));
|
|
162
|
+
const ze = /* @__PURE__ */ P(
|
|
163
|
+
R,
|
|
165
164
|
{
|
|
166
165
|
...u,
|
|
167
166
|
key: n - 1,
|
|
168
167
|
type: m.previous,
|
|
169
168
|
jumpPage: -(p * 2 + 1)
|
|
170
169
|
}
|
|
171
|
-
),
|
|
172
|
-
|
|
170
|
+
), Se = /* @__PURE__ */ P(
|
|
171
|
+
R,
|
|
173
172
|
{
|
|
174
173
|
...u,
|
|
175
174
|
key: a + 1,
|
|
176
175
|
type: m.next,
|
|
177
176
|
jumpPage: p * 2 + 1
|
|
178
177
|
}
|
|
179
|
-
),
|
|
180
|
-
|
|
181
|
-
className: `${
|
|
182
|
-
}), i.unshift(
|
|
178
|
+
), xe = /* @__PURE__ */ c(w, { pageNum: 1, ...u }, 1), ye = /* @__PURE__ */ P(w, { ...u, key: s, pageNum: s });
|
|
179
|
+
L && (i[0] = D.cloneElement(i[0], {
|
|
180
|
+
className: `${o}-item-after-pre`
|
|
181
|
+
}), i.unshift(ze), i.unshift(xe)), _ && (i[i.length - 1] = D.cloneElement(
|
|
183
182
|
i[i.length - 1],
|
|
184
183
|
{
|
|
185
|
-
className: `${
|
|
184
|
+
className: `${o}-item-before-next`
|
|
186
185
|
}
|
|
187
|
-
), i.push(
|
|
186
|
+
), i.push(Se), i.push(ye));
|
|
188
187
|
}
|
|
189
|
-
|
|
190
|
-
/* @__PURE__ */ P(
|
|
188
|
+
J = /* @__PURE__ */ E("ul", { className: `${o}-list`, children: [
|
|
189
|
+
/* @__PURE__ */ P($, { ...u, key: "previous", type: m.previous }),
|
|
191
190
|
i,
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
oe && /* @__PURE__ */ P(
|
|
192
|
+
R,
|
|
194
193
|
{
|
|
195
194
|
...u,
|
|
196
|
-
key:
|
|
195
|
+
key: s + 1,
|
|
197
196
|
type: m.next,
|
|
198
197
|
jumpPage: p * 2 + 1
|
|
199
198
|
}
|
|
200
199
|
),
|
|
201
|
-
/* @__PURE__ */ c(
|
|
200
|
+
/* @__PURE__ */ c($, { ...u, type: m.next }, "next")
|
|
202
201
|
] });
|
|
203
202
|
}
|
|
204
|
-
let
|
|
205
|
-
return typeof
|
|
203
|
+
let A = null;
|
|
204
|
+
return typeof S == "boolean" && S && (A = /* @__PURE__ */ c("div", { className: `${o}-total-text`, children: b?.Pagination?.total?.replace?.("{0}", h) })), typeof S == "function" && (A = /* @__PURE__ */ c("div", { className: `${o}-total-text`, children: S(h, [(e - 1) * f + 1, e * f]) })), /* @__PURE__ */ E(
|
|
206
205
|
"div",
|
|
207
206
|
{
|
|
208
|
-
...
|
|
209
|
-
className:
|
|
210
|
-
style:
|
|
207
|
+
...be(r),
|
|
208
|
+
className: Ce,
|
|
209
|
+
style: se,
|
|
211
210
|
ref: d,
|
|
212
211
|
children: [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
!!
|
|
216
|
-
|
|
212
|
+
A,
|
|
213
|
+
J,
|
|
214
|
+
!!ne && /* @__PURE__ */ c(
|
|
215
|
+
Me,
|
|
217
216
|
{
|
|
218
|
-
disabled:
|
|
219
|
-
rootPrefixCls:
|
|
220
|
-
sizeCanChange:
|
|
221
|
-
sizeOptions:
|
|
222
|
-
onPageSizeChange:
|
|
223
|
-
pageSize:
|
|
224
|
-
size:
|
|
225
|
-
selectProps:
|
|
217
|
+
disabled: z,
|
|
218
|
+
rootPrefixCls: o,
|
|
219
|
+
sizeCanChange: ce,
|
|
220
|
+
sizeOptions: pe,
|
|
221
|
+
onPageSizeChange: re,
|
|
222
|
+
pageSize: f,
|
|
223
|
+
size: y,
|
|
224
|
+
selectProps: fe
|
|
226
225
|
}
|
|
227
226
|
),
|
|
228
|
-
!
|
|
229
|
-
|
|
227
|
+
!x && k && /* @__PURE__ */ c(
|
|
228
|
+
G,
|
|
230
229
|
{
|
|
231
|
-
disabled:
|
|
232
|
-
rootPrefixCls:
|
|
233
|
-
totalPages:
|
|
230
|
+
disabled: z,
|
|
231
|
+
rootPrefixCls: o,
|
|
232
|
+
totalPages: s,
|
|
234
233
|
current: e,
|
|
235
|
-
onPageChange:
|
|
236
|
-
size:
|
|
234
|
+
onPageChange: j,
|
|
235
|
+
size: y
|
|
237
236
|
}
|
|
238
237
|
)
|
|
239
238
|
]
|
|
240
239
|
}
|
|
241
240
|
);
|
|
242
241
|
}
|
|
243
|
-
const
|
|
244
|
-
|
|
242
|
+
const Re = Ne(Ee);
|
|
243
|
+
Re.displayName = "Pagination";
|
|
245
244
|
export {
|
|
246
|
-
|
|
245
|
+
Re as default
|
|
247
246
|
};
|