phx-react 1.3.529 → 1.3.530
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.
|
@@ -18,7 +18,7 @@ var PHXSelectBox = function (props) {
|
|
|
18
18
|
var comboBtn = (0, react_2.useRef)(null);
|
|
19
19
|
var _b = (0, react_2.useState)(defaultValue ? defaultValue : null), selectedPerson = _b[0], setSelectedPerson = _b[1];
|
|
20
20
|
var filteredPeople = query === '' ? data : data.filter(function (person) { return person.value.toLowerCase().includes(query.toLowerCase()); });
|
|
21
|
-
var
|
|
21
|
+
var handlerClickInput = function () {
|
|
22
22
|
var _a;
|
|
23
23
|
(_a = comboBtn.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
24
24
|
};
|
|
@@ -31,7 +31,7 @@ var PHXSelectBox = function (props) {
|
|
|
31
31
|
react_2["default"].createElement("div", { className: '' },
|
|
32
32
|
react_2["default"].createElement(react_1.Combobox.Input, { className: classNames('block w-full rounded-lg border border-gray-500 px-3 py-1.5 text-xs font-light shadow-sm hover:bg-gray-50 focus:border-gray-500 focus:bg-gray-50 focus:outline-none focus:outline-offset-1 focus:outline-indigo-500 focus:ring-transparent', filteredPeople.length === 0
|
|
33
33
|
? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50'
|
|
34
|
-
: ''), displayValue: function (person) { return person === null || person === void 0 ? void 0 : person.value; }, onChange: function (event) { return setQuery(event.target.value); },
|
|
34
|
+
: ''), displayValue: function (person) { return person === null || person === void 0 ? void 0 : person.value; }, onChange: function (event) { return setQuery(event.target.value); }, onClick: function () { return handlerClickInput(); }, placeholder: placeholder }),
|
|
35
35
|
react_2["default"].createElement(react_1.Combobox.Button, { ref: comboBtn, className: 'hidden' },
|
|
36
36
|
react_2["default"].createElement(solid_1.ChevronUpDownIcon, { "aria-hidden": 'true', className: 'h-5 w-5 text-gray-400' })),
|
|
37
37
|
filteredPeople.length > 0 && (react_2["default"].createElement(react_1.Combobox.Options, { className: 'absolute z-10 mt-2 max-h-60 w-fit overflow-auto rounded-lg bg-white px-2 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm' }, filteredPeople.map(function (person) { return (react_2["default"].createElement(react_1.Combobox.Option, { key: person.id, className: function (_a) {
|
|
@@ -14,7 +14,7 @@ export var PHXSelectBox = function (props) {
|
|
|
14
14
|
var comboBtn = useRef(null);
|
|
15
15
|
var _b = useState(defaultValue ? defaultValue : null), selectedPerson = _b[0], setSelectedPerson = _b[1];
|
|
16
16
|
var filteredPeople = query === '' ? data : data.filter(function (person) { return person.value.toLowerCase().includes(query.toLowerCase()); });
|
|
17
|
-
var
|
|
17
|
+
var handlerClickInput = function () {
|
|
18
18
|
var _a;
|
|
19
19
|
(_a = comboBtn.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
20
20
|
};
|
|
@@ -27,7 +27,7 @@ export var PHXSelectBox = function (props) {
|
|
|
27
27
|
React.createElement("div", { className: '' },
|
|
28
28
|
React.createElement(Combobox.Input, { className: classNames('block w-full rounded-lg border border-gray-500 px-3 py-1.5 text-xs font-light shadow-sm hover:bg-gray-50 focus:border-gray-500 focus:bg-gray-50 focus:outline-none focus:outline-offset-1 focus:outline-indigo-500 focus:ring-transparent', filteredPeople.length === 0
|
|
29
29
|
? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50'
|
|
30
|
-
: ''), displayValue: function (person) { return person === null || person === void 0 ? void 0 : person.value; }, onChange: function (event) { return setQuery(event.target.value); },
|
|
30
|
+
: ''), displayValue: function (person) { return person === null || person === void 0 ? void 0 : person.value; }, onChange: function (event) { return setQuery(event.target.value); }, onClick: function () { return handlerClickInput(); }, placeholder: placeholder }),
|
|
31
31
|
React.createElement(Combobox.Button, { ref: comboBtn, className: 'hidden' },
|
|
32
32
|
React.createElement(ChevronUpDownIcon, { "aria-hidden": 'true', className: 'h-5 w-5 text-gray-400' })),
|
|
33
33
|
filteredPeople.length > 0 && (React.createElement(Combobox.Options, { className: 'absolute z-10 mt-2 max-h-60 w-fit overflow-auto rounded-lg bg-white px-2 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm' }, filteredPeople.map(function (person) { return (React.createElement(Combobox.Option, { key: person.id, className: function (_a) {
|