@vtx/components 4.0.0-beta.74 → 4.0.0-beta.76
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.
- package/README.md +19 -19
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +6 -6
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-export/index.js +8 -8
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-icon/index.js1 +90 -90
- package/es/vtx-modal/index.js +2 -2
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-provider/index.js +30 -30
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-select/index.js +1 -7
- package/es/vtx-wang-editor/index.js +1 -0
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +6 -6
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-export/index.js +8 -8
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-icon/index.js1 +90 -90
- package/lib/vtx-modal/index.js +2 -2
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-provider/index.js +30 -30
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-select/index.js +1 -7
- package/lib/vtx-wang-editor/index.js +3 -2
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/package.json +238 -238
package/es/vtx-icon/index.js1
CHANGED
|
@@ -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;
|
package/es/vtx-modal/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import { useContext } from 'react';
|
|
|
5
5
|
import { useStyle } from "./style";
|
|
6
6
|
import { VtxProvider } from "../vtx-provider";
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* 页面
|
|
10
|
-
* @param {*} props
|
|
8
|
+
/**
|
|
9
|
+
* 页面
|
|
10
|
+
* @param {*} props
|
|
11
11
|
*/
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
var Page = function Page(props) {
|
|
@@ -29,9 +29,9 @@ Page.propTypes = {
|
|
|
29
29
|
children: PropTypes.node
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* 内容
|
|
34
|
-
* @param {*} props
|
|
32
|
+
/**
|
|
33
|
+
* 内容
|
|
34
|
+
* @param {*} props
|
|
35
35
|
*/
|
|
36
36
|
var Content = function Content(props) {
|
|
37
37
|
var className = props.className,
|
|
@@ -24,9 +24,9 @@ var pagePaddingTop = 20;
|
|
|
24
24
|
var searchMarginBottom = 20;
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line valid-jsdoc
|
|
27
|
-
/**
|
|
28
|
-
* 页面
|
|
29
|
-
* @param {*} props
|
|
27
|
+
/**
|
|
28
|
+
* 页面
|
|
29
|
+
* @param {*} props
|
|
30
30
|
*/
|
|
31
31
|
var Page = function Page(props) {
|
|
32
32
|
var _useContext = useContext(VtxProvider),
|
|
@@ -74,17 +74,17 @@ Page.propTypes = {
|
|
|
74
74
|
onSearchCollapse: PropTypes.func
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
/**
|
|
78
|
-
* 搜索
|
|
77
|
+
/**
|
|
78
|
+
* 搜索
|
|
79
79
|
*/
|
|
80
80
|
var Search = container({
|
|
81
81
|
componentClass: 'vtx-page-table-search'
|
|
82
82
|
})(Basic);
|
|
83
83
|
|
|
84
84
|
// eslint-disable-next-line valid-jsdoc
|
|
85
|
-
/**
|
|
86
|
-
* 内容
|
|
87
|
-
* @param {*} props
|
|
85
|
+
/**
|
|
86
|
+
* 内容
|
|
87
|
+
* @param {*} props
|
|
88
88
|
*/
|
|
89
89
|
var Content = function Content(props) {
|
|
90
90
|
var className = props.className,
|
|
@@ -119,8 +119,8 @@ Content.propTypes = {
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
// eslint-disable-next-line valid-jsdoc
|
|
122
|
-
/**
|
|
123
|
-
* 表格布局
|
|
122
|
+
/**
|
|
123
|
+
* 表格布局
|
|
124
124
|
*/
|
|
125
125
|
var Table = function Table(props) {
|
|
126
126
|
var className = props.className,
|
|
@@ -4,9 +4,9 @@ import { useContext } from 'react';
|
|
|
4
4
|
import { useStyle } from "./style";
|
|
5
5
|
import { VtxProvider } from "../vtx-provider";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* 页面
|
|
9
|
-
* @param {*} props
|
|
7
|
+
/**
|
|
8
|
+
* 页面
|
|
9
|
+
* @param {*} props
|
|
10
10
|
*/
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
var Page = function Page(props) {
|
|
@@ -28,9 +28,9 @@ Page.propTypes = {
|
|
|
28
28
|
children: PropTypes.node
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* 内容
|
|
33
|
-
* @param {*} props
|
|
31
|
+
/**
|
|
32
|
+
* 内容
|
|
33
|
+
* @param {*} props
|
|
34
34
|
*/
|
|
35
35
|
var Content = function Content(props) {
|
|
36
36
|
var className = props.className,
|
|
@@ -14,8 +14,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
14
14
|
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; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
16
|
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); }
|
|
17
|
-
/**
|
|
18
|
-
* 高阶组件
|
|
17
|
+
/**
|
|
18
|
+
* 高阶组件
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import PropTypes from 'prop-types';
|
package/es/vtx-provider/index.js
CHANGED
|
@@ -46,11 +46,11 @@ var omitUndefined = function omitUndefined(obj) {
|
|
|
46
46
|
return newObj;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* 用于判断当前是否需要开启哈希(Hash)模式。
|
|
51
|
-
* 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
|
|
52
|
-
* 如果是,则返回 false。否则,直接返回 true 表示需要打开。
|
|
53
|
-
* @returns
|
|
49
|
+
/**
|
|
50
|
+
* 用于判断当前是否需要开启哈希(Hash)模式。
|
|
51
|
+
* 首先也会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
|
|
52
|
+
* 如果是,则返回 false。否则,直接返回 true 表示需要打开。
|
|
53
|
+
* @returns
|
|
54
54
|
*/
|
|
55
55
|
export var isNeedOpenHash = function isNeedOpenHash() {
|
|
56
56
|
var _process$env$NODE_ENV, _process$env$NODE_ENV2;
|
|
@@ -85,10 +85,10 @@ export var VtxConfigContext = /*#__PURE__*/React.createContext({
|
|
|
85
85
|
});
|
|
86
86
|
var ConfigConsumer = VtxConfigContext.Consumer;
|
|
87
87
|
|
|
88
|
-
/**
|
|
89
|
-
* 组件解除挂载后清空一下 cache
|
|
90
|
-
* @date 2022-11-28
|
|
91
|
-
* @returns null
|
|
88
|
+
/**
|
|
89
|
+
* 组件解除挂载后清空一下 cache
|
|
90
|
+
* @date 2022-11-28
|
|
91
|
+
* @returns null
|
|
92
92
|
*/
|
|
93
93
|
export { ConfigConsumer };
|
|
94
94
|
var CacheClean = function CacheClean() {
|
|
@@ -102,10 +102,10 @@ var CacheClean = function CacheClean() {
|
|
|
102
102
|
return null;
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
/**
|
|
106
|
-
* 用于配置 Pro 的组件,分装之后会简单一些
|
|
107
|
-
* @param props
|
|
108
|
-
* @returns
|
|
105
|
+
/**
|
|
106
|
+
* 用于配置 Pro 的组件,分装之后会简单一些
|
|
107
|
+
* @param props
|
|
108
|
+
* @returns
|
|
109
109
|
*/
|
|
110
110
|
var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
111
111
|
var _antdTheme$useToken;
|
|
@@ -124,17 +124,17 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
124
124
|
var tokenContext = (_antdTheme$useToken = antdTheme.useToken) === null || _antdTheme$useToken === void 0 ? void 0 : _antdTheme$useToken.call(antdTheme);
|
|
125
125
|
var proProvide = useContext(VtxConfigContext);
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* pro 的 类
|
|
129
|
-
* @type {string}
|
|
130
|
-
* @example .ant-pro
|
|
127
|
+
/**
|
|
128
|
+
* pro 的 类
|
|
129
|
+
* @type {string}
|
|
130
|
+
* @example .ant-pro
|
|
131
131
|
*/
|
|
132
132
|
|
|
133
133
|
var vtxComponentsCls = prefixCls ? ".".concat(prefixCls) : ".vtx";
|
|
134
134
|
var antCls = '.' + getPrefixCls();
|
|
135
135
|
var salt = "".concat(vtxComponentsCls);
|
|
136
|
-
/**
|
|
137
|
-
* 合并一下token,不然导致嵌套 token 失效
|
|
136
|
+
/**
|
|
137
|
+
* 合并一下token,不然导致嵌套 token 失效
|
|
138
138
|
*/
|
|
139
139
|
var proLayoutTokenMerge = useMemo(function () {
|
|
140
140
|
return getLayoutDesignToken(propsToken || {}, tokenContext.token);
|
|
@@ -231,10 +231,10 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
/**
|
|
235
|
-
* 用于配置 一些全局性的东西
|
|
236
|
-
* @param props
|
|
237
|
-
* @returns
|
|
234
|
+
/**
|
|
235
|
+
* 用于配置 一些全局性的东西
|
|
236
|
+
* @param props
|
|
237
|
+
* @returns
|
|
238
238
|
*/
|
|
239
239
|
export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
240
240
|
var _theme$components, _theme$components2;
|
|
@@ -299,13 +299,13 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
299
299
|
}));
|
|
300
300
|
};
|
|
301
301
|
|
|
302
|
-
/**
|
|
303
|
-
* It returns the intl object from the context if it exists, otherwise it returns the intl object for
|
|
304
|
-
* 获取国际化的方法
|
|
305
|
-
* @param locale
|
|
306
|
-
* @param localeMap
|
|
307
|
-
* the current locale
|
|
308
|
-
* @returns The return value of the function is the intl object.
|
|
302
|
+
/**
|
|
303
|
+
* It returns the intl object from the context if it exists, otherwise it returns the intl object for
|
|
304
|
+
* 获取国际化的方法
|
|
305
|
+
* @param locale
|
|
306
|
+
* @param localeMap
|
|
307
|
+
* the current locale
|
|
308
|
+
* @returns The return value of the function is the intl object.
|
|
309
309
|
*/
|
|
310
310
|
export function useIntl() {
|
|
311
311
|
var _useContext3 = useContext(AntdConfigProvider.ConfigContext),
|
package/es/vtx-provider/intl.js
CHANGED
|
@@ -33,11 +33,11 @@ import zhCN from "./locale/zh_CN";
|
|
|
33
33
|
import zhHK from "./locale/zh_HK";
|
|
34
34
|
import zhTW from "./locale/zh_TW";
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* 创建一个国际化的操作函数
|
|
38
|
-
*
|
|
39
|
-
* @param locale
|
|
40
|
-
* @param localeMap
|
|
36
|
+
/**
|
|
37
|
+
* 创建一个国际化的操作函数
|
|
38
|
+
*
|
|
39
|
+
* @param locale
|
|
40
|
+
* @param localeMap
|
|
41
41
|
*/
|
|
42
42
|
export var createIntl = function createIntl(locale, localeMap) {
|
|
43
43
|
return {
|
|
@@ -125,10 +125,10 @@ var intlMap = {
|
|
|
125
125
|
};
|
|
126
126
|
var intlMapKeys = Object.keys(intlMap);
|
|
127
127
|
|
|
128
|
-
/**
|
|
129
|
-
* 根据 antd 的 key 来找到的 locale 插件的 key
|
|
130
|
-
*
|
|
131
|
-
* @param localeKey
|
|
128
|
+
/**
|
|
129
|
+
* 根据 antd 的 key 来找到的 locale 插件的 key
|
|
130
|
+
*
|
|
131
|
+
* @param localeKey
|
|
132
132
|
*/
|
|
133
133
|
export var findIntlKeyByAntdLocaleKey = function findIntlKeyByAntdLocaleKey(localeKey) {
|
|
134
134
|
var localeName = (localeKey || 'zh-CN').toLocaleLowerCase();
|
|
@@ -10,23 +10,23 @@ import { ConfigProvider as AntdConfigProvider, theme as antdTheme } from 'antd';
|
|
|
10
10
|
import { useContext } from 'react';
|
|
11
11
|
import { VtxProvider } from "../index";
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* 把一个颜色设置一下透明度
|
|
15
|
-
* @example (#fff, 0.5) => rgba(255, 255, 255, 0.5)
|
|
16
|
-
* @param baseColor {string}
|
|
17
|
-
* @param alpha {0-1}
|
|
18
|
-
* @returns rgba {string}
|
|
13
|
+
/**
|
|
14
|
+
* 把一个颜色设置一下透明度
|
|
15
|
+
* @example (#fff, 0.5) => rgba(255, 255, 255, 0.5)
|
|
16
|
+
* @param baseColor {string}
|
|
17
|
+
* @param alpha {0-1}
|
|
18
|
+
* @returns rgba {string}
|
|
19
19
|
*/
|
|
20
20
|
export var setAlpha = function setAlpha(baseColor, alpha) {
|
|
21
21
|
return new TinyColor(baseColor).setAlpha(alpha).toRgbString();
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* 把一个颜色修改一些明度
|
|
26
|
-
* @example (#000, 50) => #808080
|
|
27
|
-
* @param baseColor {string}
|
|
28
|
-
* @param brightness {0-100}
|
|
29
|
-
* @returns hexColor {string}
|
|
24
|
+
/**
|
|
25
|
+
* 把一个颜色修改一些明度
|
|
26
|
+
* @example (#000, 50) => #808080
|
|
27
|
+
* @param baseColor {string}
|
|
28
|
+
* @param brightness {0-100}
|
|
29
|
+
* @returns hexColor {string}
|
|
30
30
|
*/
|
|
31
31
|
export var lighten = function lighten(baseColor, brightness) {
|
|
32
32
|
var instance = new TinyColor(baseColor);
|
|
@@ -61,11 +61,11 @@ export var operationUnit = function operationUnit(token) {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* 封装了一下 antd 的 useStyle
|
|
66
|
-
* @param componentName {string} 组件的名字
|
|
67
|
-
* @param styleFn {GenerateStyle} 生成样式的函数
|
|
68
|
-
* @returns UseStyleResult
|
|
64
|
+
/**
|
|
65
|
+
* 封装了一下 antd 的 useStyle
|
|
66
|
+
* @param componentName {string} 组件的名字
|
|
67
|
+
* @param styleFn {GenerateStyle} 生成样式的函数
|
|
68
|
+
* @returns UseStyleResult
|
|
69
69
|
*/
|
|
70
70
|
export function useStyle(componentName, styleFn) {
|
|
71
71
|
var _token$vtxComponentsC;
|
package/es/vtx-select/index.js
CHANGED
|
@@ -217,13 +217,7 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
217
217
|
onChange: _onChange,
|
|
218
218
|
maxTagCount: maxTagCount,
|
|
219
219
|
maxTagTextLength: maxTagTextLength,
|
|
220
|
-
maxTagPlaceholder: maxTagPlaceholder
|
|
221
|
-
showAll: showAll,
|
|
222
|
-
//是否显示全部选项
|
|
223
|
-
selectStyle: selectStyle,
|
|
224
|
-
selectAll: selectAll,
|
|
225
|
-
selectSearchAll: selectSearchAll,
|
|
226
|
-
defaultBindBodyToPopupContainer: defaultBindBodyToPopupContainer
|
|
220
|
+
maxTagPlaceholder: maxTagPlaceholder
|
|
227
221
|
}, rest), {}, {
|
|
228
222
|
onSearch: handleSearch,
|
|
229
223
|
onBlur: function onBlur(e) {
|
|
@@ -23,6 +23,7 @@ import { Editor, Toolbar } from '@wangeditor/editor-for-react';
|
|
|
23
23
|
import attachmentModule from '@wangeditor/plugin-upload-attachment';
|
|
24
24
|
import { i18nChangeLanguage, Boot } from '@wangeditor/editor';
|
|
25
25
|
import getToken from "../utils/getToken";
|
|
26
|
+
import { message } from 'antd';
|
|
26
27
|
import { withEmptyHtml, findAllImgSrcsFromHtml, extractImageDataFromRtf, replaceImagesFileSourceWithInlineRepresentation, replaceAllSpanFontSize, sanitizeHtml } from "./wangEditorUtil";
|
|
27
28
|
import cls from 'classnames';
|
|
28
29
|
import { useStyle } from "./style/index";
|
|
@@ -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
|
+
}
|
|
@@ -18,13 +18,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
18
18
|
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; }
|
|
19
19
|
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; }
|
|
20
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
-
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); } /**
|
|
22
|
-
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
|
|
23
|
-
* @param {Object} props
|
|
24
|
-
* @param {React.ReactNode} props.label
|
|
25
|
-
* @param {React.ReactNode} [props.subTitle]
|
|
26
|
-
* @param {string|Object} [props.tooltip]
|
|
27
|
-
* @param {boolean|Object} [props.ellipsis]
|
|
21
|
+
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); } /**
|
|
22
|
+
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
|
|
23
|
+
* @param {Object} props
|
|
24
|
+
* @param {React.ReactNode} props.label
|
|
25
|
+
* @param {React.ReactNode} [props.subTitle]
|
|
26
|
+
* @param {string|Object} [props.tooltip]
|
|
27
|
+
* @param {boolean|Object} [props.ellipsis]
|
|
28
28
|
*/
|
|
29
29
|
var LabelIconTip = exports.LabelIconTip = /*#__PURE__*/_react.default.memo(function (props) {
|
|
30
30
|
var label = props.label,
|
|
@@ -25,19 +25,19 @@ var dateFormatterMap = exports.dateFormatterMap = {
|
|
|
25
25
|
dateTimeRange: 'YYYY-MM-DD HH:mm:ss'
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* 判断是不是一个 object
|
|
30
|
-
* @param {any} o
|
|
31
|
-
* @returns boolean
|
|
28
|
+
/**
|
|
29
|
+
* 判断是不是一个 object
|
|
30
|
+
* @param {any} o
|
|
31
|
+
* @returns boolean
|
|
32
32
|
*/
|
|
33
33
|
function isObject(o) {
|
|
34
34
|
return Object.prototype.toString.call(o) === '[object Object]';
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* 判断是否是一个的简单的 object
|
|
39
|
-
* @param {{constructor:any}} o
|
|
40
|
-
* @returns boolean
|
|
37
|
+
/**
|
|
38
|
+
* 判断是否是一个的简单的 object
|
|
39
|
+
* @param {{constructor:any}} o
|
|
40
|
+
* @returns boolean
|
|
41
41
|
*/
|
|
42
42
|
function isPlainObject(o) {
|
|
43
43
|
if (isObject(o) === false) return false;
|
|
@@ -59,20 +59,20 @@ function isPlainObject(o) {
|
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
* 一个比较hack的moment判断工具
|
|
64
|
-
* @param {any} value
|
|
65
|
-
* @returns boolean
|
|
62
|
+
/**
|
|
63
|
+
* 一个比较hack的moment判断工具
|
|
64
|
+
* @param {any} value
|
|
65
|
+
* @returns boolean
|
|
66
66
|
*/
|
|
67
67
|
var isMoment = function isMoment(value) {
|
|
68
68
|
return !!(value !== null && value !== void 0 && value._isAMomentObject);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
/**
|
|
72
|
-
* 根据不同的格式转化 dayjs
|
|
73
|
-
* @param {dayjs.Dayjs} value
|
|
74
|
-
* @param {string|((value:dayjs.Dayjs} dateFormatter
|
|
75
|
-
* @param {string} valueType
|
|
71
|
+
/**
|
|
72
|
+
* 根据不同的格式转化 dayjs
|
|
73
|
+
* @param {dayjs.Dayjs} value
|
|
74
|
+
* @param {string|((value:dayjs.Dayjs} dateFormatter
|
|
75
|
+
* @param {string} valueType
|
|
76
76
|
*/
|
|
77
77
|
var convertMoment = exports.convertMoment = function convertMoment(value, dateFormatter, valueType) {
|
|
78
78
|
if (!dateFormatter) {
|
|
@@ -95,14 +95,14 @@ var convertMoment = exports.convertMoment = function convertMoment(value, dateFo
|
|
|
95
95
|
return value;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
* 这里主要是来转化一下数据 将 dayjs 转化为 string 将 all 默认删除
|
|
100
|
-
* @param {T} value
|
|
101
|
-
* @param {DateFormatter} dateFormatter
|
|
102
|
-
* @param {Record<string} valueTypeMap
|
|
103
|
-
* @param {ProFieldValueType;dateFormat:string;}|any>} |{valueType
|
|
104
|
-
* @param {boolean} omitNil?
|
|
105
|
-
* @param {NamePath} parentKey?
|
|
98
|
+
/**
|
|
99
|
+
* 这里主要是来转化一下数据 将 dayjs 转化为 string 将 all 默认删除
|
|
100
|
+
* @param {T} value
|
|
101
|
+
* @param {DateFormatter} dateFormatter
|
|
102
|
+
* @param {Record<string} valueTypeMap
|
|
103
|
+
* @param {ProFieldValueType;dateFormat:string;}|any>} |{valueType
|
|
104
|
+
* @param {boolean} omitNil?
|
|
105
|
+
* @param {NamePath} parentKey?
|
|
106
106
|
*/
|
|
107
107
|
var conversionMomentValue = exports.conversionMomentValue = function conversionMomentValue(value, dateFormatter, valueTypeMap, omitNil, parentKey) {
|
|
108
108
|
var tmpValue = {};
|