@unicom-cloud/ui 0.8.100 → 0.8.101

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.
Files changed (188) hide show
  1. package/Details.js +13 -2
  2. package/Divider.js +3 -2
  3. package/Flex.js +14 -4
  4. package/Loading.js +16 -3
  5. package/Space.js +3 -3
  6. package/Splitter.js +4 -3
  7. package/SuspenseFallbackTest.js +2 -4
  8. package/alert/index.js +60 -62
  9. package/back-top/index.js +32 -33
  10. package/calendar/index.js +85 -84
  11. package/components/common/development/index.js +44 -29
  12. package/components/common/empty/index.js +35 -23
  13. package/components/common/flex/index.js +64 -0
  14. package/components/common/flex/interface.js +9 -0
  15. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  16. package/components/common/space/index.js +71 -91
  17. package/components/common/suspense-fallback-test/index.js +16 -0
  18. package/components/common/utils/toArray.js +12 -0
  19. package/details/index.js +102 -62
  20. package/divider/index.js +27 -21
  21. package/empty/index.js +13 -13
  22. package/flex/index.js +43 -55
  23. package/flex/interface.js +1 -34
  24. package/icon/interface.js +1 -0
  25. package/icon-hover/interface.js +1 -0
  26. package/index.js +537 -536
  27. package/loading/index.js +72 -53
  28. package/loading/interface.js +1 -0
  29. package/modal/Modal.js +73 -74
  30. package/package.json +1 -1
  31. package/portal/interface.js +1 -0
  32. package/segmented/index.js +47 -47
  33. package/space/index.js +41 -35
  34. package/speech-synthesis/interface.js +1 -0
  35. package/splitter/Splitter.js +85 -89
  36. package/splitter/hooks/useItems.js +1 -1
  37. package/splitter/index.js +5 -4
  38. package/style.css +1 -1
  39. package/suspense-fallback-test/index.js +2 -11
  40. package/suspense-fallback-test/interface.js +1 -0
  41. package/table/Table.js +38 -38
  42. package/trigger/index.js +67 -70
  43. package/types/common/development/index.d.ts +7 -1
  44. package/types/common/development/interface.d.ts +22 -0
  45. package/types/common/empty/index.d.ts +2 -1
  46. package/types/common/flex/index.d.ts +14 -0
  47. package/types/common/flex/interface.d.ts +62 -0
  48. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  49. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  50. package/types/common/space/index.d.ts +4 -4
  51. package/types/common/space/interface.d.ts +10 -18
  52. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  53. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  54. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  55. package/types/common/utils/toArray.d.ts +13 -0
  56. package/types/pc/alert/index.d.ts +2 -1
  57. package/types/pc/alert/interface.d.ts +7 -1
  58. package/types/pc/badge/Count.d.ts +1 -1
  59. package/types/pc/breadcrumb/Item.d.ts +1 -1
  60. package/types/pc/calendar/Month.d.ts +1 -1
  61. package/types/pc/calendar/WeekList.d.ts +1 -1
  62. package/types/pc/calendar/Year.d.ts +1 -1
  63. package/types/pc/calendar/header/Panel.d.ts +1 -1
  64. package/types/pc/calendar/header/index.d.ts +1 -1
  65. package/types/pc/calendar/index.d.ts +1 -1
  66. package/types/pc/calendar/interface.d.ts +2 -1
  67. package/types/pc/cascader/interface.d.ts +1 -1
  68. package/types/pc/cascader/panel/List.d.ts +1 -1
  69. package/types/pc/cascader/panel/Option.d.ts +1 -1
  70. package/types/pc/cascader/panel/Search.d.ts +1 -1
  71. package/types/pc/checkbox/Group.d.ts +2 -2
  72. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  73. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  74. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  75. package/types/pc/color-picker/Palette.d.ts +1 -1
  76. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  77. package/types/pc/config-provider/interface.d.ts +4 -0
  78. package/types/pc/copy/index.d.ts +1 -1
  79. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  80. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  81. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  82. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  83. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  84. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  85. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  86. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  87. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  88. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  89. package/types/pc/descriptions/index.d.ts +1 -1
  90. package/types/pc/details/index.d.ts +3 -2
  91. package/types/pc/details/interface.d.ts +16 -0
  92. package/types/pc/development/index.d.ts +2 -1
  93. package/types/pc/development/interface.d.ts +15 -0
  94. package/types/pc/divider/index.d.ts +7 -2
  95. package/types/pc/draggable/Item.d.ts +1 -1
  96. package/types/pc/draggable/index.d.ts +1 -1
  97. package/types/pc/flex/index.d.ts +4 -4
  98. package/types/pc/flex/interface.d.ts +8 -53
  99. package/types/pc/form/Control.d.ts +1 -1
  100. package/types/pc/form/FormList.d.ts +1 -1
  101. package/types/pc/form/IconSymbol.d.ts +1 -1
  102. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  103. package/types/pc/icon/index.d.ts +2 -7
  104. package/types/pc/icon/interface.d.ts +13 -0
  105. package/types/pc/icon-hover/index.d.ts +2 -8
  106. package/types/pc/icon-hover/interface.d.ts +8 -0
  107. package/types/pc/image/ImageFooter.d.ts +1 -1
  108. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  109. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  110. package/types/pc/index.d.ts +60 -51
  111. package/types/pc/loading/index.d.ts +4 -3
  112. package/types/pc/loading/interface.d.ts +6 -0
  113. package/types/pc/menu/Indent.d.ts +1 -1
  114. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  115. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  116. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  117. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  118. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  119. package/types/pc/pagination/PageItem.d.ts +3 -3
  120. package/types/pc/pagination/PageJumper.d.ts +1 -1
  121. package/types/pc/pagination/PageOption.d.ts +1 -1
  122. package/types/pc/portal/Portal.d.ts +2 -6
  123. package/types/pc/portal/index.d.ts +2 -9
  124. package/types/pc/portal/interface.d.ts +14 -0
  125. package/types/pc/progress/CircleProgress.d.ts +1 -1
  126. package/types/pc/progress/LineProgess.d.ts +1 -1
  127. package/types/pc/progress/StepProgress.d.ts +1 -1
  128. package/types/pc/radio/Group.d.ts +2 -2
  129. package/types/pc/radio/GroupBlock.d.ts +1 -1
  130. package/types/pc/radio/Radio.d.ts +1 -1
  131. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  132. package/types/pc/result/403.d.ts +1 -1
  133. package/types/pc/result/404.d.ts +1 -1
  134. package/types/pc/result/500.d.ts +1 -1
  135. package/types/pc/segmented/interface.d.ts +6 -6
  136. package/types/pc/skeleton/Image.d.ts +1 -1
  137. package/types/pc/skeleton/Text.d.ts +2 -1
  138. package/types/pc/slider/Button.d.ts +1 -1
  139. package/types/pc/slider/Input.d.ts +1 -1
  140. package/types/pc/slider/Tick.d.ts +1 -1
  141. package/types/pc/space/index.d.ts +6 -5
  142. package/types/pc/speech-synthesis/index.d.ts +3 -1
  143. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  144. package/types/pc/spin/DotLoading.d.ts +1 -1
  145. package/types/pc/splitter/index.d.ts +5 -4
  146. package/types/pc/splitter/interface.d.ts +16 -16
  147. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  148. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  149. package/types/pc/table/ColGroup.d.ts +1 -1
  150. package/types/pc/table/summary/Cell.d.ts +1 -1
  151. package/types/pc/table/summary/Row.d.ts +1 -1
  152. package/types/pc/table/tbody/Td.d.ts +1 -1
  153. package/types/pc/table/tbody/index.d.ts +1 -1
  154. package/types/pc/table/tfoot/index.d.ts +1 -1
  155. package/types/pc/table/th-resizable/index.d.ts +1 -1
  156. package/types/pc/table/thead/Column.d.ts +1 -1
  157. package/types/pc/table/thead/index.d.ts +1 -1
  158. package/types/pc/tabs/TabContent.d.ts +1 -1
  159. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  160. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  161. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  162. package/types/pc/time-picker/Picker.d.ts +1 -1
  163. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  164. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  165. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  166. package/types/pc/time-picker/index.d.ts +1 -1
  167. package/types/pc/transfer/Item.d.ts +1 -1
  168. package/types/pc/transfer/List.d.ts +1 -1
  169. package/types/pc/tree/Animation.d.ts +1 -1
  170. package/types/pc/typography/Operations.d.ts +1 -1
  171. package/types/pc/upload/list/index.d.ts +1 -1
  172. package/types/pc/utils/toArray.d.ts +1 -5
  173. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  174. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  175. package/types/pc/virtual-list/index.d.ts +2 -1
  176. package/types/pc/virtual-list/interface.d.ts +56 -0
  177. package/types/pc/watermark/Watermark.d.ts +1 -1
  178. package/utils/index.js +1 -1
  179. package/utils/toArray.js +3 -10
  180. package/version/index.js +1 -1
  181. package/virtual-list/interface.js +1 -0
  182. package/components/common/space/toArray.js +0 -11
  183. package/flex/utils.js +0 -13
  184. package/loading/style/index.module.less.js +0 -4
  185. package/types/common/space/toArray.d.ts +0 -3
  186. package/types/pc/flex/utils.d.ts +0 -9
  187. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  188. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
@@ -1,3 +1,2 @@
1
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>>;
2
- export default _default;
3
- import React from 'react';
1
+ import SuspenseFallbackTest from '../../common/suspense-fallback-test';
2
+ export default SuspenseFallbackTest;
@@ -0,0 +1,2 @@
1
+ import type { SuspenseFallbackTestProps } from '../../common/suspense-fallback-test/interface';
2
+ export type { SuspenseFallbackTestProps };
@@ -9,5 +9,5 @@ type ColGroupType = {
9
9
  expandedRowKeys?: React.Key[];
10
10
  data?: any[];
11
11
  };
12
- declare function ColGroup(props: ColGroupType): import("react/jsx-dev-runtime").JSX.Element;
12
+ declare function ColGroup(props: ColGroupType): import("react/jsx-runtime").JSX.Element;
13
13
  export default ColGroup;
@@ -5,7 +5,7 @@ interface SummaryCellProps extends Omit<HTMLAttributes<HTMLElement>, 'children'>
5
5
  colSpan?: number;
6
6
  rowSpan?: number;
7
7
  }
8
- declare function Cell(props: SummaryCellProps): import("react/jsx-dev-runtime").JSX.Element;
8
+ declare function Cell(props: SummaryCellProps): import("react/jsx-runtime").JSX.Element;
9
9
  declare namespace Cell {
10
10
  var __PQB_TABLE_SUMMARY_CELL__: boolean;
11
11
  }
@@ -3,5 +3,5 @@ import { Omit } from '../../utils/type';
3
3
  interface SummaryRowProps extends Omit<HTMLAttributes<HTMLTableRowElement>, 'children'> {
4
4
  children?: ReactNode;
5
5
  }
6
- declare function Row(props: SummaryRowProps): import("react/jsx-dev-runtime").JSX.Element;
6
+ declare function Row(props: SummaryRowProps): import("react/jsx-runtime").JSX.Element;
7
7
  export default Row;
@@ -20,6 +20,6 @@ type TdType = {
20
20
  rowKey?: string;
21
21
  renderExpandIcon?: (record: any, rowKey: string) => ReactNode;
22
22
  };
23
- declare function Td(props: TdType): import("react/jsx-dev-runtime").JSX.Element | null;
23
+ declare function Td(props: TdType): import("react/jsx-runtime").JSX.Element | null;
24
24
  declare const _default: React.MemoExoticComponent<typeof Td>;
25
25
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import { TbodyProps } from '../../table/interface';
2
- declare function TBody<T>(props: TbodyProps<T>): import("react/jsx-dev-runtime").JSX.Element;
2
+ declare function TBody<T>(props: TbodyProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  export default TBody;
@@ -1,3 +1,3 @@
1
1
  import { TfootProps } from '../../table/interface';
2
- declare function Tfoot<T>(props: TfootProps<T>): import("react/jsx-dev-runtime").JSX.Element;
2
+ declare function Tfoot<T>(props: TfootProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  export default Tfoot;
@@ -1,2 +1,2 @@
1
1
  export default ThResizable;
2
- declare function ThResizable(props: any): import("react/jsx-dev-runtime").JSX.Element;
2
+ declare function ThResizable(props: any): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- declare function Column<T>(props: any): false | import("react/jsx-dev-runtime").JSX.Element;
1
+ declare function Column<T>(props: any): false | import("react/jsx-runtime").JSX.Element;
2
2
  export default Column;
@@ -1,3 +1,3 @@
1
1
  import { TheadProps } from '../../table/interface';
2
- declare function THead<T>(props: TheadProps<T>): import("react/jsx-dev-runtime").JSX.Element;
2
+ declare function THead<T>(props: TheadProps<T>): import("react/jsx-runtime").JSX.Element;
3
3
  export default THead;
@@ -5,5 +5,5 @@ interface TabContentProps extends Pick<TabsProps, 'animation' | 'activeTab' | 'd
5
5
  prefixCls: string | undefined;
6
6
  paneChildren: ReactElement<TabPaneProps, TabPaneType>[];
7
7
  }
8
- declare function TabContent(props: TabContentProps): import("react/jsx-dev-runtime").JSX.Element | null;
8
+ declare function TabContent(props: TabContentProps): import("react/jsx-runtime").JSX.Element | null;
9
9
  export default TabContent;
@@ -1,2 +1,2 @@
1
- declare function DropdownIcon(props: any): import("react/jsx-dev-runtime").JSX.Element | null;
1
+ declare function DropdownIcon(props: any): import("react/jsx-runtime").JSX.Element | null;
2
2
  export default DropdownIcon;
@@ -7,5 +7,5 @@ declare const TabInk: ({ prefixCls, animation, disabled, direction, getTitleRef,
7
7
  activeTab: any;
8
8
  getHeaderRef: any;
9
9
  inkBarSize: any;
10
- }) => import("react/jsx-dev-runtime").JSX.Element;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
11
  export default TabInk;
@@ -13,5 +13,5 @@ interface TabNavIconProps {
13
13
  rtl?: boolean;
14
14
  onChange?: (offset: number) => void;
15
15
  }
16
- declare const TabNavIcon: (props: TabNavIconProps) => import("react/jsx-dev-runtime").JSX.Element | null;
16
+ declare const TabNavIcon: (props: TabNavIconProps) => import("react/jsx-runtime").JSX.Element | null;
17
17
  export default TabNavIcon;
@@ -11,5 +11,5 @@ interface InnerPickerProps extends PickerProps {
11
11
  hideFooter?: boolean;
12
12
  order?: boolean;
13
13
  }
14
- declare const Picker: (baseProps: InnerPickerProps) => import("react/jsx-dev-runtime").JSX.Element;
14
+ declare const Picker: (baseProps: InnerPickerProps) => import("react/jsx-runtime").JSX.Element;
15
15
  export default Picker;
@@ -8,5 +8,5 @@ interface InnerRangePickerProps extends RangePickerProps {
8
8
  valueShow?: Dayjs[];
9
9
  setValueShow?: (valueShow: Dayjs[]) => void;
10
10
  }
11
- declare function RangePicker(props: InnerRangePickerProps): import("react/jsx-dev-runtime").JSX.Element;
11
+ declare function RangePicker(props: InnerRangePickerProps): import("react/jsx-runtime").JSX.Element;
12
12
  export default RangePicker;
@@ -13,5 +13,5 @@ export interface TimeColumnProps {
13
13
  popupVisible?: boolean;
14
14
  scrollSticky?: boolean;
15
15
  }
16
- declare function TimeColumn(props: TimeColumnProps): import("react/jsx-dev-runtime").JSX.Element;
16
+ declare function TimeColumn(props: TimeColumnProps): import("react/jsx-runtime").JSX.Element;
17
17
  export default TimeColumn;
@@ -20,5 +20,5 @@ interface InnerTimePickerProps extends TimePickerProps {
20
20
  setValueShow?: (valueShow: Dayjs) => void;
21
21
  hideFooter?: boolean;
22
22
  }
23
- declare function TimePicker(props: InnerTimePickerProps): import("react/jsx-dev-runtime").JSX.Element;
23
+ declare function TimePicker(props: InnerTimePickerProps): import("react/jsx-runtime").JSX.Element;
24
24
  export default TimePicker;
@@ -1,6 +1,6 @@
1
1
  import { RangePickerProps, TimePickerDecorator, TimePickerProps } from './interface';
2
2
  declare const RangePicker: {
3
- (props: RangePickerProps): import("react/jsx-dev-runtime").JSX.Element;
3
+ (props: RangePickerProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export { RangePicker as TimePickerRange };
@@ -1,3 +1,3 @@
1
1
  import { TransferItemProps } from './interface';
2
- declare function TransferItem(props: TransferItemProps): import("react/jsx-dev-runtime").JSX.Element;
2
+ declare function TransferItem(props: TransferItemProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default TransferItem;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TransferListProps } from './interface';
3
- export declare const TransferList: (props: TransferListProps, ref: any) => import("react/jsx-dev-runtime").JSX.Element;
3
+ export declare const TransferList: (props: TransferListProps, ref: any) => import("react/jsx-runtime").JSX.Element;
4
4
  declare const TransferListComponent: React.ForwardRefExoticComponent<TransferListProps & React.RefAttributes<unknown>>;
5
5
  export default TransferListComponent;
@@ -1,4 +1,4 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { NodeProps } from './interface';
3
- declare const TreeAnimation: (props: PropsWithChildren<NodeProps>) => import("react/jsx-dev-runtime").JSX.Element;
3
+ declare const TreeAnimation: (props: PropsWithChildren<NodeProps>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default TreeAnimation;
@@ -1,4 +1,4 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { OperationsProps } from './interface';
3
- declare function Operations(props: PropsWithChildren<OperationsProps>): import("react/jsx-dev-runtime").JSX.Element;
3
+ declare function Operations(props: PropsWithChildren<OperationsProps>): import("react/jsx-runtime").JSX.Element;
4
4
  export default Operations;
@@ -1,6 +1,6 @@
1
1
  import { UploadListProps } from '../../upload/interface';
2
2
  export declare const FileList: {
3
- (props: UploadListProps): import("react/jsx-dev-runtime").JSX.Element;
3
+ (props: UploadListProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default FileList;
@@ -1,7 +1,3 @@
1
- import React from 'react';
2
- interface ToArrayOptions {
3
- keepEmpty?: boolean;
4
- }
5
- declare function toArray(children: React.ReactNode, options?: ToArrayOptions): React.ReactElement[];
1
+ import toArray from '../../common/utils/toArray';
6
2
  export { toArray };
7
3
  export default toArray;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { VerificationCodeProps } from './interface';
3
- export declare function VerificationCodeComponent(baseProps: VerificationCodeProps, _: any): import("react/jsx-dev-runtime").JSX.Element;
3
+ export declare function VerificationCodeComponent(baseProps: VerificationCodeProps, _: any): import("react/jsx-runtime").JSX.Element;
4
4
  export declare namespace VerificationCodeComponent {
5
5
  var displayName: string;
6
6
  }
@@ -1,40 +1,4 @@
1
- import { Options as ScrollIntoViewOptions } from '@unicom-cloud/scroll-into-view-if-needed';
2
- import React, { CSSProperties, ReactNode, UIEvent } from 'react';
3
- import { Key } from './util/item';
4
- export type RenderFunc<T> = (item: T, index: number, props: {
5
- style: React.CSSProperties;
6
- itemIndex: number;
7
- }) => ReactNode;
8
- export interface VirtualListProps<T> extends Omit<React.HTMLAttributes<any>, 'children' | 'onScroll'> {
9
- children: RenderFunc<T>;
10
- data: T[];
11
- height?: number | string;
12
- itemHeight?: number;
13
- wrapper?: string | React.FC<any> | React.ComponentClass<any>;
14
- threshold?: number | null;
15
- isStaticItemHeight?: boolean;
16
- itemKey?: Key | ((item: T, index: number) => Key);
17
- measureLongestItem?: boolean;
18
- scrollOptions?: ScrollIntoViewOptions;
19
- needFiller?: boolean;
20
- /** Custom filler outer style */
21
- outerStyle?: CSSProperties;
22
- innerStyle?: CSSProperties;
23
- onScroll?: (event: UIEvent<HTMLElement>, info: {
24
- index: number;
25
- }) => void;
26
- wrapperChild?: string | React.FC<any> | React.ComponentClass<any>;
27
- }
28
- export type AvailableVirtualListProps = Pick<VirtualListProps<any>, 'height' | 'itemHeight' | 'threshold' | 'isStaticItemHeight' | 'scrollOptions' | 'onScroll' | 'wrapperChild'>;
29
- export type VirtualListHandle = {
30
- dom: HTMLElement;
31
- scrollTo: (arg: number | {
32
- index: number;
33
- options?: ScrollIntoViewOptions;
34
- } | {
35
- key: Key;
36
- options?: ScrollIntoViewOptions;
37
- }) => void;
38
- };
1
+ import React from 'react';
2
+ import type { VirtualListHandle, VirtualListProps } from './interface';
39
3
  declare const VirtualList: React.ForwardRefExoticComponent<VirtualListProps<any> & React.RefAttributes<VirtualListHandle>>;
40
4
  export default VirtualList;
@@ -1,3 +1,4 @@
1
1
  import VirtualList from './VirtualList';
2
+ import type { AvailableVirtualListProps, RenderFunc, VirtualListHandle } from './interface';
2
3
  export default VirtualList;
3
- export type { AvailableVirtualListProps, RenderFunc, VirtualListHandle, } from './VirtualList';
4
+ export type { AvailableVirtualListProps, RenderFunc, VirtualListHandle };
@@ -0,0 +1,56 @@
1
+ import { Options as ScrollIntoViewOptions } from '@unicom-cloud/scroll-into-view-if-needed';
2
+ import React, { CSSProperties, ReactNode, UIEvent } from 'react';
3
+ import { Key } from './util/item';
4
+ export type RenderFunc<T> = (item: T, index: number, props: {
5
+ style: React.CSSProperties;
6
+ itemIndex: number;
7
+ }) => ReactNode;
8
+ type Status = 'NONE' | 'MEASURE_START' | 'MEASURE_DONE';
9
+ export interface VirtualListProps<T> extends Omit<React.HTMLAttributes<any>, 'children' | 'onScroll'> {
10
+ children: RenderFunc<T>;
11
+ data: T[];
12
+ height?: number | string;
13
+ itemHeight?: number;
14
+ wrapper?: string | React.FC<any> | React.ComponentClass<any>;
15
+ threshold?: number | null;
16
+ isStaticItemHeight?: boolean;
17
+ itemKey?: Key | ((item: T, index: number) => Key);
18
+ measureLongestItem?: boolean;
19
+ scrollOptions?: ScrollIntoViewOptions;
20
+ needFiller?: boolean;
21
+ /** Custom filler outer style */
22
+ outerStyle?: CSSProperties;
23
+ innerStyle?: CSSProperties;
24
+ onScroll?: (event: UIEvent<HTMLElement>, info: {
25
+ index: number;
26
+ }) => void;
27
+ wrapperChild?: string | React.FC<any> | React.ComponentClass<any>;
28
+ }
29
+ export type AvailableVirtualListProps = Pick<VirtualListProps<any>, 'height' | 'itemHeight' | 'threshold' | 'isStaticItemHeight' | 'scrollOptions' | 'onScroll' | 'wrapperChild'>;
30
+ export interface RelativeScroll {
31
+ itemIndex: number;
32
+ relativeTop: number;
33
+ }
34
+ export interface VirtualListState {
35
+ status: Status;
36
+ startIndex: number;
37
+ endIndex: number;
38
+ itemIndex: number;
39
+ itemOffsetPtg: number;
40
+ startItemTop: number;
41
+ scrollTop: number;
42
+ }
43
+ export type VirtualListHandle = {
44
+ dom: HTMLElement;
45
+ scrollTo: (arg: number | {
46
+ index: number;
47
+ options?: ScrollIntoViewOptions;
48
+ } | {
49
+ key: Key;
50
+ options?: ScrollIntoViewOptions;
51
+ }) => void;
52
+ };
53
+ export type ItemHeightMap = {
54
+ [p: string]: number;
55
+ };
56
+ export {};
@@ -1,4 +1,4 @@
1
1
  import { WatermarkProps } from './interface';
2
- export declare function WatermarkComponent(baseProps: WatermarkProps, _: any): import("react/jsx-dev-runtime").JSX.Element | null;
2
+ export declare function WatermarkComponent(baseProps: WatermarkProps, _: any): import("react/jsx-runtime").JSX.Element | null;
3
3
  declare const Watermark: import("react").ForwardRefExoticComponent<WatermarkProps & import("react").RefAttributes<unknown>>;
4
4
  export default Watermark;
package/utils/index.js CHANGED
@@ -60,7 +60,7 @@ import { setPrimaryColor as tt } from "./setPrimaryColor.js";
60
60
  import { setTheme as at } from "./setTheme.js";
61
61
  import { fixedWidth as it, getStyle as mt, setTransformStyle as ft } from "../components/common/utils/style.js";
62
62
  import { throttleByRaf as lt } from "../components/common/utils/throttleByRaf.js";
63
- import { toArray as dt } from "./toArray.js";
63
+ import { toArray as dt } from "../components/common/utils/toArray.js";
64
64
  import { findNodeBy as ut, getChildWithParentBy as ct, getItemBy as gt, getItemBy2 as yt, getItemBy3 as Tt, getItemByID as St, getLabelFromDictionaryByValue as Rt } from "@unicom-cloud/utils/tree";
65
65
  import { Tween as Ct } from "../dist/tween/src/tween.js";
66
66
  import { default as Et } from "../dist/tween/src/easing.js";
package/utils/toArray.js CHANGED
@@ -1,12 +1,5 @@
1
- import t from "react";
2
- import { isFragment as f } from "react-is";
3
- function s(a, p = {}) {
4
- const e = [];
5
- return t.Children.forEach(a, (r) => {
6
- r == null && !p.keepEmpty || (Array.isArray(r) ? e.push(...s(r, p)) : f(r) && "props" in r && r.props ? e.push(...s(r.props.children, p)) : t.isValidElement(r) && e.push(r));
7
- }), e;
8
- }
1
+ import { toArray as o } from "../components/common/utils/toArray.js";
9
2
  export {
10
- s as default,
11
- s as toArray
3
+ o as default,
4
+ o as toArray
12
5
  };
package/version/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const I = "2025-07-04 19:25:46", t = "1751628346265", E = "2.66.0";
1
+ const I = "2025-07-08 09:46:15", t = "1751939175851", E = "2.66.0";
2
2
  export {
3
3
  E as VERSION,
4
4
  I as VERSION_BUILD_DATE,
@@ -0,0 +1 @@
1
+
@@ -1,11 +0,0 @@
1
- import { Children as e } from "react";
2
- import { isFragment as n } from "react-is";
3
- function p(t) {
4
- let o = [];
5
- return e.forEach(t, (r) => {
6
- n(r) && r.props ? o = o.concat(p(r.props.children)) : r != null && o.push(r);
7
- }), o;
8
- }
9
- export {
10
- p as default
11
- };
package/flex/utils.js DELETED
@@ -1,13 +0,0 @@
1
- import s from "@unicom-cloud/utils/class-name";
2
- import { alignItemsValues as u, justifyContentValues as c, flexWrapValues as m } from "./interface.js";
3
- function g(t, i) {
4
- const n = i.wrap === !0 ? "wrap" : i.wrap, a = n && m.includes(n) ? `${t}-wrap-${n}` : void 0, e = i.align && u.includes(i.align) ? `${t}-align-${i.align}` : !i.align && i.vertical ? `${t}-align-stretch` : void 0, l = i.justify && c.includes(i.justify) ? `${t}-justify-${i.justify}` : void 0;
5
- return s(a, e, l);
6
- }
7
- function d(t) {
8
- return typeof t == "string" && ["mini", "small", "medium", "large"].includes(t);
9
- }
10
- export {
11
- g as createFlexClassNames,
12
- d as isPresetSize
13
- };
@@ -1,4 +0,0 @@
1
- const s = {};
2
- export {
3
- s as default
4
- };
@@ -1,3 +0,0 @@
1
- import { ReactElement } from 'react';
2
- declare function toArray(children: ReactElement): unknown[];
3
- export default toArray;
@@ -1,9 +0,0 @@
1
- import { type FlexProps, type SizeType } from './interface';
2
- /**
3
- * 生成Flex组件的类名
4
- */
5
- export declare function createFlexClassNames(prefixCls: string | undefined, props: FlexProps): string;
6
- /**
7
- * 检查是否是预设的gap尺寸
8
- */
9
- export declare function isPresetSize(gap?: FlexProps['gap']): gap is SizeType;
@@ -1 +0,0 @@
1
- import './index.less';