@dtjoy/dt-design 1.0.6 → 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 +5 -5
- package/esm/blockHeader/index.js +13 -15
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.js +2 -2
- 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 +7 -8
- package/lib/blockHeader/index.js +13 -12
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.js +2 -2
- 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/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
- 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/convertToTooltipProps.d.ts +0 -4
- package/esm/_util/convertToTooltipProps.js +0 -15
- 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/hooks/useZIndex.d.ts +0 -8
- package/esm/_util/hooks/useZIndex.js +0 -51
- 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/_util/warning.d.ts +0 -31
- package/esm/_util/zindexContext.d.ts +0 -3
- package/esm/_util/zindexContext.js +0 -6
- package/esm/blockHeader/index.d.ts +0 -48
- 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/convertToTooltipProps.d.ts +0 -4
- package/lib/_util/convertToTooltipProps.js +0 -21
- 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/hooks/useZIndex.d.ts +0 -8
- package/lib/_util/hooks/useZIndex.js +0 -59
- 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/_util/warning.d.ts +0 -31
- package/lib/_util/zindexContext.d.ts +0 -3
- package/lib/blockHeader/index.d.ts +0 -48
- 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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getColumnKey = void 0;
|
|
7
|
+
exports.getColumnPos = getColumnPos;
|
|
8
|
+
exports.safeColumnTitle = exports.renderColumnTitle = void 0;
|
|
9
|
+
const getColumnKey = (column, defaultKey) => {
|
|
10
|
+
if ('key' in column && column.key !== undefined && column.key !== null) {
|
|
11
|
+
return column.key;
|
|
12
|
+
}
|
|
13
|
+
if (column.dataIndex) {
|
|
14
|
+
return Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : column.dataIndex;
|
|
15
|
+
}
|
|
16
|
+
return defaultKey;
|
|
17
|
+
};
|
|
18
|
+
exports.getColumnKey = getColumnKey;
|
|
19
|
+
function getColumnPos(index, pos) {
|
|
20
|
+
return pos ? `${pos}-${index}` : `${index}`;
|
|
21
|
+
}
|
|
22
|
+
const renderColumnTitle = (title, props) => {
|
|
23
|
+
if (typeof title === 'function') {
|
|
24
|
+
return title(props);
|
|
25
|
+
}
|
|
26
|
+
return title;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Safe get column title
|
|
31
|
+
*
|
|
32
|
+
* Should filter [object Object]
|
|
33
|
+
*
|
|
34
|
+
* @param title
|
|
35
|
+
*/
|
|
36
|
+
exports.renderColumnTitle = renderColumnTitle;
|
|
37
|
+
const safeColumnTitle = (title, props) => {
|
|
38
|
+
const res = renderColumnTitle(title, props);
|
|
39
|
+
if (Object.prototype.toString.call(res) === '[object Object]') {
|
|
40
|
+
return '';
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
};
|
|
44
|
+
exports.safeColumnTitle = safeColumnTitle;
|
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
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
import { isValidElement } from 'react';
|
|
3
|
-
import isNonNullable from "./isNonNullable";
|
|
4
|
-
var convertToTooltipProps = function convertToTooltipProps(tooltip) {
|
|
5
|
-
if (!isNonNullable(tooltip)) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
if (_typeof(tooltip) === 'object' && ! /*#__PURE__*/isValidElement(tooltip)) {
|
|
9
|
-
return tooltip;
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
title: tooltip
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default convertToTooltipProps;
|
package/esm/_util/gapSize.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useOrientation';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare type ZIndexContainer = 'Modal' | 'Drawer' | 'Popover' | 'Popconfirm' | 'Tooltip' | 'Tour' | 'FloatButton';
|
|
2
|
-
export declare type ZIndexConsumer = 'SelectLike' | 'Dropdown' | 'DatePicker' | 'Menu' | 'ImagePreview';
|
|
3
|
-
export declare const CONTAINER_MAX_OFFSET: number;
|
|
4
|
-
export declare const containerBaseZIndexOffset: Record<ZIndexContainer, number>;
|
|
5
|
-
export declare const consumerBaseZIndexOffset: Record<ZIndexConsumer, number>;
|
|
6
|
-
declare type ReturnResult = [zIndex: number | undefined, contextZIndex: number];
|
|
7
|
-
export declare const useZIndex: (componentType: ZIndexContainer | ZIndexConsumer, customZIndex?: number) => ReturnResult;
|
|
8
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { devUseWarning } from "../warning";
|
|
3
|
-
import zIndexContext from "../zindexContext";
|
|
4
|
-
var DEFAULT_Z_INDEX_POPUP_BASE = 1000;
|
|
5
|
-
var CONTAINER_OFFSET = 100;
|
|
6
|
-
var CONTAINER_OFFSET_MAX_COUNT = 10;
|
|
7
|
-
export var CONTAINER_MAX_OFFSET = CONTAINER_OFFSET * CONTAINER_OFFSET_MAX_COUNT;
|
|
8
|
-
var CONTAINER_MAX_OFFSET_WITH_CHILDREN = CONTAINER_MAX_OFFSET + CONTAINER_OFFSET;
|
|
9
|
-
export var containerBaseZIndexOffset = {
|
|
10
|
-
Modal: CONTAINER_OFFSET,
|
|
11
|
-
Drawer: CONTAINER_OFFSET,
|
|
12
|
-
Popover: CONTAINER_OFFSET,
|
|
13
|
-
Popconfirm: CONTAINER_OFFSET,
|
|
14
|
-
Tooltip: CONTAINER_OFFSET,
|
|
15
|
-
Tour: CONTAINER_OFFSET,
|
|
16
|
-
FloatButton: CONTAINER_OFFSET
|
|
17
|
-
};
|
|
18
|
-
export var consumerBaseZIndexOffset = {
|
|
19
|
-
SelectLike: 50,
|
|
20
|
-
Dropdown: 50,
|
|
21
|
-
DatePicker: 50,
|
|
22
|
-
Menu: 50,
|
|
23
|
-
ImagePreview: 1
|
|
24
|
-
};
|
|
25
|
-
var isContainerType = function isContainerType(type) {
|
|
26
|
-
return type in containerBaseZIndexOffset;
|
|
27
|
-
};
|
|
28
|
-
export var useZIndex = function useZIndex(componentType, customZIndex) {
|
|
29
|
-
var zIndexPopupBase = DEFAULT_Z_INDEX_POPUP_BASE;
|
|
30
|
-
var parentZIndex = React.useContext(zIndexContext);
|
|
31
|
-
var isContainer = isContainerType(componentType);
|
|
32
|
-
var result;
|
|
33
|
-
if (customZIndex !== undefined) {
|
|
34
|
-
result = [customZIndex, customZIndex];
|
|
35
|
-
} else {
|
|
36
|
-
var _zIndex = parentZIndex !== null && parentZIndex !== void 0 ? parentZIndex : 0;
|
|
37
|
-
if (isContainer) {
|
|
38
|
-
_zIndex += (parentZIndex ? 0 : zIndexPopupBase) + containerBaseZIndexOffset[componentType];
|
|
39
|
-
} else {
|
|
40
|
-
_zIndex += consumerBaseZIndexOffset[componentType];
|
|
41
|
-
}
|
|
42
|
-
result = [customZIndex !== null && customZIndex !== void 0 ? customZIndex : _zIndex, _zIndex];
|
|
43
|
-
}
|
|
44
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
45
|
-
var warning = devUseWarning(componentType);
|
|
46
|
-
var maxZIndex = zIndexPopupBase + CONTAINER_MAX_OFFSET_WITH_CHILDREN;
|
|
47
|
-
var currentZIndex = result[0] || 0;
|
|
48
|
-
warning(customZIndex !== undefined || currentZIndex <= maxZIndex, 'usage', '`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.');
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
};
|
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 {};
|
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
|
-
declare type Warning = (valid: boolean, component: string, message?: string) => void;
|
|
5
|
-
declare const warning: Warning;
|
|
6
|
-
declare 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
|
-
declare 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,48 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import './style';
|
|
3
|
-
import { LabelTooltipType } from '../_util';
|
|
4
|
-
import type { CollapsibleProps } from '../collapsible';
|
|
5
|
-
export declare type SizeType = 'small' | 'middle' | 'large';
|
|
6
|
-
export interface IBlockHeaderProps extends CollapsibleProps {
|
|
7
|
-
/** 标题 */
|
|
8
|
-
title: ReactNode;
|
|
9
|
-
/** 标题前的图标,默认是一个色块 */
|
|
10
|
-
addonBefore?: ReactNode;
|
|
11
|
-
/** 标题后的提示说明文字 */
|
|
12
|
-
description?: ReactNode;
|
|
13
|
-
/** 默认展示为问号的tooltip */
|
|
14
|
-
tooltip?: LabelTooltipType;
|
|
15
|
-
/** 后缀自定义内容块 */
|
|
16
|
-
addonAfter?: ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* 小标题 font-size: 12px; line-height: 32px
|
|
19
|
-
* 中标题 font-size: 14px; line-height: 40px
|
|
20
|
-
* 大标题 font-size: 16px; line-height: 40px
|
|
21
|
-
* 默认 中标题
|
|
22
|
-
*/
|
|
23
|
-
size?: SizeType;
|
|
24
|
-
/** 自定义 Bottom 值 */
|
|
25
|
-
spaceBottom?: number;
|
|
26
|
-
/** 标题一行的样式类名 */
|
|
27
|
-
className?: string;
|
|
28
|
-
/** 标题的样式类名 */
|
|
29
|
-
style?: React.CSSProperties;
|
|
30
|
-
/** 展示内容(children)的样式类名 */
|
|
31
|
-
contentClassName?: string;
|
|
32
|
-
/** 展示内容(children)的样式 */
|
|
33
|
-
contentStyle?: React.CSSProperties;
|
|
34
|
-
/** 是否显示背景, 默认 true */
|
|
35
|
-
background?: boolean;
|
|
36
|
-
/** 当前展开状态 */
|
|
37
|
-
expand?: boolean;
|
|
38
|
-
/** 是否默认展开内容, 默认为 undefined */
|
|
39
|
-
defaultExpand?: boolean;
|
|
40
|
-
/** 展开/收起的内容 */
|
|
41
|
-
children?: ReactNode;
|
|
42
|
-
/** 展开/收起时的回调 */
|
|
43
|
-
onExpand?: (expand: boolean) => void;
|
|
44
|
-
/** 标题的样式 */
|
|
45
|
-
titleStyle?: React.CSSProperties;
|
|
46
|
-
}
|
|
47
|
-
declare const BlockHeader: React.FC<IBlockHeaderProps>;
|
|
48
|
-
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
|
-
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
|
|
10
|
-
export default _default;
|
|
@@ -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;
|