@unicom-cloud/ui 0.8.99 → 0.8.100
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/Anchor.js +3 -1
- package/Badge.js +7 -6
- package/Copy.js +49 -2
- package/Flex.js +12 -0
- package/Grid.js +1 -1
- package/LiquidFill.js +3 -2
- package/Marquee.js +3 -2
- package/QrCode.js +3 -2
- package/Splitter.js +4 -5
- package/Tag.js +3 -2
- package/Tour.js +3 -2
- package/alert/index.js +38 -39
- package/anchor/index.js +5 -3
- package/badge/index.js +19 -18
- package/copy/index.js +83 -35
- package/flex/index.js +59 -0
- package/flex/interface.js +34 -0
- package/flex/utils.js +13 -0
- package/grid/{GridItem.js → Item.js} +15 -15
- package/grid/index.js +1 -1
- package/index.js +503 -493
- package/input/Button.js +39 -34
- package/input/Textarea.js +108 -104
- package/liquid-fill/index.js +3 -2
- package/marquee/index.js +3 -2
- package/package.json +1 -1
- package/qr-code/index.js +3 -2
- package/segmented/index.js +112 -104
- package/spin/index.js +75 -62
- package/splitter/Panel.js +39 -0
- package/splitter/SplitBar.js +157 -0
- package/splitter/Splitter.js +139 -0
- package/splitter/hooks/useEvent.js +12 -0
- package/splitter/hooks/useItems.js +26 -0
- package/splitter/hooks/useResizable.js +26 -0
- package/splitter/hooks/useResize.js +68 -0
- package/splitter/hooks/useSizes.js +60 -0
- package/splitter/index.js +5 -115
- package/style.css +1 -1
- package/table/Table.js +1 -1
- package/table/hook/useThResizable.js +72 -26
- package/table/tbody/Td.js +80 -77
- package/table/th-resizable/index.js +92 -35
- package/tag/index.js +42 -41
- package/tooltip/index.js +89 -82
- package/tour/index.js +5 -6
- package/types/common/space/index.d.ts +2 -1
- package/types/pc/affix/interface.d.ts +0 -2
- package/types/pc/alert/index.d.ts +2 -2
- package/types/pc/anchor/index.d.ts +2 -1
- package/types/pc/anchor/interface.d.ts +0 -2
- package/types/pc/auto-complete/interface.d.ts +0 -6
- package/types/pc/avatar/interface.d.ts +0 -4
- package/types/pc/breadcrumb/interface.d.ts +0 -3
- package/types/pc/carousel/interface.d.ts +2 -6
- package/types/pc/cascader/interface.d.ts +6 -18
- package/types/pc/checkbox/interface.d.ts +0 -1
- package/types/pc/collapse/interface.d.ts +0 -2
- package/types/pc/color-picker/interface.d.ts +0 -2
- package/types/pc/config-provider/interface.d.ts +13 -17
- package/types/pc/copy/interface.d.ts +2 -1
- package/types/pc/date-picker/interface.d.ts +0 -17
- package/types/pc/descriptions/interface.d.ts +0 -1
- package/types/pc/drawer/interface.d.ts +0 -7
- package/types/pc/dropdown/interface.d.ts +0 -1
- package/types/pc/flex/index.d.ts +9 -0
- package/types/pc/flex/interface.d.ts +61 -0
- package/types/pc/flex/utils.d.ts +9 -0
- package/types/pc/form/interface.d.ts +9 -22
- package/types/pc/form/util.d.ts +1 -1
- package/types/pc/grid/index.d.ts +3 -3
- package/types/pc/grid/interface.d.ts +1 -6
- package/types/pc/image/interface.d.ts +0 -13
- package/types/pc/index.d.ts +6 -2
- package/types/pc/input/Textarea.d.ts +2 -6
- package/types/pc/input/interface.d.ts +5 -13
- package/types/pc/input-number/interface.d.ts +0 -4
- package/types/pc/input-tag/interface.d.ts +0 -13
- package/types/pc/layout/interface.d.ts +0 -1
- package/types/pc/link/interface.d.ts +0 -1
- package/types/pc/list/interface.d.ts +0 -4
- package/types/pc/menu/interface.d.ts +0 -8
- package/types/pc/message/interface.d.ts +0 -2
- package/types/pc/modal/interface.d.ts +0 -5
- package/types/pc/notification/interface.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +0 -2
- package/types/pc/popconfirm/interface.d.ts +8 -10
- package/types/pc/popover/interface.d.ts +0 -1
- package/types/pc/progress/interface.d.ts +0 -3
- package/types/pc/resize-box/interface.d.ts +1 -7
- package/types/pc/select/interface.d.ts +0 -12
- package/types/pc/select-view/interface.d.ts +0 -7
- package/types/pc/slider/interface.d.ts +0 -4
- package/types/pc/space/index.d.ts +1 -0
- package/types/pc/spin/interface.d.ts +4 -1
- package/types/pc/splitter/Panel.d.ts +8 -0
- package/types/pc/splitter/SplitBar.d.ts +21 -0
- package/types/pc/splitter/Splitter.d.ts +4 -0
- package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
- package/types/pc/splitter/hooks/useItems.d.ts +10 -0
- package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
- package/types/pc/splitter/hooks/useResize.d.ts +4 -0
- package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
- package/types/pc/splitter/index.d.ts +8 -4
- package/types/pc/splitter/interface.d.ts +181 -38
- package/types/pc/statistic/interface.d.ts +0 -4
- package/types/pc/steps/interface.d.ts +0 -3
- package/types/pc/table/hook/useThResizable.d.ts +2 -2
- package/types/pc/table/interface.d.ts +4 -15
- package/types/pc/tabs/interface.d.ts +0 -7
- package/types/pc/tag/index.d.ts +2 -0
- package/types/pc/tag/interface.d.ts +0 -1
- package/types/pc/time-picker/interface.d.ts +0 -7
- package/types/pc/tooltip/interface.d.ts +4 -1
- package/types/pc/transfer/interface.d.ts +2 -9
- package/types/pc/tree/interface.d.ts +2 -8
- package/types/pc/tree-select/interface.d.ts +0 -8
- package/types/pc/trigger/interface.d.ts +0 -5
- package/types/pc/typography/EditContent.d.ts +2 -1
- package/types/pc/typography/interface.d.ts +45 -30
- package/types/pc/upload/interface.d.ts +6 -11
- package/types/pc/utils/index.d.ts +1 -0
- package/types/pc/utils/names.d.ts +6 -0
- package/types/pc/utils/toArray.d.ts +7 -0
- package/types/pc/verification-code/interface.d.ts +0 -2
- package/types/pc/watermark/interface.d.ts +0 -2
- package/typography/Base.js +73 -73
- package/typography/EditContent.js +43 -33
- package/typography/Ellipsis.js +117 -184
- package/typography/Operations.js +97 -49
- package/typography/useCssEllipsis.js +7 -6
- package/utils/index.js +117 -115
- package/utils/names.js +4 -0
- package/utils/toArray.js +12 -0
- package/version/index.js +1 -1
- /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/table/Table.js
CHANGED
|
@@ -87,7 +87,7 @@ function ko(ce, st) {
|
|
|
87
87
|
} = b, ze = ne(
|
|
88
88
|
() => vo(m, H),
|
|
89
89
|
[m, H]
|
|
90
|
-
), n = it?.("table"), ue = b.size || (["default", "middle", "small"].indexOf(Ne) > -1 ? Ne : "default"), D = w(null), u = w(null), pe = w(null), g = w(null), E = w(null), me = w(null), K = w(null), j = w(0), ge = w(!1), [Re, f] = bo(b), { currentFilters: Ct, defaultSorters: xt } = zt(), [O, ye] = V(1), [St, wt] = V(
|
|
90
|
+
), n = it?.("table"), ue = b.size || (["default", "middle", "small", "mini"].indexOf(Ne) > -1 ? Ne : "default"), D = w(null), u = w(null), pe = w(null), g = w(null), E = w(null), me = w(null), K = w(null), j = w(0), ge = w(!1), [Re, f] = bo(b), { currentFilters: Ct, defaultSorters: xt } = zt(), [O, ye] = V(1), [St, wt] = V(
|
|
91
91
|
N.pageSize || N.defaultPageSize || 10
|
|
92
92
|
), [He, ke] = V(Ct), [Pt, Tt] = V(0), [$t, Ft] = V([]), he = To(f), [Nt, Ee] = Po(
|
|
93
93
|
Re,
|
|
@@ -1,39 +1,85 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as b, useEffect as a } from "react";
|
|
2
|
+
import "@unicom-cloud/utils/case-name";
|
|
3
|
+
import "@unicom-cloud/utils/class-name";
|
|
4
|
+
import "../../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
5
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
6
|
+
import "../../utils/contextHolder.js";
|
|
7
|
+
import "@unicom-cloud/utils/dayjs";
|
|
8
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
9
|
+
import "../../components/common/utils/dayjs.js";
|
|
10
|
+
import "../../components/common/utils/dom.js";
|
|
11
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
12
|
+
import "react/jsx-runtime";
|
|
13
|
+
import "lodash/escapeRegExp";
|
|
14
|
+
import "lodash/isArray";
|
|
15
|
+
import "lodash/isNumber";
|
|
16
|
+
import "lodash/isString";
|
|
17
|
+
import "lodash/isFunction";
|
|
18
|
+
import "lodash/throttle";
|
|
2
19
|
import "../../components/common/utils/is.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
20
|
+
import "lodash/camelCase";
|
|
21
|
+
import "lodash/capitalize";
|
|
22
|
+
import "lodash/cloneDeep";
|
|
23
|
+
import "lodash/debounce";
|
|
24
|
+
import "lodash/get";
|
|
25
|
+
import "lodash/has";
|
|
26
|
+
import "lodash/kebabCase";
|
|
27
|
+
import "lodash/merge";
|
|
28
|
+
import "lodash/mergeWith";
|
|
29
|
+
import "lodash/set";
|
|
30
|
+
import "lodash/setWith";
|
|
31
|
+
import "lodash/snakeCase";
|
|
32
|
+
import "lodash/startCase";
|
|
33
|
+
import "lodash/uniq";
|
|
34
|
+
import "lodash/upperFirst";
|
|
35
|
+
import "@unicom-cloud/utils/math";
|
|
36
|
+
import "lodash/isPlainObject";
|
|
37
|
+
import "../../dist/react-transition-group/src/CSSTransition.js";
|
|
38
|
+
import "../../dist/react-transition-group/src/ReplaceTransition.js";
|
|
39
|
+
import "../../dist/react-transition-group/src/SwitchTransition.js";
|
|
40
|
+
import "../../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
41
|
+
import "../../dist/react-transition-group/src/TransitionGroup.js";
|
|
42
|
+
import "../../components/common/utils/reactDOM.js";
|
|
43
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
44
|
+
import "@unicom-cloud/utils/screenfull";
|
|
45
|
+
import "@unicom-cloud/utils/constant/ui.js";
|
|
46
|
+
import "react-is";
|
|
47
|
+
import "@unicom-cloud/utils/tree";
|
|
48
|
+
import { isArray as C } from "@unicom-cloud/utils/is";
|
|
49
|
+
import "uuid";
|
|
50
|
+
import "../../dist/validate/src/index.js";
|
|
51
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
52
|
+
import z from "../th-resizable/index.js";
|
|
53
|
+
function Rt(f = {}, c = []) {
|
|
54
|
+
const { columns: u } = f ?? {}, [d, m] = b(o(u));
|
|
55
|
+
function h(t, i) {
|
|
7
56
|
return {
|
|
8
|
-
column:
|
|
9
|
-
onResize(
|
|
10
|
-
const { column:
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
return
|
|
57
|
+
column: t,
|
|
58
|
+
onResize(p) {
|
|
59
|
+
const { column: r = {}, width: x } = p ?? {};
|
|
60
|
+
m((e) => {
|
|
61
|
+
const l = e.find((n, w, R) => n === r || n.dataIndex === r.dataIndex && n.title == r.title);
|
|
62
|
+
return l ? (l.width = x ?? r.width, o(e)) : e;
|
|
14
63
|
});
|
|
15
64
|
}
|
|
16
65
|
};
|
|
17
66
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
}) :
|
|
67
|
+
function o(t) {
|
|
68
|
+
return C(t) ? t.map((i, s, p) => {
|
|
69
|
+
const r = i;
|
|
70
|
+
return s < p.length - 1 && i.resizable !== !1 && !i.fixed && (r.onHeaderCell = h), r;
|
|
71
|
+
}) : t;
|
|
23
72
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return e ? r(e) : [];
|
|
27
|
-
});
|
|
28
|
-
return p(() => () => {
|
|
73
|
+
return a(() => (m(o(u)), () => {
|
|
74
|
+
}), [...c]), a(() => () => {
|
|
29
75
|
}, []), {
|
|
30
|
-
columns:
|
|
31
|
-
setColumns(
|
|
32
|
-
return
|
|
76
|
+
columns: d,
|
|
77
|
+
setColumns(t) {
|
|
78
|
+
return m(o(t));
|
|
33
79
|
},
|
|
34
|
-
ThResizable:
|
|
80
|
+
ThResizable: z
|
|
35
81
|
};
|
|
36
82
|
}
|
|
37
83
|
export {
|
|
38
|
-
|
|
84
|
+
Rt as default
|
|
39
85
|
};
|
package/table/tbody/Td.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as s, jsxs as re } from "react/jsx-runtime";
|
|
2
|
+
import W from "lodash/get";
|
|
3
3
|
import u from "lodash/isFunction";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import E from "lodash/isPlainObject";
|
|
5
|
+
import C from "lodash/isString";
|
|
6
|
+
import V, { useContext as ie, useRef as h, useMemo as se, useEffect as ce } from "react";
|
|
7
7
|
import "../../config-provider/ConfigProvider.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { getOriginData as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { mergedToString as
|
|
14
|
-
import { pick as
|
|
15
|
-
import
|
|
16
|
-
function ue(i) {
|
|
17
|
-
return i && !z.isValidElement(i) && $(i);
|
|
18
|
-
}
|
|
8
|
+
import de from "../../components/common/hooks/useForceUpdate.js";
|
|
9
|
+
import ae from "../hook/useComponent.js";
|
|
10
|
+
import { getOriginData as z } from "../util.js";
|
|
11
|
+
import fe from "../../tooltip/index.js";
|
|
12
|
+
import $ from "@unicom-cloud/utils/class-name";
|
|
13
|
+
import { mergedToString as me } from "../../components/common/utils/mergedToString.js";
|
|
14
|
+
import { pick as pe } from "../../components/common/utils/pick.js";
|
|
15
|
+
import ue from "../../config-provider/context.js";
|
|
19
16
|
function Ce(i) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
return i && !V.isValidElement(i) && E(i);
|
|
18
|
+
}
|
|
19
|
+
function he(i) {
|
|
20
|
+
const N = de(), {
|
|
21
|
+
component: A,
|
|
22
|
+
InnerComponentTd: K,
|
|
23
23
|
column: e,
|
|
24
|
-
columnIndex:
|
|
24
|
+
columnIndex: v,
|
|
25
25
|
prefixCls: l,
|
|
26
|
-
stickyClassName:
|
|
27
|
-
stickyOffset:
|
|
28
|
-
currentSorter:
|
|
29
|
-
virtualized:
|
|
26
|
+
stickyClassName: q,
|
|
27
|
+
stickyOffset: M,
|
|
28
|
+
currentSorter: g,
|
|
29
|
+
virtualized: G,
|
|
30
30
|
record: o,
|
|
31
31
|
trIndex: r,
|
|
32
|
-
level:
|
|
33
|
-
placeholder:
|
|
34
|
-
indentSize:
|
|
35
|
-
renderExpandIcon:
|
|
32
|
+
level: T,
|
|
33
|
+
placeholder: J = "-",
|
|
34
|
+
indentSize: Q,
|
|
35
|
+
renderExpandIcon: X,
|
|
36
36
|
rowKey: y,
|
|
37
|
-
recordHaveChildren:
|
|
38
|
-
haveTreeData:
|
|
39
|
-
} = i, { rtl: R } =
|
|
37
|
+
recordHaveChildren: b,
|
|
38
|
+
haveTreeData: Y
|
|
39
|
+
} = i, { rtl: R } = ie(ue), { ComponentBodyCell: _ } = ae(A), c = h(null), d = h(null), x = h(null), w = h(null), S = e?.tooltip?.show !== !1 && e?.ellipsis, Z = $(
|
|
40
40
|
`${l}-td`,
|
|
41
|
-
|
|
41
|
+
q,
|
|
42
42
|
{
|
|
43
|
-
[`${l}-col-sorted`]:
|
|
43
|
+
[`${l}-col-sorted`]: g && g.direction && g.field === e?.dataIndex
|
|
44
44
|
},
|
|
45
45
|
e?.className,
|
|
46
46
|
u(e?.bodyClassName) ? e.bodyClassName(o, r) : e?.bodyClassName
|
|
47
47
|
);
|
|
48
48
|
let a = {}, k, B, n = {};
|
|
49
|
-
e?.fixed === "left" && (n[R ? "right" : "left"] =
|
|
49
|
+
e?.fixed === "left" && (n[R ? "right" : "left"] = M), e?.fixed === "right" && (n[R ? "left" : "right"] = M), E(e?.cellStyle) && (n = {
|
|
50
50
|
...n,
|
|
51
51
|
...e?.cellStyle
|
|
52
|
-
}),
|
|
52
|
+
}), E(e?.bodyCellStyle) && (n = {
|
|
53
53
|
...n,
|
|
54
54
|
...e?.bodyCellStyle
|
|
55
55
|
}), u(e?.bodyCellStyle) && (n = {
|
|
56
56
|
...n,
|
|
57
57
|
...e?.bodyCellStyle?.(o, r) ?? {}
|
|
58
|
-
}), e?.align && (n.textAlign = e?.align),
|
|
59
|
-
const { onHandleSave:
|
|
58
|
+
}), e?.align && (n.textAlign = e?.align), G && e.width && (n.width = e.width, n.minWidth = e.width, n.maxWidth = e.width);
|
|
59
|
+
const { onHandleSave: ee, ...D } = e?.onCell ? e?.onCell(
|
|
60
60
|
o,
|
|
61
61
|
r,
|
|
62
62
|
e,
|
|
@@ -64,51 +64,51 @@ function Ce(i) {
|
|
|
64
64
|
// 潘启宝添加
|
|
65
65
|
) ?? {} : { onHandleSave: () => {
|
|
66
66
|
} }, H = e?.render;
|
|
67
|
-
let t =
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
let t = se(() => H?.(
|
|
68
|
+
W(o, e?.dataIndex ?? ""),
|
|
69
|
+
z(o),
|
|
70
70
|
r,
|
|
71
71
|
e,
|
|
72
72
|
// 潘启宝添加
|
|
73
73
|
{ rowKey: y }
|
|
74
74
|
// 潘启宝添加
|
|
75
75
|
), [o, e, r]);
|
|
76
|
-
if (u(H) || (t =
|
|
76
|
+
if (u(H) || (t = W(o, e?.dataIndex ?? "")), Ce(t) && (a = t?.props, k = a?.rowSpan, B = a?.colSpan, t = t?.children), k === 0 || B === 0)
|
|
77
77
|
return null;
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
} : {},
|
|
82
|
-
let f =
|
|
83
|
-
|
|
84
|
-
function
|
|
85
|
-
|
|
78
|
+
C(t) && (t = t.trim()), !t && t !== 0 && (t = e?.placeholder ?? J ?? "-");
|
|
79
|
+
const te = e?.ellipsis && C(t) && !S ? {
|
|
80
|
+
title: t
|
|
81
|
+
} : {}, I = Y && e?.$$isFirstColumn, L = I && b;
|
|
82
|
+
let f = I && T > 0 ? Q * T : 0;
|
|
83
|
+
I && !b && (f += 20);
|
|
84
|
+
function ne(p) {
|
|
85
|
+
N();
|
|
86
86
|
}
|
|
87
|
-
const O = `${
|
|
87
|
+
const O = `${v}-${r}-${f}-${L}`, oe = /* @__PURE__ */ s(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
90
|
ref: c,
|
|
91
|
-
className:
|
|
91
|
+
className: $(`${l}-cell`, {
|
|
92
92
|
[`${l}-cell-text-ellipsis`]: e?.ellipsis
|
|
93
93
|
}),
|
|
94
|
-
...
|
|
95
|
-
onMouseEnter:
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
-
|
|
94
|
+
...te,
|
|
95
|
+
onMouseEnter: S ? ne : void 0,
|
|
96
|
+
children: /* @__PURE__ */ re(
|
|
97
|
+
_,
|
|
98
98
|
{
|
|
99
99
|
ref: d,
|
|
100
100
|
className: `${l}-cell-wrap-value`,
|
|
101
|
-
...
|
|
102
|
-
rowData:
|
|
101
|
+
...C(_) ? {} : {
|
|
102
|
+
rowData: z(o),
|
|
103
103
|
column: e,
|
|
104
|
-
onHandleSave:
|
|
104
|
+
onHandleSave: ee,
|
|
105
105
|
...D
|
|
106
106
|
},
|
|
107
107
|
children: [
|
|
108
108
|
!!f && /* @__PURE__ */ s(
|
|
109
109
|
"span",
|
|
110
110
|
{
|
|
111
|
-
ref:
|
|
111
|
+
ref: x,
|
|
112
112
|
className: `${l}-cell-indent`,
|
|
113
113
|
style: { paddingLeft: f }
|
|
114
114
|
}
|
|
@@ -116,12 +116,12 @@ function Ce(i) {
|
|
|
116
116
|
!!L && /* @__PURE__ */ s(
|
|
117
117
|
"span",
|
|
118
118
|
{
|
|
119
|
-
ref:
|
|
119
|
+
ref: w,
|
|
120
120
|
className: `${l}-cell-expand-icon`,
|
|
121
|
-
children:
|
|
121
|
+
children: X(o, y)
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
|
-
i.___dangerouslySetInnerHTML___ ? /* @__PURE__ */ s(
|
|
124
|
+
i.___dangerouslySetInnerHTML___ && C(t) ? /* @__PURE__ */ s(
|
|
125
125
|
"span",
|
|
126
126
|
{
|
|
127
127
|
dangerouslySetInnerHTML: {
|
|
@@ -137,11 +137,11 @@ function Ce(i) {
|
|
|
137
137
|
O
|
|
138
138
|
);
|
|
139
139
|
let m = /* @__PURE__ */ s(
|
|
140
|
-
|
|
140
|
+
K,
|
|
141
141
|
{
|
|
142
|
-
className:
|
|
142
|
+
className: Z,
|
|
143
143
|
style: n,
|
|
144
|
-
...
|
|
144
|
+
...pe(D, [
|
|
145
145
|
"onClick",
|
|
146
146
|
"onDoubleClick",
|
|
147
147
|
"onContextMenu",
|
|
@@ -153,29 +153,32 @@ function Ce(i) {
|
|
|
153
153
|
"onMouseUp"
|
|
154
154
|
]),
|
|
155
155
|
...a,
|
|
156
|
-
children:
|
|
156
|
+
children: oe
|
|
157
157
|
},
|
|
158
|
-
e?.key || e?.dataIndex ||
|
|
158
|
+
e?.key || e?.dataIndex || v
|
|
159
159
|
);
|
|
160
|
-
if (
|
|
160
|
+
if (S) {
|
|
161
161
|
let p = 0, P = 0, j = 0, F = 0;
|
|
162
|
-
if (c.current instanceof Element && (p = c.current.getBoundingClientRect().width), d.current instanceof Element && (P = d.current.getBoundingClientRect().width),
|
|
163
|
-
const
|
|
162
|
+
if (c.current instanceof Element && (p = c.current.getBoundingClientRect().width), d.current instanceof Element && (P = d.current.getBoundingClientRect().width), x.current instanceof Element && (j = x.current.getBoundingClientRect().width), w.current instanceof Element && (F = w.current.getBoundingClientRect().width), p < P + j + F) {
|
|
163
|
+
const U = e?.tooltip?.render, le = u(U) ? U(o, r, e) : e?.tooltip?.content ?? me(m);
|
|
164
164
|
m = /* @__PURE__ */ s(
|
|
165
|
-
|
|
165
|
+
fe,
|
|
166
166
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
...e?.tooltip,
|
|
168
|
+
className: $(
|
|
169
|
+
`${l}-cell-tooltip`,
|
|
170
|
+
e?.tooltip?.className
|
|
171
|
+
),
|
|
172
|
+
content: le,
|
|
170
173
|
children: m
|
|
171
174
|
}
|
|
172
175
|
);
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
|
-
return
|
|
178
|
+
return ce(() => (N(), () => {
|
|
176
179
|
}), [c.current, d.current]), m;
|
|
177
180
|
}
|
|
178
|
-
const
|
|
181
|
+
const ke = V.memo(he);
|
|
179
182
|
export {
|
|
180
|
-
|
|
183
|
+
ke as default
|
|
181
184
|
};
|
|
@@ -1,46 +1,103 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import X from "
|
|
3
|
-
import { useRef as u, useContext as z, useCallback as o, useEffect as E } from "react";
|
|
1
|
+
import { jsx as h, jsxs as M, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s, useContext as X, useEffect as j } from "react";
|
|
4
3
|
import "../../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import "@unicom-cloud/utils/case-name";
|
|
5
|
+
import z from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import "../../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
7
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
8
|
+
import "../../utils/contextHolder.js";
|
|
9
|
+
import "@unicom-cloud/utils/dayjs";
|
|
10
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
11
|
+
import "../../components/common/utils/dayjs.js";
|
|
12
|
+
import { off as g, on as C } from "../../components/common/utils/dom.js";
|
|
13
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
14
|
+
import "lodash/escapeRegExp";
|
|
15
|
+
import "lodash/isArray";
|
|
16
|
+
import "lodash/isNumber";
|
|
17
|
+
import "lodash/isString";
|
|
18
|
+
import "lodash/isFunction";
|
|
19
|
+
import "lodash/throttle";
|
|
20
|
+
import "../../components/common/utils/is.js";
|
|
21
|
+
import "lodash/camelCase";
|
|
22
|
+
import "lodash/capitalize";
|
|
23
|
+
import "lodash/cloneDeep";
|
|
24
|
+
import "lodash/debounce";
|
|
25
|
+
import "lodash/get";
|
|
26
|
+
import "lodash/has";
|
|
27
|
+
import "lodash/kebabCase";
|
|
28
|
+
import "lodash/merge";
|
|
29
|
+
import "lodash/mergeWith";
|
|
30
|
+
import "lodash/set";
|
|
31
|
+
import "lodash/setWith";
|
|
32
|
+
import "lodash/snakeCase";
|
|
33
|
+
import "lodash/startCase";
|
|
34
|
+
import "lodash/uniq";
|
|
35
|
+
import "lodash/upperFirst";
|
|
36
|
+
import "@unicom-cloud/utils/math";
|
|
37
|
+
import "lodash/isPlainObject";
|
|
38
|
+
import "../../dist/react-transition-group/src/CSSTransition.js";
|
|
39
|
+
import "../../dist/react-transition-group/src/ReplaceTransition.js";
|
|
40
|
+
import "../../dist/react-transition-group/src/SwitchTransition.js";
|
|
41
|
+
import "../../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
42
|
+
import "../../dist/react-transition-group/src/TransitionGroup.js";
|
|
43
|
+
import "../../components/common/utils/reactDOM.js";
|
|
44
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
45
|
+
import "@unicom-cloud/utils/screenfull";
|
|
46
|
+
import "@unicom-cloud/utils/constant/ui.js";
|
|
47
|
+
import "react-is";
|
|
48
|
+
import "@unicom-cloud/utils/tree";
|
|
49
|
+
import { isFunction as E, isPlainObject as T } from "@unicom-cloud/utils/is";
|
|
50
|
+
import "uuid";
|
|
51
|
+
import "../../dist/validate/src/index.js";
|
|
52
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
53
|
+
import { defaultComponent as D } from "../constant.js";
|
|
8
54
|
/* empty css */
|
|
9
|
-
import
|
|
10
|
-
function
|
|
11
|
-
let {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
55
|
+
import F from "../../config-provider/context.js";
|
|
56
|
+
function Bt(b) {
|
|
57
|
+
let {
|
|
58
|
+
className: r,
|
|
59
|
+
children: u,
|
|
60
|
+
column: i,
|
|
61
|
+
onResize: c,
|
|
62
|
+
...w
|
|
63
|
+
} = b;
|
|
64
|
+
const v = D.header.th, f = s(null), x = s(null), o = s({}), { getPrefixCls: R } = X(F), a = R?.("table-th-resizable");
|
|
65
|
+
function l(t) {
|
|
66
|
+
o.current.boundingClientRect = f.current.getBoundingClientRect(), o.current.pageX = t?.pageX ?? 0, n(), N();
|
|
67
|
+
}
|
|
68
|
+
function e(t) {
|
|
69
|
+
n();
|
|
70
|
+
}
|
|
71
|
+
function m(t) {
|
|
72
|
+
let p = o.current.boundingClientRect.width + ((t?.pageX ?? 0) - o.current.pageX);
|
|
73
|
+
p < 0 || (T(i) && (i.width = p), c?.({
|
|
74
|
+
column: i,
|
|
75
|
+
width: p,
|
|
76
|
+
widthOrigin: o.current.boundingClientRect.width
|
|
24
77
|
}));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
78
|
+
}
|
|
79
|
+
function N(t) {
|
|
80
|
+
C(document, "mousemove", m), C(document, "mouseup", e);
|
|
81
|
+
}
|
|
82
|
+
function n(t) {
|
|
83
|
+
g(document, "mousemove", m), g(document, "mouseup", e);
|
|
84
|
+
}
|
|
85
|
+
r = z(r, a), j(() => (l(), m(), e(), () => {
|
|
86
|
+
n();
|
|
87
|
+
}), []);
|
|
88
|
+
let d = u;
|
|
89
|
+
return E(c) && (d = /* @__PURE__ */ M(P, { children: [
|
|
90
|
+
u,
|
|
91
|
+
/* @__PURE__ */ h(
|
|
35
92
|
"div",
|
|
36
93
|
{
|
|
37
94
|
ref: x,
|
|
38
|
-
className: `${
|
|
39
|
-
onMouseDown:
|
|
95
|
+
className: `${a}-cursor`,
|
|
96
|
+
onMouseDown: l
|
|
40
97
|
}
|
|
41
98
|
)
|
|
42
|
-
] });
|
|
99
|
+
] })), /* @__PURE__ */ h(v, { ref: f, ...w, className: r, children: d });
|
|
43
100
|
}
|
|
44
101
|
export {
|
|
45
|
-
|
|
102
|
+
Bt as default
|
|
46
103
|
};
|