@dtjoy/dt-design 1.0.5 → 1.0.7
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/esm/_util/easings.js +9 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/warning.js +63 -0
- package/esm/blockHeader/index.js +10 -8
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.js +7 -15
- package/esm/button/style/index.less +52 -127
- package/esm/button/style/mixin.less +34 -42
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/flex/index.js +1 -1
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.less +45 -45
- package/esm/index.js +3 -1
- package/esm/overflowList/index.js +4 -3
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/statusTag/index.js +8 -8
- package/esm/style/index.less +1 -1
- package/esm/style/themes/index.less +2 -2
- package/esm/style/themes/variable.less +4 -0
- package/esm/table/InternalTable.js +429 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.js +2 -0
- package/esm/table/interface.js +4 -0
- package/esm/table/style/bordered.less +141 -0
- package/esm/table/style/fixed.less +88 -0
- package/esm/table/style/index.js +2 -0
- package/esm/table/style/index.less +150 -0
- package/esm/table/style/selection.less +90 -0
- package/esm/table/style/sticky.less +55 -0
- package/esm/table/style/virtual.less +65 -0
- package/esm/table/util.js +33 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/warning.js +75 -0
- package/lib/blockHeader/index.js +10 -8
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.js +6 -14
- package/lib/button/style/index.less +52 -127
- package/lib/button/style/mixin.less +34 -42
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/flex/index.js +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.less +45 -45
- package/lib/index.js +21 -2
- package/lib/overflowList/index.js +4 -3
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/statusTag/index.js +8 -8
- package/lib/style/index.less +1 -1
- package/lib/style/themes/index.less +2 -2
- package/lib/style/themes/variable.less +4 -0
- package/lib/table/InternalTable.js +395 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.js +10 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.js +9 -0
- package/lib/table/interface.js +8 -0
- package/lib/table/style/bordered.less +141 -0
- package/lib/table/style/fixed.less +88 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.less +150 -0
- package/lib/table/style/selection.less +90 -0
- package/lib/table/style/sticky.less +55 -0
- package/lib/table/style/virtual.less +65 -0
- package/lib/table/util.js +44 -0
- package/package.json +82 -66
- package/esm/_util/gapSize.d.ts +0 -3
- package/esm/_util/hooks/index.d.ts +0 -1
- package/esm/_util/hooks/useOrientation.d.ts +0 -2
- package/esm/_util/index.d.ts +0 -3
- package/esm/_util/isNonNullable.d.ts +0 -2
- package/esm/_util/type.d.ts +0 -52
- package/esm/blockHeader/index.d.ts +0 -47
- 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 -97
- 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 -77
- package/esm/formList/style/index.d.ts +0 -2
- package/esm/index.d.ts +0 -14
- package/esm/overflowList/index.d.ts +0 -39
- package/esm/overflowList/style/index.d.ts +0 -2
- package/esm/resize/index.d.ts +0 -8
- 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 -28
- package/esm/statusTag/style/index.d.ts +0 -2
- package/esm/style/index.d.ts +0 -1
- package/lib/_util/gapSize.d.ts +0 -3
- package/lib/_util/hooks/index.d.ts +0 -1
- package/lib/_util/hooks/useOrientation.d.ts +0 -2
- package/lib/_util/index.d.ts +0 -3
- package/lib/_util/isNonNullable.d.ts +0 -2
- package/lib/_util/type.d.ts +0 -52
- package/lib/blockHeader/index.d.ts +0 -47
- 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 -97
- 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 -77
- package/lib/formList/style/index.d.ts +0 -2
- package/lib/index.d.ts +0 -14
- package/lib/overflowList/index.d.ts +0 -39
- package/lib/overflowList/style/index.d.ts +0 -2
- package/lib/resize/index.d.ts +0 -8
- 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 -28
- package/lib/statusTag/style/index.d.ts +0 -2
- package/lib/style/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,85 +1,93 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtjoy/dt-design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "react-component",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "夕颜",
|
|
7
|
+
"email": "wx-zhaog@dtjoy.com",
|
|
8
|
+
"url": "https://github.com/ZhaoFxxkSky/dt-design"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
5
11
|
"repository": "https://github.com/ZhaoFxxkSky/dt-design",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react",
|
|
14
|
+
"react-component",
|
|
15
|
+
"ui-library",
|
|
16
|
+
"typescript",
|
|
17
|
+
"ant-design"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"esm/**/style/*",
|
|
21
|
+
"lib/**/style/*",
|
|
22
|
+
"**/style/*"
|
|
23
|
+
],
|
|
6
24
|
"main": "lib/index.js",
|
|
7
25
|
"module": "esm/index.js",
|
|
8
26
|
"types": "esm/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"esm",
|
|
29
|
+
"lib"
|
|
30
|
+
],
|
|
9
31
|
"scripts": {
|
|
10
32
|
"start": "npm run dev",
|
|
11
33
|
"dev": "dumi dev",
|
|
12
34
|
"build": "father build",
|
|
13
35
|
"build:watch": "father dev",
|
|
36
|
+
"format": "biome format --write .",
|
|
37
|
+
"lint:script": "eslint . --cache",
|
|
38
|
+
"lint:biome": "biome lint",
|
|
39
|
+
"biome": "biome check --write",
|
|
14
40
|
"test": "jest",
|
|
15
41
|
"docs:build": "dumi build",
|
|
16
42
|
"prepare": "husky install && dumi setup",
|
|
17
43
|
"doctor": "father doctor",
|
|
18
|
-
"lint": "npm run lint:
|
|
19
|
-
"lint:es-fix": "eslint \"
|
|
20
|
-
"lint:css-fix": "stylelint \"
|
|
21
|
-
"lint:css": "stylelint \"
|
|
22
|
-
"lint:es": "eslint \"
|
|
44
|
+
"lint": "npm run tsc && npm run lint:script && npm run lint:biome",
|
|
45
|
+
"lint:es-fix": "eslint \"components/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
46
|
+
"lint:css-fix": "stylelint \"components/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\" --fix",
|
|
47
|
+
"lint:css": "stylelint \"components/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\"",
|
|
48
|
+
"lint:es": "eslint \"components/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\"",
|
|
23
49
|
"prepublishOnly": "npm run build",
|
|
24
50
|
"deploy": "npm run docs:build && gh-pages -d docs-dist",
|
|
25
|
-
"release": "./scripts/release.sh"
|
|
51
|
+
"release": "./scripts/release.sh",
|
|
52
|
+
"tsc": "tsc --noEmit",
|
|
53
|
+
"tsc:old": "tsc --noEmit -p tsconfig-old-react.json"
|
|
26
54
|
},
|
|
27
|
-
"author": {
|
|
28
|
-
"name": "夕颜",
|
|
29
|
-
"email": "wx-zhaog@dtjoy.com",
|
|
30
|
-
"url": "https://github.com/ZhaoFxxkSky/dt-design"
|
|
31
|
-
},
|
|
32
|
-
"license": "MIT",
|
|
33
|
-
"files": [
|
|
34
|
-
"lib",
|
|
35
|
-
"esm"
|
|
36
|
-
],
|
|
37
|
-
"sideEffects": [
|
|
38
|
-
"esm/**/style/*",
|
|
39
|
-
"lib/**/style/*",
|
|
40
|
-
"**/style/*"
|
|
41
|
-
],
|
|
42
|
-
"keywords": [
|
|
43
|
-
"react",
|
|
44
|
-
"react-component",
|
|
45
|
-
"ui-library",
|
|
46
|
-
"typescript",
|
|
47
|
-
"ant-design"
|
|
48
|
-
],
|
|
49
55
|
"commitlint": {
|
|
50
56
|
"extends": [
|
|
51
57
|
"@commitlint/config-conventional"
|
|
52
58
|
]
|
|
53
59
|
},
|
|
54
|
-
"lint-staged": {
|
|
55
|
-
"*.{md,json}": [
|
|
56
|
-
"prettier --write --no-error-on-unmatched-pattern"
|
|
57
|
-
],
|
|
58
|
-
"*.{css,scss}": [
|
|
59
|
-
"stylelint --fix"
|
|
60
|
-
],
|
|
61
|
-
"*.{js,jsx}": [
|
|
62
|
-
"eslint --fix",
|
|
63
|
-
"prettier --write"
|
|
64
|
-
],
|
|
65
|
-
"*.{ts,tsx}": [
|
|
66
|
-
"eslint --fix",
|
|
67
|
-
"prettier --parser=typescript --write"
|
|
68
|
-
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
60
|
"publishConfig": {
|
|
72
61
|
"access": "public"
|
|
73
62
|
},
|
|
74
63
|
"peerDependencies": {
|
|
64
|
+
"antd": "^4.x",
|
|
75
65
|
"react": ">=16.9.0",
|
|
76
|
-
"react-dom": ">=16.9.0"
|
|
77
|
-
|
|
66
|
+
"react-dom": ">=16.9.0"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@ant-design/icons": "^4.8.3",
|
|
70
|
+
"@dtinsight/dt-utils": "^1.3.1",
|
|
71
|
+
"@rc-component/table": "^1.9.1",
|
|
72
|
+
"@rc-component/util": "^1.7.0",
|
|
73
|
+
"clsx": "^2.1.1",
|
|
74
|
+
"immer": "~10.1.1",
|
|
75
|
+
"lodash-es": "^4.17.21",
|
|
76
|
+
"rc-drawer": "~5.1.0",
|
|
77
|
+
"rc-resize-observer": "^1.4.3",
|
|
78
|
+
"rc-util": "^5.44.4",
|
|
79
|
+
"rc-virtual-list": "^3.4.13"
|
|
78
80
|
},
|
|
79
81
|
"devDependencies": {
|
|
82
|
+
"@antfu/eslint-config": "^6.6.1",
|
|
83
|
+
"@biomejs/biome": "^2.3.10",
|
|
80
84
|
"@commitlint/cli": "^17.1.2",
|
|
81
85
|
"@commitlint/config-conventional": "^17.1.0",
|
|
86
|
+
"@eslint-react/eslint-plugin": "^2.5.0",
|
|
82
87
|
"@faker-js/faker": "^7.6.0",
|
|
88
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
89
|
+
"@npmcli/run-script": "^10.0.3",
|
|
90
|
+
"@prettier/sync": "^0.6.1",
|
|
83
91
|
"@testing-library/jest-dom": "^5.16.5",
|
|
84
92
|
"@testing-library/react": "^13.4.0",
|
|
85
93
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -88,6 +96,7 @@
|
|
|
88
96
|
"@types/lodash-es": "^4.17.12",
|
|
89
97
|
"@types/node": "^24.3.1",
|
|
90
98
|
"@types/react": "^18.0.0",
|
|
99
|
+
"@types/react-dom": "18.0.0",
|
|
91
100
|
"@types/react-resizable": "^3.0.8",
|
|
92
101
|
"@types/react-syntax-highlighter": "~15.5.13",
|
|
93
102
|
"@types/shortid": "^0.0.31",
|
|
@@ -96,10 +105,15 @@
|
|
|
96
105
|
"ant-design-testing": "^1.1.0",
|
|
97
106
|
"babel-plugin-import": "^1.13.8",
|
|
98
107
|
"cz-conventional-changelog": "^3.3.0",
|
|
99
|
-
"dumi": "
|
|
100
|
-
"eslint": "^
|
|
101
|
-
"
|
|
102
|
-
"
|
|
108
|
+
"dumi": "~2.4.21",
|
|
109
|
+
"eslint": "^9.39.2",
|
|
110
|
+
"eslint-plugin-compat": "^6.0.2",
|
|
111
|
+
"eslint-plugin-jest": "^29.12.0",
|
|
112
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
113
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
114
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
115
|
+
"father": "4.6.13",
|
|
116
|
+
"gh-pages": "^6.3.0",
|
|
103
117
|
"husky": "^8.0.1",
|
|
104
118
|
"jest": "^29.3.1",
|
|
105
119
|
"jest-environment-jsdom": "^29.3.1",
|
|
@@ -112,22 +126,15 @@
|
|
|
112
126
|
"react-test-renderer": "^18.2.0",
|
|
113
127
|
"resize-observer-polyfill": "^1.5.1",
|
|
114
128
|
"standard-version": "^9.5.0",
|
|
115
|
-
"stylelint": "^14.9.
|
|
129
|
+
"stylelint": "^14.9.0",
|
|
130
|
+
"stylelint-config-prettier": "^9.0.2",
|
|
131
|
+
"stylelint-config-rational-order": "^0.1.2",
|
|
132
|
+
"stylelint-config-standard": "^29.0.0",
|
|
133
|
+
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
|
|
134
|
+
"stylelint-order": "^5.0.0",
|
|
116
135
|
"ts-jest": "^29.0.3",
|
|
117
|
-
"typescript": "~
|
|
136
|
+
"typescript": "~5.9.3"
|
|
118
137
|
},
|
|
119
|
-
"dependencies": {
|
|
120
|
-
"@ant-design/icons": "^4.8.3",
|
|
121
|
-
"@dtinsight/dt-utils": "^1.3.1",
|
|
122
|
-
"rc-util": "^5.44.4",
|
|
123
|
-
"classnames": "^2.2.6",
|
|
124
|
-
"immer": "~10.1.1",
|
|
125
|
-
"lodash-es": "^4.17.21",
|
|
126
|
-
"rc-drawer": "~5.1.0",
|
|
127
|
-
"rc-resize-observer": "^1.4.3",
|
|
128
|
-
"rc-virtual-list": "^3.4.13"
|
|
129
|
-
},
|
|
130
|
-
|
|
131
138
|
"config": {
|
|
132
139
|
"commitizen": {
|
|
133
140
|
"path": "./node_modules/cz-conventional-changelog"
|
|
@@ -135,5 +142,14 @@
|
|
|
135
142
|
},
|
|
136
143
|
"resolutions": {
|
|
137
144
|
"rc-motion": "2.6.2"
|
|
145
|
+
},
|
|
146
|
+
"lint-staged": {
|
|
147
|
+
"*.{ts,tsx,js,jsx,css,mjs,json}": [
|
|
148
|
+
"biome check --write --no-errors-on-unmatched",
|
|
149
|
+
"eslint"
|
|
150
|
+
],
|
|
151
|
+
"*.{md,yml}": [
|
|
152
|
+
"prettier --ignore-unknown --write"
|
|
153
|
+
]
|
|
138
154
|
}
|
|
139
155
|
}
|
package/esm/_util/gapSize.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useOrientation';
|
package/esm/_util/index.d.ts
DELETED
package/esm/_util/type.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
3
|
-
/** https://github.com/Microsoft/TypeScript/issues/29729 */
|
|
4
|
-
export declare type LiteralUnion<T, U extends Primitive = string> = T | (U & Record<never, never>);
|
|
5
|
-
export declare type AnyObject = Record<string, any>;
|
|
6
|
-
export declare 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 declare 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 declare type GetProp<T extends React.ComponentType<any> | object, PropName extends keyof GetProps<T>> = NonNullable<GetProps<T>[PropName]>;
|
|
35
|
-
declare type ReactRefComponent<Props extends {
|
|
36
|
-
ref?: React.Ref<any> | string;
|
|
37
|
-
}> = (props: Props) => React.ReactNode;
|
|
38
|
-
declare 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 declare 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 declare type GetContextProps<T> = T extends React.Context<infer P> ? P : never;
|
|
51
|
-
export declare type GetContextProp<T extends React.Context<any>, PropName extends keyof GetContextProps<T>> = NonNullable<GetContextProps<T>[PropName]>;
|
|
52
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
import { LabelTooltipType } from '../_util';
|
|
4
|
-
export declare type SizeType = 'small' | 'middle' | 'large';
|
|
5
|
-
export interface IBlockHeaderProps {
|
|
6
|
-
/** 标题 */
|
|
7
|
-
title: ReactNode;
|
|
8
|
-
/** 标题前的图标,默认是一个色块 */
|
|
9
|
-
addonBefore?: ReactNode;
|
|
10
|
-
/** 标题后的提示说明文字 */
|
|
11
|
-
description?: ReactNode;
|
|
12
|
-
/** 默认展示为问号的tooltip */
|
|
13
|
-
tooltip?: LabelTooltipType;
|
|
14
|
-
/** 后缀自定义内容块 */
|
|
15
|
-
addonAfter?: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* 小标题 font-size: 12px; line-height: 32px
|
|
18
|
-
* 中标题 font-size: 14px; line-height: 40px
|
|
19
|
-
* 大标题 font-size: 16px; line-height: 40px
|
|
20
|
-
* 默认 中标题
|
|
21
|
-
*/
|
|
22
|
-
size?: SizeType;
|
|
23
|
-
/** 自定义 Bottom 值 */
|
|
24
|
-
spaceBottom?: number;
|
|
25
|
-
/** 标题一行的样式类名 */
|
|
26
|
-
className?: string;
|
|
27
|
-
/** 标题的样式类名 */
|
|
28
|
-
style?: React.CSSProperties;
|
|
29
|
-
/** 展示内容(children)的样式类名 */
|
|
30
|
-
contentClassName?: string;
|
|
31
|
-
/** 展示内容(children)的样式 */
|
|
32
|
-
contentStyle?: React.CSSProperties;
|
|
33
|
-
/** 是否显示背景, 默认 true */
|
|
34
|
-
background?: boolean;
|
|
35
|
-
/** 当前展开状态 */
|
|
36
|
-
expand?: boolean;
|
|
37
|
-
/** 是否默认展开内容, 默认为 undefined */
|
|
38
|
-
defaultExpand?: boolean;
|
|
39
|
-
/** 展开/收起的内容 */
|
|
40
|
-
children?: ReactNode;
|
|
41
|
-
/** 展开/收起时的回调 */
|
|
42
|
-
onExpand?: (expand: boolean) => void;
|
|
43
|
-
/** 标题的样式 */
|
|
44
|
-
titleStyle?: React.CSSProperties;
|
|
45
|
-
}
|
|
46
|
-
declare const BlockHeader: React.FC<IBlockHeaderProps>;
|
|
47
|
-
export default BlockHeader;
|
package/esm/button/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonProps as AntdButtonProps } from 'antd';
|
|
3
|
-
import { ButtonType as AntdButtonType } from 'antd/es/button';
|
|
4
|
-
import './style';
|
|
5
|
-
declare type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
|
|
6
|
-
export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
|
|
7
|
-
type?: ButtonType;
|
|
8
|
-
}
|
|
9
|
-
export default function Button({ className, icon, children, size, type, ...rest }: ButtonProps): React.JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
interface BaseComponentProps {
|
|
4
|
-
/**
|
|
5
|
-
* 类名
|
|
6
|
-
*/
|
|
7
|
-
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
* 样式
|
|
10
|
-
*/
|
|
11
|
-
style?: React.CSSProperties;
|
|
12
|
-
/**
|
|
13
|
-
* id
|
|
14
|
-
*/
|
|
15
|
-
id?: string;
|
|
16
|
-
'data-*'?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CollapsibleProps extends BaseComponentProps {
|
|
19
|
-
/**
|
|
20
|
-
* 是否开启动画
|
|
21
|
-
*/
|
|
22
|
-
motion?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* 子元素
|
|
25
|
-
*/
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* 是否展开内容区域
|
|
29
|
-
*/
|
|
30
|
-
isOpen?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 动画执行的时间
|
|
33
|
-
*/
|
|
34
|
-
duration?: number;
|
|
35
|
-
/**
|
|
36
|
-
* 是否保留隐藏的面板 DOM 树,默认销毁
|
|
37
|
-
*/
|
|
38
|
-
keepDOM?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* 配合 keepDOM 使用,为 true 时挂载时不会渲染组件
|
|
41
|
-
*/
|
|
42
|
-
lazyRender?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* 折叠高度
|
|
45
|
-
*/
|
|
46
|
-
collapseHeight?: number;
|
|
47
|
-
/**
|
|
48
|
-
* 当 reCalcKey 改变时,将重新计算子节点的高度,用于优化动态渲染时的计算
|
|
49
|
-
*/
|
|
50
|
-
reCalcKey?: number | string;
|
|
51
|
-
/**
|
|
52
|
-
* 动画结束的回调
|
|
53
|
-
*/
|
|
54
|
-
onMotionEnd?: () => void;
|
|
55
|
-
/**
|
|
56
|
-
* 是否开启淡入淡出
|
|
57
|
-
*/
|
|
58
|
-
fade?: boolean;
|
|
59
|
-
}
|
|
60
|
-
interface CollapsibleState {
|
|
61
|
-
domInRenderTree: boolean;
|
|
62
|
-
domHeight: number;
|
|
63
|
-
visible: boolean;
|
|
64
|
-
isTransitioning: boolean;
|
|
65
|
-
cacheIsOpen: boolean;
|
|
66
|
-
}
|
|
67
|
-
declare class Collapsible extends React.Component<CollapsibleProps, CollapsibleState> {
|
|
68
|
-
static defaultProps: {
|
|
69
|
-
isOpen: boolean;
|
|
70
|
-
duration: number;
|
|
71
|
-
motion: boolean;
|
|
72
|
-
keepDOM: boolean;
|
|
73
|
-
lazyRender: boolean;
|
|
74
|
-
collapseHeight: number;
|
|
75
|
-
fade: boolean;
|
|
76
|
-
};
|
|
77
|
-
prefixCls: string;
|
|
78
|
-
foundation: any;
|
|
79
|
-
private domRef;
|
|
80
|
-
private resizeObserver;
|
|
81
|
-
private hasBeenRendered;
|
|
82
|
-
static displayName: string;
|
|
83
|
-
constructor(props: CollapsibleProps);
|
|
84
|
-
private handleResize;
|
|
85
|
-
private isChildrenInRenderTree;
|
|
86
|
-
static getEntryInfo: (entry: ResizeObserverEntry) => {
|
|
87
|
-
isShown: boolean;
|
|
88
|
-
height: number;
|
|
89
|
-
};
|
|
90
|
-
private getDataAttr;
|
|
91
|
-
componentDidMount(): void;
|
|
92
|
-
static getDerivedStateFromProps(props: CollapsibleProps, prevState: CollapsibleState): Partial<CollapsibleState>;
|
|
93
|
-
componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>): void;
|
|
94
|
-
componentWillUnmount(): void;
|
|
95
|
-
render(): React.JSX.Element;
|
|
96
|
-
}
|
|
97
|
-
export default Collapsible;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { ButtonProps } from "..";
|
|
4
|
-
import type { DropDownProps } from 'antd';
|
|
5
|
-
import './style';
|
|
6
|
-
export declare type ActionItem = {
|
|
7
|
-
key: React.Key;
|
|
8
|
-
name: ReactNode;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
render?: () => ReactNode;
|
|
11
|
-
};
|
|
12
|
-
interface ICollapsibleActionItems {
|
|
13
|
-
maxCount?: number;
|
|
14
|
-
actionItems: ActionItem[];
|
|
15
|
-
className?: string;
|
|
16
|
-
divider?: ReactNode;
|
|
17
|
-
collapseIcon?: ReactNode;
|
|
18
|
-
dropdownProps?: Partial<DropDownProps>;
|
|
19
|
-
buttonProps?: Partial<ButtonProps>;
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
onItemClick?: (key: React.Key) => void;
|
|
22
|
-
}
|
|
23
|
-
declare const CollapsibleActionItems: React.FC<ICollapsibleActionItems>;
|
|
24
|
-
export default CollapsibleActionItems;
|
package/esm/flex/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
import type { FlexProps } from './interface';
|
|
4
|
-
declare const Flex: React.ForwardRefExoticComponent<FlexProps<import("../_util/type").AnyObject> & {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
-
export default Flex;
|
package/esm/flex/interface.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
3
|
-
import type { Orientation } from '../_util/hooks';
|
|
4
|
-
import type { AnyObject, CustomComponent, LiteralUnion } from '../_util/type';
|
|
5
|
-
export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
prefixCls?: string;
|
|
7
|
-
rootClassName?: string;
|
|
8
|
-
vertical?: boolean;
|
|
9
|
-
orientation?: Orientation;
|
|
10
|
-
wrap?: boolean | React.CSSProperties['flexWrap'];
|
|
11
|
-
justify?: React.CSSProperties['justifyContent'];
|
|
12
|
-
align?: React.CSSProperties['alignItems'];
|
|
13
|
-
flex?: React.CSSProperties['flex'];
|
|
14
|
-
gap?: LiteralUnion<SizeType, React.CSSProperties['gap']>;
|
|
15
|
-
component?: CustomComponent<P>;
|
|
16
|
-
}
|
package/esm/flex/utils.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FlexProps } from './interface';
|
|
3
|
-
export declare const flexWrapValues: React.CSSProperties['flexWrap'][];
|
|
4
|
-
export declare const justifyContentValues: React.CSSProperties['justifyContent'][];
|
|
5
|
-
export declare const alignItemsValues: React.CSSProperties['alignItems'][];
|
|
6
|
-
declare const createFlexClassNames: (prefixCls: string, props: FlexProps) => string;
|
|
7
|
-
export default createFlexClassNames;
|
package/esm/formList/index.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { type FormListFieldData, type TableProps } from 'antd';
|
|
3
|
-
import type { FormItemProps, FormListProps, RuleObject, RuleRender } from 'antd/lib/form';
|
|
4
|
-
import type { ColumnType as TableColumnType } from 'antd/lib/table';
|
|
5
|
-
import './style';
|
|
6
|
-
declare type NotNullRowSelection = NonNullable<TableProps<any>['rowSelection']>;
|
|
7
|
-
/**
|
|
8
|
-
* Override NamePath parameters type
|
|
9
|
-
*/
|
|
10
|
-
declare type OverrideParameters = (string | number)[];
|
|
11
|
-
declare type RcFormInstance = Parameters<RuleRender>[0];
|
|
12
|
-
declare type RawPanelRender = NonNullable<TableProps<any>['footer']>;
|
|
13
|
-
/**
|
|
14
|
-
* Override PanelRender type
|
|
15
|
-
*/
|
|
16
|
-
declare type PanelRenderFunc = (...args: Parameters<FormListProps['children']>) => ReturnType<RawPanelRender>;
|
|
17
|
-
/**
|
|
18
|
-
* Form.Table 组件类型
|
|
19
|
-
*/
|
|
20
|
-
export interface IFormTableProps
|
|
21
|
-
/**
|
|
22
|
-
* Support all FormListProps except children for which is re-defined in this component
|
|
23
|
-
* and prefixCls for which is not expected to be supported
|
|
24
|
-
*/
|
|
25
|
-
extends Pick<FormListProps, 'name' | 'rules' | 'initialValue'>,
|
|
26
|
-
/**
|
|
27
|
-
* Support all TableProps except
|
|
28
|
-
* - re-define columns and re-defined rowSelection
|
|
29
|
-
* - and pagination which is expect to be not supported in Form.Table
|
|
30
|
-
* - and className which is renamed to tableClassName
|
|
31
|
-
* - and rowKey, dataSource for which are defined and not allowed to be modified
|
|
32
|
-
* - and footer, title, summary for which are re-defined to pass form's operation
|
|
33
|
-
*/
|
|
34
|
-
Omit<TableProps<any>, 'columns' | 'rowSelection' | 'pagination' | 'className' | 'rowKey' | 'dataSource' | 'footer' | 'title' | 'summary'> {
|
|
35
|
-
/**
|
|
36
|
-
* 表格列的配置描述
|
|
37
|
-
*/
|
|
38
|
-
columns?: ColumnType[] | ((...args: Parameters<FormListProps['children']>) => ColumnType[]);
|
|
39
|
-
/**
|
|
40
|
-
* Table 的 className
|
|
41
|
-
*/
|
|
42
|
-
tableClassName?: TableProps<any>['className'];
|
|
43
|
-
/**
|
|
44
|
-
* 表格行是否可选择
|
|
45
|
-
*/
|
|
46
|
-
rowSelection?: Omit<NotNullRowSelection, 'getCheckboxProps'> & {
|
|
47
|
-
getCheckboxProps?: (field: FormListFieldData) => ReturnType<NonNullable<NotNullRowSelection['getCheckboxProps']>>;
|
|
48
|
-
};
|
|
49
|
-
title?: PanelRenderFunc;
|
|
50
|
-
footer?: PanelRenderFunc;
|
|
51
|
-
summary?: PanelRenderFunc;
|
|
52
|
-
}
|
|
53
|
-
export interface ColumnType
|
|
54
|
-
/**
|
|
55
|
-
* Support all FormItemProps, and re-defined `rules` and `dependencies`
|
|
56
|
-
*/
|
|
57
|
-
extends Omit<FormItemProps, 'rules' | 'dependencies' | 'prefixCls' | 'children'>,
|
|
58
|
-
/**
|
|
59
|
-
* Support all TableColumnType, and re-defined `render`
|
|
60
|
-
*/
|
|
61
|
-
Omit<TableColumnType<FormListFieldData>, 'render'> {
|
|
62
|
-
/**
|
|
63
|
-
* 设置依赖字段, 支持通过回调函数获取当前字段名
|
|
64
|
-
*/
|
|
65
|
-
dependencies?: ((namePath: OverrideParameters) => FormItemProps['dependencies']) | FormItemProps['dependencies'];
|
|
66
|
-
/**
|
|
67
|
-
* 校验规则,设置字段的校验逻辑,支持通过回调函数获取当前字段名
|
|
68
|
-
*/
|
|
69
|
-
rules?: (RuleObject | ((form: RcFormInstance, namePath: OverrideParameters) => RuleObject))[];
|
|
70
|
-
/**
|
|
71
|
-
* 渲染函数
|
|
72
|
-
* @param formInstance 只有在设置了 `dependencies` 的情况下才有该参数
|
|
73
|
-
*/
|
|
74
|
-
render?: (fieldData: FormListFieldData, namePath: OverrideParameters, formInstance?: RcFormInstance) => ReactNode;
|
|
75
|
-
}
|
|
76
|
-
export default function InternalTable({ name, rules, initialValue, ...tableProps }: IFormTableProps): React.JSX.Element;
|
|
77
|
-
export {};
|
package/esm/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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,39 +0,0 @@
|
|
|
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;
|