@dtjoy/dt-design 1.1.1 → 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.
- package/README.md +141 -141
- package/esm/index.js +9 -1
- package/lib/index.js +1 -9
- package/package.json +2 -4
- package/esm/_util/easings.d.ts +0 -1
- package/esm/_util/extendsObject.d.ts +0 -4
- package/esm/_util/gapSize.d.ts +0 -3
- package/esm/_util/getScroll.d.ts +0 -3
- package/esm/_util/hooks/index.d.ts +0 -4
- package/esm/_util/hooks/useForceUpdate.d.ts +0 -2
- package/esm/_util/hooks/useOrientation.d.ts +0 -2
- package/esm/_util/hooks/useProxyImperativeHandle.d.ts +0 -4
- package/esm/_util/hooks/useSyncState.d.ts +0 -3
- package/esm/_util/index.d.ts +0 -3
- package/esm/_util/isNonNullable.d.ts +0 -2
- package/esm/_util/scrollTo.d.ts +0 -10
- package/esm/_util/type.d.ts +0 -52
- package/esm/_util/warning.d.ts +0 -31
- package/esm/blockHeader/index.d.ts +0 -58
- package/esm/blockHeader/style/index.d.ts +0 -2
- package/esm/button/index.d.ts +0 -10
- package/esm/button/style/index.d.ts +0 -2
- package/esm/collapsible/index.d.ts +0 -102
- package/esm/collapsible/style/index.d.ts +0 -1
- package/esm/collapsibleActionItems/index.d.ts +0 -24
- package/esm/collapsibleActionItems/style/index.d.ts +0 -2
- package/esm/flex/index.d.ts +0 -7
- package/esm/flex/interface.d.ts +0 -16
- package/esm/flex/style/index.d.ts +0 -2
- package/esm/flex/utils.d.ts +0 -7
- package/esm/formList/index.d.ts +0 -78
- package/esm/formList/style/index.d.ts +0 -2
- package/esm/index.d.ts +0 -17
- package/esm/overflowList/index.d.ts +0 -40
- package/esm/overflowList/style/index.d.ts +0 -2
- package/esm/resize/index.d.ts +0 -9
- package/esm/resizeObserver/index.d.ts +0 -45
- package/esm/splitter/Panel.d.ts +0 -7
- package/esm/splitter/SplitBar.d.ts +0 -24
- package/esm/splitter/Splitter.d.ts +0 -5
- package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
- package/esm/splitter/hooks/useItems.d.ts +0 -14
- package/esm/splitter/hooks/useResizable.d.ts +0 -10
- package/esm/splitter/hooks/useResize.d.ts +0 -6
- package/esm/splitter/hooks/useSizes.d.ts +0 -4
- package/esm/splitter/index.d.ts +0 -8
- package/esm/splitter/interface.d.ts +0 -69
- package/esm/splitter/style/index.d.ts +0 -2
- package/esm/statusTag/index.d.ts +0 -29
- package/esm/statusTag/style/index.d.ts +0 -2
- package/esm/style/index.d.ts +0 -1
- package/esm/table/InternalTable.d.ts +0 -32
- package/esm/table/InternalTable.js +0 -429
- package/esm/table/RcTable/VirtualTable.d.ts +0 -2
- package/esm/table/RcTable/VirtualTable.js +0 -9
- package/esm/table/RcTable/index.d.ts +0 -2
- package/esm/table/RcTable/index.js +0 -9
- package/esm/table/Table.d.ts +0 -17
- package/esm/table/Table.js +0 -28
- package/esm/table/TableMeasureRowContext.d.ts +0 -3
- package/esm/table/TableMeasureRowContext.js +0 -3
- package/esm/table/hooks/useContainerWidth.d.ts +0 -1
- package/esm/table/hooks/useContainerWidth.js +0 -14
- package/esm/table/index.d.ts +0 -7
- package/esm/table/index.js +0 -2
- package/esm/table/interface.d.ts +0 -196
- package/esm/table/interface.js +0 -4
- package/esm/table/style/bordered.less +0 -141
- package/esm/table/style/fixed.less +0 -88
- package/esm/table/style/index.d.ts +0 -2
- package/esm/table/style/index.js +0 -2
- package/esm/table/style/index.less +0 -150
- package/esm/table/style/selection.less +0 -90
- package/esm/table/style/sticky.less +0 -55
- package/esm/table/style/virtual.less +0 -65
- package/esm/table/util.d.ts +0 -14
- package/esm/table/util.js +0 -33
- package/lib/_util/easings.d.ts +0 -1
- package/lib/_util/extendsObject.d.ts +0 -4
- package/lib/_util/gapSize.d.ts +0 -3
- package/lib/_util/getScroll.d.ts +0 -3
- package/lib/_util/hooks/index.d.ts +0 -4
- package/lib/_util/hooks/useForceUpdate.d.ts +0 -2
- package/lib/_util/hooks/useOrientation.d.ts +0 -2
- package/lib/_util/hooks/useProxyImperativeHandle.d.ts +0 -4
- package/lib/_util/hooks/useSyncState.d.ts +0 -3
- package/lib/_util/index.d.ts +0 -3
- package/lib/_util/isNonNullable.d.ts +0 -2
- package/lib/_util/scrollTo.d.ts +0 -10
- package/lib/_util/type.d.ts +0 -52
- package/lib/_util/warning.d.ts +0 -31
- package/lib/blockHeader/index.d.ts +0 -58
- package/lib/blockHeader/style/index.d.ts +0 -2
- package/lib/button/index.d.ts +0 -10
- package/lib/button/style/index.d.ts +0 -2
- package/lib/collapsible/index.d.ts +0 -102
- package/lib/collapsible/style/index.d.ts +0 -1
- package/lib/collapsibleActionItems/index.d.ts +0 -24
- package/lib/collapsibleActionItems/style/index.d.ts +0 -2
- package/lib/flex/index.d.ts +0 -7
- package/lib/flex/interface.d.ts +0 -16
- package/lib/flex/style/index.d.ts +0 -2
- package/lib/flex/utils.d.ts +0 -7
- package/lib/formList/index.d.ts +0 -78
- package/lib/formList/style/index.d.ts +0 -2
- package/lib/index.d.ts +0 -17
- package/lib/overflowList/index.d.ts +0 -40
- package/lib/overflowList/style/index.d.ts +0 -2
- package/lib/resize/index.d.ts +0 -9
- package/lib/resizeObserver/index.d.ts +0 -45
- package/lib/splitter/Panel.d.ts +0 -7
- package/lib/splitter/SplitBar.d.ts +0 -24
- package/lib/splitter/Splitter.d.ts +0 -5
- package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
- package/lib/splitter/hooks/useItems.d.ts +0 -14
- package/lib/splitter/hooks/useResizable.d.ts +0 -10
- package/lib/splitter/hooks/useResize.d.ts +0 -6
- package/lib/splitter/hooks/useSizes.d.ts +0 -4
- package/lib/splitter/index.d.ts +0 -8
- package/lib/splitter/interface.d.ts +0 -69
- package/lib/splitter/style/index.d.ts +0 -2
- package/lib/statusTag/index.d.ts +0 -29
- package/lib/statusTag/style/index.d.ts +0 -2
- package/lib/style/index.d.ts +0 -1
- package/lib/table/InternalTable.d.ts +0 -32
- package/lib/table/InternalTable.js +0 -395
- package/lib/table/RcTable/VirtualTable.d.ts +0 -2
- package/lib/table/RcTable/VirtualTable.js +0 -17
- package/lib/table/RcTable/index.d.ts +0 -2
- package/lib/table/RcTable/index.js +0 -17
- package/lib/table/Table.d.ts +0 -17
- package/lib/table/Table.js +0 -37
- package/lib/table/TableMeasureRowContext.d.ts +0 -3
- package/lib/table/TableMeasureRowContext.js +0 -10
- package/lib/table/hooks/useContainerWidth.d.ts +0 -1
- package/lib/table/hooks/useContainerWidth.js +0 -20
- package/lib/table/index.d.ts +0 -7
- package/lib/table/index.js +0 -9
- package/lib/table/interface.d.ts +0 -196
- package/lib/table/interface.js +0 -8
- package/lib/table/style/bordered.less +0 -141
- package/lib/table/style/fixed.less +0 -88
- package/lib/table/style/index.d.ts +0 -2
- package/lib/table/style/index.js +0 -4
- package/lib/table/style/index.less +0 -150
- package/lib/table/style/selection.less +0 -90
- package/lib/table/style/sticky.less +0 -55
- package/lib/table/style/virtual.less +0 -65
- package/lib/table/util.d.ts +0 -14
- 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`
|
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
|
|
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';
|
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.
|
|
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
|
+
}
|
package/esm/_util/easings.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
|
package/esm/_util/gapSize.d.ts
DELETED
package/esm/_util/getScroll.d.ts
DELETED
package/esm/_util/index.d.ts
DELETED
package/esm/_util/scrollTo.d.ts
DELETED
|
@@ -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 {};
|
package/esm/_util/type.d.ts
DELETED
|
@@ -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 {};
|
package/esm/_util/warning.d.ts
DELETED
|
@@ -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,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
import type { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
4
|
-
import type { LabelTooltipType } from '../_util';
|
|
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?: {
|
|
27
|
-
expand?: number;
|
|
28
|
-
collapse?: number;
|
|
29
|
-
} | number;
|
|
30
|
-
/** 标题一行的样式类名 */
|
|
31
|
-
className?: string;
|
|
32
|
-
/** 标题的样式类名 */
|
|
33
|
-
style?: React.CSSProperties;
|
|
34
|
-
/** 展示内容(children)的样式类名 */
|
|
35
|
-
contentClassName?: string;
|
|
36
|
-
/** 展示内容(children)的样式 */
|
|
37
|
-
contentStyle?: React.CSSProperties;
|
|
38
|
-
/** 是否显示背景, 默认 true */
|
|
39
|
-
background?: boolean;
|
|
40
|
-
/** 当前展开状态 */
|
|
41
|
-
expand?: boolean;
|
|
42
|
-
/** 是否可展开, 默认 true */
|
|
43
|
-
expandable?: boolean;
|
|
44
|
-
/** 是否默认展开内容, 默认为 false */
|
|
45
|
-
defaultExpand?: boolean;
|
|
46
|
-
/** 展开/收起的内容 */
|
|
47
|
-
children?: React.ReactNode;
|
|
48
|
-
/** 展开/收起时的回调 */
|
|
49
|
-
onExpand?: (expand: boolean) => void;
|
|
50
|
-
/** 标题的样式 */
|
|
51
|
-
titleStyle?: React.CSSProperties;
|
|
52
|
-
/** 是否保留 DOM 结构, 默认 false */
|
|
53
|
-
keepDOM?: boolean;
|
|
54
|
-
/** 是否懒加载, 默认 false */
|
|
55
|
-
lazy?: boolean;
|
|
56
|
-
}
|
|
57
|
-
declare const BlockHeader: React.FC<IBlockHeaderProps>;
|
|
58
|
-
export default BlockHeader;
|
package/esm/button/index.d.ts
DELETED
|
@@ -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;
|