@unicom-cloud/ui 0.8.101 → 0.8.103
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/Badge.js +7 -54
- package/Copy.js +6 -5
- package/LiquidFill.js +6 -5
- package/List.js +1 -1
- package/Marquee.js +6 -5
- package/QrCode.js +6 -5
- package/Tooltip.js +3 -4
- package/Tour.js +6 -5
- package/anchor/Anchor.js +12 -12
- package/anchor/util.js +10 -10
- package/back-top/index.js +7 -7
- package/badge/index.js +109 -162
- package/card/index.js +63 -43
- package/color-picker/InputHex.js +3 -4
- package/color-picker/InputRgb.js +7 -8
- package/color-picker/Palette.js +3 -4
- package/color-picker/Panel.js +3 -4
- package/color-picker/colors.js +5 -5
- package/color-picker/hooks/useColorPicker.js +3 -4
- package/color-picker/utils.js +14 -15
- package/components/common/space/index.js +24 -24
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/constant.js +6 -3
- package/components/common/utils/reactDOM.js +6 -4
- package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
- package/components/common/utils/setPrimaryColor.js +18 -18
- package/components/common/utils/setTheme.js +8 -9
- package/copy/index.js +4 -3
- package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
- package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
- package/dist/scroll-into-view-if-needed/src/index.js +19 -19
- package/form/FormItem.js +69 -65
- package/form/context.js +6 -7
- package/grid/Col-.js +86 -0
- package/grid/Col.js +156 -73
- package/grid/Grid.js +71 -67
- package/grid/Row.js +53 -44
- package/grid/index.js +13 -13
- package/index.js +639 -662
- package/input/Textarea.js +1 -1
- package/input/autoSizeTextAreaHeight.js +7 -7
- package/liquid-fill/index.js +6 -5
- package/liquid-fill/interface.js +1 -0
- package/list/index.js +1 -1
- package/marquee/index.js +141 -223
- package/marquee/interface.js +1 -0
- package/marquee-/index.js +260 -0
- package/marquee-/interface.js +1 -0
- package/menu/Item.js +9 -9
- package/package.json +1 -1
- package/qr-code/index.js +6 -5
- package/splitter/SplitBar.js +81 -79
- package/splitter/Splitter.js +70 -78
- package/splitter/hooks/useResizable.js +9 -18
- package/splitter/hooks/useResize.js +10 -10
- package/splitter/hooks/useSizes.js +28 -28
- package/statistic/index.js +10 -10
- package/style.css +1 -1
- package/table/Table.js +369 -370
- package/table/hook/useThResizable.js +6 -5
- package/table/th-resizable/index.js +13 -12
- package/time-picker/util.js +8 -8
- package/tooltip/index.js +1 -2
- package/tour/index.js +6 -5
- package/tour/interface.js +1 -0
- package/tree/NodeList.js +1 -1
- package/types/common/utils/constant.d.ts +1 -0
- package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
- package/types/common/utils/tree.d.ts +1 -0
- package/types/common/utils/tween.d.ts +1 -0
- package/types/pc/anchor/util.d.ts +1 -1
- package/types/pc/badge/interface.d.ts +2 -0
- package/types/pc/card/interface.d.ts +8 -0
- package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
- package/types/pc/color-picker/utils.d.ts +6 -1
- package/types/pc/config-provider/interface.d.ts +8 -8
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/grid/Col-.d.ts +4 -0
- package/types/pc/grid/Col.d.ts +3 -2
- package/types/pc/grid/Grid.d.ts +2 -2
- package/types/pc/grid/Item.d.ts +3 -3
- package/types/pc/grid/Row.d.ts +3 -2
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +13 -7
- package/types/pc/index.d.ts +4 -4
- package/types/pc/liquid-fill/index.d.ts +2 -113
- package/types/pc/liquid-fill/interface.d.ts +113 -0
- package/types/pc/marquee/index.d.ts +3 -60
- package/types/pc/marquee/interface.d.ts +95 -0
- package/types/pc/marquee-/index.d.ts +8 -0
- package/types/pc/marquee-/interface.d.ts +56 -0
- package/types/pc/qr-code/index.d.ts +1 -31
- package/types/pc/qr-code/interface.d.ts +26 -33
- package/types/pc/splitter/SplitBar.d.ts +0 -1
- package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
- package/types/pc/splitter/hooks/useResize.d.ts +1 -2
- package/types/pc/splitter/interface.d.ts +0 -8
- package/types/pc/tour/index.d.ts +2 -45
- package/types/pc/tour/interface.d.ts +46 -0
- package/types/pc/upload/interface.d.ts +1 -0
- package/types/pc/utils/constant.d.ts +1 -2
- package/types/pc/utils/dayjs.d.ts +2 -1
- package/types/pc/utils/index.d.ts +2 -5
- package/types/pc/utils/responsiveObserve.d.ts +8 -4
- package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
- package/types/pc/utils/tree.d.ts +2 -1
- package/types/pc/utils/tween.d.ts +1 -1
- package/typography/Ellipsis.js +6 -5
- package/typography/Operations.js +6 -5
- package/upload/request.js +12 -13
- package/upload/request_.js +2 -3
- package/utils/constant.js +5 -5
- package/utils/dayjs.js +13 -12
- package/utils/index.js +261 -284
- package/utils/responsiveObserve.js +32 -25
- package/utils/scrollIntoViewIfNeeded.js +12 -0
- package/utils/tree.js +11 -9
- package/utils/tween.js +5 -5
- package/version/index.js +1 -1
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/dist/compute-scroll-into-view/src/index.js +0 -126
- package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
- package/dist/tinycolor/customize/index.js +0 -12
- package/dist/tinycolor/src/conversion.js +0 -143
- package/dist/tinycolor/src/css-color-names.js +0 -153
- package/dist/tinycolor/src/format-input.js +0 -77
- package/dist/tinycolor/src/index.js +0 -388
- package/dist/tinycolor/src/util.js +0 -32
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/common/utils/scrollIntoView.d.ts +0 -4
- package/types/common/utils/tinycolor.d.ts +0 -1
- package/types/pc/utils/color.d.ts +0 -1
- package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/pc/utils/scrollIntoView.d.ts +0 -3
- package/types/pc/utils/tinycolor.d.ts +0 -1
- package/utils/color.js +0 -4
- package/utils/computeScrollIntoView.js +0 -6
- package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/utils/scrollIntoView.js +0 -6
- package/utils/tinycolor.js +0 -29
package/grid/Grid.js
CHANGED
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import A from "lodash/get";
|
|
3
|
+
import B from "lodash/isArray";
|
|
4
|
+
import n from "lodash/isNil";
|
|
5
|
+
import g, { forwardRef as Q, useState as V, useContext as k } from "react";
|
|
4
6
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { GridDataCollectorContext as
|
|
8
|
-
import { useResponsiveState as
|
|
9
|
-
import { setItemVisible as
|
|
10
|
-
import
|
|
11
|
-
const
|
|
7
|
+
import q from "../components/common/hooks/useMergeProps.js";
|
|
8
|
+
import z from "@unicom-cloud/utils/class-name";
|
|
9
|
+
import { GridDataCollectorContext as F, GridContext as H } from "./context.js";
|
|
10
|
+
import { useResponsiveState as m } from "./hook/useResponsiveState.js";
|
|
11
|
+
import { setItemVisible as J } from "./util.js";
|
|
12
|
+
import K from "../config-provider/context.js";
|
|
13
|
+
const O = {
|
|
12
14
|
collapsed: !1,
|
|
13
15
|
collapsedRows: 1,
|
|
14
16
|
cols: 24,
|
|
15
|
-
|
|
16
|
-
rowGap: 0
|
|
17
|
+
gap: 0
|
|
17
18
|
};
|
|
18
|
-
function
|
|
19
|
-
const [
|
|
19
|
+
function U(w, _) {
|
|
20
|
+
const [o, c] = V(
|
|
20
21
|
/* @__PURE__ */ new Map()
|
|
21
|
-
), { getPrefixCls:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
), { getPrefixCls: I, componentConfig: N, rtl: D } = k(K), v = q(
|
|
23
|
+
w,
|
|
24
|
+
O,
|
|
25
|
+
N?.Grid
|
|
25
26
|
), {
|
|
26
|
-
children:
|
|
27
|
-
className:
|
|
28
|
-
style:
|
|
29
|
-
cols:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
children: y,
|
|
28
|
+
className: R,
|
|
29
|
+
style: M,
|
|
30
|
+
cols: P,
|
|
31
|
+
gap: t,
|
|
32
|
+
colGap: f,
|
|
33
|
+
rowGap: d,
|
|
34
|
+
collapsed: G,
|
|
35
|
+
collapsedRows: $
|
|
36
|
+
} = v;
|
|
37
|
+
let r, a;
|
|
38
|
+
const L = n(t), h = n(d), S = n(f);
|
|
39
|
+
L || (B(t) ? (r = t[0], a = t[1] ?? t[0]) : r = a = t), h || (r = d), S || (a = f);
|
|
40
|
+
const l = m(P, 24), u = m(a, 0), E = {
|
|
41
|
+
gap: `${m(r, 0)}px ${u}px`,
|
|
42
|
+
gridTemplateColumns: `repeat(${l}, minmax(0px, 1fr))`
|
|
43
|
+
}, x = I?.("grid"), T = {
|
|
44
|
+
[`${x}`]: !0,
|
|
45
|
+
[`${x}-rtl`]: D
|
|
46
|
+
}, b = z(T, R), j = (() => {
|
|
41
47
|
const e = [];
|
|
42
|
-
for (const [
|
|
43
|
-
e[
|
|
48
|
+
for (const [s, p] of o.entries())
|
|
49
|
+
e[s] = p;
|
|
44
50
|
return e;
|
|
45
|
-
})(),
|
|
46
|
-
cols:
|
|
47
|
-
collapsed:
|
|
48
|
-
collapsedRows:
|
|
49
|
-
itemDataList:
|
|
51
|
+
})(), C = J({
|
|
52
|
+
cols: l,
|
|
53
|
+
collapsed: G,
|
|
54
|
+
collapsedRows: $,
|
|
55
|
+
itemDataList: j
|
|
50
56
|
});
|
|
51
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ i(
|
|
52
58
|
"div",
|
|
53
59
|
{
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
60
|
+
ref: _,
|
|
61
|
+
className: b,
|
|
56
62
|
style: {
|
|
57
|
-
...
|
|
58
|
-
...
|
|
63
|
+
...E,
|
|
64
|
+
...M
|
|
59
65
|
},
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
|
|
66
|
+
children: /* @__PURE__ */ i(
|
|
67
|
+
F.Provider,
|
|
62
68
|
{
|
|
63
69
|
value: {
|
|
64
|
-
collectItemData(e,
|
|
65
|
-
|
|
70
|
+
collectItemData(e, s) {
|
|
71
|
+
o.set(e, s), c(new Map([...o]));
|
|
66
72
|
},
|
|
67
73
|
removeItemData(e) {
|
|
68
|
-
|
|
74
|
+
o.delete(e), c(new Map([...o]));
|
|
69
75
|
}
|
|
70
76
|
},
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
|
|
77
|
+
children: /* @__PURE__ */ i(
|
|
78
|
+
H.Provider,
|
|
73
79
|
{
|
|
74
80
|
value: {
|
|
75
|
-
cols:
|
|
76
|
-
colGap:
|
|
77
|
-
collapsed:
|
|
78
|
-
overflow:
|
|
79
|
-
displayIndexList:
|
|
81
|
+
cols: l,
|
|
82
|
+
colGap: u,
|
|
83
|
+
collapsed: G,
|
|
84
|
+
overflow: C.overflow,
|
|
85
|
+
displayIndexList: C.displayIndexList
|
|
80
86
|
},
|
|
81
|
-
children:
|
|
87
|
+
children: g.Children.map(y, (e, s) => {
|
|
82
88
|
if (e) {
|
|
83
|
-
const
|
|
84
|
-
__index__:
|
|
89
|
+
const p = {
|
|
90
|
+
__index__: s,
|
|
85
91
|
...e.props
|
|
86
92
|
};
|
|
87
|
-
return
|
|
93
|
+
return g.cloneElement(e, p);
|
|
88
94
|
}
|
|
89
95
|
return null;
|
|
90
|
-
}).filter(
|
|
91
|
-
(e) => L(e, "type.__PQB_GRID_ITEM__")
|
|
92
|
-
)
|
|
96
|
+
}).filter((e) => A(e, "type.__PQB_GRID_ITEM__"))
|
|
93
97
|
}
|
|
94
98
|
)
|
|
95
99
|
}
|
|
@@ -97,8 +101,8 @@ function q(f, u) {
|
|
|
97
101
|
}
|
|
98
102
|
);
|
|
99
103
|
}
|
|
100
|
-
const
|
|
101
|
-
|
|
104
|
+
const W = Q(U);
|
|
105
|
+
W.displayName = "Grid";
|
|
102
106
|
export {
|
|
103
|
-
|
|
107
|
+
W as default
|
|
104
108
|
};
|
package/grid/Row.js
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useContext as G, useState as H, useRef as U, useEffect as V } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
4
|
import B from "../components/common/hooks/useMergeProps.js";
|
|
5
5
|
import E from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import "../components/common/utils/is.js";
|
|
6
7
|
import { omit as L } from "../components/common/utils/omit.js";
|
|
7
|
-
import { responsiveObserve as
|
|
8
|
+
import { responsiveObserve as x, responsiveArray as y } from "../utils/responsiveObserve.js";
|
|
8
9
|
import { RowContext as M } from "./context.js";
|
|
9
|
-
import
|
|
10
|
-
|
|
10
|
+
import T from "../config-provider/context.js";
|
|
11
|
+
import { isPlainObject as f, isArray as b, isObject as q } from "@unicom-cloud/utils/is";
|
|
12
|
+
const D = {
|
|
11
13
|
gutter: 0,
|
|
12
14
|
align: "start",
|
|
13
15
|
justify: "start"
|
|
14
16
|
};
|
|
15
|
-
function
|
|
16
|
-
const { getPrefixCls:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
), {
|
|
17
|
+
function F(v, C) {
|
|
18
|
+
const { getPrefixCls: R, componentConfig: $, rtl: j } = G(T), w = B(
|
|
19
|
+
v,
|
|
20
|
+
D,
|
|
21
|
+
$?.["Grid.Row"]
|
|
22
|
+
), {
|
|
23
|
+
className: N,
|
|
24
|
+
style: P,
|
|
25
|
+
children: h,
|
|
26
|
+
div: i,
|
|
27
|
+
align: u,
|
|
28
|
+
justify: p,
|
|
29
|
+
gutter: r = 0,
|
|
30
|
+
...A
|
|
31
|
+
} = w, [k, O] = H({
|
|
21
32
|
xs: !0,
|
|
22
33
|
sm: !0,
|
|
23
34
|
md: !0,
|
|
@@ -25,63 +36,61 @@ function q(d, b) {
|
|
|
25
36
|
xl: !0,
|
|
26
37
|
xxl: !0,
|
|
27
38
|
xxxl: !0
|
|
28
|
-
}),
|
|
29
|
-
V(() => (
|
|
30
|
-
(
|
|
39
|
+
}), n = U();
|
|
40
|
+
V(() => (n.current = x.subscribe((t) => {
|
|
41
|
+
(f(r) || Array.isArray(r) && (f(r[0]) || f(r[1]))) && O(t);
|
|
31
42
|
}), () => {
|
|
32
|
-
|
|
43
|
+
n.current && x.unsubscribe(n.current);
|
|
33
44
|
}), []);
|
|
34
|
-
function
|
|
45
|
+
function g(t) {
|
|
35
46
|
let e = 0;
|
|
36
|
-
if (
|
|
37
|
-
for (let c = 0; c <
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
e =
|
|
47
|
+
if (q(t))
|
|
48
|
+
for (let c = 0; c < y.length; c++) {
|
|
49
|
+
const l = y[c];
|
|
50
|
+
if (k[l] && t[l] !== void 0) {
|
|
51
|
+
e = t[l];
|
|
41
52
|
break;
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
55
|
else
|
|
45
|
-
e =
|
|
56
|
+
e = t;
|
|
46
57
|
return e;
|
|
47
58
|
}
|
|
48
|
-
const s =
|
|
59
|
+
const s = R?.("row"), S = E(
|
|
49
60
|
{
|
|
50
61
|
[`${s}`]: !i,
|
|
51
|
-
[`${s}-align-${
|
|
52
|
-
[`${s}-justify-${
|
|
53
|
-
[`${s}-rtl`]:
|
|
62
|
+
[`${s}-align-${u}`]: u,
|
|
63
|
+
[`${s}-justify-${p}`]: p,
|
|
64
|
+
[`${s}-rtl`]: j
|
|
54
65
|
},
|
|
55
|
-
|
|
56
|
-
), o = {},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const r = -n / 2, e = -a / 2;
|
|
61
|
-
r && (o.marginLeft = r, o.marginRight = r), e && (o.marginTop = e, o.marginBottom = e);
|
|
66
|
+
N
|
|
67
|
+
), o = {}, a = g(b(r) ? r[0] : r), m = g(b(r) ? r[1] : 0);
|
|
68
|
+
if ((a || m) && !i) {
|
|
69
|
+
const t = -a / 2, e = -m / 2;
|
|
70
|
+
t && (o.marginLeft = t, o.marginRight = t), e && (o.marginTop = e, o.marginBottom = e);
|
|
62
71
|
}
|
|
63
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ d(
|
|
64
73
|
"div",
|
|
65
74
|
{
|
|
66
|
-
ref:
|
|
67
|
-
...L(
|
|
75
|
+
ref: C,
|
|
76
|
+
...L(A, ["gutter"]),
|
|
68
77
|
style: {
|
|
69
|
-
...
|
|
78
|
+
...P,
|
|
70
79
|
...o
|
|
71
80
|
},
|
|
72
|
-
className:
|
|
73
|
-
children: /* @__PURE__ */
|
|
81
|
+
className: S,
|
|
82
|
+
children: /* @__PURE__ */ d(
|
|
74
83
|
M.Provider,
|
|
75
84
|
{
|
|
76
|
-
value: { gutter: [
|
|
77
|
-
children:
|
|
85
|
+
value: { gutter: [a, m], div: i },
|
|
86
|
+
children: h
|
|
78
87
|
}
|
|
79
88
|
)
|
|
80
89
|
}
|
|
81
90
|
);
|
|
82
91
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
92
|
+
const I = z(F);
|
|
93
|
+
I.displayName = "Row";
|
|
85
94
|
export {
|
|
86
|
-
|
|
95
|
+
I as default
|
|
87
96
|
};
|
package/grid/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const o =
|
|
6
|
-
o.Col =
|
|
7
|
-
o.Row =
|
|
8
|
-
o.Item =
|
|
1
|
+
import r from "./Col.js";
|
|
2
|
+
import m from "./Grid.js";
|
|
3
|
+
import i from "./Item.js";
|
|
4
|
+
import t from "./Row.js";
|
|
5
|
+
const o = m;
|
|
6
|
+
o.Col = r;
|
|
7
|
+
o.Row = t;
|
|
8
|
+
o.Item = i;
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
r as Col,
|
|
11
|
+
r as GridCol,
|
|
12
|
+
i as GridItem,
|
|
13
|
+
t as GridRow,
|
|
14
|
+
t as Row,
|
|
15
15
|
o as default
|
|
16
16
|
};
|