linear-react-components-ui 1.1.24-beta.8 → 1.1.24-rc.1
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/lib/alerts/AlertProvider.js +1 -2
- package/lib/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +2 -3
- package/lib/alerts/withAlert.js +1 -2
- package/lib/assets/styles/calendar.scss +137 -32
- package/lib/assets/styles/datepicker2.scss +4 -1
- package/lib/assets/styles/file.scss +8 -0
- package/lib/avatar/index.js +9 -11
- package/lib/badge/index.js +4 -4
- package/lib/buttons/Button.js +1 -2
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +5 -14
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +2 -2
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +123 -44
- package/lib/checkbox/index.js +2 -3
- package/lib/dialog/Custom.js +2 -3
- package/lib/dialog/Question.js +5 -4
- package/lib/dialog/base/Content.js +2 -3
- package/lib/dialog/base/Header.js +3 -4
- package/lib/dialog/base/index.js +10 -9
- package/lib/dialog/form/index.js +6 -6
- package/lib/dialog/wizard/index.js +1 -2
- package/lib/dialog/wizard/progressbar.js +1 -1
- package/lib/dialog/wizard/step.js +1 -1
- package/lib/dialog/wizard/useWizard.js +1 -2
- package/lib/drawer/Content.js +1 -2
- package/lib/drawer/Drawer.js +5 -6
- package/lib/drawer/Header.js +2 -3
- package/lib/dropdown/Popup.js +7 -7
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/withDropdown.js +3 -4
- package/lib/fieldset/index.js +8 -9
- package/lib/form/Field.js +2 -3
- package/lib/form/FieldArray.js +2 -3
- package/lib/form/FieldNumber.js +4 -5
- package/lib/form/FieldPeriod.js +3 -4
- package/lib/form/index.js +3 -4
- package/lib/form/withFieldHOC.js +1 -2
- package/lib/form/withFormSecurity.js +1 -2
- package/lib/form2/helpers.js +1 -1
- package/lib/form2/index.d.ts +1 -1
- package/lib/form2/types.d.ts +0 -4
- package/lib/form2/useForm/index.js +17 -13
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +1 -4
- package/lib/hint/index.js +1 -7
- package/lib/icons/index.js +9 -9
- package/lib/index-4b31b471.d.ts +15 -0
- package/lib/index-8a0c7463.d.ts +41 -0
- package/lib/index-9203efed.d.ts +26 -0
- package/lib/inputs/base/InputTextBase.js +9 -8
- package/lib/inputs/base/helpers.js +3 -7
- package/lib/inputs/base/types.d.ts +1 -1
- package/lib/inputs/color/index.js +2 -3
- package/lib/inputs/date/Dropdown.js +6 -4
- package/lib/inputs/date/index.js +31 -19
- package/lib/inputs/errorMessage/index.js +2 -3
- package/lib/inputs/file/DefaultFile.js +31 -31
- package/lib/inputs/file/DragDropFile.js +18 -17
- package/lib/inputs/file/File.js +6 -5
- package/lib/inputs/file/FileButtonSettings.js +0 -1
- package/lib/inputs/inputHOC.js +1 -2
- package/lib/inputs/mask/BaseMask.js +1 -2
- package/lib/inputs/mask/Cnpj.js +1 -2
- package/lib/inputs/mask/Cpf.js +1 -2
- package/lib/inputs/multiSelect/ActionButtons.js +1 -2
- package/lib/inputs/multiSelect/Dropdown.js +11 -11
- package/lib/inputs/multiSelect/helper.js +2 -1
- package/lib/inputs/multiSelect/index.js +10 -9
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/index.js +3 -3
- package/lib/inputs/period/Dropdown.js +7 -4
- package/lib/inputs/period/PeriodList.js +1 -1
- package/lib/inputs/period/helper.js +1 -3
- package/lib/inputs/period/index.js +66 -40
- package/lib/inputs/period/types.d.ts +4 -1
- package/lib/inputs/search/index.js +2 -3
- package/lib/inputs/select/ActionButtons.js +1 -1
- package/lib/inputs/select/Dropdown.js +3 -4
- package/lib/inputs/select/helper.js +13 -10
- package/lib/inputs/select/multiple/Selecteds.js +2 -2
- package/lib/inputs/select/multiple/index.js +14 -11
- package/lib/inputs/select/simple/index.js +19 -13
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/inputs2/checkboxfield/index.d.ts +1 -1
- package/lib/inputs2/checkboxfield/index.js +15 -15
- package/lib/inputs2/colorfield/index.js +5 -5
- package/lib/inputs2/date/base/constants.js +2 -1
- package/lib/inputs2/date/base/index.js +7 -7
- package/lib/inputs2/date/datefield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/datefield/calendarbox.js +3 -2
- package/lib/inputs2/date/datefield/index.js +37 -28
- package/lib/inputs2/date/datefield/triggers.js +1 -2
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +1 -1
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +8 -6
- package/lib/inputs2/date/dateperiodfield/index.js +61 -44
- package/lib/inputs2/date/dateperiodfield/triggers.js +19 -14
- package/lib/inputs2/filefield/index.js +33 -27
- package/lib/inputs2/index.d.ts +3 -3
- package/lib/inputs2/index.js +1 -2
- package/lib/inputs2/mask/BaseMask.js +7 -7
- package/lib/inputs2/mask/Cnpj.js +4 -5
- package/lib/inputs2/mask/Cpf.js +4 -5
- package/lib/inputs2/mask/Phone.js +1 -2
- package/lib/inputs2/mask/ZipCode.js +1 -2
- package/lib/inputs2/numberfield/currency.js +6 -6
- package/lib/inputs2/numberfield/decimal.js +6 -6
- package/lib/inputs2/numberfield/index.js +6 -6
- package/lib/inputs2/radiofield/index.d.ts +1 -1
- package/lib/inputs2/radiofield/index.js +14 -13
- package/lib/inputs2/selectfield/index.d.ts +1 -1
- package/lib/inputs2/selectfield/index.js +71 -54
- package/lib/inputs2/selectfield/item.d.ts +1 -1
- package/lib/inputs2/selectfield/item.js +4 -4
- package/lib/inputs2/selectfield/listbox.d.ts +1 -1
- package/lib/inputs2/selectfield/listbox.js +7 -4
- package/lib/inputs2/selectfield/options.d.ts +1 -1
- package/lib/inputs2/selectfield/search.d.ts +1 -1
- package/lib/inputs2/selectfield/search.js +3 -4
- package/lib/inputs2/selectfield/selections.d.ts +1 -1
- package/lib/inputs2/selectfield/selections.js +3 -2
- package/lib/inputs2/selectfield/triggers.js +6 -5
- package/lib/inputs2/slot/index.d.ts +2 -2
- package/lib/inputs2/textareafield/index.js +21 -18
- package/lib/inputs2/textfield/index.js +15 -14
- package/lib/labelMessages/index.js +4 -6
- package/lib/labels/DefaultLabel.js +2 -6
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.js +10 -12
- package/lib/list/index.js +2 -4
- package/lib/menus/float/MenuItem.js +3 -4
- package/lib/menus/float/SubMenuContainer.js +2 -3
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/MenuLink.js +1 -2
- package/lib/menus/sidenav/NavMenuGroup.js +2 -3
- package/lib/menus/sidenav/NavMenuItem.js +10 -9
- package/lib/menus/sidenav/NavSubMenuItem.js +2 -3
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +6 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +1 -2
- package/lib/panel/Content.js +9 -8
- package/lib/panel/Default.js +3 -4
- package/lib/panel/Header.js +4 -5
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/PopoverText.js +1 -2
- package/lib/popover/index.js +1 -1
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.js +3 -4
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +1 -2
- package/lib/skeleton/index.js +1 -4
- package/lib/spinner/index.js +3 -4
- package/lib/split/Split.js +2 -3
- package/lib/split/SplitSide.js +4 -5
- package/lib/table/Body.js +4 -5
- package/lib/table/Header.js +9 -7
- package/lib/table/HeaderColumn.js +2 -3
- package/lib/table/Row.js +4 -5
- package/lib/table/RowColumn.js +2 -3
- package/lib/table/index.js +2 -8
- package/lib/tabs/DropdownTabs.js +2 -3
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +4 -9
- package/lib/tabs/Panel.js +8 -7
- package/lib/tabs/context.js +7 -5
- package/lib/tabs/index.js +1 -2
- package/lib/textContent/index.js +2 -3
- package/lib/toolbar/ButtonBar.js +2 -3
- package/lib/toolbar/LabelBar.js +1 -2
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/TooltipContent.js +8 -9
- package/lib/tooltip/useTooltip.js +8 -8
- package/lib/treetable/Body.js +2 -3
- package/lib/treetable/Header.js +3 -4
- package/lib/treetable/Row.js +9 -10
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -6
- package/lib/treeview/index.js +5 -6
- package/lib/uitour/index.js +9 -8
- package/package.json +1 -1
- package/lib/calendar/base/Day.d.ts +0 -8
- package/lib/calendar/base/Day.js +0 -36
- package/lib/calendar/base/Month.d.ts +0 -8
- package/lib/calendar/base/Month.js +0 -39
- package/lib/calendar/base/Week.d.ts +0 -8
- package/lib/calendar/base/Week.js +0 -35
- package/lib/index-118afd58.d.ts +0 -26
- package/lib/index-8f540f57.d.ts +0 -41
- package/lib/index-b2ef36a6.d.ts +0 -15
|
@@ -50,13 +50,13 @@ var _types = require("./types");
|
|
|
50
50
|
var _helpers2 = require("./helpers");
|
|
51
51
|
const _excluded = ["name", "label", "errors", "children", "gridLayout", "onChange", "tooltip", "tooltipPosition", "tooltipWidth", "hintPosition", "themePopover", "popoverAlign", "skeletonize", "striped", "undigitable", "externalSearch", "openDropdownOnFocus", "showClearButton", "textAlign", "searchOnDropdown", "onSearch", "permissionAttr", "customClass", "customClassLabel", "customClassWrapper", "customClassInputContainer", "onDeniedActions", "notFoundFilterLabel", "multipleInputLabelEmpty", "multipleInputLabelManySelection", "searchInputPlaceholder", "dropdownAlignButton"];
|
|
52
52
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
53
|
-
function
|
|
54
|
-
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; }
|
|
53
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
55
54
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
56
55
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
57
56
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
58
|
-
const SELECT_FIELD_CONTROLS_ID =
|
|
57
|
+
const SELECT_FIELD_CONTROLS_ID = "select-field-controls-".concat((0, _uuid.v1)());
|
|
59
58
|
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
59
|
+
var _props$hint, _props$hint2;
|
|
60
60
|
const {
|
|
61
61
|
name,
|
|
62
62
|
label,
|
|
@@ -103,8 +103,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
103
103
|
const [filterValue, setFilterValue] = _react.default.useState('');
|
|
104
104
|
const [listBoxOpen, setListBoxOpen] = _react.default.useState(false);
|
|
105
105
|
const [activeDescendant, setActiveDescendant] = _react.default.useState(undefined);
|
|
106
|
-
const isMultipleDefault = _lodash.default.isEqual(props
|
|
107
|
-
const isMultipleWithCheckboxes = _lodash.default.isEqual(props
|
|
106
|
+
const isMultipleDefault = _lodash.default.isEqual(props === null || props === void 0 ? void 0 : props.multiple, _types.MultipleVariantEnum.default);
|
|
107
|
+
const isMultipleWithCheckboxes = _lodash.default.isEqual(props === null || props === void 0 ? void 0 : props.multiple, _types.MultipleVariantEnum.checkboxes);
|
|
108
108
|
const isMultipleSelect = isMultipleDefault || isMultipleWithCheckboxes;
|
|
109
109
|
const liSelectedRef = _react.default.useRef(null);
|
|
110
110
|
const selectFieldRoot = _react.default.useRef(null);
|
|
@@ -130,31 +130,32 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
130
130
|
if (openDropdownOnFocus && listBoxOpen) {
|
|
131
131
|
requestAnimationFrame(() => {
|
|
132
132
|
if (isMultipleWithCheckboxes) {
|
|
133
|
-
|
|
133
|
+
var _selectSearchInputRef, _selectSearchInputRef2;
|
|
134
|
+
(_selectSearchInputRef = selectSearchInputRef.current) === null || _selectSearchInputRef === void 0 ? void 0 : (_selectSearchInputRef2 = _selectSearchInputRef.focus) === null || _selectSearchInputRef2 === void 0 ? void 0 : _selectSearchInputRef2.call(_selectSearchInputRef);
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
138
|
}, [listBoxOpen]);
|
|
138
139
|
_react.default.useEffect(() => {
|
|
139
|
-
if (!isMultipleWithCheckboxes && !props
|
|
140
|
-
if (!props
|
|
140
|
+
if (!isMultipleWithCheckboxes && !(props !== null && props !== void 0 && props.value)) setInputValue('');
|
|
141
|
+
if (!(props !== null && props !== void 0 && props.value) || document.activeElement === selectInputRef.current) return;
|
|
141
142
|
const lazyInputValue = listOptionsMap.get(rest.value);
|
|
142
|
-
if (!isMultipleWithCheckboxes) setInputValue(lazyInputValue
|
|
143
|
+
if (!isMultipleWithCheckboxes) setInputValue(lazyInputValue !== null && lazyInputValue !== void 0 ? lazyInputValue : '');
|
|
143
144
|
if (isMultipleWithCheckboxes) {
|
|
144
|
-
const firstSelectionLabel = listOptionsMap.get(props
|
|
145
|
-
switch (_lodash.default.size(props
|
|
145
|
+
const firstSelectionLabel = listOptionsMap.get(props === null || props === void 0 ? void 0 : props.value[0]);
|
|
146
|
+
switch (_lodash.default.size(props === null || props === void 0 ? void 0 : props.value)) {
|
|
146
147
|
case 0:
|
|
147
148
|
return setInputValue(multipleInputLabelEmpty);
|
|
148
149
|
case 1:
|
|
149
|
-
return setInputValue(firstSelectionLabel
|
|
150
|
+
return setInputValue(firstSelectionLabel !== null && firstSelectionLabel !== void 0 ? firstSelectionLabel : '');
|
|
150
151
|
default:
|
|
151
152
|
return setInputValue(multipleInputLabelManySelection);
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
}, [props
|
|
155
|
-
const hasLabel = !_lodash.default.isEmpty(props
|
|
156
|
-
const hasHintMessages = Boolean(props.hint
|
|
157
|
-
const hasValidationErrors = Boolean(errors
|
|
155
|
+
}, [props === null || props === void 0 ? void 0 : props.value, listOptionsMap]);
|
|
156
|
+
const hasLabel = !_lodash.default.isEmpty(props === null || props === void 0 ? void 0 : props.label);
|
|
157
|
+
const hasHintMessages = Boolean((_props$hint = props.hint) === null || _props$hint === void 0 ? void 0 : _props$hint.length);
|
|
158
|
+
const hasValidationErrors = Boolean(errors === null || errors === void 0 ? void 0 : errors.length);
|
|
158
159
|
const isReadOnly = Boolean(props.readOnly || onDenied.readOnly);
|
|
159
160
|
const isDisabled = Boolean(props.disabled || onDenied.disabled);
|
|
160
161
|
const {
|
|
@@ -163,8 +164,9 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
163
164
|
const itens = [];
|
|
164
165
|
_react.default.Children.map(children, (childElement, index) => {
|
|
165
166
|
if (/*#__PURE__*/_react.default.isValidElement(childElement)) {
|
|
167
|
+
var _childElement$key;
|
|
166
168
|
const clonedChild = /*#__PURE__*/_react.default.cloneElement(childElement, {
|
|
167
|
-
key: childElement.key
|
|
169
|
+
key: (_childElement$key = childElement.key) !== null && _childElement$key !== void 0 ? _childElement$key : "child-item-".concat(index + 1)
|
|
168
170
|
});
|
|
169
171
|
if (childElement.type === _item.Item) itens.push(clonedChild);
|
|
170
172
|
}
|
|
@@ -181,8 +183,9 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
181
183
|
const right = [];
|
|
182
184
|
_react.default.Children.map(children, (childElement, index) => {
|
|
183
185
|
if (/*#__PURE__*/_react.default.isValidElement(childElement)) {
|
|
186
|
+
var _childElement$key2;
|
|
184
187
|
const clonedChild = /*#__PURE__*/_react.default.cloneElement(childElement, {
|
|
185
|
-
key: childElement.key
|
|
188
|
+
key: (_childElement$key2 = childElement.key) !== null && _childElement$key2 !== void 0 ? _childElement$key2 : "slot-".concat(index),
|
|
186
189
|
disabled: isDisabled,
|
|
187
190
|
'aria-disabled': isDisabled
|
|
188
191
|
});
|
|
@@ -201,8 +204,9 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
201
204
|
const itens = [];
|
|
202
205
|
_react.default.Children.map(children, (childElement, index) => {
|
|
203
206
|
if (/*#__PURE__*/_react.default.isValidElement(childElement)) {
|
|
207
|
+
var _childElement$key3;
|
|
204
208
|
const clonedChildItem = /*#__PURE__*/_react.default.cloneElement(childElement, {
|
|
205
|
-
key: childElement.key
|
|
209
|
+
key: (_childElement$key3 = childElement.key) !== null && _childElement$key3 !== void 0 ? _childElement$key3 : "option-list-".concat(index),
|
|
206
210
|
disabled: isDisabled
|
|
207
211
|
});
|
|
208
212
|
if (childElement.type === _options.Options) itens.push(clonedChildItem);
|
|
@@ -212,15 +216,16 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
212
216
|
optionItens: itens
|
|
213
217
|
};
|
|
214
218
|
}, [children, isDisabled]);
|
|
215
|
-
const hasLeftSlotElements = Boolean(leftSlotElements
|
|
216
|
-
const hasRightSlotElements = Boolean(rightSlotElements
|
|
219
|
+
const hasLeftSlotElements = Boolean(leftSlotElements === null || leftSlotElements === void 0 ? void 0 : leftSlotElements.length);
|
|
220
|
+
const hasRightSlotElements = Boolean(rightSlotElements === null || rightSlotElements === void 0 ? void 0 : rightSlotElements.length);
|
|
217
221
|
const handleCloseListBox = () => {
|
|
218
222
|
setListBoxOpen(false);
|
|
219
223
|
setFilterValue('');
|
|
220
224
|
};
|
|
221
225
|
const handleOpenListBox = () => {
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
var _$toString;
|
|
227
|
+
const currentValue = !isMultipleSelect ? props === null || props === void 0 ? void 0 : props.value : _lodash.default.orderBy([...props.value], value => _lodash.default.toNumber(value), ['asc'])[0];
|
|
228
|
+
setActiveDescendant((_$toString = _lodash.default.toString(currentValue)) !== null && _$toString !== void 0 ? _$toString : undefined);
|
|
224
229
|
};
|
|
225
230
|
const handleChangeListBoxState = () => {
|
|
226
231
|
setListBoxOpen(prevState => {
|
|
@@ -228,7 +233,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
228
233
|
setFilterValue('');
|
|
229
234
|
}
|
|
230
235
|
if (selectInputRef.current !== document.activeElement) {
|
|
231
|
-
|
|
236
|
+
var _selectInputRef$curre, _selectInputRef$curre2;
|
|
237
|
+
selectInputRef === null || selectInputRef === void 0 ? void 0 : (_selectInputRef$curre = selectInputRef.current) === null || _selectInputRef$curre === void 0 ? void 0 : (_selectInputRef$curre2 = _selectInputRef$curre.focus) === null || _selectInputRef$curre2 === void 0 ? void 0 : _selectInputRef$curre2.call(_selectInputRef$curre);
|
|
232
238
|
}
|
|
233
239
|
return !prevState;
|
|
234
240
|
});
|
|
@@ -237,7 +243,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
237
243
|
liSelectedRef.current = liElement;
|
|
238
244
|
};
|
|
239
245
|
const handleOnChange = (value, inputLabel, addOrRemove) => {
|
|
240
|
-
let multipleValue = props
|
|
246
|
+
let multipleValue = props === null || props === void 0 ? void 0 : props.value;
|
|
241
247
|
if (!addOrRemove) multipleValue = _lodash.default.union(props.value, [value]);
|
|
242
248
|
if (addOrRemove) multipleValue = _lodash.default.without(props.value, value);
|
|
243
249
|
const changedValue = !isMultipleSelect ? value : _lodash.default.orderBy(multipleValue, multiValue => _lodash.default.toNumber(multiValue), ['asc']);
|
|
@@ -247,13 +253,14 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
247
253
|
value: changedValue
|
|
248
254
|
}
|
|
249
255
|
};
|
|
250
|
-
onChange
|
|
256
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(syntheticEvent);
|
|
251
257
|
if (!isMultipleSelect) {
|
|
252
258
|
setListBoxOpen(false);
|
|
253
259
|
setFilterValue('');
|
|
254
|
-
setInputValue(inputLabel
|
|
260
|
+
setInputValue(inputLabel !== null && inputLabel !== void 0 ? inputLabel : '');
|
|
255
261
|
if (document.activeElement === selectSearchInputRef.current) {
|
|
256
|
-
|
|
262
|
+
var _selectInputRef$curre3, _selectInputRef$curre4;
|
|
263
|
+
selectInputRef === null || selectInputRef === void 0 ? void 0 : (_selectInputRef$curre3 = selectInputRef.current) === null || _selectInputRef$curre3 === void 0 ? void 0 : (_selectInputRef$curre4 = _selectInputRef$curre3.focus) === null || _selectInputRef$curre4 === void 0 ? void 0 : _selectInputRef$curre4.call(_selectInputRef$curre3);
|
|
257
264
|
setListBoxOpen(false);
|
|
258
265
|
}
|
|
259
266
|
}
|
|
@@ -269,7 +276,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
269
276
|
value
|
|
270
277
|
}
|
|
271
278
|
};
|
|
272
|
-
onChange
|
|
279
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(syntheticEvent);
|
|
273
280
|
};
|
|
274
281
|
const handleClearValue = () => {
|
|
275
282
|
const resetValue = !isMultipleSelect ? '' : [];
|
|
@@ -279,7 +286,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
279
286
|
value: resetValue
|
|
280
287
|
}
|
|
281
288
|
};
|
|
282
|
-
onChange
|
|
289
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(syntheticEvent);
|
|
283
290
|
setListBoxOpen(false);
|
|
284
291
|
if (!isMultipleSelect) {
|
|
285
292
|
setFilterValue('');
|
|
@@ -290,14 +297,16 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
290
297
|
}
|
|
291
298
|
};
|
|
292
299
|
const handleOnBlur = event => {
|
|
293
|
-
|
|
300
|
+
var _props$onBlur;
|
|
301
|
+
props === null || props === void 0 ? void 0 : (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, event);
|
|
294
302
|
if (!event.relatedTarget || event.relatedTarget !== selectSearchInputRef.current) {
|
|
295
303
|
setListBoxOpen(false);
|
|
296
304
|
}
|
|
297
305
|
setFilterValue('');
|
|
298
306
|
};
|
|
299
307
|
const handleOnFocus = event => {
|
|
300
|
-
|
|
308
|
+
var _props$onFocus;
|
|
309
|
+
props === null || props === void 0 ? void 0 : (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 ? void 0 : _props$onFocus.call(props, event);
|
|
301
310
|
if (openDropdownOnFocus) {
|
|
302
311
|
setListBoxOpen(true);
|
|
303
312
|
handleOpenListBox();
|
|
@@ -311,25 +320,28 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
311
320
|
if (undigitable || isMultipleWithCheckboxes) {
|
|
312
321
|
event.preventDefault();
|
|
313
322
|
} else {
|
|
314
|
-
|
|
323
|
+
var _props$onPaste;
|
|
324
|
+
(_props$onPaste = props.onPaste) === null || _props$onPaste === void 0 ? void 0 : _props$onPaste.call(props, event);
|
|
315
325
|
}
|
|
316
326
|
};
|
|
317
327
|
const handleOnBeforeInput = event => {
|
|
318
328
|
if (undigitable || isMultipleWithCheckboxes) {
|
|
319
329
|
event.preventDefault();
|
|
320
330
|
} else {
|
|
321
|
-
|
|
331
|
+
var _props$onBeforeInput;
|
|
332
|
+
(_props$onBeforeInput = props.onBeforeInput) === null || _props$onBeforeInput === void 0 ? void 0 : _props$onBeforeInput.call(props, event);
|
|
322
333
|
}
|
|
323
334
|
};
|
|
324
335
|
const handleOnSearch = event => {
|
|
325
336
|
if (externalSearch) {
|
|
326
|
-
onSearch
|
|
337
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(event);
|
|
327
338
|
} else {
|
|
328
339
|
setFilterValue(event.target.value);
|
|
329
340
|
}
|
|
330
341
|
};
|
|
331
342
|
const handleOnKeyDown = event => {
|
|
332
|
-
|
|
343
|
+
var _props$onKeyDown;
|
|
344
|
+
props === null || props === void 0 ? void 0 : (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 ? void 0 : _props$onKeyDown.call(props, event);
|
|
333
345
|
const notUndigitableKeys = [_types.Keys.backspace, _types.Keys.delete];
|
|
334
346
|
if (undigitable && notUndigitableKeys.includes(event.key)) {
|
|
335
347
|
event.preventDefault();
|
|
@@ -341,13 +353,16 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
341
353
|
event.preventDefault();
|
|
342
354
|
}
|
|
343
355
|
requestAnimationFrame(() => {
|
|
344
|
-
|
|
345
|
-
const
|
|
356
|
+
var _selectListBoxRef$cur, _ulListElement$queryS;
|
|
357
|
+
const ulListElement = (_selectListBoxRef$cur = selectListBoxRef.current) === null || _selectListBoxRef$cur === void 0 ? void 0 : _selectListBoxRef$cur.querySelector('ul[role="listbox"]');
|
|
358
|
+
const liElementsFiltered = (_ulListElement$queryS = ulListElement === null || ulListElement === void 0 ? void 0 : ulListElement.querySelectorAll('li[data-state-filtered="true"]')) !== null && _ulListElement$queryS !== void 0 ? _ulListElement$queryS : [];
|
|
346
359
|
if (!listBoxOpen && event.key === _types.Keys.arrowDown) {
|
|
347
|
-
|
|
348
|
-
|
|
360
|
+
var _$toString2;
|
|
361
|
+
const currentValue = !isMultipleSelect ? props === null || props === void 0 ? void 0 : props.value : _lodash.default.orderBy([...props.value], value => _lodash.default.toNumber(value), ['asc'])[0];
|
|
362
|
+
setActiveDescendant((_$toString2 = _lodash.default.toString(currentValue)) !== null && _$toString2 !== void 0 ? _$toString2 : undefined);
|
|
349
363
|
} else {
|
|
350
|
-
|
|
364
|
+
var _liElementsFiltered$, _liElementsFiltered$2;
|
|
365
|
+
setActiveDescendant((_liElementsFiltered$ = (_liElementsFiltered$2 = liElementsFiltered[0]) === null || _liElementsFiltered$2 === void 0 ? void 0 : _liElementsFiltered$2.id) !== null && _liElementsFiltered$ !== void 0 ? _liElementsFiltered$ : undefined);
|
|
351
366
|
}
|
|
352
367
|
});
|
|
353
368
|
if (!listBoxOpen) {
|
|
@@ -359,8 +374,9 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
359
374
|
event.preventDefault();
|
|
360
375
|
}
|
|
361
376
|
requestAnimationFrame(() => {
|
|
362
|
-
|
|
363
|
-
const
|
|
377
|
+
var _selectListBoxRef$cur2, _ulListElement$queryS2, _selectInputRef$curre5;
|
|
378
|
+
const ulListElement = (_selectListBoxRef$cur2 = selectListBoxRef.current) === null || _selectListBoxRef$cur2 === void 0 ? void 0 : _selectListBoxRef$cur2.querySelector('ul[role="listbox"]');
|
|
379
|
+
const liElementsFiltered = (_ulListElement$queryS2 = ulListElement === null || ulListElement === void 0 ? void 0 : ulListElement.querySelectorAll('li[data-state-filtered="true"]')) !== null && _ulListElement$queryS2 !== void 0 ? _ulListElement$queryS2 : [];
|
|
364
380
|
const currentElementIndex = Array.from(liElementsFiltered).findIndex(liElement => liElement.id === activeDescendant);
|
|
365
381
|
let nextElementIndex = currentElementIndex;
|
|
366
382
|
if (listBoxOpen) {
|
|
@@ -369,7 +385,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
369
385
|
case _types.Keys.escape:
|
|
370
386
|
setListBoxOpen(false);
|
|
371
387
|
setFilterValue('');
|
|
372
|
-
selectInputRef.current
|
|
388
|
+
(_selectInputRef$curre5 = selectInputRef.current) === null || _selectInputRef$curre5 === void 0 ? void 0 : _selectInputRef$curre5.focus();
|
|
373
389
|
if (event.target === selectSearchInputRef.current) {
|
|
374
390
|
setListBoxOpen(false);
|
|
375
391
|
}
|
|
@@ -393,7 +409,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
393
409
|
}
|
|
394
410
|
const nextLIOption = liElementsFiltered[nextElementIndex];
|
|
395
411
|
if (nextLIOption) {
|
|
396
|
-
|
|
412
|
+
var _nextLIOption$id;
|
|
413
|
+
setActiveDescendant((_nextLIOption$id = nextLIOption === null || nextLIOption === void 0 ? void 0 : nextLIOption.id) !== null && _nextLIOption$id !== void 0 ? _nextLIOption$id : '');
|
|
397
414
|
nextLIOption.scrollIntoView({
|
|
398
415
|
block: 'nearest'
|
|
399
416
|
});
|
|
@@ -415,7 +432,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
415
432
|
handleOnSearch,
|
|
416
433
|
searchOnDropdown,
|
|
417
434
|
nameSelect: String(props.name),
|
|
418
|
-
valueSelect: props
|
|
435
|
+
valueSelect: props === null || props === void 0 ? void 0 : props.value,
|
|
419
436
|
activeDescendant,
|
|
420
437
|
handleOnChange,
|
|
421
438
|
handleOnKeyDown,
|
|
@@ -433,7 +450,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
433
450
|
handleCheckMultiple,
|
|
434
451
|
handleChangeListBoxState,
|
|
435
452
|
optionItens
|
|
436
|
-
}), [striped, listBoxOpen, isDisabled, filterValue, props
|
|
453
|
+
}), [striped, listBoxOpen, isDisabled, filterValue, props === null || props === void 0 ? void 0 : props.name, props === null || props === void 0 ? void 0 : props.value, activeDescendant, notFoundFilterLabel, searchOnDropdown, isMultipleSelect, showClearButton, isMultipleDefault, isMultipleWithCheckboxes, searchInputPlaceholder, dropdownAlignButton, optionItens]);
|
|
437
454
|
if (unvisible || hideContent) return null;
|
|
438
455
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
|
|
439
456
|
cols: gridLayout
|
|
@@ -442,11 +459,11 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
442
459
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
443
460
|
ref: selectFieldRoot,
|
|
444
461
|
"data-testid": "test-select-field-root",
|
|
445
|
-
className:
|
|
462
|
+
className: "select-field-root ".concat(customClassWrapper),
|
|
446
463
|
"data-state-error": hasValidationErrors,
|
|
447
464
|
"data-state-hint-position": hintPosition
|
|
448
465
|
}, hasLabel && /*#__PURE__*/_react.default.createElement("span", {
|
|
449
|
-
className:
|
|
466
|
+
className: "root-label ".concat(customClassLabel),
|
|
450
467
|
"data-state-skeletonize": skeletonize
|
|
451
468
|
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
452
469
|
"data-testid": "test-select-field-label",
|
|
@@ -462,10 +479,10 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
462
479
|
align: popoverAlign,
|
|
463
480
|
iconColor: "#03bde2"
|
|
464
481
|
}, /*#__PURE__*/_react.default.createElement(_popover.PopoverText, {
|
|
465
|
-
text: props
|
|
482
|
+
text: (_props$hint2 = props === null || props === void 0 ? void 0 : props.hint) !== null && _props$hint2 !== void 0 ? _props$hint2 : ''
|
|
466
483
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
467
484
|
ref: selectContainerRef,
|
|
468
|
-
className:
|
|
485
|
+
className: "container ".concat(customClassInputContainer),
|
|
469
486
|
"aria-expanded": listBoxOpen,
|
|
470
487
|
"data-state-skeletonize": skeletonize
|
|
471
488
|
}, hasLeftSlotElements && !skeletonize && leftSlotElements, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -473,7 +490,7 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
473
490
|
}, /*#__PURE__*/_react.default.createElement("input", _extends({}, rest, {
|
|
474
491
|
ref: (0, _helpers.mergeRefs)(ref, selectInputRef),
|
|
475
492
|
readOnly: props.readOnly || undigitable,
|
|
476
|
-
className:
|
|
493
|
+
className: "input ".concat(customClass),
|
|
477
494
|
placeholder: rest.placeholder,
|
|
478
495
|
"data-state-error": hasValidationErrors,
|
|
479
496
|
"data-state-multiple": isMultipleSelect,
|
|
@@ -521,8 +538,8 @@ const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref
|
|
|
521
538
|
className: "error",
|
|
522
539
|
"data-state-skeletonize": skeletonize,
|
|
523
540
|
"aria-describedby": String(name).concat('-errors')
|
|
524
|
-
}, errors
|
|
525
|
-
key:
|
|
541
|
+
}, errors === null || errors === void 0 ? void 0 : errors.map((error, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
542
|
+
key: "".concat(index + 1, "-").concat(error)
|
|
526
543
|
}, error, "\xA0")))))), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
527
544
|
targetRef: selectInputRef,
|
|
528
545
|
text: tooltip,
|
|
@@ -7,6 +7,6 @@ interface SelectFieldItemProps extends React__default.ComponentProps<'li'> {
|
|
|
7
7
|
readOnly?: boolean;
|
|
8
8
|
children: React__default.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
declare const Item: React__default.ForwardRefExoticComponent<Pick<SelectFieldItemProps, "label" | "
|
|
10
|
+
declare const Item: React__default.ForwardRefExoticComponent<Pick<SelectFieldItemProps, "key" | "style" | "children" | "label" | "slot" | "title" | "className" | "align" | "onClick" | "disabled" | "color" | "hidden" | "id" | "value" | "readOnly" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React__default.RefAttributes<HTMLLIElement>>;
|
|
11
11
|
|
|
12
12
|
export { Item, SelectFieldItemProps };
|
|
@@ -8,11 +8,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var Checkbox = _interopRequireWildcard(require("../checkboxfield"));
|
|
10
10
|
var _context = require("./context");
|
|
11
|
-
function
|
|
12
|
-
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; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
13
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
14
|
const Item = exports.Item = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
15
|
+
var _filterValue$toString;
|
|
16
16
|
const {
|
|
17
17
|
disabled,
|
|
18
18
|
readOnly,
|
|
@@ -33,10 +33,10 @@ const Item = exports.Item = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
|
33
33
|
const hasFocus = Boolean(activeDescendant === valueToString);
|
|
34
34
|
const ariaSelected = !isMultipleSelect ? Boolean(props.value === valueSelect) : [...valueSelect].includes(props.value);
|
|
35
35
|
const addOrRemove = !isMultipleSelect ? undefined : ariaSelected;
|
|
36
|
-
const hasPartOfFilter = Boolean(String(props.label).toLowerCase().includes(filterValue
|
|
36
|
+
const hasPartOfFilter = Boolean(String(props.label).toLowerCase().includes((_filterValue$toString = filterValue === null || filterValue === void 0 ? void 0 : filterValue.toString().toLowerCase()) !== null && _filterValue$toString !== void 0 ? _filterValue$toString : ''));
|
|
37
37
|
const handleOnClickItem = event => {
|
|
38
38
|
if (isMultipleDefault && ariaSelected) event.preventDefault();else {
|
|
39
|
-
handleOnChange
|
|
39
|
+
handleOnChange === null || handleOnChange === void 0 ? void 0 : handleOnChange(props.value, props.label, addOrRemove);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
return /*#__PURE__*/_react.default.createElement("li", _extends({
|
|
@@ -2,6 +2,6 @@ import React__default from 'react';
|
|
|
2
2
|
|
|
3
3
|
interface SelectFieldListBoxProps extends React__default.ComponentProps<'div'> {
|
|
4
4
|
}
|
|
5
|
-
declare const ListBox: React__default.ForwardRefExoticComponent<Pick<SelectFieldListBoxProps, "
|
|
5
|
+
declare const ListBox: React__default.ForwardRefExoticComponent<Pick<SelectFieldListBoxProps, "key" | "style" | "children" | "slot" | "title" | "className" | "align" | "onClick" | "color" | "hidden" | "id" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
|
|
7
7
|
export { ListBox, SelectFieldListBoxProps };
|
|
@@ -35,21 +35,24 @@ const ListBox = exports.ListBox = /*#__PURE__*/_react.default.forwardRef((props,
|
|
|
35
35
|
const shouldBeShowSearchInput = searchOnDropdown || isMultipleWithCheckboxes;
|
|
36
36
|
_react.default.useCallback(() => {
|
|
37
37
|
requestAnimationFrame(() => {
|
|
38
|
-
|
|
39
|
-
const
|
|
38
|
+
var _listBoxRef$current, _listBoxRef$current$q, _listBoxRef$current2;
|
|
39
|
+
const hasChildrenElementsInUL = (_listBoxRef$current = listBoxRef.current) === null || _listBoxRef$current === void 0 ? void 0 : _listBoxRef$current.childNodes;
|
|
40
|
+
const liElementsFiltered = (_listBoxRef$current$q = (_listBoxRef$current2 = listBoxRef.current) === null || _listBoxRef$current2 === void 0 ? void 0 : _listBoxRef$current2.querySelectorAll('li[data-state-filtered="true"]')) !== null && _listBoxRef$current$q !== void 0 ? _listBoxRef$current$q : [];
|
|
40
41
|
const filterIsEmpty = !_lodash.default.isEmpty(hasChildrenElementsInUL) && _lodash.default.isEmpty(liElementsFiltered);
|
|
41
42
|
setFilterResultIsEmpty(filterIsEmpty);
|
|
42
43
|
});
|
|
43
44
|
}, [])();
|
|
44
45
|
_react.default.useEffect(() => {
|
|
45
|
-
|
|
46
|
+
var _liSelectedRef$curren;
|
|
47
|
+
liSelectedRef === null || liSelectedRef === void 0 ? void 0 : (_liSelectedRef$curren = liSelectedRef.current) === null || _liSelectedRef$curren === void 0 ? void 0 : _liSelectedRef$curren.scrollIntoView({
|
|
46
48
|
block: 'nearest',
|
|
47
49
|
behavior: 'auto'
|
|
48
50
|
});
|
|
49
51
|
}, []);
|
|
50
52
|
_react.default.useEffect(() => {
|
|
51
53
|
const updatePosition = () => {
|
|
52
|
-
|
|
54
|
+
var _selectContainerRef$c;
|
|
55
|
+
const selectPositionOnScreen = (_selectContainerRef$c = selectContainerRef.current) === null || _selectContainerRef$c === void 0 ? void 0 : _selectContainerRef$c.getBoundingClientRect();
|
|
53
56
|
if (selectPositionOnScreen) {
|
|
54
57
|
const {
|
|
55
58
|
top,
|
|
@@ -4,6 +4,6 @@ interface OptionsProps extends React__default.ComponentProps<'div'> {
|
|
|
4
4
|
children: React__default.ReactNode;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const Options: React__default.ForwardRefExoticComponent<Pick<OptionsProps, "
|
|
7
|
+
declare const Options: React__default.ForwardRefExoticComponent<Pick<OptionsProps, "key" | "style" | "children" | "slot" | "title" | "className" | "align" | "onClick" | "disabled" | "color" | "hidden" | "id" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
|
|
9
9
|
export { Options, OptionsProps };
|
|
@@ -2,6 +2,6 @@ import React__default from 'react';
|
|
|
2
2
|
|
|
3
3
|
interface SelectFieldSearchProps extends React__default.ComponentProps<'div'> {
|
|
4
4
|
}
|
|
5
|
-
declare const Search: React__default.ForwardRefExoticComponent<Pick<SelectFieldSearchProps, "
|
|
5
|
+
declare const Search: React__default.ForwardRefExoticComponent<Pick<SelectFieldSearchProps, "key" | "style" | "children" | "slot" | "title" | "className" | "align" | "onClick" | "color" | "hidden" | "id" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
|
|
7
7
|
export { Search, SelectFieldSearchProps };
|
|
@@ -10,8 +10,7 @@ var TextField = _interopRequireWildcard(require("../textfield"));
|
|
|
10
10
|
var _slot = require("../slot");
|
|
11
11
|
var _context = require("./context");
|
|
12
12
|
var _helpers = require("./helpers");
|
|
13
|
-
function
|
|
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; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
15
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
16
|
function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
|
|
@@ -27,7 +26,7 @@ const Search = exports.Search = /*#__PURE__*/_react.default.forwardRef((props, r
|
|
|
27
26
|
searchInputPlaceholder
|
|
28
27
|
} = (0, _context.useSelectFieldContext)();
|
|
29
28
|
const handleOnChangeSearchInput = event => {
|
|
30
|
-
handleOnSearch
|
|
29
|
+
handleOnSearch === null || handleOnSearch === void 0 ? void 0 : handleOnSearch(event);
|
|
31
30
|
};
|
|
32
31
|
const handleOnBlur = () => {
|
|
33
32
|
handleCloseListBox();
|
|
@@ -42,7 +41,7 @@ const Search = exports.Search = /*#__PURE__*/_react.default.forwardRef((props, r
|
|
|
42
41
|
(0, _helpers.setFocusOnOffsetElement)(inputElement, 'before');
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
handleOnKeyDown
|
|
44
|
+
handleOnKeyDown === null || handleOnKeyDown === void 0 ? void 0 : handleOnKeyDown(event);
|
|
46
45
|
};
|
|
47
46
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
48
47
|
ref: ref,
|