@vtx/components 4.0.0-beta.72 → 4.0.0-beta.74
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.js +17 -17
- 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-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-split-pane/SplitPane.js +16 -17
- 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.js +17 -17
- 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-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-split-pane/SplitPane.js +15 -15
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/package.json +238 -238
package/lib/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/lib/vtx-modal/index.js
CHANGED
|
@@ -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),
|
package/lib/vtx-provider/intl.js
CHANGED
|
@@ -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;
|
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _antd = require("antd");
|
|
8
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _antd = require("antd");
|
|
11
|
-
var _Resizer = _interopRequireDefault(require("./Resizer"));
|
|
12
|
-
var _style = require("./style");
|
|
13
11
|
var _vtxProvider = require("../vtx-provider");
|
|
12
|
+
var _style = require("./style");
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["children", "defaultSize", "minSize", "maxSize", "style"];
|
|
14
|
+
var _excluded = ["children", "defaultSize", "minSize", "maxSize", "style", "direction", "orientation", "handle", "draggerIcon"];
|
|
16
15
|
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); }
|
|
17
16
|
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; }
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -35,31 +34,32 @@ function VtxSplitPane(props) {
|
|
|
35
34
|
var _useStyle = (0, _style.useStyle)(prefixCls),
|
|
36
35
|
wrapSSR = _useStyle.wrapSSR,
|
|
37
36
|
hashId = _useStyle.hashId;
|
|
38
|
-
var splitPane = (0, _react.useRef)();
|
|
39
37
|
var children = props.children,
|
|
40
38
|
defaultSize = props.defaultSize,
|
|
41
39
|
minSize = props.minSize,
|
|
42
40
|
maxSize = props.maxSize,
|
|
43
41
|
style = props.style,
|
|
42
|
+
direction = props.direction,
|
|
43
|
+
orientation = props.orientation,
|
|
44
|
+
handle = props.handle,
|
|
45
|
+
draggerIcon = props.draggerIcon,
|
|
44
46
|
rest = _objectWithoutProperties(props, _excluded);
|
|
45
47
|
var notNullChildren = removeNullChildren(children);
|
|
46
|
-
var
|
|
48
|
+
var mergedOrientation = orientation || direction;
|
|
49
|
+
var mergedDraggerIcon = draggerIcon !== null && draggerIcon !== void 0 ? draggerIcon : handle;
|
|
47
50
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
48
51
|
className: (0, _classnames.default)("".concat(prefixCls), hashId),
|
|
49
|
-
ref: splitPane,
|
|
50
52
|
style: style,
|
|
51
53
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Splitter, _objectSpread(_objectSpread({}, rest), {}, {
|
|
54
|
+
orientation: mergedOrientation,
|
|
55
|
+
draggerIcon: mergedDraggerIcon,
|
|
52
56
|
children: notNullChildren === null || notNullChildren === void 0 ? void 0 : notNullChildren.map(function (v, index) {
|
|
53
57
|
var _v$props;
|
|
54
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
55
|
-
children: /*#__PURE__*/(0, _react.cloneElement)(notNullChildren[index], _objectSpread(_objectSpread(_objectSpread({
|
|
56
|
-
ref: function ref(el) {
|
|
57
|
-
refs.current[index] = el;
|
|
58
|
-
}
|
|
59
|
-
}, index === 0 ? {
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
59
|
+
children: /*#__PURE__*/(0, _react.cloneElement)(notNullChildren[index], _objectSpread(_objectSpread(_objectSpread({}, index === 0 ? {
|
|
60
60
|
max: maxSize,
|
|
61
61
|
min: minSize,
|
|
62
|
-
|
|
62
|
+
defaultSize: defaultSize
|
|
63
63
|
} : {}), v.props), {}, {
|
|
64
64
|
collapsible: _objectSpread({
|
|
65
65
|
start: true,
|
|
@@ -67,7 +67,7 @@ function VtxSplitPane(props) {
|
|
|
67
67
|
showCollapsibleIcon: 'auto'
|
|
68
68
|
}, (_v$props = v.props) === null || _v$props === void 0 ? void 0 : _v$props.collapsible)
|
|
69
69
|
}))
|
|
70
|
-
});
|
|
70
|
+
}, v.key || index);
|
|
71
71
|
})
|
|
72
72
|
}))
|
|
73
73
|
}));
|
|
@@ -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
|
+
}
|