@parrot-co/parrot-ui 0.1.25 → 0.1.26
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/main.js +17 -19
- package/dist/main.js.map +1 -1
- package/dist/module.js +17 -19
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +18 -18
package/dist/module.js
CHANGED
|
@@ -1572,10 +1572,10 @@ const $c35269c9504bc94d$export$5b7f4051a57920d0 = (0, $hgUW1$Item);
|
|
|
1572
1572
|
const $c35269c9504bc94d$export$ef146090a6472d9e = (0, $hgUW1$Section);
|
|
1573
1573
|
|
|
1574
1574
|
|
|
1575
|
-
function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items }) {
|
|
1575
|
+
function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderOption: renderOption, valueKey: valueKey, sectionKey: sectionKey, renderSectionLabel: renderSectionLabel, labelKey: labelKey, items: items, defaultItems: defaultItems }) {
|
|
1576
1576
|
const hasChildren = $hgUW1$Children.count(children) > 0;
|
|
1577
1577
|
if (hasChildren || typeof children === "function") return children;
|
|
1578
|
-
if (items) // eslint-disable-next-line react/display-name
|
|
1578
|
+
if (items || defaultItems) // eslint-disable-next-line react/display-name
|
|
1579
1579
|
return (item)=>{
|
|
1580
1580
|
const label = item?.[labelKey ?? "label"];
|
|
1581
1581
|
const value = item?.[valueKey ?? "id" ?? "key" ?? "value"];
|
|
@@ -1598,12 +1598,7 @@ function $b71fd84ba612e4b0$export$3d7d0414f6db67e7({ children: children, renderO
|
|
|
1598
1598
|
};
|
|
1599
1599
|
}
|
|
1600
1600
|
function $b71fd84ba612e4b0$export$4c687b6f1150e71b(props) {
|
|
1601
|
-
|
|
1602
|
-
return $b71fd84ba612e4b0$export$3d7d0414f6db67e7(props);
|
|
1603
|
-
}, [
|
|
1604
|
-
props.children
|
|
1605
|
-
]);
|
|
1606
|
-
return children;
|
|
1601
|
+
return $b71fd84ba612e4b0$export$3d7d0414f6db67e7(props);
|
|
1607
1602
|
}
|
|
1608
1603
|
|
|
1609
1604
|
|
|
@@ -1790,16 +1785,20 @@ function $6ae005878b435ce8$var$ListSection({ state: state, section: section }) {
|
|
|
1790
1785
|
function $618e53c42107439d$export$72b9695b8216309a({ description: description, descriptionProps: descriptionProps, error: error, errorMessageProps: errorMessageProps, label: label, labelProps: labelProps, selectorIcon: selectorIcon, selectorSize: selectorSize = "sm", style: style, styles: styles, className: className, classNames: classNames, isLoading: isLoading, loadData: loadData, loadingIndicator: loadingIndicator = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e1148cdb3a130657$export$3b0d6d7590275603), {
|
|
1791
1786
|
size: "xs"
|
|
1792
1787
|
}), ...props }) {
|
|
1793
|
-
|
|
1794
|
-
if (loadData) list = (0, $hgUW1$useAsyncList)({
|
|
1788
|
+
const list = (0, $hgUW1$useAsyncList)({
|
|
1795
1789
|
async load ({ filterText: filterText, signal: signal }) {
|
|
1796
|
-
|
|
1790
|
+
if (loadData) {
|
|
1791
|
+
const res = await loadData(filterText, signal);
|
|
1792
|
+
return {
|
|
1793
|
+
items: res
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1797
1796
|
return {
|
|
1798
|
-
items:
|
|
1797
|
+
items: []
|
|
1799
1798
|
};
|
|
1800
1799
|
}
|
|
1801
1800
|
});
|
|
1802
|
-
if (
|
|
1801
|
+
if (loadData) {
|
|
1803
1802
|
props.items = list.items;
|
|
1804
1803
|
props.inputValue = list.filterText;
|
|
1805
1804
|
props.onInputChange = list.setFilterText;
|
|
@@ -1820,11 +1819,11 @@ function $618e53c42107439d$export$72b9695b8216309a({ description: description, d
|
|
|
1820
1819
|
const popoverRef = $hgUW1$useRef(null);
|
|
1821
1820
|
const wrapperRef = $hgUW1$useRef(null);
|
|
1822
1821
|
const { inputProps: inputProps, buttonProps: buttonProps, listBoxProps: listBoxProps, labelProps: AriaLabelProps } = (0, $hgUW1$useComboBox)({
|
|
1822
|
+
...props,
|
|
1823
1823
|
buttonRef: buttonRef,
|
|
1824
1824
|
inputRef: inputRef,
|
|
1825
1825
|
listBoxRef: listBoxRef,
|
|
1826
|
-
popoverRef: popoverRef
|
|
1827
|
-
...props
|
|
1826
|
+
popoverRef: popoverRef
|
|
1828
1827
|
}, state);
|
|
1829
1828
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
1830
1829
|
children: [
|
|
@@ -1844,7 +1843,6 @@ function $618e53c42107439d$export$72b9695b8216309a({ description: description, d
|
|
|
1844
1843
|
/*#__PURE__*/ (0, $hgUW1$jsx)("input", {
|
|
1845
1844
|
className: "p-text-input-el",
|
|
1846
1845
|
ref: inputRef,
|
|
1847
|
-
type: "text",
|
|
1848
1846
|
...inputProps
|
|
1849
1847
|
}),
|
|
1850
1848
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e3f71af5eaf1c216$export$c25acd513dcc8062), {
|
|
@@ -1863,10 +1861,10 @@ function $618e53c42107439d$export$72b9695b8216309a({ description: description, d
|
|
|
1863
1861
|
popoverRef: popoverRef,
|
|
1864
1862
|
isNonModal: true,
|
|
1865
1863
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6ae005878b435ce8$export$41f133550aa26f48), {
|
|
1866
|
-
width: wrapperRef.current?.getBoundingClientRect()
|
|
1867
|
-
...listBoxProps,
|
|
1864
|
+
width: wrapperRef.current?.getBoundingClientRect()?.width,
|
|
1868
1865
|
listBoxRef: listBoxRef,
|
|
1869
|
-
state: state
|
|
1866
|
+
state: state,
|
|
1867
|
+
...listBoxProps
|
|
1870
1868
|
})
|
|
1871
1869
|
})
|
|
1872
1870
|
]
|