@jiaozhiye/qm-design-react 1.12.13 → 1.12.15
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/lib/config-provider/src/config-provider.d.ts +2 -0
- package/lib/form/src/types.d.ts +1 -0
- package/lib/form/src/utils.d.ts +0 -1
- package/lib/form/style/index.less +16 -14
- package/lib/index.d.ts +4 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/index.d.ts +0 -1
- package/lib/locale/index.js +0 -1
- package/lib/locale/lang/en.d.ts +5 -0
- package/lib/locale/lang/en.js +5 -0
- package/lib/locale/lang/zh-cn.d.ts +5 -0
- package/lib/locale/lang/zh-cn.js +5 -0
- package/lib/pivot-grid/style/grid-layout.less +9 -3
- package/lib/style/index.css +69 -19
- package/lib/style/index.less +1 -0
- package/lib/style/index.min.css +1 -1
- package/lib/style/mixins/reset.less +9 -0
- package/lib/table/src/context/index.d.ts +9 -2
- package/lib/table/src/hooks/useImperativeMethod.d.ts +1 -0
- package/lib/table/src/hooks/useTableCore.d.ts +10 -2
- package/lib/table/src/hooks/useTableState.d.ts +8 -2
- package/lib/table/src/table/props.d.ts +2 -2
- package/lib/table/src/table/types.d.ts +5 -4
- package/lib/table/style/header.less +1 -1
- package/lib/translate/index.d.ts +3 -0
- package/lib/translate/src/translate.d.ts +16 -0
- package/lib/translate/src/use-tooltip.d.ts +9 -0
- package/lib/translate/src/use-translation.d.ts +12 -0
- package/lib/translate/style/index.less +32 -0
- package/package.json +1 -1
|
@@ -27,6 +27,15 @@
|
|
|
27
27
|
white-space: nowrap;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
.text-ellipsis-2 () {
|
|
31
|
+
display: -webkit-box;
|
|
32
|
+
-webkit-box-orient: vertical;
|
|
33
|
+
-webkit-line-clamp: 2;
|
|
34
|
+
line-clamp: 2;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
.user-select-none() {
|
|
31
40
|
-moz-user-select: none;
|
|
32
41
|
-webkit-user-select: none;
|
|
@@ -53,8 +53,14 @@ export type ITableContext = {
|
|
|
53
53
|
createGroupData: (records: IRecord[]) => IRecord[];
|
|
54
54
|
createAllExpandedKeys: () => IRowKey[];
|
|
55
55
|
updateTableFlatData: () => void;
|
|
56
|
-
setSorter: (
|
|
57
|
-
|
|
56
|
+
setSorter: (option: {
|
|
57
|
+
payload: ITableState['sorter'];
|
|
58
|
+
forceUpdate?: boolean;
|
|
59
|
+
}) => void;
|
|
60
|
+
setFilters: (option: {
|
|
61
|
+
payload: ITableState['filters'];
|
|
62
|
+
forceUpdate?: boolean;
|
|
63
|
+
}) => void;
|
|
58
64
|
setSuperFilters: (options: ITableState['superFilters']) => void;
|
|
59
65
|
setPagerFilter: (value: ITableState['pagerFilter']) => void;
|
|
60
66
|
setHighlightKey: (rowKey: IRowKey) => void;
|
|
@@ -82,6 +88,7 @@ export type ITableContext = {
|
|
|
82
88
|
clearTableFilter: () => void;
|
|
83
89
|
clearSuperFilters: () => void;
|
|
84
90
|
clearPagerFilter: () => void;
|
|
91
|
+
clearActivedCell: () => void;
|
|
85
92
|
clearRowSelection: () => void;
|
|
86
93
|
clearRowHighlight: () => void;
|
|
87
94
|
};
|
|
@@ -43,6 +43,7 @@ type IExtra = {
|
|
|
43
43
|
clearTableFilter: () => void;
|
|
44
44
|
clearSuperFilters: () => void;
|
|
45
45
|
clearPagerFilter: () => void;
|
|
46
|
+
clearActivedCell: () => void;
|
|
46
47
|
clearTableLog: () => void;
|
|
47
48
|
};
|
|
48
49
|
declare const useImperativeMethod: <T extends React.ForwardedRef<TableRef>>(ref: T, extra: IExtra) => void;
|
|
@@ -36,10 +36,17 @@ type IExtra = {
|
|
|
36
36
|
setPingRight: (value: boolean) => void;
|
|
37
37
|
setPingLeft: (value: boolean) => void;
|
|
38
38
|
setSpinning: (value: boolean) => void;
|
|
39
|
-
setSorter: (
|
|
40
|
-
|
|
39
|
+
setSorter: (option: {
|
|
40
|
+
payload: ITableState['sorter'];
|
|
41
|
+
forceUpdate?: boolean;
|
|
42
|
+
}) => void;
|
|
43
|
+
setFilters: (option: {
|
|
44
|
+
payload: ITableState['filters'];
|
|
45
|
+
forceUpdate?: boolean;
|
|
46
|
+
}) => void;
|
|
41
47
|
setSuperFilters: (options: ITableState['superFilters']) => void;
|
|
42
48
|
setPagerFilter: (options: ITableState['pagerFilter']) => void;
|
|
49
|
+
setActivedCell: (option: ITableState['activedCell']) => void;
|
|
43
50
|
setSelectionKeys: (rowKeys: IRowKey[]) => void;
|
|
44
51
|
setRowExpandedKeys: (rowKeys: IRowKey[]) => void;
|
|
45
52
|
setHighlightKey: (rowKey: IRowKey) => void;
|
|
@@ -83,6 +90,7 @@ declare const useTableCore: <T extends ITableProps>(props: T, extra: IExtra) =>
|
|
|
83
90
|
clearTableFilter: () => void;
|
|
84
91
|
clearSuperFilters: () => void;
|
|
85
92
|
clearPagerFilter: () => void;
|
|
93
|
+
clearActivedCell: () => void;
|
|
86
94
|
clearRowSelection: () => void;
|
|
87
95
|
clearRowHighlight: () => void;
|
|
88
96
|
clearTableLog: () => void;
|
|
@@ -38,9 +38,15 @@ declare const useTableState: <T extends ITableProps>(props: T) => {
|
|
|
38
38
|
tableFlatData: IRecord<any>[];
|
|
39
39
|
setTableFlatData: React.Dispatch<React.SetStateAction<IRecord<any>[]>>;
|
|
40
40
|
filters: IFilter;
|
|
41
|
-
setFilters: React.Dispatch<
|
|
41
|
+
setFilters: React.Dispatch<{
|
|
42
|
+
payload: IFilter;
|
|
43
|
+
forceUpdate?: boolean | undefined;
|
|
44
|
+
}>;
|
|
42
45
|
sorter: ISorter;
|
|
43
|
-
setSorter: React.Dispatch<
|
|
46
|
+
setSorter: React.Dispatch<{
|
|
47
|
+
payload: ISorter;
|
|
48
|
+
forceUpdate?: boolean | undefined;
|
|
49
|
+
}>;
|
|
44
50
|
superFilters: ISuperFilter[];
|
|
45
51
|
setSuperFilters: React.Dispatch<ISuperFilter[]>;
|
|
46
52
|
pagerFilter: IPageFilter;
|
|
@@ -71,6 +71,7 @@ export declare const propTypes: {
|
|
|
71
71
|
fixed: PropTypes.Requireable<string>;
|
|
72
72
|
align: PropTypes.Requireable<string>;
|
|
73
73
|
theadAlign: PropTypes.Requireable<string>;
|
|
74
|
+
theadWrap: PropTypes.Requireable<boolean>;
|
|
74
75
|
printFixed: PropTypes.Requireable<boolean>;
|
|
75
76
|
hidden: PropTypes.Requireable<boolean>;
|
|
76
77
|
noAuth: PropTypes.Requireable<boolean>;
|
|
@@ -94,6 +95,7 @@ export declare const propTypes: {
|
|
|
94
95
|
formatType: PropTypes.Requireable<string>;
|
|
95
96
|
required: PropTypes.Requireable<boolean>;
|
|
96
97
|
canCopy: PropTypes.Requireable<boolean>;
|
|
98
|
+
translate: PropTypes.Requireable<boolean>;
|
|
97
99
|
editRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
100
|
dictItems: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
99
101
|
text: PropTypes.Requireable<string>;
|
|
@@ -187,8 +189,6 @@ export declare const propTypes: {
|
|
|
187
189
|
virtual: PropTypes.Requireable<boolean>;
|
|
188
190
|
overscan: PropTypes.Requireable<number>;
|
|
189
191
|
doubleXScrollbar: PropTypes.Requireable<boolean>;
|
|
190
|
-
}>>;
|
|
191
|
-
treeConfig: PropTypes.Requireable<PropTypes.InferProps<{
|
|
192
192
|
expandIconColumn: PropTypes.Requireable<string>;
|
|
193
193
|
}>>;
|
|
194
194
|
expandable: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -221,8 +221,6 @@ export type ITableConfig = {
|
|
|
221
221
|
virtual?: boolean;
|
|
222
222
|
overscan?: number;
|
|
223
223
|
doubleXScrollbar?: boolean;
|
|
224
|
-
};
|
|
225
|
-
export type ITreeConfig = {
|
|
226
224
|
expandIconColumn?: string;
|
|
227
225
|
};
|
|
228
226
|
export type IExpandable = {
|
|
@@ -296,6 +294,7 @@ export type IColumn = {
|
|
|
296
294
|
fixed?: IFixed;
|
|
297
295
|
align?: IAlign;
|
|
298
296
|
theadAlign?: IAlign;
|
|
297
|
+
theadWrap?: boolean;
|
|
299
298
|
printFixed?: boolean;
|
|
300
299
|
hidden?: boolean;
|
|
301
300
|
noAuth?: boolean;
|
|
@@ -316,6 +315,7 @@ export type IColumn = {
|
|
|
316
315
|
formatType?: IFormatType;
|
|
317
316
|
required?: boolean;
|
|
318
317
|
canCopy?: boolean;
|
|
318
|
+
translate?: boolean;
|
|
319
319
|
editRender?: (row: IRecord, column: IColumn) => IEditerReturn;
|
|
320
320
|
dictItems?: Array<IDict>;
|
|
321
321
|
summation?: {
|
|
@@ -379,7 +379,8 @@ export type ITableProps = {
|
|
|
379
379
|
rowSelection?: IRowSelection;
|
|
380
380
|
rowHighlight?: IRowHighlight;
|
|
381
381
|
tableConfig?: ITableConfig;
|
|
382
|
-
|
|
382
|
+
/** @deprecated use `tableConfig` instead, and it will be deprecated in the next major version */
|
|
383
|
+
treeConfig?: ITableConfig;
|
|
383
384
|
expandable?: IExpandable;
|
|
384
385
|
areaSelection?: IAreaSelection;
|
|
385
386
|
summation?: ISummation;
|
|
@@ -467,7 +468,7 @@ export type TableBodyRef = {
|
|
|
467
468
|
scrollToYIndex: (index: number) => void;
|
|
468
469
|
};
|
|
469
470
|
export type ColumnDefineRef = {
|
|
470
|
-
initialHandler: () => void;
|
|
471
|
+
initialHandler: (columns?: IColumn[]) => void;
|
|
471
472
|
};
|
|
472
473
|
export type ToolBoxRef = {
|
|
473
474
|
exportHandle: () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IFetchProps } from './use-translation';
|
|
3
|
+
type IProps = {
|
|
4
|
+
text?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
title?: string;
|
|
8
|
+
tag?: string;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
copy?: boolean;
|
|
11
|
+
fetch?: IFetchProps;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export type TranslateProps = IProps;
|
|
15
|
+
declare const Translate: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
export default Translate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type UseTooltipProps = {
|
|
3
|
+
prefixCls?: string;
|
|
4
|
+
text: string;
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
translate: (text: string) => Promise<string | null>;
|
|
7
|
+
};
|
|
8
|
+
declare const useTooltip: ({ prefixCls, text, enabled, translate, }: UseTooltipProps) => [React.ReactNode, (ev: React.MouseEvent) => void, () => void, (ev: React.MouseEvent) => void];
|
|
9
|
+
export default useTooltip;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IFetchFn, IFetchParams } from '../../table/src/table/types';
|
|
2
|
+
export type IFetchProps = {
|
|
3
|
+
api: IFetchFn;
|
|
4
|
+
params?: IFetchParams;
|
|
5
|
+
formatter?: (params?: IFetchParams) => IFetchParams;
|
|
6
|
+
afterFetch?: (data: string) => string;
|
|
7
|
+
dataKey?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const useTranslation: (fetch?: IFetchProps) => {
|
|
10
|
+
translate: (text: string) => Promise<string | null>;
|
|
11
|
+
};
|
|
12
|
+
export default useTranslation;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2025-11-10 13:37:08
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2025-11-10 17:18:14
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
@prefix-translate: ~'@{qm-prefix}-translate';
|
|
10
|
+
|
|
11
|
+
.@{prefix-translate} {
|
|
12
|
+
&.help-cursor {
|
|
13
|
+
cursor: help;
|
|
14
|
+
}
|
|
15
|
+
&__tooltip {
|
|
16
|
+
min-width: 150px;
|
|
17
|
+
max-width: 300px;
|
|
18
|
+
border-radius: 6px !important;
|
|
19
|
+
padding-left: 12px !important;
|
|
20
|
+
padding-right: 12px !important;
|
|
21
|
+
.label,
|
|
22
|
+
.text {
|
|
23
|
+
margin: 4px 0;
|
|
24
|
+
}
|
|
25
|
+
.label {
|
|
26
|
+
color: @--text-color-placeholder;
|
|
27
|
+
}
|
|
28
|
+
.primary {
|
|
29
|
+
color: @--primary-color;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|