tabler-react-2 0.1.137 → 0.1.138
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/input/dropdown.js
CHANGED
|
@@ -8,7 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _index = require("../index");
|
|
10
10
|
var _util = require("../util");
|
|
11
|
-
var _excluded = ["prompt", "values", "items", "value", "onChange", "aprops", "showSearch", "loading", "disabled", "disabledText", "label", "showLabel", "color", "outline", "maxHeight", "required"];
|
|
11
|
+
var _excluded = ["prompt", "values", "items", "value", "onChange", "aprops", "showSearch", "loading", "disabled", "disabledText", "label", "showLabel", "color", "outline", "maxHeight", "required", "autofocusSearch"];
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -44,6 +44,8 @@ var DropdownInput = exports.DropdownInput = function DropdownInput(_ref) {
|
|
|
44
44
|
_ref$maxHeight = _ref.maxHeight,
|
|
45
45
|
maxHeight = _ref$maxHeight === void 0 ? "300px" : _ref$maxHeight,
|
|
46
46
|
required = _ref.required,
|
|
47
|
+
_ref$autofocusSearch = _ref.autofocusSearch,
|
|
48
|
+
autofocusSearch = _ref$autofocusSearch === void 0 ? false : _ref$autofocusSearch,
|
|
47
49
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
48
50
|
var values = ivalues || items || [];
|
|
49
51
|
var getLabelText = function getLabelText(val) {
|
|
@@ -118,7 +120,7 @@ var DropdownInput = exports.DropdownInput = function DropdownInput(_ref) {
|
|
|
118
120
|
className: "btn dropdown-toggle ".concat(props.disabled ? "disabled" : "", " ").concat(color ? "btn-".concat(outline ? "outline-" : "").concat(color) : "", " ").concat(props.className || ""),
|
|
119
121
|
"data-bs-toggle": "dropdown"
|
|
120
122
|
}, aprops), /*#__PURE__*/_react["default"].createElement(_util.Row, {
|
|
121
|
-
gap: 0.
|
|
123
|
+
gap: 0.5
|
|
122
124
|
}, selectedValue && props.showIconInPrompt ? selectedValue.icon : null, selectedValue ? selectedValue.label : prompt)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
123
125
|
className: "dropdown-menu"
|
|
124
126
|
}, showSearch && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -128,6 +130,9 @@ var DropdownInput = exports.DropdownInput = function DropdownInput(_ref) {
|
|
|
128
130
|
value: searchQuery,
|
|
129
131
|
onChange: function onChange(q) {
|
|
130
132
|
return setSearchQuery(q);
|
|
133
|
+
},
|
|
134
|
+
inputProps: {
|
|
135
|
+
autoFocus: autofocusSearch
|
|
131
136
|
}
|
|
132
137
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
138
|
style: {
|