@unicom-cloud/ui 0.8.105 → 0.8.107
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/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- package/Modal.js +4 -2
- package/Segmented.js +4 -2
- package/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- package/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- package/package.json +1 -1
- package/segmented/index.js +93 -90
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- package/types/pc/segmented/interface.d.ts +6 -0
- package/types/pc/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import x from "
|
|
2
|
-
import
|
|
3
|
-
import { responsiveObserve as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useRef as m, useState as p, useEffect as b, useMemo as x } from "react";
|
|
2
|
+
import "../../components/common/utils/is.js";
|
|
3
|
+
import { responsiveObserve as u, responsiveArray as c } from "../../utils/responsiveObserve.js";
|
|
4
|
+
import { isString as k, isNumber as R, isPlainObject as S } from "@unicom-cloud/utils/is";
|
|
5
|
+
function O(e) {
|
|
6
|
+
return k(e) || R(e) ? !1 : S(e) && Object.keys(e).some((s) => c.some((r) => s === r));
|
|
6
7
|
}
|
|
7
|
-
const
|
|
8
|
-
const
|
|
8
|
+
const A = (e, s) => {
|
|
9
|
+
const r = O(e), n = m(), [o, f] = p({
|
|
9
10
|
xs: !0,
|
|
10
11
|
sm: !0,
|
|
11
12
|
md: !0,
|
|
@@ -14,25 +15,21 @@ const h = (e, n, u = !1) => {
|
|
|
14
15
|
xxl: !0,
|
|
15
16
|
xxxl: !0
|
|
16
17
|
});
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
}), () => {
|
|
20
|
-
|
|
21
|
-
}), []),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
18
|
+
return b(() => (r && (n.current = u.subscribe((t) => {
|
|
19
|
+
f(t);
|
|
20
|
+
})), () => {
|
|
21
|
+
r && n.current && u.unsubscribe(n.current);
|
|
22
|
+
}), [r]), x(() => {
|
|
23
|
+
if (!e || !r) return e;
|
|
24
|
+
let t = s;
|
|
25
|
+
for (const i of c)
|
|
26
|
+
if (o[i] && e[i] !== void 0) {
|
|
27
|
+
t = e[i];
|
|
28
|
+
break;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return r;
|
|
34
|
-
}, [i, e, n, u]);
|
|
30
|
+
return t;
|
|
31
|
+
}, [s, r, o, e]);
|
|
35
32
|
};
|
|
36
33
|
export {
|
|
37
|
-
|
|
34
|
+
A as useResponsiveState
|
|
38
35
|
};
|
package/grid/util.js
CHANGED
|
@@ -1,51 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
1
|
+
function f(n, { span: a, offset: e }) {
|
|
2
|
+
const t = a ?? 1, i = e ?? 0, o = Math.min(i, n);
|
|
3
3
|
return {
|
|
4
4
|
span: Math.min(
|
|
5
|
-
o > 0 ?
|
|
6
|
-
|
|
5
|
+
o > 0 ? t + i : t,
|
|
6
|
+
n
|
|
7
7
|
),
|
|
8
|
-
offset: o
|
|
9
|
-
suffix: e
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function c({
|
|
13
|
-
cols: l,
|
|
14
|
-
collapsed: t,
|
|
15
|
-
collapsedRows: u,
|
|
16
|
-
itemDataList: e
|
|
17
|
-
}) {
|
|
18
|
-
let i = !1, f = [];
|
|
19
|
-
function o(s) {
|
|
20
|
-
return Math.ceil(s / l) > u;
|
|
21
|
-
}
|
|
22
|
-
if (t) {
|
|
23
|
-
let s = 0;
|
|
24
|
-
for (let n = 0; n < e.length; n++)
|
|
25
|
-
e[n].suffix && (s += e[n].span, f.push(n));
|
|
26
|
-
if (!o(s)) {
|
|
27
|
-
let n = 0;
|
|
28
|
-
for (; n < e.length; ) {
|
|
29
|
-
const r = e[n];
|
|
30
|
-
if (!r.suffix) {
|
|
31
|
-
if (s += r.span, o(s))
|
|
32
|
-
break;
|
|
33
|
-
f.push(n);
|
|
34
|
-
}
|
|
35
|
-
n++;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
i = e.some(
|
|
39
|
-
(n, r) => !n.suffix && !f.includes(r)
|
|
40
|
-
);
|
|
41
|
-
} else
|
|
42
|
-
f = e.map((s, n) => n);
|
|
43
|
-
return {
|
|
44
|
-
overflow: i,
|
|
45
|
-
displayIndexList: f
|
|
8
|
+
offset: o
|
|
46
9
|
};
|
|
47
10
|
}
|
|
48
11
|
export {
|
|
49
|
-
|
|
50
|
-
c as setItemVisible
|
|
12
|
+
f as resolveItemData
|
|
51
13
|
};
|