ztxkui 4.2.23-580 → 4.2.23-581
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/Demo.js +1 -1
- package/dist/DemoCom/BasicDemo.js +3 -2
- package/dist/DemoCom/FormDemo.js +93 -2
- package/dist/DemoCom/PrintDemo.js +5 -1
- package/dist/TableDemo/EditableTable.js +3 -2
- package/dist/UI/Detail/index.js +11 -2
- package/dist/UI/Form/index.js +74 -2
- package/dist/components/Alert/alert.d.ts +3 -0
- package/dist/components/Alert/alert.js +54 -0
- package/dist/components/Alert/demoComponents/index.d.ts +3 -0
- package/dist/components/Alert/demoComponents/index.js +24 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/index.js +2 -0
- package/dist/components/Alert/interface.d.ts +13 -0
- package/dist/components/Alert/interface.js +1 -0
- package/dist/components/Button/button.d.ts +2 -0
- package/dist/components/Button/button.js +11 -4
- package/dist/components/Button/demoComponents/index.js +2 -1
- package/dist/components/Collapse/collapse.d.ts +4 -0
- package/dist/components/Collapse/collapse.js +10 -2
- package/dist/components/ProForm/interface.d.ts +5 -1
- package/dist/components/ProForm/item.js +3 -2
- package/dist/components/Table/table.d.ts +6 -0
- package/dist/components/Table/table.js +24 -4
- package/dist/components/Upload/upload.js +21 -12
- package/dist/components/business/DetailHeader/index.js +2 -2
- package/dist/components/business/Footer/index.d.ts +2 -0
- package/dist/components/business/Footer/index.js +2 -2
- package/dist/components/business/NewList/list.d.ts +4 -0
- package/dist/components/business/NewList/list.js +6 -1
- package/dist/components/business/SearchContainer/search-item.d.ts +1 -1
- package/dist/components/business/SearchContainer/search-item.js +1 -1
- package/dist/components/business/SearchContainer/search-right.js +1 -1
- package/dist/components/electron-signatures/content.js +2 -2
- package/dist/components/electron-signatures/demoComponents/detail.js +1 -1
- package/dist/components/utils/ZtxkContext.d.ts +4 -0
- package/dist/components/utils/ZtxkContext.js +1 -0
- package/dist/components/utils/useBaseContext.d.ts +2 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.build.d.ts +1 -1
- package/dist/index.build.js +1 -1
- package/dist/index.css +264 -22
- package/dist/index.css.map +1 -1
- package/dist/main.js +4 -0
- package/dist/pages/routes.js +10 -0
- package/package.json +1 -1
package/dist/Demo.js
CHANGED
|
@@ -1428,7 +1428,7 @@ function Demo() {
|
|
|
1428
1428
|
React.createElement(EnhanceSelect, { style: selectStyle, list: list, titleKey: "name", joinKey: "test1", isHandAddItem: true, value: value1, showAll: true, onChange: function (value, option, completeData) {
|
|
1429
1429
|
console.log(value, option, completeData);
|
|
1430
1430
|
setValue1(value);
|
|
1431
|
-
} }),
|
|
1431
|
+
}, disabled: true }),
|
|
1432
1432
|
React.createElement(EnhanceSelect, { style: selectStyle, list: list, titleKey: "name", joinKey: "test1", isHandAddItem: true, value: value2, showAll: true, mode: "multiple", onChange: function (value, option, completeData) {
|
|
1433
1433
|
console.log(value, option, completeData);
|
|
1434
1434
|
setValue2(value);
|
|
@@ -139,12 +139,13 @@ function BasicDemo() {
|
|
|
139
139
|
} }, i18next.t('获取数据'))),
|
|
140
140
|
React.createElement(Input.TextArea, { className: "placeholder", autoSize: true }),
|
|
141
141
|
React.createElement("div", { style: { border: '1px solid red' } },
|
|
142
|
-
|
|
142
|
+
"111",
|
|
143
|
+
React.createElement(FormList, { gutter: 16, bottomBorder: true },
|
|
143
144
|
React.createElement(FormList.FormItem, { span: 24, title: i18next.t('提单号提单号提单号提单号'), isEllipsis: false }, test),
|
|
144
145
|
React.createElement(FormList.FormItem, { span: 6, title: i18next.t('公司') }, "222222"),
|
|
145
146
|
React.createElement(FormList.FormItem, { span: 6, title: i18next.t('部门') }, "3333333"),
|
|
146
147
|
React.createElement(FormList.FormItem, { span: 6, title: i18next.t('提货单位') }, "444444")),
|
|
147
|
-
React.createElement(FormList, { gutter: 16 },
|
|
148
|
+
React.createElement(FormList, { gutter: 16, marginTop: true },
|
|
148
149
|
React.createElement(FormList.FormItem, { span: 6, title: i18next.t('提单号') }, "111111"),
|
|
149
150
|
React.createElement(FormList.FormItem, { span: 6, title: i18next.t('公司') }, "222222"),
|
|
150
151
|
React.createElement(FormList.FormItem, { span: 6, title: i18next.t('部门') }, "3333333"),
|
package/dist/DemoCom/FormDemo.js
CHANGED
|
@@ -203,6 +203,7 @@ var FormDemo = function () {
|
|
|
203
203
|
var _b = useState('1'), setStatus = _b[1];
|
|
204
204
|
var _c = useState({
|
|
205
205
|
mark: '123\nds ad\n6666',
|
|
206
|
+
applyPersonName1: '123123',
|
|
206
207
|
}), formData = _c[0], setFormData = _c[1];
|
|
207
208
|
var num = useState(1)[0];
|
|
208
209
|
var _d = useState(0), drafterMode = _d[0], setDrafterMode = _d[1]; // 0 模糊匹配,普通搜索栏 1 多选匹配,用户为下拉框格式
|
|
@@ -246,8 +247,31 @@ var FormDemo = function () {
|
|
|
246
247
|
isDynamic: true, dynamicStorageKey: "symbol-key-00001",
|
|
247
248
|
// // disabledHideItem
|
|
248
249
|
isToggle: true, toggleNum: 4, handleRef: handleRef },
|
|
249
|
-
React.createElement(SearchItem, { name: "
|
|
250
|
-
React.createElement(
|
|
250
|
+
React.createElement(SearchItem, { name: "type9", width: "half", label: i18next.t('你好9') },
|
|
251
|
+
React.createElement(Radio.Group, { buttonStyle: "solid" },
|
|
252
|
+
React.createElement(Radio.Button, { value: "123", key: "123" }, "123"),
|
|
253
|
+
React.createElement(Radio.Button, { value: "222", key: "222" }, "222"))),
|
|
254
|
+
React.createElement(SearchItem, { name: "number1111", label: i18next.t('数量1111'), rules: [
|
|
255
|
+
{
|
|
256
|
+
required: true,
|
|
257
|
+
message: i18next.t('采购基本数据-请选择入库单号'),
|
|
258
|
+
},
|
|
259
|
+
] },
|
|
260
|
+
React.createElement(InputNumber, null)),
|
|
261
|
+
React.createElement(SearchItem, { name: "inputqul", label: i18next.t('富文本输入'), rules: [
|
|
262
|
+
{
|
|
263
|
+
required: true,
|
|
264
|
+
message: i18next.t('采购基本数据-请选择入库单号'),
|
|
265
|
+
},
|
|
266
|
+
] },
|
|
267
|
+
React.createElement(Input.Quill, null)),
|
|
268
|
+
React.createElement(SearchItem, { name: "applyPersonName1", label: i18next.t('起草人'), disabled: true, rules: [
|
|
269
|
+
{
|
|
270
|
+
required: true,
|
|
271
|
+
message: i18next.t('采购基本数据-请选择入库单号'),
|
|
272
|
+
},
|
|
273
|
+
] },
|
|
274
|
+
React.createElement(Input, { allowClear: true, disabled: true })),
|
|
251
275
|
React.createElement(SearchItem, { name: "applyPersonName2", label: i18next.t('起草人'), suffix: React.createElement(React.Fragment, null) },
|
|
252
276
|
React.createElement(Input, { allowClear: true })),
|
|
253
277
|
React.createElement(SearchItem, { name: "applyPersonName3", label: i18next.t('起草人'), suffix: React.createElement(React.Fragment, null, drafterMode === 0 ? (React.createElement(Tooltip, { title: i18next.t('切换成选择框') },
|
|
@@ -469,6 +493,73 @@ var FormDemo = function () {
|
|
|
469
493
|
}, onClearHandle: function (items) {
|
|
470
494
|
console.log(items);
|
|
471
495
|
}, onResetHandle: function () { } }))),
|
|
496
|
+
React.createElement("div", null, "\u4E0D\u5E26\u81EA\u5B9A\u4E49\u3001\u5E38\u7528\u641C\u7D22\u529F\u80FD\u7684\u63D2\u4EF6"),
|
|
497
|
+
React.createElement(Form, { name: "test-list", form: form, onKeyDown: function (event) {
|
|
498
|
+
if (event.key === 'Enter') {
|
|
499
|
+
event.preventDefault();
|
|
500
|
+
event.stopPropagation();
|
|
501
|
+
console.log(i18next.t('提交'));
|
|
502
|
+
}
|
|
503
|
+
}, onValuesChange: function (changedValues, allValues) {
|
|
504
|
+
console.log(changedValues, allValues);
|
|
505
|
+
} },
|
|
506
|
+
React.createElement(SearchContainer, { dark: true },
|
|
507
|
+
React.createElement(SearchLeft
|
|
508
|
+
// configInfo={configInfoMemo}
|
|
509
|
+
// isDynamic
|
|
510
|
+
// dynamicStorageKey="symbol-key-00002"
|
|
511
|
+
// // disabledHideItem
|
|
512
|
+
, {
|
|
513
|
+
// configInfo={configInfoMemo}
|
|
514
|
+
// isDynamic
|
|
515
|
+
// dynamicStorageKey="symbol-key-00002"
|
|
516
|
+
// // disabledHideItem
|
|
517
|
+
isToggle: true, toggleNum: 4, handleRef: handleRef },
|
|
518
|
+
React.createElement(SearchItem, { width: "half", name: "pwNo1", label: i18next.t('入库单号1'), rules: [
|
|
519
|
+
{
|
|
520
|
+
required: true,
|
|
521
|
+
message: i18next.t('采购基本数据-请选择入库单号1'),
|
|
522
|
+
},
|
|
523
|
+
] },
|
|
524
|
+
React.createElement(Input, null))),
|
|
525
|
+
React.createElement(SearchRight, { onSearchHandle: function () {
|
|
526
|
+
console.log(form.getFieldsValue());
|
|
527
|
+
var mark = form.getFieldsValue().mark;
|
|
528
|
+
setMark(mark);
|
|
529
|
+
// handleRef.current?.setToggleHandle(false);
|
|
530
|
+
// console.log(form.getFieldsValue(), formData);
|
|
531
|
+
}, onClearHandle: function (items) {
|
|
532
|
+
console.log(items);
|
|
533
|
+
}, onResetHandle: function () { } }))),
|
|
534
|
+
React.createElement("div", null, "\u7528\u7684\u65F6\u5019\u4E0D\u5E26SearchLeft\u7EC4\u4EF6\u517C\u5BB9"),
|
|
535
|
+
React.createElement(Form, { name: "test-list", form: form, onKeyDown: function (event) {
|
|
536
|
+
if (event.key === 'Enter') {
|
|
537
|
+
event.preventDefault();
|
|
538
|
+
event.stopPropagation();
|
|
539
|
+
console.log(i18next.t('提交'));
|
|
540
|
+
}
|
|
541
|
+
}, onValuesChange: function (changedValues, allValues) {
|
|
542
|
+
console.log(changedValues, allValues);
|
|
543
|
+
} },
|
|
544
|
+
React.createElement(SearchContainer, { dark: true },
|
|
545
|
+
React.createElement(SearchLeft
|
|
546
|
+
// configInfo={configInfoMemo}
|
|
547
|
+
// isDynamic
|
|
548
|
+
// dynamicStorageKey="symbol-key-00002"
|
|
549
|
+
// // disabledHideItem
|
|
550
|
+
, {
|
|
551
|
+
// configInfo={configInfoMemo}
|
|
552
|
+
// isDynamic
|
|
553
|
+
// dynamicStorageKey="symbol-key-00002"
|
|
554
|
+
// // disabledHideItem
|
|
555
|
+
isToggle: true, toggleNum: 4, handleRef: handleRef },
|
|
556
|
+
React.createElement(SearchItem, { width: "half", name: "pwNo1", label: i18next.t('入库单号1'), rules: [
|
|
557
|
+
{
|
|
558
|
+
required: true,
|
|
559
|
+
message: i18next.t('采购基本数据-请选择入库单号1'),
|
|
560
|
+
},
|
|
561
|
+
] },
|
|
562
|
+
React.createElement(Input, null))))),
|
|
472
563
|
React.createElement("button", { onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
473
564
|
var err_1, errorFields;
|
|
474
565
|
return __generator(this, function (_a) {
|
|
@@ -409,7 +409,11 @@ var PrintDemo = function () {
|
|
|
409
409
|
React.createElement("iframe", { style: { width: '1000px', height: '400px' }, title: i18next.t('测试iframe打印'), src: "http://localhost:8787/print" })),
|
|
410
410
|
React.createElement("div", { className: "test1" }, i18next.t('我是多余的数据 我是多余的数据')),
|
|
411
411
|
React.createElement("div", { className: "test2" }, i18next.t('我是多余的数据 我是多余的数据')),
|
|
412
|
-
React.createElement(Footer
|
|
412
|
+
React.createElement(Footer
|
|
413
|
+
// paddingLeft={false}
|
|
414
|
+
, {
|
|
415
|
+
// paddingLeft={false}
|
|
416
|
+
footerDom: [
|
|
413
417
|
{
|
|
414
418
|
render: function () { return React.createElement(Print, { key: 1, showWater: true }); },
|
|
415
419
|
},
|
|
@@ -550,7 +550,7 @@ var EditableTable = function () {
|
|
|
550
550
|
tableHandleRef.current.scrollTo({ y: 0, vid: 'keyId1' });
|
|
551
551
|
} }, i18next.t('设置')),
|
|
552
552
|
React.createElement("div", { id: "editableTable" },
|
|
553
|
-
React.createElement(Table, { dataSource: records, columns: columns,
|
|
553
|
+
React.createElement(Table, { tableTitle: i18next.t('我是一个表格'), dataSource: records, columns: columns,
|
|
554
554
|
// isFlex
|
|
555
555
|
rowKey: "id",
|
|
556
556
|
// 表格项可输入
|
|
@@ -568,6 +568,7 @@ var EditableTable = function () {
|
|
|
568
568
|
// expandedRowRender: (record) => <p style={{ margin: 0 }}>111</p>,
|
|
569
569
|
expandedRowRender: function () { return React.createElement(BasicTable, null); },
|
|
570
570
|
// rowExpandable: (record) => true,
|
|
571
|
+
// expandIcon: () => 1,
|
|
571
572
|
}, scroll: { x: 1000, y: scrollY || 100 }, showDelAllBtn: true, delAllChange: onDelAllChange, rowSelection: {
|
|
572
573
|
type: 'checkbox',
|
|
573
574
|
}, summaryFixed: true, isAutoClearSort: true, isHeaderTitleWrap: true, isContextMenu: true, summaryConfig: [
|
|
@@ -612,7 +613,7 @@ var EditableTable = function () {
|
|
|
612
613
|
},
|
|
613
614
|
],
|
|
614
615
|
},
|
|
615
|
-
], isExternalSort: true }))));
|
|
616
|
+
], isExternalSort: true, expandRowBackground: true }))));
|
|
616
617
|
};
|
|
617
618
|
export default EditableTable;
|
|
618
619
|
export function useCalcScrollY(isAutoScrollY, subHeight, id) {
|
package/dist/UI/Detail/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i18next from 'ztxkutils/dist/i18next';
|
|
2
2
|
import React, { useMemo, useRef } from 'react';
|
|
3
|
-
import { DetailHeader, OperationBtnGroup, Container, Button, InputNumber, Input, Tabs, Dropdown, DatePicker, } from '../../index.build';
|
|
3
|
+
import { DetailHeader, OperationBtnGroup, Container, Button, InputNumber, Input, Tabs, Dropdown, DatePicker, Collapse, Modal, Tooltip, } from '../../index.build';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
var Detail = function () {
|
|
6
6
|
var rangeDatesRef = useRef(null);
|
|
@@ -11,6 +11,7 @@ var Detail = function () {
|
|
|
11
11
|
// render: () => <Button type="primary">{`操作按钮${i}`}</Button>,
|
|
12
12
|
}); });
|
|
13
13
|
}, []);
|
|
14
|
+
var _a = React.useState(false), visible = _a[0], setVisible = _a[1];
|
|
14
15
|
return (React.createElement("div", null,
|
|
15
16
|
React.createElement(DatePicker, null),
|
|
16
17
|
React.createElement(DatePicker.MonthPicker, null),
|
|
@@ -216,6 +217,14 @@ var Detail = function () {
|
|
|
216
217
|
React.createElement("a", null, i18next.t('编辑')),
|
|
217
218
|
React.createElement("a", null, i18next.t('删除'))) },
|
|
218
219
|
React.createElement("a", null, i18next.t('阿斯利康觉得'))) })); })),
|
|
219
|
-
React.createElement(Tabs, { isContent: true }, Array.from({ length: 6 }, function (_, i) { return (React.createElement(Tabs.TabPane, { key: i, tab: i18next.t('asd阿松大') })); }))
|
|
220
|
+
React.createElement(Tabs, { isContent: true }, Array.from({ length: 6 }, function (_, i) { return (React.createElement(Tabs.TabPane, { key: i, tab: i18next.t('asd阿松大') })); })),
|
|
221
|
+
React.createElement(Tabs, { isContent: true }, Array.from({ length: 6 }, function (_, i) { return (React.createElement(Tabs.TabPane, { key: i, tab: i18next.t('asd阿松大') }, i18next.t('我是占位文字'))); })),
|
|
222
|
+
React.createElement(Collapse, { contentPaddingTop: true },
|
|
223
|
+
React.createElement(Collapse.Panel, { key: "1", header: "\u9762\u677F1" }, "\u9762\u677F1"),
|
|
224
|
+
React.createElement(Collapse.Panel, { key: "2", header: "\u9762\u677F2" }, "\u9762\u677F2")),
|
|
225
|
+
React.createElement(Button, { onClick: function () { return setVisible(true); } }, "\u6253\u5F00\u5F39\u6846"),
|
|
226
|
+
React.createElement(Modal, { title: "\u5F39\u6846\u6807\u9898", loading: false, visible: visible, onCancel: function () { return setVisible(false); } }, "\u6211\u662F\u5F39\u6846\u5185\u5BB9"),
|
|
227
|
+
React.createElement(Tooltip, { title: "\u6211\u662F\u63D0\u793A", visible: true },
|
|
228
|
+
React.createElement(Button, null, "\u6211\u662F\u6309\u94AE"))));
|
|
220
229
|
};
|
|
221
230
|
export default Detail;
|
package/dist/UI/Form/index.js
CHANGED
|
@@ -53,7 +53,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
53
53
|
import i18next from 'ztxkutils/dist/i18next';
|
|
54
54
|
import React, { useState, useMemo, useEffect } from 'react';
|
|
55
55
|
import ProForm, { useForm } from 'components/ProForm';
|
|
56
|
-
import {
|
|
56
|
+
import { Form } from 'antd';
|
|
57
|
+
import { Input, Button, Radio, EnhanceSelect, Select, Checkbox, TreeSelect, DatePicker, InputNumber, } from '../../index.build';
|
|
57
58
|
import { stringify } from 'qs';
|
|
58
59
|
import { token } from '../../constants';
|
|
59
60
|
var RangePicker = DatePicker.RangePicker;
|
|
@@ -103,10 +104,81 @@ function Home() {
|
|
|
103
104
|
}, [form, formData]);
|
|
104
105
|
var items = useMemo(function () {
|
|
105
106
|
return __spreadArray([
|
|
107
|
+
{
|
|
108
|
+
name: 'test123321',
|
|
109
|
+
label: i18next.t('测试按钮组'),
|
|
110
|
+
render: function (itemProps) {
|
|
111
|
+
return (React.createElement(Radio.Group, __assign({}, itemProps),
|
|
112
|
+
React.createElement(Radio.Button, { value: "123", key: "123" }, "123"),
|
|
113
|
+
React.createElement(Radio.Button, { value: "222", key: "222" }, "222")));
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'referenceQuote',
|
|
118
|
+
label: i18next.t('参考报价'),
|
|
119
|
+
width: 'half',
|
|
120
|
+
hideItemBorderRadius: true,
|
|
121
|
+
render: function (itemProps, formInstance) {
|
|
122
|
+
return (React.createElement(Form.Item, { noStyle: true, shouldUpdate: function (prev, cur) {
|
|
123
|
+
return (prev === null || prev === void 0 ? void 0 : prev.referenceQuote) !== (cur === null || cur === void 0 ? void 0 : cur.referenceQuote);
|
|
124
|
+
} }, function (innerForm) {
|
|
125
|
+
var _a;
|
|
126
|
+
var fieldValue = (innerForm === null || innerForm === void 0 ? void 0 : innerForm.getFieldValue('referenceQuote')) || '';
|
|
127
|
+
var _b = String(fieldValue).split(','), operator = _b[0], value = _b[1];
|
|
128
|
+
var safeOperator = (operator || '≈').replace(/</g, '<');
|
|
129
|
+
var safeValue = undefined;
|
|
130
|
+
if (value !== '') {
|
|
131
|
+
safeValue =
|
|
132
|
+
(_a = (Number.isNaN(Number(value)) ? undefined : Number(value))) !== null && _a !== void 0 ? _a : undefined;
|
|
133
|
+
}
|
|
134
|
+
return (React.createElement("div", { style: { display: 'flex' } },
|
|
135
|
+
React.createElement(Select, { style: { width: 60 }, value: safeOperator, disabled: itemProps === null || itemProps === void 0 ? void 0 : itemProps.disabled, className: "hide-boder-radius--right" },
|
|
136
|
+
React.createElement(Select.Option, { value: "<=" }, String.fromCharCode(60) + '='),
|
|
137
|
+
React.createElement(Select.Option, { value: "\u2248" }, "\u2248")),
|
|
138
|
+
React.createElement(InputNumber, { value: safeValue, style: { flex: 1 }, disabled: itemProps === null || itemProps === void 0 ? void 0 : itemProps.disabled, className: "hide-boder-radius--right hide-boder-radius--left" })));
|
|
139
|
+
}));
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'number11111',
|
|
144
|
+
label: i18next.t('数量1111'),
|
|
145
|
+
isRequired: true,
|
|
146
|
+
isChangeable: false,
|
|
147
|
+
render: function (itemProps) {
|
|
148
|
+
return React.createElement(InputNumber, __assign({}, itemProps));
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'number3333',
|
|
153
|
+
label: i18next.t('数量3333'),
|
|
154
|
+
isRequired: true,
|
|
155
|
+
render: function (itemProps) {
|
|
156
|
+
return React.createElement(InputNumber, __assign({}, itemProps));
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'number22222',
|
|
161
|
+
label: i18next.t('富文本输入'),
|
|
162
|
+
isRequired: true,
|
|
163
|
+
isChangeable: false,
|
|
164
|
+
render: function (itemProps) {
|
|
165
|
+
return React.createElement(Input.Quill, __assign({ disabled: true }, itemProps));
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'number2222',
|
|
170
|
+
label: i18next.t('数量2222'),
|
|
171
|
+
// isRequired: true,
|
|
172
|
+
isChangeable: false,
|
|
173
|
+
render: function (itemProps) {
|
|
174
|
+
return React.createElement(InputNumber, __assign({}, itemProps));
|
|
175
|
+
},
|
|
176
|
+
},
|
|
106
177
|
{
|
|
107
178
|
name: 'test1',
|
|
108
179
|
label: i18next.t('测试1'),
|
|
109
180
|
isRequired: true,
|
|
181
|
+
isChangeable: false,
|
|
110
182
|
render: function (itemProps) {
|
|
111
183
|
console.log(i18next.t('测试1'), state);
|
|
112
184
|
return (React.createElement(Input, __assign({}, itemProps, { allowClear: true })));
|
|
@@ -298,7 +370,7 @@ function Home() {
|
|
|
298
370
|
label: i18next.t('测试9'),
|
|
299
371
|
isRequired: true,
|
|
300
372
|
valuePropName: 'checked',
|
|
301
|
-
noLabel: true,
|
|
373
|
+
// noLabel: true,
|
|
302
374
|
showBoxBorder: true,
|
|
303
375
|
shouldUpdateBeOutsideState: function () { return false; },
|
|
304
376
|
render: function (itemProps, formInstance) {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { memo, useMemo } from 'react';
|
|
24
|
+
import { Alert as AntAlert } from 'antd';
|
|
25
|
+
import { ZtIcon as Icon } from '../../index.build';
|
|
26
|
+
import classNames from 'classnames';
|
|
27
|
+
var Alert = function (props) {
|
|
28
|
+
var type = props.type, _a = props.showIcon, showIcon = _a === void 0 ? true : _a, marginTop = props.marginTop, marginBottom = props.marginBottom, inline = props.inline, className = props.className, resetProps = __rest(props, ["type", "showIcon", "marginTop", "marginBottom", "inline", "className"]);
|
|
29
|
+
var classes = classNames('zt-alert', className, {
|
|
30
|
+
'zt-alert--margin-top': marginTop,
|
|
31
|
+
'zt-alert--margin-bottom': marginBottom,
|
|
32
|
+
'zt-alert--inline': inline,
|
|
33
|
+
});
|
|
34
|
+
var iconCom = useMemo(function () {
|
|
35
|
+
if (type === 'error') {
|
|
36
|
+
return React.createElement(Icon, { type: "icon-cuowu" });
|
|
37
|
+
}
|
|
38
|
+
if (type === 'success') {
|
|
39
|
+
return React.createElement(Icon, { type: "icon-chenggong" });
|
|
40
|
+
}
|
|
41
|
+
if (type === 'info') {
|
|
42
|
+
return React.createElement(Icon, { type: "icon-tishi" });
|
|
43
|
+
}
|
|
44
|
+
if (type === 'warning') {
|
|
45
|
+
return React.createElement(Icon, { type: "icon-jinggao" });
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}, [type]);
|
|
49
|
+
return (React.createElement(AntAlert, __assign({ icon: iconCom, showIcon: showIcon, type: type, className: classes }, resetProps)));
|
|
50
|
+
};
|
|
51
|
+
var MemoAlert = memo(Alert);
|
|
52
|
+
MemoAlert.displayName = 'ZTXK_WEBUI_Alert';
|
|
53
|
+
MemoAlert.ErrorBoundary = AntAlert.ErrorBoundary;
|
|
54
|
+
export default MemoAlert;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Alert, Button } from '../../../index.build';
|
|
3
|
+
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 }),
|
|
9
|
+
React.createElement("div", null,
|
|
10
|
+
"\u4F60\u597D",
|
|
11
|
+
React.createElement(Alert, { message: "\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
|
+
};
|
|
24
|
+
export default Demo;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Alert } from 'antd';
|
|
3
|
+
import { AlertProps } from 'antd/es/alert';
|
|
4
|
+
export interface IAlertProps extends AlertProps {
|
|
5
|
+
marginTop?: boolean;
|
|
6
|
+
marginBottom?: boolean;
|
|
7
|
+
/** 是否行内显示 */
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface AlertComponent extends React.FC<IAlertProps> {
|
|
11
|
+
displayName: string;
|
|
12
|
+
ErrorBoundary: typeof Alert.ErrorBoundary;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,6 +16,8 @@ export interface IProps extends ButtonProps {
|
|
|
16
16
|
compact?: boolean;
|
|
17
17
|
/** 是否按UI周查样式调整,可覆盖全局配置 */
|
|
18
18
|
isUIWeeklyReview?: boolean;
|
|
19
|
+
/** 按钮旁显示Tooltip提示图标 */
|
|
20
|
+
toolTip?: React.ReactNode;
|
|
19
21
|
}
|
|
20
22
|
declare const ButtonHige: React.FC<IProps>;
|
|
21
23
|
export default ButtonHige;
|
|
@@ -58,14 +58,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
};
|
|
59
59
|
import i18next from 'ztxkutils/dist/i18next';
|
|
60
60
|
import React, { useRef, useState } from 'react';
|
|
61
|
-
import { Button as AntButton, Popconfirm } from 'antd';
|
|
61
|
+
import { Button as AntButton, Popconfirm, Tooltip } from 'antd';
|
|
62
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
62
63
|
import classNames from 'classnames';
|
|
63
64
|
import useBaseContext from '../utils/useBaseContext';
|
|
64
65
|
import { getFinalValue } from '../utils';
|
|
65
66
|
var maxClickTime = 1000;
|
|
66
67
|
var Button = function (props) {
|
|
67
68
|
var _a;
|
|
68
|
-
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, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick", "showCopy", "copyContainerStyle", "isAsync", "compact", "isUIWeeklyReview"]);
|
|
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"]);
|
|
69
70
|
var contextUIWeeklyReview = useBaseContext().isUIWeeklyReview;
|
|
70
71
|
var isUIWeeklyReviewBool = getFinalValue(contextUIWeeklyReview, componentUIWeeklyReview);
|
|
71
72
|
var finalType = isUIWeeklyReviewBool ? type || 'default' : type;
|
|
@@ -173,13 +174,19 @@ var Button = function (props) {
|
|
|
173
174
|
document.body.removeChild(textarea);
|
|
174
175
|
};
|
|
175
176
|
return showCopy ? (React.createElement("div", { className: "copy-btn--container", style: copyContainerStyle },
|
|
176
|
-
React.createElement(AntButton, __assign({ className: classes, type: finalType, disabled: disabled, size: size, danger: danger, onClick: isAsync ? asyncClick : myOnClick, ref: btnRef, loading: loading }, restProps),
|
|
177
|
+
React.createElement(AntButton, __assign({ className: classes, type: finalType, disabled: disabled, size: size, danger: danger, onClick: isAsync ? asyncClick : myOnClick, ref: btnRef, loading: loading }, restProps),
|
|
178
|
+
props.children,
|
|
179
|
+
toolTip && (React.createElement(Tooltip, { title: toolTip },
|
|
180
|
+
React.createElement(QuestionCircleOutlined, null)))),
|
|
177
181
|
showCopy && (React.createElement(AntButton, { type: "link", onClick: onClickHandle, style: {
|
|
178
182
|
paddingLeft: 0,
|
|
179
183
|
paddingRight: 0,
|
|
180
184
|
fontSize: '12px',
|
|
181
185
|
color: '#4285f4',
|
|
182
|
-
} }, i18next.t('复制'))))) : (React.createElement(AntButton, __assign({ className: classes, type: finalType, disabled: disabled, size: size, danger: danger, onClick: isAsync ? asyncClick : myOnClick, ref: btnRef, loading: loading }, restProps),
|
|
186
|
+
} }, i18next.t('复制'))))) : (React.createElement(AntButton, __assign({ className: classes, type: finalType, disabled: disabled, size: size, danger: danger, onClick: isAsync ? asyncClick : myOnClick, ref: btnRef, loading: loading }, restProps),
|
|
187
|
+
props.children,
|
|
188
|
+
toolTip && (React.createElement(Tooltip, { title: toolTip },
|
|
189
|
+
React.createElement(QuestionCircleOutlined, null)))));
|
|
183
190
|
};
|
|
184
191
|
var ButtonHige = function (_a) {
|
|
185
192
|
var confirmMsg = _a.confirmMsg, props = __rest(_a, ["confirmMsg"]);
|
|
@@ -64,6 +64,7 @@ var Demo = function () {
|
|
|
64
64
|
}
|
|
65
65
|
return [2 /*return*/, new Promise(function () { })];
|
|
66
66
|
});
|
|
67
|
-
}); }, disabled: false, type: "primary" }, i18next.t('点击1'))
|
|
67
|
+
}); }, disabled: false, type: "primary" }, i18next.t('点击1')),
|
|
68
|
+
React.createElement(Button, { toolTip: "\u70B9\u51FB\u67E5\u770B\u8BE6\u60C5" }, "\u4F60\u597D")));
|
|
68
69
|
};
|
|
69
70
|
export default Demo;
|
|
@@ -5,6 +5,10 @@ export interface IProps extends CollapseProps {
|
|
|
5
5
|
showHeaderBefore?: boolean;
|
|
6
6
|
showBackground?: boolean;
|
|
7
7
|
collapsible?: any;
|
|
8
|
+
/** item添加边距 */
|
|
9
|
+
itemMargin?: boolean;
|
|
10
|
+
/** 内容区域添加顶部间距 */
|
|
11
|
+
contentPaddingTop?: boolean;
|
|
8
12
|
}
|
|
9
13
|
declare function Collapse(props: IProps): JSX.Element;
|
|
10
14
|
declare namespace Collapse {
|
|
@@ -25,12 +25,20 @@ import React from 'react';
|
|
|
25
25
|
import { Collapse as AntCollapse } from 'antd';
|
|
26
26
|
import { DownOutlined } from '@ant-design/icons';
|
|
27
27
|
import classNames from 'classnames';
|
|
28
|
+
import useBaseContext from '../utils/useBaseContext';
|
|
29
|
+
import { getFinalValue } from '../utils';
|
|
28
30
|
function Collapse(props) {
|
|
29
|
-
var children = props.children, className = props.className, _a = props.showHeaderBefore, showHeaderBefore = _a === void 0 ? true : _a, showBackground = props.showBackground, _b = props.collapsible, collapsible = _b === void 0 ? 'icon' : _b, restProps = __rest(props, ["children", "className", "showHeaderBefore", "showBackground", "collapsible"]);
|
|
31
|
+
var children = props.children, className = props.className, _a = props.showHeaderBefore, showHeaderBefore = _a === void 0 ? true : _a, showBackground = props.showBackground, _b = props.collapsible, collapsible = _b === void 0 ? 'icon' : _b, itemMargin = props.itemMargin, contentPaddingTop = props.contentPaddingTop, restProps = __rest(props, ["children", "className", "showHeaderBefore", "showBackground", "collapsible", "itemMargin", "contentPaddingTop"]);
|
|
32
|
+
var isUIWeeklyReview = useBaseContext().isUIWeeklyReview;
|
|
33
|
+
var finalItemMargin = getFinalValue(isUIWeeklyReview, itemMargin);
|
|
34
|
+
var finalShowBackground = getFinalValue(isUIWeeklyReview, showBackground);
|
|
30
35
|
var classes = classNames('zt-collapse', className, {
|
|
31
36
|
'zt-collapse--noBorder': !props.bordered,
|
|
32
37
|
'zt-collaspse--header-before': showHeaderBefore,
|
|
33
|
-
'zt-collaspse--header-bg':
|
|
38
|
+
'zt-collaspse--header-bg': finalShowBackground,
|
|
39
|
+
'zt-collapse--item-margin': finalItemMargin,
|
|
40
|
+
'zt-collapse--content-pt': contentPaddingTop,
|
|
41
|
+
'zt-collapse--new-ui': isUIWeeklyReview,
|
|
34
42
|
});
|
|
35
43
|
var expandIconFn = function (_a) {
|
|
36
44
|
var isActive = _a.isActive;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormItemProps, FormInstance } from 'antd/lib/form';
|
|
3
3
|
import { IProps as FormProps } from '../Form/form';
|
|
4
|
-
export declare type IWidth = 'half' | 'double' | 'all' | 'halfAll';
|
|
4
|
+
export declare type IWidth = 'half' | 'double' | 'all' | 'halfAll' | string;
|
|
5
5
|
export interface IFormItemWrap {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
@@ -89,6 +89,10 @@ export interface IFormItem extends FormItemProps {
|
|
|
89
89
|
* 详情页的单个元素跨度
|
|
90
90
|
*/
|
|
91
91
|
span?: number;
|
|
92
|
+
/**
|
|
93
|
+
* 是否隐藏表单项内的圆角
|
|
94
|
+
*/
|
|
95
|
+
hideItemBorderRadius?: boolean;
|
|
92
96
|
}
|
|
93
97
|
export interface IProFormProps extends FormProps {
|
|
94
98
|
items: IFormItem[];
|
|
@@ -30,7 +30,7 @@ function runHandle(form, handle) {
|
|
|
30
30
|
}
|
|
31
31
|
function Item(item) {
|
|
32
32
|
var _a, _b, _c;
|
|
33
|
-
var render = item.render, isRequired = item.isRequired, isDisplay = item.isDisplay, isChangeable = item.isChangeable, dependencies = item.dependencies, shouldUpdate = item.shouldUpdate, preText = item.preText, nextText = item.nextText, disabled = item.disabled, noBorder = item.noBorder, noLabel = item.noLabel, showBoxBorder = item.showBoxBorder, width = item.width, shouldUpdateNames = item.shouldUpdateNames, shouldUpdateClear = item.shouldUpdateClear, configName = item.configName, index = item.index, itemClassName = item.itemClassName, form = item.form, _isDisplayConfigInfo = item._isDisplayConfigInfo, _isRequireConfigInfo = item._isRequireConfigInfo, _isChangeableConfigInfo = item._isChangeableConfigInfo, outsideState = item.outsideState, shouldUpdateBeOutsideState = item.shouldUpdateBeOutsideState, resetItem = __rest(item, ["render", "isRequired", "isDisplay", "isChangeable", "dependencies", "shouldUpdate", "preText", "nextText", "disabled", "noBorder", "noLabel", "showBoxBorder", "width", "shouldUpdateNames", "shouldUpdateClear", "configName", "index", "itemClassName", "form", "_isDisplayConfigInfo", "_isRequireConfigInfo", "_isChangeableConfigInfo", "outsideState", "shouldUpdateBeOutsideState"]);
|
|
33
|
+
var render = item.render, isRequired = item.isRequired, isDisplay = item.isDisplay, isChangeable = item.isChangeable, dependencies = item.dependencies, shouldUpdate = item.shouldUpdate, preText = item.preText, nextText = item.nextText, disabled = item.disabled, noBorder = item.noBorder, noLabel = item.noLabel, showBoxBorder = item.showBoxBorder, width = item.width, shouldUpdateNames = item.shouldUpdateNames, shouldUpdateClear = item.shouldUpdateClear, configName = item.configName, index = item.index, itemClassName = item.itemClassName, form = item.form, _isDisplayConfigInfo = item._isDisplayConfigInfo, _isRequireConfigInfo = item._isRequireConfigInfo, _isChangeableConfigInfo = item._isChangeableConfigInfo, outsideState = item.outsideState, shouldUpdateBeOutsideState = item.shouldUpdateBeOutsideState, hideItemBorderRadius = item.hideItemBorderRadius, resetItem = __rest(item, ["render", "isRequired", "isDisplay", "isChangeable", "dependencies", "shouldUpdate", "preText", "nextText", "disabled", "noBorder", "noLabel", "showBoxBorder", "width", "shouldUpdateNames", "shouldUpdateClear", "configName", "index", "itemClassName", "form", "_isDisplayConfigInfo", "_isRequireConfigInfo", "_isChangeableConfigInfo", "outsideState", "shouldUpdateBeOutsideState", "hideItemBorderRadius"]);
|
|
34
34
|
// 处理配置相关逻辑 配置优先代码设置
|
|
35
35
|
// 传入了是否展示配置
|
|
36
36
|
var _isDisplay = typeof _isDisplayConfigInfo === 'undefined'
|
|
@@ -89,6 +89,7 @@ function Item(item) {
|
|
|
89
89
|
'pro-form__item--noborder': noBorder,
|
|
90
90
|
'pro-form__item--nolabel': noLabel,
|
|
91
91
|
'pro-form__item--showboxborder': showBoxBorder,
|
|
92
|
+
'pro-form__item--hideitemborderradius': hideItemBorderRadius,
|
|
92
93
|
'pro-form__item--required': (resetItem === null || resetItem === void 0 ? void 0 : resetItem.rules) &&
|
|
93
94
|
((_c = (_b = resetItem.rules) === null || _b === void 0 ? void 0 : _b.find) === null || _c === void 0 ? void 0 : _c.call(_b, function (item) { return !!item.required; })),
|
|
94
95
|
});
|
|
@@ -146,7 +147,7 @@ function getWidthStr(width) {
|
|
|
146
147
|
case 'halfAll':
|
|
147
148
|
return '50%';
|
|
148
149
|
default:
|
|
149
|
-
return '33.33%';
|
|
150
|
+
return width || '33.33%';
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
function ItemWrap(props) {
|
|
@@ -112,6 +112,12 @@ export interface IProps<RecordType> extends Omit<TableProps<RecordType>, 'column
|
|
|
112
112
|
defaultTableOperationBtnGroupShowMore?: boolean;
|
|
113
113
|
/** 右键是否显示全屏功能 */
|
|
114
114
|
isContextMenuFullscreen?: boolean;
|
|
115
|
+
/** 表格标题 */
|
|
116
|
+
tableTitle?: React.ReactNode;
|
|
117
|
+
/**
|
|
118
|
+
* 树表格添加背景色
|
|
119
|
+
*/
|
|
120
|
+
expandRowBackground?: boolean;
|
|
115
121
|
}
|
|
116
122
|
/**
|
|
117
123
|
* TodoList
|