@zat-design/sisyphus-react 3.1.4 → 3.1.5-beta.10
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/.dumi/theme/builtins/Alert.tsx +19 -0
- package/.dumi/theme/builtins/Previewer.tsx +232 -0
- package/.dumi/theme/builtins/SourceCode.tsx +64 -0
- package/.dumi/theme/hooks/useCodeSandbox.tsx +197 -0
- package/.dumi/theme/hooks/useTheme.tsx +707 -0
- package/.dumi/theme/layouts/BasicLayout.tsx +88 -0
- package/.dumi/theme/layouts/components/Dark.less +157 -0
- package/.dumi/theme/layouts/components/Dark.tsx +78 -0
- package/.dumi/theme/layouts/components/Navbar.tsx +83 -0
- package/.dumi/theme/layouts/components/SideMenu.tsx +61 -0
- package/.dumi/theme/layouts/index.tsx +26 -0
- package/.dumi/theme/layouts/layout.less +87 -0
- package/.dumi/theme/typings.d.ts +7 -0
- package/dist/index.esm.css +122 -249
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +18 -2
- package/es/ProDrawerForm/index.js +5 -3
- package/es/ProDrawerForm/style/index.less +15 -11
- package/es/ProEditLabel/style/index.less +2 -2
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.js +11 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/TextArea/index.less +1 -1
- package/es/ProForm/components/combination/Container/style/index.less +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +20 -19
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +81 -61
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/RenderFields.js +10 -5
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +5 -0
- package/es/ProForm/style/index.less +55 -169
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/es/ProLayout/components/ProHeader/components/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +4 -2
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProStep/style/index.less +0 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/es/ProTable/components/RenderColumn/index.js +41 -25
- package/es/ProTable/index.js +3 -2
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +258 -201
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +1 -1
- package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/index.js +24 -17
- package/es/ProThemeTools/propsType.d.ts +8 -6
- package/es/ProThemeTools/style/index.less +2 -2
- package/es/ProThemeTools/utils/index.d.ts +7 -0
- package/es/ProThemeTools/utils/index.js +19 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +6 -1
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/style/index.less +41 -39
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +69 -0
- package/es/locale/en_US.js +68 -0
- package/es/locale/index.d.ts +7 -0
- package/es/locale/index.js +21 -0
- package/es/locale/zh_CN.d.ts +69 -0
- package/es/locale/zh_CN.js +68 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -1
- package/es/style/theme/antd.less +3 -4
- package/es/style/theme/index.less +80 -79
- package/es/style/theme/tokens.less +1 -0
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +17 -2
- package/lib/ProDrawerForm/index.js +5 -3
- package/lib/ProDrawerForm/style/index.less +15 -11
- package/lib/ProEditLabel/style/index.less +2 -2
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.js +11 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/base/RangePicker/index.js +0 -3
- package/lib/ProForm/components/base/TextArea/index.less +1 -1
- package/lib/ProForm/components/combination/Container/style/index.less +0 -1
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +76 -58
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/render/RenderFields.js +9 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +5 -0
- package/lib/ProForm/style/index.less +55 -169
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
- package/lib/ProLayout/components/ProHeader/index.js +4 -2
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProStep/style/index.less +0 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/lib/ProTable/components/RenderColumn/index.js +38 -24
- package/lib/ProTable/index.js +3 -2
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
- package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/index.js +23 -16
- package/lib/ProThemeTools/propsType.d.ts +8 -6
- package/lib/ProThemeTools/style/index.less +2 -2
- package/lib/ProThemeTools/utils/index.d.ts +7 -0
- package/lib/ProThemeTools/utils/index.js +20 -2
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +6 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/style/index.less +41 -39
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -1
- package/lib/locale/en_US.d.ts +69 -0
- package/lib/locale/en_US.js +74 -0
- package/lib/locale/index.d.ts +7 -0
- package/lib/locale/index.js +28 -0
- package/lib/locale/zh_CN.d.ts +69 -0
- package/lib/locale/zh_CN.js +74 -0
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -1
- package/lib/style/theme/antd.less +3 -4
- package/lib/style/theme/index.less +80 -79
- package/lib/style/theme/tokens.less +1 -0
- package/package.json +2 -2
- package/typings.d.ts +2 -0
- package/es/old/ProBackBtn/style/index.less +0 -19
- package/lib/old/ProBackBtn/style/index.less +0 -19
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
justify-content: center;
|
|
9
9
|
width : 32px;
|
|
10
10
|
height : 38px;
|
|
11
|
-
color: var(--zaui-global-bg, #fff);
|
|
11
|
+
color : var(--zaui-global-bg, #fff);
|
|
12
12
|
cursor : pointer;
|
|
13
13
|
|
|
14
14
|
.close-icon {
|
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
z-index : 1;
|
|
18
18
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
19
19
|
transform: translateZ(100px);
|
|
20
|
-
fill: var(--zaui-aide-text, #909090);
|
|
20
|
+
fill : var(--zaui-aide-text, #909090);
|
|
21
21
|
|
|
22
22
|
&:hover {
|
|
23
23
|
fill: var(--zaui-brand-active, #005AD9);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
>div {
|
|
26
27
|
height: 20px;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
|
|
56
57
|
.pro-drawer-scrolling {
|
|
57
58
|
z-index : 1;
|
|
58
|
-
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
59
|
+
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
.pro-drawer-content {
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
width : 100%;
|
|
76
77
|
padding : var(--zaui-space-size-md, 16px) var(--zaui-space-size-lg, 32px);
|
|
77
78
|
background-color: var(--zaui-global-bg, #fff);
|
|
78
|
-
box-shadow : 8px 2px 8px 0 var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
79
|
+
box-shadow : 8px 2px 8px 0 var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
79
80
|
|
|
80
81
|
button {
|
|
81
82
|
margin-right: var(--zaui-space-size-sm, 8px);
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
padding : 0;
|
|
92
93
|
overflow-y: hidden;
|
|
93
94
|
}
|
|
95
|
+
|
|
94
96
|
.ant-drawer-content {
|
|
95
97
|
position: static;
|
|
96
98
|
}
|
|
@@ -105,15 +107,18 @@
|
|
|
105
107
|
.ant-modal-close-x {
|
|
106
108
|
.close-icon {
|
|
107
109
|
fill: var(--zaui-aide-text, #909090);
|
|
110
|
+
|
|
108
111
|
&:hover {
|
|
109
112
|
fill: var(--zaui-brand, #006aff);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
}
|
|
117
|
+
|
|
114
118
|
.ant-modal-header {
|
|
115
119
|
padding : var(--zaui-space-size-md, 16px);
|
|
116
120
|
border-bottom: none;
|
|
121
|
+
|
|
117
122
|
.ant-modal-title {
|
|
118
123
|
font-weight: 600;
|
|
119
124
|
}
|
|
@@ -124,7 +129,7 @@
|
|
|
124
129
|
border-top: none;
|
|
125
130
|
|
|
126
131
|
.pro-modal-footer {
|
|
127
|
-
display: flex;
|
|
132
|
+
display : flex;
|
|
128
133
|
justify-content: space-between;
|
|
129
134
|
}
|
|
130
135
|
}
|
|
@@ -143,8 +148,7 @@
|
|
|
143
148
|
.pro-modal-no-footer {
|
|
144
149
|
.ant-modal-content {
|
|
145
150
|
.ant-modal-body {
|
|
146
|
-
|
|
147
|
-
padding-bottom : var(--zaui-space-size-md, 16px);
|
|
151
|
+
padding-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1))
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
}
|
|
@@ -153,7 +157,7 @@
|
|
|
153
157
|
z-index: 1;
|
|
154
158
|
|
|
155
159
|
.ant-modal-header {
|
|
156
|
-
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
160
|
+
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
157
161
|
position : relative;
|
|
158
162
|
z-index : 1;
|
|
159
163
|
}
|
|
@@ -163,6 +167,6 @@
|
|
|
163
167
|
.ant-modal-footer {
|
|
164
168
|
position : relative;
|
|
165
169
|
z-index : 1;
|
|
166
|
-
box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
170
|
+
box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
167
171
|
}
|
|
168
|
-
}
|
|
172
|
+
}
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
font-size : var(--zaui-font-size-lg, 16px);
|
|
88
88
|
font-weight : 500;
|
|
89
89
|
color : var(--zaui-text, #343434);
|
|
90
|
-
margin-bottom: var(--zaui-space-size-sm, 8px);
|
|
90
|
+
margin-bottom: calc(var(--zaui-space-size-sm, 8px) * var(--zaui-size; 1));
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.pro-edit-label-tip {
|
|
94
|
-
margin-bottom: var(--zaui-space-size-md
|
|
94
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
95
95
|
color : #666;
|
|
96
96
|
|
|
97
97
|
.anticon-info-circle {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
text-indent : 5px;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
.drag-wrapper {
|
|
61
61
|
display: flex;
|
|
62
62
|
.drag-icon {
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
line-height: 1;
|
|
111
111
|
content : "*";
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
&.is-required-left {
|
|
115
115
|
&::after {
|
|
116
116
|
display: none;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
&::before {
|
|
120
120
|
position : static;
|
|
121
121
|
top : 0;
|
|
@@ -140,6 +140,13 @@
|
|
|
140
140
|
.ant-table-cell-fix-left,
|
|
141
141
|
.ant-table-cell-fix-right {
|
|
142
142
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ant-table-cell-fix-right-first {
|
|
148
|
+
&::after {
|
|
149
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
152
|
|
|
@@ -175,12 +182,12 @@
|
|
|
175
182
|
line-height: 1;
|
|
176
183
|
content : "*";
|
|
177
184
|
}
|
|
178
|
-
|
|
185
|
+
|
|
179
186
|
&.is-required-left {
|
|
180
187
|
&::after {
|
|
181
188
|
display: none;
|
|
182
189
|
}
|
|
183
|
-
|
|
190
|
+
|
|
184
191
|
&::before {
|
|
185
192
|
position : static;
|
|
186
193
|
top : 0;
|
|
@@ -282,7 +289,7 @@
|
|
|
282
289
|
}
|
|
283
290
|
|
|
284
291
|
.pro-edit-table-header {
|
|
285
|
-
margin-bottom: var(--zaui-space-size-md
|
|
292
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
286
293
|
}
|
|
287
294
|
|
|
288
295
|
.pro-edit-table-toolbar-fixed {
|
|
@@ -300,11 +307,11 @@
|
|
|
300
307
|
display: flex;
|
|
301
308
|
align-items: center;
|
|
302
309
|
padding: 0 var(--zaui-space-size-xs, 4px);
|
|
303
|
-
|
|
310
|
+
|
|
304
311
|
&:first-child {
|
|
305
312
|
padding-left: 0;
|
|
306
313
|
}
|
|
307
|
-
|
|
314
|
+
|
|
308
315
|
span:nth-child(2) {
|
|
309
316
|
margin-left: var(--zaui-space-size-xs, 4px);
|
|
310
317
|
}
|
|
@@ -13,6 +13,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
var _icons = require("@ant-design/icons");
|
|
15
15
|
var _antd = require("antd");
|
|
16
|
+
var _lodash = require("lodash");
|
|
16
17
|
var _tools = require("./tools");
|
|
17
18
|
var defaultBtnNameMap = exports.defaultBtnNameMap = {
|
|
18
19
|
add: '添加',
|
|
@@ -68,7 +69,7 @@ var actions = exports.actions = {
|
|
|
68
69
|
},
|
|
69
70
|
save: function () {
|
|
70
71
|
var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
|
71
|
-
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys;
|
|
72
|
+
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
|
72
73
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
73
74
|
while (1) switch (_context.prev = _context.next) {
|
|
74
75
|
case 0:
|
|
@@ -86,11 +87,14 @@ var actions = exports.actions = {
|
|
|
86
87
|
} else {
|
|
87
88
|
delete record.isEditing;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
// 防止value引用不变, 值不更新 - (自定义组件)
|
|
91
|
+
values = form.getFieldsValue();
|
|
92
|
+
(0, _lodash.set)(values, rowName, record);
|
|
93
|
+
form.setFieldsValue(values);
|
|
90
94
|
setState({
|
|
91
95
|
editingKeys: nextEditingKeys
|
|
92
96
|
});
|
|
93
|
-
case
|
|
97
|
+
case 10:
|
|
94
98
|
case "end":
|
|
95
99
|
return _context.stop();
|
|
96
100
|
}
|
|
@@ -130,7 +134,10 @@ var actions = exports.actions = {
|
|
|
130
134
|
selectedRowKeys: [record.rowKey]
|
|
131
135
|
});
|
|
132
136
|
} else {
|
|
133
|
-
|
|
137
|
+
// 防止value引用不变, 值不更新 - (自定义组件)
|
|
138
|
+
var values = form.getFieldsValue();
|
|
139
|
+
(0, _lodash.set)(values, virtualRowName, record);
|
|
140
|
+
form.setFieldsValue(values);
|
|
134
141
|
}
|
|
135
142
|
},
|
|
136
143
|
delete: function _delete(_ref4) {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
margin-right: var(--zaui-space-size-sm);
|
|
12
|
-
|
|
12
|
+
margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
|
|
13
13
|
padding: var(--zaui-space-size-xs) 10px;
|
|
14
14
|
background-color: #f5f5f5;
|
|
15
15
|
border-radius: var(--zaui-space-size-xs);
|
|
@@ -54,9 +54,6 @@ var RangePicker = function RangePicker(props) {
|
|
|
54
54
|
var _res = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
55
55
|
showTime: !rest.showTime && valueType === 'dateTime' || rest.showTime
|
|
56
56
|
});
|
|
57
|
-
if (_res === null || _res === void 0 ? void 0 : _res.placeholder) {
|
|
58
|
-
_res === null || _res === void 0 ? true : delete _res.placeholder;
|
|
59
|
-
}
|
|
60
57
|
// 字符串时间格式兼容
|
|
61
58
|
if (Array.isArray(_res.value) && (0, _lodash.isString)(_res.value[0]) && (0, _lodash.isString)(_res.value[1])) {
|
|
62
59
|
_res.value = [(0, _moment.default)(_res.value[0]), (0, _moment.default)(_res.value[1])];
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
.pro-form-list-block-title {
|
|
2
|
-
height: 14px;
|
|
3
|
-
margin:
|
|
4
|
-
padding-left:
|
|
5
|
-
font-weight: 600;
|
|
6
|
-
line-height: 14px;
|
|
7
|
-
border-left: 4px solid
|
|
2
|
+
height : 14px;
|
|
3
|
+
margin : @zaui-space-size-xs 0;
|
|
4
|
+
padding-left: @zaui-space-size-sm;
|
|
5
|
+
font-weight : 600;
|
|
6
|
+
line-height : 14px;
|
|
7
|
+
border-left : 4px solid @zaui-brand;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.pro-form-list {
|
|
11
|
-
display: flex;
|
|
11
|
+
display : flex;
|
|
12
12
|
padding-bottom: 0;
|
|
13
13
|
|
|
14
14
|
&.pro-form-list-last {
|
|
15
|
+
|
|
15
16
|
.pro-form-list-drag-handle,
|
|
16
17
|
.ant-form-item {
|
|
17
18
|
margin-bottom: 0 !important;
|
|
@@ -19,12 +20,12 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.single-delete {
|
|
22
|
-
width: 14px !important;
|
|
23
|
+
width : 14px !important;
|
|
23
24
|
height: 14px !important;
|
|
24
|
-
color:
|
|
25
|
+
color : @zaui-placeholder;
|
|
25
26
|
|
|
26
27
|
&:hover {
|
|
27
|
-
color:
|
|
28
|
+
color: @zaui-aide-text;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -35,19 +36,19 @@
|
|
|
35
36
|
.pro-form-list-action {
|
|
36
37
|
padding-bottom: var(--zaui-height-size-md, 16px);
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
margin-left:
|
|
39
|
+
&>.ant-space-item:first-child>.ant-btn-link {
|
|
40
|
+
margin-left: @zaui-space-size-sm;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
.pro-form-list-drag-handle {
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
height: @zaui-height-size-lg;
|
|
47
|
-
margin-bottom:
|
|
48
|
-
padding: 0;
|
|
45
|
+
display : flex;
|
|
46
|
+
align-items : center;
|
|
47
|
+
height : @zaui-height-size-lg;
|
|
48
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
49
|
+
padding : 0;
|
|
49
50
|
padding-right: @zaui-space-size-sm;
|
|
50
|
-
border: none;
|
|
51
|
+
border : none;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
.pro-form-list-toolbar,
|
|
63
64
|
.pro-form-list-action {
|
|
64
65
|
.ant-btn-link {
|
|
65
|
-
padding:
|
|
66
|
+
padding: @zaui-space-size-xs 0;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
.ant-btn-text:hover {
|
|
@@ -33,7 +33,7 @@ var Group = function Group(props) {
|
|
|
33
33
|
var fieldList = [];
|
|
34
34
|
var result = columns.map(function (item) {
|
|
35
35
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
36
|
-
disabled: props === null || props === void 0 ? void 0 : props.disabled
|
|
36
|
+
disabled: Boolean(props === null || props === void 0 ? void 0 : props.disabled)
|
|
37
37
|
}, item), {}, {
|
|
38
38
|
noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
|
|
39
39
|
parentNames: _parentNames
|
|
@@ -47,7 +47,7 @@ var Group = function Group(props) {
|
|
|
47
47
|
columns: (0, _utils.insertSeparator)(result, space, node, otherProps),
|
|
48
48
|
fieldList: fieldList
|
|
49
49
|
};
|
|
50
|
-
}, [name, columns, space]);
|
|
50
|
+
}, [name, columns, space, props]);
|
|
51
51
|
var _className = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
52
52
|
'pro-group': true,
|
|
53
53
|
'pro-group-diy-width': columns.some(function (item) {
|
|
@@ -19,8 +19,9 @@ var _antd = require("antd");
|
|
|
19
19
|
var _utils = require("@zat-design/utils");
|
|
20
20
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
21
21
|
var _useEnum = _interopRequireDefault(require("../../../../ProEnum/hooks/useEnum"));
|
|
22
|
-
var _excluded = ["getPopupContainer", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator"];
|
|
22
|
+
var _excluded = ["className", "getPopupContainer", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator"];
|
|
23
23
|
var transformDataName = _utils.tools.transformDataName;
|
|
24
|
+
var Text = _antd.Typography.Text;
|
|
24
25
|
var filterDataSource = function filterDataSource(dataSource, level) {
|
|
25
26
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
26
27
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
@@ -56,7 +57,8 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
56
57
|
configEnumCode = _ref.enumCode,
|
|
57
58
|
configCode = _ref.code;
|
|
58
59
|
// console.count('地址组件渲染次数');
|
|
59
|
-
var
|
|
60
|
+
var className = props.className,
|
|
61
|
+
getPopupContainer = props.getPopupContainer,
|
|
60
62
|
_props$hasDetail = props.hasDetail,
|
|
61
63
|
hasDetail = _props$hasDetail === void 0 ? true : _props$hasDetail,
|
|
62
64
|
_props$detailMaxLengt = props.detailMaxLength,
|
|
@@ -173,7 +175,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
173
175
|
transFormData = transformDataName(newData, {
|
|
174
176
|
label: fieldNames.label,
|
|
175
177
|
value: fieldNames.value,
|
|
176
|
-
children: 'children'
|
|
178
|
+
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
|
177
179
|
});
|
|
178
180
|
setServiceData(realLevel === 2 ? filterDataSource(transFormData, level) : transFormData);
|
|
179
181
|
}
|
|
@@ -267,19 +269,19 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
267
269
|
}, [service]);
|
|
268
270
|
(0, _react.useEffect)(function () {
|
|
269
271
|
// 传入useRequest时初始化province展示
|
|
270
|
-
if (service && !fetched && province) {
|
|
272
|
+
if (service && loadData && !fetched && province) {
|
|
271
273
|
initAddressLabel('province', province, provinceOptions);
|
|
272
274
|
}
|
|
273
275
|
}, [province, fetched, provinceOptions]);
|
|
274
276
|
(0, _react.useEffect)(function () {
|
|
275
277
|
// 传入useRequest时初始化city展示
|
|
276
|
-
if (service && !fetched && province && city) {
|
|
278
|
+
if (service && loadData && !fetched && province && city) {
|
|
277
279
|
initAddressLabel('city', city, (0, _defineProperty2.default)({}, parentKey, province));
|
|
278
280
|
}
|
|
279
281
|
}, [province, city, fetched]);
|
|
280
282
|
(0, _react.useEffect)(function () {
|
|
281
283
|
// 传入useRequest时初始化county展示
|
|
282
|
-
if (service && !fetched && city && county) {
|
|
284
|
+
if (service && loadData && !fetched && city && county) {
|
|
283
285
|
initAddressLabel('county', county, (0, _defineProperty2.default)({}, parentKey, city));
|
|
284
286
|
}
|
|
285
287
|
}, [city, county, fetched]);
|
|
@@ -289,6 +291,12 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
289
291
|
setDefaultLabel(getAddressLabel(realDataSource, value));
|
|
290
292
|
}
|
|
291
293
|
}, [realIsView, value, realDataSource]);
|
|
294
|
+
(0, _react.useEffect)(function () {
|
|
295
|
+
// 传入useRequest但loadData为fasle查看时初始化展示
|
|
296
|
+
if (realIsView && value && (serviceData === null || serviceData === void 0 ? void 0 : serviceData.length) > 0) {
|
|
297
|
+
setDefaultLabel(getAddressLabel(serviceData, value));
|
|
298
|
+
}
|
|
299
|
+
}, [realIsView, value, serviceData]);
|
|
292
300
|
var handleLoadData = /*#__PURE__*/function () {
|
|
293
301
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4(selectedOptions) {
|
|
294
302
|
var targetOption, data;
|
|
@@ -322,14 +330,14 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
322
330
|
return _ref10.apply(this, arguments);
|
|
323
331
|
};
|
|
324
332
|
}();
|
|
325
|
-
var handleChange = function handleChange(changeValue) {
|
|
333
|
+
var handleChange = function handleChange(changeValue, selectedOptions) {
|
|
326
334
|
if (onChange) {
|
|
327
335
|
if (hasDetail && address) {
|
|
328
336
|
var realValue = changeValue || [];
|
|
329
337
|
realValue[realLevel] = address;
|
|
330
|
-
onChange(realValue);
|
|
338
|
+
onChange(realValue, selectedOptions);
|
|
331
339
|
} else {
|
|
332
|
-
onChange(changeValue);
|
|
340
|
+
onChange(changeValue, selectedOptions);
|
|
333
341
|
}
|
|
334
342
|
}
|
|
335
343
|
};
|
|
@@ -364,56 +372,66 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
364
372
|
var viewValue = ((_ref11 = [provinceLabel, cityLabel, countyLabel, value === null || value === void 0 ? void 0 : value[realLevel]]) === null || _ref11 === void 0 ? void 0 : (_ref11$filter = _ref11.filter(function (item) {
|
|
365
373
|
return !!item;
|
|
366
374
|
})) === null || _ref11$filter === void 0 ? void 0 : _ref11$filter.join(separator)) || '-';
|
|
367
|
-
return (0, _jsxRuntime.jsx)(
|
|
368
|
-
className:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
disabled: disabled,
|
|
376
|
-
displayRender: function displayRender(label) {
|
|
377
|
-
return label === null || label === void 0 ? void 0 : label.filter(function (item) {
|
|
378
|
-
return !!item;
|
|
379
|
-
}).join('/');
|
|
380
|
-
},
|
|
381
|
-
showSearch: {
|
|
382
|
-
filter: handlefilter
|
|
383
|
-
},
|
|
384
|
-
onChange: handleChange
|
|
385
|
-
}) : (0, _jsxRuntime.jsx)(_antd.Cascader, {
|
|
386
|
-
className: hasDetail ? '' : 'no-detail',
|
|
387
|
-
placeholder: "\u8BF7\u9009\u62E9",
|
|
388
|
-
value: addressValue,
|
|
389
|
-
loadData: handleLoadData,
|
|
390
|
-
// @ts-ignore
|
|
391
|
-
options: provinces,
|
|
392
|
-
disabled: disabled,
|
|
393
|
-
displayRender: displayRender,
|
|
394
|
-
changeOnSelect: true,
|
|
395
|
-
// @ts-ignore
|
|
396
|
-
onChange: handleChange
|
|
397
|
-
}), hasDetail && (tooltip && disabled && address ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
398
|
-
title: address,
|
|
399
|
-
children: (0, _jsxRuntime.jsx)("span", {
|
|
400
|
-
className: "pro-address-detail",
|
|
401
|
-
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
402
|
-
disabled: disabled,
|
|
403
|
-
value: address
|
|
404
|
-
})
|
|
405
|
-
})
|
|
406
|
-
}) : (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
407
|
-
allowClear: true,
|
|
408
|
-
autoComplete: "off",
|
|
409
|
-
disabled: disabled,
|
|
410
|
-
value: address,
|
|
411
|
-
maxLength: detailMaxLength,
|
|
412
|
-
placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740",
|
|
413
|
-
// @ts-ignore
|
|
414
|
-
onChange: handleAddressChange
|
|
415
|
-
}))]
|
|
375
|
+
return realIsView ? tooltip ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
376
|
+
className: className,
|
|
377
|
+
title: tooltip === true ? viewValue : tooltip,
|
|
378
|
+
children: (0, _jsxRuntime.jsx)(Text, {
|
|
379
|
+
ellipsis: {
|
|
380
|
+
tooltip: false
|
|
381
|
+
},
|
|
382
|
+
children: viewValue
|
|
416
383
|
})
|
|
384
|
+
}) : (0, _jsxRuntime.jsx)("span", {
|
|
385
|
+
className: className,
|
|
386
|
+
children: viewValue
|
|
387
|
+
}) : (0, _jsxRuntime.jsxs)("div", {
|
|
388
|
+
className: "pro-address ".concat(className),
|
|
389
|
+
children: [dataSource || addressCode || !loadData ? (0, _jsxRuntime.jsx)(_antd.Cascader, {
|
|
390
|
+
className: hasDetail ? '' : 'no-detail',
|
|
391
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
392
|
+
value: addressValue,
|
|
393
|
+
options: !loadData ? serviceData : realDataSource,
|
|
394
|
+
disabled: disabled,
|
|
395
|
+
displayRender: function displayRender(label) {
|
|
396
|
+
return label === null || label === void 0 ? void 0 : label.filter(function (item) {
|
|
397
|
+
return !!item;
|
|
398
|
+
}).join('/');
|
|
399
|
+
},
|
|
400
|
+
showSearch: {
|
|
401
|
+
filter: handlefilter
|
|
402
|
+
},
|
|
403
|
+
onChange: handleChange
|
|
404
|
+
}) : (0, _jsxRuntime.jsx)(_antd.Cascader, {
|
|
405
|
+
className: hasDetail ? '' : 'no-detail',
|
|
406
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
407
|
+
value: addressValue,
|
|
408
|
+
loadData: handleLoadData,
|
|
409
|
+
// @ts-ignore
|
|
410
|
+
options: provinces,
|
|
411
|
+
disabled: disabled,
|
|
412
|
+
displayRender: displayRender,
|
|
413
|
+
changeOnSelect: true,
|
|
414
|
+
// @ts-ignore
|
|
415
|
+
onChange: handleChange
|
|
416
|
+
}), hasDetail && (tooltip && disabled && address ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
417
|
+
title: address,
|
|
418
|
+
children: (0, _jsxRuntime.jsx)("span", {
|
|
419
|
+
className: "pro-address-detail",
|
|
420
|
+
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
421
|
+
disabled: disabled,
|
|
422
|
+
value: address
|
|
423
|
+
})
|
|
424
|
+
})
|
|
425
|
+
}) : (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
426
|
+
allowClear: true,
|
|
427
|
+
autoComplete: "off",
|
|
428
|
+
disabled: disabled,
|
|
429
|
+
value: address,
|
|
430
|
+
maxLength: detailMaxLength,
|
|
431
|
+
placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740",
|
|
432
|
+
// @ts-ignore
|
|
433
|
+
onChange: handleAddressChange
|
|
434
|
+
}))]
|
|
417
435
|
});
|
|
418
436
|
};
|
|
419
437
|
// @ts-ignore
|
|
@@ -3,11 +3,12 @@ import { DefaultOptionType } from 'rc-select/lib/Select';
|
|
|
3
3
|
import { Service } from 'ahooks/lib/useRequest/src/types';
|
|
4
4
|
export interface AddressProps {
|
|
5
5
|
getPopupContainer?: () => ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
isView?: boolean;
|
|
7
8
|
value?: string[];
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
hasDetail?: boolean;
|
|
10
|
-
tooltip?: boolean;
|
|
11
|
+
tooltip?: boolean | ReactNode;
|
|
11
12
|
detailMaxLength?: number;
|
|
12
13
|
fieldNames?: {
|
|
13
14
|
label: string;
|
|
@@ -20,7 +21,7 @@ export interface AddressProps {
|
|
|
20
21
|
defaultParams?: any;
|
|
21
22
|
parentKey?: string;
|
|
22
23
|
};
|
|
23
|
-
onChange?: (value: string[]) => void;
|
|
24
|
+
onChange?: (value: string[], selectedOptions?: any[]) => void;
|
|
24
25
|
transformResponse?: (data: any[]) => any[];
|
|
25
26
|
level?: number;
|
|
26
27
|
enumCode?: string;
|