fan-standard-comp 4.1.21 → 4.1.23
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/dist/fan-standard-comp.min.css +1 -1
- package/dist/fan-standard-comp.min.js +1 -1
- package/es/FormComp/FieldComponent/RefactorTreeSelect.d.ts +4 -0
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +82 -156
- package/es/FormComp/FieldComponent/style/TreeSelect.js +7 -5
- package/es/RefactorTree/index.js +13 -8
- package/es/RefactorTree/style/index.js +29 -1
- package/es/RefactorTree/util.d.ts +3 -2
- package/es/RefactorTree/util.js +51 -9
- package/es/StandardContent/SideCard.d.ts +15 -0
- package/es/StandardContent/SideCard.js +67 -0
- package/es/StandardContent/SubfieldContent.js +10 -5
- package/es/StandardContent/styles/SideCard.d.ts +6 -0
- package/es/StandardContent/styles/SideCard.js +98 -0
- package/es/StandardPanel/index.d.ts +10 -0
- package/es/StandardPanel/index.js +61 -18
- package/es/StandardPanel/style/index.js +24 -5
- package/es/StandardPanel/style/index.less +26 -26
- package/es/StandardTitle/index.d.ts +16 -0
- package/es/StandardTitle/index.js +59 -0
- package/es/StandardTitle/styles/index.d.ts +6 -0
- package/es/StandardTitle/styles/index.js +57 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/utils/getParentNodes.d.ts +10 -0
- package/es/utils/getParentNodes.js +41 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.d.ts +4 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +81 -155
- package/lib/FormComp/FieldComponent/style/TreeSelect.js +7 -5
- package/lib/RefactorTree/index.js +13 -8
- package/lib/RefactorTree/style/index.js +29 -1
- package/lib/RefactorTree/util.d.ts +3 -2
- package/lib/RefactorTree/util.js +52 -12
- package/lib/StandardContent/SideCard.d.ts +15 -0
- package/lib/StandardContent/SideCard.js +76 -0
- package/lib/StandardContent/SubfieldContent.js +10 -5
- package/lib/StandardContent/styles/SideCard.d.ts +6 -0
- package/lib/StandardContent/styles/SideCard.js +104 -0
- package/lib/StandardPanel/index.d.ts +10 -0
- package/lib/StandardPanel/index.js +61 -18
- package/lib/StandardPanel/style/index.js +24 -5
- package/lib/StandardPanel/style/index.less +26 -26
- package/lib/StandardTitle/index.d.ts +16 -0
- package/lib/StandardTitle/index.js +68 -0
- package/lib/StandardTitle/styles/index.d.ts +6 -0
- package/lib/StandardTitle/styles/index.js +63 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +16 -0
- package/lib/utils/getParentNodes.d.ts +10 -0
- package/lib/utils/getParentNodes.js +42 -1
- package/package.json +1 -1
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
//border-radius: 4px;
|
|
6
6
|
//box-shadow: @spec-box-shadow;
|
|
7
7
|
&.spec-panel-border {
|
|
8
|
-
box-shadow: none;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
8
|
+
//box-shadow: none;
|
|
9
|
+
//.spec-panel-header {
|
|
10
|
+
// height: 32px;
|
|
11
|
+
// padding:0;
|
|
12
|
+
// line-height: 32px;
|
|
13
|
+
// .spec-panel-title {
|
|
14
|
+
// width: 100%;
|
|
15
|
+
// padding: 0;
|
|
16
|
+
// }
|
|
17
|
+
//}
|
|
18
18
|
.spec-panel-body {
|
|
19
19
|
//padding: @padding-md;
|
|
20
20
|
}
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
&.spec-panel-reverse {
|
|
23
23
|
.spec-panel-header {
|
|
24
24
|
//padding:0 @padding-md;
|
|
25
|
-
height: 32px;
|
|
26
|
-
line-height: 32px;
|
|
27
|
-
|
|
28
|
-
border-top-left-radius: 4px;
|
|
29
|
-
border-top-right-radius: 4px;
|
|
25
|
+
//height: 32px;
|
|
26
|
+
//line-height: 32px;
|
|
27
|
+
////background: @table-header-bg;
|
|
28
|
+
//border-top-left-radius: 4px;
|
|
29
|
+
//border-top-right-radius: 4px;
|
|
30
30
|
}
|
|
31
31
|
.spec-panel-body {
|
|
32
32
|
//padding: @padding-md;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
.spec-panel-header {
|
|
41
41
|
display: flex;
|
|
42
42
|
//padding: 12px @padding-md;
|
|
43
|
-
line-height: 32px;
|
|
43
|
+
//line-height: 32px;
|
|
44
44
|
.spec-panel-title {
|
|
45
45
|
//padding-right: @padding-md
|
|
46
46
|
}
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
}
|
|
50
50
|
.badges {
|
|
51
51
|
display: inline-block;
|
|
52
|
-
height: 20px;
|
|
53
|
-
|
|
54
|
-
padding-left: 80px;
|
|
55
|
-
line-height: 20px;
|
|
52
|
+
//height: 20px;
|
|
53
|
+
////margin-top: 6px;
|
|
54
|
+
//padding-left: 80px;
|
|
55
|
+
//line-height: 20px;
|
|
56
56
|
vertical-align: middle;
|
|
57
57
|
.badges-item {
|
|
58
58
|
position: relative;
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
//min-width: 68px;
|
|
77
77
|
//margin-left: @padding-sm;
|
|
78
78
|
text-align: center;
|
|
79
|
-
border: 0;
|
|
80
|
-
border-bottom: 2px solid transparent;
|
|
81
|
-
border-radius: 0;
|
|
79
|
+
//border: 0;
|
|
80
|
+
//border-bottom: 2px solid transparent;
|
|
81
|
+
//border-radius: 0;
|
|
82
82
|
&::before {
|
|
83
83
|
display: none;
|
|
84
84
|
}
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){
|
|
95
95
|
//color:@primary-color;
|
|
96
96
|
//border-color: @primary-color;
|
|
97
|
-
background: none;
|
|
98
|
-
box-shadow: none;
|
|
97
|
+
//background: none;
|
|
98
|
+
//box-shadow: none;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
+ .spec-panel-buttons {
|
|
102
|
-
margin-left: 80px;
|
|
102
|
+
//margin-left: 80px;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
.spec-panel-buttons {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface titleContentType {
|
|
3
|
+
content?: React.ReactNode;
|
|
4
|
+
[k: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface StandardTitleType {
|
|
7
|
+
title?: titleContentType | React.ReactNode | any;
|
|
8
|
+
extra?: string | React.ReactNode;
|
|
9
|
+
children?: string | React.ReactNode;
|
|
10
|
+
mark?: string;
|
|
11
|
+
style?: any;
|
|
12
|
+
className?: string;
|
|
13
|
+
[k: string]: any;
|
|
14
|
+
}
|
|
15
|
+
declare const StandardTitle: React.ForwardRefExoticComponent<Omit<StandardTitleType, "ref"> & React.RefAttributes<unknown>>;
|
|
16
|
+
export default StandardTitle;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _index = _interopRequireDefault(require("./styles/index"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _ConfigContext = require("../ConfigContext");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
20
|
+
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); }
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
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; }
|
|
25
|
+
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; } }
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
var StandardTitle = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
28
|
+
var InitFanContext = (0, _react.useContext)(_ConfigContext.FanContext);
|
|
29
|
+
var providerConfig = InitFanContext['StandardTitle'] || {}; // 使用上下文(全局配置)设置扩展的配置项
|
|
30
|
+
// const proLayoutProps = InitFanContext['proLayoutProps'] || {}
|
|
31
|
+
var componentName = 'spec-standard-title';
|
|
32
|
+
var _useStyle = (0, _index.default)(componentName),
|
|
33
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
34
|
+
wrapSSR = _useStyle2[0],
|
|
35
|
+
hashId = _useStyle2[1];
|
|
36
|
+
var _providerConfig$props = _objectSpread(_objectSpread({}, providerConfig), props),
|
|
37
|
+
title = _providerConfig$props.title,
|
|
38
|
+
className = _providerConfig$props.className,
|
|
39
|
+
style = _providerConfig$props.style,
|
|
40
|
+
children = _providerConfig$props.children,
|
|
41
|
+
extra = _providerConfig$props.extra,
|
|
42
|
+
mark = _providerConfig$props.mark;
|
|
43
|
+
var contentRef = (0, _react.useRef)();
|
|
44
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
45
|
+
return contentRef === null || contentRef === void 0 ? void 0 : contentRef.current;
|
|
46
|
+
});
|
|
47
|
+
// 是否显示提示框
|
|
48
|
+
var popoverShow = function popoverShow() {
|
|
49
|
+
return title !== null && title !== void 0 && title.content ? /*#__PURE__*/_react.default.createElement(_antd.Popover, {
|
|
50
|
+
content: title.content,
|
|
51
|
+
placement: title === null || title === void 0 ? void 0 : title.placement
|
|
52
|
+
}, " ", title === null || title === void 0 ? void 0 : title.label, " ") : title;
|
|
53
|
+
};
|
|
54
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
+
className: (0, _classnames.default)(componentName, className, hashId),
|
|
56
|
+
style: style,
|
|
57
|
+
ref: contentRef
|
|
58
|
+
}, mark && /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: (0, _classnames.default)('spec-standard-title-mark', mark && mark === 'ring' ? 'spec-standard-title-mark-ring' : '', mark && mark === 'bar' ? 'spec-standard-title-mark-bar' : '')
|
|
60
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: 'spec-standard-title-base'
|
|
62
|
+
}, popoverShow()), /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
className: 'spec-standard-title-middle'
|
|
64
|
+
}, children), extra && /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
className: 'spec-standard-title-extra'
|
|
66
|
+
}, extra)));
|
|
67
|
+
});
|
|
68
|
+
var _default = exports.default = StandardTitle;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _genStyleHook = require("../../theme/utils/genStyleHook");
|
|
8
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
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); }
|
|
12
|
+
var SideCardStyleFunc = function SideCardStyleFunc(prefix) {
|
|
13
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
14
|
+
return {
|
|
15
|
+
// fontWeight: 400,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
19
|
+
var prefixCls = ".".concat(prefix);
|
|
20
|
+
// console.log(' new TinyColor(token.colorPrimary).setAlpha(0.1)' ,new TinyColor(token.colorPrimary).setAlpha(0.1).toRgbString(), )
|
|
21
|
+
return [_defineProperty({}, prefixCls, {
|
|
22
|
+
width: '100%',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
padding: "".concat(token.paddingXS, "px 0"),
|
|
27
|
+
'.spec-standard-title-mark-bar, .spec-standard-title-mark-ring': {
|
|
28
|
+
content: '""',
|
|
29
|
+
display: 'inline-flex',
|
|
30
|
+
marginRight: "".concat(token.marginXS, "px")
|
|
31
|
+
},
|
|
32
|
+
'.spec-standard-title-mark-bar': {
|
|
33
|
+
width: '3px',
|
|
34
|
+
height: '14px',
|
|
35
|
+
backgroundColor: token.colorPrimary
|
|
36
|
+
},
|
|
37
|
+
'.spec-standard-title-mark-ring': {
|
|
38
|
+
width: '12px',
|
|
39
|
+
height: '12px',
|
|
40
|
+
boxSizing: 'border-box',
|
|
41
|
+
borderRadius: '50%',
|
|
42
|
+
border: "3px solid ".concat(token.colorPrimary),
|
|
43
|
+
backgroundColor: '#fff'
|
|
44
|
+
},
|
|
45
|
+
'.spec-standard-title-base': {
|
|
46
|
+
overflow: 'hidden',
|
|
47
|
+
textOverflow: 'ellipsis',
|
|
48
|
+
whiteSpace: 'nowrap',
|
|
49
|
+
fontSize: token.fontSizeLG,
|
|
50
|
+
fontWeight: 'normal'
|
|
51
|
+
},
|
|
52
|
+
'.spec-standard-title-middle': {
|
|
53
|
+
flex: 1,
|
|
54
|
+
marginLeft: "".concat(token.marginXS, "px"),
|
|
55
|
+
marginRight: "".concat(token.marginXS, "px")
|
|
56
|
+
},
|
|
57
|
+
'.spec-standard-title-middle + .spec-standard-title-extra': {},
|
|
58
|
+
'.spec-standard-title-base + .spec-standard-title-middle': {}
|
|
59
|
+
})];
|
|
60
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
var _default = exports.default = SideCardStyleFunc;
|
package/lib/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { default as Field } from './FormComp/FieldComponent';
|
|
|
23
23
|
export { default as RenderItemGroup } from './FormComp/RenderItemGroup';
|
|
24
24
|
export { default as ItemGroup } from './FormComp/RenderItemGroup';
|
|
25
25
|
export { default as StandardDrawer } from './StandardDrawer';
|
|
26
|
+
export { default as SideCard } from './StandardContent/SideCard';
|
|
27
|
+
export { default as StandardTitle } from './StandardTitle';
|
|
26
28
|
export * from './components';
|
|
27
29
|
export * from './utils';
|
|
28
30
|
export * from './data';
|
package/lib/index.js
CHANGED
|
@@ -29,6 +29,8 @@ var _exportNames = {
|
|
|
29
29
|
RenderItemGroup: true,
|
|
30
30
|
ItemGroup: true,
|
|
31
31
|
StandardDrawer: true,
|
|
32
|
+
SideCard: true,
|
|
33
|
+
StandardTitle: true,
|
|
32
34
|
ImageGallery: true,
|
|
33
35
|
ImagePreview: true
|
|
34
36
|
};
|
|
@@ -98,6 +100,12 @@ Object.defineProperty(exports, "RenderItemGroup", {
|
|
|
98
100
|
return _RenderItemGroup.default;
|
|
99
101
|
}
|
|
100
102
|
});
|
|
103
|
+
Object.defineProperty(exports, "SideCard", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function get() {
|
|
106
|
+
return _SideCard.default;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
101
109
|
Object.defineProperty(exports, "SpecIcon", {
|
|
102
110
|
enumerable: true,
|
|
103
111
|
get: function get() {
|
|
@@ -158,6 +166,12 @@ Object.defineProperty(exports, "StandardTablePro", {
|
|
|
158
166
|
return _StandardTablePro.default;
|
|
159
167
|
}
|
|
160
168
|
});
|
|
169
|
+
Object.defineProperty(exports, "StandardTitle", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function get() {
|
|
172
|
+
return _StandardTitle.default;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
161
175
|
Object.defineProperty(exports, "StepForm", {
|
|
162
176
|
enumerable: true,
|
|
163
177
|
get: function get() {
|
|
@@ -217,6 +231,8 @@ var _EditButton = _interopRequireDefault(require("./FormComp/EditButton"));
|
|
|
217
231
|
var _FieldComponent = _interopRequireDefault(require("./FormComp/FieldComponent"));
|
|
218
232
|
var _RenderItemGroup = _interopRequireDefault(require("./FormComp/RenderItemGroup"));
|
|
219
233
|
var _StandardDrawer = _interopRequireDefault(require("./StandardDrawer"));
|
|
234
|
+
var _SideCard = _interopRequireDefault(require("./StandardContent/SideCard"));
|
|
235
|
+
var _StandardTitle = _interopRequireDefault(require("./StandardTitle"));
|
|
220
236
|
var _components = require("./components");
|
|
221
237
|
Object.keys(_components).forEach(function (key) {
|
|
222
238
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -97,3 +97,13 @@ export declare const filterTreeNodes: (list: any[], nodeKey: string | number, pa
|
|
|
97
97
|
childrenParam: string;
|
|
98
98
|
keyParam: string;
|
|
99
99
|
}) => any;
|
|
100
|
+
/**
|
|
101
|
+
* @param {Array} data 树数组数据
|
|
102
|
+
* @param {Number} level 起始层级序号
|
|
103
|
+
* @param {Number} level 起始层级序号
|
|
104
|
+
* @param {Array} parentIndexPath 父级序号集合
|
|
105
|
+
* @param {Array} parentNamePath 父级名称集合
|
|
106
|
+
* @param {Object} optionName 指定字段名 {children: '', label: '', title: '', name: ''}
|
|
107
|
+
* @param {Object} extra 扩展配置 {separator: '/'}
|
|
108
|
+
* */
|
|
109
|
+
export declare const addTreeLevels: (data: any, level: number | undefined, parentIndexPath: never[] | undefined, parentNamePath: never[] | undefined, optionName: any, extra: any) => any[];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getParentNodes = exports.getNodePaths = exports.getNode = exports.getChildrenNodes = exports.filterTreeNodes = exports.convertToArray = exports.arrayToTree = void 0;
|
|
6
|
+
exports.getParentNodes = exports.getNodePaths = exports.getNode = exports.getChildrenNodes = exports.filterTreeNodes = exports.convertToArray = exports.arrayToTree = exports.addTreeLevels = void 0;
|
|
7
7
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
9
|
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."); }
|
|
@@ -349,4 +349,45 @@ var filterTreeNodes = exports.filterTreeNodes = function filterTreeNodes(list, n
|
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
351
|
return result;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// 给节点每个层级加上level,并且将当前节点完整的路径序号值拼接起来
|
|
355
|
+
/**
|
|
356
|
+
* @param {Array} data 树数组数据
|
|
357
|
+
* @param {Number} level 起始层级序号
|
|
358
|
+
* @param {Number} level 起始层级序号
|
|
359
|
+
* @param {Array} parentIndexPath 父级序号集合
|
|
360
|
+
* @param {Array} parentNamePath 父级名称集合
|
|
361
|
+
* @param {Object} optionName 指定字段名 {children: '', label: '', title: '', name: ''}
|
|
362
|
+
* @param {Object} extra 扩展配置 {separator: '/'}
|
|
363
|
+
* */
|
|
364
|
+
var addTreeLevels = exports.addTreeLevels = function addTreeLevels(data) {
|
|
365
|
+
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
366
|
+
var parentIndexPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
367
|
+
var parentNamePath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
368
|
+
var optionName = arguments.length > 4 ? arguments[4] : undefined;
|
|
369
|
+
var extra = arguments.length > 5 ? arguments[5] : undefined;
|
|
370
|
+
if (!Array.isArray(data)) return [];
|
|
371
|
+
return data.map(function (item, index) {
|
|
372
|
+
// 创建当前节点副本
|
|
373
|
+
// 完整的名称路径
|
|
374
|
+
var fullNamePath = _toConsumableArray(parentNamePath).concat(item[(optionName === null || optionName === void 0 ? void 0 : optionName.title) || (optionName === null || optionName === void 0 ? void 0 : optionName.label) || 'label' || 'title'] ? [item[(optionName === null || optionName === void 0 ? void 0 : optionName.title) || (optionName === null || optionName === void 0 ? void 0 : optionName.label) || 'label' || 'title']] : []);
|
|
375
|
+
var node = _objectSpread(_objectSpread({}, item), {}, {
|
|
376
|
+
treeNodeLevel: level,
|
|
377
|
+
treeParentIndexPath: _toConsumableArray(parentIndexPath),
|
|
378
|
+
// 存储父级索引路径
|
|
379
|
+
treeParentNamePath: _toConsumableArray(parentNamePath),
|
|
380
|
+
treeFullLevelNamePath: fullNamePath,
|
|
381
|
+
treeFullLevelName: fullNamePath.join((extra === null || extra === void 0 ? void 0 : extra.separator) || '/')
|
|
382
|
+
});
|
|
383
|
+
// 当前节点的完整路径(用于构建子节点的父级路径)
|
|
384
|
+
var currentIndexPath = [].concat(_toConsumableArray(parentIndexPath), [index]);
|
|
385
|
+
var currentNamePath = [].concat(_toConsumableArray(parentNamePath), [item[(optionName === null || optionName === void 0 ? void 0 : optionName.title) || (optionName === null || optionName === void 0 ? void 0 : optionName.label) || 'label' || 'title']]);
|
|
386
|
+
|
|
387
|
+
// 递归处理子节点
|
|
388
|
+
if (Array.isArray(node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children']) && node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children'].length > 0) {
|
|
389
|
+
node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children'] = addTreeLevels(node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children'], level + 1, currentIndexPath, currentNamePath, optionName, extra);
|
|
390
|
+
}
|
|
391
|
+
return node;
|
|
392
|
+
});
|
|
352
393
|
};
|