zmdms-webui 0.0.90 → 0.0.92
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/es/detaillist/item.d.ts +2 -0
- package/dist/es/detaillist/item.js +16 -4
- package/dist/es/detaillist/list.d.ts +1 -0
- package/dist/es/detaillist/list.js +2 -2
- package/dist/es/table/useDynamicListByColumns.js +8 -4
- package/dist/es/table/utils.js +37 -8
- package/dist/es/tabs/interface.d.ts +2 -0
- package/dist/es/tabs/tabs.js +2 -1
- package/dist/es/title/interface.d.ts +1 -0
- package/dist/es/title/title.js +2 -2
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
-
import { jsxs,
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import classNames from '../node_modules/classnames/index.js';
|
|
4
4
|
import { Col } from 'antd';
|
|
5
5
|
|
|
6
6
|
var Item = function (_a) {
|
|
7
|
-
var children = _a.children, className = _a.className, title = _a.title, _b = _a.colon, colon = _b === void 0 ? true : _b, span = _a.span, titleSpan = _a.titleSpan, titleProps = _a.titleProps, textProps = _a.textProps, showDiff = _a.showDiff, _c = _a.isEllipsis, isEllipsis = _c === void 0 ? true : _c, isBlod = _a.isBlod, isFlex = _a.isFlex, isRequired = _a.isRequired, titleVerticalCenter = _a.titleVerticalCenter;
|
|
7
|
+
var children = _a.children, className = _a.className, title = _a.title, _b = _a.colon, colon = _b === void 0 ? true : _b, span = _a.span, titleSpan = _a.titleSpan, titleStyle = _a.titleStyle, isContentMerge = _a.isContentMerge, titleProps = _a.titleProps, textProps = _a.textProps, showDiff = _a.showDiff, _c = _a.isEllipsis, isEllipsis = _c === void 0 ? true : _c, isBlod = _a.isBlod, isFlex = _a.isFlex, isRequired = _a.isRequired, titleVerticalCenter = _a.titleVerticalCenter;
|
|
8
8
|
var classes = classNames("ztxk-grid-item", className, {
|
|
9
9
|
"ztxk-grid-item--flex": isFlex,
|
|
10
10
|
});
|
|
11
|
-
return (jsxs(
|
|
11
|
+
return isContentMerge ? (jsxs(Col, __assign({ span: span, className: "ztxk-grid-item--merge" }, { children: [jsxs("div", __assign({ className: classes +
|
|
12
|
+
" ztxk-grid-item--title" +
|
|
13
|
+
"".concat(titleVerticalCenter ? " ztxk-grid-item--title-vertical-center" : ""), title: title, style: titleStyle }, titleProps, { children: [isRequired && (jsx("span", __assign({ className: "ztxk-grid-item--title-required" }, { children: "*" }))), jsx("span", __assign({ className: "ztxk-grid-item--title-text" }, { children: title })), jsx("span", __assign({ className: "ztxk-grid-item--title-colon" }, { children: colon && ":" }))] })), jsx("div", __assign({ className: showDiff
|
|
14
|
+
? classes +
|
|
15
|
+
" ztxk-grid-item--text ztxk-grid-item--diff" +
|
|
16
|
+
"".concat(isEllipsis
|
|
17
|
+
? " ztxk-grid-item--text-ellipsis"
|
|
18
|
+
: " ztxk-grid-item--text-noellipsis")
|
|
19
|
+
: classes +
|
|
20
|
+
" ztxk-grid-item--text" +
|
|
21
|
+
"".concat(isEllipsis
|
|
22
|
+
? " ztxk-grid-item--text-ellipsis"
|
|
23
|
+
: " ztxk-grid-item--text-noellipsis"), title: typeof children === "string" ? children : undefined, style: { fontWeight: isBlod ? "bold" : "normal" } }, textProps, { children: children }))] }))) : (jsxs(Fragment, { children: [jsxs(Col, __assign({ className: classes +
|
|
12
24
|
" ztxk-grid-item--title" +
|
|
13
25
|
"".concat(titleVerticalCenter ? " ztxk-grid-item--title-vertical-center" : ""),
|
|
14
26
|
// span={titleSpan ? titleSpan : Math.ceil(span * 0.3)}
|
|
15
|
-
span: titleSpan ? titleSpan : 3, title: title }, titleProps, { children: [isRequired && (jsx("span", __assign({ className: "ztxk-grid-item--title-required" }, { children: "*" }))), jsx("span", __assign({ className: "ztxk-grid-item--title-text" }, { children: title })), jsx("span", __assign({ className: "ztxk-grid-item--title-colon" }, { children: colon && ":" }))] })), jsx(Col, __assign({ className: showDiff
|
|
27
|
+
span: titleSpan ? titleSpan : 3, title: title, style: titleStyle }, titleProps, { children: [isRequired && (jsx("span", __assign({ className: "ztxk-grid-item--title-required" }, { children: "*" }))), jsx("span", __assign({ className: "ztxk-grid-item--title-text" }, { children: title })), jsx("span", __assign({ className: "ztxk-grid-item--title-colon" }, { children: colon && ":" }))] })), jsx(Col, __assign({ className: showDiff
|
|
16
28
|
? classes +
|
|
17
29
|
" ztxk-grid-item--text ztxk-grid-item--diff" +
|
|
18
30
|
"".concat(isEllipsis
|
|
@@ -5,8 +5,8 @@ import Item from './item.js';
|
|
|
5
5
|
import { Row } from 'antd';
|
|
6
6
|
|
|
7
7
|
var List = function (_a) {
|
|
8
|
-
var children = _a.children, className = _a.className, border = _a.border, isBg = _a.isBg, isFlex = _a.isFlex, restProps = __rest(_a, ["children", "className", "border", "isBg", "isFlex"]);
|
|
9
|
-
var classes = classNames("ztxk-grid", className, {
|
|
8
|
+
var children = _a.children, className = _a.className, border = _a.border, isBg = _a.isBg, isFlex = _a.isFlex, _b = _a.size, size = _b === void 0 ? "default" : _b, restProps = __rest(_a, ["children", "className", "border", "isBg", "isFlex", "size"]);
|
|
9
|
+
var classes = classNames("ztxk-grid", "ztxk-grid--".concat(size), className, {
|
|
10
10
|
"ztxk-grid--border": border,
|
|
11
11
|
"ztxk-grid--background": isBg,
|
|
12
12
|
"ztxk-grid--flex": isFlex,
|
|
@@ -4,7 +4,7 @@ import { TABLE_DYNAMIC_KEY } from './constant.js';
|
|
|
4
4
|
import isEqual from 'lodash/isEqual';
|
|
5
5
|
|
|
6
6
|
// 处理列信息
|
|
7
|
-
function parseColumn(column, index) {
|
|
7
|
+
function parseColumn(column, index, indexs) {
|
|
8
8
|
var _a = column, key = _a.key, dataIndex = _a.dataIndex, title = _a.title, dynamicTitle = _a.dynamicTitle, dynamicDisabled = _a.dynamicDisabled, width = _a.width, fixed = _a.fixed;
|
|
9
9
|
// 动态列配置 title必须为一个字符串
|
|
10
10
|
if (title && !dynamicTitle && typeof title !== "string") {
|
|
@@ -24,6 +24,8 @@ function parseColumn(column, index) {
|
|
|
24
24
|
label: dynamicTitle ? dynamicTitle : title,
|
|
25
25
|
disabled: dynamicDisabled === true ? true : false,
|
|
26
26
|
checked: true,
|
|
27
|
+
// 记录递归的索引,在做比对查找时,用这个值添加一个比对条件
|
|
28
|
+
indexs: indexs,
|
|
27
29
|
width: width,
|
|
28
30
|
fixed: fixed,
|
|
29
31
|
};
|
|
@@ -35,13 +37,15 @@ function parseColumn(column, index) {
|
|
|
35
37
|
// }
|
|
36
38
|
}
|
|
37
39
|
// 将多级表头统一提取出来处理
|
|
38
|
-
function recursionColumns(columns, result) {
|
|
40
|
+
function recursionColumns(columns, result, indexs) {
|
|
39
41
|
if (Array.isArray(columns)) {
|
|
40
42
|
columns.forEach(function (column, index) {
|
|
41
|
-
var
|
|
43
|
+
var newIndexs = indexs ? indexs.slice() : [];
|
|
44
|
+
newIndexs.push(index);
|
|
45
|
+
var item = parseColumn(column, index, newIndexs);
|
|
42
46
|
if (column.children && Array.isArray(column.children)) {
|
|
43
47
|
var columnChildrenResult = [];
|
|
44
|
-
recursionColumns(column.children, columnChildrenResult);
|
|
48
|
+
recursionColumns(column.children, columnChildrenResult, newIndexs);
|
|
45
49
|
item.children = columnChildrenResult;
|
|
46
50
|
}
|
|
47
51
|
result.push(item);
|
package/dist/es/table/utils.js
CHANGED
|
@@ -2,24 +2,53 @@ import { __spreadArray, __assign } from '../_virtual/_tslib.js';
|
|
|
2
2
|
import { message } from 'antd';
|
|
3
3
|
|
|
4
4
|
// 递归处理columns
|
|
5
|
-
function recursionColumns(columns, currentDynamicList, newColumns) {
|
|
5
|
+
function recursionColumns(columns, currentDynamicList, newColumns, columnsIndexs) {
|
|
6
6
|
if (Array.isArray(currentDynamicList) &&
|
|
7
7
|
currentDynamicList.length > 0 &&
|
|
8
8
|
columns) {
|
|
9
|
-
currentDynamicList.forEach(function (item) {
|
|
10
|
-
var key = item.key, checked = item.checked, width = item.width, fixed = item.fixed, dynamicChildrenList = item.children;
|
|
9
|
+
currentDynamicList.forEach(function (item, index) {
|
|
10
|
+
var key = item.key, checked = item.checked, width = item.width, fixed = item.fixed, indexs = item.indexs, dynamicChildrenList = item.children;
|
|
11
11
|
// 这里肯定是能找到的 因为之前就以columns过滤了一遍dynamicList了
|
|
12
|
-
var
|
|
13
|
-
|
|
12
|
+
var currentIndex = null;
|
|
13
|
+
var result = columns.find(function (column, index) {
|
|
14
|
+
// return (
|
|
15
|
+
// (column.key === key ||
|
|
16
|
+
// ((column as any)?.dataIndex as string) === key) &&
|
|
17
|
+
// checked
|
|
18
|
+
// );
|
|
19
|
+
// 找到对应的key,加一个条件 indexs也必须相同 indexs为递归列的索引
|
|
20
|
+
if ((column.key === key ||
|
|
14
21
|
(column === null || column === void 0 ? void 0 : column.dataIndex) === key) &&
|
|
15
|
-
checked
|
|
22
|
+
checked &&
|
|
23
|
+
(!indexs ||
|
|
24
|
+
"".concat(columnsIndexs ? columnsIndexs.concat([index]) : [index]) ===
|
|
25
|
+
"".concat(indexs))) {
|
|
26
|
+
currentIndex = index;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
16
30
|
});
|
|
17
|
-
|
|
31
|
+
// 如果最终都没有找到递归列的索引,那么可能是更改了原始的排列。
|
|
32
|
+
// 这里再兜底一次,不依照索引来查找
|
|
33
|
+
if (!result) {
|
|
34
|
+
result = columns.find(function (column, index) {
|
|
35
|
+
if ((column.key === key ||
|
|
36
|
+
(column === null || column === void 0 ? void 0 : column.dataIndex) === key) &&
|
|
37
|
+
checked) {
|
|
38
|
+
currentIndex = index;
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (result && currentIndex != null) {
|
|
18
45
|
var newColumn = __assign(__assign({}, result), { width: width ? width : result.width, fixed: fixed != null ? fixed : result.fixed });
|
|
19
46
|
// 如果有子元素
|
|
20
47
|
if (result.children) {
|
|
21
48
|
newColumn.children = [];
|
|
22
|
-
recursionColumns(result.children, dynamicChildrenList, newColumn.children
|
|
49
|
+
recursionColumns(result.children, dynamicChildrenList, newColumn.children, columnsIndexs
|
|
50
|
+
? columnsIndexs.concat([currentIndex])
|
|
51
|
+
: [currentIndex]);
|
|
23
52
|
}
|
|
24
53
|
newColumns.push(newColumn);
|
|
25
54
|
}
|
package/dist/es/tabs/tabs.js
CHANGED
|
@@ -6,12 +6,13 @@ import classNames from '../node_modules/classnames/index.js';
|
|
|
6
6
|
|
|
7
7
|
var Tabs = function (props) {
|
|
8
8
|
var _a;
|
|
9
|
-
var className = props.className, isHeader = props.isHeader, isContent = props.isContent, _b = props.marginTop, marginTop = _b === void 0 ? false : _b, _c = props.marginBottom, marginBottom = _c === void 0 ? true : _c, resetProps = __rest(props, ["className", "isHeader", "isContent", "marginTop", "marginBottom"]);
|
|
9
|
+
var className = props.className, isHeader = props.isHeader, isContent = props.isContent, isFlex = props.isFlex, _b = props.marginTop, marginTop = _b === void 0 ? false : _b, _c = props.marginBottom, marginBottom = _c === void 0 ? true : _c, resetProps = __rest(props, ["className", "isHeader", "isContent", "isFlex", "marginTop", "marginBottom"]);
|
|
10
10
|
var classes = classNames("ztxk-tabs", className, (_a = {},
|
|
11
11
|
_a["ztxk-tabs--header"] = isHeader,
|
|
12
12
|
_a["ztxk-tabs--content"] = isContent,
|
|
13
13
|
_a["ztxk-tabs--marginTop"] = marginTop,
|
|
14
14
|
_a["ztxk-tabs--marginBottom"] = marginBottom,
|
|
15
|
+
_a["ztxk-tabs--isFlex"] = isFlex,
|
|
15
16
|
_a));
|
|
16
17
|
return (jsx(Tabs$1, __assign({ type: isHeader ? "editable-card" : isContent ? "card" : undefined, hideAdd: isHeader ? true : undefined, className: classes }, resetProps)));
|
|
17
18
|
};
|
package/dist/es/title/title.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import classNames from '../node_modules/classnames/index.js';
|
|
4
4
|
|
|
5
5
|
var Title = function (props) {
|
|
6
|
-
var title = props.title, className = props.className, bordered = props.bordered, showBg = props.showBg, _a = props.justifyContent, justifyContent = _a === void 0 ? "space-between" : _a, children = props.children, isTopMargin = props.isTopMargin, isBottomMargin = props.isBottomMargin;
|
|
6
|
+
var title = props.title, className = props.className, bordered = props.bordered, showBg = props.showBg, _a = props.justifyContent, justifyContent = _a === void 0 ? "space-between" : _a, children = props.children, isTopMargin = props.isTopMargin, isBottomMargin = props.isBottomMargin, titleStyle = props.titleStyle;
|
|
7
7
|
// 主容器类名
|
|
8
8
|
var classes = classNames("ztxk-title", className, {
|
|
9
9
|
"ztxk-title--bordered": bordered,
|
|
@@ -11,7 +11,7 @@ var Title = function (props) {
|
|
|
11
11
|
"ztxk-title--marginTop": isTopMargin,
|
|
12
12
|
"ztxk-title--marginBottom": isBottomMargin,
|
|
13
13
|
});
|
|
14
|
-
return (jsxs("div", __assign({ className: classes, style: { justifyContent: justifyContent } }, { children: [jsx("div", __assign({ className: "ztxk-title--title" }, { children: title })), jsx("div", __assign({ className: "ztxk-title--extra" }, { children: children }))] })));
|
|
14
|
+
return (jsxs("div", __assign({ className: classes, style: { justifyContent: justifyContent } }, { children: [jsx("div", __assign({ className: "ztxk-title--title", style: titleStyle }, { children: title })), jsx("div", __assign({ className: "ztxk-title--extra" }, { children: children }))] })));
|
|
15
15
|
};
|
|
16
16
|
var TitleCom = Title;
|
|
17
17
|
TitleCom.displayName = "ZTXK_WEBUI_Title";
|