@unicom-cloud/ui 0.8.106 → 0.8.108
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/ColorPicker.js +15 -14
- package/Constant.js +4 -0
- package/Copy.js +4 -3
- package/Countdown.js +25 -0
- package/Grid.js +8 -10
- package/LiquidFill.js +4 -3
- package/List.js +7 -6
- package/Marquee.js +4 -3
- package/Modal.js +4 -2
- package/PageHeader.js +3 -2
- package/QrCode.js +4 -3
- package/RowCol.js +8 -0
- package/Segmented.js +14 -4
- package/Statistic.js +5 -4
- package/Tour.js +4 -3
- package/Transfer.js +4 -2
- package/anchor/Link.js +1 -1
- 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/avatar/Group.js +1 -1
- package/back-top/index.js +44 -56
- package/button/index.js +52 -51
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/cascader/base/node.js +22 -20
- package/cascader/base/store.js +10 -10
- package/cascader/util.js +29 -27
- package/color-picker/Mode.js +8 -7
- package/color-picker/hooks/useColorPicker.js +56 -55
- package/color-picker/index.js +49 -48
- package/color-picker/utils.js +58 -57
- package/components/common/empty/index.js +2 -2
- package/components/common/flex/index.js +64 -55
- package/components/common/flex/interface.js +6 -6
- package/components/common/hooks/useInterval.js +6 -6
- package/components/common/icons/file/index.js +13 -11
- package/components/common/space/index.js +53 -53
- package/components/common/utils/dayjs.js +114 -126
- 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/components/common/utils/toArray.js +7 -5
- package/config-provider/ConfigProvider.js +32 -30
- package/constant/index.js +4 -0
- package/copy/index.js +2 -1
- package/countdown/index.js +113 -0
- package/countdown/interface.js +1 -0
- package/countdown/util.js +29 -0
- package/descriptions/index.js +45 -45
- package/divider/index.js +28 -20
- package/dropdown/Button.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +30 -29
- package/form/FormItem.js +126 -122
- package/grid/Grid.js +56 -90
- package/grid/Item.js +44 -65
- package/grid/context.js +2 -6
- package/grid/index.js +6 -8
- package/grid/util.js +6 -44
- package/hooks/useResponsiveState.js +54 -0
- package/index.js +614 -605
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/InputElement.js +25 -24
- package/input/Search.js +24 -24
- package/layout/Sider.js +1 -1
- package/liquid-fill/index.js +4 -3
- package/list/Item.js +21 -21
- package/list/index.js +53 -52
- package/marquee/index.js +20 -19
- package/marquee-/index.js +4 -3
- package/mentions/util.js +9 -8
- 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/page-header/index.js +57 -56
- package/pagination/Pagination.js +89 -92
- package/qr-code/index.js +4 -3
- package/radio/Group.js +1 -1
- package/row-col/Col-.js +88 -0
- package/row-col/Col.js +159 -0
- package/row-col/Row.js +73 -0
- package/row-col/context.js +5 -0
- package/row-col/index.js +11 -0
- package/row-col/interface.js +1 -0
- package/segmented/index.js +257 -206
- package/select/Select.js +191 -191
- package/select/util.js +50 -50
- package/select-view/Core.js +31 -28
- package/space/index.js +15 -13
- package/splitter/SplitBar.js +44 -46
- package/statistic/index.js +56 -55
- package/statistic/interface.js +4 -1
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/hook/useColumns.js +27 -26
- package/table/hook/useStickyClassNames.js +9 -8
- package/table/hook/useThResizable.js +4 -3
- package/table/th-resizable/index.js +2 -2
- package/table/thead/index.js +18 -16
- package/time-picker/util.js +20 -30
- package/timeline/Item.js +1 -1
- package/tour/index.js +4 -3
- package/transfer/index.js +93 -91
- package/trigger/index.js +66 -66
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/flex/index.d.ts +3 -9
- package/types/common/flex/interface.d.ts +15 -4
- package/types/common/space/index.d.ts +3 -5
- package/types/common/space/interface.d.ts +2 -0
- package/types/common/utils/dayjs.d.ts +3 -1
- 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/button/interface.d.ts +2 -2
- 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 +17 -12
- package/types/pc/constant/index.d.ts +1 -0
- package/types/pc/countdown/interface.d.ts +65 -0
- package/types/pc/countdown/util.d.ts +7 -0
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/flex/index.d.ts +8 -6
- package/types/pc/flex/interface.d.ts +3 -10
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/form/interface.d.ts +1 -1
- package/types/pc/grid/Grid.d.ts +2 -4
- package/types/pc/grid/Item.d.ts +1 -5
- package/types/pc/grid/context.d.ts +4 -15
- package/types/pc/grid/index.d.ts +4 -6
- package/types/pc/grid/interface.d.ts +14 -142
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/hooks/useResponsiveState.d.ts +3 -0
- package/types/pc/index.d.ts +10 -4
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/list/interface.d.ts +2 -1
- 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/pagination/PageOption.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +5 -6
- package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
- package/types/pc/{grid → row-col}/Col.d.ts +1 -2
- package/types/pc/{grid → row-col}/Row.d.ts +1 -2
- package/types/pc/row-col/context.d.ts +6 -0
- package/types/pc/row-col/index.d.ts +7 -0
- package/types/pc/row-col/interface.d.ts +112 -0
- package/types/pc/segmented/index.d.ts +3 -7
- package/types/pc/segmented/interface.d.ts +38 -5
- 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/space/index.d.ts +5 -7
- package/types/pc/space/interface.d.ts +3 -10
- package/types/pc/statistic/index.d.ts +1 -1
- package/types/pc/statistic/interface.d.ts +1 -49
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +422 -111
- package/types/pc/utils/responsiveObserve.d.ts +8 -8
- package/typography/Ellipsis.js +5 -4
- package/typography/Operations.js +4 -3
- package/utils/dayjs.js +13 -11
- package/utils/index.js +245 -244
- package/utils/is.js +65 -66
- package/utils/names.js +309 -150
- package/utils/responsiveObserve.js +43 -36
- package/version/index.js +1 -1
- package/grid/Col-.js +0 -86
- package/grid/Col.js +0 -169
- package/grid/Row.js +0 -96
- package/grid/hook/useResponsiveState.js +0 -38
- package/statistic/Countdown.js +0 -56
- package/statistic/util.js +0 -33
- package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
- package/types/pc/statistic/util.d.ts +0 -1
- /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type Value = string | number | undefined;
|
|
3
|
+
export type SegmentedRef = {
|
|
4
|
+
dom: HTMLDivElement | null;
|
|
5
|
+
};
|
|
6
|
+
export interface SizeVariables {
|
|
7
|
+
root: {
|
|
8
|
+
padding: string;
|
|
9
|
+
fontSize: string;
|
|
10
|
+
};
|
|
11
|
+
option: {
|
|
12
|
+
size: string;
|
|
13
|
+
padding: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* 分段控制器选项类型
|
|
4
18
|
*/
|
|
5
19
|
export interface SegmentedOption {
|
|
20
|
+
/** 自定义样式 */
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
/** 自定义类名 */
|
|
23
|
+
className?: string | string[];
|
|
6
24
|
/** 选项值 */
|
|
7
|
-
value:
|
|
25
|
+
value: Value;
|
|
8
26
|
/** 显示文本,不设置则只显示图标 */
|
|
9
27
|
label?: ReactNode;
|
|
10
28
|
/** 是否禁用 */
|
|
@@ -26,22 +44,26 @@ export interface SegmentedProps {
|
|
|
26
44
|
* 分段控制器选项
|
|
27
45
|
* @description 可以是字符串数组或 SegmentedOption 对象数组
|
|
28
46
|
*/
|
|
29
|
-
options: (SegmentedOption |
|
|
47
|
+
options: (SegmentedOption | Value)[];
|
|
30
48
|
/**
|
|
31
49
|
* 默认选中的值
|
|
32
50
|
* @description 非受控模式下使用
|
|
33
51
|
*/
|
|
34
|
-
defaultValue?:
|
|
52
|
+
defaultValue?: Value;
|
|
35
53
|
/**
|
|
36
54
|
* 当前选中的值
|
|
37
55
|
* @description 受控模式下使用
|
|
38
56
|
*/
|
|
39
|
-
value?:
|
|
57
|
+
value?: Value;
|
|
40
58
|
/**
|
|
41
59
|
* 尺寸
|
|
42
60
|
* @defaultValue 'medium'
|
|
43
61
|
*/
|
|
44
62
|
size?: 'mini' | 'small' | 'medium' | 'large';
|
|
63
|
+
/**
|
|
64
|
+
* 间距
|
|
65
|
+
*/
|
|
66
|
+
gap?: number | string;
|
|
45
67
|
/**
|
|
46
68
|
* 样式类型
|
|
47
69
|
* @defaultValue 'default'
|
|
@@ -86,9 +108,20 @@ export interface SegmentedProps {
|
|
|
86
108
|
* @defaultValue false
|
|
87
109
|
*/
|
|
88
110
|
immediateTrigger?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* 是否允许通过键盘快捷键切换方向
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
keyboardSwitch?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* @zh 是否显示分割线
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
split?: boolean;
|
|
89
121
|
/**
|
|
90
122
|
* 变化时的回调函数
|
|
91
123
|
* @param value - 当前选中的值
|
|
124
|
+
* @param option - 当前选中的选项对象,当值为 undefined 时为 undefined
|
|
92
125
|
*/
|
|
93
|
-
onChange?: (value:
|
|
126
|
+
onChange?: (value: Value, option: SegmentedOption | undefined) => void;
|
|
94
127
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SelectViewProps } from './interface';
|
|
3
|
-
export type SelectViewHandle = {
|
|
4
|
-
dom: HTMLDivElement;
|
|
5
|
-
getRootDOMNode: () => HTMLDivElement;
|
|
6
|
-
focus: () => void;
|
|
7
|
-
blur: () => void;
|
|
8
|
-
getWidth: () => number;
|
|
9
|
-
};
|
|
2
|
+
import type { SelectViewProps } from './interface';
|
|
10
3
|
declare const Core: React.ForwardRefExoticComponent<SelectViewProps & {
|
|
11
4
|
htmlDataAttributes: Record<string, string>;
|
|
12
5
|
} & React.RefAttributes<unknown>>;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SelectViewProps } from './interface';
|
|
2
|
+
import type { SelectViewHandle, SelectViewProps } from './interface';
|
|
3
3
|
export type { SelectViewCommonProps, SelectViewProps } from './interface';
|
|
4
|
-
export type SelectViewHandle = {
|
|
5
|
-
dom: HTMLDivElement;
|
|
6
|
-
getRootDOMNode: () => HTMLDivElement;
|
|
7
|
-
focus: () => void;
|
|
8
|
-
blur: () => void;
|
|
9
|
-
getWidth: () => number;
|
|
10
|
-
};
|
|
11
4
|
declare const SelectViewComponent: React.ForwardRefExoticComponent<SelectViewProps & React.RefAttributes<SelectViewHandle>>;
|
|
12
5
|
export default SelectViewComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
1
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { InputTagProps } from '../input-tag';
|
|
3
3
|
import { InputComponentProps } from '../input/interface';
|
|
4
|
-
import { PopoverProps } from '../popover';
|
|
4
|
+
import type { PopoverProps } from '../popover';
|
|
5
5
|
export interface SelectViewCommonProps extends Pick<InputTagProps<unknown>, 'animation' | 'renderTag' | 'dragToSort'> {
|
|
6
6
|
id?: string;
|
|
7
7
|
style?: CSSProperties;
|
|
@@ -142,3 +142,10 @@ export interface SelectViewProps extends SelectViewCommonProps {
|
|
|
142
142
|
onFocus?: (e: any) => void;
|
|
143
143
|
onBlur?: (e: any) => void;
|
|
144
144
|
}
|
|
145
|
+
export type SelectViewHandle = {
|
|
146
|
+
dom: HTMLDivElement;
|
|
147
|
+
getRootDOMNode: () => HTMLDivElement;
|
|
148
|
+
focus: () => void;
|
|
149
|
+
blur: () => void;
|
|
150
|
+
getWidth: () => number;
|
|
151
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
declare const Space: SpaceInterface;
|
|
1
|
+
import type { SpaceProps, SpaceVerticalProps } from './interface';
|
|
2
|
+
declare const SpaceVertical: import("react").ForwardRefExoticComponent<SpaceVerticalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const Space: import("react").ForwardRefExoticComponent<SpaceProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Vertical: import("react").ForwardRefExoticComponent<SpaceVerticalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
};
|
|
8
6
|
export { SpaceVertical };
|
|
9
7
|
export default Space;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SpaceProps as CommonSpaceProps, SpaceGap } from '../../common/space/interface';
|
|
1
|
+
import { SpaceProps as CommonSpaceProps, SpaceVerticalProps as CommonSpaceVerticalProps, SpaceGap } from '../../common/space/interface';
|
|
3
2
|
export type { SpaceGap };
|
|
4
3
|
/**
|
|
5
4
|
* @title Space
|
|
6
5
|
*/
|
|
7
6
|
export interface SpaceProps extends CommonSpaceProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
className?: string;
|
|
12
|
-
/**
|
|
13
|
-
* 自定义样式
|
|
14
|
-
*/
|
|
15
|
-
style?: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export interface SpaceVerticalProps extends CommonSpaceVerticalProps {
|
|
16
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Countdown from '
|
|
1
|
+
import Countdown from '../countdown';
|
|
2
2
|
import { StatisticProps } from './interface';
|
|
3
3
|
declare const ForwardRefStatistic: import("react").ForwardRefExoticComponent<StatisticProps & import("react").RefAttributes<unknown>>;
|
|
4
4
|
declare const StatisticComponent: typeof ForwardRefStatistic & {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
export declare const PREFIX_CLASS_STATISTIC = "statistic";
|
|
3
4
|
/**
|
|
4
5
|
* @title Statistic
|
|
5
6
|
*/
|
|
@@ -84,52 +85,3 @@ export interface StatisticProps {
|
|
|
84
85
|
*/
|
|
85
86
|
loading?: boolean;
|
|
86
87
|
}
|
|
87
|
-
/**
|
|
88
|
-
* @title Statistic.Countdown
|
|
89
|
-
*/
|
|
90
|
-
export interface CountdownProps {
|
|
91
|
-
style?: CSSProperties;
|
|
92
|
-
className?: string | string[];
|
|
93
|
-
/**
|
|
94
|
-
* @zh 数值的样式
|
|
95
|
-
* @en The css style of statistic's value
|
|
96
|
-
*/
|
|
97
|
-
styleValue?: CSSProperties;
|
|
98
|
-
/**
|
|
99
|
-
* @zh 数值的标题
|
|
100
|
-
* @en The title element
|
|
101
|
-
*/
|
|
102
|
-
title?: string | ReactNode;
|
|
103
|
-
/**
|
|
104
|
-
* @zh 倒计时的时间
|
|
105
|
-
* @en To set value
|
|
106
|
-
*/
|
|
107
|
-
value?: number | string | Date | Dayjs;
|
|
108
|
-
/**
|
|
109
|
-
* @zh [dayjs](https://github.com/iamkun/dayjs)'s format
|
|
110
|
-
* @en [dayjs](https://github.com/iamkun/dayjs)'s format
|
|
111
|
-
* @defaultValue HH:mm:ss
|
|
112
|
-
*/
|
|
113
|
-
format?: string;
|
|
114
|
-
/**
|
|
115
|
-
* @zh 自定义 render 函数。`valueDiff` 表示两个时间的时间差,`formattedDiff` 表示格式化后的时间差,
|
|
116
|
-
* @en Custom render function, the input parameter is the result formatted by `dayjs`
|
|
117
|
-
*/
|
|
118
|
-
renderFormat?: (valueDiff: number, formattedDiff: string) => ReactNode;
|
|
119
|
-
/**
|
|
120
|
-
* @zh 倒计时完成后触发的回调
|
|
121
|
-
* @en Callback at the end of the countdown
|
|
122
|
-
*/
|
|
123
|
-
onFinish?: () => void;
|
|
124
|
-
/**
|
|
125
|
-
* @zh 是否开始倒计时,默认为 `true`,可以通过设置该值控制倒计时的时机
|
|
126
|
-
* @en Whether to start the countdown
|
|
127
|
-
* @defaultValue true
|
|
128
|
-
*/
|
|
129
|
-
start?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* @zh 用于修正初始化时间显示不正确
|
|
132
|
-
* @en The current time. Used to correct the initialization time
|
|
133
|
-
*/
|
|
134
|
-
now?: number | string | Date | Dayjs;
|
|
135
|
-
}
|
package/types/pc/utils/is.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isClassComponent, isColor, isColor2, isDate, isDayjs, isDOMElement, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyReactNode, isEmptyValue, isEqual, isEqualWith, isError, isExist, isFile, isFinite, isForwardRefReact, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReact18, isReact19,
|
|
1
|
+
export { isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isClassComponent, isColor, isColor2, isDate, isDayjs, isDOMElement, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyReactNode, isEmptyValue, isEqual, isEqualWith, isError, isExist, isFile, isFinite, isForwardRefReact, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReact18, isReact19, isReactComponent, isReactContextConsumer, isReactContextProvider, isReactElement, isReactForwardRef, isReactFragment, isReactLazy, isReactMemo, isReactPortal, isReactProfiler, isReactStrictMode, isReactSuspense, isReactValidElementType, isReadableByteStreamControllerSupported, isReadableStream, isReadableStreamDefaultControllerSupported, isReadableStreamSupported, isReadableStreamSymbolAsyncIteratorSupported, isRegExp, isSafeInteger, isSet, isString, isSupportRef, isSymbol, isTypedArray, isUndefined, isValidColor, isWeakMap, isWeakSet, isWindow, supportRef, } from '../../common/utils/is';
|