@dtjoy/dt-design 1.0.6 → 1.0.8

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 (222) hide show
  1. package/esm/_util/easings.d.ts +1 -0
  2. package/esm/_util/easings.js +9 -0
  3. package/esm/_util/extendsObject.d.ts +4 -0
  4. package/esm/_util/extendsObject.js +17 -0
  5. package/esm/_util/gapSize.d.ts +3 -3
  6. package/esm/_util/getScroll.d.ts +3 -0
  7. package/esm/_util/getScroll.js +32 -0
  8. package/esm/_util/hooks/index.d.ts +4 -1
  9. package/esm/_util/hooks/index.js +4 -1
  10. package/esm/_util/hooks/useForceUpdate.d.ts +2 -0
  11. package/esm/_util/hooks/useForceUpdate.js +6 -0
  12. package/esm/_util/hooks/useOrientation.d.ts +2 -2
  13. package/esm/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
  14. package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
  15. package/esm/_util/hooks/useSyncState.d.ts +3 -0
  16. package/esm/_util/hooks/useSyncState.js +20 -0
  17. package/esm/_util/index.d.ts +3 -3
  18. package/esm/_util/isNonNullable.d.ts +2 -2
  19. package/esm/_util/scrollTo.d.ts +10 -0
  20. package/esm/_util/scrollTo.js +38 -0
  21. package/esm/_util/type.d.ts +52 -52
  22. package/esm/_util/warning.d.ts +31 -31
  23. package/esm/_util/warning.js +5 -5
  24. package/esm/blockHeader/index.d.ts +50 -48
  25. package/esm/blockHeader/index.js +13 -15
  26. package/esm/blockHeader/style/index.d.ts +2 -2
  27. package/esm/blockHeader/style/index.less +143 -143
  28. package/esm/button/index.d.ts +10 -10
  29. package/esm/button/index.js +2 -2
  30. package/esm/button/style/index.d.ts +2 -2
  31. package/esm/collapsible/index.d.ts +102 -97
  32. package/esm/collapsible/index.js +53 -55
  33. package/esm/collapsible/style/index.d.ts +1 -1
  34. package/esm/collapsibleActionItems/index.d.ts +24 -24
  35. package/esm/collapsibleActionItems/index.js +2 -2
  36. package/esm/collapsibleActionItems/style/index.d.ts +2 -2
  37. package/esm/flex/index.d.ts +7 -7
  38. package/esm/flex/index.js +1 -1
  39. package/esm/flex/interface.d.ts +16 -16
  40. package/esm/flex/style/index.d.ts +2 -2
  41. package/esm/flex/style/index.less +76 -76
  42. package/esm/flex/utils.d.ts +7 -7
  43. package/esm/flex/utils.js +1 -1
  44. package/esm/formList/index.d.ts +78 -77
  45. package/esm/formList/index.js +13 -11
  46. package/esm/formList/style/index.d.ts +2 -2
  47. package/esm/formList/style/index.less +45 -45
  48. package/esm/index.d.ts +17 -14
  49. package/esm/index.js +3 -1
  50. package/esm/overflowList/index.d.ts +40 -39
  51. package/esm/overflowList/index.js +4 -3
  52. package/esm/overflowList/style/index.d.ts +2 -2
  53. package/esm/resize/index.d.ts +9 -8
  54. package/esm/resize/index.js +1 -1
  55. package/esm/resizeObserver/index.d.ts +45 -45
  56. package/esm/resizeObserver/index.js +3 -2
  57. package/esm/splitter/Panel.d.ts +7 -7
  58. package/esm/splitter/Panel.js +3 -3
  59. package/esm/splitter/SplitBar.d.ts +24 -24
  60. package/esm/splitter/SplitBar.js +8 -7
  61. package/esm/splitter/Splitter.d.ts +5 -5
  62. package/esm/splitter/Splitter.js +5 -4
  63. package/esm/splitter/hooks/sizeUtil.d.ts +3 -3
  64. package/esm/splitter/hooks/useItems.d.ts +14 -14
  65. package/esm/splitter/hooks/useItems.js +2 -2
  66. package/esm/splitter/hooks/useResizable.d.ts +10 -10
  67. package/esm/splitter/hooks/useResize.d.ts +6 -6
  68. package/esm/splitter/hooks/useResize.js +5 -5
  69. package/esm/splitter/hooks/useSizes.d.ts +4 -4
  70. package/esm/splitter/index.d.ts +8 -8
  71. package/esm/splitter/interface.d.ts +69 -69
  72. package/esm/splitter/style/index.d.ts +2 -2
  73. package/esm/statusTag/index.d.ts +29 -28
  74. package/esm/statusTag/index.js +8 -8
  75. package/esm/statusTag/style/index.d.ts +2 -2
  76. package/esm/style/index.d.ts +1 -1
  77. package/esm/style/index.less +1 -1
  78. package/esm/style/themes/index.less +2 -2
  79. package/esm/style/themes/variable.less +4 -0
  80. package/esm/table/InternalTable.d.ts +32 -0
  81. package/esm/table/InternalTable.js +429 -0
  82. package/esm/table/RcTable/VirtualTable.d.ts +2 -0
  83. package/esm/table/RcTable/VirtualTable.js +9 -0
  84. package/esm/table/RcTable/index.d.ts +2 -0
  85. package/esm/table/RcTable/index.js +9 -0
  86. package/esm/table/Table.d.ts +17 -0
  87. package/esm/table/Table.js +28 -0
  88. package/esm/table/TableMeasureRowContext.d.ts +3 -0
  89. package/esm/table/TableMeasureRowContext.js +3 -0
  90. package/esm/table/hooks/useContainerWidth.d.ts +1 -0
  91. package/esm/table/hooks/useContainerWidth.js +14 -0
  92. package/esm/table/index.d.ts +7 -0
  93. package/esm/table/index.js +2 -0
  94. package/esm/table/interface.d.ts +196 -0
  95. package/esm/table/interface.js +4 -0
  96. package/esm/table/style/bordered.less +141 -0
  97. package/esm/table/style/fixed.less +88 -0
  98. package/esm/table/style/index.d.ts +2 -0
  99. package/esm/table/style/index.js +2 -0
  100. package/esm/table/style/index.less +150 -0
  101. package/esm/table/style/selection.less +90 -0
  102. package/esm/table/style/sticky.less +55 -0
  103. package/esm/table/style/virtual.less +65 -0
  104. package/esm/table/util.d.ts +14 -0
  105. package/esm/table/util.js +33 -0
  106. package/lib/_util/easings.d.ts +1 -0
  107. package/lib/_util/easings.js +15 -0
  108. package/lib/_util/extendsObject.d.ts +4 -0
  109. package/lib/_util/extendsObject.js +20 -0
  110. package/lib/_util/gapSize.d.ts +3 -3
  111. package/lib/_util/getScroll.d.ts +3 -0
  112. package/lib/_util/getScroll.js +39 -0
  113. package/lib/_util/hooks/index.d.ts +4 -1
  114. package/lib/_util/hooks/index.js +33 -0
  115. package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
  116. package/lib/_util/hooks/useForceUpdate.js +12 -0
  117. package/lib/_util/hooks/useOrientation.d.ts +2 -2
  118. package/lib/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
  119. package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
  120. package/lib/_util/hooks/useSyncState.d.ts +3 -0
  121. package/lib/_util/hooks/useSyncState.js +19 -0
  122. package/lib/_util/index.d.ts +3 -3
  123. package/lib/_util/isNonNullable.d.ts +2 -2
  124. package/lib/_util/scrollTo.d.ts +10 -0
  125. package/lib/_util/scrollTo.js +44 -0
  126. package/lib/_util/type.d.ts +52 -52
  127. package/lib/_util/warning.d.ts +31 -31
  128. package/lib/_util/warning.js +7 -8
  129. package/lib/blockHeader/index.d.ts +50 -48
  130. package/lib/blockHeader/index.js +13 -12
  131. package/lib/blockHeader/style/index.d.ts +2 -2
  132. package/lib/blockHeader/style/index.less +143 -143
  133. package/lib/button/index.d.ts +10 -10
  134. package/lib/button/index.js +2 -2
  135. package/lib/button/style/index.d.ts +2 -2
  136. package/lib/collapsible/index.d.ts +102 -97
  137. package/lib/collapsible/index.js +49 -49
  138. package/lib/collapsible/style/index.d.ts +1 -1
  139. package/lib/collapsibleActionItems/index.d.ts +24 -24
  140. package/lib/collapsibleActionItems/index.js +2 -2
  141. package/lib/collapsibleActionItems/style/index.d.ts +2 -2
  142. package/lib/flex/index.d.ts +7 -7
  143. package/lib/flex/index.js +2 -2
  144. package/lib/flex/interface.d.ts +16 -16
  145. package/lib/flex/style/index.d.ts +2 -2
  146. package/lib/flex/style/index.less +76 -76
  147. package/lib/flex/utils.d.ts +7 -7
  148. package/lib/flex/utils.js +2 -2
  149. package/lib/formList/index.d.ts +78 -77
  150. package/lib/formList/index.js +10 -10
  151. package/lib/formList/style/index.d.ts +2 -2
  152. package/lib/formList/style/index.less +45 -45
  153. package/lib/index.d.ts +17 -14
  154. package/lib/index.js +21 -2
  155. package/lib/overflowList/index.d.ts +40 -39
  156. package/lib/overflowList/index.js +4 -3
  157. package/lib/overflowList/style/index.d.ts +2 -2
  158. package/lib/resize/index.d.ts +9 -8
  159. package/lib/resize/index.js +1 -1
  160. package/lib/resizeObserver/index.d.ts +45 -45
  161. package/lib/resizeObserver/index.js +3 -2
  162. package/lib/splitter/Panel.d.ts +7 -7
  163. package/lib/splitter/Panel.js +3 -3
  164. package/lib/splitter/SplitBar.d.ts +24 -24
  165. package/lib/splitter/SplitBar.js +8 -7
  166. package/lib/splitter/Splitter.d.ts +5 -5
  167. package/lib/splitter/Splitter.js +5 -4
  168. package/lib/splitter/hooks/sizeUtil.d.ts +3 -3
  169. package/lib/splitter/hooks/useItems.d.ts +14 -14
  170. package/lib/splitter/hooks/useItems.js +2 -2
  171. package/lib/splitter/hooks/useResizable.d.ts +10 -10
  172. package/lib/splitter/hooks/useResize.d.ts +6 -6
  173. package/lib/splitter/hooks/useResize.js +5 -5
  174. package/lib/splitter/hooks/useSizes.d.ts +4 -4
  175. package/lib/splitter/index.d.ts +8 -8
  176. package/lib/splitter/interface.d.ts +69 -69
  177. package/lib/splitter/style/index.d.ts +2 -2
  178. package/lib/statusTag/index.d.ts +29 -28
  179. package/lib/statusTag/index.js +8 -8
  180. package/lib/statusTag/style/index.d.ts +2 -2
  181. package/lib/style/index.d.ts +1 -1
  182. package/lib/style/index.less +1 -1
  183. package/lib/style/themes/index.less +2 -2
  184. package/lib/style/themes/variable.less +4 -0
  185. package/lib/table/InternalTable.d.ts +32 -0
  186. package/lib/table/InternalTable.js +395 -0
  187. package/lib/table/RcTable/VirtualTable.d.ts +2 -0
  188. package/lib/table/RcTable/VirtualTable.js +17 -0
  189. package/lib/table/RcTable/index.d.ts +2 -0
  190. package/lib/table/RcTable/index.js +17 -0
  191. package/lib/table/Table.d.ts +17 -0
  192. package/lib/table/Table.js +37 -0
  193. package/lib/table/TableMeasureRowContext.d.ts +3 -0
  194. package/lib/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
  195. package/lib/table/hooks/useContainerWidth.d.ts +1 -0
  196. package/lib/table/hooks/useContainerWidth.js +20 -0
  197. package/lib/table/index.d.ts +7 -0
  198. package/lib/table/index.js +9 -0
  199. package/lib/table/interface.d.ts +196 -0
  200. package/lib/table/interface.js +8 -0
  201. package/lib/table/style/bordered.less +141 -0
  202. package/lib/table/style/fixed.less +88 -0
  203. package/lib/table/style/index.d.ts +2 -0
  204. package/lib/table/style/index.js +4 -0
  205. package/lib/table/style/index.less +150 -0
  206. package/lib/table/style/selection.less +90 -0
  207. package/lib/table/style/sticky.less +55 -0
  208. package/lib/table/style/virtual.less +65 -0
  209. package/lib/table/util.d.ts +14 -0
  210. package/lib/table/util.js +44 -0
  211. package/package.json +82 -66
  212. package/esm/_util/convertToTooltipProps.d.ts +0 -4
  213. package/esm/_util/convertToTooltipProps.js +0 -15
  214. package/esm/_util/hooks/useZIndex.d.ts +0 -8
  215. package/esm/_util/hooks/useZIndex.js +0 -51
  216. package/esm/_util/zindexContext.d.ts +0 -3
  217. package/esm/_util/zindexContext.js +0 -6
  218. package/lib/_util/convertToTooltipProps.d.ts +0 -4
  219. package/lib/_util/convertToTooltipProps.js +0 -21
  220. package/lib/_util/hooks/useZIndex.d.ts +0 -8
  221. package/lib/_util/hooks/useZIndex.js +0 -59
  222. package/lib/_util/zindexContext.d.ts +0 -3
@@ -14,19 +14,19 @@ import React, { useMemo } from 'react';
14
14
  import { Utils } from '@dtinsight/dt-utils';
15
15
  import { Form, Table } from 'antd';
16
16
  import { globalConfig } from 'antd/es/config-provider';
17
- import classnames from 'classnames';
17
+ import clsx from 'clsx';
18
18
  import "./style";
19
19
 
20
- /**
21
- * Override NamePath parameters type
20
+ /**
21
+ * Override NamePath parameters type
22
22
  */
23
23
 
24
- /**
25
- * Override PanelRender type
24
+ /**
25
+ * Override PanelRender type
26
26
  */
27
27
 
28
- /**
29
- * Form.Table 组件类型
28
+ /**
29
+ * Form.Table 组件类型
30
30
  */
31
31
 
32
32
  export default function InternalTable(_ref) {
@@ -85,9 +85,11 @@ export default function InternalTable(_ref) {
85
85
  return _typeof(rule) === 'object' && rule.required;
86
86
  }));
87
87
  return _objectSpread(_objectSpread({}, cols), {}, {
88
- title: /*#__PURE__*/React.createElement(React.Fragment, null, isRequired && /*#__PURE__*/React.createElement("span", {
89
- className: "dtc-form__table__column--required"
90
- }), cols.title),
88
+ title: function title() {
89
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isRequired && /*#__PURE__*/React.createElement("span", {
90
+ className: "dtc-form__table__column--required"
91
+ }), typeof cols.title === 'function' ? cols.title.apply(cols, arguments) : cols.title);
92
+ },
91
93
  render: function render(_, fieldData) {
92
94
  var currentNamePath = [fieldData.name, cols.dataIndex].filter(Utils.checkExist).flat();
93
95
  var rules = rawRules === null || rawRules === void 0 ? void 0 : rawRules.map(function (rule) {
@@ -124,7 +126,7 @@ export default function InternalTable(_ref) {
124
126
  initialValue: initialValue
125
127
  }, function (fields, ope, meta) {
126
128
  return /*#__PURE__*/React.createElement(Table, _extends({
127
- className: classnames(prefixCls, tableClassName),
129
+ className: clsx(prefixCls, tableClassName),
128
130
  rowKey: "key",
129
131
  dataSource: fields,
130
132
  pagination: false,
@@ -1,2 +1,2 @@
1
- import '../../style/index.less';
2
- import './index.less';
1
+ import '../../style/index.less';
2
+ import './index.less';
@@ -1,45 +1,45 @@
1
- @import '../../style/themes/index.less';
2
-
3
- @form-list-prefix-cls: ~'@{ant-prefix}-form-list';
4
-
5
- .@{form-list-prefix-cls} {
6
- height: 100%;
7
-
8
- &__column {
9
- &--required {
10
- &::before {
11
- content: "*";
12
- display: inline-block;
13
- margin-inline-end: 4px;
14
- font-size: 14px;
15
- line-height: 1;
16
- color: @error-color;
17
- }
18
-
19
- vertical-align: -0.1em;
20
- }
21
- }
22
-
23
- .ant-table,
24
- .ant-table-container {
25
- height: 100%;
26
- }
27
-
28
- .ant-form-item {
29
- margin-bottom: 0;
30
- }
31
-
32
- table colgroup > col.ant-table-selection-col {
33
- width: 48px;
34
- }
35
-
36
- .ant-table-thead > tr > th.ant-table-selection-column {
37
- padding: 0 16px;
38
- }
39
-
40
- .ant-table-tbody > tr > td.ant-table-selection-column {
41
- padding: 0 16px;
42
- }
43
- }
44
-
45
-
1
+ @import '../../style/themes/index.less';
2
+
3
+ @form-list-prefix-cls: ~'@{ant-prefix}-form-list';
4
+
5
+ .@{form-list-prefix-cls} {
6
+ height: 100%;
7
+
8
+ &__column {
9
+ &--required {
10
+ &::before {
11
+ content: "*";
12
+ display: inline-block;
13
+ margin-inline-end: 4px;
14
+ font-size: 14px;
15
+ line-height: 1;
16
+ color: @error-color;
17
+ }
18
+
19
+ vertical-align: -0.1em;
20
+ }
21
+ }
22
+
23
+ .ant-table,
24
+ .ant-table-container {
25
+ height: 100%;
26
+ }
27
+
28
+ .ant-form-item {
29
+ margin-bottom: 0;
30
+ }
31
+
32
+ table colgroup > col.ant-table-selection-col {
33
+ width: 48px;
34
+ }
35
+
36
+ .ant-table-thead > tr > th.ant-table-selection-column {
37
+ padding: 0 16px;
38
+ }
39
+
40
+ .ant-table-tbody > tr > td.ant-table-selection-column {
41
+ padding: 0 16px;
42
+ }
43
+ }
44
+
45
+
package/esm/index.d.ts CHANGED
@@ -1,14 +1,17 @@
1
- export { default as BlockHeader } from './blockHeader';
2
- export type { ButtonProps } from './button';
3
- export { default as Button } from './button';
4
- export { default as Collapsible } from './collapsible';
5
- export { default as CollapsibleActionItems } from './collapsibleActionItems';
6
- export { default as Flex } from './flex';
7
- export type { FlexProps } from './flex/interface';
8
- export { default as FormList } from './formList';
9
- export * from './formList';
10
- export { default as OverflowList } from './overflowList';
11
- export { default as Resize } from './resize';
12
- export { default as Splitter } from './splitter';
13
- export * from './splitter';
14
- export { default as StatusTag } from './statusTag';
1
+ export { default as BlockHeader } from './blockHeader';
2
+ export type { ButtonProps } from './button';
3
+ export { default as Button } from './button';
4
+ export { default as Collapsible } from './collapsible';
5
+ export { default as CollapsibleActionItems } from './collapsibleActionItems';
6
+ export { default as Flex } from './flex';
7
+ export type { FlexProps } from './flex/interface';
8
+ export { default as FormList } from './formList';
9
+ export * from './formList';
10
+ export { default as OverflowList } from './overflowList';
11
+ export { default as Resize } from './resize';
12
+ export { default as Splitter } from './splitter';
13
+ export * from './splitter';
14
+ export { default as StatusTag } from './statusTag';
15
+ export * from './statusTag';
16
+ export { default as Table } from './table';
17
+ export type { ColumnGroupType as TableColumnGroupType, ColumnProps as TableColumnProps, ColumnsType as TableColumnsType, ColumnType as TableColumnType, TablePaginationConfig, TableProps, } from './table';
package/esm/index.js CHANGED
@@ -9,4 +9,6 @@ export { default as OverflowList } from "./overflowList";
9
9
  export { default as Resize } from "./resize";
10
10
  export { default as Splitter } from "./splitter";
11
11
  export * from "./splitter";
12
- export { default as StatusTag } from "./statusTag";
12
+ export { default as StatusTag } from "./statusTag";
13
+ export * from "./statusTag";
14
+ export { default as Table } from "./table";
@@ -1,39 +1,40 @@
1
- import React, { Component, ReactElement, ReactNode } from 'react';
2
- import './style';
3
- export declare type OverflowItem<T = Record<string, any>> = T;
4
- export interface OverflowListProps<T = Record<string, any>> {
5
- items: OverflowItem<T>[];
6
- visibleItemRenderer: (item: OverflowItem<T>, index: number) => ReactElement;
7
- overflowRenderer: (overflowItems: OverflowItem<T>[]) => ReactNode | ReactNode[];
8
- className?: string;
9
- style?: React.CSSProperties;
10
- renderMode?: 'collapse' | 'scroll';
11
- collapseFrom?: 'start' | 'end';
12
- minVisibleItems?: number;
13
- onOverflow?: (overflowItems: OverflowItem<T>[]) => void;
14
- }
15
- interface OverflowListState {
16
- visibleCount: number;
17
- isMeasuring: boolean;
18
- }
19
- declare class OverflowList<T extends object> extends Component<OverflowListProps<T>, OverflowListState> {
20
- static defaultProps: {
21
- items: never[];
22
- collapseFrom: string;
23
- minVisibleItems: number;
24
- renderMode: string;
25
- };
26
- static displayName: string;
27
- private containerRef;
28
- private overflowRef;
29
- private itemRefs;
30
- private prefixCls;
31
- constructor(props: OverflowListProps<T>);
32
- componentDidMount(): void;
33
- componentUpdate(prevProps: OverflowListProps<T>): void;
34
- private measureAndAdjust;
35
- private getOverflowItems;
36
- renderCollapse(): React.JSX.Element;
37
- render(): React.JSX.Element;
38
- }
39
- export default OverflowList;
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import React, { Component } from 'react';
3
+ import './style';
4
+ export type OverflowItem<T = Record<string, any>> = T;
5
+ export interface OverflowListProps<T = Record<string, any>> {
6
+ items: OverflowItem<T>[];
7
+ visibleItemRenderer: (item: OverflowItem<T>, index: number) => ReactElement;
8
+ overflowRenderer: (overflowItems: OverflowItem<T>[]) => ReactNode | ReactNode[];
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ renderMode?: 'collapse' | 'scroll';
12
+ collapseFrom?: 'start' | 'end';
13
+ minVisibleItems?: number;
14
+ onOverflow?: (overflowItems: OverflowItem<T>[]) => void;
15
+ }
16
+ interface OverflowListState {
17
+ visibleCount: number;
18
+ isMeasuring: boolean;
19
+ }
20
+ declare class OverflowList<T extends object> extends Component<OverflowListProps<T>, OverflowListState> {
21
+ static defaultProps: {
22
+ items: never[];
23
+ collapseFrom: string;
24
+ minVisibleItems: number;
25
+ renderMode: string;
26
+ };
27
+ static displayName: string;
28
+ private containerRef;
29
+ private overflowRef;
30
+ private itemRefs;
31
+ private prefixCls;
32
+ constructor(props: OverflowListProps<T>);
33
+ componentDidMount(): void;
34
+ componentUpdate(prevProps: OverflowListProps<T>): void;
35
+ private measureAndAdjust;
36
+ private getOverflowItems;
37
+ renderCollapse(): React.JSX.Element;
38
+ render(): React.JSX.Element;
39
+ }
40
+ export default OverflowList;
@@ -16,8 +16,9 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
16
16
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
17
  import React, { Component, createRef } from 'react';
18
18
  import { globalConfig } from 'antd/es/config-provider';
19
- import classNames from 'classnames';
20
19
  import "./style";
20
+ import clsx from 'clsx';
21
+ import { uniqueId } from 'lodash-es';
21
22
  import ReactResizeObserver from "../resizeObserver";
22
23
  var OverflowList = /*#__PURE__*/function (_Component) {
23
24
  _inherits(OverflowList, _Component);
@@ -120,7 +121,7 @@ var OverflowList = /*#__PURE__*/function (_Component) {
120
121
  var isVisible = isMeasuring || (collapseFrom === 'end' ? i < visibleCount : i >= items.length - visibleCount);
121
122
  if (!isVisible) return null;
122
123
  return /*#__PURE__*/React.createElement("div", {
123
- key: i,
124
+ key: uniqueId('overflow-list-item'),
124
125
  ref: function ref(el) {
125
126
  if (el) _this2.itemRefs.set(i, el);else _this2.itemRefs.delete(i);
126
127
  },
@@ -140,7 +141,7 @@ var OverflowList = /*#__PURE__*/function (_Component) {
140
141
  }
141
142
  }, /*#__PURE__*/React.createElement("div", {
142
143
  ref: this.containerRef,
143
- className: classNames(this.prefixCls, className),
144
+ className: clsx(this.prefixCls, className),
144
145
  style: containerStyle
145
146
  }, collapseFrom === 'start' && overflowNode, renderItems(), collapseFrom === 'end' && overflowNode));
146
147
  }
@@ -1,2 +1,2 @@
1
- import '../../style/index.less';
2
- import './index.less';
1
+ import '../../style/index.less';
2
+ import './index.less';
@@ -1,8 +1,9 @@
1
- import React, { ReactNode } from 'react';
2
- export interface ResizeProps {
3
- observerEle?: HTMLElement | null;
4
- children?: ReactNode;
5
- onResize?: () => void;
6
- }
7
- declare const Resize: React.FC<ResizeProps>;
8
- export default Resize;
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ export interface ResizeProps {
4
+ observerEle?: HTMLElement | null;
5
+ children?: ReactNode;
6
+ onResize?: () => void;
7
+ }
8
+ declare const Resize: React.FC<ResizeProps>;
9
+ export default Resize;
@@ -20,7 +20,7 @@ var Resize = function Resize(_ref) {
20
20
  var resizeObserver = new ResizeObserver(onResizeProxy);
21
21
  resizeObserver.observe(observerEle);
22
22
  return function () {
23
- resizeObserver.unobserve(observerEle);
23
+ resizeObserver.disconnect();
24
24
  };
25
25
  }
26
26
  }, [observerEle]);
@@ -1,45 +1,45 @@
1
- import React from 'react';
2
- interface BaseProps {
3
- className?: string;
4
- style?: React.CSSProperties;
5
- [key: string]: any;
6
- }
7
- export interface ResizeEntry {
8
- contentRect: DOMRectReadOnly;
9
- target: Element;
10
- }
11
- export interface ReactResizeObserverProps extends BaseProps {
12
- onResize?: (entries: ResizeEntry[]) => void;
13
- observeParent?: boolean;
14
- observerProperty?: ObserverProperty;
15
- delayTick?: number;
16
- children: React.ReactElement;
17
- }
18
- export declare enum ObserverProperty {
19
- Width = "width",
20
- Height = "height",
21
- All = "all"
22
- }
23
- export default class ReactResizeObserver extends React.Component<ReactResizeObserverProps> {
24
- static defaultProps: {
25
- onResize: () => void;
26
- observeParent: boolean;
27
- observerProperty: ObserverProperty;
28
- delayTick: number;
29
- };
30
- observer: ResizeObserver | null;
31
- childNode: HTMLElement | null;
32
- element: Element | null;
33
- _parentNode: HTMLElement | null;
34
- formerPropertyValue: Map<Element, number>;
35
- constructor(props: ReactResizeObserverProps);
36
- getElement: () => Element | null;
37
- handleResizeEventTriggered: (entries: ResizeEntry[]) => void;
38
- observeElement: (force?: boolean) => void;
39
- mergeRef: (ref: React.Ref<any>, node: HTMLElement) => void;
40
- componentDidMount(): void;
41
- componentDidUpdate(prevProps: ReactResizeObserverProps): void;
42
- componentWillUnmount(): void;
43
- render(): React.ReactElement;
44
- }
45
- export {};
1
+ import React from 'react';
2
+ interface BaseProps {
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ [key: string]: any;
6
+ }
7
+ export interface ResizeEntry {
8
+ contentRect: DOMRectReadOnly;
9
+ target: Element;
10
+ }
11
+ export interface ReactResizeObserverProps extends BaseProps {
12
+ onResize?: (entries: ResizeEntry[]) => void;
13
+ observeParent?: boolean;
14
+ observerProperty?: ObserverProperty;
15
+ delayTick?: number;
16
+ children: React.ReactElement;
17
+ }
18
+ export declare enum ObserverProperty {
19
+ Width = "width",
20
+ Height = "height",
21
+ All = "all"
22
+ }
23
+ export default class ReactResizeObserver extends React.Component<ReactResizeObserverProps> {
24
+ static defaultProps: {
25
+ onResize: () => void;
26
+ observeParent: boolean;
27
+ observerProperty: ObserverProperty;
28
+ delayTick: number;
29
+ };
30
+ observer: ResizeObserver | null;
31
+ childNode: HTMLElement | null;
32
+ element: Element | null;
33
+ _parentNode: HTMLElement | null;
34
+ formerPropertyValue: Map<Element, number>;
35
+ constructor(props: ReactResizeObserverProps);
36
+ getElement: () => Element | null;
37
+ handleResizeEventTriggered: (entries: ResizeEntry[]) => void;
38
+ observeElement: (force?: boolean) => void;
39
+ mergeRef: (ref: React.Ref<any>, node: HTMLElement) => void;
40
+ componentDidMount(): void;
41
+ componentDidUpdate(prevProps: ReactResizeObserverProps): void;
42
+ componentWillUnmount(): void;
43
+ render(): React.ReactElement;
44
+ }
45
+ export {};
@@ -42,9 +42,10 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
42
42
  _defineProperty(_assertThisInitialized(_this), "formerPropertyValue", new Map());
43
43
  _defineProperty(_assertThisInitialized(_this), "getElement", function () {
44
44
  try {
45
- // eslint-disable-next-line react/no-find-dom-node
45
+ // eslint-disable-next-line react-dom/no-find-dom-node
46
46
  return findDOMNode(_this.childNode || _assertThisInitialized(_this));
47
- } catch (error) {
47
+ // eslint-disable-next-line unused-imports/no-unused-vars
48
+ } catch (_error) {
48
49
  return null;
49
50
  }
50
51
  });
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { InternalPanelProps, PanelProps } from './interface';
3
- export declare const InternalPanel: React.ForwardRefExoticComponent<InternalPanelProps & {
4
- children?: React.ReactNode;
5
- } & React.RefAttributes<HTMLDivElement>>;
6
- declare const Panel: React.FC<React.PropsWithChildren<PanelProps>>;
7
- export default Panel;
1
+ import React from 'react';
2
+ import type { InternalPanelProps, PanelProps } from './interface';
3
+ export declare const InternalPanel: React.ForwardRefExoticComponent<InternalPanelProps & {
4
+ children?: React.ReactNode;
5
+ } & React.RefAttributes<HTMLDivElement>>;
6
+ declare const Panel: React.FC<React.PropsWithChildren<PanelProps>>;
7
+ export default Panel;
@@ -5,8 +5,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import React, { forwardRef, useContext } from 'react';
8
- import { ConfigContext } from 'antd/es/config-provider';
9
- import classNames from 'classnames';
8
+ import { ConfigContext } from 'antd/lib/config-provider';
9
+ import clsx from 'clsx';
10
10
  export var InternalPanel = /*#__PURE__*/forwardRef(function (props, ref) {
11
11
  var customizePrefixCls = props.prefixCls,
12
12
  className = props.className,
@@ -17,7 +17,7 @@ export var InternalPanel = /*#__PURE__*/forwardRef(function (props, ref) {
17
17
  var _useContext = useContext(ConfigContext),
18
18
  getPrefixCls = _useContext.getPrefixCls;
19
19
  var prefixCls = getPrefixCls('splitter', customizePrefixCls);
20
- var panelClassName = classNames("".concat(prefixCls, "-panel"), _defineProperty({}, "".concat(prefixCls, "-panel-hidden"), size === 0), className);
20
+ var panelClassName = clsx("".concat(prefixCls, "-panel"), _defineProperty({}, "".concat(prefixCls, "-panel-hidden"), size === 0), className);
21
21
  var hasSize = size !== undefined;
22
22
  return /*#__PURE__*/React.createElement("div", {
23
23
  ref: ref,
@@ -1,24 +1,24 @@
1
- import React from 'react';
2
- export declare type ShowCollapsibleIconMode = boolean | 'auto';
3
- export interface SplitBarProps {
4
- index: number;
5
- active: boolean;
6
- prefixCls: string;
7
- resizable: boolean;
8
- startCollapsible: boolean;
9
- endCollapsible: boolean;
10
- showStartCollapsibleIcon: ShowCollapsibleIconMode;
11
- showEndCollapsibleIcon: ShowCollapsibleIconMode;
12
- onOffsetStart: (index: number) => void;
13
- onOffsetUpdate: (index: number, offsetX: number, offsetY: number, lazyEnd?: boolean) => void;
14
- onOffsetEnd: (lazyEnd?: boolean) => void;
15
- onCollapse: (index: number, type: 'start' | 'end') => void;
16
- vertical: boolean;
17
- ariaNow: number;
18
- ariaMin: number;
19
- ariaMax: number;
20
- lazy?: boolean;
21
- containerSize: number;
22
- }
23
- declare const SplitBar: React.FC<SplitBarProps>;
24
- export default SplitBar;
1
+ import React from 'react';
2
+ export type ShowCollapsibleIconMode = boolean | 'auto';
3
+ export interface SplitBarProps {
4
+ index: number;
5
+ active: boolean;
6
+ prefixCls: string;
7
+ resizable: boolean;
8
+ startCollapsible: boolean;
9
+ endCollapsible: boolean;
10
+ showStartCollapsibleIcon: ShowCollapsibleIconMode;
11
+ showEndCollapsibleIcon: ShowCollapsibleIconMode;
12
+ onOffsetStart: (index: number) => void;
13
+ onOffsetUpdate: (index: number, offsetX: number, offsetY: number, lazyEnd?: boolean) => void;
14
+ onOffsetEnd: (lazyEnd?: boolean) => void;
15
+ onCollapse: (index: number, type: 'start' | 'end') => void;
16
+ vertical: boolean;
17
+ ariaNow: number;
18
+ ariaMin: number;
19
+ ariaMax: number;
20
+ lazy?: boolean;
21
+ containerSize: number;
22
+ }
23
+ declare const SplitBar: React.FC<SplitBarProps>;
24
+ export default SplitBar;
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useState } from 'react';
12
12
  import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '@ant-design/icons';
13
- import classNames from 'classnames';
13
+ import clsx from 'clsx';
14
14
  import useEvent from 'rc-util/lib/hooks/useEvent';
15
15
  import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
16
16
  function getValidNumber(num) {
@@ -139,6 +139,7 @@ var SplitBar = function SplitBar(props) {
139
139
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
140
140
  event = _Object$entries$_i[0],
141
141
  handler = _Object$entries$_i[1];
142
+ // eslint-disable-next-line react-web-api/no-leaked-event-listener
142
143
  window.addEventListener(event, handler);
143
144
  }
144
145
  return function () {
@@ -160,26 +161,26 @@ var SplitBar = function SplitBar(props) {
160
161
  "aria-valuemin": getValidNumber(ariaMin),
161
162
  "aria-valuemax": getValidNumber(ariaMax)
162
163
  }, lazy && /*#__PURE__*/React.createElement("div", {
163
- className: classNames("".concat(splitBarPrefixCls, "-preview"), _defineProperty({}, "".concat(splitBarPrefixCls, "-preview-active"), !!constrainedOffset)),
164
+ className: clsx("".concat(splitBarPrefixCls, "-preview"), _defineProperty({}, "".concat(splitBarPrefixCls, "-preview-active"), !!constrainedOffset)),
164
165
  style: transformStyle
165
166
  }), /*#__PURE__*/React.createElement("div", {
166
- className: classNames("".concat(splitBarPrefixCls, "-dragger"), _defineProperty(_defineProperty({}, "".concat(splitBarPrefixCls, "-dragger-disabled"), !resizable), "".concat(splitBarPrefixCls, "-dragger-active"), active)),
167
+ className: clsx("".concat(splitBarPrefixCls, "-dragger"), _defineProperty(_defineProperty({}, "".concat(splitBarPrefixCls, "-dragger-disabled"), !resizable), "".concat(splitBarPrefixCls, "-dragger-active"), active)),
167
168
  onMouseDown: onMouseDown,
168
169
  onTouchStart: onTouchStart
169
170
  }), startCollapsible && /*#__PURE__*/React.createElement("div", {
170
- className: classNames("".concat(splitBarPrefixCls, "-collapse-bar"), "".concat(splitBarPrefixCls, "-collapse-bar-start"), getVisibilityClass(showStartCollapsibleIcon)),
171
+ className: clsx("".concat(splitBarPrefixCls, "-collapse-bar"), "".concat(splitBarPrefixCls, "-collapse-bar-start"), getVisibilityClass(showStartCollapsibleIcon)),
171
172
  onClick: function onClick() {
172
173
  return onCollapse(index, 'start');
173
174
  }
174
175
  }, /*#__PURE__*/React.createElement(StartIcon, {
175
- className: classNames("".concat(splitBarPrefixCls, "-collapse-icon"), "".concat(splitBarPrefixCls, "-collapse-start"))
176
+ className: clsx("".concat(splitBarPrefixCls, "-collapse-icon"), "".concat(splitBarPrefixCls, "-collapse-start"))
176
177
  })), endCollapsible && /*#__PURE__*/React.createElement("div", {
177
- className: classNames("".concat(splitBarPrefixCls, "-collapse-bar"), "".concat(splitBarPrefixCls, "-collapse-bar-end"), getVisibilityClass(showEndCollapsibleIcon)),
178
+ className: clsx("".concat(splitBarPrefixCls, "-collapse-bar"), "".concat(splitBarPrefixCls, "-collapse-bar-end"), getVisibilityClass(showEndCollapsibleIcon)),
178
179
  onClick: function onClick() {
179
180
  return onCollapse(index, 'end');
180
181
  }
181
182
  }, /*#__PURE__*/React.createElement(EndIcon, {
182
- className: classNames("".concat(splitBarPrefixCls, "-collapse-icon"), "".concat(splitBarPrefixCls, "-collapse-end"))
183
+ className: clsx("".concat(splitBarPrefixCls, "-collapse-icon"), "".concat(splitBarPrefixCls, "-collapse-end"))
183
184
  })));
184
185
  };
185
186
  export default SplitBar;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { SplitterProps } from './interface';
3
- import './style/index.less';
4
- declare const Splitter: React.FC<React.PropsWithChildren<SplitterProps>>;
5
- export default Splitter;
1
+ import React from 'react';
2
+ import type { SplitterProps } from './interface';
3
+ import './style/index.less';
4
+ declare const Splitter: React.FC<React.PropsWithChildren<SplitterProps>>;
5
+ export default Splitter;
@@ -13,7 +13,6 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  import React, { useContext, useState } from 'react';
15
15
  import { ConfigContext } from 'antd/es/config-provider';
16
- import classNames from 'classnames';
17
16
  import ResizeObserver from 'rc-resize-observer';
18
17
  import useEvent from 'rc-util/es/hooks/useEvent';
19
18
  import warning from 'rc-util/es/warning';
@@ -24,6 +23,8 @@ import useSizes from "./hooks/useSizes";
24
23
  import { InternalPanel } from "./Panel";
25
24
  import SplitBar from "./SplitBar";
26
25
  import "./style/index.less";
26
+ import clsx from 'clsx';
27
+ import { uniqueId } from 'lodash-es';
27
28
  var Splitter = function Splitter(props) {
28
29
  var customizePrefixCls = props.prefixCls,
29
30
  className = props.className,
@@ -115,7 +116,7 @@ var Splitter = function Splitter(props) {
115
116
  });
116
117
  (_props$onCollapse = props.onCollapse) === null || _props$onCollapse === void 0 || _props$onCollapse.call(props, collapsed, nextSizes);
117
118
  });
118
- var containerClassName = classNames(prefixCls, className, "".concat(prefixCls, "-").concat(layout), _defineProperty({}, "".concat(prefixCls, "-rtl"), isRTL), rootClassName);
119
+ var containerClassName = clsx(prefixCls, className, "".concat(prefixCls, "-").concat(layout), _defineProperty({}, "".concat(prefixCls, "-rtl"), isRTL), rootClassName);
119
120
  var maskCls = "".concat(prefixCls, "-mask");
120
121
  var stackSizes = React.useMemo(function () {
121
122
  var mergedSizes = [];
@@ -173,11 +174,11 @@ var Splitter = function Splitter(props) {
173
174
  });
174
175
  }
175
176
  return /*#__PURE__*/React.createElement(React.Fragment, {
176
- key: "split-panel-".concat(idx)
177
+ key: "split-panel-".concat(uniqueId())
177
178
  }, panel, splitBar);
178
179
  }), typeof movingIndex === 'number' && /*#__PURE__*/React.createElement("div", {
179
180
  "aria-hidden": true,
180
- className: classNames(maskCls, "".concat(maskCls, "-").concat(layout))
181
+ className: clsx(maskCls, "".concat(maskCls, "-").concat(layout))
181
182
  })));
182
183
  };
183
184
  if (process.env.NODE_ENV !== 'production') {
@@ -1,3 +1,3 @@
1
- declare type SizeUnit = number | undefined;
2
- export declare function autoPtgSizes(ptgSizes: SizeUnit[], minPtgSizes: SizeUnit[], maxPtgSizes: SizeUnit[]): number[];
3
- export {};
1
+ type SizeUnit = number | undefined;
2
+ export declare function autoPtgSizes(ptgSizes: SizeUnit[], minPtgSizes: SizeUnit[], maxPtgSizes: SizeUnit[]): number[];
3
+ export {};