@beweco/aurora-ui 0.6.87 → 0.6.88
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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +46 -5
- package/dist/index.esm.js +46 -5
- package/dist/types/components/menu-claw/MenuClaw.d.ts.map +1 -1
- package/dist/types/components/menu-claw/MenuClaw.types.d.ts +19 -0
- package/dist/types/components/menu-claw/MenuClaw.types.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.d.ts +2 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts +8 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts +21 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4430,9 +4430,32 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
4430
4430
|
: "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), onUserInfoClick ? (jsxRuntime.jsx("button", { type: "button", onClick: handleUserInfoClick, className: "content__menu--user w-full text-left cursor-pointer rounded-large border-none bg-transparent transition-colors hover:bg-default/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus ".concat(isCollapsed ? "gap-0" : "gap-3"), children: userInfoContent })) : (jsxRuntime.jsx("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: userInfoContent })), jsxRuntime.jsxs("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6 relative"), children: [!isCollapsed && showScrollArrows && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [scrollState.canScrollUp && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "menu-scroll-fade menu-scroll-fade--up", "aria-hidden": "true" }), jsxRuntime.jsx("button", { type: "button", "aria-label": t.scrollUpAriaLabel, className: "menu-scroll-chevron menu-scroll-chevron--up", onClick: handleScrollUp, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-up-outline", size: "md", "aria-hidden": true }) })] })), scrollState.canScrollDown && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "menu-scroll-fade menu-scroll-fade--down", "aria-hidden": "true" }), jsxRuntime.jsx("button", { type: "button", "aria-label": t.scrollDownAriaLabel, className: "menu-scroll-chevron menu-scroll-chevron--down", onClick: handleScrollDown, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", size: "md", "aria-hidden": true }) })] }))] })), jsxRuntime.jsx("div", { ref: scrollContainerRef, className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] select-none ".concat(isDraggingScroll ? "cursor-grabbing" : ""), onMouseDown: handleScrollAreaMouseDown, children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: selectedKey, items: menuItems.items, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, selectedKey) })] }), helpSection ? (jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item truncate", children: helpSection.title })) }) })) : null] }) })] }));
|
|
4431
4431
|
});
|
|
4432
4432
|
|
|
4433
|
+
/**
|
|
4434
|
+
* «Cargar más» solo se ofrece si hay otra página, alguien que pueda pedirla y la lista
|
|
4435
|
+
* ya enseña todo lo recibido (desplegada, o sin ítems plegados tras «Ver más»).
|
|
4436
|
+
*/
|
|
4437
|
+
function isLoadMoreVisible(_a) {
|
|
4438
|
+
var hasMore = _a.hasMore, hasOnLoadMore = _a.hasOnLoadMore, isExpanded = _a.isExpanded, hasHiddenItems = _a.hasHiddenItems;
|
|
4439
|
+
return hasMore && hasOnLoadMore && (isExpanded || !hasHiddenItems);
|
|
4440
|
+
}
|
|
4441
|
+
/**
|
|
4442
|
+
* Pulsación de «Cargar más». Con una página en vuelo no hace nada: el botón no usa
|
|
4443
|
+
* `disabled` nativo (perdería el foco del teclado), así que la guarda vive aquí.
|
|
4444
|
+
* Si no, despliega la lista y pide la página, para que lo nuevo no quede tras «Ver más».
|
|
4445
|
+
*/
|
|
4446
|
+
function pressLoadMore(_a) {
|
|
4447
|
+
var isLoadingMore = _a.isLoadingMore, onLoadMore = _a.onLoadMore, expand = _a.expand;
|
|
4448
|
+
if (isLoadingMore) {
|
|
4449
|
+
return;
|
|
4450
|
+
}
|
|
4451
|
+
expand();
|
|
4452
|
+
onLoadMore();
|
|
4453
|
+
}
|
|
4454
|
+
|
|
4433
4455
|
/**
|
|
4434
4456
|
* Sección de historial de conversaciones: botón de nueva conversación + lista de
|
|
4435
|
-
* entradas recientes con "ver más"
|
|
4457
|
+
* entradas recientes con "ver más" y, si el consumidor tiene más páginas,
|
|
4458
|
+
* "cargar más".
|
|
4436
4459
|
*
|
|
4437
4460
|
* La lista tiene **scroll interno propio** (`flex-1 min-h-0 overflow-y-auto`) y
|
|
4438
4461
|
* la sección está acotada en altura, para que crecer el historial no arrastre ni
|
|
@@ -4442,7 +4465,7 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
4442
4465
|
* `rounded-lg`/`rounded-xl` — que es justo lo que difiere del menú compartido.
|
|
4443
4466
|
*/
|
|
4444
4467
|
var MenuClawHistoryPanel = React.memo(function MenuClawHistoryPanel(_a) {
|
|
4445
|
-
var items = _a.items, initialVisibleCount = _a.initialVisibleCount, onNewConversation = _a.onNewConversation, isCollapsed = _a.isCollapsed, title = _a.title, newLabel = _a.newLabel, showMoreLabel = _a.showMoreLabel, showLessLabel = _a.showLessLabel, onBeforeSelect = _a.onBeforeSelect;
|
|
4468
|
+
var items = _a.items, initialVisibleCount = _a.initialVisibleCount, onNewConversation = _a.onNewConversation, hasMore = _a.hasMore, onLoadMore = _a.onLoadMore, isLoadingMore = _a.isLoadingMore, loadMoreLabel = _a.loadMoreLabel, isCollapsed = _a.isCollapsed, title = _a.title, newLabel = _a.newLabel, showMoreLabel = _a.showMoreLabel, showLessLabel = _a.showLessLabel, onBeforeSelect = _a.onBeforeSelect;
|
|
4446
4469
|
var _b = React.useState(false), isExpanded = _b[0], setIsExpanded = _b[1];
|
|
4447
4470
|
var visibleItems = React.useMemo(function () { return (isExpanded ? items : items.slice(0, initialVisibleCount)); }, [isExpanded, items, initialVisibleCount]);
|
|
4448
4471
|
var hasHiddenItems = items.length > initialVisibleCount;
|
|
@@ -4468,7 +4491,19 @@ var MenuClawHistoryPanel = React.memo(function MenuClawHistoryPanel(_a) {
|
|
|
4468
4491
|
? "cursor-not-allowed opacity-50"
|
|
4469
4492
|
: "hover:bg-default-100"), children: [jsxRuntime.jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-400", children: jsxRuntime.jsx(IconComponent, { icon: "solar:chat-round-dots-linear", size: "md", "aria-hidden": true }) }), jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col", children: [jsxRuntime.jsx("span", { className: "truncate", children: item.title }), item.meta ? (jsxRuntime.jsx("span", { className: "truncate text-tiny text-default-400", children: item.meta })) : null] })] }) }, item.id)); }) }), hasHiddenItems ? (jsxRuntime.jsxs("button", { type: "button", onClick: handleToggleExpand, "aria-expanded": isExpanded, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-tiny font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", children: [jsxRuntime.jsx(IconComponent, { icon: isExpanded
|
|
4470
4493
|
? "solar:alt-arrow-up-linear"
|
|
4471
|
-
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null
|
|
4494
|
+
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null, onLoadMore &&
|
|
4495
|
+
isLoadMoreVisible({
|
|
4496
|
+
hasMore: hasMore,
|
|
4497
|
+
hasOnLoadMore: true,
|
|
4498
|
+
isExpanded: isExpanded,
|
|
4499
|
+
hasHiddenItems: hasHiddenItems,
|
|
4500
|
+
}) ? (jsxRuntime.jsxs("button", { type: "button", onClick: function () {
|
|
4501
|
+
return pressLoadMore({
|
|
4502
|
+
isLoadingMore: isLoadingMore,
|
|
4503
|
+
onLoadMore: onLoadMore,
|
|
4504
|
+
expand: function () { return setIsExpanded(true); },
|
|
4505
|
+
});
|
|
4506
|
+
}, "aria-disabled": isLoadingMore, "aria-busy": isLoadingMore, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-tiny font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-disabled:cursor-not-allowed aria-disabled:opacity-50", children: [jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-linear", size: "sm", "aria-hidden": true }), loadMoreLabel] })) : null] })) : null] }));
|
|
4472
4507
|
});
|
|
4473
4508
|
|
|
4474
4509
|
/** ¿Está la key seleccionada en este ítem o en cualquiera de sus descendientes? */
|
|
@@ -4533,6 +4568,7 @@ var DEFAULT_TRANSLATIONS$7 = {
|
|
|
4533
4568
|
historyNewLabel: "Nueva conversación",
|
|
4534
4569
|
historyShowMoreLabel: "Ver más",
|
|
4535
4570
|
historyShowLessLabel: "Ver menos",
|
|
4571
|
+
historyLoadMoreLabel: "Cargar más",
|
|
4536
4572
|
};
|
|
4537
4573
|
/** Ítems del historial visibles antes de pulsar "ver más". */
|
|
4538
4574
|
var DEFAULT_HISTORY_VISIBLE_COUNT = 5;
|
|
@@ -4592,7 +4628,12 @@ var MenuClaw = React.memo(function MenuClaw(_a) {
|
|
|
4592
4628
|
var initialVisibleCount = typeof rawCount === "number" && Number.isFinite(rawCount) && rawCount > 0
|
|
4593
4629
|
? Math.floor(rawCount)
|
|
4594
4630
|
: DEFAULT_HISTORY_VISIBLE_COUNT;
|
|
4595
|
-
return {
|
|
4631
|
+
return {
|
|
4632
|
+
items: items,
|
|
4633
|
+
initialVisibleCount: initialVisibleCount,
|
|
4634
|
+
hasMore: (history === null || history === void 0 ? void 0 : history.hasMore) === true,
|
|
4635
|
+
isLoadingMore: (history === null || history === void 0 ? void 0 : history.isLoadingMore) === true,
|
|
4636
|
+
};
|
|
4596
4637
|
}, [history]);
|
|
4597
4638
|
var bottomBarItems = React.useMemo(function () {
|
|
4598
4639
|
if (!mobileBottomBarGroupKey) {
|
|
@@ -4637,7 +4678,7 @@ var MenuClaw = React.memo(function MenuClaw(_a) {
|
|
|
4637
4678
|
var showBottomBar = (mobileBottomBarGroupKey && bottomBarItems.length > 0) || showNativeMenu;
|
|
4638
4679
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showBottomBar ? (jsxRuntime.jsx(MenuMobileBottomBar, { items: bottomBarItems, selectedKey: selectedKey, onSelect: handleBottomBarSelect, onMenuPress: handleSidebarOpen, menuLabel: t.menuLabel, navAriaLabel: t.mobileNavAriaLabel, forceVisible: showNativeMenu && bottomBarItems.length === 0 })) : null, jsxRuntime.jsx("button", { type: "button", "aria-label": t.closeSidebarAriaLabel, className: "menu-claw-overlay ".concat(isOpenSidebar ? "menu-claw-overlay--open" : ""), onClick: handleSidebarClose, tabIndex: isOpenSidebar ? 0 : -1 }), jsxRuntime.jsx("div", { className: react.cn("menu-claw", collapsed ? "menu-claw--collapsed" : "menu-claw--expanded", isOpenSidebar && "menu-claw--mobile-open"), "aria-hidden": !isOpenSidebar, children: jsxRuntime.jsxs("div", { className: "menu-claw__content", children: [jsxRuntime.jsxs("div", { className: react.cn("flex items-center", collapsed ? "justify-center" : "justify-end"), children: [jsxRuntime.jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "block cursor-pointer sm:hidden", onClick: handleSidebarClose }), jsxRuntime.jsx("button", { type: "button", "aria-label": t.toggleSidebarAriaLabel, onClick: handleCollapseToggle, className: "hidden h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-lg text-default-500 transition-colors hover:bg-default-100 sm:flex", children: jsxRuntime.jsx(IconComponent, { icon: collapsed
|
|
4639
4680
|
? "solar:alt-arrow-right-linear"
|
|
4640
|
-
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxRuntime.jsxs("div", { className: react.cn("flex items-center py-3", collapsed ? "justify-center gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "sm", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), !collapsed ? (jsxRuntime.jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsxRuntime.jsx("p", { className: "truncate text-small font-semibold text-foreground", children: userName }), jsxRuntime.jsx("p", { className: "truncate text-tiny text-default-400", children: userRole })] })) : null] }), jsxRuntime.jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history === null || history === void 0 ? void 0 : history.onNewConversation, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, onBeforeSelect: handleSidebarClose }), jsxRuntime.jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map(function (group) {
|
|
4681
|
+
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxRuntime.jsxs("div", { className: react.cn("flex items-center py-3", collapsed ? "justify-center gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "sm", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), !collapsed ? (jsxRuntime.jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsxRuntime.jsx("p", { className: "truncate text-small font-semibold text-foreground", children: userName }), jsxRuntime.jsx("p", { className: "truncate text-tiny text-default-400", children: userRole })] })) : null] }), jsxRuntime.jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history === null || history === void 0 ? void 0 : history.onNewConversation, hasMore: historyConfig.hasMore, onLoadMore: history === null || history === void 0 ? void 0 : history.onLoadMore, isLoadingMore: historyConfig.isLoadingMore, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, loadMoreLabel: t.historyLoadMoreLabel, onBeforeSelect: handleSidebarClose }), jsxRuntime.jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map(function (group) {
|
|
4641
4682
|
var _a;
|
|
4642
4683
|
return (jsxRuntime.jsxs("div", { className: "mb-2", children: [group.title && !collapsed ? (jsxRuntime.jsx("p", { className: "px-2 pb-1 pt-2 text-tiny font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsxRuntime.jsx("ul", { className: "flex flex-col gap-0.5", children: ((_a = group.items) !== null && _a !== void 0 ? _a : []).map(function (item) { return (jsxRuntime.jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: collapsed, onSelect: handleMenuSelect }, item.key)); }) })] }, group.key));
|
|
4643
4684
|
}) }), helpSection ? (jsxRuntime.jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: "text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: collapsed, children: !collapsed ? (jsxRuntime.jsx("span", { className: "menu-claw-collapsible truncate", children: helpSection.title })) : null }) })) : null] }) })] }));
|
package/dist/index.esm.js
CHANGED
|
@@ -4431,9 +4431,32 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
4431
4431
|
: "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsx(Spacer, { y: 6 }), onUserInfoClick ? (jsx("button", { type: "button", onClick: handleUserInfoClick, className: "content__menu--user w-full text-left cursor-pointer rounded-large border-none bg-transparent transition-colors hover:bg-default/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus ".concat(isCollapsed ? "gap-0" : "gap-3"), children: userInfoContent })) : (jsx("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: userInfoContent })), jsxs("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6 relative"), children: [!isCollapsed && showScrollArrows && (jsxs(Fragment, { children: [scrollState.canScrollUp && (jsxs(Fragment, { children: [jsx("div", { className: "menu-scroll-fade menu-scroll-fade--up", "aria-hidden": "true" }), jsx("button", { type: "button", "aria-label": t.scrollUpAriaLabel, className: "menu-scroll-chevron menu-scroll-chevron--up", onClick: handleScrollUp, children: jsx(IconComponent, { icon: "solar:alt-arrow-up-outline", size: "md", "aria-hidden": true }) })] })), scrollState.canScrollDown && (jsxs(Fragment, { children: [jsx("div", { className: "menu-scroll-fade menu-scroll-fade--down", "aria-hidden": "true" }), jsx("button", { type: "button", "aria-label": t.scrollDownAriaLabel, className: "menu-scroll-chevron menu-scroll-chevron--down", onClick: handleScrollDown, children: jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", size: "md", "aria-hidden": true }) })] }))] })), jsx("div", { ref: scrollContainerRef, className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] select-none ".concat(isDraggingScroll ? "cursor-grabbing" : ""), onMouseDown: handleScrollAreaMouseDown, children: jsx(MenuNavList, { defaultSelectedKey: selectedKey, items: menuItems.items, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, selectedKey) })] }), helpSection ? (jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsx(Button$1, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsx("span", { className: "collapsible-item truncate", children: helpSection.title })) }) })) : null] }) })] }));
|
|
4432
4432
|
});
|
|
4433
4433
|
|
|
4434
|
+
/**
|
|
4435
|
+
* «Cargar más» solo se ofrece si hay otra página, alguien que pueda pedirla y la lista
|
|
4436
|
+
* ya enseña todo lo recibido (desplegada, o sin ítems plegados tras «Ver más»).
|
|
4437
|
+
*/
|
|
4438
|
+
function isLoadMoreVisible(_a) {
|
|
4439
|
+
var hasMore = _a.hasMore, hasOnLoadMore = _a.hasOnLoadMore, isExpanded = _a.isExpanded, hasHiddenItems = _a.hasHiddenItems;
|
|
4440
|
+
return hasMore && hasOnLoadMore && (isExpanded || !hasHiddenItems);
|
|
4441
|
+
}
|
|
4442
|
+
/**
|
|
4443
|
+
* Pulsación de «Cargar más». Con una página en vuelo no hace nada: el botón no usa
|
|
4444
|
+
* `disabled` nativo (perdería el foco del teclado), así que la guarda vive aquí.
|
|
4445
|
+
* Si no, despliega la lista y pide la página, para que lo nuevo no quede tras «Ver más».
|
|
4446
|
+
*/
|
|
4447
|
+
function pressLoadMore(_a) {
|
|
4448
|
+
var isLoadingMore = _a.isLoadingMore, onLoadMore = _a.onLoadMore, expand = _a.expand;
|
|
4449
|
+
if (isLoadingMore) {
|
|
4450
|
+
return;
|
|
4451
|
+
}
|
|
4452
|
+
expand();
|
|
4453
|
+
onLoadMore();
|
|
4454
|
+
}
|
|
4455
|
+
|
|
4434
4456
|
/**
|
|
4435
4457
|
* Sección de historial de conversaciones: botón de nueva conversación + lista de
|
|
4436
|
-
* entradas recientes con "ver más"
|
|
4458
|
+
* entradas recientes con "ver más" y, si el consumidor tiene más páginas,
|
|
4459
|
+
* "cargar más".
|
|
4437
4460
|
*
|
|
4438
4461
|
* La lista tiene **scroll interno propio** (`flex-1 min-h-0 overflow-y-auto`) y
|
|
4439
4462
|
* la sección está acotada en altura, para que crecer el historial no arrastre ni
|
|
@@ -4443,7 +4466,7 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
4443
4466
|
* `rounded-lg`/`rounded-xl` — que es justo lo que difiere del menú compartido.
|
|
4444
4467
|
*/
|
|
4445
4468
|
var MenuClawHistoryPanel = React.memo(function MenuClawHistoryPanel(_a) {
|
|
4446
|
-
var items = _a.items, initialVisibleCount = _a.initialVisibleCount, onNewConversation = _a.onNewConversation, isCollapsed = _a.isCollapsed, title = _a.title, newLabel = _a.newLabel, showMoreLabel = _a.showMoreLabel, showLessLabel = _a.showLessLabel, onBeforeSelect = _a.onBeforeSelect;
|
|
4469
|
+
var items = _a.items, initialVisibleCount = _a.initialVisibleCount, onNewConversation = _a.onNewConversation, hasMore = _a.hasMore, onLoadMore = _a.onLoadMore, isLoadingMore = _a.isLoadingMore, loadMoreLabel = _a.loadMoreLabel, isCollapsed = _a.isCollapsed, title = _a.title, newLabel = _a.newLabel, showMoreLabel = _a.showMoreLabel, showLessLabel = _a.showLessLabel, onBeforeSelect = _a.onBeforeSelect;
|
|
4447
4470
|
var _b = React.useState(false), isExpanded = _b[0], setIsExpanded = _b[1];
|
|
4448
4471
|
var visibleItems = useMemo(function () { return (isExpanded ? items : items.slice(0, initialVisibleCount)); }, [isExpanded, items, initialVisibleCount]);
|
|
4449
4472
|
var hasHiddenItems = items.length > initialVisibleCount;
|
|
@@ -4469,7 +4492,19 @@ var MenuClawHistoryPanel = React.memo(function MenuClawHistoryPanel(_a) {
|
|
|
4469
4492
|
? "cursor-not-allowed opacity-50"
|
|
4470
4493
|
: "hover:bg-default-100"), children: [jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-400", children: jsx(IconComponent, { icon: "solar:chat-round-dots-linear", size: "md", "aria-hidden": true }) }), jsxs("span", { className: "flex min-w-0 flex-col", children: [jsx("span", { className: "truncate", children: item.title }), item.meta ? (jsx("span", { className: "truncate text-tiny text-default-400", children: item.meta })) : null] })] }) }, item.id)); }) }), hasHiddenItems ? (jsxs("button", { type: "button", onClick: handleToggleExpand, "aria-expanded": isExpanded, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-tiny font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", children: [jsx(IconComponent, { icon: isExpanded
|
|
4471
4494
|
? "solar:alt-arrow-up-linear"
|
|
4472
|
-
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null
|
|
4495
|
+
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null, onLoadMore &&
|
|
4496
|
+
isLoadMoreVisible({
|
|
4497
|
+
hasMore: hasMore,
|
|
4498
|
+
hasOnLoadMore: true,
|
|
4499
|
+
isExpanded: isExpanded,
|
|
4500
|
+
hasHiddenItems: hasHiddenItems,
|
|
4501
|
+
}) ? (jsxs("button", { type: "button", onClick: function () {
|
|
4502
|
+
return pressLoadMore({
|
|
4503
|
+
isLoadingMore: isLoadingMore,
|
|
4504
|
+
onLoadMore: onLoadMore,
|
|
4505
|
+
expand: function () { return setIsExpanded(true); },
|
|
4506
|
+
});
|
|
4507
|
+
}, "aria-disabled": isLoadingMore, "aria-busy": isLoadingMore, className: "flex w-full shrink-0 items-center gap-1.5 rounded-lg px-2 py-2 text-tiny font-medium text-default-500 transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-disabled:cursor-not-allowed aria-disabled:opacity-50", children: [jsx(IconComponent, { icon: "solar:add-circle-linear", size: "sm", "aria-hidden": true }), loadMoreLabel] })) : null] })) : null] }));
|
|
4473
4508
|
});
|
|
4474
4509
|
|
|
4475
4510
|
/** ¿Está la key seleccionada en este ítem o en cualquiera de sus descendientes? */
|
|
@@ -4534,6 +4569,7 @@ var DEFAULT_TRANSLATIONS$7 = {
|
|
|
4534
4569
|
historyNewLabel: "Nueva conversación",
|
|
4535
4570
|
historyShowMoreLabel: "Ver más",
|
|
4536
4571
|
historyShowLessLabel: "Ver menos",
|
|
4572
|
+
historyLoadMoreLabel: "Cargar más",
|
|
4537
4573
|
};
|
|
4538
4574
|
/** Ítems del historial visibles antes de pulsar "ver más". */
|
|
4539
4575
|
var DEFAULT_HISTORY_VISIBLE_COUNT = 5;
|
|
@@ -4593,7 +4629,12 @@ var MenuClaw = React.memo(function MenuClaw(_a) {
|
|
|
4593
4629
|
var initialVisibleCount = typeof rawCount === "number" && Number.isFinite(rawCount) && rawCount > 0
|
|
4594
4630
|
? Math.floor(rawCount)
|
|
4595
4631
|
: DEFAULT_HISTORY_VISIBLE_COUNT;
|
|
4596
|
-
return {
|
|
4632
|
+
return {
|
|
4633
|
+
items: items,
|
|
4634
|
+
initialVisibleCount: initialVisibleCount,
|
|
4635
|
+
hasMore: (history === null || history === void 0 ? void 0 : history.hasMore) === true,
|
|
4636
|
+
isLoadingMore: (history === null || history === void 0 ? void 0 : history.isLoadingMore) === true,
|
|
4637
|
+
};
|
|
4597
4638
|
}, [history]);
|
|
4598
4639
|
var bottomBarItems = useMemo(function () {
|
|
4599
4640
|
if (!mobileBottomBarGroupKey) {
|
|
@@ -4638,7 +4679,7 @@ var MenuClaw = React.memo(function MenuClaw(_a) {
|
|
|
4638
4679
|
var showBottomBar = (mobileBottomBarGroupKey && bottomBarItems.length > 0) || showNativeMenu;
|
|
4639
4680
|
return (jsxs(Fragment, { children: [showBottomBar ? (jsx(MenuMobileBottomBar, { items: bottomBarItems, selectedKey: selectedKey, onSelect: handleBottomBarSelect, onMenuPress: handleSidebarOpen, menuLabel: t.menuLabel, navAriaLabel: t.mobileNavAriaLabel, forceVisible: showNativeMenu && bottomBarItems.length === 0 })) : null, jsx("button", { type: "button", "aria-label": t.closeSidebarAriaLabel, className: "menu-claw-overlay ".concat(isOpenSidebar ? "menu-claw-overlay--open" : ""), onClick: handleSidebarClose, tabIndex: isOpenSidebar ? 0 : -1 }), jsx("div", { className: cn("menu-claw", collapsed ? "menu-claw--collapsed" : "menu-claw--expanded", isOpenSidebar && "menu-claw--mobile-open"), "aria-hidden": !isOpenSidebar, children: jsxs("div", { className: "menu-claw__content", children: [jsxs("div", { className: cn("flex items-center", collapsed ? "justify-center" : "justify-end"), children: [jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "block cursor-pointer sm:hidden", onClick: handleSidebarClose }), jsx("button", { type: "button", "aria-label": t.toggleSidebarAriaLabel, onClick: handleCollapseToggle, className: "hidden h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-lg text-default-500 transition-colors hover:bg-default-100 sm:flex", children: jsx(IconComponent, { icon: collapsed
|
|
4640
4681
|
? "solar:alt-arrow-right-linear"
|
|
4641
|
-
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxs("div", { className: cn("flex items-center py-3", collapsed ? "justify-center gap-0" : "gap-3"), children: [jsx(Avatar, { size: "sm", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), !collapsed ? (jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "truncate text-small font-semibold text-foreground", children: userName }), jsx("p", { className: "truncate text-tiny text-default-400", children: userRole })] })) : null] }), jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history === null || history === void 0 ? void 0 : history.onNewConversation, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, onBeforeSelect: handleSidebarClose }), jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map(function (group) {
|
|
4682
|
+
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxs("div", { className: cn("flex items-center py-3", collapsed ? "justify-center gap-0" : "gap-3"), children: [jsx(Avatar, { size: "sm", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), !collapsed ? (jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "truncate text-small font-semibold text-foreground", children: userName }), jsx("p", { className: "truncate text-tiny text-default-400", children: userRole })] })) : null] }), jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history === null || history === void 0 ? void 0 : history.onNewConversation, hasMore: historyConfig.hasMore, onLoadMore: history === null || history === void 0 ? void 0 : history.onLoadMore, isLoadingMore: historyConfig.isLoadingMore, isCollapsed: collapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, loadMoreLabel: t.historyLoadMoreLabel, onBeforeSelect: handleSidebarClose }), jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map(function (group) {
|
|
4642
4683
|
var _a;
|
|
4643
4684
|
return (jsxs("div", { className: "mb-2", children: [group.title && !collapsed ? (jsx("p", { className: "px-2 pb-1 pt-2 text-tiny font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsx("ul", { className: "flex flex-col gap-0.5", children: ((_a = group.items) !== null && _a !== void 0 ? _a : []).map(function (item) { return (jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: collapsed, onSelect: handleMenuSelect }, item.key)); }) })] }, group.key));
|
|
4644
4685
|
}) }), helpSection ? (jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsx(Button$1, { fullWidth: true, className: "text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: collapsed, children: !collapsed ? (jsx("span", { className: "menu-claw-collapsible truncate", children: helpSection.title })) : null }) })) : null] }) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClaw.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuClaw.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAoB5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA+R3C,CAAC"}
|
|
@@ -37,6 +37,23 @@ export interface MenuClawHistory {
|
|
|
37
37
|
* Si se proporciona, se muestra el botón de nueva conversación sobre la lista.
|
|
38
38
|
*/
|
|
39
39
|
onNewConversation?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* `true` si el consumidor puede traer más entradas de las ya listadas (hay otra
|
|
42
|
+
* página en el servidor). Con `onLoadMore`, pinta «Cargar más» al final de la lista
|
|
43
|
+
* —cuando no quedan ítems plegados tras «Ver más»—. Sin esta prop, nada cambia.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
hasMore?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Pide la página siguiente. Sin esta prop no se pinta «Cargar más» aunque `hasMore`
|
|
49
|
+
* sea `true`: no se promete una página que nadie puede pedir.
|
|
50
|
+
*/
|
|
51
|
+
onLoadMore?: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Página siguiente en vuelo: «Cargar más» queda desactivado y con `aria-busy`.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
isLoadingMore?: boolean;
|
|
40
57
|
}
|
|
41
58
|
/**
|
|
42
59
|
* Traducciones de MenuClaw. Todas opcionales para permitir traducciones
|
|
@@ -61,6 +78,8 @@ export type MenuClawTranslations = {
|
|
|
61
78
|
historyShowMoreLabel?: string;
|
|
62
79
|
/** Etiqueta del botón que vuelve a plegar el historial */
|
|
63
80
|
historyShowLessLabel?: string;
|
|
81
|
+
/** Etiqueta del botón que pide la página siguiente del historial */
|
|
82
|
+
historyLoadMoreLabel?: string;
|
|
64
83
|
};
|
|
65
84
|
export interface MenuClawProps {
|
|
66
85
|
userInfo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClaw.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEzF,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,yDAAyD;IACzD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuClaw.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-claw/MenuClaw.types.ts"],"names":[],"mappings":"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"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import React from "react";
|
|
|
2
2
|
import type { MenuClawHistoryPanelProps } from "./MenuClawHistoryPanel.types";
|
|
3
3
|
/**
|
|
4
4
|
* Sección de historial de conversaciones: botón de nueva conversación + lista de
|
|
5
|
-
* entradas recientes con "ver más"
|
|
5
|
+
* entradas recientes con "ver más" y, si el consumidor tiene más páginas,
|
|
6
|
+
* "cargar más".
|
|
6
7
|
*
|
|
7
8
|
* La lista tiene **scroll interno propio** (`flex-1 min-h-0 overflow-y-auto`) y
|
|
8
9
|
* la sección está acotada en altura, para que crecer el historial no arrastre ni
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClawHistoryPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuClawHistoryPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAG9E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA2KlE,CAAC"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.d.ts
CHANGED
|
@@ -6,6 +6,14 @@ export type MenuClawHistoryPanelProps = {
|
|
|
6
6
|
initialVisibleCount: number;
|
|
7
7
|
/** Si se proporciona, se muestra el botón de nueva conversación sobre la lista. */
|
|
8
8
|
onNewConversation?: () => void;
|
|
9
|
+
/** Hay otra página en el servidor (ver `MenuClawHistory.hasMore`). */
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
/** Pide la página siguiente; sin ella no se pinta «Cargar más». */
|
|
12
|
+
onLoadMore?: () => void;
|
|
13
|
+
/** Página siguiente en vuelo: botón desactivado y `aria-busy`. */
|
|
14
|
+
isLoadingMore: boolean;
|
|
15
|
+
/** Etiqueta del botón que pide la página siguiente. */
|
|
16
|
+
loadMoreLabel: string;
|
|
9
17
|
/** Lateral comprimido: solo el botón de nueva conversación, en modo icono. */
|
|
10
18
|
isCollapsed: boolean;
|
|
11
19
|
/** Título de la sección. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuClawHistoryPanel.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,yBAAyB,GAAG;IACvC,yDAAyD;IACzD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,sDAAsD;IACtD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"MenuClawHistoryPanel.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/MenuClawHistoryPanel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,yBAAyB,GAAG;IACvC,yDAAyD;IACzD,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,sDAAsD;IACtD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,kEAAkE;IAClE,aAAa,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC"}
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* «Cargar más» solo se ofrece si hay otra página, alguien que pueda pedirla y la lista
|
|
3
|
+
* ya enseña todo lo recibido (desplegada, o sin ítems plegados tras «Ver más»).
|
|
4
|
+
*/
|
|
5
|
+
export declare function isLoadMoreVisible({ hasMore, hasOnLoadMore, isExpanded, hasHiddenItems, }: {
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
hasOnLoadMore: boolean;
|
|
8
|
+
isExpanded: boolean;
|
|
9
|
+
hasHiddenItems: boolean;
|
|
10
|
+
}): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Pulsación de «Cargar más». Con una página en vuelo no hace nada: el botón no usa
|
|
13
|
+
* `disabled` nativo (perdería el foco del teclado), así que la guarda vive aquí.
|
|
14
|
+
* Si no, despliega la lista y pide la página, para que lo nuevo no quede tras «Ver más».
|
|
15
|
+
*/
|
|
16
|
+
export declare function pressLoadMore({ isLoadingMore, onLoadMore, expand, }: {
|
|
17
|
+
isLoadingMore: boolean;
|
|
18
|
+
onLoadMore: () => void;
|
|
19
|
+
expand: () => void;
|
|
20
|
+
}): void;
|
|
21
|
+
//# sourceMappingURL=menuClawHistoryLoadMore.d.ts.map
|
package/dist/types/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuClawHistoryLoadMore.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu-claw/_internal/menu-claw-history/menuClawHistoryLoadMore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EACjC,OAAO,EACP,aAAa,EACb,UAAU,EACV,cAAc,GACd,EAAE;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,CAEV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC7B,aAAa,EACb,UAAU,EACV,MAAM,GACN,EAAE;IACF,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACnB,GAAG,IAAI,CAMP"}
|