@vtx/components 4.0.0-beta.7 → 4.0.0-beta.9

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 (91) hide show
  1. package/es/utils/filterSpecialCharacters.js +47 -46
  2. package/es/vtx-color-picker/index.js +138 -33
  3. package/es/vtx-color-picker/style/index.js +36 -12
  4. package/es/vtx-combogrid/Combogrid.js +11 -6
  5. package/es/vtx-combogrid/style/index.js +4 -4
  6. package/es/vtx-datagrid/Store/Provide.js +5 -4
  7. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +8 -3
  8. package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  9. package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  10. package/es/vtx-datagrid/ToolBar/index.js +2 -2
  11. package/es/vtx-datagrid/index.js +14 -9
  12. package/es/vtx-datagrid/style/index.js +2 -2
  13. package/es/vtx-ellipsis-text/index.js +6 -1
  14. package/es/vtx-export/index.js +5 -0
  15. package/es/vtx-export-async/index.js +28 -8
  16. package/es/vtx-form-layout/Card.js +10 -10
  17. package/es/vtx-form-layout/Divider.js +1 -1
  18. package/es/vtx-form-layout/FormItem.js +2 -1
  19. package/es/vtx-form-layout/Pane.js +23 -12
  20. package/es/vtx-image/Preview.js +11 -6
  21. package/es/vtx-import/index.js +73 -33
  22. package/es/vtx-import2/index.js +2 -1
  23. package/es/vtx-import2/style/index.js +1 -1
  24. package/es/vtx-input/TextArea/index.js +11 -6
  25. package/es/vtx-modal/style/index.js +5 -3
  26. package/es/vtx-page-layout/Content.js +1 -1
  27. package/es/vtx-page-layout/TabLayout.js +1 -7
  28. package/es/vtx-page-layout/TableLayout.js +14 -4
  29. package/es/vtx-page-layout/TableWrap.js +3 -2
  30. package/es/vtx-page-layout/TreeLayout.js +2 -8
  31. package/es/vtx-page-layout/container.js +6 -5
  32. package/es/vtx-provider/index.js +18 -10
  33. package/es/vtx-provider/locale/en_US.js +10 -2
  34. package/es/vtx-provider/locale/zh_CN.js +20 -2
  35. package/es/vtx-provider/useStyle/index.js +8 -4
  36. package/es/vtx-scrollable-row/index.js +38 -28
  37. package/es/vtx-search/index.js +5 -4
  38. package/es/vtx-search/style/index.js +2 -1
  39. package/es/vtx-select/index.js +25 -11
  40. package/es/vtx-signature/index.js +5 -4
  41. package/es/vtx-signature/style/index.js +1 -1
  42. package/es/vtx-tree/index.js +80 -34
  43. package/es/vtx-tree-select/index.js +4 -0
  44. package/es/vtx-wang-editor/index.js +278 -108
  45. package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
  46. package/lib/utils/filterSpecialCharacters.js +48 -46
  47. package/lib/vtx-color-picker/index.js +139 -34
  48. package/lib/vtx-color-picker/style/index.js +36 -12
  49. package/lib/vtx-combogrid/Combogrid.js +11 -6
  50. package/lib/vtx-combogrid/style/index.js +4 -4
  51. package/lib/vtx-datagrid/Store/Provide.js +5 -4
  52. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +8 -4
  53. package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
  54. package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
  55. package/lib/vtx-datagrid/ToolBar/index.js +2 -2
  56. package/lib/vtx-datagrid/index.js +15 -9
  57. package/lib/vtx-datagrid/style/index.js +2 -2
  58. package/lib/vtx-ellipsis-text/index.js +6 -1
  59. package/lib/vtx-export/index.js +5 -0
  60. package/lib/vtx-export-async/index.js +26 -6
  61. package/lib/vtx-form-layout/Card.js +9 -9
  62. package/lib/vtx-form-layout/Divider.js +1 -1
  63. package/lib/vtx-form-layout/FormItem.js +2 -1
  64. package/lib/vtx-form-layout/Pane.js +22 -11
  65. package/lib/vtx-image/Preview.js +11 -6
  66. package/lib/vtx-import/index.js +73 -33
  67. package/lib/vtx-import2/index.js +2 -1
  68. package/lib/vtx-import2/style/index.js +1 -1
  69. package/lib/vtx-input/TextArea/index.js +11 -6
  70. package/lib/vtx-modal/style/index.js +5 -3
  71. package/lib/vtx-page-layout/Content.js +1 -1
  72. package/lib/vtx-page-layout/TabLayout.js +3 -9
  73. package/lib/vtx-page-layout/TableLayout.js +14 -4
  74. package/lib/vtx-page-layout/TableWrap.js +3 -2
  75. package/lib/vtx-page-layout/TreeLayout.js +4 -10
  76. package/lib/vtx-page-layout/container.js +6 -5
  77. package/lib/vtx-provider/index.js +17 -10
  78. package/lib/vtx-provider/locale/en_US.js +10 -2
  79. package/lib/vtx-provider/locale/zh_CN.js +20 -2
  80. package/lib/vtx-provider/useStyle/index.js +8 -4
  81. package/lib/vtx-scrollable-row/index.js +38 -28
  82. package/lib/vtx-search/index.js +5 -4
  83. package/lib/vtx-search/style/index.js +2 -1
  84. package/lib/vtx-select/index.js +25 -11
  85. package/lib/vtx-signature/index.js +4 -3
  86. package/lib/vtx-signature/style/index.js +1 -1
  87. package/lib/vtx-tree/index.js +78 -32
  88. package/lib/vtx-tree-select/index.js +4 -0
  89. package/lib/vtx-wang-editor/index.js +277 -109
  90. package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
  91. package/package.json +38 -23
@@ -9,6 +9,52 @@ function isNotEmpty(value) {
9
9
  return Array.isArray(value) && value.length > 0;
10
10
  }
11
11
 
12
+ // 特殊符号,- _ 排除
13
+ export var SpecialCharacters = [
14
+ // 小括号
15
+ '(', ')', '(', ')',
16
+ // 中括号
17
+ '\\[', '\\]', '[', ']',
18
+ // 大括号
19
+ '{', '}', '{', '}',
20
+ // 方头括号
21
+ '【', '】',
22
+ // 尖括号
23
+ '<', '>',
24
+ // 书名号
25
+ '《', '》',
26
+ // 斜杠
27
+ '/',
28
+ // 反斜杠
29
+ '\\\\',
30
+ // 逗号
31
+ ',', ',',
32
+ // 句号
33
+ '.', '。',
34
+ // 冒号
35
+ ':', ':',
36
+ // 分号
37
+ ';', ';',
38
+ // 顿号
39
+ '、',
40
+ // 破折号
41
+ '——',
42
+ // 感叹号
43
+ '!', '!',
44
+ // 问号
45
+ '?', '?',
46
+ // 加减等于
47
+ '+', '=',
48
+ // 单引号
49
+ "'", '‘', '’',
50
+ // 双引号
51
+ '"', '“', '”',
52
+ // 金钱
53
+ '$', '¥',
54
+ // 百分号
55
+ '%', '%',
56
+ // 其它
57
+ '@', '#', '`', '~', '*', '^', '……', '|', '&'];
12
58
  /**
13
59
  * 过滤特殊字符
14
60
  * @param {String} value 值
@@ -22,52 +68,7 @@ export default function filterSpecialCharacters(value) {
22
68
  include = _ref$include === void 0 ? [] : _ref$include,
23
69
  _ref$exclude = _ref.exclude,
24
70
  exclude = _ref$exclude === void 0 ? [] : _ref$exclude;
25
- // 特殊符号,- _ 排除
26
- var specialCharacter = [
27
- // 小括号
28
- '(', ')', '(', ')',
29
- // 中括号
30
- '\\[', '\\]', '[', ']',
31
- // 大括号
32
- '{', '}', '{', '}',
33
- // 方头括号
34
- '【', '】',
35
- // 尖括号
36
- '<', '>',
37
- // 书名号
38
- '《', '》',
39
- // 斜杠
40
- '/',
41
- // 反斜杠
42
- '\\\\',
43
- // 逗号
44
- ',', ',',
45
- // 句号
46
- '.', '。',
47
- // 冒号
48
- ':', ':',
49
- // 分号
50
- ';', ';',
51
- // 顿号
52
- '、',
53
- // 破折号
54
- '——',
55
- // 感叹号
56
- '!', '!',
57
- // 问号
58
- '?', '?',
59
- // 加减等于
60
- '+', '=',
61
- // 单引号
62
- "'", '‘', '’',
63
- // 双引号
64
- '"', '“', '”',
65
- // 金钱
66
- '$', '¥',
67
- // 百分号
68
- '%', '%',
69
- // 其它
70
- '@', '#', '`', '~', '*', '^', '……', '|', '&'];
71
+ var specialCharacter = JSON.parse(JSON.stringify(SpecialCharacters));
71
72
 
72
73
  // 新增
73
74
  if (isNotEmpty(include)) {
@@ -1,70 +1,175 @@
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 = ["value", "onChange", "className", "style", "disabled"];
2
+ var _excluded = ["value", "onChange", "className", "style", "disabled", "format", "input", "panelStyle"];
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; }
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
- import { ConfigProvider, Input, Space, ColorPicker } from 'antd';
10
+ import React, { forwardRef, useContext, useMemo, useState, useCallback } from 'react';
11
+ import { Input, Space, ColorPicker, Row, Col } from 'antd';
17
12
  import classnames from 'classnames';
18
- import React, { forwardRef, useContext, useMemo, useState } from 'react';
19
- import { useStyle } from "./style/index";
13
+ import PropTypes from 'prop-types';
14
+ import { useStyle } from "./style";
20
15
  import { getPlaceholder } from "../utils";
16
+ import { useIntl, VtxProvider } from "../vtx-provider";
21
17
  import { jsx as _jsx } from "react/jsx-runtime";
22
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
19
  var VtxColorPicker = /*#__PURE__*/forwardRef(function (props, ref) {
20
+ var intl = useIntl();
24
21
  var value = props.value,
25
- onChange = props.onChange,
22
+ _onChange = props.onChange,
26
23
  className = props.className,
27
24
  style = props.style,
28
25
  disabled = props.disabled,
26
+ _props$format = props.format,
27
+ format = _props$format === void 0 ? 'hex' : _props$format,
28
+ _props$input = props.input,
29
+ input = _props$input === void 0 ? true : _props$input,
30
+ panelStyle = props.panelStyle,
29
31
  rest = _objectWithoutProperties(props, _excluded);
30
- var _useState = useState(value),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- colorHex = _useState2[0],
33
- setColorHex = _useState2[1];
34
- var _useState3 = useState('hex'),
35
- _useState4 = _slicedToArray(_useState3, 2),
36
- formatHex = _useState4[0],
37
- setFormatHex = _useState4[1];
38
- var hexString = useMemo(function () {
39
- return typeof colorHex === 'string' ? colorHex : colorHex === null || colorHex === void 0 ? void 0 : colorHex.toHexString();
40
- }, [colorHex]);
41
- var _useContext = useContext(ConfigProvider.ConfigContext),
32
+ var getVtxPresets = function getVtxPresets() {
33
+ return [{
34
+ label: intl.getMessage('colorPicker.basic', '基础颜色'),
35
+ key: 'basic',
36
+ colors: ['#0EBF37', '#1890FF', '#FAAD14', '#FF4D4F', '#898989', '#13C2C2', '#FA8C16', '#722ED1', '#EB2F96', '#2F54EB']
37
+ }, {
38
+ label: intl.getMessage('colorPicker.chart', '图表颜色'),
39
+ key: 'chart',
40
+ colors: ['#249AF8', '#1FC678', '#FFB737', '#4ABEFF', '#FD6865', '#A09CF7', '#1BCEBF', '#F58E44', '#27AD8E', '#F18F86', '#7996FF', '#5AD8A6', '#E9C140', '#79C2E6', '#FF9E9E', '#D396DE', '#3CBDCB', '#F29F64', '#85ACD7', '#FDA3C7']
41
+ }];
42
+ };
43
+ var getNormalPresets = function getNormalPresets() {
44
+ return [{
45
+ label: '',
46
+ key: '1',
47
+ colors: ['#F5222D', '#FA8C16', '#FAAD14', '#52C41A', '#389E0D', '#CF1322', '#1677FF', '#5B83FB', '#9254DE', '#5D7092']
48
+ }];
49
+ };
50
+ var getHorizontalPresets = function getHorizontalPresets(token) {
51
+ return [{
52
+ label: intl.getMessage('colorPicker.primary', '主要'),
53
+ key: '主要',
54
+ colors: ['#E6F4FF', '#BAE0FF', '#91CAFF', '#69B1FF', '#4096FF', '#1677FF', '#0958D9', '#003EB3', '#002C8C', '#001D66']
55
+ }, {
56
+ label: intl.getMessage('colorPicker.danger', '红色'),
57
+ key: '红色',
58
+ colors: ['#FFF1F0', '#FFCCC7', '#FFA39E', '#FF7875', '#FF4D4F', '#F5222D', '#CF1322', '#A8071A', '#820014', '#5C0011']
59
+ }, {
60
+ label: intl.getMessage('colorPicker.success', '绿色'),
61
+ key: '绿色',
62
+ colors: ['#F6FFED', '#D9F7BE', '#B7EB8F', '#95DE64', '#73D13D', '#52C41A', '#389E0D', '#237804', '#135200', '#092B00']
63
+ }, {
64
+ label: intl.getMessage('colorPicker.info', '青色'),
65
+ key: '青色',
66
+ colors: ['#E6FFFB', '#B5F5EC', '#87E8DE', '#5CDBD3', '#36CFC9', '#13C2C2', '#08979C', '#006D75', '#00474F', '#002329']
67
+ }];
68
+ };
69
+ var _useContext = useContext(VtxProvider),
42
70
  getPrefixCls = _useContext.getPrefixCls;
43
- var prefixCls = getPrefixCls('', 'vtx-color-picker');
71
+ var prefixCls = getPrefixCls('color-picker', props.prefixCls);
44
72
  var _useStyle = useStyle(prefixCls),
45
73
  wrapSSR = _useStyle.wrapSSR,
46
74
  hashId = _useStyle.hashId;
75
+ var getChangeFun = useCallback(function () {
76
+ switch (format) {
77
+ case 'hsb':
78
+ return 'toHsbString';
79
+ case 'rgb':
80
+ return 'toRgbString';
81
+ default:
82
+ return 'toHexString';
83
+ }
84
+ }, [format]);
85
+ var horizontalPanelRender = function horizontalPanelRender(_, _ref) {
86
+ var _ref$components = _ref.components,
87
+ Picker = _ref$components.Picker,
88
+ Presets = _ref$components.Presets;
89
+ return /*#__PURE__*/_jsxs("div", {
90
+ className: classnames("".concat(prefixCls, "-horizontal")),
91
+ children: [/*#__PURE__*/_jsx(Presets, {}), /*#__PURE__*/_jsx("div", {
92
+ children: /*#__PURE__*/_jsx(Picker, {})
93
+ })]
94
+ });
95
+ };
96
+ var verticalPanelRender = function verticalPanelRender(_, _ref2) {
97
+ var _ref2$components = _ref2.components,
98
+ Picker = _ref2$components.Picker,
99
+ Presets = _ref2$components.Presets;
100
+ return /*#__PURE__*/_jsxs("div", {
101
+ className: classnames("".concat(prefixCls, "-vertical")),
102
+ children: [/*#__PURE__*/_jsx(Picker, {}), /*#__PURE__*/_jsx(Presets, {})]
103
+ });
104
+ };
105
+ var panelStyleProps = _objectSpread(_objectSpread(_objectSpread({}, panelStyle === 'vtx' ? {
106
+ presets: getVtxPresets(),
107
+ styles: {
108
+ popupOverlayInner: {
109
+ width: 460
110
+ }
111
+ },
112
+ panelRender: horizontalPanelRender
113
+ } : {}), panelStyle === 'normal' ? {
114
+ presets: getNormalPresets(),
115
+ styles: {
116
+ popupOverlayInner: {
117
+ width: 258
118
+ }
119
+ },
120
+ panelRender: verticalPanelRender
121
+ } : {}), panelStyle === 'horizontal' ? {
122
+ presets: getHorizontalPresets(),
123
+ styles: {
124
+ popupOverlayInner: {
125
+ width: 504
126
+ }
127
+ },
128
+ panelRender: horizontalPanelRender
129
+ } : {});
47
130
  return wrapSSR( /*#__PURE__*/_jsxs(Space.Compact, {
48
131
  style: {
49
132
  width: '100%'
50
133
  },
51
- children: [/*#__PURE__*/_jsx(Input, {
134
+ children: [input && /*#__PURE__*/_jsx(Input, {
52
135
  ref: ref,
53
- value: hexString,
136
+ value: value,
54
137
  placeholder: getPlaceholder(props.placeholder),
55
138
  readOnly: true,
56
139
  disabled: disabled,
57
- className: classnames(prefixCls, className, hashId),
140
+ className: classnames("".concat(prefixCls, "-input"), hashId),
58
141
  style: style
59
- }), disabled ? null : /*#__PURE__*/_jsx(ColorPicker, _objectSpread(_objectSpread({}, rest), {}, {
142
+ }), /*#__PURE__*/_jsx(ColorPicker, _objectSpread(_objectSpread({
60
143
  animation: "slide-up",
61
- format: formatHex,
62
- value: colorHex,
63
- onChange: setColorHex,
64
- onFormatChange: setFormatHex
65
- }))]
144
+ allowClear: true,
145
+ className: classnames(prefixCls, className, hashId),
146
+ onChange: function onChange(e, css) {
147
+ var _e$colors;
148
+ var res = undefined;
149
+ if (((_e$colors = e.colors) === null || _e$colors === void 0 ? void 0 : _e$colors.length) > 1) {
150
+ res = e === null || e === void 0 ? void 0 : e.toCssString();
151
+ } else {
152
+ var _e$getChangeFun;
153
+ res = e === null || e === void 0 || (_e$getChangeFun = e[getChangeFun(format)]) === null || _e$getChangeFun === void 0 ? void 0 : _e$getChangeFun.call(e);
154
+ }
155
+ if (e.cleared) {
156
+ res = undefined;
157
+ }
158
+ _onChange === null || _onChange === void 0 || _onChange(res, css);
159
+ },
160
+ value: value,
161
+ disabled: disabled
162
+ }, panelStyleProps), rest))]
66
163
  }));
67
164
  });
68
165
  VtxColorPicker.displayName = 'VtxColorPicker';
166
+ VtxColorPicker.propTypes = {
167
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
168
+ onChange: PropTypes.func,
169
+ className: PropTypes.string,
170
+ style: PropTypes.object,
171
+ disabled: PropTypes.bool,
172
+ placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
173
+ };
69
174
  export { VtxColorPicker };
70
175
  export default VtxColorPicker;
@@ -4,21 +4,45 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import 'rc-color-picker/assets/index.css';
8
7
  import { useStyle as useAntdStyle } from "../../vtx-provider";
9
8
  var genVtxColorPickerStyle = function genVtxColorPickerStyle(token) {
10
9
  var componentCls = token.componentCls;
11
- return _defineProperty({}, componentCls, {
12
- backgroundColor: 'transparent',
13
- '.ant-input-group-addon': {
14
- width: '37px !important'
15
- },
16
- '.rc-color-picker-wrap': _defineProperty(_defineProperty({
17
- position: 'absolute',
18
- top: '50%',
19
- left: '50%'
20
- }, 'line-height', '0'), "transform", 'translate(-50%, -50%)')
21
- });
10
+ return {
11
+ '.ant-color-picker-inner': _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty({}, "&-vertical, &-horizontal", {
12
+ '.ant-color-picker-presets': {
13
+ paddingTop: 4,
14
+ '.ant-color-picker-presets-items': {
15
+ '.ant-color-picker-presets-color': {
16
+ width: 18,
17
+ height: 18,
18
+ '&::before': {
19
+ width: "calc(18px + var(--ant-line-width) * 4)",
20
+ height: "calc(18px + var(--ant-line-width) * 4)"
21
+ },
22
+ '&::affter': {
23
+ width: "calc(18px / 13 * 5)",
24
+ height: "calc(18px / 13 * 8)"
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }), "&-vertical", {
30
+ '.ant-collapse-header': {
31
+ display: 'none'
32
+ }
33
+ }), "&-horizontal", {
34
+ display: 'flex',
35
+ gap: 12,
36
+ '.ant-color-picker-presets': {
37
+ flex: 1
38
+ },
39
+ '>div': {
40
+ display: 'flex',
41
+ flexDirection: 'column',
42
+ width: 234
43
+ }
44
+ }))
45
+ };
22
46
  };
23
47
  export function useStyle(prefixCls) {
24
48
  return useAntdStyle('VtxColorPicker', function (token) {
@@ -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"];
2
+ var _excluded = ["setPopoverVisible", "multiple", "onChange", "getTableData", "columns", "searchForms", "selectedRowKeys", "setSelectedRowKeys", "spread", "defaultPageSize", "customEnumText", "headFootHeight", "popoverWidth"];
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; }
@@ -27,10 +27,6 @@ function VtxCombogrid(props, ref) {
27
27
  var intl = useIntl();
28
28
  var _useContext = useContext(ConfigProvider.ConfigContext),
29
29
  getPrefixCls = _useContext.getPrefixCls;
30
- var prefixCls = getPrefixCls('', 'vtx-combogrid');
31
- var _useStyle = useStyle(prefixCls),
32
- wrapSSR = _useStyle.wrapSSR,
33
- hashId = _useStyle.hashId;
34
30
  var _useState = useState(!!props.defaultExpandSearch),
35
31
  _useState2 = _slicedToArray(_useState, 2),
36
32
  more = _useState2[0],
@@ -51,7 +47,16 @@ function VtxCombogrid(props, ref) {
51
47
  defaultPageSize = props.defaultPageSize,
52
48
  _props$customEnumText = props.customEnumText,
53
49
  customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
50
+ _props$headFootHeight = props.headFootHeight,
51
+ headFootHeight = _props$headFootHeight === void 0 ? 95 : _props$headFootHeight,
52
+ popoverWidth = props.popoverWidth,
54
53
  rest = _objectWithoutProperties(props, _excluded);
54
+ var prefixCls = getPrefixCls('', 'vtx-combogrid');
55
+ var _useStyle = useStyle(prefixCls, {
56
+ popoverWidth: popoverWidth
57
+ }),
58
+ wrapSSR = _useStyle.wrapSSR,
59
+ hashId = _useStyle.hashId;
55
60
  var TextEnum = _objectSpread({
56
61
  indexTitle: intl.getMessage('indexTitle', '序号'),
57
62
  actionMoreText: intl.getMessage('actionMoreText', '更多'),
@@ -86,7 +91,7 @@ function VtxCombogrid(props, ref) {
86
91
  columns: columns,
87
92
  startIndex: (current - 1) * pageSize + 1,
88
93
  size: 'small',
89
- headFootHeight: 95,
94
+ headFootHeight: headFootHeight,
90
95
  indexTitle: TextEnum.indexTitle,
91
96
  onRowSelectionClear: clearSelectedRow,
92
97
  pagination: _objectSpread(_objectSpread({}, pagination), {}, {
@@ -5,10 +5,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { useStyle as useAntdStyle } from "../../vtx-provider";
8
- var genVtxStyle = function genVtxStyle(token) {
8
+ var genVtxStyle = function genVtxStyle(token, options) {
9
9
  var componentCls = token.componentCls;
10
10
  return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&-popover", {
11
- width: 550,
11
+ width: options.popoverWidth || 550,
12
12
  '.ant-form-item': {
13
13
  marginBottom: 12
14
14
  }
@@ -32,11 +32,11 @@ var genVtxStyle = function genVtxStyle(token) {
32
32
  }
33
33
  }));
34
34
  };
35
- export function useStyle(prefixCls) {
35
+ export function useStyle(prefixCls, options) {
36
36
  return useAntdStyle(prefixCls, function (token) {
37
37
  var vtxToken = _objectSpread(_objectSpread({}, token), {}, {
38
38
  componentCls: ".".concat(prefixCls)
39
39
  });
40
- return [genVtxStyle(vtxToken)];
40
+ return [genVtxStyle(vtxToken, options)];
41
41
  });
42
42
  }
@@ -38,13 +38,14 @@ function useContainer() {
38
38
  _props$indexFixed = props.indexFixed,
39
39
  indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
40
40
  _props$indexTitle = props.indexTitle,
41
- indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
41
+ indexTitle = _props$indexTitle === void 0 ? intl.getMessage('indexTitle', '序号') : _props$indexTitle,
42
42
  _props$indexWidth = props.indexWidth,
43
43
  indexWidth = _props$indexWidth === void 0 ? 70 : _props$indexWidth,
44
44
  onColumnsSave = props.onColumnsSave,
45
45
  disabledColumnKeys = props.disabledColumnKeys,
46
46
  hideColumnSetting = props.hideColumnSetting,
47
- customEnumText = props.customEnumText;
47
+ _props$customEnumText = props.customEnumText,
48
+ customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText;
48
49
  var TextEnum = _objectSpread({
49
50
  refreshText: intl.getMessage('tableToolBar.reload', '刷新'),
50
51
  densityDefaultText: intl.getMessage('tableToolBar.densityDefault', '默认'),
@@ -73,8 +74,8 @@ function useContainer() {
73
74
  noFixedTitle: intl.getMessage('tableToolBar.noFixedTitle', '不固定'),
74
75
  rightFixedTitle: intl.getMessage('tableToolBar.rightFixedTitle', '固定在右侧'),
75
76
  columnAll: intl.getMessage('tableToolBar.columnAll', '全部'),
76
- total: intl.getMessage('pagination.total.total', '共'),
77
- item: intl.getMessage('pagination.total.item', '条')
77
+ paginationTotalText: intl.getMessage('pagination.total.total', '共'),
78
+ paginationItemText: intl.getMessage('pagination.total.item', '条')
78
79
  }, customEnumText);
79
80
  var isFirst = useRef(true);
80
81
  var actionRef = useRef();
@@ -29,6 +29,7 @@ import { VtxProvider } from "../../../../vtx-provider";
29
29
  import { TableContext } from "../../../Store/Provide";
30
30
  import VtxIcon from "../../../../vtx-icon";
31
31
  import { useStyle } from "./style";
32
+ // omit 用于从对象中排除指定的属性,返回一个新对象
32
33
  import { jsx as _jsx } from "react/jsx-runtime";
33
34
  import { jsxs as _jsxs } from "react/jsx-runtime";
34
35
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -360,7 +361,6 @@ export default function ColumnSetting(props) {
360
361
  var _useStyle = useStyle(prefixCls),
361
362
  wrapSSR = _useStyle.wrapSSR,
362
363
  hashId = _useStyle.hashId;
363
- var localColumns = props.columns;
364
364
  var _useContext8 = useContext(TableContext),
365
365
  uniqueKey = _useContext8.uniqueKey,
366
366
  columnsMap = _useContext8.columnsMap,
@@ -368,7 +368,9 @@ export default function ColumnSetting(props) {
368
368
  defaultColumnKeyMap = _useContext8.defaultColumnKeyMap,
369
369
  setSortKeyColumns = _useContext8.setSortKeyColumns,
370
370
  saveColumns = _useContext8.saveColumns,
371
- TextEnum = _useContext8.TextEnum;
371
+ TextEnum = _useContext8.TextEnum,
372
+ tableColumn = _useContext8.tableColumn;
373
+ var localColumns = props.localColumns;
372
374
  var checkedColumnKeys = props.checkedColumnKeys,
373
375
  onColumnsSave = props.onColumnsSave;
374
376
 
@@ -499,7 +501,10 @@ export default function ColumnSetting(props) {
499
501
  children: TextEnum.columnSettingSaveText
500
502
  })]
501
503
  }) : null]
502
- })
504
+ }),
505
+ getPopupContainer: function getPopupContainer(triggerNode) {
506
+ return triggerNode.parentNode;
507
+ }
503
508
  // open={true}
504
509
  ,
505
510
  children: /*#__PURE__*/_jsx(Tooltip, {
@@ -28,6 +28,9 @@ function Density() {
28
28
  selectedKeys: [counter.tableSize]
29
29
  },
30
30
  trigger: ['click'],
31
+ getPopupContainer: function getPopupContainer(triggerNode) {
32
+ return triggerNode.parentNode;
33
+ },
31
34
  children: /*#__PURE__*/_jsx(Tooltip, {
32
35
  title: TextEnum.columnDensityText,
33
36
  children: /*#__PURE__*/_jsx("span", {
@@ -31,6 +31,9 @@ function TableStyle() {
31
31
  trigger: ['click'],
32
32
  placement: "bottomRight",
33
33
  title: null,
34
+ getPopupContainer: function getPopupContainer(triggerNode) {
35
+ return triggerNode.parentNode;
36
+ },
34
37
  content: list === null || list === void 0 ? void 0 : list.map(function (v) {
35
38
  return /*#__PURE__*/_jsx("div", {
36
39
  children: /*#__PURE__*/_jsx(Checkbox, {
@@ -21,9 +21,9 @@ function ToolBar(props) {
21
21
  onRefresh = props.onRefresh,
22
22
  hideColumnHeight = props.hideColumnHeight,
23
23
  hideColumnSetting = props.hideColumnSetting,
24
- columns = props.columns,
25
24
  onColumnsSave = props.onColumnsSave,
26
25
  uniqueKey = props.uniqueKey,
26
+ columns = props.columns,
27
27
  TextEnum = props.TextEnum;
28
28
  var _useStyle = useStyle("".concat(prefix, "-toolbar")),
29
29
  wrapSSR = _useStyle.wrapSSR,
@@ -72,7 +72,7 @@ function ToolBar(props) {
72
72
  }), !hideColumnSetting && /*#__PURE__*/_jsx("div", {
73
73
  className: "".concat(prefix, "-toolbar-setting-item"),
74
74
  children: /*#__PURE__*/_jsx(ColumnSetting, {
75
- columns: columns,
75
+ localColumns: columns,
76
76
  uniqueKey: uniqueKey,
77
77
  onColumnsSave: onColumnsSave
78
78
  })
@@ -25,12 +25,19 @@ import ToolBar from "./ToolBar";
25
25
  import { Container, TableContext } from "./Store/Provide";
26
26
  import { useStyle } from "./style/index";
27
27
  import { useAntdColumnResize } from 'react-antd-column-resize';
28
+ import { useIntl } from "../vtx-provider";
28
29
  import { jsx as _jsx } from "react/jsx-runtime";
29
30
  import { jsxs as _jsxs } from "react/jsx-runtime";
30
31
  var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
31
32
  export var indexColumnKey = '_serialNum';
33
+ export var DEFAULT_HEIGHTS = {
34
+ HEAD_FOOT: 115,
35
+ ALERT: 49,
36
+ TOOLBAR: 56
37
+ };
32
38
  function VtxTable(props) {
33
39
  var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
40
+ var intl = useIntl();
34
41
  var _useContext = useContext(ConfigProvider.ConfigContext),
35
42
  getPrefixCls = _useContext.getPrefixCls;
36
43
  var prefixCls = getPrefixCls('', 'vtx-datagrid');
@@ -66,7 +73,7 @@ function VtxTable(props) {
66
73
  toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
67
74
  toolbarClassName = props.toolbarClassName,
68
75
  _props$toolbarTilte = props.toolbarTilte,
69
- toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
76
+ toolbarTilte = _props$toolbarTilte === void 0 ? intl.getMessage('datagrid.queryResults', '查询结果') : _props$toolbarTilte,
70
77
  buttonGroup = props.buttonGroup,
71
78
  _props$refreshIconVis = props.refreshIconVisible,
72
79
  refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
@@ -80,14 +87,14 @@ function VtxTable(props) {
80
87
  _props$autoFit = props.autoFit,
81
88
  autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
82
89
  _props$headFootHeight = props.headFootHeight,
83
- headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
90
+ headFootHeight = _props$headFootHeight === void 0 ? DEFAULT_HEIGHTS.HEAD_FOOT : _props$headFootHeight,
84
91
  _props$columnResizabl = props.columnResizable,
85
92
  columnResizable = _props$columnResizabl === void 0 ? true : _props$columnResizabl,
86
93
  components = props.components,
87
94
  className = props.className,
88
95
  style = props.style,
89
96
  _props$emptyText = props.emptyText,
90
- emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
97
+ emptyText = _props$emptyText === void 0 ? intl.getMessage('select.empty', '暂无数据') : _props$emptyText,
91
98
  onRowSelectionClear = props.onRowSelectionClear,
92
99
  onColumnsSave = props.onColumnsSave,
93
100
  uniqueKey = props.uniqueKey,
@@ -123,14 +130,12 @@ function VtxTable(props) {
123
130
  var resizeObserver = new ResizeObserver(function () {
124
131
  calculateHeight();
125
132
  });
126
- // componentDidMount
127
133
  if (autoFit && rootDomRef.current) {
128
134
  resizeObserver.observe(rootDomRef.current, {
129
135
  box: 'border-box'
130
136
  });
131
137
  }
132
138
  return function () {
133
- // componentWillUnmount
134
139
  if (autoFit) {
135
140
  resizeObserver.disconnect();
136
141
  }
@@ -152,7 +157,7 @@ function VtxTable(props) {
152
157
  showSizeChanger: true,
153
158
  showQuickJumper: true,
154
159
  showTotal: function showTotal(total) {
155
- return "".concat(TextEnum.total, " ").concat(total, " ").concat(TextEnum.item);
160
+ return "".concat(TextEnum.paginationTotalText, " ").concat(total, " ").concat(TextEnum.paginationItemText);
156
161
  }
157
162
  }, pagination);
158
163
  };
@@ -227,8 +232,8 @@ function VtxTable(props) {
227
232
  selectedRowKeys: (_rest$rowSelection4 = rest.rowSelection) === null || _rest$rowSelection4 === void 0 ? void 0 : _rest$rowSelection4.selectedRowKeys,
228
233
  onRowSelectionClear: onRowSelectionClear
229
234
  }) : null;
230
- alertHeight.current = !hideSelectionClear && hasAlert ? 49 : 0;
231
- toolbarHeight.current = toolbar ? 56 : 0;
235
+ alertHeight.current = !hideSelectionClear && hasAlert ? DEFAULT_HEIGHTS.ALERT : 0;
236
+ toolbarHeight.current = toolbar ? DEFAULT_HEIGHTS.TOOLBAR : 0;
232
237
  var _useAntdColumnResize = useAntdColumnResize(function () {
233
238
  return {
234
239
  columns: columns,
@@ -279,7 +284,7 @@ function VtxTable(props) {
279
284
  hideColumnHeight: hideColumnHeight,
280
285
  hideColumnSetting: hideColumnSetting,
281
286
  onRefresh: onRefresh,
282
- columns: _columns,
287
+ columns: tableColumn,
283
288
  onColumnsSave: onColumnsSave,
284
289
  uniqueKey: uniqueKey,
285
290
  prefixUrl: prefixUrl,