@dtjoy/dt-design 1.1.0 → 1.1.2

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 (152) hide show
  1. package/README.md +141 -141
  2. package/esm/blockHeader/index.js +17 -7
  3. package/esm/index.js +9 -1
  4. package/lib/blockHeader/index.js +15 -6
  5. package/lib/index.js +1 -9
  6. package/package.json +2 -4
  7. package/esm/_util/easings.d.ts +0 -1
  8. package/esm/_util/extendsObject.d.ts +0 -4
  9. package/esm/_util/gapSize.d.ts +0 -3
  10. package/esm/_util/getScroll.d.ts +0 -3
  11. package/esm/_util/hooks/index.d.ts +0 -4
  12. package/esm/_util/hooks/useForceUpdate.d.ts +0 -2
  13. package/esm/_util/hooks/useOrientation.d.ts +0 -2
  14. package/esm/_util/hooks/useProxyImperativeHandle.d.ts +0 -4
  15. package/esm/_util/hooks/useSyncState.d.ts +0 -3
  16. package/esm/_util/index.d.ts +0 -3
  17. package/esm/_util/isNonNullable.d.ts +0 -2
  18. package/esm/_util/scrollTo.d.ts +0 -10
  19. package/esm/_util/type.d.ts +0 -52
  20. package/esm/_util/warning.d.ts +0 -31
  21. package/esm/blockHeader/index.d.ts +0 -55
  22. package/esm/blockHeader/style/index.d.ts +0 -2
  23. package/esm/button/index.d.ts +0 -10
  24. package/esm/button/style/index.d.ts +0 -2
  25. package/esm/collapsible/index.d.ts +0 -102
  26. package/esm/collapsible/style/index.d.ts +0 -1
  27. package/esm/collapsibleActionItems/index.d.ts +0 -24
  28. package/esm/collapsibleActionItems/style/index.d.ts +0 -2
  29. package/esm/flex/index.d.ts +0 -7
  30. package/esm/flex/interface.d.ts +0 -16
  31. package/esm/flex/style/index.d.ts +0 -2
  32. package/esm/flex/utils.d.ts +0 -7
  33. package/esm/formList/index.d.ts +0 -78
  34. package/esm/formList/style/index.d.ts +0 -2
  35. package/esm/index.d.ts +0 -17
  36. package/esm/overflowList/index.d.ts +0 -40
  37. package/esm/overflowList/style/index.d.ts +0 -2
  38. package/esm/resize/index.d.ts +0 -9
  39. package/esm/resizeObserver/index.d.ts +0 -45
  40. package/esm/splitter/Panel.d.ts +0 -7
  41. package/esm/splitter/SplitBar.d.ts +0 -24
  42. package/esm/splitter/Splitter.d.ts +0 -5
  43. package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
  44. package/esm/splitter/hooks/useItems.d.ts +0 -14
  45. package/esm/splitter/hooks/useResizable.d.ts +0 -10
  46. package/esm/splitter/hooks/useResize.d.ts +0 -6
  47. package/esm/splitter/hooks/useSizes.d.ts +0 -4
  48. package/esm/splitter/index.d.ts +0 -8
  49. package/esm/splitter/interface.d.ts +0 -69
  50. package/esm/splitter/style/index.d.ts +0 -2
  51. package/esm/statusTag/index.d.ts +0 -29
  52. package/esm/statusTag/style/index.d.ts +0 -2
  53. package/esm/style/index.d.ts +0 -1
  54. package/esm/table/InternalTable.d.ts +0 -32
  55. package/esm/table/InternalTable.js +0 -429
  56. package/esm/table/RcTable/VirtualTable.d.ts +0 -2
  57. package/esm/table/RcTable/VirtualTable.js +0 -9
  58. package/esm/table/RcTable/index.d.ts +0 -2
  59. package/esm/table/RcTable/index.js +0 -9
  60. package/esm/table/Table.d.ts +0 -17
  61. package/esm/table/Table.js +0 -28
  62. package/esm/table/TableMeasureRowContext.d.ts +0 -3
  63. package/esm/table/TableMeasureRowContext.js +0 -3
  64. package/esm/table/hooks/useContainerWidth.d.ts +0 -1
  65. package/esm/table/hooks/useContainerWidth.js +0 -14
  66. package/esm/table/index.d.ts +0 -7
  67. package/esm/table/index.js +0 -2
  68. package/esm/table/interface.d.ts +0 -196
  69. package/esm/table/interface.js +0 -4
  70. package/esm/table/style/bordered.less +0 -141
  71. package/esm/table/style/fixed.less +0 -88
  72. package/esm/table/style/index.d.ts +0 -2
  73. package/esm/table/style/index.js +0 -2
  74. package/esm/table/style/index.less +0 -150
  75. package/esm/table/style/selection.less +0 -90
  76. package/esm/table/style/sticky.less +0 -55
  77. package/esm/table/style/virtual.less +0 -65
  78. package/esm/table/util.d.ts +0 -14
  79. package/esm/table/util.js +0 -33
  80. package/lib/_util/easings.d.ts +0 -1
  81. package/lib/_util/extendsObject.d.ts +0 -4
  82. package/lib/_util/gapSize.d.ts +0 -3
  83. package/lib/_util/getScroll.d.ts +0 -3
  84. package/lib/_util/hooks/index.d.ts +0 -4
  85. package/lib/_util/hooks/useForceUpdate.d.ts +0 -2
  86. package/lib/_util/hooks/useOrientation.d.ts +0 -2
  87. package/lib/_util/hooks/useProxyImperativeHandle.d.ts +0 -4
  88. package/lib/_util/hooks/useSyncState.d.ts +0 -3
  89. package/lib/_util/index.d.ts +0 -3
  90. package/lib/_util/isNonNullable.d.ts +0 -2
  91. package/lib/_util/scrollTo.d.ts +0 -10
  92. package/lib/_util/type.d.ts +0 -52
  93. package/lib/_util/warning.d.ts +0 -31
  94. package/lib/blockHeader/index.d.ts +0 -55
  95. package/lib/blockHeader/style/index.d.ts +0 -2
  96. package/lib/button/index.d.ts +0 -10
  97. package/lib/button/style/index.d.ts +0 -2
  98. package/lib/collapsible/index.d.ts +0 -102
  99. package/lib/collapsible/style/index.d.ts +0 -1
  100. package/lib/collapsibleActionItems/index.d.ts +0 -24
  101. package/lib/collapsibleActionItems/style/index.d.ts +0 -2
  102. package/lib/flex/index.d.ts +0 -7
  103. package/lib/flex/interface.d.ts +0 -16
  104. package/lib/flex/style/index.d.ts +0 -2
  105. package/lib/flex/utils.d.ts +0 -7
  106. package/lib/formList/index.d.ts +0 -78
  107. package/lib/formList/style/index.d.ts +0 -2
  108. package/lib/index.d.ts +0 -17
  109. package/lib/overflowList/index.d.ts +0 -40
  110. package/lib/overflowList/style/index.d.ts +0 -2
  111. package/lib/resize/index.d.ts +0 -9
  112. package/lib/resizeObserver/index.d.ts +0 -45
  113. package/lib/splitter/Panel.d.ts +0 -7
  114. package/lib/splitter/SplitBar.d.ts +0 -24
  115. package/lib/splitter/Splitter.d.ts +0 -5
  116. package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
  117. package/lib/splitter/hooks/useItems.d.ts +0 -14
  118. package/lib/splitter/hooks/useResizable.d.ts +0 -10
  119. package/lib/splitter/hooks/useResize.d.ts +0 -6
  120. package/lib/splitter/hooks/useSizes.d.ts +0 -4
  121. package/lib/splitter/index.d.ts +0 -8
  122. package/lib/splitter/interface.d.ts +0 -69
  123. package/lib/splitter/style/index.d.ts +0 -2
  124. package/lib/statusTag/index.d.ts +0 -29
  125. package/lib/statusTag/style/index.d.ts +0 -2
  126. package/lib/style/index.d.ts +0 -1
  127. package/lib/table/InternalTable.d.ts +0 -32
  128. package/lib/table/InternalTable.js +0 -395
  129. package/lib/table/RcTable/VirtualTable.d.ts +0 -2
  130. package/lib/table/RcTable/VirtualTable.js +0 -17
  131. package/lib/table/RcTable/index.d.ts +0 -2
  132. package/lib/table/RcTable/index.js +0 -17
  133. package/lib/table/Table.d.ts +0 -17
  134. package/lib/table/Table.js +0 -37
  135. package/lib/table/TableMeasureRowContext.d.ts +0 -3
  136. package/lib/table/TableMeasureRowContext.js +0 -10
  137. package/lib/table/hooks/useContainerWidth.d.ts +0 -1
  138. package/lib/table/hooks/useContainerWidth.js +0 -20
  139. package/lib/table/index.d.ts +0 -7
  140. package/lib/table/index.js +0 -9
  141. package/lib/table/interface.d.ts +0 -196
  142. package/lib/table/interface.js +0 -8
  143. package/lib/table/style/bordered.less +0 -141
  144. package/lib/table/style/fixed.less +0 -88
  145. package/lib/table/style/index.d.ts +0 -2
  146. package/lib/table/style/index.js +0 -4
  147. package/lib/table/style/index.less +0 -150
  148. package/lib/table/style/selection.less +0 -90
  149. package/lib/table/style/sticky.less +0 -55
  150. package/lib/table/style/virtual.less +0 -65
  151. package/lib/table/util.d.ts +0 -14
  152. package/lib/table/util.js +0 -44
package/README.md CHANGED
@@ -1,141 +1,141 @@
1
-
2
-
3
-
4
- <div align="center">
5
-
6
- # dt-design
7
-
8
- English | [简体中文](./README-zh_CN.md)
9
-
10
- An enterprise-class React component library built on [Ant Design](https://github.com/ant-design/ant-design), optimized for back-office business scenarios with high reusability and extensibility.
11
-
12
- </div>
13
-
14
- ---
15
-
16
- ## 📖 Introduction
17
-
18
- dt-design is a React component library internally developed by the **Digital Business Department**, extending Ant Design 5.x. It abstracts and沉淀(consolidates)common business patterns into **out-of-the-box components**, boosting development velocity while reducing redundant code.
19
-
20
- In addition, we provide several framework-agnostic utilities written in vanilla JavaScript:
21
-
22
- * `ContextMenu` – right-click context menu
23
- * `KeyEventListener` – global keyboard event binder
24
-
25
- ---
26
-
27
- ## 🎯 When to Use
28
-
29
- * ✅ Ant Design's basic components are insufficient for complex business requirements
30
- * ✅ Multiple projects share similar modules and need a unified implementation
31
- * ✅ You want to extract general business logic to avoid duplicate development
32
- * ✅ You need consistent UI specification and interaction behavior across products
33
-
34
- ---
35
-
36
- ## 📦 Installation
37
-
38
- ```bash
39
- # npm
40
- npm install dt-design
41
-
42
- # yarn
43
- yarn add dt-design
44
-
45
- # pnpm
46
- pnpm add dt-design
47
- ```
48
-
49
- ---
50
-
51
- ## 🚀 Quick Start
52
-
53
- ```tsx
54
- import React from 'react';
55
- import { BlockHeader } from '@dtjoy/dt-design';
56
-
57
- const App = () => <BlockHeader title="Category Title" background />;
58
- ```
59
-
60
- ---
61
-
62
- ## 📌 Tree-Shaking & On-Demand
63
-
64
- ES modules are fully supported; import only what you need and the bundler will drop the rest automatically:
65
-
66
- ```ts
67
- import { BlockHeader, CustomTable } from '@dtjoy/dt-design';
68
- ```
69
-
70
- ---
71
-
72
- ## 🧩 TypeScript First
73
-
74
- Written entirely in TypeScript with complete type definitions for better IntelliSense and compile-time safety.
75
-
76
- ---
77
-
78
- ## 🛠 Local Development
79
-
80
- ```bash
81
- git clone https://github.com/ZhaoFxxkSky/dt-design
82
- cd dt-design
83
- pnpm install
84
- pnpm dev
85
- ```
86
-
87
- Then open [http://127.0.0.1:8000](http://127.0.0.1:8000).
88
- We use [dumi](https://d.umijs.org/) for docs & component management.
89
-
90
- ---
91
-
92
- ## 📦 Build & Release
93
-
94
- ### Build the library
95
-
96
- ```bash
97
- pnpm build
98
- ```
99
-
100
- ### Bump version (internal npm registry)
101
-
102
- ```bash
103
- pnpm release -- -r x.x.x
104
- npm publish --registry <internal-npm-registry>
105
- ```
106
-
107
- ### Deploy documentation site (optional)
108
-
109
- ```bash
110
- pnpm deploy
111
- ```
112
-
113
- ---
114
-
115
- ## 🤝 Contributing
116
-
117
- We welcome Issues and Pull Requests. Workflow:
118
-
119
- 1. Fork the repository
120
- 2. Create your feature branch (`git checkout -b feature/xxx`)
121
- 3. Commit your changes (`git commit -m 'feat: add xxx'`)
122
- 4. Push to the branch (`git push origin feature/xxx`)
123
- 5. Open a Pull Request
124
-
125
- Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for coding standards and CI rules.
126
-
127
- ---
128
-
129
- ## 👨‍💻 Core Team
130
-
131
- Maintained by the **Digital Business Department**. Thanks to all contributors!
132
-
133
- ---
134
-
135
- ## 📄 License
136
-
137
- Internal use only. Redistribution or publication without explicit permission is strictly prohibited.
138
-
139
- ---
140
-
141
- Need help? Contact us at `wx-zhaog@dtjoy.com`
1
+
2
+
3
+
4
+ <div align="center">
5
+
6
+ # dt-design
7
+
8
+ English | [简体中文](./README-zh_CN.md)
9
+
10
+ An enterprise-class React component library built on [Ant Design](https://github.com/ant-design/ant-design), optimized for back-office business scenarios with high reusability and extensibility.
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## 📖 Introduction
17
+
18
+ dt-design is a React component library internally developed by the **Digital Business Department**, extending Ant Design 5.x. It abstracts and沉淀(consolidates)common business patterns into **out-of-the-box components**, boosting development velocity while reducing redundant code.
19
+
20
+ In addition, we provide several framework-agnostic utilities written in vanilla JavaScript:
21
+
22
+ * `ContextMenu` – right-click context menu
23
+ * `KeyEventListener` – global keyboard event binder
24
+
25
+ ---
26
+
27
+ ## 🎯 When to Use
28
+
29
+ * ✅ Ant Design's basic components are insufficient for complex business requirements
30
+ * ✅ Multiple projects share similar modules and need a unified implementation
31
+ * ✅ You want to extract general business logic to avoid duplicate development
32
+ * ✅ You need consistent UI specification and interaction behavior across products
33
+
34
+ ---
35
+
36
+ ## 📦 Installation
37
+
38
+ ```bash
39
+ # npm
40
+ npm install dt-design
41
+
42
+ # yarn
43
+ yarn add dt-design
44
+
45
+ # pnpm
46
+ pnpm add dt-design
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 🚀 Quick Start
52
+
53
+ ```tsx
54
+ import React from 'react';
55
+ import { BlockHeader } from '@dtjoy/dt-design';
56
+
57
+ const App = () => <BlockHeader title="Category Title" background />;
58
+ ```
59
+
60
+ ---
61
+
62
+ ## 📌 Tree-Shaking & On-Demand
63
+
64
+ ES modules are fully supported; import only what you need and the bundler will drop the rest automatically:
65
+
66
+ ```ts
67
+ import { BlockHeader, CustomTable } from '@dtjoy/dt-design';
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 🧩 TypeScript First
73
+
74
+ Written entirely in TypeScript with complete type definitions for better IntelliSense and compile-time safety.
75
+
76
+ ---
77
+
78
+ ## 🛠 Local Development
79
+
80
+ ```bash
81
+ git clone https://github.com/ZhaoFxxkSky/dt-design
82
+ cd dt-design
83
+ pnpm install
84
+ pnpm dev
85
+ ```
86
+
87
+ Then open [http://127.0.0.1:8000](http://127.0.0.1:8000).
88
+ We use [dumi](https://d.umijs.org/) for docs & component management.
89
+
90
+ ---
91
+
92
+ ## 📦 Build & Release
93
+
94
+ ### Build the library
95
+
96
+ ```bash
97
+ pnpm build
98
+ ```
99
+
100
+ ### Bump version (internal npm registry)
101
+
102
+ ```bash
103
+ pnpm release -- -r x.x.x
104
+ npm publish --registry <internal-npm-registry>
105
+ ```
106
+
107
+ ### Deploy documentation site (optional)
108
+
109
+ ```bash
110
+ pnpm deploy
111
+ ```
112
+
113
+ ---
114
+
115
+ ## 🤝 Contributing
116
+
117
+ We welcome Issues and Pull Requests. Workflow:
118
+
119
+ 1. Fork the repository
120
+ 2. Create your feature branch (`git checkout -b feature/xxx`)
121
+ 3. Commit your changes (`git commit -m 'feat: add xxx'`)
122
+ 4. Push to the branch (`git push origin feature/xxx`)
123
+ 5. Open a Pull Request
124
+
125
+ Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for coding standards and CI rules.
126
+
127
+ ---
128
+
129
+ ## 👨‍💻 Core Team
130
+
131
+ Maintained by the **Digital Business Department**. Thanks to all contributors!
132
+
133
+ ---
134
+
135
+ ## 📄 License
136
+
137
+ Internal use only. Redistribution or publication without explicit permission is strictly prohibited.
138
+
139
+ ---
140
+
141
+ Need help? Contact us at `wx-zhaog@dtjoy.com`
@@ -12,7 +12,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
12
12
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  // 优化后的代码示例
15
- import React, { useState } from 'react';
15
+ import React, { useMemo, useState } from 'react';
16
16
  import { QuestionCircleOutlined, UpOutlined } from '@ant-design/icons';
17
17
  import { Tooltip } from 'antd';
18
18
  import { globalConfig } from 'antd/es/config-provider';
@@ -34,7 +34,10 @@ var BlockHeader = function BlockHeader(props) {
34
34
  _props$size = props.size,
35
35
  size = _props$size === void 0 ? 'middle' : _props$size,
36
36
  _props$spaceBottom = props.spaceBottom,
37
- spaceBottom = _props$spaceBottom === void 0 ? 16 : _props$spaceBottom,
37
+ spaceBottom = _props$spaceBottom === void 0 ? {
38
+ expand: 16,
39
+ collapse: 16
40
+ } : _props$spaceBottom,
38
41
  _props$className = props.className,
39
42
  className = _props$className === void 0 ? '' : _props$className,
40
43
  _props$contentClassNa = props.contentClassName,
@@ -70,11 +73,18 @@ var BlockHeader = function BlockHeader(props) {
70
73
  var currentExpand = isControlled(props) ? expand !== null && expand !== void 0 ? expand : false : internalExpand;
71
74
  var showCollapse = expandable && !!children;
72
75
  var tooltipProps = toTooltipProps(tooltip);
73
- var bottomStyle = spaceBottom ? showCollapse && !currentExpand ? {
74
- marginBottom: 0
75
- } : {
76
- marginBottom: spaceBottom
77
- } : {};
76
+ var bottomStyle = useMemo(function () {
77
+ var _spaceBottom$key;
78
+ if (typeof spaceBottom === 'number') {
79
+ return {
80
+ marginBottom: spaceBottom
81
+ };
82
+ }
83
+ var key = currentExpand ? 'expand' : 'collapse';
84
+ return {
85
+ marginBottom: (_spaceBottom$key = spaceBottom[key]) !== null && _spaceBottom$key !== void 0 ? _spaceBottom$key : 0
86
+ };
87
+ }, [spaceBottom, currentExpand]);
78
88
  var handleExpand = function handleExpand() {
79
89
  var newExpandState = !currentExpand;
80
90
  !isControlled(props) && setInternalExpand(newExpandState);
package/esm/index.js CHANGED
@@ -11,4 +11,12 @@ export { default as Splitter } from "./splitter";
11
11
  export * from "./splitter";
12
12
  export { default as StatusTag } from "./statusTag";
13
13
  export * from "./statusTag";
14
- export { default as Table } from "./table";
14
+ // export { default as Table } from './table';
15
+ // export type {
16
+ // ColumnGroupType as TableColumnGroupType,
17
+ // ColumnProps as TableColumnProps,
18
+ // ColumnsType as TableColumnsType,
19
+ // ColumnType as TableColumnType,
20
+ // TablePaginationConfig,
21
+ // TableProps,
22
+ // } from './table';
@@ -28,7 +28,10 @@ const BlockHeader = props => {
28
28
  description = '',
29
29
  tooltip,
30
30
  size = 'middle',
31
- spaceBottom = 16,
31
+ spaceBottom = {
32
+ expand: 16,
33
+ collapse: 16
34
+ },
32
35
  className = '',
33
36
  contentClassName = '',
34
37
  style = {},
@@ -51,11 +54,17 @@ const BlockHeader = props => {
51
54
  const currentExpand = isControlled(props) ? expand ?? false : internalExpand;
52
55
  const showCollapse = expandable && !!children;
53
56
  const tooltipProps = (0, _util.toTooltipProps)(tooltip);
54
- const bottomStyle = spaceBottom ? showCollapse && !currentExpand ? {
55
- marginBottom: 0
56
- } : {
57
- marginBottom: spaceBottom
58
- } : {};
57
+ const bottomStyle = (0, _react.useMemo)(() => {
58
+ if (typeof spaceBottom === 'number') {
59
+ return {
60
+ marginBottom: spaceBottom
61
+ };
62
+ }
63
+ const key = currentExpand ? 'expand' : 'collapse';
64
+ return {
65
+ marginBottom: spaceBottom[key] ?? 0
66
+ };
67
+ }, [spaceBottom, currentExpand]);
59
68
  const handleExpand = () => {
60
69
  const newExpandState = !currentExpand;
61
70
  !isControlled(props) && setInternalExpand(newExpandState);
package/lib/index.js CHANGED
@@ -13,8 +13,7 @@ var _exportNames = {
13
13
  OverflowList: true,
14
14
  Resize: true,
15
15
  Splitter: true,
16
- StatusTag: true,
17
- Table: true
16
+ StatusTag: true
18
17
  };
19
18
  Object.defineProperty(exports, "BlockHeader", {
20
19
  enumerable: true,
@@ -76,12 +75,6 @@ Object.defineProperty(exports, "StatusTag", {
76
75
  return _statusTag.default;
77
76
  }
78
77
  });
79
- Object.defineProperty(exports, "Table", {
80
- enumerable: true,
81
- get: function () {
82
- return _table.default;
83
- }
84
- });
85
78
  var _blockHeader = _interopRequireDefault(require("./blockHeader"));
86
79
  var _button = _interopRequireDefault(require("./button"));
87
80
  var _collapsible = _interopRequireDefault(require("./collapsible"));
@@ -125,7 +118,6 @@ Object.keys(_statusTag).forEach(function (key) {
125
118
  }
126
119
  });
127
120
  });
128
- var _table = _interopRequireDefault(require("./table"));
129
121
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
130
122
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
131
123
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtjoy/dt-design",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "react-component",
5
5
  "author": {
6
6
  "name": "夕颜",
@@ -68,8 +68,6 @@
68
68
  "dependencies": {
69
69
  "@ant-design/icons": "^4.8.3",
70
70
  "@dtinsight/dt-utils": "^1.3.1",
71
- "@rc-component/table": "^1.9.1",
72
- "@rc-component/util": "^1.7.0",
73
71
  "clsx": "^2.1.1",
74
72
  "immer": "~10.1.1",
75
73
  "lodash-es": "^4.17.21",
@@ -152,4 +150,4 @@
152
150
  "prettier --ignore-unknown --write"
153
151
  ]
154
152
  }
155
- }
153
+ }
@@ -1 +0,0 @@
1
- export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
@@ -1,4 +0,0 @@
1
- declare function mergeProps<A, B>(a: A, b: B): B & A;
2
- declare function mergeProps<A, B, C>(a: A, b: B, c: C): C & B & A;
3
- declare function mergeProps<A, B, C, D>(a: A, b: B, c: C, d: D): D & C & B & A;
4
- export default mergeProps;
@@ -1,3 +0,0 @@
1
- import type { SizeType } from 'antd/es/config-provider/SizeContext';
2
- export declare function isPresetSize(size?: SizeType | string | number): size is SizeType;
3
- export declare function isValidGapNumber(size?: SizeType | string | number): size is number;
@@ -1,3 +0,0 @@
1
- export declare function isWindow(obj: any): obj is Window;
2
- declare const getScroll: (target: HTMLElement | Window | Document | null) => number;
3
- export default getScroll;
@@ -1,4 +0,0 @@
1
- export * from './useForceUpdate';
2
- export * from './useOrientation';
3
- export * from './useProxyImperativeHandle';
4
- export * from './useSyncState';
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const useForceUpdate: () => [any, React.DispatchWithoutAction];
@@ -1,2 +0,0 @@
1
- export type Orientation = 'horizontal' | 'vertical';
2
- export declare const useOrientation: (orientation?: Orientation, vertical?: boolean, legacyDirection?: Orientation) => [Orientation, boolean];
@@ -1,4 +0,0 @@
1
- import type { Ref } from 'react';
2
- export declare const useProxyImperativeHandle: <NativeELementType extends HTMLElement, ReturnRefType extends {
3
- nativeElement: NativeELementType;
4
- }>(ref: Ref<any> | undefined, init: () => ReturnRefType) => void;
@@ -1,3 +0,0 @@
1
- type UseSyncStateProps<T> = readonly [() => T, (newValue: T) => void];
2
- export declare const useSyncState: <T>(initialValue: T) => UseSyncStateProps<T>;
3
- export {};
@@ -1,3 +0,0 @@
1
- import type { TooltipProps } from 'antd';
2
- export type LabelTooltipType = TooltipProps | TooltipProps['title'];
3
- export declare function toTooltipProps(tooltip: LabelTooltipType): TooltipProps | null;
@@ -1,2 +0,0 @@
1
- declare const isNonNullable: <T>(val: T) => val is NonNullable<T>;
2
- export default isNonNullable;
@@ -1,10 +0,0 @@
1
- interface ScrollToOptions {
2
- /** Scroll container, default as window */
3
- getContainer?: () => HTMLElement | Window | Document;
4
- /** Scroll end callback */
5
- callback?: () => void;
6
- /** Animation duration, default as 450 */
7
- duration?: number;
8
- }
9
- export default function scrollTo(y: number, options?: ScrollToOptions): () => void;
10
- export {};
@@ -1,52 +0,0 @@
1
- import type React from 'react';
2
- export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
3
- /** https://github.com/Microsoft/TypeScript/issues/29729 */
4
- export type LiteralUnion<T, U extends Primitive = string> = T | (U & Record<never, never>);
5
- export type AnyObject = Record<PropertyKey, any>;
6
- export type CustomComponent<P = AnyObject> = React.ComponentType<P> | string;
7
- /**
8
- * Get component props
9
- * @example
10
- * ```ts
11
- * import { Checkbox } from '@dtjoy/dt-design'
12
- * import type { GetProps } from '@dtjoy/dt-design';
13
- *
14
- * type CheckboxGroupProps = GetProps<typeof Checkbox.Group>
15
- * ```
16
- */
17
- export type GetProps<T extends React.ComponentType<any> | object> = T extends React.ComponentType<infer P> ? P : T extends object ? T : never;
18
- /**
19
- * Get component props by component name
20
- * @example
21
- * ```ts
22
- * import { Select } from '@dtjoy/dt-design';
23
- * import type { GetProp, SelectProps } from '@dtjoy/dt-design';
24
- *
25
- * type SelectOption1 = GetProp<SelectProps, 'options'>[number];
26
- * // or
27
- * type SelectOption2 = GetProp<typeof Select, 'options'>[number];
28
- *
29
- * const onChange: GetProp<typeof Select, 'onChange'> = (value, option) => {
30
- * // Do something
31
- * };
32
- * ```
33
- */
34
- export type GetProp<T extends React.ComponentType<any> | object, PropName extends keyof GetProps<T>> = NonNullable<GetProps<T>[PropName]>;
35
- type ReactRefComponent<Props extends {
36
- ref?: React.Ref<any> | string;
37
- }> = (props: Props) => React.ReactNode;
38
- type ExtractRefAttributesRef<T> = T extends React.RefAttributes<infer P> ? P : never;
39
- /**
40
- * Get component ref
41
- * @example
42
- * ```ts
43
- * import { Input } from '@dtjoy/dt-design';
44
- * import type { GetRef } from '@dtjoy/dt-design';
45
- *
46
- * type InputRef = GetRef<typeof Input>;
47
- * ```
48
- */
49
- export type GetRef<T extends ReactRefComponent<any> | React.Component<any>> = T extends React.Component<any> ? T : T extends React.ComponentType<infer P> ? ExtractRefAttributesRef<P> : never;
50
- export type GetContextProps<T> = T extends React.Context<infer P> ? P : never;
51
- export type GetContextProp<T extends React.Context<any>, PropName extends keyof GetContextProps<T>> = NonNullable<GetContextProps<T>[PropName]>;
52
- export {};
@@ -1,31 +0,0 @@
1
- import * as React from 'react';
2
- export declare function noop(): void;
3
- export declare function resetWarned(): void;
4
- type Warning = (valid: boolean, component: string, message?: string) => void;
5
- declare const warning: Warning;
6
- type BaseTypeWarning = (valid: boolean,
7
- /**
8
- * - deprecated: Some API will be removed in future but still support now.
9
- * - usage: Some API usage is not correct.
10
- * - breaking: Breaking change like API is removed.
11
- */
12
- type: 'deprecated' | 'usage' | 'breaking', message?: string) => void;
13
- type TypeWarning = BaseTypeWarning & {
14
- deprecated: (valid: boolean, oldProp: string, newProp: string, message?: string) => void;
15
- };
16
- export interface WarningContextProps {
17
- /**
18
- * @descCN 设置警告等级,设置 `false` 时会将废弃相关信息聚合为单条信息。
19
- * @descEN Set the warning level. When set to `false`, discard related information will be aggregated into a single message.
20
- * @since 5.10.0
21
- */
22
- strict?: boolean;
23
- }
24
- export declare const WarningContext: React.Context<WarningContextProps>;
25
- /**
26
- * This is a hook but we not named as `useWarning`
27
- * since this is only used in development.
28
- * We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
29
- */
30
- export declare const devUseWarning: (component: string) => TypeWarning;
31
- export default warning;
@@ -1,55 +0,0 @@
1
- import React from 'react';
2
- import './style';
3
- import type { LabelTooltipType } from '../_util';
4
- import type { SizeType } from 'antd/es/config-provider/SizeContext';
5
- export interface IBlockHeaderProps {
6
- /** id */
7
- id?: string;
8
- /** 标题 */
9
- title: React.ReactNode;
10
- /** 标题前的图标,默认是一个色块 */
11
- addonBefore?: React.ReactNode;
12
- /** 标题后的提示说明文字 */
13
- description?: React.ReactNode;
14
- /** 默认展示为问号的tooltip */
15
- tooltip?: LabelTooltipType;
16
- /** 后缀自定义内容块 */
17
- addonAfter?: React.ReactNode;
18
- /**
19
- * 小标题 font-size: 12px; line-height: 32px
20
- * 中标题 font-size: 14px; line-height: 40px
21
- * 大标题 font-size: 16px; line-height: 40px
22
- * 默认 中标题
23
- */
24
- size?: SizeType;
25
- /** 自定义 Bottom 值 */
26
- spaceBottom?: number;
27
- /** 标题一行的样式类名 */
28
- className?: string;
29
- /** 标题的样式类名 */
30
- style?: React.CSSProperties;
31
- /** 展示内容(children)的样式类名 */
32
- contentClassName?: string;
33
- /** 展示内容(children)的样式 */
34
- contentStyle?: React.CSSProperties;
35
- /** 是否显示背景, 默认 true */
36
- background?: boolean;
37
- /** 当前展开状态 */
38
- expand?: boolean;
39
- /** 是否可展开, 默认 true */
40
- expandable?: boolean;
41
- /** 是否默认展开内容, 默认为 false */
42
- defaultExpand?: boolean;
43
- /** 展开/收起的内容 */
44
- children?: React.ReactNode;
45
- /** 展开/收起时的回调 */
46
- onExpand?: (expand: boolean) => void;
47
- /** 标题的样式 */
48
- titleStyle?: React.CSSProperties;
49
- /** 是否保留 DOM 结构, 默认 false */
50
- keepDOM?: boolean;
51
- /** 是否懒加载, 默认 false */
52
- lazy?: boolean;
53
- }
54
- declare const BlockHeader: React.FC<IBlockHeaderProps>;
55
- export default BlockHeader;
@@ -1,2 +0,0 @@
1
- import '../../style';
2
- import './index.less';
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { ButtonProps as AntdButtonProps } from 'antd';
3
- import type { ButtonType as AntdButtonType } from 'antd/es/button';
4
- import './style';
5
- type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
6
- export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
7
- type?: ButtonType;
8
- }
9
- declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
10
- export default _default;
@@ -1,2 +0,0 @@
1
- import '../../style/index.less';
2
- import './index.less';