x-ui-design 0.4.22 → 0.4.24
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 +5 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +1 -1
- package/lib/helpers/flatten.ts +4 -0
- package/package.json +1 -1
- package/src/app/page.tsx +4 -19
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import require$$1 from 'react/jsx-runtime';
|
|
2
|
-
import React, { useRef, useState,
|
|
2
|
+
import React, { useRef, useState, isValidElement, Children, 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
|
|
|
@@ -907,6 +907,9 @@ function clsx(...args) {
|
|
|
907
907
|
|
|
908
908
|
function flattenChildren(children) {
|
|
909
909
|
const result = [];
|
|
910
|
+
if (Array.isArray(children) && ! /*#__PURE__*/isValidElement(children[0])) {
|
|
911
|
+
return children;
|
|
912
|
+
}
|
|
910
913
|
Children.forEach(children, child => {
|
|
911
914
|
if (! /*#__PURE__*/isValidElement(child)) return;
|
|
912
915
|
if (child.type === Fragment || child.type === Suspense) {
|
|
@@ -3424,7 +3427,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
|
|
|
3424
3427
|
isOpen: isOpen
|
|
3425
3428
|
}));
|
|
3426
3429
|
}, [showArrow, showSearch, isOpen, suffixIcon, searchIcon]);
|
|
3427
|
-
const extractedOptions = children ? extractOptions(children) : Array.isArray(options) ? options : [];
|
|
3430
|
+
const extractedOptions = children ? Array.isArray(children) && ! /*#__PURE__*/isValidElement(children[0]) ? children : extractOptions(children) : Array.isArray(options) ? options : [];
|
|
3428
3431
|
const triggerNode = useMemo(() => {
|
|
3429
3432
|
return selectRef.current?.querySelector(`.${prefixCls}-trigger`);
|
|
3430
3433
|
}, [prefixCls]);
|