vap1 0.4.3 → 0.4.4

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 (202) 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/Lists/SList.d.ts +4 -5
  6. package/components/Lists/SList.js +1 -2
  7. package/components/SearchBar/ActionButtons.d.ts +4 -4
  8. package/components/SearchBar/ActionButtons.js +26 -3
  9. package/components/SearchBar/ByField.d.ts +1 -1
  10. package/components/SearchBar/ByField.js +2 -2
  11. package/components/SearchBar/ByKeyword.d.ts +2 -2
  12. package/components/SearchBar/ByKeyword.js +2 -2
  13. package/components/SearchBar/SearchField.d.ts +2 -2
  14. package/components/SearchBar/index.js +1 -1
  15. package/components/Tables/Components/ActionBar.d.ts +2 -3
  16. package/components/Tables/Components/Actions.d.ts +7 -7
  17. package/components/Tables/Components/Actions.js +4 -4
  18. package/components/Tables/Components/index.d.ts +6 -6
  19. package/components/Tables/TopTable.d.ts +2 -2
  20. package/components/Tables/TopTable.js +5 -19
  21. package/components/Tables/TopTableModal.d.ts +2 -2
  22. package/components/Tables/TopTableModal.js +1 -1
  23. package/components/Tables/Util.d.ts +5 -1
  24. package/components/Tables/Util.js +69 -2
  25. package/components/Tables/VTable.js +45 -74
  26. package/components/Tables/index.d.ts +5 -4
  27. package/components/TreeSelect/BaseTreeSelect.d.ts +3 -3
  28. package/components/TreeSelect/BaseTreeSelect.js +8 -5
  29. package/components/TreeSelect/DTreeSelect.d.ts +2 -2
  30. package/components/TreeSelect/DTreeSelect.js +1 -1
  31. package/components/TreeSelect/FTreeSelect.d.ts +2 -2
  32. package/components/TreeSelect/STreeSelect.d.ts +2 -2
  33. package/components/Trees/BaseTree.d.ts +2 -2
  34. package/components/Trees/COTree/COButton.js +1 -1
  35. package/components/Trees/COTree/COSelect.js +1 -1
  36. package/components/Trees/COTree/COTreeUtil.d.ts +2 -1
  37. package/components/Trees/DTree.d.ts +7 -0
  38. package/components/Trees/FTree.d.ts +2 -3
  39. package/components/Trees/STree.d.ts +2 -2
  40. package/components/UForm/FormWrapper.d.ts +2 -3
  41. package/components/UForm/UDescriptions.d.ts +2 -1
  42. package/components/UForm/UDescriptions.js +28 -5
  43. package/components/UForm/UForm.js +4 -4
  44. package/components/UForm/UFormModal.d.ts +2 -2
  45. package/components/UForm/UInfo.d.ts +2 -2
  46. package/components/UForm/UInfoModal.d.ts +2 -2
  47. package/components/UForm/UInfoModal.js +1 -1
  48. package/components/UForm/UModal.d.ts +2 -2
  49. package/components/UForm/_FieldType.d.ts +1 -1
  50. package/components/UForm/_FieldType.js +4 -0
  51. package/components/UForm/_input.d.ts +3 -3
  52. package/components/UForm/_input.js +2 -2
  53. package/components/UForm/_register.d.ts +2 -3
  54. package/components/UForm/index.d.ts +16 -13
  55. package/components/Upload/UploadFile.d.ts +2 -2
  56. package/components/Upload/UploadImage.d.ts +2 -2
  57. package/components/Upload/UploadImage.js +1 -1
  58. package/components/Upload/UploadModal.d.ts +4 -4
  59. package/components/Upload/UploadModal.js +2 -2
  60. package/components/Upload/useUpload.d.ts +2 -2
  61. package/components/Upload/useUpload.js +1 -1
  62. package/components/_RegisterUtil.d.ts +1 -1
  63. package/components/_RegisterUtil.js +2 -2
  64. package/components/_adapt/Alert.d.ts +2 -3
  65. package/components/_adapt/Button.d.ts +3 -4
  66. package/components/_adapt/Col.d.ts +8 -8
  67. package/components/_adapt/ColorPicker.js +2 -2
  68. package/components/_adapt/ConfigProvider.d.ts +3 -3
  69. package/components/_adapt/Drawer.d.ts +2 -3
  70. package/components/_adapt/Drawer.js +2 -2
  71. package/components/_adapt/FloatButton.d.ts +5 -5
  72. package/components/_adapt/Form.js +3 -3
  73. package/components/_adapt/Icon.d.ts +2 -1
  74. package/components/_adapt/Image.js +1 -1
  75. package/components/_adapt/Layout.d.ts +1 -2
  76. package/components/_adapt/Layout.js +1 -1
  77. package/components/_adapt/Menu.d.ts +5 -6
  78. package/components/_adapt/Menu.js +25 -2
  79. package/components/_adapt/Modal.d.ts +2 -1
  80. package/components/_adapt/Modal.js +1 -1
  81. package/components/_adapt/Progress.d.ts +3 -2
  82. package/components/_adapt/Progress.js +1 -1
  83. package/components/_adapt/Row.d.ts +2 -2
  84. package/components/_adapt/Select.js +1 -1
  85. package/components/_adapt/Slider.d.ts +7 -7
  86. package/components/_adapt/Space.d.ts +4 -3
  87. package/components/_adapt/Table.d.ts +5 -5
  88. package/components/_adapt/Tabs.d.ts +2 -3
  89. package/components/_adapt/Tag.js +25 -2
  90. package/components/_adapt/utils.js +10 -10
  91. package/components/_common/AutoComplete.d.ts +3 -3
  92. package/components/_common/CountUp.d.ts +3 -3
  93. package/components/_common/CountUp.js +1 -1
  94. package/components/_common/DateRange.d.ts +2 -2
  95. package/components/_common/HighLight.d.ts +2 -2
  96. package/components/_common/HighLight.js +1 -1
  97. package/components/_common/I18N.d.ts +2 -2
  98. package/components/_common/Loading.d.ts +3 -3
  99. package/components/_common/MonthRange.d.ts +2 -2
  100. package/components/_common/PromiseLabel.d.ts +4 -4
  101. package/components/_common/UTitle.d.ts +6 -5
  102. package/components/_common/UTitle.js +25 -2
  103. package/components/_common/Upagination.d.ts +2 -2
  104. package/deps/JsonView.d.ts +2 -2
  105. package/deps/JsonView.js +5 -2
  106. package/deps/app-audit/LookUp.d.ts +3 -3
  107. package/deps/app-audit/LookUp.js +2 -2
  108. package/deps/app-data/useSource.js +2 -2
  109. package/deps/echarts.d.ts +2 -2
  110. package/deps/editor/Article.d.ts +3 -3
  111. package/deps/editor/support/buttons/ImageButton.d.ts +2 -2
  112. package/deps/editor/support/buttons/ImageButton.js +1 -1
  113. package/deps/editor/tools/Button.d.ts +2 -2
  114. package/deps/editor/tools/Button.js +1 -1
  115. package/deps/editor/tools/ToolBar.d.ts +2 -2
  116. package/deps/editor/tools/_BlockButton.d.ts +2 -2
  117. package/deps/editor/tools/_InsertButton.d.ts +4 -4
  118. package/deps/editor/tools/_MarkButton.d.ts +2 -2
  119. package/deps/editor/tools/_TxtButton.d.ts +6 -6
  120. package/deps/editor/tools/_TxtButton.js +25 -5
  121. package/deps/editor/types.d.ts +2 -2
  122. package/deps/editor/utils/index.js +0 -5
  123. package/hooks/useApiBase.js +1 -1
  124. package/hooks/useApp.d.ts +3 -3
  125. package/hooks/useApp.js +1 -1
  126. package/hooks/useArray.js +5 -7
  127. package/hooks/useHover.d.ts +3 -3
  128. package/hooks/useHover.js +2 -25
  129. package/package.json +1 -1
  130. package/screen/Comment.d.ts +3 -3
  131. package/screen/EchartContent.js +2 -2
  132. package/screen/Page.d.ts +2 -2
  133. package/screen/render.d.ts +2 -2
  134. package/uform/FormEditor.d.ts +2 -2
  135. package/uform/FormEditor.js +3 -2
  136. package/uform/inputs/_date.js +1 -1
  137. package/uform/inputs/_input.js +1 -1
  138. package/uform/inputs/_select.js +1 -1
  139. package/uform/inputs/register.d.ts +2 -2
  140. package/uform/panel/Editor/GroupEditor.js +3 -3
  141. package/uform/panel/Editor/_GroupCollapse.js +3 -3
  142. package/uform/panel/Editor/_GroupDefault.js +24 -4
  143. package/uform/panel/Editor/_GroupStep.js +28 -5
  144. package/uform/panel/Editor/_GroupTab.js +25 -2
  145. package/uform/panel/Editor/index.js +1 -1
  146. package/uform/panel/Items/Fields.d.ts +2 -2
  147. package/uform/panel/Items/Fields.js +3 -1
  148. package/uform/panel/Items/InputSelector.d.ts +2 -2
  149. package/uform/panel/Items/InputSelector.js +2 -1
  150. package/uform/panel/Items/Inputs.d.ts +2 -1
  151. package/uform/panel/Items/Inputs.js +24 -4
  152. package/uform/panel/Propreties/CanvasProperties.js +25 -2
  153. package/uform/panel/Propreties/Component/FieldPlugin.d.ts +2 -2
  154. package/uform/panel/Propreties/Component/FieldPlugin.js +1 -1
  155. package/uform/panel/Propreties/Component/LinkAsyncFunction.d.ts +2 -2
  156. package/uform/panel/Propreties/Component/LinkAsyncFunction.js +1 -1
  157. package/uform/panel/Propreties/Component/LinkSyncFunction.d.ts +2 -2
  158. package/uform/panel/Propreties/Component/LinkSyncFunction.js +1 -1
  159. package/uform/panel/Propreties/Component/Links.js +1 -1
  160. package/uform/panel/Propreties/Component/OptionTable.js +25 -5
  161. package/uform/panel/Propreties/Component/RegexpModal.d.ts +2 -2
  162. package/uform/panel/Propreties/Component/Validate.js +1 -1
  163. package/uform/panel/Propreties/Component/ValidateAsyncFunction.d.ts +2 -2
  164. package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +25 -2
  165. package/uform/panel/Propreties/Component/ValidateSyncFunction.d.ts +2 -2
  166. package/uform/panel/Propreties/Component/ValidateSyncFunction.js +25 -2
  167. package/uform/panel/Propreties/FieldProperties.js +1 -1
  168. package/uform/panel/Propreties/_ItemAdvance.js +25 -2
  169. package/uform/panel/Propreties/_ItemBase.js +1 -1
  170. package/uform/panel/Propreties/_ItemLink.js +24 -4
  171. package/uform/panel/Propreties/_ItemValidate.js +24 -4
  172. package/uform/utils/Convert.js +9 -9
  173. package/utils/CacheUtil.d.ts +4 -4
  174. package/utils/CacheUtil.js +15 -15
  175. package/utils/Const.d.ts +3 -2
  176. package/utils/Const.js +26 -5
  177. package/utils/CustomApp.d.ts +3 -3
  178. package/utils/Format.js +2 -1
  179. package/utils/Renders/ApiGetRender.js +3 -3
  180. package/utils/Renders/ApiPostRender.js +2 -2
  181. package/utils/Renders/CondictionRender.d.ts +5 -0
  182. package/utils/Renders/CondictionRender.js +163 -0
  183. package/utils/Renders/DateRender.js +5 -5
  184. package/utils/Renders/DictRender.js +5 -6
  185. package/utils/Renders/FileRender.d.ts +2 -1
  186. package/utils/Renders/FileRender.js +5 -5
  187. package/utils/Renders/ListRender.js +9 -9
  188. package/utils/Renders/NumberRender.js +4 -4
  189. package/utils/Renders/StatusRender.js +2 -2
  190. package/utils/Renders/StringRender.js +4 -4
  191. package/utils/Renders/_DictBaseRender.d.ts +1 -1
  192. package/utils/Renders/_DictBaseRender.js +23 -23
  193. package/utils/Renders/_define.d.ts +6 -6
  194. package/utils/Renders/_define.js +9 -14
  195. package/utils/Renders/index.d.ts +1 -0
  196. package/utils/Renders/index.js +3 -1
  197. package/utils/StringUtil.d.ts +4 -4
  198. package/utils/StringUtil.js +15 -14
  199. package/utils/VAP.d.ts +4 -4
  200. package/utils/VAP.js +8 -40
  201. package/utils/i18n.d.ts +3 -3
  202. package/widget/index.d.ts +2 -2
@@ -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>;
@@ -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> & {
@@ -27,6 +27,6 @@ type BaseTreeContext = {
27
27
  };
28
28
  declare const BaseTreeContext: React.Context<BaseTreeContext>;
29
29
  export declare const useBaseTree: () => BaseTreeContext;
30
- export declare const BaseTree: React.FC<PropsWithChildren<BaseTreeProps>>;
30
+ export declare const BaseTree: FC<PropsWithChildren<BaseTreeProps>>;
31
31
  export declare const getNodeParam: (node: any, position: number[], state: BaseTreeState, search: SearchResult, disabledNode: (node: PlainObject) => boolean, folderChecker: (node: PlainObject) => boolean) => AntTreeNodeProps;
32
32
  export {};
@@ -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,6 +34,13 @@ 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;
38
45
  mustSelect?: boolean;
39
46
  disabledNode?: (node: PlainObject) => boolean;
@@ -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模式代替
@@ -20,7 +19,7 @@ export declare const FTree: React.MemoExoticComponent<React.ForwardRefExoticComp
20
19
  iconField?: string | ((item: any) => React.ReactNode);
21
20
  titleField: string | import("./index").LanguageField;
22
21
  mustSelect?: boolean;
23
- disabledNode?: (node: PlainObject) => boolean;
24
- onSelect?: (key: import("../../basetype").Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void;
22
+ disabledNode?: (node: import("../..").PlainObject) => boolean;
23
+ onSelect?: (key: import("../..").Key, node: import("../..").PlainObject, parentNode: import("../..").PlainObject, crumb: import("../..").PlainObject[], pos: number[]) => void;
25
24
  searchValue?: string;
26
25
  } & 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>;
@@ -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
  };
@@ -1,20 +1,43 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.UDescriptions = void 0;
7
- var react_1 = __importDefault(require("react"));
30
+ var react_1 = __importStar(require("react"));
8
31
  var lodash_1 = __importDefault(require("lodash"));
9
32
  var utils_1 = require("../../utils");
10
33
  var isReactFragment = function (variableToInspect) {
11
34
  if (variableToInspect.type)
12
- return variableToInspect.type === react_1.default.Fragment;
35
+ return variableToInspect.type === react_1.Fragment;
13
36
  return false;
14
37
  };
15
38
  var toArray = function (children) {
16
39
  var ret = [];
17
- react_1.default.Children.forEach(children, function (child) {
40
+ react_1.Children.forEach(children, function (child) {
18
41
  if (child === undefined || child === null) {
19
42
  return;
20
43
  }
@@ -88,12 +111,12 @@ var generateChildrenRows = function (items, column) {
88
111
  var cells = columns.map(function (item) { return item.props.span; });
89
112
  var diffSpan = column - lodash_1.default.sum(cells);
90
113
  var lastNode = columns.pop();
91
- columns.push(react_1.default.cloneElement(lastNode, { span: lastNode.props.span + diffSpan }));
114
+ columns.push((0, react_1.cloneElement)(lastNode, { span: lastNode.props.span + diffSpan }));
92
115
  leftSpans = column - span;
93
116
  columns = [];
94
117
  rows.push(columns);
95
118
  }
96
- columns.push(react_1.default.cloneElement(node, { span: span }));
119
+ columns.push((0, react_1.cloneElement)(node, { span: span }));
97
120
  if (leftSpans <= 0) {
98
121
  columns = null;
99
122
  }
@@ -219,7 +219,7 @@ var renderFormField = function (state, field, form, update, data) {
219
219
  var input = (0, _register_1.getUFormInput)(field.type || 'text');
220
220
  var labelSpan = state.labelSpan, inputSpan = state.inputSpan, colSpan = state.colSpan, cols = state.cols, disableFields = state.disableFields, hiddenFields = state.hiddenFields, requireFields = state.requireFields, optionFields = state.optionFields;
221
221
  if (hiddenFields.current.has(field.field)) {
222
- return react_1.default.createElement(antd_1.Form.Item, { style: { display: 'none' } }, form.getFieldDecorator(field.field)(react_1.default.createElement(input.component, {
222
+ return react_1.default.createElement(antd_1.Form.Item, { style: { display: 'none' } }, form.getFieldDecorator(field.field)((0, react_1.createElement)(input.component, {
223
223
  form: form,
224
224
  field: field,
225
225
  disabled: disableFields.current.has(field.field),
@@ -298,7 +298,7 @@ var renderFormField = function (state, field, form, update, data) {
298
298
  }
299
299
  }
300
300
  return react_1.default.createElement(antd_1.Col, __assign({}, colProps),
301
- react_1.default.createElement(antd_1.Form.Item, __assign({}, itemProps), form.getFieldDecorator(field.field, options)(react_1.default.createElement(input.component, {
301
+ react_1.default.createElement(antd_1.Form.Item, __assign({}, itemProps), form.getFieldDecorator(field.field, options)((0, react_1.createElement)(input.component, {
302
302
  form: form,
303
303
  field: field,
304
304
  disabled: disableFields.current.has(field.field),
@@ -494,7 +494,7 @@ var _FormGroup = function (props) {
494
494
  return props.fields.map(function (group) {
495
495
  if (group == null || group === false)
496
496
  return utils_1.Const.NONE;
497
- return react_1.default.createElement(react_1.default.Fragment, null,
497
+ return react_1.default.createElement(react_1.Fragment, null,
498
498
  react_1.default.createElement(antd_1.Col, { span: 24, className: "c-form-group-title" }, utils_1.i18n.getText(group.ik, group.title)),
499
499
  group.fields.map(function (field) {
500
500
  if (field == null || field === false)
@@ -570,7 +570,7 @@ var _UFormAdaptor = /** @class */ (function (_super) {
570
570
  return react_1.default.createElement(_UForm, __assign({}, this.props, { ref: this.props.aref }));
571
571
  };
572
572
  return _UFormAdaptor;
573
- }(react_1.default.Component));
573
+ }(react_1.Component));
574
574
  // 3.0 适配层
575
575
  var UFormAdaptor = (0, react_1.memo)((0, react_1.forwardRef)(function (props, ref) {
576
576
  var FROM = antd_1.Form.create()(_UFormAdaptor);
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { UModalProps } from './index';
3
- export declare const UFormModal: React.FC<UModalProps>;
3
+ export declare const UFormModal: FC<UModalProps>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { UFromProps, UDescriptionsProps } from './index';
3
3
  import type { PlainObject } from '../../basetype';
4
4
  export type UInfoProps = Omit<UFromProps, 'buttons' | 'mode' | 'isEdit'> & Pick<UDescriptionsProps, 'hideBorder' | 'theme'> & {
@@ -7,4 +7,4 @@ export type UInfoProps = Omit<UFromProps, 'buttons' | 'mode' | 'isEdit'> & Pick<
7
7
  */
8
8
  data: PlainObject;
9
9
  };
10
- export declare const UInfo: React.FC<UInfoProps>;
10
+ export declare const UInfo: FC<UInfoProps>;
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { UModalProps } from './index';
3
- export declare const UInfoModal: React.FC<UModalProps>;
3
+ export declare const UInfoModal: FC<UModalProps>;
@@ -55,7 +55,7 @@ var UInfoModal = function (props) {
55
55
  }
56
56
  if (!lodash_1.default.has(props, 'width'))
57
57
  param.width = (0, FormWrapper_1.getDefault)(props)[1];
58
- return react_1.default.createElement(Modal_1.Modal, __assign({ maskClosable: true, footer: null }, param),
58
+ return react_1.default.createElement(Modal_1.Modal, __assign({ className: utils_1.StringUtil.className(['c-info-modal'], props.className), maskClosable: true, footer: null }, param),
59
59
  react_1.default.createElement(UInfo_1.UInfo, __assign({}, lodash_1.default.pick(props, FORM_FIELDS))));
60
60
  };
61
61
  exports.UInfoModal = UInfoModal;
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import type { FC } from 'react';
2
2
  import type { UModalProps } from './index';
3
- export declare const UModal: React.FC<UModalProps>;
3
+ export declare const UModal: FC<UModalProps>;