@lingxiteam/assets 1.0.11 → 1.0.12
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/es/dealDsl/preprocess/common.js +27 -16
- package/es/error/errorDisplay/Web/Drawer/Drawer.less +31 -0
- package/es/error/errorDisplay/Web/Drawer/index.js +12 -4
- package/es/error/errorDisplay/Web/ErrorMsg/index.js +27 -4
- package/es/error/errorDisplay/Web/Notification/index.js +22 -11
- package/es/rootConfig/mobile/BusiComp.js +1 -1
- package/es/rootConfig/mobile/MobileModal.js +1 -1
- package/es/rootConfig/mobile/MobilePopover.js +1 -1
- package/es/rootConfig/pc/BusiComp.js +1 -1
- package/es/rootConfig/pc/Drawer.js +1 -1
- package/es/rootConfig/pc/Modal.js +1 -1
- package/es/rootConfig/pc/Popover.js +1 -1
- package/es/rootConfig/todoActionList.js +1 -1
- package/es/rootConfig/todoOptionList.js +1 -1
- package/es/theme/bin/cucc/theme.js +275 -0
- package/es/theme/bin/cucc/theme.less +272 -0
- package/es/theme/bin/cucc/theme.scss +272 -0
- package/es/theme/bin/default/theme.js +275 -0
- package/es/theme/bin/default/theme.less +272 -0
- package/es/theme/bin/default/theme.scss +272 -0
- package/es/theme/build.js +42 -0
- package/es/theme/src/cucc/index.js +131 -0
- package/es/theme/src/default/index.js +131 -0
- package/es/theme/utils/colorPaletteMixin.js +59 -0
- package/es/theme/utils/px2Num.js +12 -0
- package/es/theme/utils/renderColors.js +16 -0
- package/lib/IconSvg/index.d.ts +6 -0
- package/lib/IconSvg/index.js +30 -0
- package/lib/dealDsl/PropType.d.ts +7 -0
- package/lib/dealDsl/PropType.js +5 -0
- package/lib/dealDsl/events/actionObj.d.ts +3 -0
- package/lib/dealDsl/events/actionObj.js +13 -0
- package/lib/dealDsl/events/index.d.ts +6 -0
- package/lib/dealDsl/events/index.js +21 -0
- package/lib/dealDsl/index.d.ts +2 -0
- package/lib/dealDsl/index.js +31 -0
- package/lib/dealDsl/preprocess/common.d.ts +9 -0
- package/lib/dealDsl/preprocess/common.js +277 -0
- package/lib/dealDsl/preprocess/editor.d.ts +9 -0
- package/lib/dealDsl/preprocess/editor.js +28 -0
- package/lib/dealDsl/preprocess/engine.d.ts +9 -0
- package/lib/dealDsl/preprocess/engine.js +26 -0
- package/lib/dealDsl/preprocessDSL.d.ts +21 -0
- package/lib/dealDsl/preprocessDSL.js +88 -0
- package/lib/dealDsl/utils/index.d.ts +13 -0
- package/lib/dealDsl/utils/index.js +29 -0
- package/lib/error/errorCatch/index.js +48 -0
- package/lib/error/errorDisplay/Mobile/Drawer/Drawer.js +115 -0
- package/lib/error/errorDisplay/Mobile/Drawer/Drawer.less +201 -0
- package/lib/error/errorDisplay/Mobile/Drawer/index.js +140 -0
- package/lib/error/errorDisplay/Mobile/ErrorMsg/index.js +207 -0
- package/lib/error/errorDisplay/Mobile/Modal/Modal.js +53 -0
- package/lib/error/errorDisplay/Mobile/Modal/Modal.less +146 -0
- package/lib/error/errorDisplay/Mobile/Modal/index.js +127 -0
- package/lib/error/errorDisplay/Mobile/defaultGlobalConfig.js +21 -0
- package/lib/error/errorDisplay/SVGstring.js +18 -0
- package/lib/error/errorDisplay/Web/Drawer/Drawer.js +274 -0
- package/lib/error/errorDisplay/Web/Drawer/Drawer.less +420 -0
- package/lib/error/errorDisplay/Web/Drawer/DrawerConnect.js +213 -0
- package/lib/error/errorDisplay/Web/Drawer/index.js +142 -0
- package/lib/error/errorDisplay/Web/ErrorMsg/index.js +301 -0
- package/lib/error/errorDisplay/Web/Notification/Notice.js +161 -0
- package/lib/error/errorDisplay/Web/Notification/Notification.js +149 -0
- package/lib/error/errorDisplay/Web/Notification/Notification.less +137 -0
- package/lib/error/errorDisplay/Web/Notification/index.js +104 -0
- package/lib/error/errorDisplay/Web/defaultGlobalConfig.js +29 -0
- package/lib/error/errorDisplay/animation.less +112 -0
- package/lib/error/errorDisplay/compUtils.js +52 -0
- package/lib/error/errorDisplay/const.js +83 -0
- package/lib/error/errorDisplay/http.js +103 -0
- package/lib/error/errorDisplay/variables.less +1 -0
- package/lib/error/index.js +34 -0
- package/lib/images/ico-back.png +0 -0
- package/lib/index.d.ts +9 -0
- package/lib/rootConfig/index.d.ts +5 -0
- package/lib/rootConfig/index.js +28 -0
- package/lib/rootConfig/mobile/BusiComp.d.ts +66 -0
- package/lib/rootConfig/mobile/BusiComp.js +88 -0
- package/lib/rootConfig/mobile/MobileModal.d.ts +114 -0
- package/lib/rootConfig/mobile/MobileModal.js +140 -0
- package/lib/rootConfig/mobile/MobilePopover.d.ts +81 -0
- package/lib/rootConfig/mobile/MobilePopover.js +89 -0
- package/lib/rootConfig/mobile/index.d.ts +4 -0
- package/lib/rootConfig/mobile/index.js +34 -0
- package/lib/rootConfig/mobile/page.d.ts +157 -0
- package/lib/rootConfig/mobile/page.js +161 -0
- package/lib/rootConfig/pc/BusiComp.d.ts +66 -0
- package/lib/rootConfig/pc/BusiComp.js +88 -0
- package/lib/rootConfig/pc/Drawer.d.ts +150 -0
- package/lib/rootConfig/pc/Drawer.js +203 -0
- package/lib/rootConfig/pc/Modal.d.ts +160 -0
- package/lib/rootConfig/pc/Modal.js +195 -0
- package/lib/rootConfig/pc/Popover.d.ts +90 -0
- package/lib/rootConfig/pc/Popover.js +104 -0
- package/lib/rootConfig/pc/index.d.ts +5 -0
- package/lib/rootConfig/pc/index.js +41 -0
- package/lib/rootConfig/pc/page.d.ts +146 -0
- package/lib/rootConfig/pc/page.js +153 -0
- package/lib/rootConfig/todoActionList.d.ts +3082 -0
- package/lib/rootConfig/todoActionList.js +3600 -0
- package/lib/rootConfig/todoOptionList.d.ts +1466 -0
- package/lib/rootConfig/todoOptionList.js +1685 -0
- package/lib/security/const.d.ts +22 -0
- package/lib/security/const.js +38 -0
- package/lib/security/encipher/aes.d.ts +2 -0
- package/lib/security/encipher/aes.js +35 -0
- package/lib/security/encipher/des.d.ts +2 -0
- package/lib/security/encipher/des.js +34 -0
- package/lib/security/encipher/rsa.d.ts +2 -0
- package/lib/security/encipher/rsa.js +26 -0
- package/lib/security/encipher/sign.d.ts +6 -0
- package/lib/security/encipher/sign.js +102 -0
- package/lib/security/fetch.d.ts +9 -0
- package/lib/security/fetch.js +212 -0
- package/lib/security/httpEncryption.js +83 -0
- package/lib/security/index.d.ts +39 -0
- package/lib/security/index.js +29 -0
- package/lib/svg/check.svg +10 -0
- package/lib/svg/normal-check.svg +10 -0
- package/lib/svg/webViewError.svg +40 -0
- package/lib/theme/bin/cucc/theme.js +277 -0
- package/lib/theme/bin/cucc/theme.less +272 -0
- package/lib/theme/bin/cucc/theme.scss +272 -0
- package/lib/theme/bin/default/theme.js +277 -0
- package/lib/theme/bin/default/theme.less +272 -0
- package/lib/theme/bin/default/theme.scss +272 -0
- package/lib/theme/build.js +44 -0
- package/lib/theme/src/cucc/index.js +133 -0
- package/lib/theme/src/default/index.js +133 -0
- package/lib/theme/utils/colorPaletteMixin.js +61 -0
- package/lib/theme/utils/px2Num.js +14 -0
- package/lib/theme/utils/renderColors.js +18 -0
- package/lib/utils/img.d.ts +1 -0
- package/lib/utils/img.js +10 -0
- package/lib/utils/url.d.ts +16 -0
- package/lib/utils/url.js +111 -0
- package/package.json +6 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var h5 = {
|
|
8
|
+
Button: function Button(component) {
|
|
9
|
+
return component;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var pc = {
|
|
13
|
+
Description: function Description(component) {
|
|
14
|
+
var descColumns = component.props.descColumns;
|
|
15
|
+
if (descColumns) {
|
|
16
|
+
delete component.props.descColumns;
|
|
17
|
+
}
|
|
18
|
+
return component;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 编辑器端
|
|
23
|
+
*/
|
|
24
|
+
var _default = {
|
|
25
|
+
h5: h5,
|
|
26
|
+
pc: pc
|
|
27
|
+
};
|
|
28
|
+
exports.default = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
// H5组件
|
|
8
|
+
var h5 = {
|
|
9
|
+
Button: function Button(component) {
|
|
10
|
+
return component;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
// PC端组件
|
|
14
|
+
var pc = {
|
|
15
|
+
Button: function Button(component) {
|
|
16
|
+
return component;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 运行态端
|
|
21
|
+
*/
|
|
22
|
+
var _default = {
|
|
23
|
+
h5: h5,
|
|
24
|
+
pc: pc
|
|
25
|
+
};
|
|
26
|
+
exports.default = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ContextType } from "./PropType";
|
|
2
|
+
/**
|
|
3
|
+
* 本方法只处理运行态和配置态公共属性.
|
|
4
|
+
* 如果需要修改单独特性属性,请使用preprocessEditorDSL或者preprocessEngineDSL
|
|
5
|
+
* @param component
|
|
6
|
+
* @param context
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const preprocessDSL: (component: Record<string, any>, context: ContextType) => Record<string, any>;
|
|
10
|
+
/**
|
|
11
|
+
* 预处理DSL数据, 本方法仅在编辑器端使用。 处理后数据的权重高于preprocessDSL。
|
|
12
|
+
* @param component 组件JSON数据
|
|
13
|
+
* @param context 上下文
|
|
14
|
+
*/
|
|
15
|
+
export declare const preprocessEditorDSL: (component: Record<string, any>, context: ContextType) => Record<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* 预处理DSL数据,本方法仅在运行态端使用。 处理后数据的权重高于preprocessDSL。
|
|
18
|
+
* @param component 组件JSON数据
|
|
19
|
+
* @param context 上下文
|
|
20
|
+
*/
|
|
21
|
+
export declare const preprocessEngineDSL: (component: Record<string, any>, context: ContextType) => Record<string, any>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.preprocessEngineDSL = exports.preprocessEditorDSL = exports.preprocessDSL = void 0;
|
|
7
|
+
var _common = _interopRequireDefault(require("./preprocess/common"));
|
|
8
|
+
var _editor = _interopRequireDefault(require("./preprocess/editor"));
|
|
9
|
+
var _engine = _interopRequireDefault(require("./preprocess/engine"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
/**
|
|
12
|
+
* 支持属性key通过 "compName|compName"模式
|
|
13
|
+
* @param compName
|
|
14
|
+
* @param obj
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
var collectionMethods = function collectionMethods(compName, obj) {
|
|
18
|
+
var funcs = [];
|
|
19
|
+
Object.keys(obj).forEach(function (key) {
|
|
20
|
+
var compNames = key.replace(/\s/g, '').split('|');
|
|
21
|
+
if (compNames.includes(compName)) {
|
|
22
|
+
funcs.push(obj[key]);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return funcs;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 本方法只处理运行态和配置态公共属性.
|
|
29
|
+
* 如果需要修改单独特性属性,请使用preprocessEditorDSL或者preprocessEngineDSL
|
|
30
|
+
* @param component
|
|
31
|
+
* @param context
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
var preprocessDSL = function preprocessDSL(component, context) {
|
|
35
|
+
var targetComponents = component;
|
|
36
|
+
var _ref = component || {},
|
|
37
|
+
compName = _ref.compName;
|
|
38
|
+
var _context$isMobile = context.isMobile,
|
|
39
|
+
isMobile = _context$isMobile === void 0 ? false : _context$isMobile;
|
|
40
|
+
var platform = isMobile ? 'h5' : 'pc';
|
|
41
|
+
var methods = collectionMethods(compName, _common.default === null || _common.default === void 0 ? void 0 : _common.default[platform]);
|
|
42
|
+
methods.forEach(function (fn) {
|
|
43
|
+
var _fn;
|
|
44
|
+
targetComponents = (_fn = fn(targetComponents)) !== null && _fn !== void 0 ? _fn : targetComponents;
|
|
45
|
+
});
|
|
46
|
+
return targetComponents;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 预处理DSL数据, 本方法仅在编辑器端使用。 处理后数据的权重高于preprocessDSL。
|
|
50
|
+
* @param component 组件JSON数据
|
|
51
|
+
* @param context 上下文
|
|
52
|
+
*/
|
|
53
|
+
exports.preprocessDSL = preprocessDSL;
|
|
54
|
+
var preprocessEditorDSL = function preprocessEditorDSL(component, context) {
|
|
55
|
+
var targetComponents = component;
|
|
56
|
+
var _ref2 = component || {},
|
|
57
|
+
compName = _ref2.compName;
|
|
58
|
+
var _context$isMobile2 = context.isMobile,
|
|
59
|
+
isMobile = _context$isMobile2 === void 0 ? false : _context$isMobile2;
|
|
60
|
+
var platform = isMobile ? 'h5' : 'pc';
|
|
61
|
+
var methods = collectionMethods(compName, _editor.default === null || _editor.default === void 0 ? void 0 : _editor.default[platform]);
|
|
62
|
+
methods.forEach(function (fn) {
|
|
63
|
+
var _fn2;
|
|
64
|
+
targetComponents = (_fn2 = fn(targetComponents)) !== null && _fn2 !== void 0 ? _fn2 : targetComponents;
|
|
65
|
+
});
|
|
66
|
+
return targetComponents;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* 预处理DSL数据,本方法仅在运行态端使用。 处理后数据的权重高于preprocessDSL。
|
|
70
|
+
* @param component 组件JSON数据
|
|
71
|
+
* @param context 上下文
|
|
72
|
+
*/
|
|
73
|
+
exports.preprocessEditorDSL = preprocessEditorDSL;
|
|
74
|
+
var preprocessEngineDSL = function preprocessEngineDSL(component, context) {
|
|
75
|
+
var targetComponents = component;
|
|
76
|
+
var _ref3 = component || {},
|
|
77
|
+
compName = _ref3.compName;
|
|
78
|
+
var _context$isMobile3 = context.isMobile,
|
|
79
|
+
isMobile = _context$isMobile3 === void 0 ? false : _context$isMobile3;
|
|
80
|
+
var platform = isMobile ? 'h5' : 'pc';
|
|
81
|
+
var methods = collectionMethods(compName, _engine.default === null || _engine.default === void 0 ? void 0 : _engine.default[platform]);
|
|
82
|
+
methods.forEach(function (fn) {
|
|
83
|
+
var _fn3;
|
|
84
|
+
targetComponents = (_fn3 = fn(targetComponents)) !== null && _fn3 !== void 0 ? _fn3 : targetComponents;
|
|
85
|
+
});
|
|
86
|
+
return targetComponents;
|
|
87
|
+
};
|
|
88
|
+
exports.preprocessEngineDSL = preprocessEngineDSL;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 是否包含某属性,或的关系。 包含`propertyNames`中的一个值即可
|
|
3
|
+
* @param target
|
|
4
|
+
* @param propertyNames
|
|
5
|
+
*/
|
|
6
|
+
export declare const hasSomeOwnProperty: (target: Object, propertyNames: string[]) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 是否包含某属性,且的关系。 必须包含`propertyNames`中的所有属性
|
|
9
|
+
* @param target
|
|
10
|
+
* @param propertyNames
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasEveryOwnProperty: (target: Object, propertyNames: string[]) => boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasSomeOwnProperty = exports.hasEveryOwnProperty = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* 是否包含某属性,或的关系。 包含`propertyNames`中的一个值即可
|
|
9
|
+
* @param target
|
|
10
|
+
* @param propertyNames
|
|
11
|
+
*/
|
|
12
|
+
var hasSomeOwnProperty = function hasSomeOwnProperty(target, propertyNames) {
|
|
13
|
+
return propertyNames.some(function (property) {
|
|
14
|
+
return target.hasOwnProperty(property);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 是否包含某属性,且的关系。 必须包含`propertyNames`中的所有属性
|
|
19
|
+
* @param target
|
|
20
|
+
* @param propertyNames
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
exports.hasSomeOwnProperty = hasSomeOwnProperty;
|
|
24
|
+
var hasEveryOwnProperty = function hasEveryOwnProperty(target, propertyNames) {
|
|
25
|
+
return propertyNames.every(function (property) {
|
|
26
|
+
return target.hasOwnProperty(property);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.hasEveryOwnProperty = hasEveryOwnProperty;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ErrorMsg = _interopRequireDefault(require("../errorDisplay/Web/ErrorMsg"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
// TODO
|
|
10
|
+
|
|
11
|
+
var errorDisplayComp = _ErrorMsg.default;
|
|
12
|
+
var info = {};
|
|
13
|
+
// eslint-disable-next-line
|
|
14
|
+
var errorHandler = function errorHandler(msg, url, row, col, error) {
|
|
15
|
+
errorDisplayComp.open({
|
|
16
|
+
code: "02-".concat(info.code, "-1-000-00000"),
|
|
17
|
+
msg: "\u7A0B\u5E8F\u53D1\u751F\u5F02\u5E38: ".concat(msg),
|
|
18
|
+
stack: error
|
|
19
|
+
});
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
var rejectHandler = function rejectHandler(e) {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
// errorDisplayComp.open({
|
|
25
|
+
// code: `02-${info.code}-1-000-00000`,
|
|
26
|
+
// msg: `程序发生异常: ${msg}`,
|
|
27
|
+
// stack: error,
|
|
28
|
+
// });
|
|
29
|
+
return true;
|
|
30
|
+
};
|
|
31
|
+
var start = function start(_ref) {
|
|
32
|
+
var errorDisplay = _ref.errorDisplay,
|
|
33
|
+
_ref$projectInfo = _ref.projectInfo,
|
|
34
|
+
projectInfo = _ref$projectInfo === void 0 ? {} : _ref$projectInfo;
|
|
35
|
+
if (errorDisplay) errorDisplayComp = errorDisplay;
|
|
36
|
+
info = projectInfo;
|
|
37
|
+
window.addEventListener('error', errorHandler, true);
|
|
38
|
+
window.addEventListener('unhandledrejection', rejectHandler);
|
|
39
|
+
};
|
|
40
|
+
var stop = function stop() {
|
|
41
|
+
window.removeEventListener('error', errorHandler);
|
|
42
|
+
window.removeEventListener('unhandledrejection', rejectHandler);
|
|
43
|
+
};
|
|
44
|
+
var _default = {
|
|
45
|
+
start: start,
|
|
46
|
+
stop: stop
|
|
47
|
+
};
|
|
48
|
+
exports.default = _default;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _SVGstring = require("../../SVGstring");
|
|
11
|
+
var _img = require("../../../../utils/img");
|
|
12
|
+
require("./Drawer.less");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
var isDomEle = function isDomEle(target) {
|
|
17
|
+
return typeof target === 'string' || /*#__PURE__*/(0, _react.isValidElement)(target);
|
|
18
|
+
};
|
|
19
|
+
var emptyTxt = '暂无匹配信息,请联系平台管理员';
|
|
20
|
+
var Drawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
21
|
+
var visible = props.visible,
|
|
22
|
+
title = props.title,
|
|
23
|
+
tabs = props.tabs,
|
|
24
|
+
activeTabsKey = props.activeTabsKey,
|
|
25
|
+
onTabsChange = props.onTabsChange,
|
|
26
|
+
dataSource = props.dataSource,
|
|
27
|
+
onCancel = props.onCancel,
|
|
28
|
+
onClickRecord = props.onClickRecord,
|
|
29
|
+
_props$mode = props.mode,
|
|
30
|
+
mode = _props$mode === void 0 ? 'content' : _props$mode;
|
|
31
|
+
var renderItems = function renderItems() {
|
|
32
|
+
if (Array.isArray(dataSource) && dataSource.length > 0) {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: "lxm-drawer-list"
|
|
35
|
+
}, dataSource.map(function (item) {
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
+
key: item === null || item === void 0 ? void 0 : item.key,
|
|
38
|
+
className: (0, _classnames.default)('lxm-drawer-list-item', item === null || item === void 0 ? void 0 : item.status),
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
onClickRecord(item);
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
+
className: "lxm-drawer-list-item-dt"
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
className: "lxm-drawer-list-item-dt-title"
|
|
46
|
+
}, (item === null || item === void 0 ? void 0 : item.title) || ''), (item === null || item === void 0 ? void 0 : item.extra) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
className: "lxm-drawer-list-item-dt-extra"
|
|
48
|
+
}, item === null || item === void 0 ? void 0 : item.extra) : ''), /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
className: "lxm-drawer-list-item-dd"
|
|
50
|
+
}, (item === null || item === void 0 ? void 0 : item.content) || ''));
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
className: "lxm-drawer-empty"
|
|
55
|
+
}, "\u6682\u65E0\u6570\u636E");
|
|
56
|
+
};
|
|
57
|
+
var renderContent = function renderContent() {
|
|
58
|
+
if (dataSource && ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.author) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.content))) {
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
className: "lxm-drawer-content"
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: "lxm-drawer-content-head"
|
|
63
|
+
}, isDomEle(dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
className: "lxm-drawer-content-head-title"
|
|
65
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) : '', isDomEle(dataSource === null || dataSource === void 0 ? void 0 : dataSource.author) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
className: "lxm-drawer-content-head-author"
|
|
67
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.author) : ''), /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
className: "lxm-drawer-content-body"
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
// eslint-disable-next-line react/no-danger
|
|
71
|
+
dangerouslySetInnerHTML: {
|
|
72
|
+
__html: dataSource === null || dataSource === void 0 ? void 0 : dataSource.content
|
|
73
|
+
}
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "lxm-drawer-empty"
|
|
78
|
+
}, emptyTxt);
|
|
79
|
+
};
|
|
80
|
+
return visible ? /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
+
ref: ref,
|
|
82
|
+
className: "lxm-drawer-wraper"
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
+
className: "lxm-drawer-container"
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
className: "lxm-drawer-header"
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
className: "lxm-drawer-header-extend",
|
|
89
|
+
onClick: onCancel
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
91
|
+
src: (0, _img.getSvgImageBase64)(_SVGstring.BackIcon),
|
|
92
|
+
alt: "",
|
|
93
|
+
className: "lxm-drawer-header-close"
|
|
94
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
className: "lxm-drawer-header-title"
|
|
96
|
+
}, isDomEle(title) ? title : ''), /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
className: "lxm-drawer-header-extend"
|
|
98
|
+
})), Array.isArray(tabs) && tabs.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: "lxm-drawer-tabs"
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
className: "lxm-drawer-tabs-row"
|
|
102
|
+
}, tabs.map(function (item) {
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
+
className: (0, _classnames.default)('lxm-drawer-tabs-btn', activeTabsKey === (item === null || item === void 0 ? void 0 : item.key) ? 'active' : ''),
|
|
105
|
+
key: item === null || item === void 0 ? void 0 : item.key,
|
|
106
|
+
onClick: function onClick() {
|
|
107
|
+
onTabsChange(item);
|
|
108
|
+
}
|
|
109
|
+
}, item.tab);
|
|
110
|
+
}))) : '', /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: "lxm-drawer-main"
|
|
112
|
+
}, mode === 'list' ? renderItems() : renderContent()))) : '';
|
|
113
|
+
});
|
|
114
|
+
var _default = Drawer;
|
|
115
|
+
exports.default = _default;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
@import url('../../animation.less');
|
|
2
|
+
@import url('../../variables.less');
|
|
3
|
+
|
|
4
|
+
.lxm-drawer {
|
|
5
|
+
&-wraper {
|
|
6
|
+
position: absolute;
|
|
7
|
+
left: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
top: 0;
|
|
11
|
+
z-index: 9999;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-close-move &-container {
|
|
16
|
+
animation: lxmDrawerClose 0.3s;
|
|
17
|
+
animation-fill-mode: forwards;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-container {
|
|
21
|
+
position: relative;
|
|
22
|
+
height: 100%;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
background-color: #fff;
|
|
27
|
+
animation: lxmDrawerOpen 0.3s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-header {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
height: 44 * @hd;
|
|
34
|
+
background-color: #f6f8fa;
|
|
35
|
+
|
|
36
|
+
&-close {
|
|
37
|
+
width: 24 * @hd;
|
|
38
|
+
height: 24 * @hd;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
vertical-align: middle;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-extend {
|
|
45
|
+
width: 80 * @hd;
|
|
46
|
+
padding: 0 20* @hd;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&-title {
|
|
50
|
+
flex: 1;
|
|
51
|
+
text-align: center;
|
|
52
|
+
font-size: 18* @hd;
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
color: #1c242e;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&-tabs {
|
|
62
|
+
padding: 8* @hd 20* @hd;
|
|
63
|
+
background-color: #f6f8fa;
|
|
64
|
+
|
|
65
|
+
&-row {
|
|
66
|
+
background: #f0f0f0;
|
|
67
|
+
border-radius: 8* @hd;
|
|
68
|
+
padding: 4* @hd;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-row &-btn {
|
|
74
|
+
color: #1c242e;
|
|
75
|
+
text-align: center;
|
|
76
|
+
padding: 4* @hd;
|
|
77
|
+
font-size: 14* @hd;
|
|
78
|
+
flex: 1;
|
|
79
|
+
border-radius: 8* @hd;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&-row &-btn.active {
|
|
84
|
+
background-color: #fff;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
box-shadow: 0 1* @hd 6* @hd -4* @hd rgba(28, 36, 46, 0.15);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-main {
|
|
91
|
+
border-top: 1px solid #f0f0f0;
|
|
92
|
+
flex: 1;
|
|
93
|
+
background-color: #fff;
|
|
94
|
+
overflow-y: auto;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-content {
|
|
98
|
+
padding: 20* @hd;
|
|
99
|
+
|
|
100
|
+
&-head {
|
|
101
|
+
margin-bottom: 20* @hd;
|
|
102
|
+
|
|
103
|
+
&-title {
|
|
104
|
+
font-size: 21* @hd;
|
|
105
|
+
font-weight: 500;
|
|
106
|
+
color: #1c242e;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-author {
|
|
110
|
+
font-size: 13* @hd;
|
|
111
|
+
color: rgba(28, 36, 46, 0.45);;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&-body {
|
|
116
|
+
font-size: 15* @hd;
|
|
117
|
+
color: rgba(28, 36, 46, 0.75);
|
|
118
|
+
|
|
119
|
+
// 内置文章样式
|
|
120
|
+
dt {
|
|
121
|
+
font-size: 17* @hd;
|
|
122
|
+
font-weight: 500;
|
|
123
|
+
margin-top: 30* @hd;
|
|
124
|
+
}
|
|
125
|
+
dd {
|
|
126
|
+
padding: 8* @hd 0;
|
|
127
|
+
margin: 0;
|
|
128
|
+
font-size: 15* @hd;
|
|
129
|
+
}
|
|
130
|
+
ol, ul {
|
|
131
|
+
padding: 0;
|
|
132
|
+
margin: 0;
|
|
133
|
+
}
|
|
134
|
+
ol, ul {
|
|
135
|
+
list-style: inside inside;
|
|
136
|
+
}
|
|
137
|
+
li, p {
|
|
138
|
+
line-height: 24* @hd;
|
|
139
|
+
letter-spacing: 1px;
|
|
140
|
+
margin: 4* @hd 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&-list {
|
|
146
|
+
padding: 0 20* @hd;
|
|
147
|
+
|
|
148
|
+
&-item {
|
|
149
|
+
padding: 8* @hd 0;
|
|
150
|
+
border-bottom: 1px solid #f0f0f0;
|
|
151
|
+
|
|
152
|
+
&.purple &-dt {
|
|
153
|
+
&-title {
|
|
154
|
+
color: #9747ff;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.blue &-dt {
|
|
159
|
+
&-title {
|
|
160
|
+
color: #47e;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&.red &-dt {
|
|
165
|
+
&-title {
|
|
166
|
+
color: #fa7570;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&-dt {
|
|
171
|
+
display: flex;
|
|
172
|
+
|
|
173
|
+
&-title {
|
|
174
|
+
flex: 1;
|
|
175
|
+
font-size: 14* @hd;
|
|
176
|
+
font-weight: 500;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&-extra {
|
|
180
|
+
font-size: 12* @hd;
|
|
181
|
+
color: rgba(28, 36, 46, 0.45);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&-title + &-extra {
|
|
185
|
+
margin-left: 8* @hd;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&-dd {
|
|
190
|
+
font-size: 12* @hd;
|
|
191
|
+
color: rgba(28, 36, 46, 0.75);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&-empty {
|
|
197
|
+
padding: 20* @hd;
|
|
198
|
+
text-align: center;
|
|
199
|
+
color: rgba(28, 36, 46, 0.45);
|
|
200
|
+
}
|
|
201
|
+
}
|