@rocket.chat/fuselage 0.59.2 → 0.59.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.
|
@@ -17404,10 +17404,13 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
17404
17404
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17405
17405
|
exports.useCollapse = void 0;
|
|
17406
17406
|
var fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
|
|
17407
|
+
var hasPropExpanded = function (expanded) {
|
|
17408
|
+
return expanded !== undefined;
|
|
17409
|
+
};
|
|
17407
17410
|
var useCollapse = function (_a) {
|
|
17408
17411
|
var propExpanded = _a.expanded, defaultExpanded = _a.defaultExpanded, disabled = _a.disabled, noncollapsible = _a.noncollapsible, _b = _a.tabIndex, tabIndex = _b === void 0 ? 0 : _b;
|
|
17409
17412
|
var _c = __read((0, fuselage_hooks_1.useToggle)(defaultExpanded), 2), stateExpanded = _c[0], toggleStateExpanded = _c[1];
|
|
17410
|
-
var expanded = propExpanded
|
|
17413
|
+
var expanded = hasPropExpanded(propExpanded) ? propExpanded : stateExpanded;
|
|
17411
17414
|
var panelExpanded = noncollapsible || expanded;
|
|
17412
17415
|
var titleId = (0, fuselage_hooks_1.useUniqueId)();
|
|
17413
17416
|
var panelId = (0, fuselage_hooks_1.useUniqueId)();
|