@unicom-cloud/ui 0.8.106 → 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/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/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/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
|
@@ -52,9 +52,8 @@ import { isFunction as E, isPlainObject as T } from "@unicom-cloud/utils/is";
|
|
|
52
52
|
import "../../dist/validate/src/index.js";
|
|
53
53
|
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
54
54
|
import { defaultComponent as D } from "../constant.js";
|
|
55
|
-
/* empty css */
|
|
56
55
|
import F from "../../config-provider/context.js";
|
|
57
|
-
function
|
|
56
|
+
function Bt(b) {
|
|
58
57
|
let {
|
|
59
58
|
className: r,
|
|
60
59
|
children: u,
|
|
@@ -64,27 +63,27 @@ function Ut(b) {
|
|
|
64
63
|
} = b;
|
|
65
64
|
const v = D.header.th, f = s(null), x = s(null), o = s({}), { getPrefixCls: R } = X(F), a = R?.("table-th-resizable");
|
|
66
65
|
function l(t) {
|
|
67
|
-
o.current.boundingClientRect = f.current.getBoundingClientRect(), o.current.pageX = t?.pageX ?? 0,
|
|
66
|
+
o.current.boundingClientRect = f.current.getBoundingClientRect(), o.current.pageX = t?.pageX ?? 0, n(), N();
|
|
68
67
|
}
|
|
69
68
|
function e(t) {
|
|
70
|
-
|
|
69
|
+
n();
|
|
71
70
|
}
|
|
72
71
|
function m(t) {
|
|
73
|
-
let
|
|
74
|
-
|
|
72
|
+
let p = o.current.boundingClientRect.width + ((t?.pageX ?? 0) - o.current.pageX);
|
|
73
|
+
p < 0 || (T(i) && (i.width = p), c?.({
|
|
75
74
|
column: i,
|
|
76
|
-
width:
|
|
75
|
+
width: p,
|
|
77
76
|
widthOrigin: o.current.boundingClientRect.width
|
|
78
77
|
}));
|
|
79
78
|
}
|
|
80
79
|
function N(t) {
|
|
81
80
|
C(document, "mousemove", m), C(document, "mouseup", e);
|
|
82
81
|
}
|
|
83
|
-
function
|
|
82
|
+
function n(t) {
|
|
84
83
|
g(document, "mousemove", m), g(document, "mouseup", e);
|
|
85
84
|
}
|
|
86
85
|
r = z(r, a), j(() => (l(), m(), e(), () => {
|
|
87
|
-
|
|
86
|
+
n();
|
|
88
87
|
}), []);
|
|
89
88
|
let d = u;
|
|
90
89
|
return E(c) && (d = /* @__PURE__ */ M(P, { children: [
|
|
@@ -100,5 +99,5 @@ function Ut(b) {
|
|
|
100
99
|
] })), /* @__PURE__ */ h(v, { ref: f, ...w, className: r, children: d });
|
|
101
100
|
}
|
|
102
101
|
export {
|
|
103
|
-
|
|
102
|
+
Bt as default
|
|
104
103
|
};
|
package/time-picker/util.js
CHANGED
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return t.forEach((r) => {
|
|
9
|
-
o.indexOf(r) !== -1 && (s.push(r), (r === "a" || r === "A") && (e = !0));
|
|
1
|
+
import { isDayjs as i } from "dayjs";
|
|
2
|
+
import { dayjs as m, methods as e } from "../components/common/utils/dayjs.js";
|
|
3
|
+
function l(o) {
|
|
4
|
+
const t = ["H", "h", "m", "s", "a", "A"], r = [];
|
|
5
|
+
let a = !1;
|
|
6
|
+
return t.forEach((n) => {
|
|
7
|
+
o.indexOf(n) !== -1 && (r.push(n), (n === "a" || n === "A") && (a = !0));
|
|
10
8
|
}), {
|
|
11
|
-
list:
|
|
12
|
-
use12Hours:
|
|
9
|
+
list: r,
|
|
10
|
+
use12Hours: a
|
|
13
11
|
};
|
|
14
12
|
}
|
|
15
13
|
const c = /* @__PURE__ */ new Map();
|
|
16
|
-
function
|
|
17
|
-
c.get(o) && cancelAnimationFrame(c.get(o)),
|
|
14
|
+
function d(o, t, r) {
|
|
15
|
+
c.get(o) && cancelAnimationFrame(c.get(o)), r <= 0 && (o.scrollTop = t), c.set(
|
|
18
16
|
o,
|
|
19
17
|
requestAnimationFrame(() => {
|
|
20
|
-
|
|
21
|
-
from: { scrollTop: o.scrollTop },
|
|
22
|
-
to: { scrollTop: t },
|
|
23
|
-
duration: s,
|
|
24
|
-
onUpdate: (r) => {
|
|
25
|
-
o.scrollTop = r.scrollTop;
|
|
26
|
-
},
|
|
27
|
-
easing: l.quartInOut
|
|
28
|
-
}).start();
|
|
18
|
+
o.scrollTo({ top: t, behavior: "smooth" });
|
|
29
19
|
})
|
|
30
20
|
);
|
|
31
21
|
}
|
|
32
|
-
function
|
|
33
|
-
const t =
|
|
34
|
-
if (
|
|
35
|
-
let
|
|
36
|
-
return
|
|
22
|
+
function h(o) {
|
|
23
|
+
const t = m(), r = t.year(), a = t.month(), n = t.date();
|
|
24
|
+
if (i(o)) {
|
|
25
|
+
let s = o;
|
|
26
|
+
return s = e.set(s, "year", r), s = e.set(s, "month", a), s = e.set(s, "date", n), s;
|
|
37
27
|
}
|
|
38
28
|
return o;
|
|
39
29
|
}
|
|
40
30
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
l as getColumnsFromFormat,
|
|
32
|
+
h as getFormatTime,
|
|
33
|
+
d as scrollTo
|
|
44
34
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Development 组件的属性类型定义
|
|
4
4
|
* @property {string} [url] - 图片 URL,如果有则显示图片而不是图标
|
|
5
|
-
* @property {
|
|
5
|
+
* @property {ReactNode} [icon] - 自定义图标,会覆盖默认的等待图标
|
|
6
6
|
* @property {string} [label] - 提示文字,默认为"等待开发"
|
|
7
7
|
* @property {string} [tip] - 提示文字别名,优先级低于 label
|
|
8
8
|
* @property {string} [className] - 根节点类名
|
|
@@ -12,7 +12,7 @@ import React from 'react';
|
|
|
12
12
|
*/
|
|
13
13
|
export interface DevelopmentProps {
|
|
14
14
|
url?: string;
|
|
15
|
-
icon?:
|
|
15
|
+
icon?: ReactNode;
|
|
16
16
|
label?: string;
|
|
17
17
|
tip?: string;
|
|
18
18
|
className?: string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColor, isColor2, isDate, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReadableByteStreamControllerSupported, isReadableStream, isReadableStreamDefaultControllerSupported, isReadableStreamSupported, isReadableStreamSymbolAsyncIteratorSupported, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isValidColor, isWeakMap, isWeakSet } from '@unicom-cloud/utils/is';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { isDayjs } from 'dayjs';
|
|
3
|
+
import { isContextConsumer as isReactContextConsumer, isContextProvider as isReactContextProvider, isElement as isReactElement, isForwardRef as isReactForwardRef, isFragment as isReactFragment, isLazy as isReactLazy, isMemo as isReactMemo, isPortal as isReactPortal, isProfiler as isReactProfiler, isStrictMode as isReactStrictMode, isSuspense as isReactSuspense, isValidElementType as isReactValidElementType } from 'react-is';
|
|
4
4
|
declare function isNullOrUndefined(obj: any): boolean;
|
|
5
5
|
declare function isEmptyReactNode(content: any, trim?: boolean): boolean;
|
|
6
6
|
declare function isExist(obj: any): boolean;
|
|
7
7
|
declare function isWindow(el: any): el is Window;
|
|
8
|
-
declare function isDayjs(time: any): time is Dayjs;
|
|
9
8
|
declare const isReactComponent: (element: any) => boolean;
|
|
10
9
|
declare const isClassComponent: (element: any) => boolean;
|
|
11
10
|
declare const isDOMElement: (element: any) => boolean;
|
|
@@ -15,4 +14,4 @@ declare const isForwardRefReact: (object: any) => boolean;
|
|
|
15
14
|
declare const supportRef: (element: any) => boolean;
|
|
16
15
|
declare const isSupportRef: (element: any) => boolean;
|
|
17
16
|
declare function is32Bit(c: string): boolean | 0 | undefined;
|
|
18
|
-
export { is32Bit, 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,
|
|
17
|
+
export { is32Bit, 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, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { ConfigProps as MessageConfigProps, MessageHookReturnType } from '../message/interface';
|
|
3
|
+
import type { ModalHookReturnType } from '../modal/interface';
|
|
4
|
+
import type { ConfigProps as NotificationConfigProps, NotificationHookReturnType } from '../notification/interface';
|
|
5
|
+
export interface AppProps {
|
|
6
|
+
message?: MessageConfigProps;
|
|
7
|
+
notification?: NotificationConfigProps;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface useAppProps {
|
|
11
|
+
message: MessageHookReturnType;
|
|
12
|
+
notification: NotificationHookReturnType;
|
|
13
|
+
modal: ModalHookReturnType;
|
|
14
|
+
}
|
|
15
|
+
export interface AppComponentType extends React.FC<AppProps> {
|
|
16
|
+
useApp: () => useAppProps;
|
|
17
|
+
}
|
|
@@ -17,26 +17,13 @@ export interface BackTopProps {
|
|
|
17
17
|
* @defaultValue () => window
|
|
18
18
|
*/
|
|
19
19
|
target?: () => HTMLElement | Window;
|
|
20
|
+
/**
|
|
21
|
+
* @zh 是否平滑滚动
|
|
22
|
+
*/
|
|
23
|
+
smooth?: boolean;
|
|
20
24
|
/**
|
|
21
25
|
* @zh 点击返回顶部时的回调函数。
|
|
22
26
|
* @en Callback when you click to return to the top.
|
|
23
27
|
*/
|
|
24
28
|
onClick?: () => void;
|
|
25
|
-
/**
|
|
26
|
-
* @zh 是否使用Tween缓动库,注:当元素的css属性scroll-behavior: smooth;时,将不使用Tween缓动库
|
|
27
|
-
* @defaultValue true
|
|
28
|
-
*/
|
|
29
|
-
tween?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @zh 滚动到顶部的缓动方式类型
|
|
32
|
-
* @en Scroll to the top of the easing method type
|
|
33
|
-
* @defaultValue quartOut
|
|
34
|
-
*/
|
|
35
|
-
easing?: Function | string;
|
|
36
|
-
/**
|
|
37
|
-
* @zh 滚动到顶部的时间。
|
|
38
|
-
* @en Duration to scroll to the top
|
|
39
|
-
* @defaultValue 400
|
|
40
|
-
*/
|
|
41
|
-
duration?: number;
|
|
42
29
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CalendarProps } from './interface';
|
|
2
|
+
export interface CalendarLunarProps extends CalendarProps {
|
|
3
|
+
/**
|
|
4
|
+
* @zh 自定义节假日,公历或者农历,例如 festival: { lunar: { '2-27': '潘启宝农历生日' }, solar: { '11-22': '潘星移生日' }, }
|
|
5
|
+
*/
|
|
6
|
+
festival: {
|
|
7
|
+
solar: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
};
|
|
10
|
+
lunar: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare function LunarComponent(props: CalendarLunarProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare namespace LunarComponent {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
export default LunarComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CalendarProps } from './interface';
|
|
1
2
|
import Month from './Month';
|
|
2
3
|
import Year from './Year';
|
|
3
|
-
import { CalendarProps } from './interface';
|
|
4
4
|
declare function Calendar(baseProps: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare namespace Calendar {
|
|
6
6
|
var displayName: string;
|
|
@@ -208,7 +208,7 @@ export interface ConfigProviderProps {
|
|
|
208
208
|
* @en The parent node of the global popup.
|
|
209
209
|
* @defaultValue () => document.body
|
|
210
210
|
*/
|
|
211
|
-
getPopupContainer?: (node: HTMLElement) => Element;
|
|
211
|
+
getPopupContainer?: (node: HTMLElement) => Element | null;
|
|
212
212
|
/**
|
|
213
213
|
* @zh 全局的加载中图标,作用于所有组件。
|
|
214
214
|
* @en Global loading icon.
|
package/types/pc/grid/Grid.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { GridProps } from './interface';
|
|
3
|
-
declare const Grid:
|
|
2
|
+
declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<unknown>>;
|
|
4
3
|
export default Grid;
|
|
5
4
|
export type { GridProps };
|
package/types/pc/grid/Item.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { GridItemProps } from './interface';
|
|
3
|
-
declare const GridItemForwardRef:
|
|
4
|
-
declare const GridItem: typeof GridItemForwardRef
|
|
5
|
-
__PQB_GRID_ITEM__: boolean;
|
|
6
|
-
};
|
|
2
|
+
declare const GridItemForwardRef: import("react").ForwardRefExoticComponent<GridItemProps & import("react").RefAttributes<unknown>>;
|
|
3
|
+
declare const GridItem: typeof GridItemForwardRef;
|
|
7
4
|
export default GridItem;
|
|
8
5
|
export type { GridItemProps };
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { GridProps } from './interface';
|
|
2
2
|
type RowContextType = {
|
|
3
3
|
gutter?: [number, number];
|
|
4
4
|
div?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare const RowContext: import("react").Context<RowContextType>;
|
|
7
7
|
type GridContextType = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
cols?: number;
|
|
12
|
-
colGap?: number;
|
|
8
|
+
cols?: GridProps['cols'];
|
|
9
|
+
rowGap?: GridProps['rowGap'];
|
|
10
|
+
colGap?: GridProps['colGap'];
|
|
13
11
|
};
|
|
14
12
|
export declare const GridContext: import("react").Context<GridContextType>;
|
|
15
|
-
export declare const GridDataCollectorContext: import("react").Context<Readonly<{
|
|
16
|
-
collectItemData?: (index: number, itemData: GridItemData) => void;
|
|
17
|
-
removeItemData?: (index: number) => void;
|
|
18
|
-
}>>;
|
|
19
13
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const useResponsiveState: (
|
|
1
|
+
import type { GridProps, ResponsiveValue } from '../interface';
|
|
2
|
+
export declare const useResponsiveState: (value: GridProps["cols"], defaultValue: number) => number | ResponsiveValue | import("../interface").AutoGridTemplateColumns | undefined;
|
|
@@ -122,6 +122,11 @@ export interface ColProps extends Omit<HTMLAttributes<HTMLDivElement>, 'classNam
|
|
|
122
122
|
flex?: FlexType;
|
|
123
123
|
}
|
|
124
124
|
export type GridUnitProps = number | ResponsiveValue | undefined;
|
|
125
|
+
export type AutoGridTemplateColumns = {
|
|
126
|
+
type: 'auto-fit' | 'auto-fill';
|
|
127
|
+
max: number | string;
|
|
128
|
+
min: number | string;
|
|
129
|
+
};
|
|
125
130
|
/**
|
|
126
131
|
* @title Grid
|
|
127
132
|
*/
|
|
@@ -133,7 +138,7 @@ export interface GridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'classNa
|
|
|
133
138
|
* @en Number of columns displayed in each row
|
|
134
139
|
* @defaultValue 24
|
|
135
140
|
*/
|
|
136
|
-
cols?: GridUnitProps;
|
|
141
|
+
cols?: GridUnitProps | AutoGridTemplateColumns;
|
|
137
142
|
/**
|
|
138
143
|
* @zh 间距
|
|
139
144
|
* @defaultValue 0
|
|
@@ -151,18 +156,6 @@ export interface GridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'classNa
|
|
|
151
156
|
* @defaultValue 0
|
|
152
157
|
*/
|
|
153
158
|
colGap?: GridUnitProps;
|
|
154
|
-
/**
|
|
155
|
-
* @zh 是否折叠
|
|
156
|
-
* @en Whether to collapsed
|
|
157
|
-
* @defaultValue false
|
|
158
|
-
*/
|
|
159
|
-
collapsed?: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* @zh 折叠时显示的行数
|
|
162
|
-
* @en Number of rows displayed when collapsed
|
|
163
|
-
* @defaultValue 1
|
|
164
|
-
*/
|
|
165
|
-
collapsedRows?: number;
|
|
166
159
|
}
|
|
167
160
|
/**
|
|
168
161
|
* @title Item
|
|
@@ -188,14 +181,11 @@ export interface GridItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'cla
|
|
|
188
181
|
* @defaultValue false
|
|
189
182
|
*/
|
|
190
183
|
suffix?: boolean;
|
|
191
|
-
|
|
192
|
-
children?: ReactNode | ((info: {
|
|
193
|
-
overflow: boolean;
|
|
194
|
-
}) => ReactNode);
|
|
184
|
+
children?: ReactNode;
|
|
195
185
|
}
|
|
196
186
|
export interface GridItemData extends GridItemProps {
|
|
197
|
-
span
|
|
198
|
-
offset
|
|
187
|
+
span?: number;
|
|
188
|
+
offset?: number;
|
|
199
189
|
}
|
|
200
190
|
/**
|
|
201
191
|
* @title ResponsiveValue
|
package/types/pc/grid/util.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import { GridItemData } from './interface';
|
|
2
|
-
export declare function resolveItemData(cols: number, { span, offset
|
|
3
|
-
export declare function setItemVisible({ cols, collapsed, collapsedRows, itemDataList, }: {
|
|
4
|
-
cols: number;
|
|
5
|
-
collapsed: boolean;
|
|
6
|
-
collapsedRows: number;
|
|
7
|
-
itemDataList: GridItemData[];
|
|
8
|
-
}): {
|
|
9
|
-
overflow: boolean;
|
|
10
|
-
displayIndexList: number[];
|
|
11
|
-
};
|
|
2
|
+
export declare function resolveItemData(cols: number, { span, offset }: GridItemData): GridItemData;
|
package/types/pc/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as Alert } from './alert';
|
|
|
6
6
|
export type { AlertProps } from './alert/interface';
|
|
7
7
|
export { default as Anchor, AnchorLink, findAnchorLinkNode } from './anchor';
|
|
8
8
|
export type { AnchorLinkProps, AnchorProps } from './anchor/interface';
|
|
9
|
+
export { default as App, useApp } from './app';
|
|
10
|
+
export type { AppProps } from './app/interface';
|
|
9
11
|
export { default as AutoComplete, AutoCompleteOptGroup, AutoCompleteOption, } from './auto-complete';
|
|
10
12
|
export type { AutoCompleteProps } from './auto-complete/interface';
|
|
11
13
|
export { default as Avatar, AvatarGroup } from './avatar';
|
|
@@ -92,7 +94,7 @@ export { default as Menu, MenuItem, MenuItemGroup, MenuSubMenu, SubMenu, } from
|
|
|
92
94
|
export type { MenuItemGroupProps, MenuItemProps, MenuProps, MenuSubMenuProps, } from './menu/interface';
|
|
93
95
|
export { default as Message, useMessage } from './message';
|
|
94
96
|
export type { MessageHookReturnType, MessageProps } from './message/interface';
|
|
95
|
-
export { default as Modal } from './modal';
|
|
97
|
+
export { default as Modal, useModal } from './modal';
|
|
96
98
|
export type { ModalHookReturnType, ModalProps } from './modal/interface';
|
|
97
99
|
export { default as Notification, useNotification } from './notification';
|
|
98
100
|
export type { NotificationHookReturnType, NotificationProps, } from './notification/interface';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputButtonProps, RefInputType } from './interface';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const ButtonInput: React.ForwardRefExoticComponent<InputButtonProps & React.RefAttributes<RefInputType>>;
|
|
4
|
+
export default ButtonInput;
|
|
5
5
|
export type { InputButtonProps };
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import { MessageHookReturnType, MessageProps } from './interface';
|
|
2
|
+
import { ConfigProps, MessageHookReturnType, MessageProps } from './interface';
|
|
3
3
|
import useMessage from './useMessage';
|
|
4
4
|
export declare const messageTypes: string[];
|
|
5
|
-
export type ConfigProps = {
|
|
6
|
-
maxCount?: number;
|
|
7
|
-
prefixCls?: string;
|
|
8
|
-
getContainer?: () => HTMLElement;
|
|
9
|
-
duration?: number;
|
|
10
|
-
rtl?: boolean;
|
|
11
|
-
closable?: boolean;
|
|
12
|
-
};
|
|
13
5
|
export interface MessageType {
|
|
14
6
|
(): void;
|
|
15
7
|
}
|
|
@@ -79,4 +79,12 @@ export type MessageHookReturnType = {
|
|
|
79
79
|
loading?: messageHookFunction;
|
|
80
80
|
normal?: messageHookFunction;
|
|
81
81
|
};
|
|
82
|
+
export type ConfigProps = {
|
|
83
|
+
maxCount?: number;
|
|
84
|
+
prefixCls?: string;
|
|
85
|
+
getContainer?: () => HTMLElement;
|
|
86
|
+
duration?: number;
|
|
87
|
+
rtl?: boolean;
|
|
88
|
+
closable?: boolean;
|
|
89
|
+
};
|
|
82
90
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import { ConfigProps } from '
|
|
3
|
-
import { MessageHookReturnType } from './interface';
|
|
2
|
+
import { ConfigProps, MessageHookReturnType } from './interface';
|
|
4
3
|
export type messageFuncType = MessageHookReturnType;
|
|
5
4
|
declare function useMessage(commonConfig?: ConfigProps): [MessageHookReturnType, JSX.Element];
|
|
6
5
|
export default useMessage;
|
|
@@ -15,5 +15,6 @@ export interface ModalComponent extends ForwardRefExoticComponent<PropsWithChild
|
|
|
15
15
|
useModal: typeof useModal;
|
|
16
16
|
}
|
|
17
17
|
declare const ExportedModalComponent: ModalComponent;
|
|
18
|
+
export { useModal };
|
|
18
19
|
export default ExportedModalComponent;
|
|
19
20
|
export type { ModalProps, ModalReturnProps };
|
|
@@ -2,9 +2,8 @@ import { ConfigProviderProps } from '../config-provider';
|
|
|
2
2
|
export declare function setConfigProviderProps(configProviderProps: ConfigProviderProps): void;
|
|
3
3
|
export declare function getConfigProviderProps(): ConfigProviderProps;
|
|
4
4
|
export type ModalConfigType = {
|
|
5
|
-
prefixCls?: string;
|
|
6
5
|
simple?: boolean;
|
|
7
6
|
};
|
|
8
7
|
export declare const setModalConfig: (config: ModalConfigType) => void;
|
|
9
8
|
export declare const getModalConfig: () => ModalConfigType;
|
|
10
|
-
export declare const destroyList: Array<
|
|
9
|
+
export declare const destroyList: Array<() => void>;
|
|
@@ -18,6 +18,18 @@ export interface ModalProps {
|
|
|
18
18
|
*/
|
|
19
19
|
onOk?: (e?: MouseEvent) => Promise<any> | void;
|
|
20
20
|
onConfirm?: (e?: MouseEvent) => Promise<any> | void;
|
|
21
|
+
cancelButton?: {
|
|
22
|
+
visible: boolean;
|
|
23
|
+
label: string;
|
|
24
|
+
text: string;
|
|
25
|
+
props: ButtonProps;
|
|
26
|
+
};
|
|
27
|
+
okButton?: {
|
|
28
|
+
visible: boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
text: string;
|
|
31
|
+
props: ButtonProps;
|
|
32
|
+
};
|
|
21
33
|
/**
|
|
22
34
|
* @zh 指定弹出框挂载的父节点
|
|
23
35
|
* @en Specify the parent node of the Modal
|
|
@@ -75,10 +87,10 @@ export interface ModalProps {
|
|
|
75
87
|
*/
|
|
76
88
|
cancelButtonProps?: ButtonProps;
|
|
77
89
|
/**
|
|
78
|
-
* @zh 自定义页脚,传入 null 则不显示
|
|
90
|
+
* @zh 自定义页脚,传入 false | null | undefined 则不显示
|
|
79
91
|
* @en Custom `footer`. if it is null, the footer will not be displayed.
|
|
80
92
|
*/
|
|
81
|
-
footer?: ReactNode | ((cancelButtonNode: ReactNode, okButtonNode: ReactNode) => ReactNode);
|
|
93
|
+
footer?: ReactNode | ((cancelButtonNode: ReactNode, okButtonNode: ReactNode) => ReactNode) | boolean | null | undefined;
|
|
82
94
|
/**
|
|
83
95
|
* @zh 是否显示右上角的关闭按钮
|
|
84
96
|
* @en Whether to show the close button in TitleBar
|
|
@@ -154,7 +166,6 @@ export interface ModalProps {
|
|
|
154
166
|
* @en Custom the render of Modal
|
|
155
167
|
*/
|
|
156
168
|
modalRender?: (modalNode: ReactNode) => ReactNode;
|
|
157
|
-
prefixCls?: string;
|
|
158
169
|
/**
|
|
159
170
|
* @zh 是否开启全屏
|
|
160
171
|
* @en Whether to enable fullscreenable
|
|
@@ -163,8 +174,9 @@ export interface ModalProps {
|
|
|
163
174
|
draggable?: boolean;
|
|
164
175
|
}
|
|
165
176
|
export type ModalReturnProps = {
|
|
166
|
-
update:
|
|
167
|
-
close:
|
|
177
|
+
update: (newConfig: ConfirmProps) => void;
|
|
178
|
+
close: () => void;
|
|
179
|
+
destroy: () => void;
|
|
168
180
|
};
|
|
169
181
|
type modalHookFunction = (config: ConfirmProps) => {
|
|
170
182
|
close: () => void;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { ReactInstance } from 'react';
|
|
2
|
-
import { NotificationHookReturnType, NotificationProps } from './interface';
|
|
1
|
+
import React, { JSX, ReactInstance } from 'react';
|
|
2
|
+
import { ConfigProps, NotificationHookReturnType, NotificationProps } from './interface';
|
|
3
3
|
import useNotification from './useNotification';
|
|
4
4
|
export declare const notificationTypes: string[];
|
|
5
|
-
export type ConfigProps = {
|
|
6
|
-
maxCount?: number;
|
|
7
|
-
prefixCls?: string;
|
|
8
|
-
getContainer?: () => HTMLElement;
|
|
9
|
-
duration?: number;
|
|
10
|
-
rtl?: boolean;
|
|
11
|
-
};
|
|
12
5
|
export declare function getPosition(position: any, rtl_: any): any;
|
|
13
6
|
interface ComponentStaticProps {
|
|
14
7
|
displayName?: string;
|
|
@@ -74,4 +74,11 @@ export type NotificationHookReturnType = {
|
|
|
74
74
|
loading?: notificationHookFunction;
|
|
75
75
|
normal?: notificationHookFunction;
|
|
76
76
|
};
|
|
77
|
+
export type ConfigProps = {
|
|
78
|
+
maxCount?: number;
|
|
79
|
+
prefixCls?: string;
|
|
80
|
+
getContainer?: () => HTMLElement;
|
|
81
|
+
duration?: number;
|
|
82
|
+
rtl?: boolean;
|
|
83
|
+
};
|
|
77
84
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import { ConfigProps } from '
|
|
3
|
-
import { NotificationHookReturnType } from './interface';
|
|
2
|
+
import { ConfigProps, NotificationHookReturnType } from './interface';
|
|
4
3
|
export type notificationFuncType = NotificationHookReturnType;
|
|
5
4
|
declare function useNotification(commonConfig?: ConfigProps): [NotificationHookReturnType, JSX.Element];
|
|
6
5
|
export default useNotification;
|
|
@@ -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;
|