@unicom-cloud/ui 0.8.95 → 0.8.97
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/Message.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Switch.js +1 -1
- package/Tour.js +63 -0
- package/Trigger.js +2 -2
- 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 +52 -51
- 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 +126 -130
- 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/useForceUpdate.js +6 -2
- package/components/common/hooks/useId.js +4 -4
- 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 +11 -10
- package/components/common/utils/PqbCSSTransition.js +1 -1
- 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 +55 -56
- package/development/index.js +9 -9
- package/dist/react-transition-group/src/CSSTransition.js +1 -1
- package/dist/react-transition-group/src/SwitchTransition.js +1 -1
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/tween/src/tween.js +24 -25
- 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/index.js +50 -52
- 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 +682 -679
- 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 +223 -231
- 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 +189 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/liquid-fill/interface.js +1 -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 +97 -100
- 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 +61 -66
- 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 +108 -108
- package/slider/util.js +1 -1
- 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 +61 -61
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +78 -79
- 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/time-picker/util.js +4 -4
- 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 +338 -347
- 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/math.d.ts +1 -1
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/alert/interface.d.ts +2 -2
- package/types/pc/details/interface.d.ts +2 -2
- package/types/pc/hooks/index.d.ts +0 -1
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +4 -0
- package/types/pc/liquid-fill/interface.d.ts +0 -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/math.d.ts +1 -1
- 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 +78 -75
- 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 +49 -50
- 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 +274 -275
- package/utils/intersectionObserver.js +4 -0
- package/utils/math.js +7 -11
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/reactTransitionGroup.js +1 -1
- 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/hooks/useComputedState.js +0 -11
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/hooks/useComputedState.js +0 -4
- package/types/common/hooks/useComputedState.d.ts +0 -4
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/hooks/useComputedState.d.ts +0 -1
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
- /package/dist/react-transition-group/chunk/{C6QwjD4L.js → CPfP7aNL.js} +0 -0
package/table/thead/Column.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
import { jsxs as u, Fragment as Fe, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as ve, useState as Q, useEffect as W, createElement as Se } from "react";
|
|
3
|
+
import be from "@unicom-cloud/icons/IconUiCaretDown";
|
|
4
|
+
import ye from "@unicom-cloud/icons/IconUiCaretUp";
|
|
5
|
+
import Te from "@unicom-cloud/icons/IconUiFilter";
|
|
6
|
+
import X from "lodash/isArray";
|
|
7
|
+
import Ie from "lodash/isFunction";
|
|
8
|
+
import P from "lodash/isPlainObject";
|
|
9
|
+
import ke from "lodash/isString";
|
|
10
|
+
import Y from "../../button/index.js";
|
|
11
|
+
import De from "../../checkbox/Checkbox.js";
|
|
12
12
|
import "../../checkbox/Group.js";
|
|
13
13
|
import "../../config-provider/ConfigProvider.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import we from "../../components/common/hooks/useMergeValue.js";
|
|
15
|
+
import Pe from "../../radio/Radio.js";
|
|
16
16
|
import Ae from "../../space/index.js";
|
|
17
17
|
import Ee from "../hook/useComponent.js";
|
|
18
18
|
import Oe from "../../tooltip/index.js";
|
|
19
19
|
import Me from "../../trigger/index.js";
|
|
20
|
-
import
|
|
20
|
+
import h from "@unicom-cloud/utils/class-name";
|
|
21
21
|
import Re from "../../config-provider/context.js";
|
|
22
|
-
function Ue(
|
|
23
|
-
return
|
|
22
|
+
function Ue(g, m) {
|
|
23
|
+
return g === "ascend" ? m?.Table.sortAscend : g === "descend" ? m?.Table.sortDescend : m?.Table.cancelSort;
|
|
24
24
|
}
|
|
25
25
|
const je = { bottom: 0 };
|
|
26
|
-
function
|
|
26
|
+
function lt(g) {
|
|
27
27
|
const {
|
|
28
|
-
onSort:
|
|
29
|
-
onFilter:
|
|
30
|
-
onHandleFilter:
|
|
31
|
-
onHandleFilterReset:
|
|
32
|
-
currentFilters:
|
|
28
|
+
onSort: m,
|
|
29
|
+
onFilter: A,
|
|
30
|
+
onHandleFilter: E,
|
|
31
|
+
onHandleFilterReset: Z,
|
|
32
|
+
currentFilters: S = {},
|
|
33
33
|
currentSorter: o,
|
|
34
|
-
_key:
|
|
35
|
-
dataIndex:
|
|
36
|
-
title:
|
|
37
|
-
sorter:
|
|
38
|
-
sortDirections:
|
|
39
|
-
filters:
|
|
40
|
-
columnFixedStyle:
|
|
41
|
-
className:
|
|
42
|
-
headerClassName:
|
|
43
|
-
cellStyle:
|
|
44
|
-
headerCellStyle:
|
|
45
|
-
rowSpan:
|
|
46
|
-
colSpan:
|
|
47
|
-
headerCellProps:
|
|
34
|
+
_key: O,
|
|
35
|
+
dataIndex: _,
|
|
36
|
+
title: C,
|
|
37
|
+
sorter: ee,
|
|
38
|
+
sortDirections: l = ["ascend", "descend"],
|
|
39
|
+
filters: f = [],
|
|
40
|
+
columnFixedStyle: te,
|
|
41
|
+
className: ne,
|
|
42
|
+
headerClassName: re,
|
|
43
|
+
cellStyle: M,
|
|
44
|
+
headerCellStyle: x,
|
|
45
|
+
rowSpan: b,
|
|
46
|
+
colSpan: $,
|
|
47
|
+
headerCellProps: ie,
|
|
48
48
|
prefixCls: t,
|
|
49
|
-
align:
|
|
50
|
-
component:
|
|
49
|
+
align: y = "left",
|
|
50
|
+
component: oe,
|
|
51
51
|
filterIcon: le,
|
|
52
|
-
filterDropdown:
|
|
53
|
-
filterMultiple:
|
|
54
|
-
ellipsis:
|
|
55
|
-
filterDropdownProps:
|
|
56
|
-
onFilterDropdownVisibleChange:
|
|
52
|
+
filterDropdown: T,
|
|
53
|
+
filterMultiple: R = !0,
|
|
54
|
+
ellipsis: U,
|
|
55
|
+
filterDropdownProps: j,
|
|
56
|
+
onFilterDropdownVisibleChange: se,
|
|
57
57
|
column: ce,
|
|
58
|
-
showSorterTooltip:
|
|
59
|
-
index:
|
|
60
|
-
} =
|
|
61
|
-
value:
|
|
62
|
-
}), [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
function
|
|
58
|
+
showSorterTooltip: I,
|
|
59
|
+
index: H
|
|
60
|
+
} = g, { locale: k, rtl: ae } = ve(Re), i = O || _ || H, [d, p, a] = we([], {
|
|
61
|
+
value: S[i] || []
|
|
62
|
+
}), [D, z] = Q(!1), [B, K] = Q(!1), N = ee && X(l) && l.length, F = N ? de() : void 0;
|
|
63
|
+
W(() => {
|
|
64
|
+
p(S[i] || []);
|
|
65
|
+
}, [S, i]), W(() => {
|
|
66
|
+
d && d !== a && p(d);
|
|
67
|
+
}, [D]);
|
|
68
|
+
function de() {
|
|
69
69
|
const e = o && o.direction;
|
|
70
|
-
if (!e || o && o.field !==
|
|
71
|
-
return
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
70
|
+
if (!e || o && o.field !== i)
|
|
71
|
+
return l[0];
|
|
72
|
+
const s = l.indexOf(e);
|
|
73
|
+
if (s < l.length)
|
|
74
|
+
return l[s + 1];
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
{ onFilter:
|
|
76
|
+
function me() {
|
|
77
|
+
d && (E?.(
|
|
78
|
+
{ onFilter: A, filters: f, dataIndex: i },
|
|
79
79
|
a
|
|
80
|
-
),
|
|
80
|
+
), w(!1));
|
|
81
81
|
}
|
|
82
82
|
function fe() {
|
|
83
|
-
|
|
83
|
+
Z({ dataIndex: i }), w(!1);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
85
|
+
function w(e) {
|
|
86
|
+
z(e), se?.(e);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function L(e, s) {
|
|
89
89
|
let r = [...a];
|
|
90
|
-
if (
|
|
91
|
-
|
|
90
|
+
if (R)
|
|
91
|
+
s ? r = r.concat(e) : r.splice(
|
|
92
92
|
r.findIndex((Ne) => Ne === e),
|
|
93
93
|
1
|
|
94
94
|
);
|
|
@@ -99,99 +99,99 @@ function st(x) {
|
|
|
99
99
|
return;
|
|
100
100
|
else
|
|
101
101
|
r = [e];
|
|
102
|
-
|
|
102
|
+
p(r);
|
|
103
103
|
}
|
|
104
104
|
function pe(e) {
|
|
105
|
-
|
|
106
|
-
{ filters:
|
|
105
|
+
p(e || a), z(!1), E?.(
|
|
106
|
+
{ filters: f, onFilter: A, dataIndex: i },
|
|
107
107
|
e || a
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
function ue() {
|
|
111
|
-
return typeof
|
|
111
|
+
return typeof T == "function" ? T({
|
|
112
112
|
filterKeys: a,
|
|
113
|
-
setFilterKeys: (e,
|
|
114
|
-
|
|
113
|
+
setFilterKeys: (e, s) => {
|
|
114
|
+
p(e), s?.();
|
|
115
115
|
},
|
|
116
116
|
confirm: pe
|
|
117
|
-
}) : /* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */ n("div", { className: `${t}-filters-list`, children:
|
|
119
|
-
const
|
|
120
|
-
return /* @__PURE__ */ n("div", { className: `${t}-filters-item`, children:
|
|
121
|
-
|
|
117
|
+
}) : /* @__PURE__ */ u("div", { className: `${t}-filters-popup`, children: [
|
|
118
|
+
/* @__PURE__ */ n("div", { className: `${t}-filters-list`, children: f.map((e) => {
|
|
119
|
+
const s = a.findIndex((r) => r === e.value) !== -1;
|
|
120
|
+
return /* @__PURE__ */ n("div", { className: `${t}-filters-item`, children: R ? /* @__PURE__ */ n(
|
|
121
|
+
De,
|
|
122
122
|
{
|
|
123
|
-
checked:
|
|
124
|
-
onChange: (r) =>
|
|
123
|
+
checked: s,
|
|
124
|
+
onChange: (r) => L(e.value, r),
|
|
125
125
|
children: e.text
|
|
126
126
|
}
|
|
127
127
|
) : /* @__PURE__ */ n(
|
|
128
|
-
|
|
128
|
+
Pe,
|
|
129
129
|
{
|
|
130
|
-
checked:
|
|
131
|
-
onChange: (r) =>
|
|
130
|
+
checked: s,
|
|
131
|
+
onChange: (r) => L(e.value, r),
|
|
132
132
|
children: e.text
|
|
133
133
|
}
|
|
134
134
|
) }, e.value);
|
|
135
135
|
}) }),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */ n(
|
|
138
|
-
/* @__PURE__ */ n(
|
|
136
|
+
/* @__PURE__ */ u(Ae, { className: `${t}-filters-btn`, children: [
|
|
137
|
+
/* @__PURE__ */ n(Y, { onClick: fe, size: "mini", children: k?.Table.resetText }),
|
|
138
|
+
/* @__PURE__ */ n(Y, { onClick: me, type: "primary", size: "mini", children: k?.Table.okText })
|
|
139
139
|
] })
|
|
140
140
|
] });
|
|
141
141
|
}
|
|
142
|
-
const
|
|
143
|
-
[`${t}-sorter-icon-active`]: o && o.direction === e && o.field ===
|
|
144
|
-
}), he =
|
|
145
|
-
[`${t}-filters-open`]:
|
|
146
|
-
[`${t}-filters-active`]:
|
|
142
|
+
const V = (e) => h(`${t}-sorter-icon`, {
|
|
143
|
+
[`${t}-sorter-icon-active`]: o && o.direction === e && o.field === i
|
|
144
|
+
}), he = h(`${t}-filters`, {
|
|
145
|
+
[`${t}-filters-open`]: D,
|
|
146
|
+
[`${t}-filters-active`]: d && d.length
|
|
147
147
|
});
|
|
148
|
-
let
|
|
149
|
-
...
|
|
148
|
+
let c = {
|
|
149
|
+
...te
|
|
150
150
|
};
|
|
151
|
-
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
}),
|
|
155
|
-
...
|
|
156
|
-
...
|
|
157
|
-
}),
|
|
158
|
-
...
|
|
159
|
-
...
|
|
160
|
-
}),
|
|
161
|
-
const
|
|
162
|
-
style:
|
|
163
|
-
key:
|
|
151
|
+
P(M) && (c = {
|
|
152
|
+
...c,
|
|
153
|
+
...M
|
|
154
|
+
}), P(x) && (c = {
|
|
155
|
+
...c,
|
|
156
|
+
...x
|
|
157
|
+
}), Ie(x) && (c = {
|
|
158
|
+
...c,
|
|
159
|
+
...x()
|
|
160
|
+
}), y && y !== "left" && (c.textAlign = y);
|
|
161
|
+
const v = {
|
|
162
|
+
style: c,
|
|
163
|
+
key: O || i
|
|
164
164
|
};
|
|
165
|
-
|
|
166
|
-
const { ComponentTh: ge, ComponentHeaderCell:
|
|
167
|
-
|
|
165
|
+
$ && $ > 1 && (v.colSpan = $), b && b > 1 && (v.rowSpan = b);
|
|
166
|
+
const { ComponentTh: ge, ComponentHeaderCell: q } = Ee(oe), G = X(f) && f.length > 0 || typeof T == "function", J = U && typeof C == "string" ? { title: C } : {}, Ce = j && j.triggerProps, xe = /* @__PURE__ */ u(Fe, { children: [
|
|
167
|
+
N ? /* @__PURE__ */ n(
|
|
168
168
|
Oe,
|
|
169
169
|
{
|
|
170
|
-
content: Ue(
|
|
171
|
-
disabled: !
|
|
172
|
-
...
|
|
173
|
-
children: /* @__PURE__ */
|
|
170
|
+
content: Ue(F, k),
|
|
171
|
+
disabled: !I,
|
|
172
|
+
...P(I) ? I : {},
|
|
173
|
+
children: /* @__PURE__ */ u(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: `${t}-cell-with-sorter`,
|
|
177
177
|
onMouseEnter: () => {
|
|
178
|
-
|
|
178
|
+
K(!0);
|
|
179
179
|
},
|
|
180
180
|
onMouseLeave: () => {
|
|
181
|
-
|
|
181
|
+
K(!1);
|
|
182
182
|
},
|
|
183
|
-
onClick: () =>
|
|
183
|
+
onClick: () => m(F, i),
|
|
184
184
|
children: [
|
|
185
|
-
/* @__PURE__ */ n("span", { className: `${t}-th-item-title`, ...
|
|
186
|
-
|
|
185
|
+
/* @__PURE__ */ n("span", { className: `${t}-th-item-title`, ...J, children: C }),
|
|
186
|
+
N && /* @__PURE__ */ u(
|
|
187
187
|
"div",
|
|
188
188
|
{
|
|
189
|
-
className:
|
|
190
|
-
[`${t}-sorter-direction-one`]:
|
|
189
|
+
className: h(`${t}-sorter`, {
|
|
190
|
+
[`${t}-sorter-direction-one`]: l.length === 1
|
|
191
191
|
}),
|
|
192
192
|
children: [
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
l.indexOf("ascend") !== -1 && /* @__PURE__ */ n("div", { className: V("ascend"), children: /* @__PURE__ */ n(ye, {}) }),
|
|
194
|
+
l.indexOf("descend") !== -1 && /* @__PURE__ */ n("div", { className: V("descend"), children: /* @__PURE__ */ n(be, {}) })
|
|
195
195
|
]
|
|
196
196
|
}
|
|
197
197
|
)
|
|
@@ -199,54 +199,54 @@ function st(x) {
|
|
|
199
199
|
}
|
|
200
200
|
)
|
|
201
201
|
}
|
|
202
|
-
) : /* @__PURE__ */ n("span", { className: `${t}-th-item-title`, ...
|
|
203
|
-
|
|
202
|
+
) : /* @__PURE__ */ n("span", { className: `${t}-th-item-title`, ...J, children: C }),
|
|
203
|
+
G && /* @__PURE__ */ n(
|
|
204
204
|
Me,
|
|
205
205
|
{
|
|
206
206
|
popup: ue,
|
|
207
207
|
trigger: "click",
|
|
208
208
|
classNames: "slideDynamicOrigin",
|
|
209
|
-
position:
|
|
209
|
+
position: ae ? "bl" : "br",
|
|
210
210
|
popupAlign: je,
|
|
211
|
-
popupVisible:
|
|
212
|
-
onVisibleChange:
|
|
211
|
+
popupVisible: D,
|
|
212
|
+
onVisibleChange: w,
|
|
213
213
|
...Ce,
|
|
214
|
-
children: /* @__PURE__ */ n("div", { className: he, children: le || /* @__PURE__ */ n(
|
|
214
|
+
children: /* @__PURE__ */ n("div", { className: he, children: le || /* @__PURE__ */ n(Te, {}) })
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
|
-
] }), $e =
|
|
218
|
-
[`${t}-cell-text-ellipsis`]:
|
|
219
|
-
[`${t}-cell-mouseenter`]:
|
|
220
|
-
[`${t}-cell-next-${
|
|
221
|
-
[`${t}-col-has-sorter`]:
|
|
222
|
-
[`${t}-col-has-filter`]:
|
|
217
|
+
] }), $e = h(`${t}-th-item`, {
|
|
218
|
+
[`${t}-cell-text-ellipsis`]: U,
|
|
219
|
+
[`${t}-cell-mouseenter`]: B,
|
|
220
|
+
[`${t}-cell-next-${F}`]: B && F,
|
|
221
|
+
[`${t}-col-has-sorter`]: N,
|
|
222
|
+
[`${t}-col-has-filter`]: G
|
|
223
223
|
});
|
|
224
|
-
return
|
|
224
|
+
return $ !== 0 && /* @__PURE__ */ Se(
|
|
225
225
|
ge,
|
|
226
226
|
{
|
|
227
|
-
className:
|
|
227
|
+
className: h(
|
|
228
228
|
`${t}-th`,
|
|
229
229
|
{
|
|
230
|
-
[`${t}-col-sorted`]:
|
|
230
|
+
[`${t}-col-sorted`]: o?.direction && o.field === i
|
|
231
231
|
},
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
ne,
|
|
233
|
+
re
|
|
234
234
|
),
|
|
235
|
-
index:
|
|
236
|
-
...
|
|
237
|
-
key:
|
|
238
|
-
...
|
|
235
|
+
index: H,
|
|
236
|
+
...v,
|
|
237
|
+
key: v.key,
|
|
238
|
+
...ie
|
|
239
239
|
},
|
|
240
240
|
/* @__PURE__ */ n(
|
|
241
|
-
|
|
241
|
+
q,
|
|
242
242
|
{
|
|
243
243
|
className: $e,
|
|
244
|
-
column:
|
|
244
|
+
column: ke(q) ? void 0 : ce,
|
|
245
245
|
children: xe
|
|
246
246
|
}
|
|
247
247
|
)
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
250
|
export {
|
|
251
|
-
|
|
251
|
+
lt as default
|
|
252
252
|
};
|
package/table/thead/index.js
CHANGED
|
@@ -1,124 +1,123 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as d, jsxs as V } from "react/jsx-runtime";
|
|
2
|
+
import Z, { useContext as ee, useMemo as te, createElement as _ } from "react";
|
|
3
|
+
import oe from "../../checkbox/Checkbox.js";
|
|
4
4
|
import "../../checkbox/Group.js";
|
|
5
5
|
import "../../config-provider/ConfigProvider.js";
|
|
6
|
-
import { INTERNAL_SELECTION_KEY as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
function
|
|
6
|
+
import { INTERNAL_SELECTION_KEY as se, INTERNAL_EXPAND_KEY as ne } from "../constant.js";
|
|
7
|
+
import re from "../hook/useComponent.js";
|
|
8
|
+
import c from "@unicom-cloud/utils/class-name";
|
|
9
|
+
import ie from "./Column.js";
|
|
10
|
+
import ae from "../../config-provider/context.js";
|
|
11
|
+
function ke(R) {
|
|
12
12
|
const {
|
|
13
|
-
activeSorters:
|
|
14
|
-
expandedRowRender:
|
|
15
|
-
expandProps:
|
|
16
|
-
onSort:
|
|
17
|
-
onHandleFilter:
|
|
18
|
-
onHandleFilterReset:
|
|
19
|
-
onHeaderRow:
|
|
20
|
-
prefixCls:
|
|
21
|
-
currentFilters:
|
|
22
|
-
component:
|
|
23
|
-
data:
|
|
24
|
-
selectedRowKeys:
|
|
13
|
+
activeSorters: b,
|
|
14
|
+
expandedRowRender: K,
|
|
15
|
+
expandProps: P = {},
|
|
16
|
+
onSort: F,
|
|
17
|
+
onHandleFilter: v,
|
|
18
|
+
onHandleFilterReset: I,
|
|
19
|
+
onHeaderRow: L,
|
|
20
|
+
prefixCls: o,
|
|
21
|
+
currentFilters: j,
|
|
22
|
+
component: S,
|
|
23
|
+
data: $,
|
|
24
|
+
selectedRowKeys: E,
|
|
25
25
|
rowSelection: t,
|
|
26
|
-
allSelectedRowKeys:
|
|
27
|
-
groupColumns:
|
|
28
|
-
stickyOffsets:
|
|
29
|
-
groupStickyClassNames:
|
|
30
|
-
showSorterTooltip:
|
|
31
|
-
} = R, { rtl:
|
|
32
|
-
const
|
|
33
|
-
return
|
|
34
|
-
}, [
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
const
|
|
26
|
+
allSelectedRowKeys: r = [],
|
|
27
|
+
groupColumns: m,
|
|
28
|
+
stickyOffsets: N,
|
|
29
|
+
groupStickyClassNames: Y,
|
|
30
|
+
showSorterTooltip: D
|
|
31
|
+
} = R, { rtl: y } = ee(ae), { ComponentThead: M, ComponentHeaderRow: W, getHeaderComponentOperations: X } = re(S), q = t && (t.type === "checkbox" || !("type" in t)), z = t && "checkAll" in t ? t.checkAll : !0, C = t && t.type === "radio", { columnTitle: A } = P, p = te(() => {
|
|
32
|
+
const h = new Set(r);
|
|
33
|
+
return E.filter((s, T, u) => h.has(s));
|
|
34
|
+
}, [E, r]), B = m.length > 1 ? { rowSpan: m.length } : {}, k = c(`${o}-th`, `${o}-operation`);
|
|
35
|
+
return /* @__PURE__ */ d(M, { children: m.map((h, s) => {
|
|
36
|
+
const T = L?.(h, s), u = (q || C) && s === 0 && /* @__PURE__ */ d(
|
|
37
37
|
"th",
|
|
38
38
|
{
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
`${
|
|
39
|
+
className: c(
|
|
40
|
+
k,
|
|
41
|
+
`${o}-${C ? "radio" : "checkbox"}`
|
|
42
42
|
),
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
children: /* @__PURE__ */ V("div", { className: `${o}-th-item`, children: [
|
|
44
|
+
z && !C ? /* @__PURE__ */ d(
|
|
45
|
+
oe,
|
|
46
46
|
{
|
|
47
|
-
indeterminate:
|
|
48
|
-
checked:
|
|
49
|
-
disabled: !
|
|
47
|
+
indeterminate: $ && p.length > 0 && p.length !== r.length,
|
|
48
|
+
checked: $ && p.length !== 0 && p.length === r.length,
|
|
49
|
+
disabled: !r.length,
|
|
50
50
|
onChange: R.onCheckAll
|
|
51
51
|
}
|
|
52
52
|
) : null,
|
|
53
53
|
t && t.columnTitle
|
|
54
54
|
] })
|
|
55
55
|
}
|
|
56
|
-
),
|
|
57
|
-
selectionNode:
|
|
58
|
-
expandNode:
|
|
56
|
+
), G = K && /* @__PURE__ */ d("th", { className: c(k, `${o}-expand`), children: A && /* @__PURE__ */ d("div", { className: `${o}-th-item`, children: A }) }), J = Y[s], H = X({
|
|
57
|
+
selectionNode: u,
|
|
58
|
+
expandNode: G
|
|
59
59
|
});
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
|
|
60
|
+
return /* @__PURE__ */ _(
|
|
61
|
+
W,
|
|
62
62
|
{
|
|
63
|
-
...
|
|
64
|
-
key:
|
|
65
|
-
className: `${
|
|
63
|
+
...T,
|
|
64
|
+
key: s,
|
|
65
|
+
className: `${o}-tr`
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const H = ee[a];
|
|
67
|
+
h.map((e, i) => {
|
|
68
|
+
const n = e.$$columnIndex;
|
|
69
|
+
let a = 0;
|
|
70
|
+
Array.isArray(n) && n.length === 2 ? a = e.fixed === "right" ? N[n[1]] : N[n[0]] : typeof n == "number" && (a = N[n] || 0);
|
|
71
|
+
const O = J[i];
|
|
73
72
|
if (e.$$isOperation) {
|
|
74
|
-
let
|
|
75
|
-
e.title ===
|
|
73
|
+
let l = e.node, x = !0;
|
|
74
|
+
e.title === se && (l = H.find(
|
|
76
75
|
(w) => w.name === "selectionNode"
|
|
77
|
-
)
|
|
76
|
+
)?.node, x = !1), e.title === ne && (l = H.find(
|
|
78
77
|
(w) => w.name === "expandNode"
|
|
79
|
-
)
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
key: e.key ||
|
|
83
|
-
...
|
|
84
|
-
...
|
|
85
|
-
className:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
)?.node, x = !1);
|
|
79
|
+
const f = l;
|
|
80
|
+
return Z.cloneElement(f, {
|
|
81
|
+
key: e.key || i,
|
|
82
|
+
...f.props,
|
|
83
|
+
...B,
|
|
84
|
+
className: c(
|
|
85
|
+
x ? k : "",
|
|
86
|
+
f?.props?.className,
|
|
87
|
+
O
|
|
89
88
|
),
|
|
90
89
|
style: {
|
|
91
|
-
...
|
|
90
|
+
...f?.props?.style,
|
|
92
91
|
...e.fixed === "left" ? {
|
|
93
|
-
[
|
|
92
|
+
[y ? "right" : "left"]: a
|
|
94
93
|
} : {},
|
|
95
94
|
width: e.width,
|
|
96
95
|
minWidth: e.width
|
|
97
96
|
}
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
|
-
const
|
|
101
|
-
return e.fixed === "left" && (
|
|
102
|
-
|
|
99
|
+
const Q = e?.onHeaderCell?.(e, i), U = c(O, e.className), g = {};
|
|
100
|
+
return e.fixed === "left" && (g[y ? "right" : "left"] = a), e.fixed === "right" && (g[y ? "left" : "right"] = a), /* @__PURE__ */ _(
|
|
101
|
+
ie,
|
|
103
102
|
{
|
|
104
|
-
index:
|
|
105
|
-
onSort:
|
|
106
|
-
onHandleFilter:
|
|
107
|
-
onHandleFilterReset:
|
|
108
|
-
currentSorter:
|
|
109
|
-
(
|
|
103
|
+
index: i,
|
|
104
|
+
onSort: F,
|
|
105
|
+
onHandleFilter: v,
|
|
106
|
+
onHandleFilterReset: I,
|
|
107
|
+
currentSorter: b.find(
|
|
108
|
+
(l) => l.field === (e.dataIndex || e.key)
|
|
110
109
|
),
|
|
111
|
-
currentFilters:
|
|
112
|
-
_key: e.key || e.dataIndex ||
|
|
110
|
+
currentFilters: j,
|
|
111
|
+
_key: e.key || e.dataIndex || i,
|
|
113
112
|
...e,
|
|
114
113
|
key: e.key,
|
|
115
114
|
column: e,
|
|
116
|
-
headerCellProps:
|
|
117
|
-
prefixCls:
|
|
118
|
-
component:
|
|
119
|
-
className:
|
|
120
|
-
columnFixedStyle:
|
|
121
|
-
showSorterTooltip:
|
|
115
|
+
headerCellProps: Q,
|
|
116
|
+
prefixCls: o,
|
|
117
|
+
component: S,
|
|
118
|
+
className: U,
|
|
119
|
+
columnFixedStyle: g,
|
|
120
|
+
showSorterTooltip: D
|
|
122
121
|
}
|
|
123
122
|
);
|
|
124
123
|
})
|
|
@@ -126,5 +125,5 @@ function Re(R) {
|
|
|
126
125
|
}) });
|
|
127
126
|
}
|
|
128
127
|
export {
|
|
129
|
-
|
|
128
|
+
ke as default
|
|
130
129
|
};
|