@jiovan-labs/ant-buddy-pro 2.0.3 → 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.
Files changed (37) hide show
  1. package/dist/cjs/field/NotifyBadge/index.d.ts +13 -4
  2. package/dist/cjs/field/NotifyBadge/index.js +39 -42
  3. package/dist/cjs/field/NotifyBadge/styles.js +29 -17
  4. package/dist/cjs/field/RemoteField/index.js +21 -17
  5. package/dist/cjs/form/AddonInput/index.js +47 -18
  6. package/dist/cjs/form/AvatarUpload/index.d.ts +2 -2
  7. package/dist/cjs/form/CaptchaInput/index.js +6 -2
  8. package/dist/cjs/form/CollapseForm/index.js +1 -3
  9. package/dist/cjs/form/CronInput/index.js +3 -3
  10. package/dist/cjs/form/DivideSelect/index.js +23 -20
  11. package/dist/cjs/form/LocaleInput/index.js +16 -12
  12. package/dist/cjs/form/LocaleInput/styles.js +19 -10
  13. package/dist/cjs/form/MathInput/index.js +3 -1
  14. package/dist/cjs/form/SegmentRadio/index.js +23 -20
  15. package/dist/cjs/form/TagInput/index.d.ts +1 -1
  16. package/dist/cjs/form/TagInput/index.js +36 -32
  17. package/dist/cjs/layout/MenuTabs/index.js +18 -20
  18. package/dist/cjs/layout/PageFooter/index.js +1 -1
  19. package/dist/esm/field/NotifyBadge/index.d.ts +13 -4
  20. package/dist/esm/field/NotifyBadge/index.js +64 -85
  21. package/dist/esm/field/NotifyBadge/styles.js +24 -18
  22. package/dist/esm/field/RemoteField/index.js +21 -18
  23. package/dist/esm/form/AddonInput/index.js +65 -27
  24. package/dist/esm/form/AvatarUpload/index.d.ts +2 -2
  25. package/dist/esm/form/CaptchaInput/index.js +9 -3
  26. package/dist/esm/form/CollapseForm/index.js +3 -3
  27. package/dist/esm/form/CronInput/index.js +3 -3
  28. package/dist/esm/form/DivideSelect/index.js +24 -22
  29. package/dist/esm/form/LocaleInput/index.js +28 -17
  30. package/dist/esm/form/LocaleInput/styles.js +16 -8
  31. package/dist/esm/form/MathInput/index.js +5 -1
  32. package/dist/esm/form/SegmentRadio/index.js +24 -22
  33. package/dist/esm/form/TagInput/index.d.ts +1 -1
  34. package/dist/esm/form/TagInput/index.js +37 -34
  35. package/dist/esm/layout/MenuTabs/index.js +20 -20
  36. package/dist/esm/layout/PageFooter/index.js +1 -1
  37. package/package.json +2 -2
@@ -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
- if (props !== null && props !== void 0 && props.request) {
44
- var _props$debounceTime;
45
- var _useDebounceFn = useDebounceFn(props.request, (_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 (autoStart) {
49
- run(props === null || props === void 0 ? void 0 : props.params).then(function (data) {
50
- setOutcome(data);
51
- }).catch(function () {});
52
- }
53
- }, []);
54
- React.useEffect(function () {
55
- run(props === null || props === void 0 ? void 0 : props.params).then(function (data) {
56
- setOutcome(data);
57
- }).catch(function () {});
58
- }, [refreshId]);
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,
@@ -6,10 +6,14 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
8
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
9
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
10
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
14
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
17
  import React from 'react';
14
18
  import { Form, Input, Space } from 'antd';
15
19
  import { ProForm, FormListContext } from '@ant-design/pro-components';
@@ -37,6 +41,12 @@ export var AddonInput = function AddonInput(props) {
37
41
  _ref$proField = _ref.proField,
38
42
  proField = _ref$proField === void 0 ? true : _ref$proField;
39
43
  var fieldStyle = useFieldStyle(clazzPrefix);
44
+ var compositionRef = React.useRef(false);
45
+ var _React$useState = React.useState(undefined),
46
+ _React$useState2 = _slicedToArray(_React$useState, 2),
47
+ composingValue = _React$useState2[0],
48
+ setComposingValue = _React$useState2[1];
49
+ var webkitBrowser = navigator.userAgent.indexOf('WebKit') !== -1;
40
50
  var addonBeforeDom = typeof (props === null || props === void 0 ? void 0 : props.addonBefore) === 'function' ? props.addonBefore() : props === null || props === void 0 ? void 0 : props.addonBefore;
41
51
  var addonAfterDom = typeof (props === null || props === void 0 ? void 0 : props.addonAfter) === 'function' ? props.addonAfter() : props === null || props === void 0 ? void 0 : props.addonAfter;
42
52
  var addonBeforeStyle = {
@@ -49,7 +59,11 @@ export var AddonInput = function AddonInput(props) {
49
59
  };
50
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;
51
61
  var fieldName = !simpleName ? undefined : formListContext !== null && formListContext !== void 0 && formListContext.listName ? [].concat(_toConsumableArray(formListContext.listName), [simpleName]) : simpleName;
52
- var fieldValue = simpleName && form ? Form.useWatch(fieldName, form) : props === null || props === void 0 || (_props$fieldProps2 = props.fieldProps) === null || _props$fieldProps2 === void 0 ? void 0 : _props$fieldProps2.value;
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;
53
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);
54
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';
55
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);
@@ -59,9 +73,41 @@ export var AddonInput = function AddonInput(props) {
59
73
  var widthBlockClazz = !widthBlock ? undefined : "".concat(clazzPrefix, "-width-block");
60
74
  var entryReadModeClazz = !entryReadMode ? undefined : "".concat(clazzPrefix, "-read-mode");
61
75
  var entryImmutableClazz = !entryImmutable ? undefined : "".concat(clazzPrefix, "-immutable");
62
- var omitFieldProps = !(props !== null && props !== void 0 && props.fieldProps) ? {} : omit(props === null || props === void 0 ? void 0 : props.fieldProps, ['className', 'name', 'id', 'placeholder', 'allowClear', 'readOnly', 'disabled', 'value', 'onChange']);
76
+ var omitFieldProps = !(props !== null && props !== void 0 && props.fieldProps) ? {} : omit(props === null || props === void 0 ? void 0 : props.fieldProps, ['className', 'name', 'id', 'placeholder', 'allowClear', 'readOnly', 'disabled', 'value', 'onChange', 'onCompositionStart', 'onCompositionEnd']);
77
+ var setFieldValue = function setFieldValue(value) {
78
+ if (simpleName) {
79
+ form === null || form === void 0 || form.setFieldValue(simpleName, value);
80
+ }
81
+ };
82
+ var handleChange = function handleChange(event) {
83
+ var _props$fieldProps6, _props$fieldProps6$on;
84
+ if (compositionRef.current) {
85
+ setComposingValue(event.target.value);
86
+ return;
87
+ }
88
+ if (!simpleName) {
89
+ setComposingValue(event.target.value);
90
+ }
91
+ setFieldValue(event.target.value);
92
+ props === null || props === void 0 || (_props$fieldProps6 = props.fieldProps) === null || _props$fieldProps6 === void 0 || (_props$fieldProps6$on = _props$fieldProps6.onChange) === null || _props$fieldProps6$on === void 0 || _props$fieldProps6$on.call(_props$fieldProps6, event);
93
+ };
94
+ var handleCompositionStart = function handleCompositionStart(event) {
95
+ var _props$fieldProps7, _props$fieldProps7$on;
96
+ compositionRef.current = true;
97
+ props === null || props === void 0 || (_props$fieldProps7 = props.fieldProps) === null || _props$fieldProps7 === void 0 || (_props$fieldProps7$on = _props$fieldProps7.onCompositionStart) === null || _props$fieldProps7$on === void 0 || _props$fieldProps7$on.call(_props$fieldProps7, event);
98
+ };
99
+ var handleCompositionEnd = function handleCompositionEnd(event) {
100
+ var _props$fieldProps8, _props$fieldProps8$on;
101
+ compositionRef.current = false;
102
+ props === null || props === void 0 || (_props$fieldProps8 = props.fieldProps) === null || _props$fieldProps8 === void 0 || (_props$fieldProps8$on = _props$fieldProps8.onCompositionEnd) === null || _props$fieldProps8$on === void 0 || _props$fieldProps8$on.call(_props$fieldProps8, event);
103
+ var finalValue = event.currentTarget.value;
104
+ setComposingValue(simpleName ? undefined : finalValue);
105
+ if (webkitBrowser) {
106
+ setFieldValue(finalValue);
107
+ }
108
+ };
63
109
  if (proField) {
64
- var _props$fieldProps6, _StringUtils$join, _props$fieldProps7, _props$proFieldProps3, _props$fieldProps8;
110
+ var _props$fieldProps9, _StringUtils$join, _props$fieldProps10, _props$proFieldProps3, _props$fieldProps11;
65
111
  var restProps = !props ? {} : omit(props, ['className', 'name', 'allowClear', 'fieldProps', 'proFieldProps', 'clazzPrefix', 'addonBefore', 'addonAfter', 'cursorBefore', 'cursorAfter', 'paddingBefore', 'paddingAfter', 'widthBlock', 'proField']);
66
112
  return /*#__PURE__*/_jsx("div", {
67
113
  className: classnames(clazzPrefix, fieldStyle.hashId, proFieldClazz, widthBlockClazz, entryReadModeClazz, entryImmutableClazz),
@@ -78,23 +124,19 @@ export var AddonInput = function AddonInput(props) {
78
124
  style: addonBeforeStyle,
79
125
  children: addonBeforeDom
80
126
  }), /*#__PURE__*/_jsx(Input, _objectSpread({
81
- className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$fieldProps6 = props.fieldProps) === null || _props$fieldProps6 === void 0 ? void 0 : _props$fieldProps6.className),
82
- placeholder: (_StringUtils$join = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join !== void 0 ? _StringUtils$join : props === null || props === void 0 || (_props$fieldProps7 = props.fieldProps) === null || _props$fieldProps7 === void 0 ? void 0 : _props$fieldProps7.placeholder,
127
+ className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$fieldProps9 = props.fieldProps) === null || _props$fieldProps9 === void 0 ? void 0 : _props$fieldProps9.className),
128
+ placeholder: (_StringUtils$join = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join !== void 0 ? _StringUtils$join : props === null || props === void 0 || (_props$fieldProps10 = props.fieldProps) === null || _props$fieldProps10 === void 0 ? void 0 : _props$fieldProps10.placeholder,
83
129
  name: simpleName,
84
- value: entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps3 = props.proFieldProps) === null || _props$proFieldProps3 === void 0 ? void 0 : _props$proFieldProps3.emptyText) || '-' : fieldValue,
85
- allowClear: !entryImmutable && (props === null || props === void 0 ? void 0 : props.allowClear) !== false && (props === null || props === void 0 || (_props$fieldProps8 = props.fieldProps) === null || _props$fieldProps8 === void 0 ? void 0 : _props$fieldProps8.allowClear) !== false,
130
+ value: composingValue !== null && composingValue !== void 0 ? composingValue : entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps3 = props.proFieldProps) === null || _props$proFieldProps3 === void 0 ? void 0 : _props$proFieldProps3.emptyText) || '-' : fieldValue,
131
+ allowClear: !entryImmutable && (props === null || props === void 0 ? void 0 : props.allowClear) !== false && (props === null || props === void 0 || (_props$fieldProps11 = props.fieldProps) === null || _props$fieldProps11 === void 0 ? void 0 : _props$fieldProps11.allowClear) !== false,
86
132
  readOnly: entryReadMode || entryReadonly,
87
133
  disabled: entryDisabled,
88
134
  style: !inputWidth ? undefined : {
89
135
  width: inputWidth
90
136
  },
91
- onChange: function onChange(event) {
92
- var _props$fieldProps9, _props$fieldProps9$on;
93
- if (simpleName) {
94
- form === null || form === void 0 || form.setFieldValue(simpleName, event.target.value);
95
- }
96
- props === null || props === void 0 || (_props$fieldProps9 = props.fieldProps) === null || _props$fieldProps9 === void 0 || (_props$fieldProps9$on = _props$fieldProps9.onChange) === null || _props$fieldProps9$on === void 0 || _props$fieldProps9$on.call(_props$fieldProps9, event);
97
- }
137
+ onChange: handleChange,
138
+ onCompositionStart: handleCompositionStart,
139
+ onCompositionEnd: handleCompositionEnd
98
140
  }, omitFieldProps)), !!addonAfterDom && /*#__PURE__*/_jsx(Space.Addon, {
99
141
  className: "".concat(clazzPrefix, "-compact-after"),
100
142
  style: addonAfterStyle,
@@ -104,9 +146,9 @@ export var AddonInput = function AddonInput(props) {
104
146
  }))
105
147
  });
106
148
  } else {
107
- var _props$className, _props$fieldProps10, _props$fieldProps11, _StringUtils$join2, _props$fieldProps12, _props$proFieldProps4;
149
+ var _props$className, _props$fieldProps12, _props$fieldProps13, _StringUtils$join2, _props$fieldProps14, _props$proFieldProps4;
108
150
  return /*#__PURE__*/_jsx("div", {
109
- className: classnames(clazzPrefix, fieldStyle.hashId, proFieldClazz, widthBlockClazz, entryReadModeClazz, entryImmutableClazz, (_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : props === null || props === void 0 || (_props$fieldProps10 = props.fieldProps) === null || _props$fieldProps10 === void 0 ? void 0 : _props$fieldProps10.className),
151
+ className: classnames(clazzPrefix, fieldStyle.hashId, proFieldClazz, widthBlockClazz, entryReadModeClazz, entryImmutableClazz, (_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : props === null || props === void 0 || (_props$fieldProps12 = props.fieldProps) === null || _props$fieldProps12 === void 0 ? void 0 : _props$fieldProps12.className),
110
152
  children: /*#__PURE__*/_jsxs(Space.Compact, {
111
153
  className: "".concat(clazzPrefix, "-space"),
112
154
  style: {
@@ -117,22 +159,18 @@ export var AddonInput = function AddonInput(props) {
117
159
  style: addonBeforeStyle,
118
160
  children: addonBeforeDom
119
161
  }), /*#__PURE__*/_jsx(Input, _objectSpread({
120
- className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$fieldProps11 = props.fieldProps) === null || _props$fieldProps11 === void 0 ? void 0 : _props$fieldProps11.className),
162
+ className: classnames("".concat(clazzPrefix, "-input"), props === null || props === void 0 || (_props$fieldProps13 = props.fieldProps) === null || _props$fieldProps13 === void 0 ? void 0 : _props$fieldProps13.className),
121
163
  name: simpleName,
122
- placeholder: (_StringUtils$join2 = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join2 !== void 0 ? _StringUtils$join2 : props === null || props === void 0 || (_props$fieldProps12 = props.fieldProps) === null || _props$fieldProps12 === void 0 ? void 0 : _props$fieldProps12.placeholder,
123
- value: entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps4 = props.proFieldProps) === null || _props$proFieldProps4 === void 0 ? void 0 : _props$proFieldProps4.emptyText) || '-' : fieldValue,
164
+ placeholder: (_StringUtils$join2 = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join2 !== void 0 ? _StringUtils$join2 : props === null || props === void 0 || (_props$fieldProps14 = props.fieldProps) === null || _props$fieldProps14 === void 0 ? void 0 : _props$fieldProps14.placeholder,
165
+ value: composingValue !== null && composingValue !== void 0 ? composingValue : entryReadMode ? fieldValue || (props === null || props === void 0 || (_props$proFieldProps4 = props.proFieldProps) === null || _props$proFieldProps4 === void 0 ? void 0 : _props$proFieldProps4.emptyText) || '-' : fieldValue,
124
166
  readOnly: entryReadMode || entryReadonly,
125
167
  disabled: entryDisabled,
126
168
  style: !inputWidth ? undefined : {
127
169
  width: inputWidth
128
170
  },
129
- onChange: function onChange(event) {
130
- var _props$fieldProps13, _props$fieldProps13$o;
131
- if (props !== null && props !== void 0 && props.name) {
132
- form === null || form === void 0 || form.setFieldValue(props.name, event.target.value);
133
- }
134
- props === null || props === void 0 || (_props$fieldProps13 = props.fieldProps) === null || _props$fieldProps13 === void 0 || (_props$fieldProps13$o = _props$fieldProps13.onChange) === null || _props$fieldProps13$o === void 0 || _props$fieldProps13$o.call(_props$fieldProps13, event);
135
- }
171
+ onChange: handleChange,
172
+ onCompositionStart: handleCompositionStart,
173
+ onCompositionEnd: handleCompositionEnd
136
174
  }, omitFieldProps)), !!addonAfterDom && /*#__PURE__*/_jsx(Space.Addon, {
137
175
  className: "".concat(clazzPrefix, "-compact-after"),
138
176
  style: addonAfterStyle,
@@ -45,7 +45,7 @@ export type AvatarUploadProps = Omit<ProFormFieldItemProps, 'children' | 'fieldR
45
45
  locale?: string;
46
46
  localeProps?: IntlLocaleProps;
47
47
  };
48
- export declare const AvatarUpload: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "disabled" | "fieldProps" | "placeholder" | "readonly" | "fieldRef"> & {
48
+ export declare const AvatarUpload: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "placeholder" | "fieldProps" | "disabled" | "readonly" | "fieldRef"> & {
49
49
  clazzPrefix?: string | undefined;
50
50
  containerClazz?: string | undefined;
51
51
  containerStyle?: React.CSSProperties | undefined;
@@ -54,7 +54,7 @@ export declare const AvatarUpload: React.ForwardRefExoticComponent<Omit<ProFormF
54
54
  fallbackSrc?: string | undefined;
55
55
  shape?: CircleSquareShape | undefined;
56
56
  avatarProps?: Omit<AvatarProps, "children" | "src" | "srcSet" | "shape"> | undefined;
57
- imageProps?: Omit<ImageProps, "title" | "src" | "width" | "height" | "srcSet" | "preview" | "fallback"> | undefined;
57
+ imageProps?: Omit<ImageProps, "title" | "src" | "fallback" | "preview" | "height" | "srcSet" | "width"> | undefined;
58
58
  uploadEnabled?: boolean | undefined;
59
59
  uploadProps?: FileUploadProps | undefined;
60
60
  cropEnabled?: boolean | undefined;
@@ -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 watchValues = !(props !== null && props !== void 0 && props.autoValidate) ? [] : ProForm.useWatch([], {
139
- form: form,
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
- if (closeOnBlur) {
76
- useEventListener(['keydown', 'mousedown'], restoreLayout);
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
- if (props !== null && props !== void 0 && props.request && (props === null || props === void 0 ? void 0 : props.requestOptionPlace) !== false) {
59
- var _props$debounceTime;
60
- var _useDebounceFn = useDebounceFn(props.request, (_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
- run(props === null || props === void 0 ? void 0 : props.params).then(function (values) {
64
- if (!values) {
65
- if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
66
- setOptionItems(undefined);
67
- }
68
- return;
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
- }).catch(function () {});
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) {
@@ -16,7 +16,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
16
16
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  import React from 'react';
19
- import { ConfigProvider, Form, List, Popconfirm, Space, Tooltip } from 'antd';
19
+ import { ConfigProvider, Form, Listy, Popconfirm, Space, Tooltip } from 'antd';
20
20
  import { TranslationOutlined, SelectOutlined } from '@ant-design/icons';
21
21
  import { useIntl } from '@ant-design/pro-components';
22
22
  import { EditOrReadOnlyContext } from '@ant-design/pro-components/es/form/BaseForm/EditOrReadOnlyContext.js';
@@ -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);
@@ -121,8 +125,15 @@ export var LocaleInput = function LocaleInput(props) {
121
125
  useEventListener('resize', handleWindowResize);
122
126
  var addonEntryDom = typeof addon === 'function' ? addon() : addon;
123
127
  var buildEntryAddonDom = function buildEntryAddonDom(before) {
124
- return before && addonPos === 'before' || !before && addonPos === 'after' ? addonEntryDom : undefined;
128
+ if (!(before && addonPos === 'before' || !before && addonPos === 'after')) {
129
+ return undefined;
130
+ }
131
+ return multilingual ? addonEntryDom : /*#__PURE__*/_jsx("span", {
132
+ className: "".concat(clazzPrefix, "-entry-addon-disabled"),
133
+ children: addonEntryDom
134
+ });
125
135
  };
136
+ var entryAddonCursor = multilingual ? 'pointer' : 'not-allowed';
126
137
  var renderEntryReadonly = function renderEntryReadonly(dom) {
127
138
  var _props$proFieldProps;
128
139
  return /*#__PURE__*/_jsxs("div", {
@@ -157,8 +168,8 @@ export var LocaleInput = function LocaleInput(props) {
157
168
  children: /*#__PURE__*/_jsx(AddonInput, _objectSpread({
158
169
  addonBefore: buildEntryAddonDom(true),
159
170
  addonAfter: buildEntryAddonDom(false),
160
- cursorBefore: addonPos === 'before' ? 'pointer' : undefined,
161
- cursorAfter: addonPos === 'after' ? 'pointer' : undefined,
171
+ cursorBefore: addonPos === 'before' ? entryAddonCursor : undefined,
172
+ cursorAfter: addonPos === 'after' ? entryAddonCursor : undefined,
162
173
  fieldProps: _objectSpread(_objectSpread({
163
174
  className: classnames("".concat(clazzPrefix, "-entry-").concat(fieldId), (_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : props === null || props === void 0 || (_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 ? void 0 : _props$fieldProps.className),
164
175
  allowClear: (props === null || props === void 0 ? void 0 : props.allowClear) || (props === null || props === void 0 || (_props$fieldProps2 = props.fieldProps) === null || _props$fieldProps2 === void 0 ? void 0 : _props$fieldProps2.allowClear)
@@ -184,8 +195,8 @@ export var LocaleInput = function LocaleInput(props) {
184
195
  placeholder: (_StringUtils$join = StringUtils.join(props === null || props === void 0 ? void 0 : props.placeholder)) !== null && _StringUtils$join !== void 0 ? _StringUtils$join : props === null || props === void 0 || (_props$fieldProps4 = props.fieldProps) === null || _props$fieldProps4 === void 0 ? void 0 : _props$fieldProps4.placeholder,
185
196
  addonBefore: buildEntryAddonDom(true),
186
197
  addonAfter: buildEntryAddonDom(false),
187
- cursorBefore: addonPos === 'before' ? 'pointer' : undefined,
188
- cursorAfter: addonPos === 'after' ? 'pointer' : undefined,
198
+ cursorBefore: addonPos === 'before' ? entryAddonCursor : undefined,
199
+ cursorAfter: addonPos === 'after' ? entryAddonCursor : undefined,
189
200
  proField: proField,
190
201
  onChange: function onChange(event) {
191
202
  var _props$fieldProps5, _props$fieldProps5$on;
@@ -202,10 +213,6 @@ export var LocaleInput = function LocaleInput(props) {
202
213
  if (!multilingual || !(props !== null && props !== void 0 && props.popupInputProps) && !(props !== null && props !== void 0 && props.popupQuickTags)) {
203
214
  return buildEntryDom();
204
215
  }
205
- var _React$useState7 = React.useState(),
206
- _React$useState8 = _slicedToArray(_React$useState7, 2),
207
- confirmOpen = _React$useState8[0],
208
- setConfirmOpen = _React$useState8[1];
209
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);
210
217
  var handleSetAsDefault = function handleSetAsDefault(tagId) {
211
218
  var inspect = document.querySelector("[data-locale-input-id='".concat(fieldId, "']"));
@@ -435,13 +442,17 @@ export var LocaleInput = function LocaleInput(props) {
435
442
  props === null || props === void 0 || (_props$triggerProps = props.triggerProps) === null || _props$triggerProps === void 0 || (_props$triggerProps$o = _props$triggerProps.onOpenChange) === null || _props$triggerProps$o === void 0 || _props$triggerProps$o.call(_props$triggerProps, false);
436
443
  }, 200);
437
444
  },
438
- children: /*#__PURE__*/_jsx(List, {
439
- className: "".concat(clazzPrefix, "-popup-list"),
440
- dataSource: tagInputs,
441
- bordered: true,
442
- size: "small",
443
- renderItem: function renderItem(item) {
444
- return /*#__PURE__*/_jsx(List.Item, {
445
+ children: /*#__PURE__*/_jsx(Listy, {
446
+ className: classnames("".concat(clazzPrefix, "-popup-list"), "".concat(clazzPrefix, "-popup-list-bordered")),
447
+ items: tagInputs,
448
+ rowKey: function rowKey(_item, index) {
449
+ return index;
450
+ },
451
+ classNames: {
452
+ item: "".concat(clazzPrefix, "-popup-listy-item")
453
+ },
454
+ itemRender: function itemRender(item) {
455
+ return /*#__PURE__*/_jsx("div", {
445
456
  className: "".concat(clazzPrefix, "-popup-list-item"),
446
457
  children: item
447
458
  });
@@ -8,19 +8,28 @@ import { unit } from '@ant-design/cssinjs';
8
8
  import { useStyle } from '@ant-design/pro-components';
9
9
  import { PackageConst } from "../../constant/PackageConst";
10
10
  var buildFieldStyle = function buildFieldStyle(token) {
11
- return _defineProperty(_defineProperty({}, "".concat(token.componentCls, "-popup"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
11
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(token.componentCls, "-popup"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
12
12
  backgroundColor: token.colorBgContainer,
13
13
  borderRadius: token.borderRadiusLG,
14
14
  boxShadow: token.boxShadow,
15
15
  zIndex: token.zIndexPopupBase
16
- }, "".concat(token.componentCls, "-popup-list"), _defineProperty({}, "".concat(token.componentCls, "-popup-list-item"), _defineProperty(_defineProperty(_defineProperty({}, "&:hover", {
16
+ }, "".concat(token.componentCls, "-popup-list"), _defineProperty(_defineProperty(_defineProperty({}, "&".concat(token.componentCls, "-popup-list-bordered"), {
17
+ border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
18
+ borderRadius: token.borderRadiusLG
19
+ }), "".concat(token.componentCls, "-popup-listy-item"), _defineProperty({
20
+ borderBottom: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit)
21
+ }, "&:last-of-type", {
22
+ borderBottom: 'none'
23
+ })), "".concat(token.componentCls, "-popup-list-item"), _defineProperty(_defineProperty(_defineProperty({}, "&:hover", {
17
24
  backgroundColor: token.controlItemBgHover
18
25
  }), "> ".concat(token.antCls, "-form-item"), {
19
26
  width: '100%'
20
27
  }), "".concat(token.componentCls, "-locale-tag"), {
21
28
  color: token.colorTextSecondary,
22
29
  fontSize: token.fontSize - 1
23
- }))), "&".concat(token.componentCls, "-popup-immutable ").concat(token.componentCls, "-popup-list ").concat(token.componentCls, "-popup-list-item ").concat(token.antCls, "-form-item"), _defineProperty(_defineProperty(_defineProperty({
30
+ }))), "&".concat(token.componentCls, "-popup-pro-field ").concat(token.componentCls, "-popup-listy-item"), {
31
+ paddingBottom: 0
32
+ }), "&".concat(token.componentCls, "-popup-immutable ").concat(token.componentCls, "-popup-list ").concat(token.componentCls, "-popup-list-item ").concat(token.antCls, "-form-item"), _defineProperty(_defineProperty(_defineProperty({
24
33
  marginBottom: "0 !important"
25
34
  }, "".concat(token.componentCls, "-locale-tag"), {
26
35
  backgroundColor: token.controlItemBgHover,
@@ -51,11 +60,10 @@ var buildFieldStyle = function buildFieldStyle(token) {
51
60
  color: token.colorTextSecondary,
52
61
  padding: "2px ".concat(token.paddingXS, "px"),
53
62
  fontSize: token.fontSizeSM
54
- })), "&".concat(token.componentCls, "-popup-pro-field:not(").concat(token.componentCls, "-popup-immutable)"), _defineProperty({}, "".concat(token.componentCls, "-popup-list ").concat(token.componentCls, "-popup-list-item:first-of-type"), {
55
- paddingTop: token.paddingMD
56
- })), "&:not(".concat(token.componentCls, "-popup-pro-field)"), _defineProperty({}, "".concat(token.componentCls, "-popup-list ").concat(token.componentCls, "-popup-list-item:first-of-type"), {
57
- paddingTop: token.paddingXS
58
- }))), "".concat(token.componentCls, "-entry-readonly"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
63
+ }))), "".concat(token.componentCls, "-entry-addon-disabled"), {
64
+ color: token.colorTextDisabled,
65
+ cursor: 'not-allowed'
66
+ }), "".concat(token.componentCls, "-entry-readonly"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
59
67
  display: 'flex',
60
68
  flexFlow: 'row nowrap',
61
69
  alignItems: 'center'
@@ -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 fieldValue = props !== null && props !== void 0 && props.name && form ? Form.useWatch(fieldName, form) : props === null || props === void 0 ? void 0 : props.value;
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
- if (props !== null && props !== void 0 && props.request && (props === null || props === void 0 ? void 0 : props.requestOptionPlace) !== false) {
43
- var _props$debounceTime;
44
- var _useDebounceFn = useDebounceFn(props.request, (_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
- run(props === null || props === void 0 ? void 0 : props.params).then(function (values) {
48
- if (!values) {
49
- if ((props === null || props === void 0 ? void 0 : props.requestOptionPlace) === 'override') {
50
- setOptionItems(undefined);
51
- }
52
- return;
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
- }).catch(function () {});
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" | "disabled" | "fieldProps" | "placeholder" | "readonly" | "fieldRef"> & Omit<ProFormFieldRemoteProps, "request" | "valueEnum"> & {
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;