bianic-ui 1.0.0-beta.25 → 1.0.0-beta.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/cjs/index.js
CHANGED
|
@@ -1744,7 +1744,7 @@ var sizeConfig$5 = {
|
|
|
1744
1744
|
|
|
1745
1745
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1746
1746
|
function DefaultDropdownItem(_a) {
|
|
1747
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, isSelected = _a.isSelected, options = _a.options;
|
|
1747
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, isSelected = _a.isSelected, options = _a.options, caption = _a.caption;
|
|
1748
1748
|
var _f = React.useState(false), isHovered = _f[0], setisHovered = _f[1];
|
|
1749
1749
|
var _g = React.useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
1750
1750
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
@@ -1753,9 +1753,11 @@ function DefaultDropdownItem(_a) {
|
|
|
1753
1753
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
1754
1754
|
var isExistSubDropdown = options.length !== 0;
|
|
1755
1755
|
return (React.createElement("div", { className: "w-full relative focus-visible:outline-bia-blue-light-50 ".concat(containerClass), tabIndex: 0, role: "button", onClick: function (e) { return onClick(e); }, onMouseEnter: function () { return setisHovered(true); }, onMouseLeave: function () { return setisHovered(false); }, onKeyDown: function () { } },
|
|
1756
|
-
React.createElement("div", { className: "hover:bg-bia-blue-light-90 active:bg-bia-blue-light-80 select-none ".concat(itemClass) },
|
|
1757
|
-
|
|
1758
|
-
|
|
1756
|
+
React.createElement("div", { className: "hover:bg-bia-blue-light-90 active:bg-bia-blue-light-80 select-none flex flex-col ".concat(itemClass) },
|
|
1757
|
+
React.createElement("span", null,
|
|
1758
|
+
label,
|
|
1759
|
+
isExistSubDropdown && (React.createElement(TbChevronRight, { className: "float-right text-bia-grey" }))),
|
|
1760
|
+
React.createElement(Text, { variant: "small-text", extended: "text-bia-coolgrey" }, caption)),
|
|
1759
1761
|
isOpenDropdown && options && isExistSubDropdown && (React.createElement("div", { className: "absolute z-50 top-0 right-0 translate-x-full border w-full bg-primary-white border-bia-grey-dark-10 rounded-md shadow-lg", onMouseEnter: function () { return setIsHoveredSubMenu(true); }, onMouseLeave: function () { return setIsHoveredSubMenu(false); } }, options.map(function (option) { return (React.createElement(DefaultDropdownItem, { label: option.label, size: size, options: option.options })); })))));
|
|
1760
1762
|
}
|
|
1761
1763
|
DefaultDropdownItem.defaultProps = {
|
|
@@ -1764,6 +1766,7 @@ DefaultDropdownItem.defaultProps = {
|
|
|
1764
1766
|
size: 'md',
|
|
1765
1767
|
options: [],
|
|
1766
1768
|
isSelected: false,
|
|
1769
|
+
caption: '',
|
|
1767
1770
|
};
|
|
1768
1771
|
|
|
1769
1772
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -1794,7 +1797,7 @@ function SelectInput(_a) {
|
|
|
1794
1797
|
React.createElement("div", { className: "absolute inset-y-0 pl-3 flex items-center pointer-events-none text-bia-coolgrey peer-disabled:text-bia-coolgrey-light-50 ".concat(iconSize) }, isOpen ? (React.createElement(TbChevronUp, { className: "" })) : (React.createElement(TbChevronDown, { className: "" }))),
|
|
1795
1798
|
isOpen && (React.createElement("div", { className: "absolute border w-full bg-primary-white border-bia-grey-dark-10 rounded-b-md shadow-lg z-10" }, options.map(function (option) {
|
|
1796
1799
|
var isSelected = selected && selected.id && option.id === selected.id;
|
|
1797
|
-
return (React.createElement(DefaultDropdownItem, { label: option.label, size: validatedSize, isSelected: isSelected, onClick: function () {
|
|
1800
|
+
return (React.createElement(DefaultDropdownItem, { label: option.label, caption: option.caption, size: validatedSize, isSelected: isSelected, onClick: function () {
|
|
1798
1801
|
setSelected(option);
|
|
1799
1802
|
setIsOpen(false);
|
|
1800
1803
|
} }));
|
|
@@ -1817,27 +1820,33 @@ function SelectInputSimulation(_a) {
|
|
|
1817
1820
|
var _c = React.useState({
|
|
1818
1821
|
id: 1,
|
|
1819
1822
|
label: 'Mohammed Salah',
|
|
1823
|
+
caption: 'Liverpool',
|
|
1820
1824
|
}), selected = _c[0], setSelected = _c[1];
|
|
1821
1825
|
var optionData = [
|
|
1822
1826
|
{
|
|
1823
1827
|
id: 1,
|
|
1824
1828
|
label: 'Mohammed Salah',
|
|
1829
|
+
caption: 'Liverpool',
|
|
1825
1830
|
},
|
|
1826
1831
|
{
|
|
1827
1832
|
id: 2,
|
|
1828
1833
|
label: 'Cristiono Ronaldo',
|
|
1834
|
+
caption: 'Manchester United',
|
|
1829
1835
|
},
|
|
1830
1836
|
{
|
|
1831
1837
|
id: 3,
|
|
1832
1838
|
label: 'Vinicius Junior',
|
|
1839
|
+
caption: 'Real Madrid',
|
|
1833
1840
|
},
|
|
1834
1841
|
{
|
|
1835
1842
|
id: 4,
|
|
1836
1843
|
label: 'Lionel Messi',
|
|
1844
|
+
caption: 'Paris Saint Germain',
|
|
1837
1845
|
},
|
|
1838
1846
|
{
|
|
1839
1847
|
id: 5,
|
|
1840
1848
|
label: 'Ricardo Kaka',
|
|
1849
|
+
caption: 'AC Milan',
|
|
1841
1850
|
},
|
|
1842
1851
|
];
|
|
1843
1852
|
return (React.createElement(SelectInput, { label: "Input Select", descText: "Deskripsi Input Select", options: optionData, selected: selected, setSelected: setSelected, size: size, id: "demo-id" }));
|