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.
@@ -1,6 +1,6 @@
1
1
  import i18next from 'ztxkutils/dist/i18next';
2
2
  import React from 'react';
3
- import imgSrc from '../assets/img/浙江商拓国际供应链有限公司.png';
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, Button, Container } from '../../../index.build';
2
+ import { Alert } from '../../../index.build';
3
+ import i18next from 'ztxkutils/dist/i18next';
3
4
  var Demo = function () {
4
- return (React.createElement("div", null,
5
- React.createElement("h3", null, "Alert \u7EC4\u4EF6\u793A\u4F8B"),
6
- React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 16 } },
7
- React.createElement(Alert, { message: "\u6210\u529F\u63D0\u793A", type: "success", showIcon: true }),
8
- React.createElement(Alert, { message: "\u4FE1\u606F\u63D0\u793A", type: "info", showIcon: true }),
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
- "\u4F60\u597D",
11
- React.createElement(Alert, { message: "\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A\u4FE1\u606F\u63D0\u793A", type: "info", showIcon: true, inline: true })),
12
- React.createElement(Alert, { message: "\u8B66\u544A\u63D0\u793A", type: "warning", showIcon: true }),
13
- React.createElement(Alert, { message: "\u9519\u8BEF\u63D0\u793A", type: "error", showIcon: true }),
14
- React.createElement(Alert, { message: "\u53EF\u5173\u95ED\u7684\u63D0\u793A", type: "warning", closable: true, onClose: function () { return console.log('关闭'); } }),
15
- React.createElement(Alert, { message: "\u5E26\u63CF\u8FF0\u7684\u63D0\u793A", description: "\u8FD9\u662F\u4E00\u6BB5\u8BE6\u7EC6\u7684\u63CF\u8FF0\u4FE1\u606F", type: "info", showIcon: true }),
16
- React.createElement(Alert, { message: "\u4F7F\u7528 isUIWeeklyReview={false} \u8986\u76D6\u5168\u5C40\u914D\u7F6E", type: "warning", isUIWeeklyReview: false })),
17
- React.createElement("h3", { style: { marginTop: 24 } }, "Button \u793A\u4F8B\uFF08\u5BF9\u6BD4\u5168\u5C40 isUIWeeklyReview \u6548\u679C\uFF09"),
18
- React.createElement("div", { style: { display: 'flex', gap: 8 } },
19
- React.createElement(Button, { type: "primary" }, "primary"),
20
- React.createElement(Button, { type: "default" }, "default"),
21
- React.createElement(Button, null, "\u65E0type"),
22
- React.createElement(Button, { type: "primary", isUIWeeklyReview: false }, "\u8986\u76D6\u5168\u5C40")),
23
- React.createElement(Container, null,
24
- React.createElement(Container.OperationMiddle, null,
25
- React.createElement(Button, { type: "primary" }, "primary"),
26
- React.createElement(Button, { type: "default" }, "default"),
27
- React.createElement(Button, { type: "primary" }, "primary"),
28
- React.createElement(Button, { type: "default" }, "default"),
29
- React.createElement(Button, { type: "primary" }, "primary"),
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 contextUIWeeklyReview = useBaseContext().isUIWeeklyReview;
71
- var isUIWeeklyReviewBool = getFinalValue(contextUIWeeklyReview, componentUIWeeklyReview);
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 isUIWeeklyReview = useBaseContext().isUIWeeklyReview;
35
- var _b = useState(true), disabled = _b[0], setDisabled = _b[1];
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 = _c[0], setBounds = _c[1];
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
- return (React.createElement(AntModal, __assign({ wrapClassName: stick ? 'zt-modal-stick' : undefined, className: classes, getContainer: getPopupContainer }, restProps, { title: dragTitle, modalRender: modalRender, mask: stick ? false : restProps.mask, maskClosable: stick ? false : restProps.maskClosable, style: stick
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
  */
@@ -24,6 +24,7 @@ var ztxkConfig = {
24
24
  isSelectFrozenStatus: false,
25
25
  isTableEditShowContextMenu: false,
26
26
  isUIWeeklyReview: false,
27
+ isButtonForceDefaultType: false,
27
28
  enableTableExpandIcon: false,
28
29
  };
29
30
  main();
@@ -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: 0px 10px;
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: 0 10px;
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: 2px solid #cdd9e6;
5030
+ border: 1px solid #cdd9e6;
5031
5031
  color: #3d3d3d;
5032
5032
  }
5033
5033
  .zt-alert.ant-alert-info .anticon {
5034
- color: #3d3d3d;
5034
+ color: #93a1b0;
5035
5035
  }
5036
5036
  .zt-alert.ant-alert-info .ant-alert-message {
5037
5037
  color: #3d3d3d;
package/dist/main.js CHANGED
@@ -385,6 +385,10 @@ var ztxkConfig = {
385
385
  * 是否按UI周查样式调整(Button的type默认改为default)
386
386
  */
387
387
  isUIWeeklyReview: true,
388
+ /**
389
+ * 是否强制Button的type为default
390
+ */
391
+ isButtonForceDefaultType: true,
388
392
  /**
389
393
  * 表格展开收起图标使用自定义图标
390
394
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.2.23-597",
3
+ "version": "4.2.23-599",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",