vap1 0.4.3 → 0.4.5

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 (220) hide show
  1. package/_mixin.scss +89 -0
  2. package/components/Box/Box.d.ts +3 -3
  3. package/components/Box/Box.js +38 -29
  4. package/components/Box/SelectBar.d.ts +3 -3
  5. package/components/Box/index.d.ts +1 -1
  6. package/components/Lists/SList.d.ts +4 -5
  7. package/components/Lists/SList.js +4 -4
  8. package/components/SearchBar/ActionButtons.d.ts +4 -4
  9. package/components/SearchBar/ActionButtons.js +26 -3
  10. package/components/SearchBar/ByField.d.ts +1 -1
  11. package/components/SearchBar/ByField.js +2 -2
  12. package/components/SearchBar/ByKeyword.d.ts +2 -2
  13. package/components/SearchBar/ByKeyword.js +2 -2
  14. package/components/SearchBar/SearchField.d.ts +2 -2
  15. package/components/SearchBar/index.js +1 -1
  16. package/components/Tables/Components/ActionBar.d.ts +2 -3
  17. package/components/Tables/Components/Actions.d.ts +7 -7
  18. package/components/Tables/Components/Actions.js +4 -4
  19. package/components/Tables/Components/index.d.ts +6 -6
  20. package/components/Tables/STable.d.ts +1 -1
  21. package/components/Tables/TopTable.d.ts +2 -2
  22. package/components/Tables/TopTable.js +4 -19
  23. package/components/Tables/TopTableModal.d.ts +2 -2
  24. package/components/Tables/TopTableModal.js +1 -1
  25. package/components/Tables/Util.d.ts +5 -1
  26. package/components/Tables/Util.js +69 -2
  27. package/components/Tables/VTable.js +45 -74
  28. package/components/Tables/index.d.ts +5 -4
  29. package/components/TreeSelect/BaseTreeSelect.d.ts +3 -3
  30. package/components/TreeSelect/BaseTreeSelect.js +8 -5
  31. package/components/TreeSelect/DTreeSelect.d.ts +2 -2
  32. package/components/TreeSelect/DTreeSelect.js +1 -1
  33. package/components/TreeSelect/FTreeSelect.d.ts +2 -2
  34. package/components/TreeSelect/STreeSelect.d.ts +2 -2
  35. package/components/Trees/ActionTree.d.ts +4 -1
  36. package/components/Trees/BaseTree.d.ts +3 -2
  37. package/components/Trees/BaseTree.js +11 -2
  38. package/components/Trees/COTree/COButton.js +1 -1
  39. package/components/Trees/COTree/COSelect.js +1 -1
  40. package/components/Trees/COTree/COTreeUtil.d.ts +2 -1
  41. package/components/Trees/DTree.d.ts +8 -0
  42. package/components/Trees/FTree.d.ts +3 -3
  43. package/components/Trees/STree.d.ts +2 -2
  44. package/components/Trees/index.d.ts +4 -0
  45. package/components/UForm/FormWrapper.d.ts +2 -3
  46. package/components/UForm/UDescriptions.d.ts +2 -1
  47. package/components/UForm/UDescriptions.js +28 -5
  48. package/components/UForm/UForm.js +4 -4
  49. package/components/UForm/UFormModal.d.ts +2 -2
  50. package/components/UForm/UInfo.d.ts +2 -2
  51. package/components/UForm/UInfoModal.d.ts +2 -2
  52. package/components/UForm/UInfoModal.js +1 -1
  53. package/components/UForm/UModal.d.ts +2 -2
  54. package/components/UForm/_FieldType.d.ts +1 -1
  55. package/components/UForm/_FieldType.js +4 -0
  56. package/components/UForm/_input.d.ts +3 -3
  57. package/components/UForm/_input.js +2 -2
  58. package/components/UForm/_register.d.ts +2 -3
  59. package/components/UForm/index.d.ts +16 -13
  60. package/components/Upload/UploadFile.d.ts +2 -2
  61. package/components/Upload/UploadImage.d.ts +2 -2
  62. package/components/Upload/UploadImage.js +1 -1
  63. package/components/Upload/UploadModal.d.ts +4 -4
  64. package/components/Upload/UploadModal.js +2 -2
  65. package/components/Upload/useUpload.d.ts +2 -2
  66. package/components/Upload/useUpload.js +1 -1
  67. package/components/_RegisterUtil.d.ts +1 -1
  68. package/components/_RegisterUtil.js +2 -2
  69. package/components/_adapt/Alert.d.ts +2 -3
  70. package/components/_adapt/Button.d.ts +3 -4
  71. package/components/_adapt/Col.d.ts +8 -8
  72. package/components/_adapt/ColorPicker.js +2 -2
  73. package/components/_adapt/ConfigProvider.d.ts +3 -3
  74. package/components/_adapt/Drawer.d.ts +2 -3
  75. package/components/_adapt/Drawer.js +2 -2
  76. package/components/_adapt/FloatButton.d.ts +5 -5
  77. package/components/_adapt/Form.js +3 -3
  78. package/components/_adapt/Icon.d.ts +2 -1
  79. package/components/_adapt/Image.js +1 -1
  80. package/components/_adapt/Layout.d.ts +1 -2
  81. package/components/_adapt/Layout.js +1 -1
  82. package/components/_adapt/Menu.d.ts +5 -6
  83. package/components/_adapt/Menu.js +25 -2
  84. package/components/_adapt/Modal.d.ts +2 -1
  85. package/components/_adapt/Modal.js +1 -1
  86. package/components/_adapt/Progress.d.ts +3 -2
  87. package/components/_adapt/Progress.js +1 -1
  88. package/components/_adapt/Row.d.ts +2 -2
  89. package/components/_adapt/Select.js +1 -1
  90. package/components/_adapt/Slider.d.ts +7 -7
  91. package/components/_adapt/Space.d.ts +4 -3
  92. package/components/_adapt/Table.d.ts +5 -5
  93. package/components/_adapt/Tabs.d.ts +2 -3
  94. package/components/_adapt/Tag.js +25 -2
  95. package/components/_adapt/utils.js +10 -10
  96. package/components/_common/AutoComplete.d.ts +3 -3
  97. package/components/_common/CountUp.d.ts +3 -3
  98. package/components/_common/CountUp.js +1 -1
  99. package/components/_common/DateRange.d.ts +2 -2
  100. package/components/_common/HighLight.d.ts +2 -2
  101. package/components/_common/HighLight.js +1 -1
  102. package/components/_common/I18N.d.ts +2 -2
  103. package/components/_common/Loading.d.ts +3 -3
  104. package/components/_common/MonthRange.d.ts +2 -2
  105. package/components/_common/PromiseLabel.d.ts +4 -4
  106. package/components/_common/UTitle.d.ts +6 -5
  107. package/components/_common/UTitle.js +25 -2
  108. package/components/_common/Upagination.d.ts +2 -2
  109. package/deps/JsonView.d.ts +2 -2
  110. package/deps/JsonView.js +5 -2
  111. package/deps/app-audit/LookUp.d.ts +3 -3
  112. package/deps/app-audit/LookUp.js +2 -2
  113. package/deps/app-data/useSource.js +2 -2
  114. package/deps/echarts.d.ts +2 -2
  115. package/deps/editor/Article.d.ts +3 -3
  116. package/deps/editor/support/buttons/ImageButton.d.ts +2 -2
  117. package/deps/editor/support/buttons/ImageButton.js +1 -1
  118. package/deps/editor/tools/Button.d.ts +2 -2
  119. package/deps/editor/tools/Button.js +1 -1
  120. package/deps/editor/tools/ToolBar.d.ts +2 -2
  121. package/deps/editor/tools/_BlockButton.d.ts +2 -2
  122. package/deps/editor/tools/_InsertButton.d.ts +4 -4
  123. package/deps/editor/tools/_MarkButton.d.ts +2 -2
  124. package/deps/editor/tools/_TxtButton.d.ts +6 -6
  125. package/deps/editor/tools/_TxtButton.js +25 -5
  126. package/deps/editor/types.d.ts +2 -2
  127. package/deps/editor/utils/index.js +0 -5
  128. package/hooks/useApiBase.js +1 -1
  129. package/hooks/useApiGlobal.js +1 -1
  130. package/hooks/useApp.d.ts +3 -3
  131. package/hooks/useApp.js +1 -1
  132. package/hooks/useArray.js +5 -7
  133. package/hooks/useEffectFunction.d.ts +4 -2
  134. package/hooks/useGetSet.d.ts +1 -1
  135. package/hooks/useGlobal.d.ts +1 -1
  136. package/hooks/useHover.d.ts +3 -3
  137. package/hooks/useHover.js +2 -25
  138. package/package.json +1 -1
  139. package/screen/Comment.d.ts +3 -3
  140. package/screen/EchartContent.js +2 -2
  141. package/screen/Page.d.ts +2 -2
  142. package/screen/Page.js +3 -3
  143. package/screen/render.d.ts +2 -2
  144. package/uform/FormEditor.d.ts +2 -2
  145. package/uform/FormEditor.js +3 -2
  146. package/uform/inputs/_date.js +1 -1
  147. package/uform/inputs/_input.js +1 -1
  148. package/uform/inputs/_select.js +1 -1
  149. package/uform/inputs/register.d.ts +2 -2
  150. package/uform/panel/Editor/GroupEditor.js +3 -3
  151. package/uform/panel/Editor/_GroupCollapse.js +3 -3
  152. package/uform/panel/Editor/_GroupDefault.js +24 -4
  153. package/uform/panel/Editor/_GroupStep.js +28 -5
  154. package/uform/panel/Editor/_GroupTab.js +25 -2
  155. package/uform/panel/Editor/index.js +1 -1
  156. package/uform/panel/Items/Fields.d.ts +2 -2
  157. package/uform/panel/Items/Fields.js +3 -1
  158. package/uform/panel/Items/InputSelector.d.ts +2 -2
  159. package/uform/panel/Items/InputSelector.js +2 -1
  160. package/uform/panel/Items/Inputs.d.ts +2 -1
  161. package/uform/panel/Items/Inputs.js +24 -4
  162. package/uform/panel/Propreties/CanvasProperties.js +25 -2
  163. package/uform/panel/Propreties/Component/FieldPlugin.d.ts +2 -2
  164. package/uform/panel/Propreties/Component/FieldPlugin.js +1 -1
  165. package/uform/panel/Propreties/Component/LinkAsyncFunction.d.ts +2 -2
  166. package/uform/panel/Propreties/Component/LinkAsyncFunction.js +1 -1
  167. package/uform/panel/Propreties/Component/LinkSyncFunction.d.ts +2 -2
  168. package/uform/panel/Propreties/Component/LinkSyncFunction.js +1 -1
  169. package/uform/panel/Propreties/Component/Links.js +1 -1
  170. package/uform/panel/Propreties/Component/OptionTable.js +25 -5
  171. package/uform/panel/Propreties/Component/RegexpModal.d.ts +2 -2
  172. package/uform/panel/Propreties/Component/Validate.js +1 -1
  173. package/uform/panel/Propreties/Component/ValidateAsyncFunction.d.ts +2 -2
  174. package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +25 -2
  175. package/uform/panel/Propreties/Component/ValidateSyncFunction.d.ts +2 -2
  176. package/uform/panel/Propreties/Component/ValidateSyncFunction.js +25 -2
  177. package/uform/panel/Propreties/FieldProperties.js +1 -1
  178. package/uform/panel/Propreties/_ItemAdvance.js +25 -2
  179. package/uform/panel/Propreties/_ItemBase.js +1 -1
  180. package/uform/panel/Propreties/_ItemLink.js +24 -4
  181. package/uform/panel/Propreties/_ItemValidate.js +24 -4
  182. package/uform/utils/Convert.js +9 -9
  183. package/utils/CacheUtil.d.ts +4 -4
  184. package/utils/CacheUtil.js +15 -15
  185. package/utils/Const.d.ts +3 -2
  186. package/utils/Const.js +26 -5
  187. package/utils/CustomApp.d.ts +5 -5
  188. package/utils/Format.js +2 -1
  189. package/utils/Global.d.ts +5 -0
  190. package/utils/Global.js +1 -0
  191. package/utils/Renders/ApiGetRender.js +3 -3
  192. package/utils/Renders/ApiPostRender.js +2 -2
  193. package/utils/Renders/CondictionRender.d.ts +5 -0
  194. package/utils/Renders/CondictionRender.js +163 -0
  195. package/utils/Renders/DateRender.js +5 -5
  196. package/utils/Renders/DictRender.d.ts +2 -5
  197. package/utils/Renders/DictRender.js +19 -14
  198. package/utils/Renders/FileRender.d.ts +2 -1
  199. package/utils/Renders/FileRender.js +5 -5
  200. package/utils/Renders/ListRender.js +9 -9
  201. package/utils/Renders/NumberRender.js +4 -4
  202. package/utils/Renders/StatusRender.js +2 -2
  203. package/utils/Renders/StringRender.js +4 -4
  204. package/utils/Renders/_DictBaseRender.d.ts +1 -1
  205. package/utils/Renders/_DictBaseRender.js +23 -23
  206. package/utils/Renders/_define.d.ts +6 -6
  207. package/utils/Renders/_define.js +9 -14
  208. package/utils/Renders/index.d.ts +1 -0
  209. package/utils/Renders/index.js +3 -1
  210. package/utils/StringUtil.d.ts +8 -6
  211. package/utils/StringUtil.js +27 -17
  212. package/utils/TreeUtil.js +6 -5
  213. package/utils/VAP.d.ts +4 -4
  214. package/utils/VAP.js +8 -40
  215. package/utils/_Support.d.ts +0 -6
  216. package/utils/_Support.js +1 -67
  217. package/utils/i18n.d.ts +3 -3
  218. package/utils/py.d.ts +19 -0
  219. package/utils/py.js +174 -0
  220. package/widget/index.d.ts +2 -2
@@ -1,5 +1,5 @@
1
- import React from "react";
1
+ import type { FC } from 'react';
2
2
  import type { ModalProps } from '../_adapt/Modal';
3
3
  import type { TopTableProps } from './TopTable';
4
4
  export type TopTableModalProps = TopTableProps & ModalProps;
5
- export declare const TopTableModal: React.FC<TopTableModalProps>;
5
+ export declare const TopTableModal: FC<TopTableModalProps>;
@@ -25,7 +25,7 @@ var TOP_TABLE_PROPERTIES = [
25
25
  var TopTableModal = function (props) {
26
26
  var modalProps = lodash_1.default.omit(props, TOP_TABLE_PROPERTIES);
27
27
  var tableProps = lodash_1.default.pick(props, TOP_TABLE_PROPERTIES);
28
- return react_1.default.createElement(Modal_1.Modal, __assign({}, modalProps),
28
+ return react_1.default.createElement(Modal_1.Modal, __assign({ footer: null }, modalProps),
29
29
  react_1.default.createElement(TopTable_1.TopTable, __assign({}, tableProps)));
30
30
  };
31
31
  exports.TopTableModal = TopTableModal;
@@ -1,3 +1,7 @@
1
1
  import type { MutableRefObject } from 'react';
2
+ import type { BaseTableProps } from './index';
2
3
  import type { ColumnProps } from 'antd/es/table/interface';
3
- export declare const getIdxColumn: (ref: MutableRefObject<number>, showIndex?: string, isRank?: boolean) => ColumnProps<any>;
4
+ export declare const convertColumns: (props: BaseTableProps, rank: {
5
+ ref: MutableRefObject<number>;
6
+ isRank?: boolean;
7
+ }) => ColumnProps<any>[];
@@ -1,9 +1,20 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getIdxColumn = void 0;
17
+ exports.convertColumns = void 0;
7
18
  var lodash_1 = __importDefault(require("lodash"));
8
19
  var utils_1 = require("../../utils");
9
20
  var _i18n_1 = require("../_i18n");
@@ -40,4 +51,60 @@ var getIdxColumn = function (ref, showIndex, isRank) {
40
51
  render: idxRender
41
52
  };
42
53
  };
43
- exports.getIdxColumn = getIdxColumn;
54
+ var convertCol = function (col) {
55
+ if (col.roleCode && !utils_1.PageUtil.hasRole(col.roleCode))
56
+ return null;
57
+ var item = __assign({}, col);
58
+ if (col.ik) {
59
+ var title = utils_1.i18n.txt(col.ik);
60
+ item.title = title == '' ? item.title : title;
61
+ }
62
+ var clazz = [];
63
+ if (col.wrap) {
64
+ clazz.push('c-table-col-wrap');
65
+ }
66
+ else if (!lodash_1.default.has(col, 'ellipsis')) {
67
+ item.ellipsis = true;
68
+ }
69
+ if (!lodash_1.default.has(item, 'width')) {
70
+ if (lodash_1.default.isString(item.title)) {
71
+ clazz.push('c-table-col-' + (item.title.length + (item.sorter ? 2 : 0)));
72
+ }
73
+ if (lodash_1.default.isString(col.dataIndex) && col.dataIndex.length && col.dataIndex.indexOf('.') < 0 && col.dataIndex.indexOf('[') < 0) {
74
+ clazz.push('table-col-' + col.dataIndex);
75
+ if (col.sorter) {
76
+ clazz.push('c-table-col-has-sorter');
77
+ }
78
+ }
79
+ }
80
+ if (col.className) {
81
+ clazz.push(col.className);
82
+ }
83
+ item.className = clazz.join(' ');
84
+ return item;
85
+ };
86
+ var convertColumns = function (props, rank) {
87
+ // props.columns[0]
88
+ var cols = (props.showIndex == false) ? [] : [getIdxColumn(rank.ref, props.showIndex, rank.isRank)];
89
+ props.columns.map(function (col) {
90
+ // @ts-ignore
91
+ var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children);
92
+ if (isGroup) {
93
+ console.error('Not Support group mode in 1.5');
94
+ // let column: ColumnGroupType<any> = { ..._.pick(col, ['width', 'align']), children: [], title: col.title, className: 'c-table-header-group' };
95
+ // if (col.className) column.className = `c-table-header-group ${col.className}`;
96
+ // (col as TableColumnGroup).children.map((item => {
97
+ // let subCol = convertCol(item);
98
+ // if (subCol != null) column.children.push(subCol);
99
+ // }));
100
+ // if (column.children.length > 0) cols.push(column);
101
+ }
102
+ else {
103
+ var column = convertCol(col);
104
+ if (column != null)
105
+ cols.push(column);
106
+ }
107
+ });
108
+ return cols;
109
+ };
110
+ exports.convertColumns = convertColumns;
@@ -98,6 +98,13 @@ exports.getHeightByTagName = getHeightByTagName;
98
98
  var _VTable = (0, react_1.forwardRef)(function (props, ref) {
99
99
  var update = (0, hooks_1.useUpdate)();
100
100
  var _a = (0, Box_1.useBox)(), state = _a.state, root = _a.root, resize = _a.resize;
101
+ var inModal = (0, react_1.useMemo)(function () {
102
+ if (root.current == null)
103
+ return false;
104
+ return root.current.parentElement.parentElement.classList.contains('ant-modal-body')
105
+ || root.current.parentElement.parentElement.parentElement.classList.contains('ant-modal-body')
106
+ || root.current.parentElement.parentElement.parentElement.parentElement.classList.contains('ant-modal-body');
107
+ }, []);
101
108
  // const [scroll, setScroll] = useState<TableProps<PlainObject>['scroll']>(undefined);
102
109
  var _b = props.model, rowKey = _b.rowKey, list = _b.list, isQuerying = _b.isQuerying, pageNo = _b.pageNo, pageSize = _b.pageSize, orderBy = _b.orderBy, query = _b.query, total = _b.total;
103
110
  var start = (0, react_1.useRef)(0);
@@ -173,85 +180,45 @@ var _VTable = (0, react_1.forwardRef)(function (props, ref) {
173
180
  }, [isFristMounted]);
174
181
  // 计算 clolum 及 高亮keyword
175
182
  var columns = (0, react_1.useMemo)(function () {
176
- var cols = [];
177
- if (props.showIndex !== false)
178
- cols.push((0, Util_1.getIdxColumn)(start, props.showIndex));
183
+ var cols = (0, Util_1.convertColumns)(props, { ref: start, isRank: false });
184
+ if (!utils_1.GLOBAL.CONFIG.SEARCHBAR.DISABLE_KEYWORD || !lodash_1.default.has(props, 'searchBar.keyword'))
185
+ return cols;
179
186
  var HighKeys = new Set();
180
- if (!utils_1.GLOBAL.CONFIG.SEARCHBAR.DISABLE_KEYWORD && lodash_1.default.has(props, 'searchBar.keyword')) {
181
- if (lodash_1.default.isObject(props.searchBar.keyword)) {
182
- (props.searchBar.keyword.highlight || []).map(function (key) { return HighKeys.add(key); });
183
- }
184
- else {
185
- props.columns.map(function (col) {
186
- // @ts-ignore
187
- var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children);
188
- if (isGroup) {
189
- col.children.map((function (item) {
190
- if (lodash_1.default.isString(item.dataIndex))
191
- HighKeys.add(item.dataIndex);
192
- }));
193
- }
194
- else {
195
- var dataIndex = col.dataIndex;
196
- if (lodash_1.default.isString(dataIndex))
197
- HighKeys.add(dataIndex);
198
- }
199
- });
200
- }
187
+ if (lodash_1.default.isObject(props.searchBar.keyword)) {
188
+ (props.searchBar.keyword.highlight || []).map(function (key) { return HighKeys.add(key); });
201
189
  }
202
- var convertCol = function (col) {
203
- if (col.roleCode && !utils_1.PageUtil.hasRole(col.roleCode))
204
- return null;
205
- var item = __assign({}, col);
206
- if (col.ik) {
207
- var title = utils_1.i18n.txt(col.ik);
208
- item.title = title == '' ? item.title : title;
209
- }
210
- if (HighKeys.has(item.dataIndex) && item.render == null) {
211
- item.render = function (record) {
212
- if (!lodash_1.default.isString(record))
213
- return record;
214
- var keyword = '';
215
- if (record && keyword) {
216
- return react_1.default.createElement(HighLight_1.HighLight, { text: record, keyword: keyword });
217
- }
218
- return record;
219
- };
220
- }
221
- if (!lodash_1.default.has(item, 'ellipsis'))
222
- item.ellipsis = true;
223
- if (!lodash_1.default.has(item, 'width') && lodash_1.default.isString(item.title)) {
224
- var clz = item.title.length + (item.sorter ? 2 : 0);
225
- if (col.className) {
226
- item.className = 'c-table-col-' + clz + ' ' + col.className;
190
+ else {
191
+ props.columns.map(function (col) {
192
+ // @ts-ignore
193
+ var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children);
194
+ if (isGroup) {
195
+ col.children.map((function (item) {
196
+ if (lodash_1.default.isString(item.dataIndex))
197
+ HighKeys.add(item.dataIndex);
198
+ }));
227
199
  }
228
200
  else {
229
- item.className = 'c-table-col-' + clz;
201
+ var dataIndex = col.dataIndex;
202
+ if (lodash_1.default.isString(dataIndex))
203
+ HighKeys.add(dataIndex);
230
204
  }
231
- }
232
- return item;
233
- };
234
- props.columns.map(function (col) {
235
- // @ts-ignore
236
- var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children);
237
- if (isGroup) {
238
- var column_1 = __assign(__assign({}, lodash_1.default.pick(col, ['width', 'align'])), { children: [], title: col.title, className: 'c-table-header-group' });
239
- if (col.className)
240
- column_1.className = "c-table-header-group ".concat(col.className);
241
- col.children.map((function (item) {
242
- var subCol = convertCol(item);
243
- if (subCol != null)
244
- column_1.children.push(subCol);
245
- }));
246
- if (column_1.children.length > 0)
247
- cols.push(column_1);
248
- }
249
- else {
250
- var column = convertCol(col);
251
- if (column != null)
252
- cols.push(column);
253
- }
254
- });
205
+ });
206
+ }
207
+ if (HighKeys.size > 0) {
208
+ cols.map(function (col) {
209
+ if (HighKeys.has(col.dataIndex) && col.render == null) {
210
+ col.render = function (record) {
211
+ if (!lodash_1.default.isString(record))
212
+ return record;
213
+ var keyword = '';
214
+ if (record && keyword) {
215
+ return react_1.default.createElement(HighLight_1.HighLight, { text: record, keyword: keyword });
216
+ }
217
+ return record;
218
+ };
219
+ }
220
+ });
221
+ }
255
222
  return cols;
256
223
  }, [props.columns]);
257
224
  (0, react_1.useLayoutEffect)(function () {
@@ -269,6 +236,10 @@ var _VTable = (0, react_1.forwardRef)(function (props, ref) {
269
236
  }, []);
270
237
  // 更新高度 table 需要把 head 排除设置滚动
271
238
  // useEffect(() => {
239
+ // if (inModal) {
240
+ // setScroll({ x: true })
241
+ // return;
242
+ // }
272
243
  // if (props.scroll === null) return;
273
244
  // if (props.mode == undefined || props.mode == 'common') return;
274
245
  // let height = state?.height;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import type { TableDefined } from './Components';
3
- import type { ForwardRefExoticComponent, ExoticComponent, RefAttributes } from 'react';
2
+ import type { ReactNode, ForwardRefExoticComponent, ExoticComponent, RefAttributes } from 'react';
4
3
  import type { TableProps } from '../_adapt/Table';
5
4
  import type { ColumnProps } from 'antd/es/table/interface';
6
5
  import type { SearchBarProps } from '../SearchBar/index';
@@ -8,7 +7,9 @@ import type { TableActionButton } from './Components/ActionBar';
8
7
  import type { PlainObject, BaseItem, ApiModel } from '../../basetype';
9
8
  import type { BoxMode } from '../Box/Box';
10
9
  import type { SelectBarProps } from '../Box/SelectBar';
11
- export type TableColumn = BaseItem & Omit<ColumnProps<any>, 'children'>;
10
+ export type TableColumn = BaseItem & Omit<ColumnProps<any>, 'children'> & {
11
+ wrap?: boolean;
12
+ };
12
13
  export type TableColumnGroup = Pick<TableColumn, 'className' | 'width' | 'align'> & {
13
14
  title: string;
14
15
  children: TableColumn[];
@@ -52,7 +53,7 @@ export type BaseTableProps = TableDefine & {
52
53
  /**
53
54
  * 表格操作区域
54
55
  */
55
- actionBar?: (TableActionButton[]) | React.ReactNode;
56
+ actionBar?: (TableActionButton[]) | ReactNode;
56
57
  /**
57
58
  * 表格选择区域
58
59
  */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { ReactNode, PropsWithChildren } from 'react';
2
+ import type { FC, ReactNode, PropsWithChildren } from 'react';
3
3
  import type { TreeNodeData } from '../../utils/TreeUtil';
4
4
  import type { TreeSelectProps } from 'antd/es/tree-select';
5
5
  import type { BaseTreeSelectProps } from './index';
@@ -25,7 +25,7 @@ type BaseTreeSelectContext = {
25
25
  };
26
26
  declare const BaseTreeSelectContext: React.Context<BaseTreeSelectContext>;
27
27
  export declare const useBaseTree: () => BaseTreeSelectContext;
28
- export declare const BaseTreeSelect: React.FC<PropsWithChildren<BaseTreeSelectProps>>;
28
+ export declare const BaseTreeSelect: FC<PropsWithChildren<BaseTreeSelectProps>>;
29
29
  export declare const getNodeParam: (node: any, state: BaseTreeSelectState, disabledNode: (node: PlainObject) => boolean) => any;
30
- export declare const renderRoot: (props: BaseTreeSelectProps, state: BaseTreeSelectState) => React.ReactNode;
30
+ export declare const renderRoot: (props: BaseTreeSelectProps, state: BaseTreeSelectState) => ReactNode;
31
31
  export {};
@@ -58,10 +58,13 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
58
58
  }
59
59
  return to.concat(ar || Array.prototype.slice.call(from));
60
60
  };
61
+ var __importDefault = (this && this.__importDefault) || function (mod) {
62
+ return (mod && mod.__esModule) ? mod : { "default": mod };
63
+ };
61
64
  Object.defineProperty(exports, "__esModule", { value: true });
62
65
  exports.renderRoot = exports.getNodeParam = exports.BaseTreeSelect = exports.useBaseTree = void 0;
63
- var lodash_1 = __importStar(require("lodash"));
64
66
  var react_1 = __importStar(require("react"));
67
+ var lodash_1 = __importDefault(require("lodash"));
65
68
  var antd_1 = require("antd");
66
69
  var HighLight_1 = require("../_common/HighLight");
67
70
  var Icon_1 = require("../_adapt/Icon");
@@ -136,7 +139,7 @@ var BaseTreeSelect = function (props) {
136
139
  }, []);
137
140
  var value = (0, react_1.useMemo)(function () {
138
141
  if (props.multiple) {
139
- if ((0, lodash_1.isArray)(props.value))
142
+ if (lodash_1.default.isArray(props.value))
140
143
  return props.value;
141
144
  if (props.value)
142
145
  return [props.value];
@@ -206,13 +209,13 @@ var getNodeParam = function (node, state, disabledNode) {
206
209
  var icon = node[iconField];
207
210
  if (icon) {
208
211
  if (icon.indexOf('/') >= 0) {
209
- param.title = react_1.default.createElement(react_1.default.Fragment, null,
212
+ param.title = react_1.default.createElement(react_1.Fragment, null,
210
213
  react_1.default.createElement("span", { className: 'v-icon-bg' },
211
214
  react_1.default.createElement("img", { style: { marginTop: -4 }, src: node[iconField] })),
212
215
  title);
213
216
  }
214
217
  else {
215
- param.title = react_1.default.createElement(react_1.default.Fragment, null,
218
+ param.title = react_1.default.createElement(react_1.Fragment, null,
216
219
  react_1.default.createElement(Icon_1.Icon, { type: node[iconField] }),
217
220
  title);
218
221
  }
@@ -221,7 +224,7 @@ var getNodeParam = function (node, state, disabledNode) {
221
224
  else if (lodash_1.default.isFunction(iconField)) {
222
225
  var icon = iconField(node);
223
226
  if (icon) {
224
- param.title = react_1.default.createElement(react_1.default.Fragment, null,
227
+ param.title = react_1.default.createElement(react_1.Fragment, null,
225
228
  icon,
226
229
  title);
227
230
  }
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import type { BaseTreeSelectProps } from './index';
3
2
  import type { DTreeData } from '../Trees/DTree';
3
+ import type { FC } from 'react';
4
4
  export type DTreeSelectProps = BaseTreeSelectProps & DTreeData;
5
- export declare const DTreeSelect: React.FC<DTreeSelectProps>;
5
+ export declare const DTreeSelect: FC<DTreeSelectProps>;
@@ -111,8 +111,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
111
111
  Object.defineProperty(exports, "__esModule", { value: true });
112
112
  exports.DTreeSelect = void 0;
113
113
  var react_1 = __importStar(require("react"));
114
- var antd_1 = require("antd");
115
114
  var lodash_1 = __importDefault(require("lodash"));
115
+ var antd_1 = require("antd");
116
116
  var BaseTreeSelect_1 = require("./BaseTreeSelect");
117
117
  var hooks_1 = require("../../hooks");
118
118
  var utils_1 = require("../../utils");
@@ -1,5 +1,5 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { BaseTreeSelectProps } from './index';
3
3
  import type { FTreeData } from '../Trees/FTree';
4
4
  export type FTreeSelectProps = BaseTreeSelectProps & Required<FTreeData>;
5
- export declare const FTreeSelect: React.FC<FTreeSelectProps>;
5
+ export declare const FTreeSelect: FC<FTreeSelectProps>;
@@ -1,5 +1,5 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { STreeData } from '../Trees/STree';
3
3
  import type { BaseTreeSelectProps } from './index';
4
4
  export type STreeSelectProps = BaseTreeSelectProps & STreeData;
5
- export declare const STreeSelect: React.FC<STreeSelectProps>;
5
+ export declare const STreeSelect: FC<STreeSelectProps>;
@@ -37,9 +37,12 @@ export declare const useActionTree: () => ActionTreeContext;
37
37
  export declare const ActionTree: React.ForwardRefExoticComponent<import("../../utils/TreeUtil").BaseTreeOpts & Pick<import("antd/es/tree/Tree").TreeProps, "className" | "disabled" | "defaultExpandAll"> & {
38
38
  iconField?: string | ((item: any) => React.ReactNode);
39
39
  titleField: string | import("./index").LanguageField;
40
+ titleRender?: (node: PlainObject) => React.ReactNode;
40
41
  mustSelect?: boolean;
41
42
  disabledNode?: (node: PlainObject) => boolean;
42
- onSelect?: (key: Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void;
43
+ onSelect?: (key: Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void; /**
44
+ * 获取子节点方法
45
+ */
43
46
  searchValue?: string;
44
47
  } & BaseActionTreeProps & CacheTree & React.RefAttributes<ActionTreeRef>>;
45
48
  export declare const renderRoot: (props: ActionTreeProps, state: BaseTreeState, context: ActionTreeContext) => ReactNode;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Language } from '../../utils/_Support';
3
+ import type { FC, PropsWithChildren, ReactNode } from 'react';
3
4
  import type { BaseTreeOpts, SearchResult, TreeNodeData } from '../../utils/TreeUtil';
4
5
  import type { AntTreeNodeProps, AntTreeNodeSelectedEvent, TreeProps } from 'antd/es/tree';
5
- import type { PropsWithChildren, ReactNode } from 'react';
6
6
  import type { BaseTreeProps } from './index';
7
7
  import type { Key, PlainObject } from '../../basetype';
8
8
  export type BaseTreeState = Required<BaseTreeOpts> & {
@@ -11,6 +11,7 @@ export type BaseTreeState = Required<BaseTreeOpts> & {
11
11
  selectedKeys: string[];
12
12
  selectedNode: PlainObject;
13
13
  titleField: string;
14
+ titleRender?: (item: any) => ReactNode;
14
15
  iconField: string | ((item: any) => ReactNode);
15
16
  inited: boolean;
16
17
  langs: {
@@ -27,6 +28,6 @@ type BaseTreeContext = {
27
28
  };
28
29
  declare const BaseTreeContext: React.Context<BaseTreeContext>;
29
30
  export declare const useBaseTree: () => BaseTreeContext;
30
- export declare const BaseTree: React.FC<PropsWithChildren<BaseTreeProps>>;
31
+ export declare const BaseTree: FC<PropsWithChildren<BaseTreeProps>>;
31
32
  export declare const getNodeParam: (node: any, position: number[], state: BaseTreeState, search: SearchResult, disabledNode: (node: PlainObject) => boolean, folderChecker: (node: PlainObject) => boolean) => AntTreeNodeProps;
32
33
  export {};
@@ -99,6 +99,7 @@ var BaseTree = function (props) {
99
99
  rootCode: '0',
100
100
  search: { word: null, keyword: null, match: null },
101
101
  titleField: 'name',
102
+ titleRender: null,
102
103
  keyField: 'id',
103
104
  iconField: null,
104
105
  sortField: null,
@@ -145,6 +146,9 @@ var BaseTree = function (props) {
145
146
  DEFAULT.langs = langs;
146
147
  }
147
148
  }
149
+ if (props.titleRender && lodash_1.default.isFunction(props.titleRender)) {
150
+ DEFAULT.titleRender = props.titleRender;
151
+ }
148
152
  var _a = __read((0, hooks_1.useSetState)(DEFAULT), 2), state = _a[0], setState = _a[1];
149
153
  var PID = (0, react_1.useRef)(null);
150
154
  var searchByKeyWord = (0, react_1.useCallback)(function (word) {
@@ -203,13 +207,18 @@ var BaseTree = function (props) {
203
207
  };
204
208
  exports.BaseTree = BaseTree;
205
209
  var getNodeParam = function (node, position, state, search, disabledNode, folderChecker) {
206
- var titleField = state.titleField, keyField = state.keyField, iconField = state.iconField;
210
+ var titleField = state.titleField, keyField = state.keyField, iconField = state.iconField, titleRender = state.titleRender;
207
211
  var param = { key: node[keyField], data: { node: node, position: position } };
208
212
  if (search.keyword) {
209
213
  param.title = react_1.default.createElement(HighLight_1.HighLight, { keyword: search.keyword, text: node[titleField] });
210
214
  }
211
215
  else {
212
- param.title = node[titleField];
216
+ if (titleRender) {
217
+ param.title = titleRender(node);
218
+ }
219
+ else {
220
+ param.title = node[titleField];
221
+ }
213
222
  }
214
223
  if (lodash_1.default.isFunction(disabledNode)) {
215
224
  if (disabledNode(node)) {
@@ -134,7 +134,7 @@ var COButton = function (props) {
134
134
  value.length > 0 && react_1.default.createElement(index_1.Popover, { style: { width: 480 }, overlayClassName: 'co-button-content', content: react_1.default.createElement(COSelect_1.SelectedTable, __assign({}, props, { value: value })) },
135
135
  react_1.default.createElement(index_1.Button, { icon: "unordered-list", type: "primary", style: { paddingRight: 0, paddingLeft: 4 } })),
136
136
  react_1.default.createElement(index_1.Modal, { open: open, title: "\u8BF7\u9009\u62E9\u673A\u6784", bodyStyle: { maxHeight: 540, overflow: 'auto' }, width: 720, onCancel: function () { return setOpen(false); }, onOk: onOk },
137
- react_1.default.createElement(index_1.Alert, { message: react_1.default.createElement(react_1.default.Fragment, null,
137
+ react_1.default.createElement(index_1.Alert, { message: react_1.default.createElement(react_1.Fragment, null,
138
138
  "\u9009\u4E2D\u72B6\u6001\u8BF4\u660E \uFF1A ",
139
139
  (0, COTreeUtil_1.flagRender)(0, ' :'),
140
140
  " ",
@@ -103,7 +103,7 @@ var COSelect = function (props) {
103
103
  }
104
104
  }, [convert]);
105
105
  return react_1.default.createElement(index_1.Input.Group, { compact: true, style: { width: props.width || '100%', display: 'flex' } },
106
- react_1.default.createElement(index_1.Select, { maxTagCount: 1, mode: "tags", disabled: props.disabled, maxTagPlaceholder: react_1.default.createElement(react_1.default.Fragment, null), showSearch: false, className: 'co-select', allowClear: props.allowClear,
106
+ react_1.default.createElement(index_1.Select, { maxTagCount: 1, mode: "tags", disabled: props.disabled, maxTagPlaceholder: utils_1.Const.NONE, showSearch: false, className: 'co-select', allowClear: props.allowClear,
107
107
  // onClear={() => props.onChange([])}
108
108
  placeholder: props.placeholder || '请选择机构', style: { flexGrow: 1 }, showAction: ["click"], options: [], labelInValue: true, value: selectValue, dropdownStyle: { width: props.width || '100%', maxHeight: 360, overflow: 'auto' }, dropdownRender: function () { return react_1.default.createElement(COTree_1.COTree, __assign({}, props, { value: value, onChange: onChange })); }, getPopupContainer: function (evt) {
109
109
  return evt.parentElement.parentElement;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { ReactNode } from 'react';
2
3
  import type { TreeProps } from 'antd/es/tree/Tree';
3
4
  import type { COTreeProps, COTreeValueItem, FLAG } from './COTree';
4
5
  import type { PlainObject } from '../../../basetype';
@@ -9,7 +10,7 @@ export type TreeFields = {
9
10
  parentField: string;
10
11
  checkField?: string;
11
12
  };
12
- export declare const flagRender: (flag: FLAG, split?: React.ReactNode) => React.JSX.Element;
13
+ export declare const flagRender: (flag: FLAG, split?: ReactNode) => React.JSX.Element;
13
14
  export declare const getTreeDataByLoaded: (all: any[], treeProps: COTreeProps, FIELDS: TreeFields) => [TreeProps, Set<string>, Set<string>, Set<string>];
14
15
  export declare const convertFormObject: (obj: PlainObject) => COTreeValueItem[];
15
16
  export declare const invertToObject: (items: COTreeValueItem[]) => PlainObject;
@@ -34,7 +34,15 @@ export type DTreeProps = BaseTreeProps & BaseActionTreeProps & DTreeData;
34
34
  */
35
35
  export declare const DTree: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("../../utils/TreeUtil").BaseTreeOpts & Pick<TreeProps, "className" | "disabled" | "defaultExpandAll"> & {
36
36
  iconField?: string | ((item: any) => React.ReactNode);
37
+ /**
38
+ * 展开子节点:
39
+ *
40
+ * 方式一:传一个 api 接口地址,必须返回 VData<Array<Object>> 格式
41
+ *
42
+ * 方式二:传一个方法 ,接收一个父节点参数,必须返回 Promise<TreeNodeData[]> (不要返回 children, 仅返回一级)
43
+ */
37
44
  titleField: string | import("./index").LanguageField;
45
+ titleRender?: (node: PlainObject) => React.ReactNode;
38
46
  mustSelect?: boolean;
39
47
  disabledNode?: (node: PlainObject) => boolean;
40
48
  onSelect?: (key: Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void;
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { TreeUtil } from '../../utils';
3
3
  import type { TreeProps } from 'antd/es/tree';
4
4
  import type { BaseTreeProps, BaseActionTreeProps, ActionTreeRef } from './index';
5
- import type { PlainObject } from '../../basetype';
6
5
  export type FTreeData = {
7
6
  /**
8
7
  * 获取全部节点的API,如果不传,刚用 API 的GET模式代替
@@ -19,8 +18,9 @@ export type FTreeProps = BaseTreeProps & BaseActionTreeProps & FTreeData;
19
18
  export declare const FTree: React.MemoExoticComponent<React.ForwardRefExoticComponent<TreeUtil.BaseTreeOpts & Pick<TreeProps, "className" | "disabled" | "defaultExpandAll"> & {
20
19
  iconField?: string | ((item: any) => React.ReactNode);
21
20
  titleField: string | import("./index").LanguageField;
21
+ titleRender?: (node: import("../..").PlainObject) => React.ReactNode;
22
22
  mustSelect?: boolean;
23
- disabledNode?: (node: PlainObject) => boolean;
24
- onSelect?: (key: import("../../basetype").Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void;
23
+ disabledNode?: (node: import("../..").PlainObject) => boolean;
24
+ onSelect?: (key: import("../..").Key, node: import("../..").PlainObject, parentNode: import("../..").PlainObject, crumb: import("../..").PlainObject[], pos: number[]) => void;
25
25
  searchValue?: string;
26
26
  } & BaseActionTreeProps & FTreeData & React.RefAttributes<ActionTreeRef>>>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { BaseTreeProps } from './index';
3
3
  import type { TreeNodeData } from '../../utils/TreeUtil';
4
4
  export type STreeData = {
@@ -19,4 +19,4 @@ export type STreeProps = BaseTreeProps & STreeData;
19
19
  * 搜索 : 支持
20
20
  * 数据 : 需要组装好后传入
21
21
  */
22
- export declare const STree: React.FC<STreeProps>;
22
+ export declare const STree: FC<STreeProps>;
@@ -36,6 +36,10 @@ export type BaseTreeProps = BaseTreeOpts & Pick<TreeProps, 'className' | 'defaul
36
36
  * 如果需要支持 i18n ,则传一个对象,支持3个字段
37
37
  */
38
38
  titleField: string | LanguageField;
39
+ /**
40
+ * 自定义标题
41
+ */
42
+ titleRender?: (node: PlainObject) => ReactNode;
39
43
  /**
40
44
  * 是否必选,
41
45
  */
@@ -1,6 +1,5 @@
1
- import React from 'react';
1
+ import type { FC, MutableRefObject, PropsWithChildren } from 'react';
2
2
  import type { UFromProps } from './index';
3
- import type { MutableRefObject, PropsWithChildren } from 'react';
4
3
  export type FormState = {
5
4
  width: number;
6
5
  cols: 1 | 2 | 3;
@@ -17,6 +16,6 @@ export type FormState = {
17
16
  };
18
17
  export declare const useFormLayout: () => FormState;
19
18
  export declare const getDefault: (props: UFromProps) => [boolean, number, 1 | 2 | 3, number];
20
- export declare const FormWrapper: React.FC<PropsWithChildren<UFromProps & {
19
+ export declare const FormWrapper: FC<PropsWithChildren<UFromProps & {
21
20
  isInfo: boolean;
22
21
  }>>;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
+ import type { FC } from 'react';
2
3
  import type { UDescriptionsItemProps, UDescriptionsProps } from './index';
3
4
  export declare const UDescriptions: React.ExoticComponent<React.PropsWithChildren<UDescriptionsProps>> & {
4
- Item: React.FC<UDescriptionsItemProps>;
5
+ Item: FC<UDescriptionsItemProps>;
5
6
  };