funuicss 3.4.6 → 3.4.7

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.4.6",
2
+ "version": "3.4.7",
3
3
  "name": "funuicss",
4
4
  "description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
5
5
  "main": "index.js",
@@ -22,6 +22,7 @@ interface CustomSelectProps {
22
22
  status?: 'success' | 'warning' | 'danger' | '';
23
23
  className?: string;
24
24
  funcss?: string;
25
+ searchAutoFocus?: boolean;
25
26
  style?: React.CSSProperties;
26
27
  }
27
28
  declare const Select: React.FC<CustomSelectProps>;
@@ -35,12 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  var react_1 = __importStar(require("react"));
37
37
  var Select = function (_a) {
38
- var id = _a.id, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, _b = _a.placeholder, placeholder = _b === void 0 ? 'Select an option' : _b, _c = _a.options, options = _c === void 0 ? [] : _c, onChange = _a.onChange, onBlur = _a.onBlur, _d = _a.searchable, searchable = _d === void 0 ? true : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? false : _f, _g = _a.borderless, borderless = _g === void 0 ? false : _g, _h = _a.rounded, rounded = _h === void 0 ? false : _h, _j = _a.flat, flat = _j === void 0 ? false : _j, _k = _a.fullWidth, fullWidth = _k === void 0 ? false : _k, _l = _a.status, status = _l === void 0 ? '' : _l, _m = _a.className, className = _m === void 0 ? '' : _m, _o = _a.funcss, funcss = _o === void 0 ? '' : _o, _p = _a.style, style = _p === void 0 ? {} : _p;
39
- var _q = (0, react_1.useState)(false), isOpen = _q[0], setIsOpen = _q[1];
40
- var _r = (0, react_1.useState)(null), selectedOption = _r[0], setSelectedOption = _r[1];
41
- var _s = (0, react_1.useState)(''), searchQuery = _s[0], setSearchQuery = _s[1];
42
- var _t = (0, react_1.useState)(-1), focusedIndex = _t[0], setFocusedIndex = _t[1];
43
- var _u = (0, react_1.useState)(options), filteredOptions = _u[0], setFilteredOptions = _u[1];
38
+ var id = _a.id, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, _b = _a.placeholder, placeholder = _b === void 0 ? 'Select an option' : _b, _c = _a.options, options = _c === void 0 ? [] : _c, onChange = _a.onChange, onBlur = _a.onBlur, _d = _a.searchable, searchable = _d === void 0 ? true : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? false : _f, _g = _a.borderless, borderless = _g === void 0 ? false : _g, _h = _a.rounded, rounded = _h === void 0 ? false : _h, _j = _a.flat, flat = _j === void 0 ? false : _j, _k = _a.fullWidth, fullWidth = _k === void 0 ? false : _k, _l = _a.status, status = _l === void 0 ? '' : _l, _m = _a.className, className = _m === void 0 ? '' : _m, _o = _a.funcss, funcss = _o === void 0 ? '' : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.searchAutoFocus, searchAutoFocus = _q === void 0 ? false : _q;
39
+ var _r = (0, react_1.useState)(false), isOpen = _r[0], setIsOpen = _r[1];
40
+ var _s = (0, react_1.useState)(null), selectedOption = _s[0], setSelectedOption = _s[1];
41
+ var _t = (0, react_1.useState)(''), searchQuery = _t[0], setSearchQuery = _t[1];
42
+ var _u = (0, react_1.useState)(-1), focusedIndex = _u[0], setFocusedIndex = _u[1];
43
+ var _v = (0, react_1.useState)(options), filteredOptions = _v[0], setFilteredOptions = _v[1];
44
44
  var containerRef = (0, react_1.useRef)(null);
45
45
  var triggerRef = (0, react_1.useRef)(null);
46
46
  var searchInputRef = (0, react_1.useRef)(null);
@@ -85,7 +85,9 @@ var Select = function (_a) {
85
85
  return;
86
86
  setIsOpen(true);
87
87
  if (searchable && searchInputRef.current) {
88
- setTimeout(function () { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 100);
88
+ if (searchAutoFocus) {
89
+ setTimeout(function () { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 100);
90
+ }
89
91
  }
90
92
  else if (selectedOption) {
91
93
  var index = filteredOptions.findIndex(function (opt) { return opt.value === selectedOption.value; });