@jiovan-labs/ant-buddy-pro 2.0.4 → 2.0.5
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/cjs/field/RemoteField/index.js +21 -17
- package/dist/cjs/form/AddonInput/index.js +3 -1
- package/dist/cjs/form/CaptchaInput/index.js +6 -2
- package/dist/cjs/form/CollapseForm/index.js +1 -3
- package/dist/cjs/form/CronInput/index.js +3 -3
- package/dist/cjs/form/DivideSelect/index.js +23 -20
- package/dist/cjs/form/LocaleInput/index.js +1 -1
- package/dist/cjs/form/MathInput/index.js +3 -1
- package/dist/cjs/form/SegmentRadio/index.js +23 -20
- package/dist/cjs/form/TagInput/index.d.ts +1 -1
- package/dist/cjs/form/TagInput/index.js +36 -32
- package/dist/cjs/layout/MenuTabs/index.js +18 -20
- package/dist/cjs/layout/PageFooter/index.js +1 -1
- package/dist/esm/field/RemoteField/index.js +21 -18
- package/dist/esm/form/AddonInput/index.js +5 -1
- package/dist/esm/form/CaptchaInput/index.js +9 -3
- package/dist/esm/form/CollapseForm/index.js +3 -3
- package/dist/esm/form/CronInput/index.js +3 -3
- package/dist/esm/form/DivideSelect/index.js +24 -22
- package/dist/esm/form/LocaleInput/index.js +4 -4
- package/dist/esm/form/MathInput/index.js +5 -1
- package/dist/esm/form/SegmentRadio/index.js +24 -22
- package/dist/esm/form/TagInput/index.d.ts +1 -1
- package/dist/esm/form/TagInput/index.js +37 -34
- package/dist/esm/layout/MenuTabs/index.js +20 -20
- package/dist/esm/layout/PageFooter/index.js +1 -1
- package/package.json +1 -1
|
@@ -58,23 +58,27 @@ var RemoteField = import_react.default.forwardRef((props, ref) => {
|
|
|
58
58
|
setRefreshId(import_ts_lang_utils.NanoidUtils.getPopularId());
|
|
59
59
|
}
|
|
60
60
|
}));
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
61
|
+
const { run } = (0, import_pro_components.useDebounceFn)((params) => {
|
|
62
|
+
return !(props == null ? void 0 : props.request) ? Promise.resolve(void 0) : props.request(params);
|
|
63
|
+
}, (props == null ? void 0 : props.debounceTime) ?? 0);
|
|
64
|
+
import_react.default.useEffect(() => {
|
|
65
|
+
if (!(props == null ? void 0 : props.request) || !autoStart) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
run(props == null ? void 0 : props.params).then((data) => {
|
|
69
|
+
setOutcome(data);
|
|
70
|
+
}).catch(() => {
|
|
71
|
+
});
|
|
72
|
+
}, []);
|
|
73
|
+
import_react.default.useEffect(() => {
|
|
74
|
+
if (!(props == null ? void 0 : props.request)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
run(props == null ? void 0 : props.params).then((data) => {
|
|
78
|
+
setOutcome(data);
|
|
79
|
+
}).catch(() => {
|
|
80
|
+
});
|
|
81
|
+
}, [refreshId]);
|
|
78
82
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
83
|
"div",
|
|
80
84
|
{
|
|
@@ -70,7 +70,9 @@ var AddonInput = (props) => {
|
|
|
70
70
|
};
|
|
71
71
|
const simpleName = (props == null ? void 0 : props.name) ?? ((_a = props == null ? void 0 : props.fieldProps) == null ? void 0 : _a.name);
|
|
72
72
|
const fieldName = !simpleName ? void 0 : (formListContext == null ? void 0 : formListContext.listName) ? [...formListContext.listName, simpleName] : simpleName;
|
|
73
|
-
const
|
|
73
|
+
const [fallbackForm] = import_antd.Form.useForm();
|
|
74
|
+
const watchedValue = import_antd.Form.useWatch(fieldName ?? "__abp_watch_placeholder__", form ?? fallbackForm);
|
|
75
|
+
const fieldValue = !simpleName ? (_b = props == null ? void 0 : props.fieldProps) == null ? void 0 : _b.value : watchedValue;
|
|
74
76
|
const inputWidth = !widthBlock ? void 0 : import_PropUtils.PropUtils.calculateWidth((props == null ? void 0 : props.width) ?? (typeof ((_d = (_c = props == null ? void 0 : props.fieldProps) == null ? void 0 : _c.style) == null ? void 0 : _d.width) === "string" ? props.fieldProps.style.width : void 0));
|
|
75
77
|
const entryReadMode = editContext.mode === "read" || ((_e = props == null ? void 0 : props.proFieldProps) == null ? void 0 : _e.mode) === "read";
|
|
76
78
|
const entryReadonly = ((_f = props == null ? void 0 : props.fieldProps) == null ? void 0 : _f.readOnly) || ((_g = props == null ? void 0 : props.proFieldProps) == null ? void 0 : _g.readonly);
|
|
@@ -94,7 +94,10 @@ var CaptchaInputField = import_react.default.forwardRef((props, ref) => {
|
|
|
94
94
|
return timing;
|
|
95
95
|
},
|
|
96
96
|
startTimer: () => {
|
|
97
|
-
validateDependFields().then(() => {
|
|
97
|
+
validateDependFields().then((validated) => {
|
|
98
|
+
if (!validated) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
98
101
|
setTiming(true);
|
|
99
102
|
}).catch(() => {
|
|
100
103
|
});
|
|
@@ -129,7 +132,8 @@ var CaptchaInputField = import_react.default.forwardRef((props, ref) => {
|
|
|
129
132
|
const watchFields = import_react.default.useMemo(() => {
|
|
130
133
|
return [props == null ? void 0 : props.phoneName, props == null ? void 0 : props.dependName].flat().filter((item) => !!item);
|
|
131
134
|
}, [props == null ? void 0 : props.phoneName, props == null ? void 0 : props.dependName]);
|
|
132
|
-
const
|
|
135
|
+
const [fallbackForm] = import_antd.Form.useForm();
|
|
136
|
+
const watchValues = import_pro_components.ProForm.useWatch([], { form: form ?? fallbackForm, preserve: true });
|
|
133
137
|
const checkSubmittable = () => {
|
|
134
138
|
if (import_ts_lang_utils.ArrayUtils.isNotEmpty(watchFields)) {
|
|
135
139
|
form == null ? void 0 : form.validateFields([...watchFields], {
|
|
@@ -79,9 +79,7 @@ var CollapseForm = import_react.default.forwardRef((props, ref) => {
|
|
|
79
79
|
setFormOpen(false);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
(0, import_ahooks.useEventListener)(["keydown", "mousedown"], restoreLayout);
|
|
84
|
-
}
|
|
82
|
+
(0, import_ahooks.useEventListener)(["keydown", "mousedown"], restoreLayout, { enable: closeOnBlur });
|
|
85
83
|
const buildEntryDom = () => {
|
|
86
84
|
if (formOpen) {
|
|
87
85
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -314,9 +314,6 @@ var CronInput = import_react.default.forwardRef((props, ref) => {
|
|
|
314
314
|
] }) });
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
if (entryImmutable) {
|
|
318
|
-
return buildEntryDom();
|
|
319
|
-
}
|
|
320
317
|
const handleWindowResize = () => {
|
|
321
318
|
const inspect = document.querySelector(`.${clazzPrefix}-entry-${fieldId}`);
|
|
322
319
|
const sponsor = document.querySelector(`.${clazzPrefix}-popup-${fieldId}`);
|
|
@@ -326,6 +323,9 @@ var CronInput = import_react.default.forwardRef((props, ref) => {
|
|
|
326
323
|
}
|
|
327
324
|
};
|
|
328
325
|
(0, import_ahooks.useEventListener)("resize", handleWindowResize);
|
|
326
|
+
if (entryImmutable) {
|
|
327
|
+
return buildEntryDom();
|
|
328
|
+
}
|
|
329
329
|
const buildPopupDom = () => {
|
|
330
330
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
331
331
|
const tabItems = [
|
|
@@ -63,27 +63,30 @@ var DivideSelect = (props) => {
|
|
|
63
63
|
const enumOptions = import_FieldUtils.FieldUtils.valueEnumToSelectOptions(props == null ? void 0 : props.valueEnum) ?? [];
|
|
64
64
|
return [...rawOptions, ...enumOptions];
|
|
65
65
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
setOptionItems(values);
|
|
78
|
-
} else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
|
|
79
|
-
setOptionItems([...values, ...optionItems ?? []]);
|
|
80
|
-
} else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
|
|
81
|
-
setOptionItems([...optionItems ?? [], ...values]);
|
|
66
|
+
const { run } = (0, import_pro_components.useDebounceFn)((params) => {
|
|
67
|
+
return !(props == null ? void 0 : props.request) ? Promise.resolve(void 0) : props.request(params, void 0);
|
|
68
|
+
}, (props == null ? void 0 : props.debounceTime) ?? 0);
|
|
69
|
+
import_react.default.useEffect(() => {
|
|
70
|
+
if (!(props == null ? void 0 : props.request) || (props == null ? void 0 : props.requestOptionPlace) === false) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
run(props == null ? void 0 : props.params).then((values) => {
|
|
74
|
+
if (!values) {
|
|
75
|
+
if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
76
|
+
setOptionItems(void 0);
|
|
82
77
|
}
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
81
|
+
setOptionItems(values);
|
|
82
|
+
} else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
|
|
83
|
+
setOptionItems([...values, ...optionItems ?? []]);
|
|
84
|
+
} else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
|
|
85
|
+
setOptionItems([...optionItems ?? [], ...values]);
|
|
86
|
+
}
|
|
87
|
+
}).catch(() => {
|
|
88
|
+
});
|
|
89
|
+
}, []);
|
|
87
90
|
const renderContent = (item, before) => {
|
|
88
91
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
89
92
|
if (!item) {
|
|
@@ -83,6 +83,7 @@ var LocaleInput = (props) => {
|
|
|
83
83
|
const [fieldId] = import_react.default.useState(import_ts_lang_utils.NanoidUtils.getPopularId());
|
|
84
84
|
const [triggerOpen, setTriggerOpen] = import_react.default.useState((props == null ? void 0 : props.defaultOpen) ?? false);
|
|
85
85
|
const [triggerOffset, setTriggerOffset] = import_react.default.useState(4);
|
|
86
|
+
const [confirmOpen, setConfirmOpen] = import_react.default.useState();
|
|
86
87
|
const compositionRef = import_react.default.useRef(false);
|
|
87
88
|
const closeTimerRef = import_react.default.useRef(null);
|
|
88
89
|
const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
|
|
@@ -186,7 +187,6 @@ var LocaleInput = (props) => {
|
|
|
186
187
|
if (!multilingual || !(props == null ? void 0 : props.popupInputProps) && !(props == null ? void 0 : props.popupQuickTags)) {
|
|
187
188
|
return buildEntryDom();
|
|
188
189
|
}
|
|
189
|
-
const [confirmOpen, setConfirmOpen] = import_react.default.useState();
|
|
190
190
|
const entryImmutable = editContext.mode === "read" || ((_a = props == null ? void 0 : props.proFieldProps) == null ? void 0 : _a.mode) === "read" || ((_b = props == null ? void 0 : props.fieldProps) == null ? void 0 : _b.readOnly) || ((_c = props == null ? void 0 : props.proFieldProps) == null ? void 0 : _c.readonly) || (props == null ? void 0 : props.disabled) || ((_d = props == null ? void 0 : props.fieldProps) == null ? void 0 : _d.disabled);
|
|
191
191
|
const handleSetAsDefault = (tagId) => {
|
|
192
192
|
const inspect = document.querySelector(`[data-locale-input-id='${fieldId}']`);
|
|
@@ -63,7 +63,9 @@ var MathInput = (props) => {
|
|
|
63
63
|
} = props ?? {};
|
|
64
64
|
const [fieldId] = import_react.default.useState(import_ts_lang_utils.NanoidUtils.getPopularId());
|
|
65
65
|
const fieldName = !(props == null ? void 0 : props.name) ? void 0 : [...(formListContext == null ? void 0 : formListContext.listName) ?? [], props.name];
|
|
66
|
-
const
|
|
66
|
+
const [fallbackForm] = import_antd.Form.useForm();
|
|
67
|
+
const watchedValue = import_antd.Form.useWatch(fieldName ?? "__abp_watch_placeholder__", form ?? fallbackForm);
|
|
68
|
+
const fieldValue = !(props == null ? void 0 : props.name) ? props == null ? void 0 : props.value : watchedValue;
|
|
67
69
|
const containerRef = import_react.default.useRef(null);
|
|
68
70
|
const fieldRef = import_react.default.useRef(null);
|
|
69
71
|
const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
|
|
@@ -54,27 +54,30 @@ var SegmentRadio = (props) => {
|
|
|
54
54
|
const enumOptions = import_FieldUtils.FieldUtils.valueEnumToSegmentOptions(props == null ? void 0 : props.valueEnum) ?? [];
|
|
55
55
|
return [...rawOptions, ...enumOptions];
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
setOptionItems(values);
|
|
69
|
-
} else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
|
|
70
|
-
setOptionItems([...values, ...optionItems ?? []]);
|
|
71
|
-
} else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
|
|
72
|
-
setOptionItems([...optionItems ?? [], ...values]);
|
|
57
|
+
const { run } = (0, import_pro_components.useDebounceFn)((params) => {
|
|
58
|
+
return !(props == null ? void 0 : props.request) ? Promise.resolve(void 0) : props.request(params);
|
|
59
|
+
}, (props == null ? void 0 : props.debounceTime) ?? 0);
|
|
60
|
+
import_react.default.useEffect(() => {
|
|
61
|
+
if (!(props == null ? void 0 : props.request) || (props == null ? void 0 : props.requestOptionPlace) === false) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
run(props == null ? void 0 : props.params).then((values) => {
|
|
65
|
+
if (!values) {
|
|
66
|
+
if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
67
|
+
setOptionItems(void 0);
|
|
73
68
|
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
72
|
+
setOptionItems(values);
|
|
73
|
+
} else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
|
|
74
|
+
setOptionItems([...values, ...optionItems ?? []]);
|
|
75
|
+
} else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
|
|
76
|
+
setOptionItems([...optionItems ?? [], ...values]);
|
|
77
|
+
}
|
|
78
|
+
}).catch(() => {
|
|
79
|
+
});
|
|
80
|
+
}, []);
|
|
78
81
|
import_react.default.useEffect(() => {
|
|
79
82
|
var _a2;
|
|
80
83
|
(_a2 = props == null ? void 0 : props.onOptionItemsChange) == null ? void 0 : _a2.call(props, optionItems);
|
|
@@ -36,7 +36,7 @@ export type TagInputProps = Omit<ProFormFieldItemProps, 'children' | 'fieldRef'
|
|
|
36
36
|
locale?: string;
|
|
37
37
|
localeProps?: IntlLocaleProps;
|
|
38
38
|
};
|
|
39
|
-
export declare const TagInput: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "
|
|
39
|
+
export declare const TagInput: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "fieldProps" | "disabled" | "placeholder" | "readonly" | "fieldRef"> & Omit<ProFormFieldRemoteProps, "request" | "valueEnum"> & {
|
|
40
40
|
clazzPrefix?: string | undefined;
|
|
41
41
|
containerClazz?: string | undefined;
|
|
42
42
|
containerStyle?: React.CSSProperties | undefined;
|
|
@@ -90,39 +90,43 @@ var TagInputField = import_react.default.forwardRef((props, ref) => {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}));
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}))];
|
|
114
|
-
import_ConsoleUtils.ConsoleUtils.warn(result.length === values.length, true, "TagInput", `Field '${props == null ? void 0 : props.name}' prop 'request' must includes unique response`);
|
|
115
|
-
if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
116
|
-
setTagContents(result);
|
|
117
|
-
} else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
|
|
118
|
-
setTagContents([...result, ...tagContents ?? []]);
|
|
119
|
-
} else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
|
|
120
|
-
setTagContents([...tagContents ?? [], ...result]);
|
|
93
|
+
import_react.default.useLayoutEffect(() => {
|
|
94
|
+
var _a2, _b2, _c;
|
|
95
|
+
if (!(props == null ? void 0 : props.compactMargin)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const parentClazz = configContext.getPrefixCls("form-item");
|
|
99
|
+
const targetClazz = `${clazzPrefix}-compact-margin`;
|
|
100
|
+
(_c = (_b2 = (_a2 = fieldRef.current) == null ? void 0 : _a2.closest(`.${parentClazz}`)) == null ? void 0 : _b2.classList) == null ? void 0 : _c.add(targetClazz);
|
|
101
|
+
}, []);
|
|
102
|
+
const { run } = (0, import_pro_components.useDebounceFn)((params) => {
|
|
103
|
+
return !(props == null ? void 0 : props.request) ? Promise.resolve(void 0) : props.request(params);
|
|
104
|
+
}, (props == null ? void 0 : props.debounceTime) ?? 0);
|
|
105
|
+
import_react.default.useEffect(() => {
|
|
106
|
+
if (!(props == null ? void 0 : props.request) || (props == null ? void 0 : props.requestOptionPlace) === false) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
run(props == null ? void 0 : props.params).then((values) => {
|
|
110
|
+
if (!values) {
|
|
111
|
+
if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
112
|
+
setTagContents(null);
|
|
121
113
|
}
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const result = [...new Set(values == null ? void 0 : values.map((item) => {
|
|
117
|
+
return typeof item === "string" || typeof item === "number" ? item : item.content;
|
|
118
|
+
}))];
|
|
119
|
+
import_ConsoleUtils.ConsoleUtils.warn(result.length === values.length, true, "TagInput", `Field '${props == null ? void 0 : props.name}' prop 'request' must includes unique response`);
|
|
120
|
+
if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
|
|
121
|
+
setTagContents(result);
|
|
122
|
+
} else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
|
|
123
|
+
setTagContents([...result, ...tagContents ?? []]);
|
|
124
|
+
} else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
|
|
125
|
+
setTagContents([...tagContents ?? [], ...result]);
|
|
126
|
+
}
|
|
127
|
+
}).catch(() => {
|
|
128
|
+
});
|
|
129
|
+
}, []);
|
|
126
130
|
import_react.default.useEffect(() => {
|
|
127
131
|
setInputName(inputVisible ? fieldId : void 0);
|
|
128
132
|
}, [inputVisible]);
|
|
@@ -58,26 +58,24 @@ var MenuTabs = (props) => {
|
|
|
58
58
|
const [activeKey, setActiveKey] = import_react.default.useState((_a = props == null ? void 0 : props.menuProps) == null ? void 0 : _a.defaultActiveKey);
|
|
59
59
|
const [menuMode, setMenuMode] = import_react.default.useState("inline");
|
|
60
60
|
const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
(0, import_ahooks.useEventListener)("resize", handleWindowResize);
|
|
80
|
-
}
|
|
61
|
+
const handleWindowResize = () => {
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
var _a2;
|
|
64
|
+
if (!fieldRef.current) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
let shouldMode = "inline";
|
|
68
|
+
const { offsetWidth } = fieldRef.current;
|
|
69
|
+
if (offsetWidth > ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.minOffsetWidth) ?? 400) && ((_a2 = fieldRef.current) == null ? void 0 : _a2.offsetWidth) < ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.maxOffsetWidth) ?? 640)) {
|
|
70
|
+
shouldMode = "horizontal";
|
|
71
|
+
}
|
|
72
|
+
if (offsetWidth > ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.minOffsetWidth) ?? 400) && window.innerWidth < ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.maxWindowWidth) ?? 768)) {
|
|
73
|
+
shouldMode = "horizontal";
|
|
74
|
+
}
|
|
75
|
+
setMenuMode(shouldMode);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
(0, import_ahooks.useEventListener)("resize", handleWindowResize, { enable: (adjustLayoutProps == null ? void 0 : adjustLayoutProps.adjustOnResize) !== false });
|
|
81
79
|
const buildTabsDom = () => {
|
|
82
80
|
var _a2, _b2;
|
|
83
81
|
if (!((_a2 = props == null ? void 0 : props.menuProps) == null ? void 0 : _a2.items) || !props.menuProps.items.length) {
|
|
@@ -44,10 +44,10 @@ var PageFooter = (props) => {
|
|
|
44
44
|
copyrightIcon = true,
|
|
45
45
|
presetStyle = "default"
|
|
46
46
|
} = props ?? {};
|
|
47
|
+
const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
|
|
47
48
|
if ((!(props == null ? void 0 : props.links) || !props.links.length) && !(props == null ? void 0 : props.copyright)) {
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
50
|
-
const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
|
|
51
51
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
52
|
import_antd.Layout.Footer,
|
|
53
53
|
{
|
|
@@ -11,7 +11,7 @@ import { NanoidUtils } from '@jiovan-labs/ts-lang-utils';
|
|
|
11
11
|
import classnames from 'classnames';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
export var RemoteField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
|
-
var _props$clazzPrefix;
|
|
14
|
+
var _props$clazzPrefix, _props$debounceTime;
|
|
15
15
|
RemoteField.displayName = 'RemoteField';
|
|
16
16
|
var clazzPrefix = (_props$clazzPrefix = props === null || props === void 0 ? void 0 : props.clazzPrefix) !== null && _props$clazzPrefix !== void 0 ? _props$clazzPrefix : 'abp-remote-field';
|
|
17
17
|
var _ref = props !== null && props !== void 0 ? props : {},
|
|
@@ -40,23 +40,26 @@ export var RemoteField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
43
|
+
var _useDebounceFn = useDebounceFn(function (params) {
|
|
44
|
+
return !(props !== null && props !== void 0 && props.request) ? Promise.resolve(undefined) : props.request(params);
|
|
45
|
+
}, (_props$debounceTime = props === null || props === void 0 ? void 0 : props.debounceTime) !== null && _props$debounceTime !== void 0 ? _props$debounceTime : 0),
|
|
46
|
+
run = _useDebounceFn.run;
|
|
47
|
+
React.useEffect(function () {
|
|
48
|
+
if (!(props !== null && props !== void 0 && props.request) || !autoStart) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
run(props === null || props === void 0 ? void 0 : props.params).then(function (data) {
|
|
52
|
+
setOutcome(data);
|
|
53
|
+
}).catch(function () {});
|
|
54
|
+
}, []);
|
|
55
|
+
React.useEffect(function () {
|
|
56
|
+
if (!(props !== null && props !== void 0 && props.request)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
run(props === null || props === void 0 ? void 0 : props.params).then(function (data) {
|
|
60
|
+
setOutcome(data);
|
|
61
|
+
}).catch(function () {});
|
|
62
|
+
}, [refreshId]);
|
|
60
63
|
return /*#__PURE__*/_jsx("div", {
|
|
61
64
|
className: classnames(clazzPrefix, props === null || props === void 0 ? void 0 : props.containerClazz),
|
|
62
65
|
style: props === null || props === void 0 ? void 0 : props.containerStyle,
|
|
@@ -59,7 +59,11 @@ export var AddonInput = function AddonInput(props) {
|
|
|
59
59
|
};
|
|
60
60
|
var simpleName = (_props$name = props === null || props === void 0 ? void 0 : props.name) !== null && _props$name !== void 0 ? _props$name : props === null || props === void 0 || (_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 ? void 0 : _props$fieldProps.name;
|
|
61
61
|
var fieldName = !simpleName ? undefined : formListContext !== null && formListContext !== void 0 && formListContext.listName ? [].concat(_toConsumableArray(formListContext.listName), [simpleName]) : simpleName;
|
|
62
|
-
var
|
|
62
|
+
var _Form$useForm = Form.useForm(),
|
|
63
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
64
|
+
fallbackForm = _Form$useForm2[0];
|
|
65
|
+
var watchedValue = Form.useWatch(fieldName !== null && fieldName !== void 0 ? fieldName : '__abp_watch_placeholder__', form !== null && form !== void 0 ? form : fallbackForm);
|
|
66
|
+
var fieldValue = !simpleName ? props === null || props === void 0 || (_props$fieldProps2 = props.fieldProps) === null || _props$fieldProps2 === void 0 ? void 0 : _props$fieldProps2.value : watchedValue;
|
|
63
67
|
var inputWidth = !widthBlock ? undefined : PropUtils.calculateWidth((_props$width = props === null || props === void 0 ? void 0 : props.width) !== null && _props$width !== void 0 ? _props$width : typeof (props === null || props === void 0 || (_props$fieldProps3 = props.fieldProps) === null || _props$fieldProps3 === void 0 || (_props$fieldProps3 = _props$fieldProps3.style) === null || _props$fieldProps3 === void 0 ? void 0 : _props$fieldProps3.width) === 'string' ? props.fieldProps.style.width : undefined);
|
|
64
68
|
var entryReadMode = editContext.mode === 'read' || (props === null || props === void 0 || (_props$proFieldProps = props.proFieldProps) === null || _props$proFieldProps === void 0 ? void 0 : _props$proFieldProps.mode) === 'read';
|
|
65
69
|
var entryReadonly = (props === null || props === void 0 || (_props$fieldProps4 = props.fieldProps) === null || _props$fieldProps4 === void 0 ? void 0 : _props$fieldProps4.readOnly) || (props === null || props === void 0 || (_props$proFieldProps2 = props.proFieldProps) === null || _props$proFieldProps2 === void 0 ? void 0 : _props$proFieldProps2.readonly);
|
|
@@ -96,7 +96,10 @@ var CaptchaInputField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
96
96
|
return timing;
|
|
97
97
|
},
|
|
98
98
|
startTimer: function startTimer() {
|
|
99
|
-
validateDependFields().then(function () {
|
|
99
|
+
validateDependFields().then(function (validated) {
|
|
100
|
+
if (!validated) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
100
103
|
setTiming(true);
|
|
101
104
|
}).catch(function () {});
|
|
102
105
|
},
|
|
@@ -135,8 +138,11 @@ var CaptchaInputField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
135
138
|
return !!item;
|
|
136
139
|
});
|
|
137
140
|
}, [props === null || props === void 0 ? void 0 : props.phoneName, props === null || props === void 0 ? void 0 : props.dependName]);
|
|
138
|
-
var
|
|
139
|
-
|
|
141
|
+
var _Form$useForm = Form.useForm(),
|
|
142
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
143
|
+
fallbackForm = _Form$useForm2[0];
|
|
144
|
+
var watchValues = ProForm.useWatch([], {
|
|
145
|
+
form: form !== null && form !== void 0 ? form : fallbackForm,
|
|
140
146
|
preserve: true
|
|
141
147
|
});
|
|
142
148
|
var checkSubmittable = function checkSubmittable() {
|
|
@@ -72,9 +72,9 @@ export var CollapseForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
72
72
|
setFormOpen(false);
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
75
|
+
useEventListener(['keydown', 'mousedown'], restoreLayout, {
|
|
76
|
+
enable: closeOnBlur
|
|
77
|
+
});
|
|
78
78
|
var buildEntryDom = function buildEntryDom() {
|
|
79
79
|
if (formOpen) {
|
|
80
80
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -360,9 +360,6 @@ export var CronInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
if (entryImmutable) {
|
|
364
|
-
return buildEntryDom();
|
|
365
|
-
}
|
|
366
363
|
var handleWindowResize = function handleWindowResize() {
|
|
367
364
|
var inspect = document.querySelector(".".concat(clazzPrefix, "-entry-").concat(fieldId));
|
|
368
365
|
var sponsor = document.querySelector(".".concat(clazzPrefix, "-popup-").concat(fieldId));
|
|
@@ -372,6 +369,9 @@ export var CronInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
372
369
|
}
|
|
373
370
|
};
|
|
374
371
|
useEventListener('resize', handleWindowResize);
|
|
372
|
+
if (entryImmutable) {
|
|
373
|
+
return buildEntryDom();
|
|
374
|
+
}
|
|
375
375
|
var buildPopupDom = function buildPopupDom() {
|
|
376
376
|
var _props$localeProps4, _props$minutePanelPro3, _props$minutePanelPro4, _props$localeProps5, _props$hourPanelProps3, _props$hourPanelProps4, _props$localeProps6, _props$dayPanelProps$2, _props$dayPanelProps2, _props$localeProps7, _props$monthPanelProp3, _props$monthPanelProp4, _props$localeProps8, _props$weekPanelProps3, _props$weekPanelProps4, _props$tabsProps$defa, _props$tabsProps2, _props$tabsProps$size, _props$tabsProps3, _props$tabsProps4, _props$localeProps11, _props$localeProps12, _props$localeProps13, _props$localeProps14, _props$localeProps15;
|
|
377
377
|
var tabItems = [{
|
|
@@ -27,7 +27,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
27
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
28
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
29
|
export var DivideSelect = function DivideSelect(props) {
|
|
30
|
-
var _props$clazzPrefix, _props$fieldProps, _props$fieldProps2, _resolvedClassNames$p;
|
|
30
|
+
var _props$clazzPrefix, _props$fieldProps, _props$fieldProps2, _resolvedClassNames$p, _props$debounceTime;
|
|
31
31
|
var form = Form.useFormInstance();
|
|
32
32
|
var clazzPrefix = (_props$clazzPrefix = props === null || props === void 0 ? void 0 : props.clazzPrefix) !== null && _props$clazzPrefix !== void 0 ? _props$clazzPrefix : 'abp-divide-select';
|
|
33
33
|
var _ref = props !== null && props !== void 0 ? props : {},
|
|
@@ -55,28 +55,30 @@ export var DivideSelect = function DivideSelect(props) {
|
|
|
55
55
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
56
56
|
optionItems = _React$useState2[0],
|
|
57
57
|
setOptionItems = _React$useState2[1];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === undefined || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
71
|
-
setOptionItems(values);
|
|
72
|
-
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'before') {
|
|
73
|
-
setOptionItems([].concat(_toConsumableArray(values), _toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : [])));
|
|
74
|
-
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'after') {
|
|
75
|
-
setOptionItems([].concat(_toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : []), _toConsumableArray(values)));
|
|
58
|
+
var _useDebounceFn = useDebounceFn(function (params) {
|
|
59
|
+
return !(props !== null && props !== void 0 && props.request) ? Promise.resolve(undefined) : props.request(params, undefined);
|
|
60
|
+
}, (_props$debounceTime = props === null || props === void 0 ? void 0 : props.debounceTime) !== null && _props$debounceTime !== void 0 ? _props$debounceTime : 0),
|
|
61
|
+
run = _useDebounceFn.run;
|
|
62
|
+
React.useEffect(function () {
|
|
63
|
+
if (!(props !== null && props !== void 0 && props.request) || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === false) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
run(props === null || props === void 0 ? void 0 : props.params).then(function (values) {
|
|
67
|
+
if (!values) {
|
|
68
|
+
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
69
|
+
setOptionItems(undefined);
|
|
76
70
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === undefined || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
74
|
+
setOptionItems(values);
|
|
75
|
+
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'before') {
|
|
76
|
+
setOptionItems([].concat(_toConsumableArray(values), _toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : [])));
|
|
77
|
+
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'after') {
|
|
78
|
+
setOptionItems([].concat(_toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : []), _toConsumableArray(values)));
|
|
79
|
+
}
|
|
80
|
+
}).catch(function () {});
|
|
81
|
+
}, []);
|
|
80
82
|
var renderContent = function renderContent(item, before) {
|
|
81
83
|
var _ObjectUtils$getProp, _props$fieldProps4, _item$data, _ObjectUtils$getProp2, _props$fieldProps5, _item$data2;
|
|
82
84
|
if (!item) {
|
|
@@ -85,6 +85,10 @@ export var LocaleInput = function LocaleInput(props) {
|
|
|
85
85
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
86
86
|
triggerOffset = _React$useState6[0],
|
|
87
87
|
setTriggerOffset = _React$useState6[1];
|
|
88
|
+
var _React$useState7 = React.useState(),
|
|
89
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
90
|
+
confirmOpen = _React$useState8[0],
|
|
91
|
+
setConfirmOpen = _React$useState8[1];
|
|
88
92
|
var compositionRef = React.useRef(false);
|
|
89
93
|
var closeTimerRef = React.useRef(null);
|
|
90
94
|
var fieldStyle = useFieldStyle(clazzPrefix);
|
|
@@ -209,10 +213,6 @@ export var LocaleInput = function LocaleInput(props) {
|
|
|
209
213
|
if (!multilingual || !(props !== null && props !== void 0 && props.popupInputProps) && !(props !== null && props !== void 0 && props.popupQuickTags)) {
|
|
210
214
|
return buildEntryDom();
|
|
211
215
|
}
|
|
212
|
-
var _React$useState7 = React.useState(),
|
|
213
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
214
|
-
confirmOpen = _React$useState8[0],
|
|
215
|
-
setConfirmOpen = _React$useState8[1];
|
|
216
216
|
var entryImmutable = editContext.mode === 'read' || (props === null || props === void 0 || (_props$proFieldProps3 = props.proFieldProps) === null || _props$proFieldProps3 === void 0 ? void 0 : _props$proFieldProps3.mode) === 'read' || (props === null || props === void 0 || (_props$fieldProps6 = props.fieldProps) === null || _props$fieldProps6 === void 0 ? void 0 : _props$fieldProps6.readOnly) || (props === null || props === void 0 || (_props$proFieldProps4 = props.proFieldProps) === null || _props$proFieldProps4 === void 0 ? void 0 : _props$proFieldProps4.readonly) || (props === null || props === void 0 ? void 0 : props.disabled) || (props === null || props === void 0 || (_props$fieldProps7 = props.fieldProps) === null || _props$fieldProps7 === void 0 ? void 0 : _props$fieldProps7.disabled);
|
|
217
217
|
var handleSetAsDefault = function handleSetAsDefault(tagId) {
|
|
218
218
|
var inspect = document.querySelector("[data-locale-input-id='".concat(fieldId, "']"));
|
|
@@ -53,7 +53,11 @@ export var MathInput = function MathInput(props) {
|
|
|
53
53
|
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
54
54
|
fieldId = _React$useState2[0];
|
|
55
55
|
var fieldName = !(props !== null && props !== void 0 && props.name) ? undefined : [].concat(_toConsumableArray((_formListContext$list = formListContext === null || formListContext === void 0 ? void 0 : formListContext.listName) !== null && _formListContext$list !== void 0 ? _formListContext$list : []), [props.name]);
|
|
56
|
-
var
|
|
56
|
+
var _Form$useForm = Form.useForm(),
|
|
57
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
58
|
+
fallbackForm = _Form$useForm2[0];
|
|
59
|
+
var watchedValue = Form.useWatch(fieldName !== null && fieldName !== void 0 ? fieldName : '__abp_watch_placeholder__', form !== null && form !== void 0 ? form : fallbackForm);
|
|
60
|
+
var fieldValue = !(props !== null && props !== void 0 && props.name) ? props === null || props === void 0 ? void 0 : props.value : watchedValue;
|
|
57
61
|
var containerRef = React.useRef(null);
|
|
58
62
|
var fieldRef = React.useRef(null);
|
|
59
63
|
var fieldStyle = useFieldStyle(clazzPrefix);
|
|
@@ -23,7 +23,7 @@ import classnames from 'classnames';
|
|
|
23
23
|
import { FieldUtils } from "../../util/FieldUtils";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
export var SegmentRadio = function SegmentRadio(props) {
|
|
26
|
-
var _props$clazzPrefix, _props$proFieldProps, _props$fieldProps2, _props$proFieldProps2, _props$fieldProps3;
|
|
26
|
+
var _props$clazzPrefix, _props$debounceTime, _props$proFieldProps, _props$fieldProps2, _props$proFieldProps2, _props$fieldProps3;
|
|
27
27
|
var form = Form.useFormInstance();
|
|
28
28
|
var editContext = React.useContext(EditOrReadOnlyContext);
|
|
29
29
|
var clazzPrefix = (_props$clazzPrefix = props === null || props === void 0 ? void 0 : props.clazzPrefix) !== null && _props$clazzPrefix !== void 0 ? _props$clazzPrefix : 'abp-segment-radio';
|
|
@@ -39,28 +39,30 @@ export var SegmentRadio = function SegmentRadio(props) {
|
|
|
39
39
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
40
40
|
optionItems = _React$useState2[0],
|
|
41
41
|
setOptionItems = _React$useState2[1];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === undefined || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
55
|
-
setOptionItems(values);
|
|
56
|
-
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'before') {
|
|
57
|
-
setOptionItems([].concat(_toConsumableArray(values), _toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : [])));
|
|
58
|
-
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'after') {
|
|
59
|
-
setOptionItems([].concat(_toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : []), _toConsumableArray(values)));
|
|
42
|
+
var _useDebounceFn = useDebounceFn(function (params) {
|
|
43
|
+
return !(props !== null && props !== void 0 && props.request) ? Promise.resolve(undefined) : props.request(params);
|
|
44
|
+
}, (_props$debounceTime = props === null || props === void 0 ? void 0 : props.debounceTime) !== null && _props$debounceTime !== void 0 ? _props$debounceTime : 0),
|
|
45
|
+
run = _useDebounceFn.run;
|
|
46
|
+
React.useEffect(function () {
|
|
47
|
+
if (!(props !== null && props !== void 0 && props.request) || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === false) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
run(props === null || props === void 0 ? void 0 : props.params).then(function (values) {
|
|
51
|
+
if (!values) {
|
|
52
|
+
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
53
|
+
setOptionItems(undefined);
|
|
60
54
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === undefined || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
58
|
+
setOptionItems(values);
|
|
59
|
+
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'before') {
|
|
60
|
+
setOptionItems([].concat(_toConsumableArray(values), _toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : [])));
|
|
61
|
+
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'after') {
|
|
62
|
+
setOptionItems([].concat(_toConsumableArray(optionItems !== null && optionItems !== void 0 ? optionItems : []), _toConsumableArray(values)));
|
|
63
|
+
}
|
|
64
|
+
}).catch(function () {});
|
|
65
|
+
}, []);
|
|
64
66
|
React.useEffect(function () {
|
|
65
67
|
var _props$onOptionItemsC;
|
|
66
68
|
props === null || props === void 0 || (_props$onOptionItemsC = props.onOptionItemsChange) === null || _props$onOptionItemsC === void 0 || _props$onOptionItemsC.call(props, optionItems);
|
|
@@ -36,7 +36,7 @@ export type TagInputProps = Omit<ProFormFieldItemProps, 'children' | 'fieldRef'
|
|
|
36
36
|
locale?: string;
|
|
37
37
|
localeProps?: IntlLocaleProps;
|
|
38
38
|
};
|
|
39
|
-
export declare const TagInput: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "
|
|
39
|
+
export declare const TagInput: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "fieldProps" | "disabled" | "placeholder" | "readonly" | "fieldRef"> & Omit<ProFormFieldRemoteProps, "request" | "valueEnum"> & {
|
|
40
40
|
clazzPrefix?: string | undefined;
|
|
41
41
|
containerClazz?: string | undefined;
|
|
42
42
|
containerStyle?: React.CSSProperties | undefined;
|
|
@@ -33,7 +33,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
33
33
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
34
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
35
|
var TagInputField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
36
|
-
var _props$clazzPrefix, _props$proFieldProps, _props$proFieldProps2;
|
|
36
|
+
var _props$clazzPrefix, _props$debounceTime, _props$proFieldProps, _props$proFieldProps2;
|
|
37
37
|
TagInputField.displayName = 'TagInput';
|
|
38
38
|
var configContext = React.useContext(ConfigProvider.ConfigContext);
|
|
39
39
|
var form = Form.useFormInstance();
|
|
@@ -100,40 +100,43 @@ var TagInputField = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return typeof item === 'string' || typeof item === 'number' ? item : item.content;
|
|
125
|
-
})));
|
|
126
|
-
ConsoleUtils.warn(result.length === values.length, true, 'TagInput', "Field '".concat(props === null || props === void 0 ? void 0 : props.name, "' prop 'request' must includes unique response"));
|
|
127
|
-
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === undefined || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
128
|
-
_setTagContents(result);
|
|
129
|
-
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'before') {
|
|
130
|
-
_setTagContents([].concat(_toConsumableArray(result), _toConsumableArray(tagContents !== null && tagContents !== void 0 ? tagContents : [])));
|
|
131
|
-
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'after') {
|
|
132
|
-
_setTagContents([].concat(_toConsumableArray(tagContents !== null && tagContents !== void 0 ? tagContents : []), _toConsumableArray(result)));
|
|
103
|
+
React.useLayoutEffect(function () {
|
|
104
|
+
var _fieldRef$current;
|
|
105
|
+
if (!(props !== null && props !== void 0 && props.compactMargin)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
var parentClazz = configContext.getPrefixCls('form-item');
|
|
109
|
+
var targetClazz = "".concat(clazzPrefix, "-compact-margin");
|
|
110
|
+
(_fieldRef$current = fieldRef.current) === null || _fieldRef$current === void 0 || (_fieldRef$current = _fieldRef$current.closest(".".concat(parentClazz))) === null || _fieldRef$current === void 0 || (_fieldRef$current = _fieldRef$current.classList) === null || _fieldRef$current === void 0 || _fieldRef$current.add(targetClazz);
|
|
111
|
+
}, []);
|
|
112
|
+
var _useDebounceFn = useDebounceFn(function (params) {
|
|
113
|
+
return !(props !== null && props !== void 0 && props.request) ? Promise.resolve(undefined) : props.request(params);
|
|
114
|
+
}, (_props$debounceTime = props === null || props === void 0 ? void 0 : props.debounceTime) !== null && _props$debounceTime !== void 0 ? _props$debounceTime : 0),
|
|
115
|
+
run = _useDebounceFn.run;
|
|
116
|
+
React.useEffect(function () {
|
|
117
|
+
if (!(props !== null && props !== void 0 && props.request) || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === false) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
run(props === null || props === void 0 ? void 0 : props.params).then(function (values) {
|
|
121
|
+
if (!values) {
|
|
122
|
+
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
123
|
+
_setTagContents(null);
|
|
133
124
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
var result = _toConsumableArray(new Set(values === null || values === void 0 ? void 0 : values.map(function (item) {
|
|
128
|
+
return typeof item === 'string' || typeof item === 'number' ? item : item.content;
|
|
129
|
+
})));
|
|
130
|
+
ConsoleUtils.warn(result.length === values.length, true, 'TagInput', "Field '".concat(props === null || props === void 0 ? void 0 : props.name, "' prop 'request' must includes unique response"));
|
|
131
|
+
if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === undefined || (props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
|
|
132
|
+
_setTagContents(result);
|
|
133
|
+
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'before') {
|
|
134
|
+
_setTagContents([].concat(_toConsumableArray(result), _toConsumableArray(tagContents !== null && tagContents !== void 0 ? tagContents : [])));
|
|
135
|
+
} else if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'after') {
|
|
136
|
+
_setTagContents([].concat(_toConsumableArray(tagContents !== null && tagContents !== void 0 ? tagContents : []), _toConsumableArray(result)));
|
|
137
|
+
}
|
|
138
|
+
}).catch(function () {});
|
|
139
|
+
}, []);
|
|
137
140
|
React.useEffect(function () {
|
|
138
141
|
setInputName(inputVisible ? fieldId : undefined);
|
|
139
142
|
}, [inputVisible]);
|
|
@@ -49,26 +49,26 @@ export var MenuTabs = function MenuTabs(props) {
|
|
|
49
49
|
menuMode = _React$useState4[0],
|
|
50
50
|
setMenuMode = _React$useState4[1];
|
|
51
51
|
var fieldStyle = useFieldStyle(clazzPrefix);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
52
|
+
var handleWindowResize = function handleWindowResize() {
|
|
53
|
+
requestAnimationFrame(function () {
|
|
54
|
+
var _adjustLayoutProps$mi, _fieldRef$current, _adjustLayoutProps$ma, _adjustLayoutProps$mi2, _adjustLayoutProps$ma2;
|
|
55
|
+
if (!fieldRef.current) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
var shouldMode = 'inline';
|
|
59
|
+
var offsetWidth = fieldRef.current.offsetWidth;
|
|
60
|
+
if (offsetWidth > ((_adjustLayoutProps$mi = adjustLayoutProps === null || adjustLayoutProps === void 0 ? void 0 : adjustLayoutProps.minOffsetWidth) !== null && _adjustLayoutProps$mi !== void 0 ? _adjustLayoutProps$mi : 400) && ((_fieldRef$current = fieldRef.current) === null || _fieldRef$current === void 0 ? void 0 : _fieldRef$current.offsetWidth) < ((_adjustLayoutProps$ma = adjustLayoutProps === null || adjustLayoutProps === void 0 ? void 0 : adjustLayoutProps.maxOffsetWidth) !== null && _adjustLayoutProps$ma !== void 0 ? _adjustLayoutProps$ma : 640)) {
|
|
61
|
+
shouldMode = 'horizontal';
|
|
62
|
+
}
|
|
63
|
+
if (offsetWidth > ((_adjustLayoutProps$mi2 = adjustLayoutProps === null || adjustLayoutProps === void 0 ? void 0 : adjustLayoutProps.minOffsetWidth) !== null && _adjustLayoutProps$mi2 !== void 0 ? _adjustLayoutProps$mi2 : 400) && window.innerWidth < ((_adjustLayoutProps$ma2 = adjustLayoutProps === null || adjustLayoutProps === void 0 ? void 0 : adjustLayoutProps.maxWindowWidth) !== null && _adjustLayoutProps$ma2 !== void 0 ? _adjustLayoutProps$ma2 : 768)) {
|
|
64
|
+
shouldMode = 'horizontal';
|
|
65
|
+
}
|
|
66
|
+
setMenuMode(shouldMode);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
useEventListener('resize', handleWindowResize, {
|
|
70
|
+
enable: (adjustLayoutProps === null || adjustLayoutProps === void 0 ? void 0 : adjustLayoutProps.adjustOnResize) !== false
|
|
71
|
+
});
|
|
72
72
|
var buildTabsDom = function buildTabsDom() {
|
|
73
73
|
var _props$menuProps2, _props$menuProps3;
|
|
74
74
|
if (!(props !== null && props !== void 0 && (_props$menuProps2 = props.menuProps) !== null && _props$menuProps2 !== void 0 && _props$menuProps2.items) || !props.menuProps.items.length) {
|
|
@@ -21,10 +21,10 @@ export var PageFooter = function PageFooter(props) {
|
|
|
21
21
|
copyrightIcon = _ref$copyrightIcon === void 0 ? true : _ref$copyrightIcon,
|
|
22
22
|
_ref$presetStyle = _ref.presetStyle,
|
|
23
23
|
presetStyle = _ref$presetStyle === void 0 ? 'default' : _ref$presetStyle;
|
|
24
|
+
var fieldStyle = useFieldStyle(clazzPrefix);
|
|
24
25
|
if ((!(props !== null && props !== void 0 && props.links) || !props.links.length) && !(props !== null && props !== void 0 && props.copyright)) {
|
|
25
26
|
return null;
|
|
26
27
|
}
|
|
27
|
-
var fieldStyle = useFieldStyle(clazzPrefix);
|
|
28
28
|
return /*#__PURE__*/_jsx(Layout.Footer, {
|
|
29
29
|
className: classnames(clazzPrefix, fieldStyle.hashId, !(props !== null && props !== void 0 && props.widthBlock) ? undefined : "".concat(clazzPrefix, "-width-block"), !presetStyle ? undefined : "".concat(clazzPrefix, "-").concat(presetStyle), props === null || props === void 0 ? void 0 : props.containerClazz),
|
|
30
30
|
style: props === null || props === void 0 ? void 0 : props.containerStyle,
|
package/package.json
CHANGED