@unicom-cloud/ui 0.8.102 → 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/Copy.js +1 -1
- package/LiquidFill.js +1 -1
- package/Marquee.js +2 -2
- package/QrCode.js +1 -1
- package/Tour.js +1 -1
- package/components/common/space/index.js +24 -24
- package/copy/index.js +1 -1
- package/grid/Col.js +32 -32
- package/grid/Row.js +53 -44
- package/liquid-fill/index.js +1 -1
- package/liquid-fill/interface.js +1 -0
- package/marquee/index.js +138 -221
- package/marquee/interface.js +1 -0
- package/marquee-/index.js +260 -0
- package/marquee-/interface.js +1 -0
- package/package.json +1 -1
- package/qr-code/index.js +1 -1
- package/style.css +1 -1
- package/table/hook/useThResizable.js +1 -1
- package/table/th-resizable/index.js +1 -1
- package/tour/index.js +1 -1
- package/tour/interface.js +1 -0
- package/types/pc/config-provider/interface.d.ts +8 -8
- package/types/pc/grid/Row.d.ts +2 -1
- 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/tour/index.d.ts +2 -45
- package/types/pc/tour/interface.d.ts +46 -0
- package/types/pc/utils/responsiveObserve.d.ts +8 -4
- package/typography/Ellipsis.js +1 -1
- package/typography/Operations.js +1 -1
- package/utils/responsiveObserve.js +32 -25
- package/version/index.js +1 -1
|
@@ -1,39 +1,32 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
export interface QRCodeProps {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 二维码尺寸(像素)
|
|
8
|
-
* @default 160
|
|
9
|
-
*/
|
|
3
|
+
/** 二维码内容 (必填) */
|
|
4
|
+
value: string;
|
|
5
|
+
/** 渲染模式 */
|
|
6
|
+
renderAs?: 'svg' | 'canvas';
|
|
7
|
+
/** 二维码尺寸(像素) */
|
|
10
8
|
size?: number;
|
|
11
|
-
/**
|
|
12
|
-
* 二维码颜色
|
|
13
|
-
* @default '#000000'
|
|
14
|
-
*/
|
|
15
|
-
color?: string;
|
|
16
|
-
/**
|
|
17
|
-
* 二维码背景色
|
|
18
|
-
* @default '#ffffff'
|
|
19
|
-
*/
|
|
20
|
-
bgColor?: string;
|
|
21
|
-
/**
|
|
22
|
-
* 是否有边框
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
9
|
+
/** 是否显示边框 */
|
|
25
10
|
bordered?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* 容错级别
|
|
28
|
-
* @default 'M'
|
|
29
|
-
*/
|
|
11
|
+
/** 容错级别 */
|
|
30
12
|
errorLevel?: 'L' | 'M' | 'Q' | 'H';
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
/** 前景色(二维码点颜色) */
|
|
14
|
+
fgColor?: string;
|
|
15
|
+
/** 背景色 */
|
|
16
|
+
bgColor?: string;
|
|
17
|
+
/** 边距大小(像素) */
|
|
18
|
+
marginSize?: number;
|
|
19
|
+
/** 中心图标设置 */
|
|
20
|
+
imageSettings?: {
|
|
21
|
+
src: string;
|
|
22
|
+
height: number;
|
|
23
|
+
width: number;
|
|
24
|
+
excavate: boolean;
|
|
25
|
+
x?: number;
|
|
26
|
+
y?: number;
|
|
27
|
+
};
|
|
28
|
+
/** 自定义类名 */
|
|
38
29
|
className?: string;
|
|
30
|
+
/** 自定义样式 */
|
|
31
|
+
style?: React.CSSProperties;
|
|
39
32
|
}
|
package/types/pc/tour/index.d.ts
CHANGED
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
type
|
|
3
|
-
type TourType = 'default' | 'primary';
|
|
4
|
-
export interface TourStep {
|
|
5
|
-
/** 目标元素 (选择器字符串或DOM元素) */
|
|
6
|
-
target: string | HTMLElement;
|
|
7
|
-
/** 标题内容 */
|
|
8
|
-
title?: React.ReactNode;
|
|
9
|
-
/** 描述内容 */
|
|
10
|
-
description?: React.ReactNode;
|
|
11
|
-
/** 初始弹出位置 (会自动调整) */
|
|
12
|
-
placement?: Placement;
|
|
13
|
-
}
|
|
14
|
-
export interface TourProps {
|
|
15
|
-
/** 自定义样式 */
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
/** 自定义类名 */
|
|
18
|
-
className?: string | string[];
|
|
19
|
-
/** 引导步骤数组 */
|
|
20
|
-
steps: TourStep[];
|
|
21
|
-
/** 是否显示引导 */
|
|
22
|
-
open?: boolean;
|
|
23
|
-
/** 关闭回调 */
|
|
24
|
-
onClose?: () => void;
|
|
25
|
-
/** 是否显示遮罩 */
|
|
26
|
-
mask?: boolean;
|
|
27
|
-
/** 点击遮罩是否关闭 */
|
|
28
|
-
maskClosable?: boolean;
|
|
29
|
-
/** 引导类型 (default/primary) */
|
|
30
|
-
type?: TourType;
|
|
31
|
-
/** 默认弹出位置 */
|
|
32
|
-
placement?: Placement;
|
|
33
|
-
/** 是否显示箭头 */
|
|
34
|
-
arrow?: boolean;
|
|
35
|
-
/** 是否显示关闭按钮 */
|
|
36
|
-
closable?: boolean;
|
|
37
|
-
/** 层级 */
|
|
38
|
-
zIndex?: number;
|
|
39
|
-
/** 当前步骤索引 */
|
|
40
|
-
current?: number;
|
|
41
|
-
/** 完成回调 */
|
|
42
|
-
onFinish?: () => void;
|
|
43
|
-
/** 步骤改变回调 */
|
|
44
|
-
onStepChange?: (current: number) => void;
|
|
45
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TourProps } from './interface';
|
|
46
3
|
declare function Tour(baseProps: TourProps): React.ReactElement | null;
|
|
47
4
|
export default Tour;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
|
+
export type Placement = 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
+
export type TourType = 'default' | 'primary';
|
|
5
|
+
export interface TourStep {
|
|
6
|
+
/** 目标元素 (选择器字符串或DOM元素) */
|
|
7
|
+
target: string | HTMLElement;
|
|
8
|
+
/** 标题内容 */
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
/** 描述内容 */
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
/** 初始弹出位置 (会自动调整) */
|
|
13
|
+
placement?: Placement;
|
|
14
|
+
}
|
|
15
|
+
export interface TourProps {
|
|
16
|
+
/** 自定义样式 */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
/** 自定义类名 */
|
|
19
|
+
className?: string | string[];
|
|
20
|
+
/** 引导步骤数组 */
|
|
21
|
+
steps: TourStep[];
|
|
22
|
+
/** 是否显示引导 */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/** 关闭回调 */
|
|
25
|
+
onClose?: () => void;
|
|
26
|
+
/** 是否显示遮罩 */
|
|
27
|
+
mask?: boolean;
|
|
28
|
+
/** 点击遮罩是否关闭 */
|
|
29
|
+
maskClosable?: boolean;
|
|
30
|
+
/** 引导类型 (default/primary) */
|
|
31
|
+
type?: TourType;
|
|
32
|
+
/** 默认弹出位置 */
|
|
33
|
+
placement?: Placement;
|
|
34
|
+
/** 是否显示箭头 */
|
|
35
|
+
arrow?: boolean;
|
|
36
|
+
/** 是否显示关闭按钮 */
|
|
37
|
+
closable?: boolean;
|
|
38
|
+
/** 层级 */
|
|
39
|
+
zIndex?: number;
|
|
40
|
+
/** 当前步骤索引 */
|
|
41
|
+
current?: number;
|
|
42
|
+
/** 完成回调 */
|
|
43
|
+
onFinish?: () => void;
|
|
44
|
+
/** 步骤改变回调 */
|
|
45
|
+
onStepChange?: (current: number) => void;
|
|
46
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export type Breakpoint = 'xxxl' | 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
2
|
-
export type BreakpointMap =
|
|
2
|
+
export type BreakpointMap = Record<Breakpoint, string>;
|
|
3
3
|
export type ScreenMap = Partial<Record<Breakpoint, boolean>>;
|
|
4
4
|
export declare const responsiveArray: Breakpoint[];
|
|
5
5
|
export declare const responsiveMap: BreakpointMap;
|
|
6
|
-
type SubscribeFunc = (screens: ScreenMap, breakpointChecked: Breakpoint) => void;
|
|
6
|
+
type SubscribeFunc = (screens: ScreenMap, breakpointChecked: Breakpoint | null) => void;
|
|
7
|
+
type MatchHandler = {
|
|
8
|
+
mql: MediaQueryList;
|
|
9
|
+
listener: (this: MediaQueryList, ev: MediaQueryListEvent) => void;
|
|
10
|
+
};
|
|
7
11
|
declare const responsiveObserve: {
|
|
8
|
-
matchHandlers:
|
|
9
|
-
dispatch(pointMap: ScreenMap, breakpointChecked: Breakpoint): boolean;
|
|
12
|
+
matchHandlers: Record<string, MatchHandler>;
|
|
13
|
+
dispatch(pointMap: ScreenMap, breakpointChecked: Breakpoint | null): boolean;
|
|
10
14
|
subscribe(func: SubscribeFunc): string;
|
|
11
15
|
unsubscribe(token: string): void;
|
|
12
16
|
unregister(): void;
|
package/typography/Ellipsis.js
CHANGED
|
@@ -45,6 +45,7 @@ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
|
45
45
|
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
46
46
|
import "../components/common/utils/reactDOM.js";
|
|
47
47
|
import { resizeObserver as it } from "../components/common/utils/resizeObserver.js";
|
|
48
|
+
import "uuid";
|
|
48
49
|
import "@unicom-cloud/utils/file/saveAs";
|
|
49
50
|
import "@unicom-cloud/utils/screenfull";
|
|
50
51
|
import "@unicom-cloud/utils/tinycolor";
|
|
@@ -55,7 +56,6 @@ import { throttleByRaf as nt } from "../components/common/utils/throttleByRaf.js
|
|
|
55
56
|
import "react-is";
|
|
56
57
|
import "@unicom-cloud/utils/tree";
|
|
57
58
|
import { isPlainObject as b, isFunction as st } from "@unicom-cloud/utils/is";
|
|
58
|
-
import "uuid";
|
|
59
59
|
import "../dist/validate/src/index.js";
|
|
60
60
|
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
61
61
|
import lt from "../config-provider/context.js";
|
package/typography/Operations.js
CHANGED
|
@@ -44,6 +44,7 @@ import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
|
44
44
|
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
45
45
|
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
46
46
|
import "../components/common/utils/reactDOM.js";
|
|
47
|
+
import "uuid";
|
|
47
48
|
import "@unicom-cloud/utils/file/saveAs";
|
|
48
49
|
import "@unicom-cloud/utils/screenfull";
|
|
49
50
|
import "@unicom-cloud/utils/tinycolor";
|
|
@@ -52,7 +53,6 @@ import "@unicom-cloud/utils/constant/ui.js";
|
|
|
52
53
|
import "react-is";
|
|
53
54
|
import "@unicom-cloud/utils/tree";
|
|
54
55
|
import { isFunction as K } from "@unicom-cloud/utils/is";
|
|
55
|
-
import "uuid";
|
|
56
56
|
import "../dist/validate/src/index.js";
|
|
57
57
|
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
58
58
|
function Bo(u) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { v4 as a } from "uuid";
|
|
2
|
+
const m = [
|
|
2
3
|
"xxxl",
|
|
3
4
|
"xxl",
|
|
4
5
|
"xl",
|
|
@@ -6,7 +7,7 @@ const c = [
|
|
|
6
7
|
"md",
|
|
7
8
|
"sm",
|
|
8
9
|
"xs"
|
|
9
|
-
],
|
|
10
|
+
], h = {
|
|
10
11
|
xs: "(max-width: 575px)",
|
|
11
12
|
sm: "(min-width: 576px)",
|
|
12
13
|
md: "(min-width: 768px)",
|
|
@@ -15,52 +16,58 @@ const c = [
|
|
|
15
16
|
xxl: "(min-width: 1600px)",
|
|
16
17
|
xxxl: "(min-width: 2000px)"
|
|
17
18
|
};
|
|
18
|
-
let i = [],
|
|
19
|
-
const
|
|
19
|
+
let i = [], n = {};
|
|
20
|
+
const x = {
|
|
20
21
|
matchHandlers: {},
|
|
21
22
|
dispatch(e, t) {
|
|
22
|
-
return
|
|
23
|
-
s.func(
|
|
23
|
+
return n = e, i.length < 1 ? !1 : (i.forEach((s) => {
|
|
24
|
+
s.func(n, t);
|
|
24
25
|
}), !0);
|
|
25
26
|
},
|
|
26
27
|
subscribe(e) {
|
|
27
28
|
i.length === 0 && this.register();
|
|
28
|
-
const t =
|
|
29
|
+
const t = a();
|
|
29
30
|
return i.push({
|
|
30
31
|
token: t,
|
|
31
32
|
func: e
|
|
32
|
-
}), e(
|
|
33
|
+
}), e(n, null), t;
|
|
33
34
|
},
|
|
34
35
|
unsubscribe(e) {
|
|
35
36
|
i = i.filter((t) => t.token !== e), i.length === 0 && this.unregister();
|
|
36
37
|
},
|
|
37
38
|
unregister() {
|
|
38
|
-
Object.
|
|
39
|
-
const
|
|
40
|
-
s && s.mql && s.listener && s.mql.
|
|
41
|
-
});
|
|
39
|
+
Object.entries(h).forEach(([e, t]) => {
|
|
40
|
+
const s = this.matchHandlers[t];
|
|
41
|
+
s && s.mql && s.listener && s.mql.removeEventListener("change", s.listener);
|
|
42
|
+
}), this.matchHandlers = {};
|
|
42
43
|
},
|
|
43
44
|
register() {
|
|
44
|
-
Object.
|
|
45
|
-
const
|
|
45
|
+
Object.entries(h).forEach(([e, t]) => {
|
|
46
|
+
const s = window.matchMedia(t), r = (l) => {
|
|
46
47
|
this.dispatch(
|
|
47
48
|
{
|
|
48
|
-
...
|
|
49
|
-
[e]: l
|
|
49
|
+
...n,
|
|
50
|
+
[e]: l.matches
|
|
50
51
|
},
|
|
51
52
|
e
|
|
52
53
|
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
mql:
|
|
56
|
-
listener:
|
|
57
|
-
},
|
|
54
|
+
};
|
|
55
|
+
s.addEventListener("change", r), this.matchHandlers[t] = {
|
|
56
|
+
mql: s,
|
|
57
|
+
listener: r
|
|
58
|
+
}, this.dispatch(
|
|
59
|
+
{
|
|
60
|
+
...n,
|
|
61
|
+
[e]: s.matches
|
|
62
|
+
},
|
|
63
|
+
e
|
|
64
|
+
);
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
};
|
|
61
68
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
x as default,
|
|
70
|
+
m as responsiveArray,
|
|
71
|
+
h as responsiveMap,
|
|
72
|
+
x as responsiveObserve
|
|
66
73
|
};
|
package/version/index.js
CHANGED