@teamix/pro 1.3.10 → 1.3.11
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/pro.js +32 -21
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +1 -1
- package/es/actions/dialog.d.ts +1 -1
- package/es/actions/dialog.js +11 -6
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/actions/dialog-form.js +1 -1
- package/lib/actions/dialog.d.ts +1 -1
- package/lib/actions/dialog.js +11 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
@@ -232,6 +232,6 @@ export function useDialogFormAction(action, context) {
|
|
232
232
|
|
233
233
|
_onFinish && _onFinish((_innerFormRef$current2 = innerFormRef.current) === null || _innerFormRef$current2 === void 0 ? void 0 : _innerFormRef$current2.values);
|
234
234
|
}
|
235
|
-
}, others), context);
|
235
|
+
}, others), context, true);
|
236
236
|
}
|
237
237
|
export default useDialogFormAction;
|
package/es/actions/dialog.d.ts
CHANGED
@@ -26,7 +26,7 @@ export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShow
|
|
26
26
|
/** 弹窗内容区的组件 */
|
27
27
|
component?: any;
|
28
28
|
}
|
29
|
-
export declare function useDialogAction(action: DialogAction, actionContext?: any): {
|
29
|
+
export declare function useDialogAction(action: DialogAction, actionContext?: any, hasForm?: boolean): {
|
30
30
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
31
31
|
};
|
32
32
|
export default useDialogAction;
|
package/es/actions/dialog.js
CHANGED
@@ -69,7 +69,7 @@ function getFooterAlignClass(isDrawer, align) {
|
|
69
69
|
} // 弹窗 -> 请求(点击确认,发送数据请求)
|
70
70
|
|
71
71
|
|
72
|
-
export function useDialogAction(action, actionContext) {
|
72
|
+
export function useDialogAction(action, actionContext, hasForm) {
|
73
73
|
var _useState = useState(false),
|
74
74
|
_useState2 = _slicedToArray(_useState, 2),
|
75
75
|
loading = _useState2[0],
|
@@ -174,22 +174,27 @@ export function useDialogAction(action, actionContext) {
|
|
174
174
|
case 6:
|
175
175
|
onFinish && onFinish();
|
176
176
|
resolve(true);
|
177
|
-
_context.next =
|
177
|
+
_context.next = 18;
|
178
178
|
break;
|
179
179
|
|
180
180
|
case 10:
|
181
181
|
_context.prev = 10;
|
182
182
|
_context.t0 = _context["catch"](2);
|
183
|
-
setLoading(false); // 如果 beforeRequest 中返回了 false,则直接关闭弹窗
|
183
|
+
setLoading(false); // 如果 beforeRequest 中返回了 false 并且不是 dialog-form,则直接关闭弹窗
|
184
184
|
|
185
|
-
if (beforeRequest) {
|
186
|
-
|
185
|
+
if (!(beforeRequest && !hasForm)) {
|
186
|
+
_context.next = 16;
|
187
|
+
break;
|
187
188
|
}
|
188
189
|
|
189
|
-
resolve(
|
190
|
+
resolve(true);
|
190
191
|
return _context.abrupt("return");
|
191
192
|
|
192
193
|
case 16:
|
194
|
+
resolve(false);
|
195
|
+
return _context.abrupt("return");
|
196
|
+
|
197
|
+
case 18:
|
193
198
|
case "end":
|
194
199
|
return _context.stop();
|
195
200
|
}
|
package/es/index.d.ts
CHANGED
@@ -26,5 +26,5 @@ export * from './table';
|
|
26
26
|
export * from './sidebar';
|
27
27
|
export * from './utils';
|
28
28
|
export * from './timeline';
|
29
|
-
declare const version = "1.3.
|
29
|
+
declare const version = "1.3.11";
|
30
30
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -31,6 +31,6 @@ export * from './sidebar';
|
|
31
31
|
export * from './utils'; // export * from './sidebar';
|
32
32
|
|
33
33
|
export * from './timeline';
|
34
|
-
var version = '1.3.
|
34
|
+
var version = '1.3.11';
|
35
35
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
36
36
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils };
|
@@ -253,7 +253,7 @@ function useDialogFormAction(action, context) {
|
|
253
253
|
|
254
254
|
_onFinish && _onFinish((_innerFormRef$current2 = innerFormRef.current) === null || _innerFormRef$current2 === void 0 ? void 0 : _innerFormRef$current2.values);
|
255
255
|
}
|
256
|
-
}, others), context);
|
256
|
+
}, others), context, true);
|
257
257
|
}
|
258
258
|
|
259
259
|
var _default = useDialogFormAction;
|
package/lib/actions/dialog.d.ts
CHANGED
@@ -26,7 +26,7 @@ export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShow
|
|
26
26
|
/** 弹窗内容区的组件 */
|
27
27
|
component?: any;
|
28
28
|
}
|
29
|
-
export declare function useDialogAction(action: DialogAction, actionContext?: any): {
|
29
|
+
export declare function useDialogAction(action: DialogAction, actionContext?: any, hasForm?: boolean): {
|
30
30
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
31
31
|
};
|
32
32
|
export default useDialogAction;
|
package/lib/actions/dialog.js
CHANGED
@@ -95,7 +95,7 @@ function getFooterAlignClass(isDrawer, align) {
|
|
95
95
|
} // 弹窗 -> 请求(点击确认,发送数据请求)
|
96
96
|
|
97
97
|
|
98
|
-
function useDialogAction(action, actionContext) {
|
98
|
+
function useDialogAction(action, actionContext, hasForm) {
|
99
99
|
var _useState = (0, _react.useState)(false),
|
100
100
|
_useState2 = _slicedToArray(_useState, 2),
|
101
101
|
loading = _useState2[0],
|
@@ -200,22 +200,27 @@ function useDialogAction(action, actionContext) {
|
|
200
200
|
case 6:
|
201
201
|
onFinish && onFinish();
|
202
202
|
resolve(true);
|
203
|
-
_context.next =
|
203
|
+
_context.next = 18;
|
204
204
|
break;
|
205
205
|
|
206
206
|
case 10:
|
207
207
|
_context.prev = 10;
|
208
208
|
_context.t0 = _context["catch"](2);
|
209
|
-
setLoading(false); // 如果 beforeRequest 中返回了 false,则直接关闭弹窗
|
209
|
+
setLoading(false); // 如果 beforeRequest 中返回了 false 并且不是 dialog-form,则直接关闭弹窗
|
210
210
|
|
211
|
-
if (beforeRequest) {
|
212
|
-
|
211
|
+
if (!(beforeRequest && !hasForm)) {
|
212
|
+
_context.next = 16;
|
213
|
+
break;
|
213
214
|
}
|
214
215
|
|
215
|
-
resolve(
|
216
|
+
resolve(true);
|
216
217
|
return _context.abrupt("return");
|
217
218
|
|
218
219
|
case 16:
|
220
|
+
resolve(false);
|
221
|
+
return _context.abrupt("return");
|
222
|
+
|
223
|
+
case 18:
|
219
224
|
case "end":
|
220
225
|
return _context.stop();
|
221
226
|
}
|
package/lib/index.d.ts
CHANGED
@@ -26,5 +26,5 @@ export * from './table';
|
|
26
26
|
export * from './sidebar';
|
27
27
|
export * from './utils';
|
28
28
|
export * from './timeline';
|
29
|
-
declare const version = "1.3.
|
29
|
+
declare const version = "1.3.11";
|
30
30
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED