@vtx/components 4.0.0-beta.93 → 4.0.0-beta.95

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 (82) hide show
  1. package/README.md +19 -19
  2. package/es/utils/components/LabelIconTip/index.js +7 -7
  3. package/es/utils/conversionMomentValue/index.js +25 -25
  4. package/es/utils/filterSpecialCharacters.js +6 -6
  5. package/es/utils/genCopyable/index.js +6 -6
  6. package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  7. package/es/utils/hooks/useDebounceFn/index.js +4 -4
  8. package/es/utils/hooks/useDebounceValue/index.js +6 -6
  9. package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
  10. package/es/utils/hooks/useLatest/index.js +2 -2
  11. package/es/utils/hooks/useRefCallback/index.js +5 -5
  12. package/es/utils/isBrowser/index.js +7 -7
  13. package/es/utils/isUrl/index.js +4 -4
  14. package/es/utils/merge/index.js +4 -4
  15. package/es/utils/nanoid/index.js +4 -4
  16. package/es/utils/omitBoolean/index.js +4 -4
  17. package/es/utils/parseValueToMoment/index.js +4 -4
  18. package/es/utils/proFieldParsingText/index.js +10 -10
  19. package/es/utils/transformKeySubmitValue/index.js +57 -57
  20. package/es/utils/useEditableArray/index.js +46 -46
  21. package/es/utils/useEditableMap/index.js +22 -22
  22. package/es/utils/useMediaQuery/index.js +5 -5
  23. package/es/vtx-combogrid/Combogrid.js +7 -4
  24. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  25. package/es/vtx-datagrid/index.js +13 -7
  26. package/es/vtx-datagrid/style/index.less +242 -242
  27. package/es/vtx-date-picker/style/index.less +39 -39
  28. package/es/vtx-export/index.js +8 -8
  29. package/es/vtx-icon/index.js1 +90 -90
  30. package/es/vtx-modal/index.js +5 -4
  31. package/es/vtx-page-layout/Basic.js +2 -2
  32. package/es/vtx-page-layout/TabLayout.js +6 -6
  33. package/es/vtx-page-layout/TableLayout.js +10 -10
  34. package/es/vtx-page-layout/TreeLayout.js +6 -6
  35. package/es/vtx-page-layout/container.js +2 -2
  36. package/es/vtx-provider/index.js +30 -30
  37. package/es/vtx-provider/intl.js +9 -9
  38. package/es/vtx-provider/useStyle/index.js +17 -17
  39. package/es/vtx-tabs/style/index.js +1 -2
  40. package/es/vtx-tree-select/index.js +23 -3
  41. package/es/vtx-wang-editor/style/index.less +12 -12
  42. package/lib/utils/components/LabelIconTip/index.js +7 -7
  43. package/lib/utils/conversionMomentValue/index.js +25 -25
  44. package/lib/utils/filterSpecialCharacters.js +6 -6
  45. package/lib/utils/genCopyable/index.js +6 -6
  46. package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  47. package/lib/utils/hooks/useDebounceFn/index.js +4 -4
  48. package/lib/utils/hooks/useDebounceValue/index.js +6 -6
  49. package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
  50. package/lib/utils/hooks/useLatest/index.js +2 -2
  51. package/lib/utils/hooks/useRefCallback/index.js +5 -5
  52. package/lib/utils/isBrowser/index.js +7 -7
  53. package/lib/utils/isUrl/index.js +4 -4
  54. package/lib/utils/merge/index.js +4 -4
  55. package/lib/utils/nanoid/index.js +4 -4
  56. package/lib/utils/omitBoolean/index.js +4 -4
  57. package/lib/utils/parseValueToMoment/index.js +4 -4
  58. package/lib/utils/proFieldParsingText/index.js +10 -10
  59. package/lib/utils/transformKeySubmitValue/index.js +57 -57
  60. package/lib/utils/useEditableArray/index.js +46 -46
  61. package/lib/utils/useEditableMap/index.js +22 -22
  62. package/lib/utils/useMediaQuery/index.js +5 -5
  63. package/lib/vtx-combogrid/Combogrid.js +7 -4
  64. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  65. package/lib/vtx-datagrid/index.js +13 -10
  66. package/lib/vtx-datagrid/style/index.less +242 -242
  67. package/lib/vtx-date-picker/style/index.less +39 -39
  68. package/lib/vtx-export/index.js +8 -8
  69. package/lib/vtx-icon/index.js1 +90 -90
  70. package/lib/vtx-modal/index.js +5 -4
  71. package/lib/vtx-page-layout/Basic.js +2 -2
  72. package/lib/vtx-page-layout/TabLayout.js +6 -6
  73. package/lib/vtx-page-layout/TableLayout.js +10 -10
  74. package/lib/vtx-page-layout/TreeLayout.js +6 -6
  75. package/lib/vtx-page-layout/container.js +2 -2
  76. package/lib/vtx-provider/index.js +30 -30
  77. package/lib/vtx-provider/intl.js +9 -9
  78. package/lib/vtx-provider/useStyle/index.js +17 -17
  79. package/lib/vtx-tabs/style/index.js +1 -2
  80. package/lib/vtx-tree-select/index.js +22 -3
  81. package/lib/vtx-wang-editor/style/index.less +12 -12
  82. package/package.json +239 -239
@@ -40,9 +40,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
40
40
  import { jsxs as _jsxs } from "react/jsx-runtime";
41
41
  var noteOnce = rcWarning.noteOnce;
42
42
 
43
- /**
44
- * 显示警告信息
45
- * @param messageStr
43
+ /**
44
+ * 显示警告信息
45
+ * @param messageStr
46
46
  */
47
47
  var warning = function warning(messageStr) {
48
48
  return message.warning(messageStr);
@@ -52,11 +52,11 @@ export var recordKeyToString = function recordKeyToString(rowKey) {
52
52
  return rowKey;
53
53
  };
54
54
 
55
- /**
56
- * 使用map 来删除数据,性能一般 但是准确率比较高
57
- *
58
- * @param keyProps
59
- * @param action
55
+ /**
56
+ * 使用map 来删除数据,性能一般 但是准确率比较高
57
+ *
58
+ * @param keyProps
59
+ * @param action
60
60
  */
61
61
  export function editableRowByKey(keyProps, action) {
62
62
  var _recordKeyToString;
@@ -68,11 +68,11 @@ export function editableRowByKey(keyProps, action) {
68
68
  var key = (_recordKeyToString = recordKeyToString(keyProps.key)) === null || _recordKeyToString === void 0 ? void 0 : _recordKeyToString.toString();
69
69
  var kvMap = new Map();
70
70
 
71
- /**
72
- * 打平这个数组
73
- *
74
- * @param records
75
- * @param parentKey
71
+ /**
72
+ * 打平这个数组
73
+ *
74
+ * @param records
75
+ * @param parentKey
76
76
  */
77
77
  function dig(records, map_row_parentKey, map_row_index) {
78
78
  records.forEach(function (record, index) {
@@ -157,10 +157,10 @@ export function editableRowByKey(keyProps, action) {
157
157
  return fill(kvMap);
158
158
  }
159
159
 
160
- /**
161
- * 保存按钮的dom
162
- *
163
- * @param ActionRenderConfig
160
+ /**
161
+ * 保存按钮的dom
162
+ *
163
+ * @param ActionRenderConfig
164
164
  */
165
165
  export function SaveEditableAction(_ref, ref) {
166
166
  var recordKey = _ref.recordKey,
@@ -263,10 +263,10 @@ export function SaveEditableAction(_ref, ref) {
263
263
  }, "save");
264
264
  }
265
265
 
266
- /**
267
- * 删除按钮 dom
268
- *
269
- * @param ActionRenderConfig
266
+ /**
267
+ * 删除按钮 dom
268
+ *
269
+ * @param ActionRenderConfig
270
270
  */
271
271
  export var DeleteEditableAction = function DeleteEditableAction(_ref4) {
272
272
  var recordKey = _ref4.recordKey,
@@ -406,17 +406,17 @@ export function defaultActionRender(row, config) {
406
406
  };
407
407
  }
408
408
 
409
- /**
410
- * 一个方便的hooks 用于维护编辑的状态
411
- *
412
- * @param props
409
+ /**
410
+ * 一个方便的hooks 用于维护编辑的状态
411
+ *
412
+ * @param props
413
413
  */
414
414
  export function useEditableArray(props) {
415
415
  // Internationalization
416
416
  var intl = useIntl();
417
417
 
418
- /**
419
- * 点击开始编辑之前的保存数据用的
418
+ /**
419
+ * 点击开始编辑之前的保存数据用的
420
420
  */
421
421
  var preEditRowRef = useRef(null);
422
422
  var _useState = useState(undefined),
@@ -504,10 +504,10 @@ export function useEditableArray(props) {
504
504
  };
505
505
  });
506
506
 
507
- /**
508
- * 进入编辑状态
509
- *
510
- * @param recordKey
507
+ /**
508
+ * 进入编辑状态
509
+ *
510
+ * @param recordKey
511
511
  */
512
512
  var startEditable = useRefFunction(function (recordKey, record) {
513
513
  var _ref7, _props$dataSource;
@@ -526,10 +526,10 @@ export function useEditableArray(props) {
526
526
  return true;
527
527
  });
528
528
 
529
- /**
530
- * 退出编辑状态
531
- *
532
- * @param recordKey
529
+ /**
530
+ * 退出编辑状态
531
+ *
532
+ * @param recordKey
533
533
  */
534
534
  var cancelEditable = useRefFunction( /*#__PURE__*/function () {
535
535
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(recordKey, needReTry) {
@@ -635,11 +635,11 @@ export function useEditableArray(props) {
635
635
  }
636
636
  });
637
637
  }, [saveRefsMap, editableKeysSet]);
638
- /**
639
- * 保存编辑行
640
- *
641
- * @param recordKey
642
- * @param needReTry
638
+ /**
639
+ * 保存编辑行
640
+ *
641
+ * @param recordKey
642
+ * @param needReTry
643
643
  */
644
644
  var saveEditable = useRefFunction( /*#__PURE__*/function () {
645
645
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(recordKey, needReTry) {
@@ -686,12 +686,12 @@ export function useEditableArray(props) {
686
686
  };
687
687
  }());
688
688
 
689
- /**
690
- * 同时只能支持一行,取消之后数据消息,不会触发 dataSource
691
- *
692
- * @param row
693
- * @param options
694
- * @name 增加新的行
689
+ /**
690
+ * 同时只能支持一行,取消之后数据消息,不会触发 dataSource
691
+ *
692
+ * @param row
693
+ * @param options
694
+ * @name 增加新的行
695
695
  */
696
696
  var addEditRecord = useRefFunction(function (row, options) {
697
697
  if (options !== null && options !== void 0 && options.parentKey && !dataSourceKeyIndexMapRef.current.has(recordKeyToString(options === null || options === void 0 ? void 0 : options.parentKey).toString())) {
@@ -20,19 +20,19 @@ import { useCallback, useMemo, useRef } from 'react';
20
20
  import { useIntl } from "../../vtx-provider";
21
21
  import { defaultActionRender, recordKeyToString } from "../useEditableArray";
22
22
 
23
- /**
24
- * 显示警告信息
25
- * @param messageStr
23
+ /**
24
+ * 显示警告信息
25
+ * @param messageStr
26
26
  */
27
27
  var warning = function warning(messageStr) {
28
28
  return message.warning(messageStr);
29
29
  };
30
30
 
31
- /**
32
- * 使用map 来删除数据,性能一般 但是准确率比较高
33
- *
34
- * @param params
35
- * @param action
31
+ /**
32
+ * 使用map 来删除数据,性能一般 但是准确率比较高
33
+ *
34
+ * @param params
35
+ * @param action
36
36
  */
37
37
  function editableRowByKey(_ref) {
38
38
  var data = _ref.data,
@@ -40,14 +40,14 @@ function editableRowByKey(_ref) {
40
40
  return _objectSpread(_objectSpread({}, data), row);
41
41
  }
42
42
 
43
- /**
44
- * 一个方便的hooks 用于维护编辑的状态
45
- *
46
- * @param props
43
+ /**
44
+ * 一个方便的hooks 用于维护编辑的状态
45
+ *
46
+ * @param props
47
47
  */
48
48
  export function useEditableMap(props) {
49
- /**
50
- * 点击开始编辑之前的保存数据用的
49
+ /**
50
+ * 点击开始编辑之前的保存数据用的
51
51
  */
52
52
  var preEditRowRef = useRef(null);
53
53
  var editableType = props.type || 'single';
@@ -79,10 +79,10 @@ export function useEditableMap(props) {
79
79
  return false;
80
80
  }, [(editableKeys || []).join(',')]);
81
81
 
82
- /**
83
- * 进入编辑状态
84
- *
85
- * @param recordKey
82
+ /**
83
+ * 进入编辑状态
84
+ *
85
+ * @param recordKey
86
86
  */
87
87
  var startEditable = function startEditable(recordKey, recordValue) {
88
88
  var _ref2;
@@ -97,10 +97,10 @@ export function useEditableMap(props) {
97
97
  return true;
98
98
  };
99
99
 
100
- /**
101
- * 退出编辑状态
102
- *
103
- * @param recordKey
100
+ /**
101
+ * 退出编辑状态
102
+ *
103
+ * @param recordKey
104
104
  */
105
105
  var cancelEditable = function cancelEditable(recordKey) {
106
106
  // 防止多次渲染
@@ -37,11 +37,11 @@ export var MediaQueryEnum = {
37
37
  }
38
38
  };
39
39
 
40
- /**
41
- * loop query screen className
42
- * Array.find will throw a error
43
- * `Rendered more hooks than during the previous render.`
44
- * So should use Array.forEach
40
+ /**
41
+ * loop query screen className
42
+ * Array.find will throw a error
43
+ * `Rendered more hooks than during the previous render.`
44
+ * So should use Array.forEach
45
45
  */
46
46
  export var getScreenClassName = function getScreenClassName() {
47
47
  var queryKey = undefined;
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["setPopoverVisible", "multiple", "onChange", "getTableData", "columns", "searchForms", "selectedRowKeys", "setSelectedRowKeys", "spread", "defaultPageSize", "customEnumText", "headFootHeight", "popoverWidth"];
2
+ var _excluded = ["setPopoverVisible", "multiple", "onChange", "getTableData", "columns", "searchForms", "selectedRowKeys", "setSelectedRowKeys", "spread", "defaultPageSize", "customEnumText", "headFootHeight", "popoverWidth", "formProps"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -51,6 +51,8 @@ function VtxCombogrid(props, ref) {
51
51
  _props$headFootHeight = props.headFootHeight,
52
52
  headFootHeight = _props$headFootHeight === void 0 ? 95 : _props$headFootHeight,
53
53
  popoverWidth = props.popoverWidth,
54
+ _props$formProps = props.formProps,
55
+ formProps = _props$formProps === void 0 ? {} : _props$formProps,
54
56
  rest = _objectWithoutProperties(props, _excluded);
55
57
  var prefixCls = getPrefixCls('', 'vtx-combogrid');
56
58
  var _useStyle = useStyle(prefixCls, {
@@ -184,8 +186,9 @@ function VtxCombogrid(props, ref) {
184
186
  return wrapSSR( /*#__PURE__*/_jsxs("div", {
185
187
  className: "".concat(prefixCls, "-popover"),
186
188
  ref: ref,
187
- children: [formLen > 0 && /*#__PURE__*/_jsx(Form, {
188
- form: form,
189
+ children: [formLen > 0 && /*#__PURE__*/_jsx(Form, _objectSpread(_objectSpread({
190
+ form: form
191
+ }, formProps), {}, {
189
192
  children: /*#__PURE__*/_jsxs(Row, {
190
193
  gutter: 8,
191
194
  children: [/*#__PURE__*/_jsxs(Col, {
@@ -223,7 +226,7 @@ function VtxCombogrid(props, ref) {
223
226
  })]
224
227
  })]
225
228
  })
226
- }), /*#__PURE__*/_jsx("div", {
229
+ })), /*#__PURE__*/_jsx("div", {
227
230
  className: "".concat(prefixCls, "-main"),
228
231
  children: /*#__PURE__*/_jsx(VtxDatagrid, _objectSpread(_objectSpread(_objectSpread({
229
232
  toolbar: false
@@ -375,10 +375,10 @@ export default function ColumnSetting(props) {
375
375
  var checkedColumnKeys = props.checkedColumnKeys,
376
376
  onColumnsSave = props.onColumnsSave;
377
377
 
378
- /**
379
- * 设置全部选中,或全部未选中
380
- *
381
- * @param show
378
+ /**
379
+ * 设置全部选中,或全部未选中
380
+ *
381
+ * @param show
382
382
  */
383
383
  var setAllSelectAction = useRefFunction(function () {
384
384
  var show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
@@ -27,6 +27,8 @@ import { Container, TableContext } from "./Store/Provide";
27
27
  import ToolBar from "./ToolBar";
28
28
  import { mergeComponentsForResize } from "./mergeComponents";
29
29
  import { useStyle } from "./style/index";
30
+ import { forwardRef } from 'react';
31
+ import { merge } from 'lodash-es';
30
32
  import { jsx as _jsx } from "react/jsx-runtime";
31
33
  import { jsxs as _jsxs } from "react/jsx-runtime";
32
34
  var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
@@ -36,7 +38,7 @@ export var DEFAULT_HEIGHTS = {
36
38
  ALERT: 48,
37
39
  TOOLBAR: 64
38
40
  };
39
- function VtxTable(props) {
41
+ var VtxTable = /*#__PURE__*/forwardRef(function (props, ref) {
40
42
  var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
41
43
  var intl = useIntl();
42
44
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -386,6 +388,7 @@ function VtxTable(props) {
386
388
  ref: rootDomRef,
387
389
  style: style,
388
390
  children: [toolbarRender, alertRender, /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
391
+ ref: ref,
389
392
  size: counter.tableSize,
390
393
  bordered: true
391
394
  // virtual
@@ -396,11 +399,11 @@ function VtxTable(props) {
396
399
  }, scroll),
397
400
  pagination: getPagination(rest.pagination),
398
401
  xs: true,
399
- styles: {
402
+ styles: merge({
400
403
  root: {
401
404
  height: "calc(100% - ".concat(toolbarHeight.current + alertHeight.current, "px)")
402
405
  }
403
- },
406
+ }, props.styles),
404
407
  locale: _objectSpread({
405
408
  emptyText: /*#__PURE__*/_jsx(Empty, {
406
409
  description: emptyText
@@ -413,16 +416,19 @@ function VtxTable(props) {
413
416
  tableLayout: "fixed"
414
417
  }))]
415
418
  }));
416
- }
417
- function VtxDatagrid(props) {
419
+ });
420
+ VtxTable.displayName = 'VtxTable';
421
+ var VtxDatagrid = /*#__PURE__*/forwardRef(function (props, ref) {
418
422
  var ErrorComponent = props.ErrorBoundary === false ? React.Fragment : props.ErrorBoundary || ErrorBoundary;
419
423
  return /*#__PURE__*/_jsx(Container, {
420
424
  initValue: props,
421
425
  children: /*#__PURE__*/_jsx(ErrorComponent, {
422
- children: /*#__PURE__*/_jsx(VtxTable, _objectSpread({}, props))
426
+ children: /*#__PURE__*/_jsx(VtxTable, _objectSpread(_objectSpread({}, props), {}, {
427
+ ref: ref
428
+ }))
423
429
  })
424
430
  });
425
- }
431
+ });
426
432
  VtxDatagrid.displayName = 'VtxDatagrid';
427
433
  export { VtxDatagrid };
428
434
  export default VtxDatagrid;