x-ui-design 0.3.72 → 0.3.74
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 +33 -41
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -40
- package/dist/index.js.map +1 -1
- package/lib/components/Form/Form.tsx +17 -18
- package/lib/components/Form/Item/Item.tsx +17 -16
- package/lib/components/Input/Input.tsx +4 -0
- package/lib/components/Select/Select.tsx +4 -0
- package/package.json +1 -1
- package/src/app/page.tsx +8 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import require$$1 from 'react/jsx-runtime';
|
|
2
|
-
import React$1, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect,
|
|
2
|
+
import React$1, { useRef, useState, Children, isValidElement, Fragment, Suspense, useContext, useMemo, useEffect, createContext, forwardRef, useImperativeHandle, useCallback } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import ReactDOMServer from 'react-dom/server';
|
|
5
5
|
|
|
@@ -820,6 +820,16 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
|
820
820
|
return formInstance;
|
|
821
821
|
};
|
|
822
822
|
|
|
823
|
+
function _extends() {
|
|
824
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
825
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
826
|
+
var t = arguments[e];
|
|
827
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
828
|
+
}
|
|
829
|
+
return n;
|
|
830
|
+
}, _extends.apply(null, arguments);
|
|
831
|
+
}
|
|
832
|
+
|
|
823
833
|
const prefixClsForm = 'xUi-form';
|
|
824
834
|
const prefixClsFormItem = 'xUi-form-item';
|
|
825
835
|
const prefixClsEmpty = 'xUi-empty';
|
|
@@ -835,16 +845,6 @@ const prefixClsTimePicker = 'xUi-timepicker';
|
|
|
835
845
|
const prefixClsButton = 'xUi-button';
|
|
836
846
|
const prefixClsSkeleton = 'xUi-skeleton';
|
|
837
847
|
|
|
838
|
-
function _extends() {
|
|
839
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
840
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
841
|
-
var t = arguments[e];
|
|
842
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
843
|
-
}
|
|
844
|
-
return n;
|
|
845
|
-
}, _extends.apply(null, arguments);
|
|
846
|
-
}
|
|
847
|
-
|
|
848
848
|
const parseValue = value => {
|
|
849
849
|
if (value === 'true') {
|
|
850
850
|
return true;
|
|
@@ -1051,31 +1051,23 @@ const FormItemChildComponent = ({
|
|
|
1051
1051
|
const childProps = child.props;
|
|
1052
1052
|
const isWrapper = typeof child.type === 'string' && !('dangerouslySetInnerHTML' in childProps) && ['div', 'span', 'label'].includes(child.type);
|
|
1053
1053
|
if (isWrapper) {
|
|
1054
|
-
return /*#__PURE__*/
|
|
1055
|
-
...childProps,
|
|
1056
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1057
|
-
// @ts-expect-error
|
|
1058
|
-
children: Children.map(flattenChildren(childProps.children), injectPropsIntoFinalLeaf)
|
|
1059
|
-
});
|
|
1054
|
+
return /*#__PURE__*/React$1.createElement(child.type, childProps, Children.map(flattenChildren(childProps.children), injectPropsIntoFinalLeaf));
|
|
1060
1055
|
}
|
|
1061
1056
|
if (childProps?.__injected) {
|
|
1062
1057
|
return child;
|
|
1063
1058
|
}
|
|
1064
|
-
return /*#__PURE__*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
// @ts-expect-error
|
|
1068
|
-
name,
|
|
1059
|
+
return /*#__PURE__*/React$1.createElement(child.type, _extends({}, props, child.props, {
|
|
1060
|
+
name: name,
|
|
1061
|
+
child: child,
|
|
1069
1062
|
onChange: handleChange,
|
|
1070
1063
|
key: `${name}_${wasNormalize}`,
|
|
1071
|
-
value: fieldValue ?? props.value
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
});
|
|
1064
|
+
value: fieldValue ?? props.value
|
|
1065
|
+
}, 'dangerouslySetInnerHTML' in childProps ? {} : {
|
|
1066
|
+
__injected: true,
|
|
1067
|
+
...(error ? {
|
|
1068
|
+
error
|
|
1069
|
+
} : {})
|
|
1070
|
+
}));
|
|
1079
1071
|
};
|
|
1080
1072
|
return injectPropsIntoFinalLeaf(child);
|
|
1081
1073
|
};
|
|
@@ -1132,23 +1124,16 @@ const Form$1 = ({
|
|
|
1132
1124
|
const childProps = child.props;
|
|
1133
1125
|
const isWrapper = typeof child.type === 'string' && !('dangerouslySetInnerHTML' in childProps) && ['div', 'span', 'label'].includes(child.type);
|
|
1134
1126
|
if (isWrapper) {
|
|
1135
|
-
return /*#__PURE__*/
|
|
1136
|
-
...childProps,
|
|
1137
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1138
|
-
// @ts-expect-error
|
|
1139
|
-
children: Children.map(flattenChildren(childProps.children), injectPropsIntoFinalLeaf)
|
|
1140
|
-
});
|
|
1127
|
+
return /*#__PURE__*/React$1.createElement(child.type, childProps, Children.map(flattenChildren(childProps.children), injectPropsIntoFinalLeaf));
|
|
1141
1128
|
}
|
|
1142
1129
|
if (childProps?.__injected) {
|
|
1143
1130
|
return child;
|
|
1144
1131
|
}
|
|
1145
|
-
return /*#__PURE__*/
|
|
1146
|
-
|
|
1147
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1148
|
-
// @ts-expect-error
|
|
1132
|
+
return /*#__PURE__*/React$1.createElement(child.type, _extends({}, child.props, {
|
|
1133
|
+
child: child,
|
|
1149
1134
|
size: childProps.size || rest.size,
|
|
1150
1135
|
layout: childProps.layout || layout
|
|
1151
|
-
});
|
|
1136
|
+
}));
|
|
1152
1137
|
};
|
|
1153
1138
|
return /*#__PURE__*/React$1.createElement(FormContext.Provider, {
|
|
1154
1139
|
value: formInstance
|
|
@@ -2656,6 +2641,10 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
2656
2641
|
iconRender,
|
|
2657
2642
|
noStyle,
|
|
2658
2643
|
feedbackIcons,
|
|
2644
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2645
|
+
// @ts-expect-error
|
|
2646
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2647
|
+
__injected,
|
|
2659
2648
|
...props
|
|
2660
2649
|
}, ref) => {
|
|
2661
2650
|
const inputRef = useRef(null);
|
|
@@ -3157,6 +3146,9 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3157
3146
|
controller.abort();
|
|
3158
3147
|
};
|
|
3159
3148
|
}, [isOpen, getPopupContainer, updateDropdownPosition]);
|
|
3149
|
+
useEffect(() => {
|
|
3150
|
+
console.log(1);
|
|
3151
|
+
}, []);
|
|
3160
3152
|
useEffect(() => {
|
|
3161
3153
|
updateDropdownPosition(true);
|
|
3162
3154
|
}, [searchQuery.length]);
|