@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.
Files changed (292) hide show
  1. package/es/components/AutoComplete/index.d.ts +3 -2
  2. package/es/components/Breadcrumb/index.d.ts +1 -1
  3. package/es/components/Button/index.d.ts +1 -1
  4. package/es/components/Card/RowExtra/index.d.ts +1 -1
  5. package/es/components/Card/SearchInput/index.d.ts +2 -2
  6. package/es/components/Card/index.d.ts +1 -1
  7. package/es/components/CheckTransformList/Item/index.d.ts +2 -2
  8. package/es/components/CheckTransformList/index.d.ts +2 -2
  9. package/es/components/Checkbox/index.d.ts +2 -2
  10. package/es/components/CheckboxList/index.d.ts +1 -1
  11. package/es/components/Collapse/Panel/index.d.ts +2 -2
  12. package/es/components/Collapse/index.d.ts +2 -2
  13. package/es/components/Collapse/index.js +10 -8
  14. package/es/components/CollapsiblePanel/PanelContent/index.d.ts +1 -1
  15. package/es/components/CollapsiblePanel/PanelContent/index.js +2 -2
  16. package/es/components/CollapsiblePanel/PanelHeader/index.d.ts +1 -1
  17. package/es/components/CollapsiblePanel/PanelHeader/index.js +1 -1
  18. package/es/components/CollapsiblePanel/index.d.ts +1 -1
  19. package/es/components/CollapsiblePanel/index.js +1 -1
  20. package/es/components/ConfigProvider/context.d.ts +1 -1
  21. package/es/components/ConfigProvider/index.d.ts +2 -2
  22. package/es/components/DateTimePicker/Base/index.d.ts +4 -4
  23. package/es/components/DateTimePicker/Base/index.js +7 -7
  24. package/es/components/DateTimePicker/Base/relativeTimePicker.d.ts +1 -1
  25. package/es/components/DateTimePicker/Base/relativeTimePicker.js +1 -1
  26. package/es/components/DateTimePicker/BaseMobile/Absolute/index.d.ts +1 -1
  27. package/es/components/DateTimePicker/BaseMobile/Absolute/index.js +4 -4
  28. package/es/components/DateTimePicker/BaseMobile/CustomButton/index.d.ts +2 -2
  29. package/es/components/DateTimePicker/BaseMobile/index.d.ts +2 -2
  30. package/es/components/DateTimePicker/BaseMobile/index.js +1 -1
  31. package/es/components/DateTimePicker/Collapse/Panel/index.d.ts +1 -1
  32. package/es/components/DateTimePicker/Collapse/index.d.ts +1 -1
  33. package/es/components/DateTimePicker/DisplayInput/index.d.ts +1 -1
  34. package/es/components/DateTimePicker/DisplayInput/index.js +1 -1
  35. package/es/components/DateTimePicker/index.d.ts +1 -1
  36. package/es/components/DateTimePicker/index.js +1 -1
  37. package/es/components/Drawer/index.d.ts +5 -5
  38. package/es/components/Drawer/index.js +3 -3
  39. package/es/components/FileResumable/constants.js +1 -0
  40. package/es/components/FileResumable/index.d.ts +2 -2
  41. package/es/components/Input/Password/index.d.ts +2 -2
  42. package/es/components/Input/TextArea/index.d.ts +2 -2
  43. package/es/components/Input/index.d.ts +4 -4
  44. package/es/components/InputNumberWithUnit/index.d.ts +1 -1
  45. package/es/components/KeyValuePair/index.d.ts +2 -2
  46. package/es/components/KeyValuePair/index.js +10 -3
  47. package/es/components/Measure/index.d.ts +2 -2
  48. package/es/components/Menu/Option.d.ts +1 -1
  49. package/es/components/Menu/index.d.ts +1 -1
  50. package/es/components/Modal/index.d.ts +1 -1
  51. package/es/components/Modal/index.js +1 -1
  52. package/es/components/NameExplainTooltip/index.d.ts +2 -2
  53. package/es/components/NameLimiter/index.d.ts +1 -1
  54. package/es/components/OptionList/InlineOptionList/index.d.ts +2 -2
  55. package/es/components/OptionList/OptionItem/index.d.ts +2 -2
  56. package/es/components/OptionList/PopoverOptionList/index.d.ts +1 -1
  57. package/es/components/OptionList/index.d.ts +1 -1
  58. package/es/components/RadioGroup/index.d.ts +1 -1
  59. package/es/components/RangeInput/index.d.ts +1 -1
  60. package/es/components/ReactSortable/index.d.ts +23 -0
  61. package/es/components/ReactSortable/index.js +171 -0
  62. package/es/components/RemarkName/index.d.ts +2 -2
  63. package/es/components/Selector/SelectorWidthChildren.d.ts +1 -1
  64. package/es/components/Selector/index.d.ts +1 -1
  65. package/es/components/Selector/index.js +1 -1
  66. package/es/components/SolidRadioGroup/index.d.ts +1 -1
  67. package/es/components/Spin/LoadingSVG.d.ts +2 -2
  68. package/es/components/Spin/index.d.ts +1 -1
  69. package/es/components/Steps/ControlButton/index.d.ts +1 -1
  70. package/es/components/Steps/Step/index.d.ts +2 -2
  71. package/es/components/Steps/index.d.ts +2 -2
  72. package/es/components/Style/index.d.ts +1 -1
  73. package/es/components/Style/index.js +1 -1
  74. package/es/components/Table/ColumnSetting/index.d.ts +1 -1
  75. package/es/components/Table/ColumnSetting/index.js +1 -1
  76. package/es/components/Table/ColumnTag/ColumnTag.d.ts +2 -2
  77. package/es/components/Table/ResizableTitle/index.d.ts +2 -2
  78. package/es/components/Table/constant.d.ts +7 -1
  79. package/es/components/Table/constant.js +6 -0
  80. package/es/components/Table/index.d.ts +15 -6
  81. package/es/components/Table/index.js +147 -117
  82. package/es/components/Tabs/index.d.ts +1 -1
  83. package/es/components/TagList/Tag/index.d.ts +1 -1
  84. package/es/components/TagList/TagSwitch/index.d.ts +1 -1
  85. package/es/components/TagList/index.d.ts +1 -1
  86. package/es/components/TagList/index.js +1 -1
  87. package/es/components/Timeline/TimelineItem/index.d.ts +1 -1
  88. package/es/components/Timeline/index.d.ts +1 -1
  89. package/es/components/Transfer/List/index.d.ts +2 -2
  90. package/es/components/Transfer/ListBody/index.d.ts +2 -2
  91. package/es/components/Transfer/constants.js +1 -0
  92. package/es/components/Transfer/index.d.ts +2 -2
  93. package/es/components/TreeSelector/index.d.ts +1 -1
  94. package/es/hoc/debounce.d.ts +1 -1
  95. package/es/hoc/modalPopupContainer.d.ts +1 -1
  96. package/es/index.css +372 -372
  97. package/es/index.d.ts +1 -0
  98. package/es/index.js +1 -0
  99. package/es/index.less +13 -13
  100. package/es/models/index.js +1 -0
  101. package/es/style/theme.less +4 -3
  102. package/lib/components/AutoComplete/index.d.ts +3 -2
  103. package/lib/components/AutoComplete/index.js +20 -7
  104. package/lib/components/Breadcrumb/index.d.ts +1 -1
  105. package/lib/components/Breadcrumb/index.js +14 -2
  106. package/lib/components/Button/index.d.ts +1 -1
  107. package/lib/components/Button/index.js +19 -7
  108. package/lib/components/Card/RowExtra/index.d.ts +1 -1
  109. package/lib/components/Card/RowExtra/index.js +14 -2
  110. package/lib/components/Card/SearchInput/index.d.ts +2 -2
  111. package/lib/components/Card/SearchInput/index.js +19 -7
  112. package/lib/components/Card/index.d.ts +1 -1
  113. package/lib/components/Card/index.js +19 -7
  114. package/lib/components/CheckTransformList/Item/index.d.ts +2 -2
  115. package/lib/components/CheckTransformList/Item/index.js +14 -2
  116. package/lib/components/CheckTransformList/index.d.ts +2 -2
  117. package/lib/components/CheckTransformList/index.js +19 -7
  118. package/lib/components/Checkbox/index.d.ts +2 -2
  119. package/lib/components/Checkbox/index.js +19 -7
  120. package/lib/components/CheckboxList/index.d.ts +1 -1
  121. package/lib/components/CheckboxList/index.js +14 -2
  122. package/lib/components/Collapse/Panel/index.d.ts +2 -2
  123. package/lib/components/Collapse/Panel/index.js +20 -7
  124. package/lib/components/Collapse/index.d.ts +2 -2
  125. package/lib/components/Collapse/index.js +30 -15
  126. package/lib/components/CollapsiblePanel/PanelContent/index.d.ts +1 -1
  127. package/lib/components/CollapsiblePanel/PanelContent/index.js +2 -2
  128. package/lib/components/CollapsiblePanel/PanelHeader/index.d.ts +1 -1
  129. package/lib/components/CollapsiblePanel/PanelHeader/index.js +1 -1
  130. package/lib/components/CollapsiblePanel/index.d.ts +1 -1
  131. package/lib/components/CollapsiblePanel/index.js +1 -1
  132. package/lib/components/ConfigProvider/context.d.ts +1 -1
  133. package/lib/components/ConfigProvider/context.js +20 -7
  134. package/lib/components/ConfigProvider/index.d.ts +2 -2
  135. package/lib/components/DateTimePicker/Base/constants.js +1 -0
  136. package/lib/components/DateTimePicker/Base/index.d.ts +4 -4
  137. package/lib/components/DateTimePicker/Base/index.js +25 -12
  138. package/lib/components/DateTimePicker/Base/relativeTimePicker.d.ts +1 -1
  139. package/lib/components/DateTimePicker/Base/relativeTimePicker.js +15 -3
  140. package/lib/components/DateTimePicker/BaseMobile/Absolute/constants.js +1 -0
  141. package/lib/components/DateTimePicker/BaseMobile/Absolute/index.d.ts +1 -1
  142. package/lib/components/DateTimePicker/BaseMobile/Absolute/index.js +4 -4
  143. package/lib/components/DateTimePicker/BaseMobile/CustomButton/index.d.ts +2 -2
  144. package/lib/components/DateTimePicker/BaseMobile/constants.js +1 -0
  145. package/lib/components/DateTimePicker/BaseMobile/index.d.ts +2 -2
  146. package/lib/components/DateTimePicker/BaseMobile/index.js +3 -2
  147. package/lib/components/DateTimePicker/Collapse/Panel/index.d.ts +1 -1
  148. package/lib/components/DateTimePicker/Collapse/Panel/index.js +19 -7
  149. package/lib/components/DateTimePicker/Collapse/index.d.ts +1 -1
  150. package/lib/components/DateTimePicker/Collapse/index.js +14 -2
  151. package/lib/components/DateTimePicker/DisplayInput/index.d.ts +1 -1
  152. package/lib/components/DateTimePicker/DisplayInput/index.js +20 -8
  153. package/lib/components/DateTimePicker/constants.js +1 -0
  154. package/lib/components/DateTimePicker/index.d.ts +1 -1
  155. package/lib/components/DateTimePicker/index.js +22 -9
  156. package/lib/components/DateTimePicker/transform.js +1 -0
  157. package/lib/components/Descriptions/index.js +19 -7
  158. package/lib/components/Drawer/CloseIcon/index.js +17 -3
  159. package/lib/components/Drawer/index.d.ts +5 -5
  160. package/lib/components/Drawer/index.js +4 -3
  161. package/lib/components/FileResumable/index.d.ts +2 -2
  162. package/lib/components/FileResumable/index.js +19 -7
  163. package/lib/components/FileResumable/utils.js +3 -1
  164. package/lib/components/Input/Password/index.d.ts +2 -2
  165. package/lib/components/Input/Password/index.js +20 -7
  166. package/lib/components/Input/TextArea/index.d.ts +2 -2
  167. package/lib/components/Input/TextArea/index.js +20 -7
  168. package/lib/components/Input/index.d.ts +4 -4
  169. package/lib/components/Input/index.js +19 -7
  170. package/lib/components/InputNumberWithUnit/index.d.ts +1 -1
  171. package/lib/components/InputNumberWithUnit/index.js +19 -7
  172. package/lib/components/KeyValuePair/index.d.ts +2 -2
  173. package/lib/components/KeyValuePair/index.js +27 -8
  174. package/lib/components/Measure/index.d.ts +2 -2
  175. package/lib/components/Menu/Option.d.ts +1 -1
  176. package/lib/components/Menu/Option.js +14 -2
  177. package/lib/components/Menu/index.d.ts +1 -1
  178. package/lib/components/Menu/index.js +20 -7
  179. package/lib/components/Modal/index.d.ts +1 -1
  180. package/lib/components/Modal/index.js +20 -8
  181. package/lib/components/NameExplainTooltip/index.d.ts +2 -2
  182. package/lib/components/NameExplainTooltip/index.js +19 -7
  183. package/lib/components/NameLimiter/index.d.ts +1 -1
  184. package/lib/components/NameLimiter/index.js +19 -7
  185. package/lib/components/OptionList/InlineOptionList/index.d.ts +2 -2
  186. package/lib/components/OptionList/InlineOptionList/index.js +14 -2
  187. package/lib/components/OptionList/OptionItem/index.d.ts +2 -2
  188. package/lib/components/OptionList/OptionItem/index.js +14 -2
  189. package/lib/components/OptionList/PopoverOptionList/index.d.ts +1 -1
  190. package/lib/components/OptionList/PopoverOptionList/index.js +19 -7
  191. package/lib/components/OptionList/constants.js +1 -0
  192. package/lib/components/OptionList/index.d.ts +1 -1
  193. package/lib/components/OptionList/index.js +23 -11
  194. package/lib/components/RadioGroup/index.d.ts +1 -1
  195. package/lib/components/RadioGroup/index.js +14 -2
  196. package/lib/components/RangeInput/index.d.ts +1 -1
  197. package/lib/components/RangeInput/index.js +19 -7
  198. package/lib/components/RangeInput/utils.js +1 -0
  199. package/lib/components/ReactSortable/index.d.ts +23 -0
  200. package/lib/components/ReactSortable/index.js +195 -0
  201. package/lib/components/RemarkName/index.d.ts +2 -2
  202. package/lib/components/RemarkName/index.js +15 -2
  203. package/lib/components/Selector/SelectorWidthChildren.d.ts +1 -1
  204. package/lib/components/Selector/SelectorWidthChildren.js +19 -7
  205. package/lib/components/Selector/index.d.ts +1 -1
  206. package/lib/components/Selector/index.js +20 -8
  207. package/lib/components/SolidRadioGroup/index.d.ts +1 -1
  208. package/lib/components/SolidRadioGroup/index.js +14 -2
  209. package/lib/components/Spin/LoadingSVG.d.ts +2 -2
  210. package/lib/components/Spin/index.d.ts +1 -1
  211. package/lib/components/Spin/index.js +1 -0
  212. package/lib/components/Steps/ControlButton/index.d.ts +1 -1
  213. package/lib/components/Steps/ControlButton/index.js +14 -2
  214. package/lib/components/Steps/Step/index.d.ts +2 -2
  215. package/lib/components/Steps/Step/index.js +14 -2
  216. package/lib/components/Steps/context.js +15 -2
  217. package/lib/components/Steps/index.d.ts +2 -2
  218. package/lib/components/Steps/index.js +19 -7
  219. package/lib/components/Style/index.d.ts +1 -1
  220. package/lib/components/Style/index.js +18 -6
  221. package/lib/components/Table/ColumnSetting/index.d.ts +1 -1
  222. package/lib/components/Table/ColumnSetting/index.js +22 -9
  223. package/lib/components/Table/ColumnTag/ColumnTag.d.ts +2 -2
  224. package/lib/components/Table/ColumnTag/ColumnTag.js +15 -2
  225. package/lib/components/Table/ResizableTitle/index.d.ts +2 -2
  226. package/lib/components/Table/constant.d.ts +7 -1
  227. package/lib/components/Table/constant.js +7 -0
  228. package/lib/components/Table/index.d.ts +15 -6
  229. package/lib/components/Table/index.js +167 -124
  230. package/lib/components/Tabs/index.d.ts +1 -1
  231. package/lib/components/Tabs/index.js +1 -0
  232. package/lib/components/TagList/Tag/index.d.ts +1 -1
  233. package/lib/components/TagList/Tag/index.js +19 -7
  234. package/lib/components/TagList/TagSwitch/index.d.ts +1 -1
  235. package/lib/components/TagList/TagSwitch/index.js +14 -2
  236. package/lib/components/TagList/index.d.ts +1 -1
  237. package/lib/components/TagList/index.js +20 -8
  238. package/lib/components/Timeline/TimelineItem/index.d.ts +1 -1
  239. package/lib/components/Timeline/TimelineItem/index.js +14 -2
  240. package/lib/components/Timeline/index.d.ts +1 -1
  241. package/lib/components/Timeline/index.js +15 -2
  242. package/lib/components/Transfer/List/index.d.ts +2 -2
  243. package/lib/components/Transfer/List/index.js +19 -7
  244. package/lib/components/Transfer/ListBody/index.d.ts +2 -2
  245. package/lib/components/Transfer/index.d.ts +2 -2
  246. package/lib/components/TreeSelector/index.d.ts +1 -1
  247. package/lib/components/TreeSelector/index.js +20 -7
  248. package/lib/constants/language/check_transform_list/en.js +1 -0
  249. package/lib/constants/language/check_transform_list/type.js +1 -0
  250. package/lib/constants/language/check_transform_list/zh.js +1 -0
  251. package/lib/constants/language/datetime/en.js +1 -0
  252. package/lib/constants/language/datetime/type.js +1 -0
  253. package/lib/constants/language/datetime/zh.js +1 -0
  254. package/lib/constants/language/en.js +1 -0
  255. package/lib/constants/language/modal/en.js +1 -0
  256. package/lib/constants/language/modal/type.js +1 -0
  257. package/lib/constants/language/modal/zh.js +1 -0
  258. package/lib/constants/language/range_input/en.js +1 -0
  259. package/lib/constants/language/range_input/type.js +1 -0
  260. package/lib/constants/language/range_input/zh.js +1 -0
  261. package/lib/constants/language/steps/en.js +1 -0
  262. package/lib/constants/language/steps/type.js +1 -0
  263. package/lib/constants/language/steps/zh.js +1 -0
  264. package/lib/constants/language/table/en.js +1 -0
  265. package/lib/constants/language/table/type.js +1 -0
  266. package/lib/constants/language/table/zh.js +1 -0
  267. package/lib/constants/language/transfer/en.js +1 -0
  268. package/lib/constants/language/transfer/type.js +1 -0
  269. package/lib/constants/language/transfer/zh.js +1 -0
  270. package/lib/constants/language/type.js +1 -0
  271. package/lib/constants/language/upload/type.js +1 -0
  272. package/lib/constants/language/zh.js +1 -0
  273. package/lib/constants/locale.js +1 -0
  274. package/lib/constants/style.js +1 -0
  275. package/lib/constants/time.js +1 -0
  276. package/lib/hoc/debounce.d.ts +1 -1
  277. package/lib/hoc/debounce.js +19 -7
  278. package/lib/hoc/modalPopupContainer.d.ts +1 -1
  279. package/lib/hoc/modalPopupContainer.js +19 -7
  280. package/lib/index.css +1587 -1587
  281. package/lib/index.d.ts +1 -0
  282. package/lib/index.js +67 -54
  283. package/lib/index.less +11 -11
  284. package/lib/style/theme.less +4 -3
  285. package/lib/utils/dom.js +1 -0
  286. package/lib/utils/env.js +1 -0
  287. package/lib/utils/language.js +1 -0
  288. package/lib/utils/languageLocale.js +1 -0
  289. package/lib/utils/time.js +17 -3
  290. package/package.json +17 -15
  291. package/CHANGELOG.json +0 -672
  292. 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(): boolean;
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(): (IKeyValues<any> | undefined)[];
103
- getColumns(): (IKeyValues<any> | undefined)[];
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[]): (IKeyValues<any> | undefined)[];
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
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
- this.setColumns((nextProps.scroll && nextProps.draggable === true) ||
138
- nextProps.draggable === ETableSettingType.RESIZE
139
- ? this.getResizeColumns(nextProps.columns)
140
- : nextProps.columns);
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: true,
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: true,
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: true,
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: true,
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: true,
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: true,
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: true,
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: true,
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: true,
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 _this = this;
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
- if (saveSettingKey) {
277
- // 支持排序或拖拽
278
- var sizeStr = localStorage.getItem(saveSettingKey);
279
- settingFields = (!!sizeStr && JSON.parse(sizeStr)) || [];
280
- // 已配置的列和实际的对不上
281
- // 可能新增或者删除列的情况
282
- var newSettingFields = [];
283
- if ((settingFields === null || settingFields === void 0 ? void 0 : settingFields.length) && isArray(settingFields)) {
284
- // 已配置列
285
- // 旧类型数据为对象类型,未配置
286
- settingFields.map(function (field) {
287
- var find = _this.columns.find(function (column) { return column.dataIndex === field.field; });
288
- if (find) {
289
- if (field.hide) {
290
- hideKeys.push(field.field);
291
- }
292
- if (!find.fixed) {
293
- sortableColumns.push(field);
294
- }
295
- else if (find.fixed === 'left' || find.fixed === true) {
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
- else {
328
- // 从未配置过的列
329
- this.columns.map(function (column) {
330
- if (!column.fixed) {
331
- sortableColumns.push({
332
- field: column.dataIndex,
333
- fixed: column.fixed
334
- });
335
- }
336
- else if (column.fixed === 'left' || column.fixed === true) {
337
- leftColumns.push({
338
- field: column.dataIndex,
339
- fixed: column.fixed
340
- });
341
- }
342
- else {
343
- rightColumns.push({
344
- field: column.dataIndex,
345
- fixed: column.fixed
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
- this.setFixedLeftKeys(leftColumns.map(function (t) { return t.field; }));
351
- this.setFixedRightKeys(rightColumns.map(function (t) { return t.field; }));
352
- this.setSortKeys(sortableColumns.map(function (t) { return t.field; }));
353
- this.setHiddenColumn(__spread(new Set(__spread(hiddenColumns, hideKeys))));
354
- newSettingFields = __spread(leftColumns, sortableColumns, rightColumns);
355
- this.setSettingFields(newSettingFields);
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 (this.props.saveSettingKey) {
565
- var sizeStr = localStorage.getItem(this.props.saveSettingKey);
566
- fields = !!sizeStr && JSON.parse(sizeStr);
567
- if (fields) {
568
- columns = columns === null || columns === void 0 ? void 0 : columns.map(function (col) {
569
- var _a;
570
- var dataIndex = get(col, 'dataIndex');
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
- this.setColumns(this.resizable && this.props.scroll
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 && scroll
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),
@@ -58,5 +58,5 @@ export interface ITabsProps extends TabsProps {
58
58
  /**
59
59
  * 卡片顶栏功能切换Tab
60
60
  */
61
- export declare function Tabs(props: ITabsProps): JSX.Element;
61
+ export declare function Tabs(props: ITabsProps): React.JSX.Element;
62
62
  export default Tabs;
@@ -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;
@@ -34,7 +34,7 @@ function TagList(props) {
34
34
  return;
35
35
  }
36
36
  if (active) {
37
- return onChange(__spread(values, [value]));
37
+ return onChange(__spread((values || []), [value]));
38
38
  }
39
39
  return onChange(values.filter(function (v) { return v !== value; }));
40
40
  };
@@ -23,4 +23,4 @@ export interface ITimelineItemProps {
23
23
  /**
24
24
  * Timeline的每个时间节点
25
25
  */
26
- export default function TimelineItem(props: ITimelineItemProps): JSX.Element;
26
+ export default function TimelineItem(props: ITimelineItemProps): React.JSX.Element;
@@ -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
- /// <reference types="react" />
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
- /// <reference types="react" />
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
- /// <reference types="react" />
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";
@@ -5,4 +5,4 @@ export interface IWrapperParamProps {
5
5
  }
6
6
  export default function debounceWrapper<T extends IWrapperParamProps>(Comp: React.ComponentType<T>): (props: T & {
7
7
  debounce?: number | undefined;
8
- }) => JSX.Element;
8
+ }) => React.JSX.Element;
@@ -4,4 +4,4 @@ export default function modalPopupContainerWrapper<T>(Comp: React.ComponentType<
4
4
  children: React.ReactNode;
5
5
  title?: React.ReactNode;
6
6
  extra?: React.ReactNode;
7
- }) => JSX.Element;
7
+ }) => React.JSX.Element;