@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/table/tbody/Tr.js
CHANGED
|
@@ -1,130 +1,128 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import we, { forwardRef as Re, useContext as Ee, createElement as Te } from "react";
|
|
3
|
+
import _e from "@unicom-cloud/icons/IconUiMinus";
|
|
4
|
+
import ge from "@unicom-cloud/icons/IconUiPlus";
|
|
5
|
+
import $e from "lodash/isArray";
|
|
6
|
+
import Pe from "lodash/isString";
|
|
7
|
+
import be from "../../checkbox/Checkbox.js";
|
|
8
8
|
import "../../checkbox/Group.js";
|
|
9
9
|
import "../../config-provider/ConfigProvider.js";
|
|
10
|
-
import
|
|
10
|
+
import Oe from "../../radio/Radio.js";
|
|
11
11
|
import "../../radio/Group.js";
|
|
12
|
-
import { INTERNAL_SELECTION_KEY as
|
|
13
|
-
import
|
|
14
|
-
import { getOriginData as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
function
|
|
12
|
+
import { INTERNAL_SELECTION_KEY as ve, INTERNAL_EXPAND_KEY as Ie } from "../constant.js";
|
|
13
|
+
import Se from "../hook/useComponent.js";
|
|
14
|
+
import { getOriginData as Ke } from "../util.js";
|
|
15
|
+
import k from "@unicom-cloud/utils/class-name";
|
|
16
|
+
import Be from "./Td.js";
|
|
17
|
+
import De from "../../config-provider/context.js";
|
|
18
|
+
function Le($, W) {
|
|
19
19
|
const {
|
|
20
|
-
expandedRowRender:
|
|
21
|
-
onClickExpandBtn:
|
|
22
|
-
columns:
|
|
23
|
-
component:
|
|
24
|
-
onCheck:
|
|
25
|
-
onCheckRadio:
|
|
26
|
-
prefixCls:
|
|
27
|
-
selectedRowKeys:
|
|
28
|
-
indeterminateKeys:
|
|
29
|
-
rowClassName:
|
|
30
|
-
onRow:
|
|
31
|
-
rowSelection:
|
|
32
|
-
indentSize:
|
|
33
|
-
activeSorters:
|
|
34
|
-
virtualized:
|
|
35
|
-
stickyOffsets:
|
|
36
|
-
stickyClassNames:
|
|
37
|
-
getRowKey:
|
|
38
|
-
placeholder:
|
|
39
|
-
expandProps:
|
|
40
|
-
data:
|
|
41
|
-
expandedRowKeys:
|
|
42
|
-
childrenColumnName:
|
|
20
|
+
expandedRowRender: N,
|
|
21
|
+
onClickExpandBtn: P,
|
|
22
|
+
columns: X,
|
|
23
|
+
component: b,
|
|
24
|
+
onCheck: q,
|
|
25
|
+
onCheckRadio: G,
|
|
26
|
+
prefixCls: t,
|
|
27
|
+
selectedRowKeys: O,
|
|
28
|
+
indeterminateKeys: J,
|
|
29
|
+
rowClassName: Q,
|
|
30
|
+
onRow: V,
|
|
31
|
+
rowSelection: c,
|
|
32
|
+
indentSize: Z = 16,
|
|
33
|
+
activeSorters: ee,
|
|
34
|
+
virtualized: d,
|
|
35
|
+
stickyOffsets: oe,
|
|
36
|
+
stickyClassNames: ne,
|
|
37
|
+
getRowKey: te,
|
|
38
|
+
placeholder: re,
|
|
39
|
+
expandProps: w = { strictTreeData: !0 },
|
|
40
|
+
data: ie,
|
|
41
|
+
expandedRowKeys: v,
|
|
42
|
+
childrenColumnName: R,
|
|
43
43
|
record: o,
|
|
44
|
-
index:
|
|
45
|
-
type:
|
|
46
|
-
shouldRowExpand:
|
|
47
|
-
level:
|
|
48
|
-
} =
|
|
49
|
-
`${
|
|
44
|
+
index: a,
|
|
45
|
+
type: p,
|
|
46
|
+
shouldRowExpand: se,
|
|
47
|
+
level: ae
|
|
48
|
+
} = $, { rtl: ce } = Ee(De), l = Ke(o), { ...I } = V?.(l, a) || {}, n = te(o), de = p === "radio" ? O.slice(0, 1) : O, pe = n || a, m = de.indexOf(n) > -1, le = v.indexOf(n) > -1, me = J.indexOf(n) > -1, fe = k(
|
|
49
|
+
`${t}-tr`,
|
|
50
50
|
{
|
|
51
|
-
[`${
|
|
52
|
-
[`${
|
|
51
|
+
[`${t}-row-checked`]: m,
|
|
52
|
+
[`${t}-row-expanded`]: le
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
),
|
|
56
|
-
[`${
|
|
57
|
-
[`${
|
|
54
|
+
Q?.(l, a)
|
|
55
|
+
), S = c && typeof c.checkboxProps == "function" ? c.checkboxProps(l) : {}, K = k(`${t}-td`, `${t}-operation`), E = (e) => k(K, `${t}-${e}`, {
|
|
56
|
+
[`${t}-selection-col`]: d && p === "checkbox" || p === "radio",
|
|
57
|
+
[`${t}-expand-icon-col`]: d && N
|
|
58
58
|
});
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function B(e) {
|
|
60
|
+
return w.strictTreeData ? $e(e[R]) && e[R].length : e[R] !== void 0;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
62
|
+
function xe() {
|
|
63
|
+
return ie.find((e) => B(e));
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const D = se(o, a), L = B(o), A = xe() && !N, Ce = A && L, ue = w.expandRowByClick && (D || Ce) ? {
|
|
66
66
|
onClick: (e) => {
|
|
67
|
-
|
|
68
|
-
S(t), (n = a == null ? void 0 : a.onClick) == null || n.call(a, e);
|
|
67
|
+
P(n), I?.onClick?.(e);
|
|
69
68
|
}
|
|
70
|
-
} : {}, { ComponentBodyRow:
|
|
71
|
-
className:
|
|
72
|
-
key:
|
|
73
|
-
...
|
|
74
|
-
...
|
|
75
|
-
},
|
|
76
|
-
function
|
|
77
|
-
const { icon:
|
|
78
|
-
onClick: (
|
|
79
|
-
|
|
69
|
+
} : {}, { ComponentBodyRow: H, ComponentTd: ye, getBodyComponentOperations: he } = Se(b), ke = d ? "div" : H, u = d ? "div" : ye, M = {
|
|
70
|
+
className: fe,
|
|
71
|
+
key: pe,
|
|
72
|
+
...I,
|
|
73
|
+
...ue
|
|
74
|
+
}, z = Pe(H) ? M : { ...M, record: o, index: a };
|
|
75
|
+
function U(e, s) {
|
|
76
|
+
const { icon: f } = w, x = !!~v.indexOf(s), C = {
|
|
77
|
+
onClick: (r) => {
|
|
78
|
+
r.stopPropagation(), P(s);
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
|
-
return typeof
|
|
81
|
+
return typeof f == "function" ? f({ expanded: x, record: e, ...C }) : /* @__PURE__ */ i("button", { ...C, type: "button", children: x ? /* @__PURE__ */ i(_e, {}) : /* @__PURE__ */ i(ge, {}) });
|
|
83
82
|
}
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
const
|
|
87
|
-
|
|
83
|
+
const Ne = N && /* @__PURE__ */ i(u, { className: E("expand-icon-cell"), children: D && U(o, n) }), y = c && c.renderCell;
|
|
84
|
+
let T;
|
|
85
|
+
const Y = /* @__PURE__ */ i(
|
|
86
|
+
be,
|
|
88
87
|
{
|
|
89
|
-
value:
|
|
90
|
-
onChange: (e) =>
|
|
91
|
-
checked:
|
|
92
|
-
indeterminate:
|
|
93
|
-
...
|
|
88
|
+
value: n,
|
|
89
|
+
onChange: (e) => q(e, o),
|
|
90
|
+
checked: m,
|
|
91
|
+
indeterminate: me,
|
|
92
|
+
...S
|
|
94
93
|
}
|
|
95
|
-
),
|
|
96
|
-
|
|
94
|
+
), j = /* @__PURE__ */ i(
|
|
95
|
+
Oe,
|
|
97
96
|
{
|
|
98
|
-
onChange: () =>
|
|
99
|
-
value:
|
|
100
|
-
checked:
|
|
101
|
-
...
|
|
97
|
+
onChange: () => G(n, o),
|
|
98
|
+
value: n,
|
|
99
|
+
checked: m,
|
|
100
|
+
...S
|
|
102
101
|
}
|
|
103
102
|
);
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
selectionNode:
|
|
107
|
-
expandNode:
|
|
103
|
+
p === "checkbox" && (T = /* @__PURE__ */ i(u, { className: E("checkbox"), children: y ? y(Y, m, l) : Y })), p === "radio" && (T = /* @__PURE__ */ i(u, { className: E("radio"), children: y ? y(j, m, l) : j }));
|
|
104
|
+
const F = he({
|
|
105
|
+
selectionNode: T,
|
|
106
|
+
expandNode: Ne
|
|
108
107
|
});
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
const u = `${e.key}-${e.dataIndex}-${e.title}-${n}`, y = ie[n], C = se[n];
|
|
108
|
+
return /* @__PURE__ */ Te(ke, { ...z, key: z.key, ref: W }, X.map((e, s) => {
|
|
109
|
+
const f = `${e.key}-${e.dataIndex}-${e.title}-${s}`, x = oe[s], C = ne[s];
|
|
112
110
|
if (e.$$isOperation) {
|
|
113
|
-
let
|
|
114
|
-
e.title ===
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
-
key:
|
|
118
|
-
...
|
|
119
|
-
className:
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
let r = e.node, _ = !0;
|
|
112
|
+
e.title === ve && (r = F.find((g) => g.name === "selectionNode")?.node, _ = !1), e.title === Ie && (r = F.find((g) => g.name === "expandNode")?.node, _ = !1);
|
|
113
|
+
const h = typeof r == "function" ? r(o) : r;
|
|
114
|
+
return we.cloneElement(h, {
|
|
115
|
+
key: f || s,
|
|
116
|
+
...h.props,
|
|
117
|
+
className: k(
|
|
118
|
+
_ ? K : "",
|
|
119
|
+
h?.props?.className,
|
|
122
120
|
C
|
|
123
121
|
),
|
|
124
122
|
style: {
|
|
125
|
-
...
|
|
123
|
+
...h?.props?.style,
|
|
126
124
|
...e.fixed === "left" ? {
|
|
127
|
-
[
|
|
125
|
+
[ce ? "right" : "left"]: x
|
|
128
126
|
} : {},
|
|
129
127
|
width: e.width,
|
|
130
128
|
minWidth: e.width
|
|
@@ -132,35 +130,35 @@ function ze(I, V) {
|
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
return /* @__PURE__ */ i(
|
|
135
|
-
|
|
133
|
+
Be,
|
|
136
134
|
{
|
|
137
|
-
prefixCls:
|
|
138
|
-
virtualized:
|
|
139
|
-
component:
|
|
140
|
-
currentSorter:
|
|
141
|
-
(
|
|
135
|
+
prefixCls: t,
|
|
136
|
+
virtualized: d,
|
|
137
|
+
component: b,
|
|
138
|
+
currentSorter: ee.find(
|
|
139
|
+
(r) => r.field === (e.dataIndex || e.key)
|
|
142
140
|
),
|
|
143
|
-
placeholder:
|
|
144
|
-
indentSize:
|
|
141
|
+
placeholder: re,
|
|
142
|
+
indentSize: Z,
|
|
145
143
|
stickyClassName: C,
|
|
146
|
-
stickyOffset:
|
|
147
|
-
InnerComponentTd:
|
|
144
|
+
stickyOffset: x,
|
|
145
|
+
InnerComponentTd: u,
|
|
148
146
|
column: e,
|
|
149
|
-
columnIndex:
|
|
147
|
+
columnIndex: s,
|
|
150
148
|
record: o,
|
|
151
|
-
trIndex:
|
|
152
|
-
level:
|
|
153
|
-
haveTreeData:
|
|
154
|
-
recordHaveChildren:
|
|
155
|
-
rowKey:
|
|
156
|
-
renderExpandIcon:
|
|
157
|
-
___dangerouslySetInnerHTML___:
|
|
149
|
+
trIndex: a,
|
|
150
|
+
level: ae,
|
|
151
|
+
haveTreeData: A,
|
|
152
|
+
recordHaveChildren: L,
|
|
153
|
+
rowKey: n,
|
|
154
|
+
renderExpandIcon: U,
|
|
155
|
+
___dangerouslySetInnerHTML___: $.___dangerouslySetInnerHTML___
|
|
158
156
|
},
|
|
159
|
-
|
|
157
|
+
f
|
|
160
158
|
);
|
|
161
159
|
}));
|
|
162
160
|
}
|
|
163
|
-
const
|
|
161
|
+
const no = Re(Le);
|
|
164
162
|
export {
|
|
165
|
-
|
|
163
|
+
no as default
|
|
166
164
|
};
|
package/table/tbody/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as I, jsx as
|
|
1
|
+
import { jsxs as I, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import z, { forwardRef as A, createElement as B } from "react";
|
|
3
3
|
import V from "lodash/isArray";
|
|
4
4
|
import X from "../hook/useComponent.js";
|
|
@@ -8,82 +8,82 @@ import q from "../../virtual-list/VirtualList.js";
|
|
|
8
8
|
import W from "./Tr.js";
|
|
9
9
|
const G = A(function({
|
|
10
10
|
record: r,
|
|
11
|
-
index:
|
|
12
|
-
virtualized:
|
|
11
|
+
index: c,
|
|
12
|
+
virtualized: o,
|
|
13
13
|
tbodyProps: R
|
|
14
14
|
}, v) {
|
|
15
15
|
const {
|
|
16
16
|
prefixCls: e,
|
|
17
17
|
columns: b,
|
|
18
18
|
indentSize: N = 16,
|
|
19
|
-
childrenColumnName:
|
|
20
|
-
expandProps:
|
|
21
|
-
rowSelection:
|
|
22
|
-
hasFixedColumn:
|
|
19
|
+
childrenColumnName: m = "children",
|
|
20
|
+
expandProps: f = {},
|
|
21
|
+
rowSelection: s,
|
|
22
|
+
hasFixedColumn: h,
|
|
23
23
|
tableViewWidth: $,
|
|
24
|
-
getRowKey:
|
|
25
|
-
expandedRowKeys:
|
|
26
|
-
expandedRowRender:
|
|
24
|
+
getRowKey: i,
|
|
25
|
+
expandedRowKeys: y,
|
|
26
|
+
expandedRowRender: l
|
|
27
27
|
} = R;
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
const
|
|
28
|
+
let p;
|
|
29
|
+
s && "type" in s ? p = s.type : s && !("type" in s) && (p = "checkbox");
|
|
30
|
+
const d = l && ((n, x) => l(Y(n), x)), a = (n) => V(n[m]) && n[m].length, u = (n, x) => "rowExpandable" in f && typeof f.rowExpandable == "function" ? f.rowExpandable(n) : d?.(n, x) !== null, E = (n, x) => {
|
|
31
31
|
const S = [], K = {
|
|
32
32
|
...R,
|
|
33
|
-
type:
|
|
34
|
-
shouldRowExpand:
|
|
33
|
+
type: p,
|
|
34
|
+
shouldRowExpand: u
|
|
35
35
|
};
|
|
36
36
|
S.push(
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
38
|
W,
|
|
39
39
|
{
|
|
40
40
|
ref: v,
|
|
41
41
|
...K,
|
|
42
|
-
record:
|
|
42
|
+
record: n,
|
|
43
43
|
level: 0,
|
|
44
|
-
index:
|
|
44
|
+
index: x
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
i(n)
|
|
47
47
|
)
|
|
48
48
|
);
|
|
49
49
|
const L = (C, O, P = 0) => {
|
|
50
|
-
V(C) && C.length && C.forEach((
|
|
51
|
-
|
|
50
|
+
V(C) && C.length && C.forEach((g, j) => {
|
|
51
|
+
y.indexOf(O) !== -1 && (S.push(
|
|
52
52
|
/* @__PURE__ */ B(
|
|
53
53
|
W,
|
|
54
54
|
{
|
|
55
55
|
...K,
|
|
56
|
-
key:
|
|
57
|
-
record:
|
|
56
|
+
key: i(g),
|
|
57
|
+
record: g,
|
|
58
58
|
level: P + 1,
|
|
59
59
|
index: j
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
|
-
),
|
|
62
|
+
), a(g) && L(g[m], i(g), P + 1));
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
return
|
|
66
|
-
}, T =
|
|
65
|
+
return d || L(n[m], i(n)), S;
|
|
66
|
+
}, T = i(r), k = u(r, c) && y.indexOf(T) !== -1, F = o ? "div" : "tr", H = o ? "div" : "td";
|
|
67
67
|
return /* @__PURE__ */ I(z.Fragment, { children: [
|
|
68
|
-
E(r,
|
|
69
|
-
k && /* @__PURE__ */
|
|
68
|
+
E(r, c),
|
|
69
|
+
k && /* @__PURE__ */ t(
|
|
70
70
|
F,
|
|
71
71
|
{
|
|
72
72
|
className: D(`${e}-tr`, `${e}-expand-content`),
|
|
73
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ t(
|
|
74
74
|
H,
|
|
75
75
|
{
|
|
76
76
|
className: D(`${e}-td`),
|
|
77
77
|
style: { paddingLeft: N },
|
|
78
78
|
colSpan: b.length,
|
|
79
|
-
children:
|
|
79
|
+
children: h ? /* @__PURE__ */ t(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: `${e}-expand-fixed-row`,
|
|
83
83
|
style: { width: $ },
|
|
84
|
-
children:
|
|
84
|
+
children: d?.(r, c)
|
|
85
85
|
}
|
|
86
|
-
) :
|
|
86
|
+
) : d?.(r, c)
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
},
|
|
@@ -91,63 +91,62 @@ const G = A(function({
|
|
|
91
91
|
)
|
|
92
92
|
] }, T);
|
|
93
93
|
});
|
|
94
|
-
function ne(
|
|
94
|
+
function ne(w) {
|
|
95
95
|
const {
|
|
96
96
|
data: r,
|
|
97
|
-
columns:
|
|
98
|
-
prefixCls:
|
|
97
|
+
columns: c,
|
|
98
|
+
prefixCls: o,
|
|
99
99
|
component: R,
|
|
100
100
|
noDataElement: v,
|
|
101
101
|
scroll: e,
|
|
102
102
|
tableViewWidth: b,
|
|
103
103
|
virtualized: N,
|
|
104
|
-
virtualListProps:
|
|
105
|
-
getRowKey:
|
|
106
|
-
saveVirtualListRef:
|
|
107
|
-
} =
|
|
108
|
-
|
|
109
|
-
(l = m.saveRef) == null || l.call(m, i);
|
|
104
|
+
virtualListProps: m,
|
|
105
|
+
getRowKey: f,
|
|
106
|
+
saveVirtualListRef: s
|
|
107
|
+
} = w, h = (a) => {
|
|
108
|
+
w.saveRef?.(a);
|
|
110
109
|
}, { ComponentTbody: $ } = X(R);
|
|
111
|
-
let
|
|
112
|
-
e && (e.x && (typeof e.x == "number" || typeof e.x == "string") && (
|
|
110
|
+
let i = {}, y = {};
|
|
111
|
+
e && (e.x && (typeof e.x == "number" || typeof e.x == "string") && (i = {
|
|
113
112
|
width: e.x
|
|
114
|
-
}), e.y && (typeof e.y == "number" || typeof e.y == "string") && (
|
|
113
|
+
}), e.y && (typeof e.y == "number" || typeof e.y == "string") && (y = {
|
|
115
114
|
maxHeight: e.y
|
|
116
115
|
}));
|
|
117
|
-
const
|
|
118
|
-
className: `${
|
|
116
|
+
const l = {
|
|
117
|
+
className: `${o}-no-data`
|
|
119
118
|
};
|
|
120
|
-
b && (
|
|
121
|
-
const
|
|
122
|
-
const E =
|
|
123
|
-
return /* @__PURE__ */
|
|
119
|
+
b && (l.className = `${o}-no-data ${o}-expand-fixed-row`, l.style = { width: b });
|
|
120
|
+
const p = /* @__PURE__ */ t("tr", { className: D(`${o}-tr`, `${o}-empty-row`), children: /* @__PURE__ */ t("td", { className: `${o}-td`, colSpan: c.length, children: /* @__PURE__ */ t("div", { ...l, children: v }) }) }), d = (a, u) => {
|
|
121
|
+
const E = f(a) ?? u;
|
|
122
|
+
return /* @__PURE__ */ t(
|
|
124
123
|
G,
|
|
125
124
|
{
|
|
126
|
-
record:
|
|
127
|
-
index:
|
|
125
|
+
record: a,
|
|
126
|
+
index: u,
|
|
128
127
|
virtualized: N,
|
|
129
|
-
tbodyProps:
|
|
128
|
+
tbodyProps: w
|
|
130
129
|
},
|
|
131
130
|
E
|
|
132
131
|
);
|
|
133
132
|
};
|
|
134
|
-
return N ? r.length > 0 ? /* @__PURE__ */
|
|
133
|
+
return N ? r.length > 0 ? /* @__PURE__ */ t(
|
|
135
134
|
q,
|
|
136
135
|
{
|
|
137
136
|
data: r,
|
|
138
|
-
height:
|
|
137
|
+
height: y.maxHeight,
|
|
139
138
|
isStaticItemHeight: !1,
|
|
140
|
-
outerStyle: { ...
|
|
139
|
+
outerStyle: { ...i, minWidth: "100%", overflow: "visible" },
|
|
141
140
|
innerStyle: { right: "auto", minWidth: "100%" },
|
|
142
|
-
className: `${
|
|
143
|
-
ref: (
|
|
144
|
-
|
|
141
|
+
className: `${o}-body`,
|
|
142
|
+
ref: (a) => {
|
|
143
|
+
s(a), h(a?.dom);
|
|
145
144
|
},
|
|
146
|
-
itemKey:
|
|
147
|
-
...
|
|
148
|
-
children:
|
|
145
|
+
itemKey: f,
|
|
146
|
+
...m,
|
|
147
|
+
children: d
|
|
149
148
|
}
|
|
150
|
-
) : /* @__PURE__ */
|
|
149
|
+
) : /* @__PURE__ */ t("div", { className: `${o}-body`, ref: h, children: /* @__PURE__ */ t("table", { children: /* @__PURE__ */ t("tbody", { children: p }) }) }) : /* @__PURE__ */ t($, { ref: h, children: r.length > 0 ? r.map(d) : p });
|
|
151
150
|
}
|
|
152
151
|
export {
|
|
153
152
|
ne as default
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as C, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import X from "lodash/isFunction";
|
|
3
|
-
import { useRef as
|
|
3
|
+
import { useRef as u, useContext as z, useCallback as o, useEffect as E } from "react";
|
|
4
4
|
import "../../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import { on as
|
|
7
|
-
import { defaultComponent as
|
|
5
|
+
import T from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import { on as b, off as w } from "../../components/common/utils/dom.js";
|
|
7
|
+
import { defaultComponent as j } from "../constant.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import
|
|
10
|
-
function
|
|
11
|
-
let { className: r, children:
|
|
12
|
-
const
|
|
13
|
-
if (!X(
|
|
14
|
-
const
|
|
15
|
-
t.current.boundingClientRect =
|
|
16
|
-
}, []),
|
|
17
|
-
|
|
18
|
-
}, []),
|
|
19
|
-
let i = t.current.boundingClientRect.width + ((
|
|
20
|
-
i < 0 || (
|
|
21
|
-
column:
|
|
9
|
+
import D from "../../config-provider/context.js";
|
|
10
|
+
function A(v) {
|
|
11
|
+
let { className: r, children: m, column: a, onResize: l, ...f } = v;
|
|
12
|
+
const p = j.header.th, n = u(null), x = u(null), t = u({}), { getPrefixCls: R } = z(D), d = R?.("table-th-resizable");
|
|
13
|
+
if (!X(l)) return /* @__PURE__ */ C(p, { ref: n, ...f, className: r, children: m });
|
|
14
|
+
const h = o((e) => {
|
|
15
|
+
t.current.boundingClientRect = n.current.getBoundingClientRect(), t.current.pageX = e?.pageX ?? 0, N();
|
|
16
|
+
}, []), s = o((e) => {
|
|
17
|
+
g();
|
|
18
|
+
}, []), c = o((e) => {
|
|
19
|
+
let i = t.current.boundingClientRect.width + ((e?.pageX ?? 0) - t.current.pageX);
|
|
20
|
+
i < 0 || (a.width = i, l?.({
|
|
21
|
+
column: a,
|
|
22
22
|
width: i,
|
|
23
23
|
widthOrigin: t.current.boundingClientRect.width
|
|
24
24
|
}));
|
|
25
|
-
}, []),
|
|
26
|
-
|
|
27
|
-
}, []),
|
|
28
|
-
|
|
25
|
+
}, []), N = o((e) => {
|
|
26
|
+
b(document, "mousemove", c), b(document, "mouseup", s);
|
|
27
|
+
}, []), g = o((e) => {
|
|
28
|
+
w(document, "mousemove", c), w(document, "mouseup", s);
|
|
29
29
|
}, []);
|
|
30
|
-
return r =
|
|
31
|
-
|
|
32
|
-
}), []), /* @__PURE__ */ M(
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */
|
|
30
|
+
return r = T(r, d), E(() => (h(), c(), s(), () => {
|
|
31
|
+
g();
|
|
32
|
+
}), []), /* @__PURE__ */ M(p, { ref: n, ...f, className: r, children: [
|
|
33
|
+
m,
|
|
34
|
+
/* @__PURE__ */ C(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
ref: x,
|
|
38
|
-
className: `${
|
|
39
|
-
onMouseDown:
|
|
38
|
+
className: `${d}-cursor`,
|
|
39
|
+
onMouseDown: h
|
|
40
40
|
}
|
|
41
41
|
)
|
|
42
42
|
] });
|
|
43
43
|
}
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
A as default
|
|
46
46
|
};
|