@vtx/components 4.0.0-beta.89 → 4.0.0-beta.90

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 (84) 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-datagrid/Store/Provide.js +7 -7
  24. package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  25. package/es/vtx-datagrid/index.js +7 -6
  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-form-layout/style/index.js +6 -4
  30. package/es/vtx-icon/index.js1 +90 -90
  31. package/es/vtx-modal/index.js +2 -2
  32. package/es/vtx-page-layout/Basic.js +2 -2
  33. package/es/vtx-page-layout/TabLayout.js +6 -6
  34. package/es/vtx-page-layout/TableLayout.js +10 -10
  35. package/es/vtx-page-layout/TreeLayout.js +6 -6
  36. package/es/vtx-page-layout/container.js +2 -2
  37. package/es/vtx-provider/index.js +30 -30
  38. package/es/vtx-provider/intl.js +9 -9
  39. package/es/vtx-provider/useStyle/index.js +17 -17
  40. package/es/vtx-search/index.js +17 -3
  41. package/es/vtx-tree-select/index.js +13 -8
  42. package/es/vtx-wang-editor/style/index.less +12 -12
  43. package/lib/utils/components/LabelIconTip/index.js +7 -7
  44. package/lib/utils/conversionMomentValue/index.js +25 -25
  45. package/lib/utils/filterSpecialCharacters.js +6 -6
  46. package/lib/utils/genCopyable/index.js +6 -6
  47. package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
  48. package/lib/utils/hooks/useDebounceFn/index.js +4 -4
  49. package/lib/utils/hooks/useDebounceValue/index.js +6 -6
  50. package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
  51. package/lib/utils/hooks/useLatest/index.js +2 -2
  52. package/lib/utils/hooks/useRefCallback/index.js +5 -5
  53. package/lib/utils/isBrowser/index.js +7 -7
  54. package/lib/utils/isUrl/index.js +4 -4
  55. package/lib/utils/merge/index.js +4 -4
  56. package/lib/utils/nanoid/index.js +4 -4
  57. package/lib/utils/omitBoolean/index.js +4 -4
  58. package/lib/utils/parseValueToMoment/index.js +4 -4
  59. package/lib/utils/proFieldParsingText/index.js +10 -10
  60. package/lib/utils/transformKeySubmitValue/index.js +57 -57
  61. package/lib/utils/useEditableArray/index.js +46 -46
  62. package/lib/utils/useEditableMap/index.js +22 -22
  63. package/lib/utils/useMediaQuery/index.js +5 -5
  64. package/lib/vtx-datagrid/Store/Provide.js +10 -10
  65. package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
  66. package/lib/vtx-datagrid/index.js +7 -6
  67. package/lib/vtx-datagrid/style/index.less +242 -242
  68. package/lib/vtx-date-picker/style/index.less +39 -39
  69. package/lib/vtx-export/index.js +8 -8
  70. package/lib/vtx-form-layout/style/index.js +6 -4
  71. package/lib/vtx-icon/index.js1 +90 -90
  72. package/lib/vtx-modal/index.js +2 -2
  73. package/lib/vtx-page-layout/Basic.js +2 -2
  74. package/lib/vtx-page-layout/TabLayout.js +6 -6
  75. package/lib/vtx-page-layout/TableLayout.js +10 -10
  76. package/lib/vtx-page-layout/TreeLayout.js +6 -6
  77. package/lib/vtx-page-layout/container.js +2 -2
  78. package/lib/vtx-provider/index.js +30 -30
  79. package/lib/vtx-provider/intl.js +9 -9
  80. package/lib/vtx-provider/useStyle/index.js +17 -17
  81. package/lib/vtx-search/index.js +19 -3
  82. package/lib/vtx-tree-select/index.js +13 -10
  83. package/lib/vtx-wang-editor/style/index.less +12 -12
  84. package/package.json +239 -239
@@ -1,90 +1,90 @@
1
- import { lazy, memo, Suspense, useMemo } from 'react';
2
- import AlignRightOutlined from './svg/alignRightOutlined.js';
3
- import ColumnHeightOutlined from './svg/columnHeightOutlined.js';
4
- import DownOutlined from './svg/downOutlined.js';
5
- import Fullscreen from './svg/fullscreen.js';
6
- import RedoOutlined from './svg/redoOutlined.js';
7
- import RightOutlined from './svg/rightOutlined.js';
8
- import SettingOutlined from './svg/settingOutlined.js';
9
-
10
-
11
- const iconComponents = {
12
- alignRightOutlined: AlignRightOutlined,
13
- columnHeightOutlined: ColumnHeightOutlined,
14
- downOutlined: DownOutlined,
15
- fullscreen: Fullscreen,
16
- redoOutlined: RedoOutlined,
17
- rightOutlined: RightOutlined,
18
- settingOutlined: SettingOutlined,
19
- // 低频图标如果确实需要,可以再考虑 lazy
20
- };
21
-
22
- // const iconComponents = {
23
- // // 核心:添加你需要的所有图标, 动态导入有的组件会失败
24
- // alignRightOutlined: lazy(() => import('./svg/alignRightOutlined.js')),
25
- // columnHeightOutlined: lazy(() => import('./svg/columnHeightOutlined.js')),
26
- // downOutlined: lazy(() => import('./svg/downOutlined.js')),
27
- // fullscreen: lazy(() => import('./svg/fullscreen.js')),
28
- // redoOutlined: lazy(() => import('./svg/redoOutlined.js')),
29
- // rightOutlined: lazy(() => import('./svg/rightOutlined.js')),
30
- // settingOutlined: lazy(() => import('./svg/settingOutlined.js')),
31
- // // 新增其他图标...
32
- // };
33
-
34
-
35
- const VtxIcon = memo(({
36
- type,
37
- size = 16,
38
- className = '',
39
- style = {},
40
- color,
41
- fileType = 'webp',
42
- ...props
43
- }) => {
44
- const width = props.width || size;
45
- const height = props.height || size;
46
- if (!type) {
47
- return null;
48
- }
49
- // const SvgComponent = useMemo(() => {
50
- // // 动态导入并缓存结果
51
- // return lazy(() => import(/* @vite-ignore */`./svg/${type}.js`));
52
- // }, [type]);
53
-
54
- const SvgComponent = useMemo(() => {
55
- // 兜底:找不到对应图标时,返回一个空组件(避免报错)
56
- return iconComponents[type] || lazy(() => Promise.resolve({ default: () => <svg width={width} height={height} /> }));
57
- }, [type, width, height]);
58
-
59
- // 默认返回空元素
60
- if (fileType == 'svg') {
61
- try {
62
- // const SvgComponent = lazy(() => import(`./svg/${type}.js`));
63
- return (
64
- <Suspense fallback={<div style={{ width, height, ...style }} />}>
65
- <SvgComponent
66
- className={className}
67
- style={{ width, height, ...style }}
68
- fill={color}
69
- {...props}
70
- />
71
- </Suspense>
72
- );
73
- } catch (error) {
74
- // 如果动态导入失败,返回空的 SVG 元素
75
- return (
76
- <svg width={width} height={height} style={style} className={className} {...props} />
77
- );
78
- }
79
- } else {
80
- return (
81
- // <img
82
- // src={require(`./assets/${type}.${fileType}`)}
83
- // style={{ width, height, ...style }}
84
- // />
85
- <></>
86
- );
87
- }
88
- });
89
- export { VtxIcon }
90
- export default VtxIcon;
1
+ import { lazy, memo, Suspense, useMemo } from 'react';
2
+ import AlignRightOutlined from './svg/alignRightOutlined.js';
3
+ import ColumnHeightOutlined from './svg/columnHeightOutlined.js';
4
+ import DownOutlined from './svg/downOutlined.js';
5
+ import Fullscreen from './svg/fullscreen.js';
6
+ import RedoOutlined from './svg/redoOutlined.js';
7
+ import RightOutlined from './svg/rightOutlined.js';
8
+ import SettingOutlined from './svg/settingOutlined.js';
9
+
10
+
11
+ const iconComponents = {
12
+ alignRightOutlined: AlignRightOutlined,
13
+ columnHeightOutlined: ColumnHeightOutlined,
14
+ downOutlined: DownOutlined,
15
+ fullscreen: Fullscreen,
16
+ redoOutlined: RedoOutlined,
17
+ rightOutlined: RightOutlined,
18
+ settingOutlined: SettingOutlined,
19
+ // 低频图标如果确实需要,可以再考虑 lazy
20
+ };
21
+
22
+ // const iconComponents = {
23
+ // // 核心:添加你需要的所有图标, 动态导入有的组件会失败
24
+ // alignRightOutlined: lazy(() => import('./svg/alignRightOutlined.js')),
25
+ // columnHeightOutlined: lazy(() => import('./svg/columnHeightOutlined.js')),
26
+ // downOutlined: lazy(() => import('./svg/downOutlined.js')),
27
+ // fullscreen: lazy(() => import('./svg/fullscreen.js')),
28
+ // redoOutlined: lazy(() => import('./svg/redoOutlined.js')),
29
+ // rightOutlined: lazy(() => import('./svg/rightOutlined.js')),
30
+ // settingOutlined: lazy(() => import('./svg/settingOutlined.js')),
31
+ // // 新增其他图标...
32
+ // };
33
+
34
+
35
+ const VtxIcon = memo(({
36
+ type,
37
+ size = 16,
38
+ className = '',
39
+ style = {},
40
+ color,
41
+ fileType = 'webp',
42
+ ...props
43
+ }) => {
44
+ const width = props.width || size;
45
+ const height = props.height || size;
46
+ if (!type) {
47
+ return null;
48
+ }
49
+ // const SvgComponent = useMemo(() => {
50
+ // // 动态导入并缓存结果
51
+ // return lazy(() => import(/* @vite-ignore */`./svg/${type}.js`));
52
+ // }, [type]);
53
+
54
+ const SvgComponent = useMemo(() => {
55
+ // 兜底:找不到对应图标时,返回一个空组件(避免报错)
56
+ return iconComponents[type] || lazy(() => Promise.resolve({ default: () => <svg width={width} height={height} /> }));
57
+ }, [type, width, height]);
58
+
59
+ // 默认返回空元素
60
+ if (fileType == 'svg') {
61
+ try {
62
+ // const SvgComponent = lazy(() => import(`./svg/${type}.js`));
63
+ return (
64
+ <Suspense fallback={<div style={{ width, height, ...style }} />}>
65
+ <SvgComponent
66
+ className={className}
67
+ style={{ width, height, ...style }}
68
+ fill={color}
69
+ {...props}
70
+ />
71
+ </Suspense>
72
+ );
73
+ } catch (error) {
74
+ // 如果动态导入失败,返回空的 SVG 元素
75
+ return (
76
+ <svg width={width} height={height} style={style} className={className} {...props} />
77
+ );
78
+ }
79
+ } else {
80
+ return (
81
+ // <img
82
+ // src={require(`./assets/${type}.${fileType}`)}
83
+ // style={{ width, height, ...style }}
84
+ // />
85
+ <></>
86
+ );
87
+ }
88
+ });
89
+ export { VtxIcon }
90
+ export default VtxIcon;
@@ -141,8 +141,8 @@ function VtxModal(props) {
141
141
  }
142
142
  };
143
143
 
144
- /*
145
- *重写title,加入对话框全屏功能
144
+ /*
145
+ *重写title,加入对话框全屏功能
146
146
  */
147
147
  title = function renderTitle() {
148
148
  if (typeof title == 'string' && title.indexOf('>') > -1) {
@@ -10,8 +10,8 @@ var _style = require("./style");
10
10
  var _vtxProvider = require("../vtx-provider");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- /**
14
- * 基础布局
13
+ /**
14
+ * 基础布局
15
15
  */
16
16
 
17
17
  function Basic(props) {
@@ -12,9 +12,9 @@ var _style = require("./style");
12
12
  var _vtxProvider = require("../vtx-provider");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- /**
16
- * 页面
17
- * @param {*} props
15
+ /**
16
+ * 页面
17
+ * @param {*} props
18
18
  */var Page = function Page(props) {
19
19
  var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
20
20
  getPrefixCls = _useContext.getPrefixCls;
@@ -34,9 +34,9 @@ Page.propTypes = {
34
34
  children: _propTypes.default.node
35
35
  };
36
36
 
37
- /**
38
- * 内容
39
- * @param {*} props
37
+ /**
38
+ * 内容
39
+ * @param {*} props
40
40
  */
41
41
  var Content = function Content(props) {
42
42
  var className = props.className,
@@ -33,9 +33,9 @@ var pagePaddingTop = 20;
33
33
  var searchMarginBottom = 20;
34
34
 
35
35
  // eslint-disable-next-line valid-jsdoc
36
- /**
37
- * 页面
38
- * @param {*} props
36
+ /**
37
+ * 页面
38
+ * @param {*} props
39
39
  */
40
40
  var Page = function Page(props) {
41
41
  var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
@@ -83,17 +83,17 @@ Page.propTypes = {
83
83
  onSearchCollapse: _propTypes.default.func
84
84
  };
85
85
 
86
- /**
87
- * 搜索
86
+ /**
87
+ * 搜索
88
88
  */
89
89
  var Search = (0, _container.default)({
90
90
  componentClass: 'vtx-page-table-search'
91
91
  })(_Basic.default);
92
92
 
93
93
  // eslint-disable-next-line valid-jsdoc
94
- /**
95
- * 内容
96
- * @param {*} props
94
+ /**
95
+ * 内容
96
+ * @param {*} props
97
97
  */
98
98
  var Content = function Content(props) {
99
99
  var className = props.className,
@@ -128,8 +128,8 @@ Content.propTypes = {
128
128
  };
129
129
 
130
130
  // eslint-disable-next-line valid-jsdoc
131
- /**
132
- * 表格布局
131
+ /**
132
+ * 表格布局
133
133
  */
134
134
  var Table = function Table(props) {
135
135
  var className = props.className,
@@ -11,9 +11,9 @@ var _style = require("./style");
11
11
  var _vtxProvider = require("../vtx-provider");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- /**
15
- * 页面
16
- * @param {*} props
14
+ /**
15
+ * 页面
16
+ * @param {*} props
17
17
  */var Page = function Page(props) {
18
18
  var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
19
19
  getPrefixCls = _useContext.getPrefixCls;
@@ -33,9 +33,9 @@ Page.propTypes = {
33
33
  children: _propTypes.default.node
34
34
  };
35
35
 
36
- /**
37
- * 内容
38
- * @param {*} props
36
+ /**
37
+ * 内容
38
+ * @param {*} props
39
39
  */
40
40
  var Content = function Content(props) {
41
41
  var className = props.className,
@@ -24,8 +24,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
24
24
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25
25
  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; }
26
26
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
27
- 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); } /**
28
- * 高阶组件
27
+ 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); } /**
28
+ * 高阶组件
29
29
  */
30
30
  function getDisplayName(WrappedComponend) {
31
31
  return WrappedComponend.displayName || WrappedComponend.name || 'Component';
@@ -82,11 +82,11 @@ var omitUndefined = function omitUndefined(obj) {
82
82
  return newObj;
83
83
  };
84
84
 
85
- /**
86
- * 用于判断当前是否需要开启哈希(Hash)模式。
87
- * 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
88
- * 如果是,则返回 false。否则,直接返回 true 表示需要打开。
89
- * @returns
85
+ /**
86
+ * 用于判断当前是否需要开启哈希(Hash)模式。
87
+ * 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
88
+ * 如果是,则返回 false。否则,直接返回 true 表示需要打开。
89
+ * @returns
90
90
  */
91
91
  var isNeedOpenHash = exports.isNeedOpenHash = function isNeedOpenHash() {
92
92
  var _process$env$NODE_ENV, _process$env$NODE_ENV2;
@@ -121,10 +121,10 @@ var VtxConfigContext = exports.VtxConfigContext = /*#__PURE__*/_react.default.cr
121
121
  });
122
122
  var ConfigConsumer = exports.ConfigConsumer = VtxConfigContext.Consumer;
123
123
 
124
- /**
125
- * 组件解除挂载后清空一下 cache
126
- * @date 2022-11-28
127
- * @returns null
124
+ /**
125
+ * 组件解除挂载后清空一下 cache
126
+ * @date 2022-11-28
127
+ * @returns null
128
128
  */
129
129
  var CacheClean = function CacheClean() {
130
130
  var _useSWRConfig = (0, _swr.useSWRConfig)(),
@@ -137,10 +137,10 @@ var CacheClean = function CacheClean() {
137
137
  return null;
138
138
  };
139
139
 
140
- /**
141
- * 用于配置 Pro 的组件,分装之后会简单一些
142
- * @param props
143
- * @returns
140
+ /**
141
+ * 用于配置 Pro 的组件,分装之后会简单一些
142
+ * @param props
143
+ * @returns
144
144
  */
145
145
  var ConfigProviderContainer = function ConfigProviderContainer(props) {
146
146
  var _antdTheme$useToken;
@@ -159,17 +159,17 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
159
159
  var tokenContext = (_antdTheme$useToken = _antd.theme.useToken) === null || _antdTheme$useToken === void 0 ? void 0 : _antdTheme$useToken.call(_antd.theme);
160
160
  var proProvide = (0, _react.useContext)(VtxConfigContext);
161
161
 
162
- /**
163
- * pro 的 类
164
- * @type {string}
165
- * @example .ant-pro
162
+ /**
163
+ * pro 的 类
164
+ * @type {string}
165
+ * @example .ant-pro
166
166
  */
167
167
 
168
168
  var vtxComponentsCls = prefixCls ? ".".concat(prefixCls) : ".vtx";
169
169
  var antCls = '.' + getPrefixCls();
170
170
  var salt = "".concat(vtxComponentsCls);
171
- /**
172
- * 合并一下token,不然导致嵌套 token 失效
171
+ /**
172
+ * 合并一下token,不然导致嵌套 token 失效
173
173
  */
174
174
  var proLayoutTokenMerge = (0, _react.useMemo)(function () {
175
175
  return (0, _layoutToken.getLayoutDesignToken)(propsToken || {}, tokenContext.token);
@@ -266,10 +266,10 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
266
266
  });
267
267
  };
268
268
 
269
- /**
270
- * 用于配置 一些全局性的东西
271
- * @param props
272
- * @returns
269
+ /**
270
+ * 用于配置 一些全局性的东西
271
+ * @param props
272
+ * @returns
273
273
  */
274
274
  var VtxConfigProvider = exports.VtxConfigProvider = function VtxConfigProvider(props) {
275
275
  var _theme$components, _theme$components2;
@@ -334,13 +334,13 @@ var VtxConfigProvider = exports.VtxConfigProvider = function VtxConfigProvider(p
334
334
  }));
335
335
  };
336
336
 
337
- /**
338
- * It returns the intl object from the context if it exists, otherwise it returns the intl object for
339
- * 获取国际化的方法
340
- * @param locale
341
- * @param localeMap
342
- * the current locale
343
- * @returns The return value of the function is the intl object.
337
+ /**
338
+ * It returns the intl object from the context if it exists, otherwise it returns the intl object for
339
+ * 获取国际化的方法
340
+ * @param locale
341
+ * @param localeMap
342
+ * the current locale
343
+ * @returns The return value of the function is the intl object.
344
344
  */
345
345
  function useIntl() {
346
346
  var _useContext3 = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
@@ -39,11 +39,11 @@ var _zh_CN = _interopRequireDefault(require("./locale/zh_CN"));
39
39
  var _zh_HK = _interopRequireDefault(require("./locale/zh_HK"));
40
40
  var _zh_TW = _interopRequireDefault(require("./locale/zh_TW"));
41
41
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
- /**
43
- * 创建一个国际化的操作函数
44
- *
45
- * @param locale
46
- * @param localeMap
42
+ /**
43
+ * 创建一个国际化的操作函数
44
+ *
45
+ * @param locale
46
+ * @param localeMap
47
47
  */
48
48
  var createIntl = exports.createIntl = function createIntl(locale, localeMap) {
49
49
  return {
@@ -131,10 +131,10 @@ var intlMap = exports.intlMap = {
131
131
  };
132
132
  var intlMapKeys = exports.intlMapKeys = Object.keys(intlMap);
133
133
 
134
- /**
135
- * 根据 antd 的 key 来找到的 locale 插件的 key
136
- *
137
- * @param localeKey
134
+ /**
135
+ * 根据 antd 的 key 来找到的 locale 插件的 key
136
+ *
137
+ * @param localeKey
138
138
  */
139
139
  var findIntlKeyByAntdLocaleKey = exports.findIntlKeyByAntdLocaleKey = function findIntlKeyByAntdLocaleKey(localeKey) {
140
140
  var localeName = (localeKey || 'zh-CN').toLocaleLowerCase();
@@ -16,23 +16,23 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  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; }
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
18
18
  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); }
19
- /**
20
- * 把一个颜色设置一下透明度
21
- * @example (#fff, 0.5) => rgba(255, 255, 255, 0.5)
22
- * @param baseColor {string}
23
- * @param alpha {0-1}
24
- * @returns rgba {string}
19
+ /**
20
+ * 把一个颜色设置一下透明度
21
+ * @example (#fff, 0.5) => rgba(255, 255, 255, 0.5)
22
+ * @param baseColor {string}
23
+ * @param alpha {0-1}
24
+ * @returns rgba {string}
25
25
  */
26
26
  var setAlpha = exports.setAlpha = function setAlpha(baseColor, alpha) {
27
27
  return new _tinycolor.TinyColor(baseColor).setAlpha(alpha).toRgbString();
28
28
  };
29
29
 
30
- /**
31
- * 把一个颜色修改一些明度
32
- * @example (#000, 50) => #808080
33
- * @param baseColor {string}
34
- * @param brightness {0-100}
35
- * @returns hexColor {string}
30
+ /**
31
+ * 把一个颜色修改一些明度
32
+ * @example (#000, 50) => #808080
33
+ * @param baseColor {string}
34
+ * @param brightness {0-100}
35
+ * @returns hexColor {string}
36
36
  */
37
37
  var lighten = exports.lighten = function lighten(baseColor, brightness) {
38
38
  var instance = new _tinycolor.TinyColor(baseColor);
@@ -67,11 +67,11 @@ var operationUnit = exports.operationUnit = function operationUnit(token) {
67
67
  };
68
68
  };
69
69
 
70
- /**
71
- * 封装了一下 antd 的 useStyle
72
- * @param componentName {string} 组件的名字
73
- * @param styleFn {GenerateStyle} 生成样式的函数
74
- * @returns UseStyleResult
70
+ /**
71
+ * 封装了一下 antd 的 useStyle
72
+ * @param componentName {string} 组件的名字
73
+ * @param styleFn {GenerateStyle} 生成样式的函数
74
+ * @returns UseStyleResult
75
75
  */
76
76
  function useStyle(componentName, styleFn) {
77
77
  var _token$vtxComponentsC;
@@ -11,12 +11,14 @@ var _ahooks = require("ahooks");
11
11
  var _antd = require("antd");
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
- var _react = require("react");
14
+ var _react = _interopRequireWildcard(require("react"));
15
15
  var _useColSize = _interopRequireDefault(require("../utils/useColSize"));
16
16
  var _TableLayout = require("../vtx-page-layout/TableLayout");
17
17
  var _index = require("./style/index");
18
18
  var _vtxProvider = require("../vtx-provider");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
  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; }
22
24
  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; }
@@ -33,6 +35,18 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
33
35
  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; }
34
36
  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; } }
35
37
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
38
+ var hasRenderableChildren = function hasRenderableChildren(children) {
39
+ var result = false;
40
+ _react.Children.forEach(children, function (child) {
41
+ if (result) return;
42
+ if ( /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _react.Fragment) {
43
+ result = hasRenderableChildren(child.props.children);
44
+ return;
45
+ }
46
+ result = child !== null && child !== undefined && typeof child !== 'boolean';
47
+ });
48
+ return result;
49
+ };
36
50
  function VtxSearch(props) {
37
51
  var intl = (0, _vtxProvider.useIntl)();
38
52
  var _useContext = (0, _react.useContext)(_vtxProvider.VtxProvider),
@@ -138,6 +152,8 @@ function VtxSearch(props) {
138
152
  cumulativeWeight: cumulativeWeight
139
153
  };
140
154
  }, [JSON.stringify(props.gridWeight), size]);
155
+ var hasMoreButton = isMoreButton && grid.len > realColumn - 1;
156
+ var hasButtons = renderButtons ? hasRenderableChildren(renderButtons) : isConfirmButton || isClearButton || hasMoreButton;
141
157
 
142
158
  // 需要显示的位置
143
159
  var showPosition = (0, _react.useMemo)(function () {
@@ -289,7 +305,7 @@ function VtxSearch(props) {
289
305
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Row, {
290
306
  gutter: 24,
291
307
  attr: "row",
292
- children: [analyzeChildren(newChildren), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Col, {
308
+ children: [analyzeChildren(newChildren), hasButtons && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Col, {
293
309
  span: 24 / realColumn * 1,
294
310
  offset: btnOffset,
295
311
  className: "vtx-search-buttons-content",
@@ -318,7 +334,7 @@ function VtxSearch(props) {
318
334
  onClick: onClear,
319
335
  children: customEnumText.clearText
320
336
  })
321
- }), isMoreButton && grid.len > realColumn - 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
337
+ }), hasMoreButton && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
322
338
  "data-type": 'bt',
323
339
  onClick: function onClick() {
324
340
  return setShowMore(!showMore);
@@ -5,20 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = exports.VtxTreeSelect = void 0;
8
- var _antd = require("antd");
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
8
  var _icons = require("@ant-design/icons");
9
+ var _ahooks = require("ahooks");
10
+ var _antd = require("antd");
12
11
  var _classnames = _interopRequireDefault(require("classnames"));
13
12
  var _pull = _interopRequireDefault(require("lodash-es/pull"));
14
- var _index = require("./style/index");
15
- var _ahooks = require("ahooks");
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _react = require("react");
15
+ var _vtxIcon = _interopRequireDefault(require("../vtx-icon"));
16
16
  var _vtxProvider = require("../vtx-provider");
17
+ var _index = require("./style/index");
17
18
  var _jsxRuntime = require("react/jsx-runtime");
18
19
  var _excluded = ["multiple", "treeData", "placeholder", "treeCheckable", "disabled", "style", "fieldNames", "onChange", "labelInValue"];
19
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
21
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
22
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
23
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -47,9 +46,9 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
47
46
  style = _ref.style,
48
47
  _ref$fieldNames = _ref.fieldNames,
49
48
  fieldNames = _ref$fieldNames === void 0 ? {
50
- label: "title",
51
- value: "value",
52
- key: "value",
49
+ label: 'title',
50
+ value: 'value',
51
+ key: 'value',
53
52
  children: 'children'
54
53
  } : _ref$fieldNames,
55
54
  onChange = _ref.onChange,
@@ -195,6 +194,10 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
195
194
  showLeafIcon: false
196
195
  },
197
196
  switcherIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DownOutlined, {}),
197
+ suffixIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxIcon.default, {
198
+ type: "downOutlined",
199
+ fileType: "svg"
200
+ }),
198
201
  multiple: multiple,
199
202
  treeCheckable: treeCheckable,
200
203
  className: (0, _classnames.default)("".concat(prefixCls, " ").concat(props.prefixCls), hashId),
@@ -1,12 +1,12 @@
1
-
2
-
3
- .vtx-wang-editor {
4
- border: @border-width-base @border-style-base @border-color-base;
5
- &.w-e-full-screen-container {
6
- z-index: 999999;
7
- }
8
- &-content {
9
- height: 350px;
10
- border-top: @border-width-base @border-style-base @border-color-base;
11
- }
12
- }
1
+
2
+
3
+ .vtx-wang-editor {
4
+ border: @border-width-base @border-style-base @border-color-base;
5
+ &.w-e-full-screen-container {
6
+ z-index: 999999;
7
+ }
8
+ &-content {
9
+ height: 350px;
10
+ border-top: @border-width-base @border-style-base @border-color-base;
11
+ }
12
+ }