@rocket.chat/fuselage 0.51.2 → 0.51.3

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.
@@ -12330,6 +12330,7 @@ var AnimatedVisibility_1 = __importDefault(__webpack_require__(/*! ../AnimatedVi
12330
12330
  var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.tsx"));
12331
12331
  var Icon_1 = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12332
12332
  var Margins_1 = __importDefault(__webpack_require__(/*! ../Margins */ "./src/components/Margins/index.ts"));
12333
+ var Option_1 = __importDefault(__webpack_require__(/*! ../Option */ "./src/components/Option/index.tsx"));
12333
12334
  var useVisible_1 = __webpack_require__(/*! ../Options/useVisible */ "./src/components/Options/useVisible.ts");
12334
12335
  var OptionsPaginated_1 = __webpack_require__(/*! ../OptionsPaginated */ "./src/components/OptionsPaginated/index.ts");
12335
12336
  var PositionAnimated_1 = __importDefault(__webpack_require__(/*! ../PositionAnimated */ "./src/components/PositionAnimated/index.ts"));
@@ -12337,11 +12338,11 @@ var SelectAddon_1 = __importDefault(__webpack_require__(/*! ../Select/SelectAddo
12337
12338
  var SelectFocus_1 = __importDefault(__webpack_require__(/*! ../Select/SelectFocus */ "./src/components/Select/SelectFocus.tsx"));
12338
12339
  var PaginatedSelectWrapper_1 = __importDefault(__webpack_require__(/*! ./PaginatedSelectWrapper */ "./src/components/PaginatedSelect/PaginatedSelectWrapper.tsx"));
12339
12340
  var PaginatedSelect = function (_a) {
12340
- var value = _a.value, withTitle = _a.withTitle, filter = _a.filter, _setFilter = _a.setFilter, error = _a.error, disabled = _a.disabled, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.anchor, Anchor = _c === void 0 ? SelectFocus_1.default : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.renderOptions, _Options = _f === void 0 ? OptionsPaginated_1.OptionsPaginated : _f, endReached = _a.endReached, props = __rest(_a, ["value", "withTitle", "filter", "setFilter", "error", "disabled", "options", "anchor", "onChange", "placeholder", "renderOptions", "endReached"]);
12341
- var _g = __read((0, react_1.useState)(value), 2), internalValue = _g[0], setInternalValue = _g[1];
12341
+ var value = _a.value, withTitle = _a.withTitle, filter = _a.filter, _setFilter = _a.setFilter, error = _a.error, disabled = _a.disabled, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.anchor, Anchor = _c === void 0 ? SelectFocus_1.default : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.renderOptions, _Options = _f === void 0 ? OptionsPaginated_1.OptionsPaginated : _f, _g = _a.renderItem, renderItem = _g === void 0 ? Option_1.default : _g, endReached = _a.endReached, props = __rest(_a, ["value", "withTitle", "filter", "setFilter", "error", "disabled", "options", "anchor", "onChange", "placeholder", "renderOptions", "renderItem", "endReached"]);
12342
+ var _h = __read((0, react_1.useState)(value), 2), internalValue = _h[0], setInternalValue = _h[1];
12342
12343
  var currentValue = value !== undefined ? value : internalValue;
12343
12344
  var option = options.find(function (option) { return (option === null || option === void 0 ? void 0 : option.value) === currentValue; });
12344
- var _h = __read((0, useVisible_1.useVisible)(), 3), visible = _h[0], hide = _h[1], show = _h[2];
12345
+ var _j = __read((0, useVisible_1.useVisible)(), 3), visible = _j[0], hide = _j[1], show = _j[2];
12345
12346
  var internalChangedByClick = (0, fuselage_hooks_1.useEffectEvent)(function (_a) {
12346
12347
  var _b = __read(_a, 1), value = _b[0];
12347
12348
  setInternalValue(value);
@@ -12349,7 +12350,7 @@ var PaginatedSelect = function (_a) {
12349
12350
  hide();
12350
12351
  });
12351
12352
  var ref = (0, react_1.useRef)(null);
12352
- var _j = (0, fuselage_hooks_1.useResizeObserver)(), containerRef = _j.ref, borderBoxSize = _j.borderBoxSize;
12353
+ var _k = (0, fuselage_hooks_1.useResizeObserver)(), containerRef = _k.ref, borderBoxSize = _k.borderBoxSize;
12353
12354
  var valueLabel = option === null || option === void 0 ? void 0 : option.label;
12354
12355
  var visibleText = (filter === undefined || visible === AnimatedVisibility_1.default.HIDDEN) &&
12355
12356
  (valueLabel || placeholder || typeof placeholder === 'string');
@@ -12372,7 +12373,7 @@ var PaginatedSelect = function (_a) {
12372
12373
  ? 'chevron-up'
12373
12374
  : 'chevron-down', size: 'x20' })))),
12374
12375
  react_1.default.createElement(PositionAnimated_1.default, { visible: visible, anchor: containerRef },
12375
- react_1.default.createElement(_Options, { withTitle: withTitle, width: borderBoxSize.inlineSize, role: 'listbox', filter: filter, options: options, onSelect: internalChangedByClick, endReached: endReached, onMouseDown: prevent_1.prevent }))));
12376
+ react_1.default.createElement(_Options, { withTitle: withTitle, width: borderBoxSize.inlineSize, role: 'listbox', filter: filter, options: options, onSelect: internalChangedByClick, endReached: endReached, onMouseDown: prevent_1.prevent, renderItem: renderItem }))));
12376
12377
  };
12377
12378
  exports.PaginatedSelect = PaginatedSelect;
12378
12379