x-ui-design 0.5.93 → 0.5.95
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/index.esm.js +13 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/lib/components/Form/Item/Item.tsx +16 -15
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import require$$1 from 'react/jsx-runtime';
|
|
2
|
-
import React, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect, createContext, useImperativeHandle,
|
|
2
|
+
import React, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect, useCallback, createContext, useImperativeHandle, useLayoutEffect } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import ReactDOMServer from 'react-dom/server';
|
|
5
5
|
|
|
@@ -974,17 +974,6 @@ function flattenChildren(children) {
|
|
|
974
974
|
var css_248z$l = ".xUi-form-item{display:flex;position:relative}.xUi-form-item.noStyle{display:inline-flex;margin-bottom:0}.xUi-form-item-label{align-items:center;color:var(--xui-text-color);display:flex;font-size:var(--xui-font-size-md);font-weight:500;line-height:20px;margin-bottom:4px}.xUi-form-item-error{color:var(--xui-error-color);display:block;font-size:var(--xui-font-size-xs);line-height:16px;margin-bottom:8px;margin-top:4px;min-height:16px;position:relative;right:0;text-align:end;user-select:none}.xUi-form-item-required{color:var(--xui-error-color);display:inline-block;font-size:var(--xui-font-size-md);line-height:1;margin-left:4px;margin-right:4px}.xUi-form-item.horizontal{align-items:center;flex-direction:row;gap:4px}.xUi-form-item.vertical{align-self:flex-start;flex-direction:column}.xUi-form-item .xUi-input-container{width:-webkit-fill-available}";
|
|
975
975
|
styleInject(css_248z$l);
|
|
976
976
|
|
|
977
|
-
const debounce = (func, delay) => {
|
|
978
|
-
let timeoutId = null;
|
|
979
|
-
return (...args) => {
|
|
980
|
-
if (timeoutId) {
|
|
981
|
-
clearTimeout(timeoutId);
|
|
982
|
-
}
|
|
983
|
-
timeoutId = setTimeout(() => {
|
|
984
|
-
func(...args);
|
|
985
|
-
}, delay);
|
|
986
|
-
};
|
|
987
|
-
};
|
|
988
977
|
const FormItem$1 = ({
|
|
989
978
|
prefixCls = prefixClsFormItem,
|
|
990
979
|
name,
|
|
@@ -1133,9 +1122,20 @@ const FormItemChildComponent = ({
|
|
|
1133
1122
|
const {
|
|
1134
1123
|
getFieldsValue
|
|
1135
1124
|
} = formContext || {};
|
|
1125
|
+
const debounce = useCallback((func, delay) => {
|
|
1126
|
+
let timeoutId = null;
|
|
1127
|
+
return (...args) => {
|
|
1128
|
+
if (timeoutId) {
|
|
1129
|
+
clearTimeout(timeoutId);
|
|
1130
|
+
}
|
|
1131
|
+
timeoutId = setTimeout(() => {
|
|
1132
|
+
func(...args);
|
|
1133
|
+
}, delay);
|
|
1134
|
+
};
|
|
1135
|
+
}, []);
|
|
1136
1136
|
const debouncedSetFieldValue = useRef(debounce((name, value) => {
|
|
1137
1137
|
setFieldValue(name, value, undefined, undefined, true);
|
|
1138
|
-
},
|
|
1138
|
+
}, 70)).current;
|
|
1139
1139
|
const handleChange = (e, option) => {
|
|
1140
1140
|
let rawValue = e?.target ? e.target.value : e;
|
|
1141
1141
|
if (normalize) {
|