@qn-pandora/pandora-component 4.4.4 → 4.4.6
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/es/components/AutoComplete/index.d.ts +3 -2
- package/es/components/Breadcrumb/index.d.ts +1 -1
- package/es/components/Button/index.d.ts +1 -1
- package/es/components/Card/RowExtra/index.d.ts +1 -1
- package/es/components/Card/SearchInput/index.d.ts +2 -2
- package/es/components/Card/index.d.ts +1 -1
- package/es/components/CheckTransformList/Item/index.d.ts +2 -2
- package/es/components/CheckTransformList/index.d.ts +2 -2
- package/es/components/Checkbox/index.d.ts +2 -2
- package/es/components/CheckboxList/index.d.ts +1 -1
- package/es/components/Collapse/Panel/index.d.ts +2 -2
- package/es/components/Collapse/index.d.ts +2 -2
- package/es/components/Collapse/index.js +10 -8
- package/es/components/CollapsiblePanel/PanelContent/index.d.ts +1 -1
- package/es/components/CollapsiblePanel/PanelContent/index.js +2 -2
- package/es/components/CollapsiblePanel/PanelHeader/index.d.ts +1 -1
- package/es/components/CollapsiblePanel/PanelHeader/index.js +1 -1
- package/es/components/CollapsiblePanel/index.d.ts +1 -1
- package/es/components/CollapsiblePanel/index.js +1 -1
- package/es/components/ConfigProvider/context.d.ts +1 -1
- package/es/components/ConfigProvider/index.d.ts +2 -2
- package/es/components/DateTimePicker/Base/index.d.ts +4 -4
- package/es/components/DateTimePicker/Base/index.js +7 -7
- package/es/components/DateTimePicker/Base/relativeTimePicker.d.ts +1 -1
- package/es/components/DateTimePicker/Base/relativeTimePicker.js +1 -1
- package/es/components/DateTimePicker/BaseMobile/Absolute/index.d.ts +1 -1
- package/es/components/DateTimePicker/BaseMobile/Absolute/index.js +4 -4
- package/es/components/DateTimePicker/BaseMobile/CustomButton/index.d.ts +2 -2
- package/es/components/DateTimePicker/BaseMobile/index.d.ts +2 -2
- package/es/components/DateTimePicker/BaseMobile/index.js +1 -1
- package/es/components/DateTimePicker/Collapse/Panel/index.d.ts +1 -1
- package/es/components/DateTimePicker/Collapse/index.d.ts +1 -1
- package/es/components/DateTimePicker/DisplayInput/index.d.ts +1 -1
- package/es/components/DateTimePicker/DisplayInput/index.js +1 -1
- package/es/components/DateTimePicker/index.d.ts +1 -1
- package/es/components/DateTimePicker/index.js +1 -1
- package/es/components/Drawer/index.d.ts +5 -5
- package/es/components/Drawer/index.js +3 -3
- package/es/components/FileResumable/constants.js +1 -0
- package/es/components/FileResumable/index.d.ts +2 -2
- package/es/components/Input/Password/index.d.ts +2 -2
- package/es/components/Input/TextArea/index.d.ts +2 -2
- package/es/components/Input/index.d.ts +4 -4
- package/es/components/InputNumberWithUnit/index.d.ts +1 -1
- package/es/components/KeyValuePair/index.d.ts +2 -2
- package/es/components/KeyValuePair/index.js +10 -3
- package/es/components/Measure/index.d.ts +2 -2
- package/es/components/Menu/Option.d.ts +1 -1
- package/es/components/Menu/index.d.ts +1 -1
- package/es/components/Modal/index.d.ts +1 -1
- package/es/components/Modal/index.js +1 -1
- package/es/components/NameExplainTooltip/index.d.ts +2 -2
- package/es/components/NameLimiter/index.d.ts +1 -1
- package/es/components/OptionList/InlineOptionList/index.d.ts +2 -2
- package/es/components/OptionList/OptionItem/index.d.ts +2 -2
- package/es/components/OptionList/PopoverOptionList/index.d.ts +1 -1
- package/es/components/OptionList/index.d.ts +1 -1
- package/es/components/RadioGroup/index.d.ts +1 -1
- package/es/components/RangeInput/index.d.ts +1 -1
- package/es/components/ReactSortable/index.d.ts +23 -0
- package/es/components/ReactSortable/index.js +171 -0
- package/es/components/RemarkName/index.d.ts +2 -2
- package/es/components/Selector/SelectorWidthChildren.d.ts +1 -1
- package/es/components/Selector/index.d.ts +1 -1
- package/es/components/Selector/index.js +1 -1
- package/es/components/SolidRadioGroup/index.d.ts +1 -1
- package/es/components/Spin/LoadingSVG.d.ts +2 -2
- package/es/components/Spin/index.d.ts +1 -1
- package/es/components/Steps/ControlButton/index.d.ts +1 -1
- package/es/components/Steps/Step/index.d.ts +2 -2
- package/es/components/Steps/index.d.ts +2 -2
- package/es/components/Style/index.d.ts +1 -1
- package/es/components/Style/index.js +1 -1
- package/es/components/Table/ColumnSetting/index.d.ts +1 -1
- package/es/components/Table/ColumnSetting/index.js +1 -1
- package/es/components/Table/ColumnTag/ColumnTag.d.ts +2 -2
- package/es/components/Table/ResizableTitle/index.d.ts +2 -2
- package/es/components/Table/constant.d.ts +7 -1
- package/es/components/Table/constant.js +6 -0
- package/es/components/Table/index.d.ts +15 -6
- package/es/components/Table/index.js +147 -117
- package/es/components/Tabs/index.d.ts +1 -1
- package/es/components/TagList/Tag/index.d.ts +1 -1
- package/es/components/TagList/TagSwitch/index.d.ts +1 -1
- package/es/components/TagList/index.d.ts +1 -1
- package/es/components/TagList/index.js +1 -1
- package/es/components/Timeline/TimelineItem/index.d.ts +1 -1
- package/es/components/Timeline/index.d.ts +1 -1
- package/es/components/Transfer/List/index.d.ts +2 -2
- package/es/components/Transfer/ListBody/index.d.ts +2 -2
- package/es/components/Transfer/constants.js +1 -0
- package/es/components/Transfer/index.d.ts +2 -2
- package/es/components/TreeSelector/index.d.ts +1 -1
- package/es/hoc/debounce.d.ts +1 -1
- package/es/hoc/modalPopupContainer.d.ts +1 -1
- package/es/index.css +372 -372
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +13 -13
- package/es/models/index.js +1 -0
- package/es/style/theme.less +4 -3
- package/lib/components/AutoComplete/index.d.ts +3 -2
- package/lib/components/AutoComplete/index.js +20 -7
- package/lib/components/Breadcrumb/index.d.ts +1 -1
- package/lib/components/Breadcrumb/index.js +14 -2
- package/lib/components/Button/index.d.ts +1 -1
- package/lib/components/Button/index.js +19 -7
- package/lib/components/Card/RowExtra/index.d.ts +1 -1
- package/lib/components/Card/RowExtra/index.js +14 -2
- package/lib/components/Card/SearchInput/index.d.ts +2 -2
- package/lib/components/Card/SearchInput/index.js +19 -7
- package/lib/components/Card/index.d.ts +1 -1
- package/lib/components/Card/index.js +19 -7
- package/lib/components/CheckTransformList/Item/index.d.ts +2 -2
- package/lib/components/CheckTransformList/Item/index.js +14 -2
- package/lib/components/CheckTransformList/index.d.ts +2 -2
- package/lib/components/CheckTransformList/index.js +19 -7
- package/lib/components/Checkbox/index.d.ts +2 -2
- package/lib/components/Checkbox/index.js +19 -7
- package/lib/components/CheckboxList/index.d.ts +1 -1
- package/lib/components/CheckboxList/index.js +14 -2
- package/lib/components/Collapse/Panel/index.d.ts +2 -2
- package/lib/components/Collapse/Panel/index.js +20 -7
- package/lib/components/Collapse/index.d.ts +2 -2
- package/lib/components/Collapse/index.js +30 -15
- package/lib/components/CollapsiblePanel/PanelContent/index.d.ts +1 -1
- package/lib/components/CollapsiblePanel/PanelContent/index.js +2 -2
- package/lib/components/CollapsiblePanel/PanelHeader/index.d.ts +1 -1
- package/lib/components/CollapsiblePanel/PanelHeader/index.js +1 -1
- package/lib/components/CollapsiblePanel/index.d.ts +1 -1
- package/lib/components/CollapsiblePanel/index.js +1 -1
- package/lib/components/ConfigProvider/context.d.ts +1 -1
- package/lib/components/ConfigProvider/context.js +20 -7
- package/lib/components/ConfigProvider/index.d.ts +2 -2
- package/lib/components/DateTimePicker/Base/constants.js +1 -0
- package/lib/components/DateTimePicker/Base/index.d.ts +4 -4
- package/lib/components/DateTimePicker/Base/index.js +25 -12
- package/lib/components/DateTimePicker/Base/relativeTimePicker.d.ts +1 -1
- package/lib/components/DateTimePicker/Base/relativeTimePicker.js +15 -3
- package/lib/components/DateTimePicker/BaseMobile/Absolute/constants.js +1 -0
- package/lib/components/DateTimePicker/BaseMobile/Absolute/index.d.ts +1 -1
- package/lib/components/DateTimePicker/BaseMobile/Absolute/index.js +4 -4
- package/lib/components/DateTimePicker/BaseMobile/CustomButton/index.d.ts +2 -2
- package/lib/components/DateTimePicker/BaseMobile/constants.js +1 -0
- package/lib/components/DateTimePicker/BaseMobile/index.d.ts +2 -2
- package/lib/components/DateTimePicker/BaseMobile/index.js +3 -2
- package/lib/components/DateTimePicker/Collapse/Panel/index.d.ts +1 -1
- package/lib/components/DateTimePicker/Collapse/Panel/index.js +19 -7
- package/lib/components/DateTimePicker/Collapse/index.d.ts +1 -1
- package/lib/components/DateTimePicker/Collapse/index.js +14 -2
- package/lib/components/DateTimePicker/DisplayInput/index.d.ts +1 -1
- package/lib/components/DateTimePicker/DisplayInput/index.js +20 -8
- package/lib/components/DateTimePicker/constants.js +1 -0
- package/lib/components/DateTimePicker/index.d.ts +1 -1
- package/lib/components/DateTimePicker/index.js +22 -9
- package/lib/components/DateTimePicker/transform.js +1 -0
- package/lib/components/Descriptions/index.js +19 -7
- package/lib/components/Drawer/CloseIcon/index.js +17 -3
- package/lib/components/Drawer/index.d.ts +5 -5
- package/lib/components/Drawer/index.js +4 -3
- package/lib/components/FileResumable/index.d.ts +2 -2
- package/lib/components/FileResumable/index.js +19 -7
- package/lib/components/FileResumable/utils.js +3 -1
- package/lib/components/Input/Password/index.d.ts +2 -2
- package/lib/components/Input/Password/index.js +20 -7
- package/lib/components/Input/TextArea/index.d.ts +2 -2
- package/lib/components/Input/TextArea/index.js +20 -7
- package/lib/components/Input/index.d.ts +4 -4
- package/lib/components/Input/index.js +19 -7
- package/lib/components/InputNumberWithUnit/index.d.ts +1 -1
- package/lib/components/InputNumberWithUnit/index.js +19 -7
- package/lib/components/KeyValuePair/index.d.ts +2 -2
- package/lib/components/KeyValuePair/index.js +27 -8
- package/lib/components/Measure/index.d.ts +2 -2
- package/lib/components/Menu/Option.d.ts +1 -1
- package/lib/components/Menu/Option.js +14 -2
- package/lib/components/Menu/index.d.ts +1 -1
- package/lib/components/Menu/index.js +20 -7
- package/lib/components/Modal/index.d.ts +1 -1
- package/lib/components/Modal/index.js +20 -8
- package/lib/components/NameExplainTooltip/index.d.ts +2 -2
- package/lib/components/NameExplainTooltip/index.js +19 -7
- package/lib/components/NameLimiter/index.d.ts +1 -1
- package/lib/components/NameLimiter/index.js +19 -7
- package/lib/components/OptionList/InlineOptionList/index.d.ts +2 -2
- package/lib/components/OptionList/InlineOptionList/index.js +14 -2
- package/lib/components/OptionList/OptionItem/index.d.ts +2 -2
- package/lib/components/OptionList/OptionItem/index.js +14 -2
- package/lib/components/OptionList/PopoverOptionList/index.d.ts +1 -1
- package/lib/components/OptionList/PopoverOptionList/index.js +19 -7
- package/lib/components/OptionList/constants.js +1 -0
- package/lib/components/OptionList/index.d.ts +1 -1
- package/lib/components/OptionList/index.js +23 -11
- package/lib/components/RadioGroup/index.d.ts +1 -1
- package/lib/components/RadioGroup/index.js +14 -2
- package/lib/components/RangeInput/index.d.ts +1 -1
- package/lib/components/RangeInput/index.js +19 -7
- package/lib/components/RangeInput/utils.js +1 -0
- package/lib/components/ReactSortable/index.d.ts +23 -0
- package/lib/components/ReactSortable/index.js +195 -0
- package/lib/components/RemarkName/index.d.ts +2 -2
- package/lib/components/RemarkName/index.js +15 -2
- package/lib/components/Selector/SelectorWidthChildren.d.ts +1 -1
- package/lib/components/Selector/SelectorWidthChildren.js +19 -7
- package/lib/components/Selector/index.d.ts +1 -1
- package/lib/components/Selector/index.js +20 -8
- package/lib/components/SolidRadioGroup/index.d.ts +1 -1
- package/lib/components/SolidRadioGroup/index.js +14 -2
- package/lib/components/Spin/LoadingSVG.d.ts +2 -2
- package/lib/components/Spin/index.d.ts +1 -1
- package/lib/components/Spin/index.js +1 -0
- package/lib/components/Steps/ControlButton/index.d.ts +1 -1
- package/lib/components/Steps/ControlButton/index.js +14 -2
- package/lib/components/Steps/Step/index.d.ts +2 -2
- package/lib/components/Steps/Step/index.js +14 -2
- package/lib/components/Steps/context.js +15 -2
- package/lib/components/Steps/index.d.ts +2 -2
- package/lib/components/Steps/index.js +19 -7
- package/lib/components/Style/index.d.ts +1 -1
- package/lib/components/Style/index.js +18 -6
- package/lib/components/Table/ColumnSetting/index.d.ts +1 -1
- package/lib/components/Table/ColumnSetting/index.js +22 -9
- package/lib/components/Table/ColumnTag/ColumnTag.d.ts +2 -2
- package/lib/components/Table/ColumnTag/ColumnTag.js +15 -2
- package/lib/components/Table/ResizableTitle/index.d.ts +2 -2
- package/lib/components/Table/constant.d.ts +7 -1
- package/lib/components/Table/constant.js +7 -0
- package/lib/components/Table/index.d.ts +15 -6
- package/lib/components/Table/index.js +167 -124
- package/lib/components/Tabs/index.d.ts +1 -1
- package/lib/components/Tabs/index.js +1 -0
- package/lib/components/TagList/Tag/index.d.ts +1 -1
- package/lib/components/TagList/Tag/index.js +19 -7
- package/lib/components/TagList/TagSwitch/index.d.ts +1 -1
- package/lib/components/TagList/TagSwitch/index.js +14 -2
- package/lib/components/TagList/index.d.ts +1 -1
- package/lib/components/TagList/index.js +20 -8
- package/lib/components/Timeline/TimelineItem/index.d.ts +1 -1
- package/lib/components/Timeline/TimelineItem/index.js +14 -2
- package/lib/components/Timeline/index.d.ts +1 -1
- package/lib/components/Timeline/index.js +15 -2
- package/lib/components/Transfer/List/index.d.ts +2 -2
- package/lib/components/Transfer/List/index.js +19 -7
- package/lib/components/Transfer/ListBody/index.d.ts +2 -2
- package/lib/components/Transfer/index.d.ts +2 -2
- package/lib/components/TreeSelector/index.d.ts +1 -1
- package/lib/components/TreeSelector/index.js +20 -7
- package/lib/constants/language/check_transform_list/en.js +1 -0
- package/lib/constants/language/check_transform_list/type.js +1 -0
- package/lib/constants/language/check_transform_list/zh.js +1 -0
- package/lib/constants/language/datetime/en.js +1 -0
- package/lib/constants/language/datetime/type.js +1 -0
- package/lib/constants/language/datetime/zh.js +1 -0
- package/lib/constants/language/en.js +1 -0
- package/lib/constants/language/modal/en.js +1 -0
- package/lib/constants/language/modal/type.js +1 -0
- package/lib/constants/language/modal/zh.js +1 -0
- package/lib/constants/language/range_input/en.js +1 -0
- package/lib/constants/language/range_input/type.js +1 -0
- package/lib/constants/language/range_input/zh.js +1 -0
- package/lib/constants/language/steps/en.js +1 -0
- package/lib/constants/language/steps/type.js +1 -0
- package/lib/constants/language/steps/zh.js +1 -0
- package/lib/constants/language/table/en.js +1 -0
- package/lib/constants/language/table/type.js +1 -0
- package/lib/constants/language/table/zh.js +1 -0
- package/lib/constants/language/transfer/en.js +1 -0
- package/lib/constants/language/transfer/type.js +1 -0
- package/lib/constants/language/transfer/zh.js +1 -0
- package/lib/constants/language/type.js +1 -0
- package/lib/constants/language/upload/type.js +1 -0
- package/lib/constants/language/zh.js +1 -0
- package/lib/constants/locale.js +1 -0
- package/lib/constants/style.js +1 -0
- package/lib/constants/time.js +1 -0
- package/lib/hoc/debounce.d.ts +1 -1
- package/lib/hoc/debounce.js +19 -7
- package/lib/hoc/modalPopupContainer.d.ts +1 -1
- package/lib/hoc/modalPopupContainer.js +19 -7
- package/lib/index.css +1587 -1587
- package/lib/index.d.ts +1 -0
- package/lib/index.js +67 -54
- package/lib/index.less +11 -11
- package/lib/style/theme.less +4 -3
- package/lib/utils/dom.js +1 -0
- package/lib/utils/env.js +1 -0
- package/lib/utils/language.js +1 -0
- package/lib/utils/languageLocale.js +1 -0
- package/lib/utils/time.js +17 -3
- package/package.json +17 -15
- package/CHANGELOG.json +0 -672
- package/CHANGELOG.md +0 -235
@@ -71,7 +71,7 @@ declare class Table<T = any> extends React.Component<ITableProps<T>, any> {
|
|
71
71
|
tags: any[];
|
72
72
|
title?: string | undefined;
|
73
73
|
tagClassName?: string | undefined;
|
74
|
-
}) => JSX.Element;
|
74
|
+
}) => React.JSX.Element;
|
75
75
|
static contextType: React.Context<import("antd/es/config-provider").ConfigConsumerProps>;
|
76
76
|
indeterminate: boolean;
|
77
77
|
checkAll: boolean;
|
@@ -84,6 +84,7 @@ declare class Table<T = any> extends React.Component<ITableProps<T>, any> {
|
|
84
84
|
};
|
85
85
|
settingFields: ISaveFieldItem[];
|
86
86
|
UNSAFE_componentWillReceiveProps(nextProps: ITableProps<T>): void;
|
87
|
+
componentWillUnmount(): void;
|
87
88
|
get selectedRowKeys(): React.ReactText[];
|
88
89
|
get rowSelection(): TableRowSelection<T> | undefined;
|
89
90
|
get undisabledData(): readonly T[];
|
@@ -95,14 +96,22 @@ declare class Table<T = any> extends React.Component<ITableProps<T>, any> {
|
|
95
96
|
unconfigableKeys: string[];
|
96
97
|
resetKeys: string[];
|
97
98
|
};
|
98
|
-
get resizable():
|
99
|
+
get resizable(): false | ({
|
100
|
+
x?: string | number | true | undefined;
|
101
|
+
y?: string | number | undefined;
|
102
|
+
} & {
|
103
|
+
scrollToFirstRowOnChange?: boolean | undefined;
|
104
|
+
}) | undefined;
|
99
105
|
get sortable(): boolean;
|
106
|
+
updateSettingConfig(columns: Array<IColumnType<T>>): void;
|
100
107
|
initSettingConfig(): void;
|
108
|
+
updateSettingFields(columns: Array<IColumnType<T>>, settingFields: ISaveFieldItem[]): void;
|
101
109
|
handleHideColumnsChange(keys: string[]): Promise<void> | undefined;
|
102
|
-
getSortedColumns():
|
103
|
-
|
110
|
+
getSortedColumns(): IKeyValues<any>[];
|
111
|
+
transfromColumns(columns: IKeyValues[]): IKeyValues<any>[];
|
112
|
+
getColumns(): IKeyValues<any>[];
|
104
113
|
getRowKey(row: any, index: number): any;
|
105
|
-
getSortCoulmns(columns: IKeyValues[]):
|
114
|
+
getSortCoulmns(columns: IKeyValues[]): IKeyValues<any>[];
|
106
115
|
setIndeterminate(indeterminate: boolean): void;
|
107
116
|
setCheckAll(checkAll: boolean): void;
|
108
117
|
setHiddenColumn(hiddenColumn?: string[]): void;
|
@@ -124,6 +133,6 @@ declare class Table<T = any> extends React.Component<ITableProps<T>, any> {
|
|
124
133
|
}, oldColumn: IColumnsType<T>): void;
|
125
134
|
getResizeColumns(columns?: IColumnsType<T>): any;
|
126
135
|
componentDidMount(): void;
|
127
|
-
render(): JSX.Element;
|
136
|
+
render(): React.JSX.Element;
|
128
137
|
}
|
129
138
|
export default Table;
|
@@ -2,7 +2,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
2
2
|
var extendStatics = function (d, b) {
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5
|
-
function (d, b) { for (var p in b) if (
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
6
6
|
return extendStatics(d, b);
|
7
7
|
};
|
8
8
|
return function (d, b) {
|
@@ -134,10 +134,19 @@ var Table = /** @class */ (function (_super) {
|
|
134
134
|
this.setHiddenColumn(nextProps.hiddenColumns);
|
135
135
|
}
|
136
136
|
if (nextProps.columns !== this.props.columns) {
|
137
|
-
|
138
|
-
nextProps.draggable === ETableSettingType.RESIZE
|
139
|
-
|
140
|
-
|
137
|
+
if ((nextProps.scroll && nextProps.draggable === true) ||
|
138
|
+
nextProps.draggable === ETableSettingType.RESIZE) {
|
139
|
+
this.updateSettingConfig(nextProps.columns);
|
140
|
+
this.setColumns(this.getResizeColumns(nextProps.columns));
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
this.setColumns(nextProps.columns || []);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
};
|
147
|
+
Table.prototype.componentWillUnmount = function () {
|
148
|
+
if (this.props.saveSettingKey) {
|
149
|
+
localStorage.setItem(this.props.saveSettingKey, JSON.stringify(this.settingFields));
|
141
150
|
}
|
142
151
|
};
|
143
152
|
Object.defineProperty(Table.prototype, "selectedRowKeys", {
|
@@ -145,7 +154,7 @@ var Table = /** @class */ (function (_super) {
|
|
145
154
|
var rowSelection = this.props.rowSelection;
|
146
155
|
return (rowSelection && rowSelection.selectedRowKeys) || [];
|
147
156
|
},
|
148
|
-
enumerable:
|
157
|
+
enumerable: false,
|
149
158
|
configurable: true
|
150
159
|
});
|
151
160
|
Object.defineProperty(Table.prototype, "rowSelection", {
|
@@ -155,7 +164,7 @@ var Table = /** @class */ (function (_super) {
|
|
155
164
|
return __assign(__assign({}, rowSelection), { selectedRowKeys: this.selectedRowKeys, onChange: this.handleSelectionChange });
|
156
165
|
}
|
157
166
|
},
|
158
|
-
enumerable:
|
167
|
+
enumerable: false,
|
159
168
|
configurable: true
|
160
169
|
});
|
161
170
|
Object.defineProperty(Table.prototype, "undisabledData", {
|
@@ -169,14 +178,14 @@ var Table = /** @class */ (function (_super) {
|
|
169
178
|
}
|
170
179
|
return undisabledData;
|
171
180
|
},
|
172
|
-
enumerable:
|
181
|
+
enumerable: false,
|
173
182
|
configurable: true
|
174
183
|
});
|
175
184
|
Object.defineProperty(Table.prototype, "keysOfCurrentPage", {
|
176
185
|
get: function () {
|
177
186
|
return this.undisabledData.map(this.getRowKey);
|
178
187
|
},
|
179
|
-
enumerable:
|
188
|
+
enumerable: false,
|
180
189
|
configurable: true
|
181
190
|
});
|
182
191
|
Object.defineProperty(Table.prototype, "emptyTextComp", {
|
@@ -196,7 +205,7 @@ var Table = /** @class */ (function (_super) {
|
|
196
205
|
}
|
197
206
|
return emptyText;
|
198
207
|
},
|
199
|
-
enumerable:
|
208
|
+
enumerable: false,
|
200
209
|
configurable: true
|
201
210
|
});
|
202
211
|
Object.defineProperty(Table.prototype, "columnsSettingOptions", {
|
@@ -218,7 +227,7 @@ var Table = /** @class */ (function (_super) {
|
|
218
227
|
.map(function (key) { return options.find(function (option) { return option.value === key; }); })
|
219
228
|
.filter(function (f) { return !!f; });
|
220
229
|
},
|
221
|
-
enumerable:
|
230
|
+
enumerable: false,
|
222
231
|
configurable: true
|
223
232
|
});
|
224
233
|
Object.defineProperty(Table.prototype, "columnKeys", {
|
@@ -244,16 +253,17 @@ var Table = /** @class */ (function (_super) {
|
|
244
253
|
resetKeys: resetKeys
|
245
254
|
};
|
246
255
|
},
|
247
|
-
enumerable:
|
256
|
+
enumerable: false,
|
248
257
|
configurable: true
|
249
258
|
});
|
250
259
|
Object.defineProperty(Table.prototype, "resizable", {
|
251
260
|
get: function () {
|
252
261
|
var _a, _b;
|
253
|
-
return (((_a = this.props) === null || _a === void 0 ? void 0 : _a.draggable) === true ||
|
254
|
-
((_b = this.props) === null || _b === void 0 ? void 0 : _b.draggable) === ETableSettingType.RESIZE)
|
262
|
+
return ((((_a = this.props) === null || _a === void 0 ? void 0 : _a.draggable) === true ||
|
263
|
+
((_b = this.props) === null || _b === void 0 ? void 0 : _b.draggable) === ETableSettingType.RESIZE) &&
|
264
|
+
this.props.scroll);
|
255
265
|
},
|
256
|
-
enumerable:
|
266
|
+
enumerable: false,
|
257
267
|
configurable: true
|
258
268
|
});
|
259
269
|
Object.defineProperty(Table.prototype, "sortable", {
|
@@ -262,98 +272,83 @@ var Table = /** @class */ (function (_super) {
|
|
262
272
|
return (((_a = this.props) === null || _a === void 0 ? void 0 : _a.draggable) === true ||
|
263
273
|
((_b = this.props) === null || _b === void 0 ? void 0 : _b.draggable) === ETableSettingType.SORT);
|
264
274
|
},
|
265
|
-
enumerable:
|
275
|
+
enumerable: false,
|
266
276
|
configurable: true
|
267
277
|
});
|
278
|
+
Table.prototype.updateSettingConfig = function (columns) {
|
279
|
+
this.updateSettingFields(columns, this.settingFields);
|
280
|
+
};
|
268
281
|
Table.prototype.initSettingConfig = function () {
|
269
|
-
var
|
270
|
-
var _a = this.props, saveSettingKey = _a.saveSettingKey, _b = _a.hiddenColumns, hiddenColumns = _b === void 0 ? [] : _b;
|
282
|
+
var saveSettingKey = this.props.saveSettingKey;
|
271
283
|
var settingFields = [];
|
284
|
+
if (saveSettingKey) {
|
285
|
+
var settingStr = localStorage.getItem(saveSettingKey);
|
286
|
+
var settingConfig = !!settingStr && JSON.parse(settingStr);
|
287
|
+
if (isArray(settingConfig)) {
|
288
|
+
settingFields = settingConfig;
|
289
|
+
}
|
290
|
+
}
|
291
|
+
this.updateSettingFields(this.props.columns, settingFields);
|
292
|
+
};
|
293
|
+
Table.prototype.updateSettingFields = function (columns, settingFields) {
|
294
|
+
var _a = this.props.hiddenColumns, hiddenColumns = _a === void 0 ? [] : _a;
|
272
295
|
var sortableColumns = [];
|
273
296
|
var leftColumns = [];
|
274
297
|
var rightColumns = [];
|
275
298
|
var hideKeys = [];
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
var
|
283
|
-
if (
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
leftColumns.push(field);
|
297
|
-
}
|
298
|
-
else {
|
299
|
-
rightColumns.push(field);
|
300
|
-
}
|
301
|
-
}
|
302
|
-
});
|
303
|
-
// 未配置过的列
|
304
|
-
this.columns
|
305
|
-
.filter(function (f) { return !settingFields.find(function (field) { return field.field === f.dataIndex; }); })
|
306
|
-
.map(function (column) {
|
307
|
-
if (!column.fixed) {
|
308
|
-
sortableColumns.push({
|
309
|
-
field: column.dataIndex,
|
310
|
-
fixed: column.fixed
|
311
|
-
});
|
312
|
-
}
|
313
|
-
else if (column.fixed === 'left' || column.fixed === true) {
|
314
|
-
leftColumns.push({
|
315
|
-
field: column.dataIndex,
|
316
|
-
fixed: column.fixed
|
317
|
-
});
|
318
|
-
}
|
319
|
-
else {
|
320
|
-
rightColumns.push({
|
321
|
-
field: column.dataIndex,
|
322
|
-
fixed: column.fixed
|
323
|
-
});
|
324
|
-
}
|
325
|
-
});
|
299
|
+
// 已配置的列和实际的对不上
|
300
|
+
// 可能新增或者删除列的情况
|
301
|
+
var newSettingFields = [];
|
302
|
+
// 已配置列
|
303
|
+
// 旧类型数据为对象类型,未配置
|
304
|
+
settingFields.map(function (field) {
|
305
|
+
var find = columns.find(function (column) { var _a; return ((_a = column) === null || _a === void 0 ? void 0 : _a.dataIndex) === field.field; });
|
306
|
+
if (find) {
|
307
|
+
if (field.hide) {
|
308
|
+
hideKeys.push(field.field);
|
309
|
+
}
|
310
|
+
if (!find.fixed) {
|
311
|
+
sortableColumns.push(field);
|
312
|
+
}
|
313
|
+
else if (find.fixed === 'left' || find.fixed === true) {
|
314
|
+
leftColumns.push(field);
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
rightColumns.push(field);
|
318
|
+
}
|
326
319
|
}
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
320
|
+
});
|
321
|
+
// 未配置过的列
|
322
|
+
columns
|
323
|
+
.filter(function (f) { return !settingFields.find(function (field) { return field.field === f.dataIndex; }); })
|
324
|
+
.map(function (column) {
|
325
|
+
if (column.dataIndex) {
|
326
|
+
if (!column.fixed) {
|
327
|
+
sortableColumns.push({
|
328
|
+
field: column.dataIndex.toString(),
|
329
|
+
fixed: column.fixed
|
330
|
+
});
|
331
|
+
}
|
332
|
+
else if (column.fixed === 'left' || column.fixed === true) {
|
333
|
+
leftColumns.push({
|
334
|
+
field: column.dataIndex.toString(),
|
335
|
+
fixed: column.fixed
|
336
|
+
});
|
337
|
+
}
|
338
|
+
else {
|
339
|
+
rightColumns.push({
|
340
|
+
field: column.dataIndex.toString(),
|
341
|
+
fixed: column.fixed
|
342
|
+
});
|
343
|
+
}
|
349
344
|
}
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
345
|
+
});
|
346
|
+
this.setFixedLeftKeys(leftColumns.map(function (t) { return t.field; }));
|
347
|
+
this.setFixedRightKeys(rightColumns.map(function (t) { return t.field; }));
|
348
|
+
this.setSortKeys(sortableColumns.map(function (t) { return t.field; }));
|
349
|
+
this.setHiddenColumn(__spread(new Set(__spread(hiddenColumns, hideKeys))));
|
350
|
+
newSettingFields = __spread(leftColumns, sortableColumns, rightColumns);
|
351
|
+
this.setSettingFields(newSettingFields);
|
357
352
|
};
|
358
353
|
// 隐藏key
|
359
354
|
Table.prototype.handleHideColumnsChange = function (keys) {
|
@@ -390,14 +385,35 @@ var Table = /** @class */ (function (_super) {
|
|
390
385
|
});
|
391
386
|
return __spread(fixedLeftColumn, this.getSortCoulmns(selectedCols), fixedRightColumn);
|
392
387
|
};
|
388
|
+
// 如果支持拖拽,在屏幕宽度大于table总的列宽的时候,添加一个空白列,宽度auto.
|
389
|
+
// 空白列添加到右固定列的前面
|
390
|
+
Table.prototype.transfromColumns = function (columns) {
|
391
|
+
if (!this.resizable)
|
392
|
+
return columns;
|
393
|
+
var cols = __spread(columns);
|
394
|
+
var firstFixedRightIndex = cols.findIndex(function (item) { return get(item, 'fixed') === 'right'; });
|
395
|
+
var column = {
|
396
|
+
title: '',
|
397
|
+
dataIndex: '__empty__',
|
398
|
+
key: '__empty__'
|
399
|
+
};
|
400
|
+
if (firstFixedRightIndex === -1) {
|
401
|
+
cols.push(column);
|
402
|
+
}
|
403
|
+
else {
|
404
|
+
cols.splice(firstFixedRightIndex, 0, column);
|
405
|
+
}
|
406
|
+
return cols;
|
407
|
+
};
|
393
408
|
Table.prototype.getColumns = function () {
|
394
409
|
var _a = this.props, showColumnSetting = _a.showColumnSetting, columnSettingOverlayClass = _a.columnSettingOverlayClass;
|
395
410
|
if (!showColumnSetting) {
|
396
|
-
return this.columns;
|
411
|
+
return this.transfromColumns(this.columns);
|
397
412
|
}
|
398
413
|
// 获取到列设置的options
|
399
414
|
var columnsSettingOptions = this.columnsSettingOptions;
|
400
415
|
var allCols = this.getSortedColumns();
|
416
|
+
this.transfromColumns(allCols);
|
401
417
|
var length = allCols.length;
|
402
418
|
if (length > 0) {
|
403
419
|
var title = (React.createElement("span", { className: SDK_PREFIX + "-last-column-title" },
|
@@ -452,9 +468,6 @@ var Table = /** @class */ (function (_super) {
|
|
452
468
|
this.sortConfig = __assign(__assign({}, this.sortConfig), { sortKeys: columns });
|
453
469
|
};
|
454
470
|
Table.prototype.setSettingFields = function (columns) {
|
455
|
-
if (this.props.saveSettingKey) {
|
456
|
-
localStorage.setItem(this.props.saveSettingKey, JSON.stringify(columns));
|
457
|
-
}
|
458
471
|
this.settingFields = columns;
|
459
472
|
};
|
460
473
|
Table.prototype.setFixedRightKeys = function (columns) {
|
@@ -560,18 +573,14 @@ var Table = /** @class */ (function (_super) {
|
|
560
573
|
};
|
561
574
|
Table.prototype.getResizeColumns = function (columns) {
|
562
575
|
var _this = this;
|
563
|
-
var fields;
|
564
|
-
if (
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
var width = (_a = fields.find(function (f) { return f.field === dataIndex; })) === null || _a === void 0 ? void 0 : _a.width;
|
572
|
-
return isNumber(width) ? __assign(__assign({}, col), { width: width }) : col;
|
573
|
-
});
|
574
|
-
}
|
576
|
+
var fields = this.settingFields;
|
577
|
+
if ((fields === null || fields === void 0 ? void 0 : fields.length) && isArray(fields)) {
|
578
|
+
columns = columns === null || columns === void 0 ? void 0 : columns.map(function (col) {
|
579
|
+
var _a;
|
580
|
+
var dataIndex = get(col, 'dataIndex');
|
581
|
+
var width = (_a = fields === null || fields === void 0 ? void 0 : fields.find(function (f) { return f.field === dataIndex; })) === null || _a === void 0 ? void 0 : _a.width;
|
582
|
+
return isNumber(width) ? __assign(__assign({}, col), { width: width }) : col;
|
583
|
+
});
|
575
584
|
}
|
576
585
|
var transformColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (it) {
|
577
586
|
if (get(it, 'resizable') && _this.resizable) {
|
@@ -591,12 +600,13 @@ var Table = /** @class */ (function (_super) {
|
|
591
600
|
return transformColumns;
|
592
601
|
};
|
593
602
|
Table.prototype.componentDidMount = function () {
|
594
|
-
|
595
|
-
? this.getResizeColumns(this.props.columns)
|
596
|
-
: this.props.columns);
|
603
|
+
var _a;
|
597
604
|
if (this.sortable || this.resizable) {
|
598
605
|
this.initSettingConfig();
|
599
606
|
}
|
607
|
+
this.setColumns(this.resizable && ((_a = this.settingFields) === null || _a === void 0 ? void 0 : _a.length)
|
608
|
+
? this.getResizeColumns(this.props.columns)
|
609
|
+
: this.props.columns);
|
600
610
|
};
|
601
611
|
Table.prototype.render = function () {
|
602
612
|
var _a, _b;
|
@@ -608,7 +618,7 @@ var Table = /** @class */ (function (_super) {
|
|
608
618
|
// getCheckboxProps只能放到tableBatchWrapper里,因为selectedRowKeys在那个组件计算
|
609
619
|
rowSelection: batchOptions && this.props.rowSelection
|
610
620
|
? this.rowSelection
|
611
|
-
: this.props.rowSelection, rowClassName: this.getRowClassName, components: __assign(__assign({}, (components || {})), (this.resizable
|
621
|
+
: this.props.rowSelection, rowClassName: this.getRowClassName, components: __assign(__assign({}, (components || {})), (this.resizable
|
612
622
|
? {
|
613
623
|
header: {
|
614
624
|
cell: ResizableTitle
|
@@ -704,6 +714,13 @@ var Table = /** @class */ (function (_super) {
|
|
704
714
|
__metadata("design:type", Object),
|
705
715
|
__metadata("design:paramtypes", [])
|
706
716
|
], Table.prototype, "sortable", null);
|
717
|
+
__decorate([
|
718
|
+
bind,
|
719
|
+
action,
|
720
|
+
__metadata("design:type", Function),
|
721
|
+
__metadata("design:paramtypes", [Array]),
|
722
|
+
__metadata("design:returntype", void 0)
|
723
|
+
], Table.prototype, "updateSettingConfig", null);
|
707
724
|
__decorate([
|
708
725
|
bind,
|
709
726
|
action,
|
@@ -711,6 +728,13 @@ var Table = /** @class */ (function (_super) {
|
|
711
728
|
__metadata("design:paramtypes", []),
|
712
729
|
__metadata("design:returntype", void 0)
|
713
730
|
], Table.prototype, "initSettingConfig", null);
|
731
|
+
__decorate([
|
732
|
+
bind,
|
733
|
+
action,
|
734
|
+
__metadata("design:type", Function),
|
735
|
+
__metadata("design:paramtypes", [Array, Array]),
|
736
|
+
__metadata("design:returntype", void 0)
|
737
|
+
], Table.prototype, "updateSettingFields", null);
|
714
738
|
__decorate([
|
715
739
|
bind,
|
716
740
|
__metadata("design:type", Function),
|
@@ -723,6 +747,12 @@ var Table = /** @class */ (function (_super) {
|
|
723
747
|
__metadata("design:paramtypes", []),
|
724
748
|
__metadata("design:returntype", void 0)
|
725
749
|
], Table.prototype, "getSortedColumns", null);
|
750
|
+
__decorate([
|
751
|
+
bind,
|
752
|
+
__metadata("design:type", Function),
|
753
|
+
__metadata("design:paramtypes", [Array]),
|
754
|
+
__metadata("design:returntype", void 0)
|
755
|
+
], Table.prototype, "transfromColumns", null);
|
726
756
|
__decorate([
|
727
757
|
bind,
|
728
758
|
__metadata("design:type", Function),
|
@@ -30,4 +30,4 @@ export interface ITagProps extends IKeyValues<any> {
|
|
30
30
|
*/
|
31
31
|
getPopupContainer?: () => HTMLElement;
|
32
32
|
}
|
33
|
-
export default function Tag(props: React.PropsWithChildren<ITagProps>): JSX.Element;
|
33
|
+
export default function Tag(props: React.PropsWithChildren<ITagProps>): React.JSX.Element;
|
@@ -31,4 +31,4 @@ export interface ITagSwitchProps {
|
|
31
31
|
*/
|
32
32
|
getPopupContainer?: () => HTMLElement;
|
33
33
|
}
|
34
|
-
export default function TagSwitch(props: React.PropsWithChildren<ITagSwitchProps>): JSX.Element;
|
34
|
+
export default function TagSwitch(props: React.PropsWithChildren<ITagSwitchProps>): React.JSX.Element;
|
@@ -28,7 +28,7 @@ export interface ITagListProps {
|
|
28
28
|
*/
|
29
29
|
onChange?: (values: any[]) => void;
|
30
30
|
}
|
31
|
-
declare function TagList(props: React.PropsWithChildren<ITagListProps>): JSX.Element;
|
31
|
+
declare function TagList(props: React.PropsWithChildren<ITagListProps>): React.JSX.Element;
|
32
32
|
declare namespace TagList {
|
33
33
|
var Tag: typeof import("./Tag").default;
|
34
34
|
var TagSwitch: typeof import("./TagSwitch").default;
|
@@ -10,7 +10,7 @@ export interface ITimelineProps {
|
|
10
10
|
/**
|
11
11
|
* 时间轴组件封装
|
12
12
|
*/
|
13
|
-
export declare function Timeline(props: React.PropsWithChildren<ITimelineProps>): JSX.Element;
|
13
|
+
export declare function Timeline(props: React.PropsWithChildren<ITimelineProps>): React.JSX.Element;
|
14
14
|
export declare namespace Timeline {
|
15
15
|
var TimelineItem: typeof import("./TimelineItem").default;
|
16
16
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
import React from 'react';
|
2
2
|
import { EType, KeyWiseTransferItem } from '../constants';
|
3
3
|
interface ListProps<RecordType extends KeyWiseTransferItem> {
|
4
4
|
dataSource: RecordType[];
|
@@ -9,5 +9,5 @@ interface ListProps<RecordType extends KeyWiseTransferItem> {
|
|
9
9
|
type: EType;
|
10
10
|
selectAllTitle: string;
|
11
11
|
}
|
12
|
-
export default function List<RecordType extends KeyWiseTransferItem>(props: ListProps<RecordType>): JSX.Element;
|
12
|
+
export default function List<RecordType extends KeyWiseTransferItem>(props: ListProps<RecordType>): React.JSX.Element;
|
13
13
|
export {};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
import React from 'react';
|
2
2
|
import { KeyWiseTransferItem } from '../constants';
|
3
3
|
interface ListBodyProps<RecordType extends KeyWiseTransferItem> {
|
4
4
|
dataSource: RecordType[];
|
5
5
|
onChange: (key: string, checked: boolean) => void;
|
6
6
|
}
|
7
|
-
export default function ListBody<RecordType extends KeyWiseTransferItem>(props: ListBodyProps<RecordType>): JSX.Element;
|
7
|
+
export default function ListBody<RecordType extends KeyWiseTransferItem>(props: ListBodyProps<RecordType>): React.JSX.Element;
|
8
8
|
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
import React from 'react';
|
2
2
|
import { TransferItem } from './constants';
|
3
3
|
export interface TransferProps<RecordType extends TransferItem> {
|
4
4
|
/**
|
@@ -30,4 +30,4 @@ export interface TransferProps<RecordType extends TransferItem> {
|
|
30
30
|
*/
|
31
31
|
selectAllTitle: string;
|
32
32
|
}
|
33
|
-
export default function Transfer<RecordType extends TransferItem = TransferItem>(props: TransferProps<RecordType>): JSX.Element;
|
33
|
+
export default function Transfer<RecordType extends TransferItem = TransferItem>(props: TransferProps<RecordType>): React.JSX.Element;
|
@@ -46,7 +46,7 @@ export declare type ITreeSelectorProps<T extends TreeNodeValue = any> = Overwrit
|
|
46
46
|
onChange?: (value: T, label: any, extra: any) => void;
|
47
47
|
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
48
48
|
}>;
|
49
|
-
export declare function TreeSelector(props: ITreeSelectorProps): JSX.Element;
|
49
|
+
export declare function TreeSelector(props: ITreeSelectorProps): React.JSX.Element;
|
50
50
|
export declare namespace TreeSelector {
|
51
51
|
var SHOW_ALL: "SHOW_ALL";
|
52
52
|
var SHOW_PARENT: "SHOW_PARENT";
|
package/es/hoc/debounce.d.ts
CHANGED