ztxkui 4.2.23-597 → 4.2.23-599
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/DemoCom/tidan.js +1 -1
- package/dist/components/Alert/demoComponents/index.js +37 -42
- package/dist/components/Button/button.js +2 -2
- package/dist/components/Modal/modal.js +13 -6
- package/dist/components/utils/ZtxkContext.d.ts +4 -0
- package/dist/components/utils/ZtxkContext.js +1 -0
- package/dist/components/utils/useBaseContext.d.ts +1 -0
- package/dist/index.css +4 -4
- package/dist/main.js +4 -0
- package/package.json +1 -1
package/dist/DemoCom/tidan.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i18next from 'ztxkutils/dist/i18next';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import imgSrc from '../assets/img
|
|
3
|
+
import imgSrc from '../assets/img/锋瑞国际(香港).png';
|
|
4
4
|
import { Row, Col } from '../index.build';
|
|
5
5
|
import './print.scss';
|
|
6
6
|
// function test() {
|
|
@@ -1,47 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Alert
|
|
2
|
+
import { Alert } from '../../../index.build';
|
|
3
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
3
4
|
var Demo = function () {
|
|
4
|
-
return (React.createElement("div",
|
|
5
|
-
React.createElement("
|
|
6
|
-
|
|
7
|
-
React.createElement(
|
|
8
|
-
|
|
5
|
+
return (React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 24 } },
|
|
6
|
+
React.createElement("section", null,
|
|
7
|
+
React.createElement("h3", { style: { marginBottom: 12 } }, i18next.t('消息类提示')),
|
|
8
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 } },
|
|
9
|
+
React.createElement("div", null,
|
|
10
|
+
React.createElement("h4", { style: { marginBottom: 8 } }, i18next.t('分类一:成功类消息提醒')),
|
|
11
|
+
React.createElement(Alert, { message: i18next.t('操作成功完成'), type: "success", showIcon: true })),
|
|
12
|
+
React.createElement("div", null,
|
|
13
|
+
React.createElement("h4", { style: { marginBottom: 8 } }, i18next.t('分类二:错误类消息提醒')),
|
|
14
|
+
React.createElement(Alert, { message: i18next.t('操作失败,请稍后重试'), type: "error", showIcon: true })),
|
|
15
|
+
React.createElement("div", null,
|
|
16
|
+
React.createElement("h4", { style: { marginBottom: 8 } }, i18next.t('分类三:警告说明类提醒')),
|
|
17
|
+
React.createElement(Alert, { message: i18next.t('请注意此项操作不可撤销'), type: "warning", showIcon: true })))),
|
|
18
|
+
React.createElement("section", null,
|
|
19
|
+
React.createElement("h3", { style: { marginBottom: 12 } }, i18next.t('页面提示')),
|
|
9
20
|
React.createElement("div", null,
|
|
10
|
-
"
|
|
11
|
-
React.createElement(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React.createElement(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
31
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
32
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
33
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
34
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
35
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
36
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
37
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
38
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
39
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
40
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
41
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
42
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
43
|
-
React.createElement(Button, { type: "primary" }, "primary"),
|
|
44
|
-
React.createElement(Button, { type: "default" }, "default"),
|
|
45
|
-
React.createElement(Alert, { message: "\u4FE1\u606F\u63D0\u793A", type: "info", showIcon: true, inline: true })))));
|
|
21
|
+
React.createElement("h4", { style: { marginBottom: 8 } }, i18next.t('块模式')),
|
|
22
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 } },
|
|
23
|
+
React.createElement(Alert, { message: i18next.t('页面提示 - 灰色背景'), description: i18next.t('用于一般性信息说明,灰色背景适用于普通提示场景。'), type: "info", showIcon: true }),
|
|
24
|
+
React.createElement(Alert, { message: i18next.t('页面提示 - 黄色背景'), description: i18next.t('用于需要用户注意的信息,黄色背景适用于警告场景。'), type: "warning", showIcon: true }),
|
|
25
|
+
React.createElement(Alert, { message: i18next.t('页面提示 - 警告类'), description: i18next.t('用于需要特别提醒的内容,强调重要性。'), type: "error", showIcon: true }))),
|
|
26
|
+
React.createElement("div", { style: { marginTop: 16 } },
|
|
27
|
+
React.createElement("h4", { style: { marginBottom: 8 } }, i18next.t('行内模式')),
|
|
28
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 } },
|
|
29
|
+
React.createElement("div", null,
|
|
30
|
+
i18next.t('这是一段普通文本,'),
|
|
31
|
+
React.createElement(Alert, { message: i18next.t('页面提示 - 灰色背景'), type: "info", showIcon: true, inline: true }),
|
|
32
|
+
i18next.t('行内展示。')),
|
|
33
|
+
React.createElement("div", null,
|
|
34
|
+
i18next.t('这是一段普通文本,'),
|
|
35
|
+
React.createElement(Alert, { message: i18next.t('页面提示 - 黄色背景'), type: "warning", showIcon: true, inline: true }),
|
|
36
|
+
i18next.t('行内展示。')),
|
|
37
|
+
React.createElement("div", null,
|
|
38
|
+
i18next.t('这是一段普通文本,'),
|
|
39
|
+
React.createElement(Alert, { message: i18next.t('页面提示 - 警告类'), type: "error", showIcon: true, inline: true }),
|
|
40
|
+
i18next.t('行内展示。')))))));
|
|
46
41
|
};
|
|
47
42
|
export default Demo;
|
|
@@ -67,8 +67,8 @@ var maxClickTime = 1000;
|
|
|
67
67
|
var Button = function (props) {
|
|
68
68
|
var _a;
|
|
69
69
|
var children = props.children, type = props.type, size = props.size, disabled = props.disabled, danger = props.danger, className = props.className, onClick = props.onClick, _b = props.agentClick, agentClick = _b === void 0 ? true : _b, showCopy = props.showCopy, copyContainerStyle = props.copyContainerStyle, isAsync = props.isAsync, compact = props.compact, componentUIWeeklyReview = props.isUIWeeklyReview, toolTip = props.toolTip, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick", "showCopy", "copyContainerStyle", "isAsync", "compact", "isUIWeeklyReview", "toolTip"]);
|
|
70
|
-
var
|
|
71
|
-
var isUIWeeklyReviewBool = getFinalValue(
|
|
70
|
+
var contextForceDefaultType = useBaseContext().isButtonForceDefaultType;
|
|
71
|
+
var isUIWeeklyReviewBool = getFinalValue(contextForceDefaultType, componentUIWeeklyReview);
|
|
72
72
|
var finalType = isUIWeeklyReviewBool ? type || 'default' : type;
|
|
73
73
|
var btnRef = useRef();
|
|
74
74
|
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
|
@@ -24,21 +24,24 @@ import React, { useState, useRef } from 'react';
|
|
|
24
24
|
import { Modal as AntModal, Spin } from 'antd';
|
|
25
25
|
import Draggable from 'react-draggable';
|
|
26
26
|
import classNames from 'classnames';
|
|
27
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
27
28
|
import { usePopupContainer } from '../Table/table-context';
|
|
28
29
|
import useBaseContext from '../utils/useBaseContext';
|
|
30
|
+
import Button from '../Button';
|
|
29
31
|
function Modal(props) {
|
|
30
|
-
var children = props.children, loading = props.loading, className = props.className, title = props.title, _a = props.isDrag, isDrag = _a === void 0 ? true : _a, stick = props.stick, getContainer = props.getContainer, restProps = __rest(props, ["children", "loading", "className", "title", "isDrag", "stick", "getContainer"]);
|
|
32
|
+
var children = props.children, loading = props.loading, className = props.className, title = props.title, _a = props.isDrag, isDrag = _a === void 0 ? true : _a, stick = props.stick, getContainer = props.getContainer, footer = props.footer, onOk = props.onOk, onCancel = props.onCancel, okText = props.okText, cancelText = props.cancelText, okButtonProps = props.okButtonProps, cancelButtonProps = props.cancelButtonProps, confirmLoading = props.confirmLoading, restProps = __rest(props, ["children", "loading", "className", "title", "isDrag", "stick", "getContainer", "footer", "onOk", "onCancel", "okText", "cancelText", "okButtonProps", "cancelButtonProps", "confirmLoading"]);
|
|
31
33
|
var getPopupContainer = usePopupContainer({
|
|
32
34
|
getPopupContainer: getContainer,
|
|
33
35
|
});
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var _c = useState(
|
|
36
|
+
var _b = useBaseContext(), isUIWeeklyReview = _b.isUIWeeklyReview, isButtonForceDefaultType = _b.isButtonForceDefaultType;
|
|
37
|
+
var useProxyButton = isUIWeeklyReview || isButtonForceDefaultType;
|
|
38
|
+
var _c = useState(true), disabled = _c[0], setDisabled = _c[1];
|
|
39
|
+
var _d = useState({
|
|
37
40
|
left: 0,
|
|
38
41
|
top: 0,
|
|
39
42
|
bottom: 0,
|
|
40
43
|
right: 0,
|
|
41
|
-
}), bounds =
|
|
44
|
+
}), bounds = _d[0], setBounds = _d[1];
|
|
42
45
|
var draggleRef = useRef(null);
|
|
43
46
|
var onStart = function (_event, uiData) {
|
|
44
47
|
var _a;
|
|
@@ -75,7 +78,11 @@ function Modal(props) {
|
|
|
75
78
|
? function (modal) { return (React.createElement(Draggable, { disabled: disabled, bounds: bounds, onStart: function (event, uiData) { return onStart(event, uiData); } },
|
|
76
79
|
React.createElement("div", { ref: draggleRef }, modal))); }
|
|
77
80
|
: props.modalRender;
|
|
78
|
-
|
|
81
|
+
// 当全局开启了按钮默认类型代理,且未自定义 footer 时,使用代理 Button 渲染默认底部按钮
|
|
82
|
+
var proxyFooter = useProxyButton && footer === undefined ? (React.createElement(React.Fragment, null,
|
|
83
|
+
React.createElement(Button, __assign({ onClick: onCancel }, cancelButtonProps), cancelText || i18next.t('取消')),
|
|
84
|
+
React.createElement(Button, __assign({ type: "primary", loading: confirmLoading || loading, onClick: onOk }, okButtonProps), okText || i18next.t('确定')))) : (footer);
|
|
85
|
+
return (React.createElement(AntModal, __assign({ wrapClassName: stick ? 'zt-modal-stick' : undefined, className: classes, getContainer: getPopupContainer }, restProps, { footer: proxyFooter, onOk: onOk, onCancel: onCancel, okText: okText, cancelText: cancelText, okButtonProps: okButtonProps, cancelButtonProps: cancelButtonProps, confirmLoading: confirmLoading, title: dragTitle, modalRender: modalRender, mask: stick ? false : restProps.mask, maskClosable: stick ? false : restProps.maskClosable, style: stick
|
|
79
86
|
? __assign({ '--modal-content-width': restProps.width + 'px' }, restProps.style)
|
|
80
87
|
: restProps.style }),
|
|
81
88
|
React.createElement(Spin, { size: "large", spinning: loading }, children)));
|
|
@@ -100,6 +100,10 @@ export interface IZtxkConfig {
|
|
|
100
100
|
* 是否按UI周查样式调整(Button的type默认改为default)
|
|
101
101
|
*/
|
|
102
102
|
isUIWeeklyReview?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* 是否强制按钮使用默认类型(type || 'default')
|
|
105
|
+
*/
|
|
106
|
+
isButtonForceDefaultType?: boolean;
|
|
103
107
|
/**
|
|
104
108
|
* 表格的展开收起图标是否使用组件自定义图标,或者自己自定义
|
|
105
109
|
*/
|
|
@@ -34,6 +34,7 @@ export default function useBaseContext(): {
|
|
|
34
34
|
isSelectFrozenStatus?: boolean;
|
|
35
35
|
isTableEditShowContextMenu?: boolean;
|
|
36
36
|
isUIWeeklyReview?: boolean;
|
|
37
|
+
isButtonForceDefaultType?: boolean;
|
|
37
38
|
enableTableExpandIcon?: boolean | ((option: any) => import("react").ReactNode);
|
|
38
39
|
};
|
|
39
40
|
export declare function useAntdContext(): import("antd/lib/config-provider").ConfigConsumerProps;
|
package/dist/index.css
CHANGED
|
@@ -4980,7 +4980,7 @@ textarea.textArea-isSingleLine {
|
|
|
4980
4980
|
.zt-alert {
|
|
4981
4981
|
border-radius: 4px;
|
|
4982
4982
|
border: none;
|
|
4983
|
-
padding:
|
|
4983
|
+
padding: 4px 6px;
|
|
4984
4984
|
line-height: 24px;
|
|
4985
4985
|
min-height: 30px;
|
|
4986
4986
|
}
|
|
@@ -4989,7 +4989,7 @@ textarea.textArea-isSingleLine {
|
|
|
4989
4989
|
margin-right: 10px;
|
|
4990
4990
|
}
|
|
4991
4991
|
.zt-alert.ant-alert-with-description {
|
|
4992
|
-
padding:
|
|
4992
|
+
padding: 4px 6px;
|
|
4993
4993
|
}
|
|
4994
4994
|
.zt-alert.ant-alert-with-description > .anticon {
|
|
4995
4995
|
margin-top: 2px;
|
|
@@ -5027,11 +5027,11 @@ textarea.textArea-isSingleLine {
|
|
|
5027
5027
|
}
|
|
5028
5028
|
.zt-alert.ant-alert-info {
|
|
5029
5029
|
background: #ebf3fe;
|
|
5030
|
-
border:
|
|
5030
|
+
border: 1px solid #cdd9e6;
|
|
5031
5031
|
color: #3d3d3d;
|
|
5032
5032
|
}
|
|
5033
5033
|
.zt-alert.ant-alert-info .anticon {
|
|
5034
|
-
color: #
|
|
5034
|
+
color: #93a1b0;
|
|
5035
5035
|
}
|
|
5036
5036
|
.zt-alert.ant-alert-info .ant-alert-message {
|
|
5037
5037
|
color: #3d3d3d;
|
package/dist/main.js
CHANGED