@comitor/ui 4.3.2 → 4.4.0
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/README.md +3 -3
- package/dist/components/composite/detail-panel.d.ts +41 -2
- package/dist/components/composite/detail-panel.js +59 -5
- package/dist/components/composite/detail-panel.js.map +1 -1
- package/dist/components/composite/menu-property-picker.d.ts +64 -0
- package/dist/components/composite/menu-property-picker.js +214 -0
- package/dist/components/composite/menu-property-picker.js.map +1 -0
- package/dist/components/composite/property-picker.d.ts +11 -4
- package/dist/components/composite/property-picker.js +5 -3
- package/dist/components/composite/property-picker.js.map +1 -1
- package/dist/components/ui/command.d.ts +5 -1
- package/dist/components/ui/command.js +4 -2
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +36 -10
- package/dist/components/ui/context-menu.js +81 -15
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +37 -10
- package/dist/components/ui/dropdown-menu.js +82 -15
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/data-grid/data-grid-cell-variants.js +1 -1
- package/dist/data-grid/data-grid-cell-variants.js.map +1 -1
- package/dist/data-grid/data-grid-column-header.d.ts +2 -0
- package/dist/data-grid/data-grid-filter-menu.js +3 -3
- package/dist/data-grid/data-grid-filter-menu.js.map +1 -1
- package/dist/data-grid/data-grid-sort-menu.js +1 -1
- package/dist/data-grid/data-grid-sort-menu.js.map +1 -1
- package/dist/data-grid/data-grid-view-menu.js +1 -1
- package/dist/data-grid/data-grid-view-menu.js.map +1 -1
- package/dist/data-grid/messages-en.d.ts +5 -0
- package/dist/data-grid/messages-en.js +6 -1
- package/dist/data-grid/messages-en.js.map +1 -1
- package/dist/data-grid/messages-vi.js +2 -1
- package/dist/data-grid/messages-vi.js.map +1 -1
- package/dist/data-grid/messages.d.ts +2 -0
- package/dist/data-grid/use-data-grid.d.ts +1 -0
- package/dist/i18n/locale-provider.d.ts +1 -0
- package/dist/i18n/messages.d.ts +2 -0
- package/dist/i18n/messages.js +3 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/i18n/namespaces/command.d.ts +6 -1
- package/dist/i18n/namespaces/command.js +6 -2
- package/dist/i18n/namespaces/command.js.map +1 -1
- package/dist/i18n/namespaces/menu-filter.d.ts +23 -0
- package/dist/i18n/namespaces/menu-filter.js +19 -0
- package/dist/i18n/namespaces/menu-filter.js.map +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/menu-filter-classes.d.ts +13 -0
- package/dist/lib/menu-filter-classes.js +9 -0
- package/dist/lib/menu-filter-classes.js.map +1 -0
- package/dist/lib/menu-filter.d.ts +113 -0
- package/dist/lib/menu-filter.js +236 -0
- package/dist/lib/menu-filter.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { cn } from \"../../lib/cn.js\";\n\n/**\n * ContextMenu — menu chuột phải (Radix ContextMenu).\n *\n * Dùng cho thao tác nhanh trên thẻ task, dòng bảng, mục sidebar. Cấu trúc mục\n * giống `DropdownMenu` (cùng biến thể `destructive`, `inset`) để hai menu nhìn như một.\n * Vì chuột phải không có trên thiết bị cảm ứng, mọi thao tác ở đây phải có đường\n * thay thế (nút \"…\" mở DropdownMenu).\n */\n\nexport type ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;\n\nfunction ContextMenu({ ...props }: ContextMenuProps) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nexport type ContextMenuTriggerProps = React.ComponentProps<typeof ContextMenuPrimitive.Trigger>;\n\nfunction ContextMenuTrigger({ ...props }: ContextMenuTriggerProps) {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />;\n}\n\nexport type ContextMenuGroupProps = React.ComponentProps<typeof ContextMenuPrimitive.Group>;\n\nfunction ContextMenuGroup({ ...props }: ContextMenuGroupProps) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nexport type ContextMenuPortalProps = React.ComponentProps<typeof ContextMenuPrimitive.Portal>;\n\nfunction ContextMenuPortal({ ...props }: ContextMenuPortalProps) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nexport type ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;\n\nfunction ContextMenuSub({ ...props }: ContextMenuSubProps) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nexport type ContextMenuRadioGroupProps = React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>;\n\nfunction ContextMenuRadioGroup({ ...props }: ContextMenuRadioGroupProps) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nexport type ContextMenuSubTriggerProps = React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n};\n\nfunction ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenuSubTriggerProps) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\n/*\n * ─ VÌ SAO `SubContent` PHẢI BỌC `Portal` ─\n *\n * Không bọc thì Radix render nó (kèm lớp bọc định vị `position: fixed`) làm CON của\n * `ContextMenuContent`, mà `ContextMenuContent` có `overflow-x-hidden overflow-y-auto`. `position: fixed`\n * bình thường thoát được `overflow` — TRỪ KHI có tổ tiên tạo containing block cho nó, và\n * `ContextMenuContent` tạo đúng thứ đó: các lớp `data-[state=open]:animate-in` / `zoom-in-95` /\n * `slide-in-from-*` animate `transform`, với `animation-fill-mode: both` nên transform CÒN LẠI\n * sau khi hiệu ứng chạy xong (`scale(1)` vẫn là transform, không phải `none`).\n *\n * Hệ quả: submenu mở sang BÊN CẠNH menu cha, tức hoàn toàn nằm ngoài hộp của cha theo chiều\n * ngang, và bị `overflow-x-hidden` cắt sạch. Người dùng thấy mục có mũi tên ▸ mà bấm/rê vào\n * không ra gì — không lỗi, không cảnh báo.\n *\n * Đây là hồi quy đã biết của shadcn/ui: nó xuất hiện đúng lúc `ContextMenuContent` được thêm\n * `max-h-… overflow-y-auto`. Bọc `Portal` đưa submenu ra thẳng `document.body`, thoát cả\n * `overflow` lẫn containing block.\n *\n * ⚠ Đừng \"sửa\" bằng cách bỏ `overflow-y-auto` ở `ContextMenuContent`: lớp đó có việc của nó (menu\n * dài hơn màn hình thì phải cuộn được).\n */\nexport type ContextMenuSubContentProps = React.ComponentProps<typeof ContextMenuPrimitive.SubContent>;\n\nfunction ContextMenuSubContent({ className, ...props }: ContextMenuSubContentProps) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-overlay\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nexport type ContextMenuContentProps = React.ComponentProps<typeof ContextMenuPrimitive.Content>;\n\nfunction ContextMenuContent({ className, ...props }: ContextMenuContentProps) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-overlay\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nexport type ContextMenuItemVariant = \"default\" | \"destructive\";\n\nexport type ContextMenuItemProps = React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: ContextMenuItemVariant;\n};\n\nfunction ContextMenuItem({ className, inset, variant = \"default\", ...props }: ContextMenuItemProps) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n // `text-destructive-ink` chứ KHÔNG `text-destructive`: `--destructive` là màu NỀN (nút xoá),\n // ghim một giá trị cho cả hai theme nên làm CHỮ trên nền popover tối chỉ được 3,53:1 ✗ —\n // và tệ thêm khi focus vì nền chuyển sang `bg-destructive/20` (2,98:1 ✗). Bậc ink đạt cả\n // hai theme, cả hai nền: 7,15:1 / 6,18:1 (light, nghỉ / focus) · 6,42:1 / 5,42:1 (dark).\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-ink data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive-ink data-[variant=destructive]:*:[svg]:!text-destructive-ink [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport type ContextMenuCheckboxItemProps = React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>;\n\nfunction ContextMenuCheckboxItem({ className, children, checked, ...props }: ContextMenuCheckboxItemProps) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nexport type ContextMenuRadioItemProps = React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>;\n\nfunction ContextMenuRadioItem({ className, children, ...props }: ContextMenuRadioItemProps) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nexport type ContextMenuLabelProps = React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n};\n\nfunction ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nexport type ContextMenuSeparatorProps = React.ComponentProps<typeof ContextMenuPrimitive.Separator>;\n\nfunction ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorProps) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nexport type ContextMenuShortcutProps = React.ComponentProps<\"span\">;\n\nfunction ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrig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AAW,WAAU,uBAAsB,GAC9C,GACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAMA,SAAS,iBAAiB,EAAE,WAAW,OAAO,GAAG,MAAM,GAA0B;AAC/E,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,WAAW,GAAG,qEAAqE,SAAS;AAAA,MAC3F,GAAG;AAAA;AAAA,EACN;AAEJ;AAIA,SAAS,qBAAqB,EAAE,WAAW,GAAG,MAAM,GAA8B;AAChF,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEJ;AAIA,SAAS,oBAAoB,EAAE,WAAW,GAAG,MAAM,GAA6B;AAC9E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { cn } from \"../../lib/cn.js\";\nimport {\n MenuFilterBoundary,\n type MenuFilterOptions,\n useMenuFilter,\n useMenuFiltering,\n useMenuItemFilteredOut\n} from \"../../lib/menu-filter.js\";\nimport { MENU_FILTER_ACTIVE_CLASS, menuFilteredOutClass } from \"../../lib/menu-filter-classes.js\";\n\n/**\n * ContextMenu — menu chuột phải (Radix ContextMenu).\n *\n * Dùng cho thao tác nhanh trên thẻ task, dòng bảng, mục sidebar. Cấu trúc mục\n * giống `DropdownMenu` (cùng biến thể `destructive`, `inset`) để hai menu nhìn như một.\n * Vì chuột phải không có trên thiết bị cảm ứng, mọi thao tác ở đây phải có đường\n * thay thế (nút \"…\" mở DropdownMenu).\n *\n * Ô LỌC (4.4.0): `<ContextMenuContent filter>` thêm ô gõ ở đầu menu — gõ là lọc mục theo chữ của mục + `keywords`, ↑↓ đi giữa\n * mục còn lại, Enter chạy mục khớp đầu tiên, Esc xoá chữ rồi mới đóng. Luật đầy đủ và lý do: `src/lib/menu-filter.tsx`. Mục mà\n * tên nằm trong một component riêng thì đặt `textValue` (chữ lọc), từ khoá phụ thì `keywords`. Menu con mang sẵn giá trị\n * («Trạng thái ›»): `ContextMenuPropertyPicker`.\n */\n\n/** Tuỳ chọn của `ContextMenuContent filter` (4.4.0) — chữ gợi ý, tên ô gõ, mô tả, câu «không khớp». */\nexport type ContextMenuFilterOptions = MenuFilterOptions;\n\n/** Phần tử bỏ qua khi đọc chữ lọc của một mục — phím tắt ở mép phải không phải tên của mục. */\nconst FILTER_TEXT_SKIP: ReadonlySet<unknown> = new Set<unknown>([ContextMenuShortcut]);\n\nexport type ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;\n\nfunction ContextMenu({ ...props }: ContextMenuProps) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nexport type ContextMenuTriggerProps = React.ComponentProps<typeof ContextMenuPrimitive.Trigger>;\n\nfunction ContextMenuTrigger({ ...props }: ContextMenuTriggerProps) {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />;\n}\n\nexport type ContextMenuGroupProps = React.ComponentProps<typeof ContextMenuPrimitive.Group>;\n\nfunction ContextMenuGroup({ ...props }: ContextMenuGroupProps) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nexport type ContextMenuPortalProps = React.ComponentProps<typeof ContextMenuPrimitive.Portal>;\n\nfunction ContextMenuPortal({ ...props }: ContextMenuPortalProps) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nexport type ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;\n\nfunction ContextMenuSub({ ...props }: ContextMenuSubProps) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nexport type ContextMenuRadioGroupProps = React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>;\n\nfunction ContextMenuRadioGroup({ ...props }: ContextMenuRadioGroupProps) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nexport type ContextMenuSubTriggerProps = React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`ContextMenuContent filter`) — ngoài chữ của mục. */\n keywords?: readonly string[];\n};\n\nfunction ContextMenuSubTrigger({ className, inset, keywords, children, ...props }: ContextMenuSubTriggerProps) {\n const filteredOut = useMenuItemFilteredOut({\n children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n className,\n menuFilteredOutClass(filteredOut)\n )}\n {...props}\n hidden={filteredOut || props.hidden}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\n/*\n * ─ VÌ SAO `SubContent` PHẢI BỌC `Portal` ─\n *\n * Không bọc thì Radix render nó (kèm lớp bọc định vị `position: fixed`) làm CON của\n * `ContextMenuContent`, mà `ContextMenuContent` có `overflow-x-hidden overflow-y-auto`. `position: fixed`\n * bình thường thoát được `overflow` — TRỪ KHI có tổ tiên tạo containing block cho nó, và\n * `ContextMenuContent` tạo đúng thứ đó: các lớp `data-[state=open]:animate-in` / `zoom-in-95` /\n * `slide-in-from-*` animate `transform`, với `animation-fill-mode: both` nên transform CÒN LẠI\n * sau khi hiệu ứng chạy xong (`scale(1)` vẫn là transform, không phải `none`).\n *\n * Hệ quả: submenu mở sang BÊN CẠNH menu cha, tức hoàn toàn nằm ngoài hộp của cha theo chiều\n * ngang, và bị `overflow-x-hidden` cắt sạch. Người dùng thấy mục có mũi tên ▸ mà bấm/rê vào\n * không ra gì — không lỗi, không cảnh báo.\n *\n * Đây là hồi quy đã biết của shadcn/ui: nó xuất hiện đúng lúc `ContextMenuContent` được thêm\n * `max-h-… overflow-y-auto`. Bọc `Portal` đưa submenu ra thẳng `document.body`, thoát cả\n * `overflow` lẫn containing block.\n *\n * ⚠ Đừng \"sửa\" bằng cách bỏ `overflow-y-auto` ở `ContextMenuContent`: lớp đó có việc của nó (menu\n * dài hơn màn hình thì phải cuộn được).\n */\nexport type ContextMenuSubContentProps = React.ComponentProps<typeof ContextMenuPrimitive.SubContent>;\n\nfunction ContextMenuSubContent({ className, children, ...props }: ContextMenuSubContentProps) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-overlay\",\n className\n )}\n {...props}\n >\n {/* Mục của menu con không lọc theo ô gõ của menu cha (xem `menu-filter`). */}\n <MenuFilterBoundary>{children}</MenuFilterBoundary>\n </ContextMenuPrimitive.SubContent>\n </ContextMenuPrimitive.Portal>\n );\n}\n\nexport type ContextMenuContentProps = React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n /**\n * (4.4.0) Ô gõ lọc mục ở đầu menu. `true` = chữ mặc định của namespace `menuFilter`; object để đặt riêng chữ gợi ý, tên ô gõ, mô\n * tả, câu «không khớp». Vắng = menu như trước. Có ô lọc thì khung mang `role=\"dialog\"` (tên: `aria-label`, mặc định «Actions»)\n * và các mục nằm trong một `role=\"menu\"` riêng — xem `src/lib/menu-filter.tsx`.\n */\n filter?: boolean | ContextMenuFilterOptions;\n};\n\nfunction ContextMenuContent({\n className,\n filter,\n children,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onKeyDownCapture,\n ...props\n}: ContextMenuContentProps) {\n const menuFilter = useMenuFilter(\n filter,\n { onCloseAutoFocus, onEscapeKeyDown, onKeyDownCapture },\n { slot: \"context-menu\", listClassName: \"p-1\", withDefaultLabel: true, returnFocus: true }\n );\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-overlay\",\n menuFilter.contentClassName,\n className\n )}\n {...menuFilter.contentProps}\n {...props}\n >\n {menuFilter.wrap(children)}\n </ContextMenuPrimitive.Content>\n </ContextMenuPrimitive.Portal>\n );\n}\n\nexport type ContextMenuItemVariant = \"default\" | \"destructive\";\n\nexport type ContextMenuItemProps = React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: ContextMenuItemVariant;\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`ContextMenuContent filter`) — ngoài chữ của mục (tên khác, mã lệnh…). */\n keywords?: readonly string[];\n};\n\nfunction ContextMenuItem({ className, inset, variant = \"default\", keywords, ...props }: ContextMenuItemProps) {\n const filteredOut = useMenuItemFilteredOut({\n children: props.children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n // `text-destructive-ink` chứ KHÔNG `text-destructive`: `--destructive` là màu NỀN (nút xoá),\n // ghim một giá trị cho cả hai theme nên làm CHỮ trên nền popover tối chỉ được 3,53:1 ✗ —\n // và tệ thêm khi focus vì nền chuyển sang `bg-destructive/20` (2,98:1 ✗). Bậc ink đạt cả\n // hai theme, cả hai nền: 7,15:1 / 6,18:1 (light, nghỉ / focus) · 6,42:1 / 5,42:1 (dark).\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-ink data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive-ink data-[variant=destructive]:*:[svg]:!text-destructive-ink [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n \"data-[variant=destructive]:data-[filter-active]:bg-destructive/10 dark:data-[variant=destructive]:data-[filter-active]:bg-destructive/20 data-[variant=destructive]:data-[filter-active]:text-destructive-ink\",\n className,\n menuFilteredOutClass(filteredOut)\n )}\n {...props}\n hidden={filteredOut || props.hidden}\n />\n );\n}\n\nexport type ContextMenuCheckboxItemProps = React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`ContextMenuContent filter`). */\n keywords?: readonly string[];\n};\n\nfunction ContextMenuCheckboxItem({ className, children, checked, keywords, ...props }: ContextMenuCheckboxItemProps) {\n const filteredOut = useMenuItemFilteredOut({\n children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n className,\n menuFilteredOutClass(filteredOut)\n )}\n checked={checked}\n {...props}\n hidden={filteredOut || props.hidden}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nexport type ContextMenuRadioItemProps = React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`ContextMenuContent filter`). */\n keywords?: readonly string[];\n};\n\nfunction ContextMenuRadioItem({ className, children, keywords, ...props }: ContextMenuRadioItemProps) {\n const filteredOut = useMenuItemFilteredOut({\n children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n className,\n menuFilteredOutClass(filteredOut)\n )}\n {...props}\n hidden={filteredOut || props.hidden}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nexport type ContextMenuLabelProps = React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n};\n\nfunction ContextMenuLabel({ className, inset, ...props }: ContextMenuLabelProps) {\n /* Đang lọc thì danh sách là các mục khớp, phẳng — nhãn nhóm và vạch chia ẩn. */\n const filtering = useMenuFiltering();\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n hidden={filtering || props.hidden}\n />\n );\n}\n\nexport type ContextMenuSeparatorProps = React.ComponentProps<typeof ContextMenuPrimitive.Separator>;\n\nfunction ContextMenuSeparator({ className, ...props }: ContextMenuSeparatorProps) {\n const filtering = useMenuFiltering();\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n hidden={filtering || props.hidden}\n />\n );\n}\n\nexport type ContextMenuShortcutProps = React.ComponentProps<\"span\">;\n\nfunction ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger\n};\n"],"mappings":";AAsCS,cA+CL,YA/CK;AApCT,YAAY,0BAA0B;AACtC,SAAS,WAAW,kBAAkB,kBAAkB;AAExD,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B,4BAA4B;AAoB/D,MAAM,mBAAyC,oBAAI,IAAa,CAAC,mBAAmB,CAAC;AAIrF,SAAS,YAAY,EAAE,GAAG,MAAM,GAAqB;AACnD,SAAO,oBAAC,qBAAqB,MAArB,EAA0B,aAAU,gBAAgB,GAAG,OAAO;AACxE;AAIA,SAAS,mBAAmB,EAAE,GAAG,MAAM,GAA4B;AACjE,SAAO,oBAAC,qBAAqB,SAArB,EAA6B,aAAU,wBAAwB,GAAG,OAAO;AACnF;AAIA,SAAS,iBAAiB,EAAE,GAAG,MAAM,GAA0B;AAC7D,SAAO,oBAAC,qBAAqB,OAArB,EAA2B,aAAU,sBAAsB,GAAG,OAAO;AAC/E;AAIA,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAA2B;AAC/D,SAAO,oBAAC,qBAAqB,QAArB,EAA4B,aAAU,uBAAuB,GAAG,OAAO;AACjF;AAIA,SAAS,eAAe,EAAE,GAAG,MAAM,GAAwB;AACzD,SAAO,oBAAC,qBAAqB,KAArB,EAAyB,aAAU,oBAAoB,GAAG,OAAO;AAC3E;AAIA,SAAS,sBAAsB,EAAE,GAAG,MAAM,GAA+B;AACvE,SAAO,oBAAC,qBAAqB,YAArB,EAAgC,aAAU,4BAA4B,GAAG,OAAO;AAC1F;AAQA,SAAS,sB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qB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,qBAAqB,WAAW;AAAA,MAClC;AAAA,MACC,GAAG;AAAA,MACJ,QAAQ,eAAe,MAAM;AAAA,MAE7B;AAAA,4BAAC,UAAK,WAAU,iFACd,8BAAC,qBAAqB,eAArB,EACC,8BAAC,cAAW,WAAU,uBAAsB,GAC9C,GACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAMA,SAAS,iBAAiB,EAAE,WAAW,OAAO,GAAG,MAAM,GAA0B;AAE/E,QAAM,YAAY,iBAAiB;AACnC,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,WAAW,GAAG,qEAAqE,SAAS;AAAA,MAC3F,GAAG;AAAA,MACJ,QAAQ,aAAa,MAAM;AAAA;AAAA,EAC7B;AAEJ;AAIA,SAAS,qBAAqB,EAAE,WAAW,GAAG,MAAM,GAA8B;AAChF,QAAM,YAAY,iBAAiB;AACnC,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA,MACJ,QAAQ,aAAa,MAAM;AAAA;AAAA,EAC7B;AAEJ;AAIA,SAAS,oBAAoB,EAAE,WAAW,GAAG,MAAM,GAA6B;AAC9E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { MenuFilterOptions } from '../../lib/menu-filter.js';
|
|
4
|
+
import '../../i18n/namespaces/menu-filter.js';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* DropdownMenu — menu bung ra từ một nút (Radix DropdownMenu).
|
|
@@ -7,15 +9,30 @@ import * as React from 'react';
|
|
|
7
9
|
* Xương sống của UserMenu, menu thao tác trên dòng bảng, WorkspaceSwitcher.
|
|
8
10
|
* `DropdownMenuItem` có `variant="destructive"` cho mục nguy hiểm (Xóa, Đăng xuất)
|
|
9
11
|
* và `inset` để thụt lề cho ngang hàng với mục có icon chọn.
|
|
12
|
+
*
|
|
13
|
+
* Ô LỌC (4.4.0): `<DropdownMenuContent filter>` — cùng lõi với `ContextMenuContent filter` (`src/lib/menu-filter.tsx`): gõ lọc
|
|
14
|
+
* mục theo chữ + `keywords`, ↑↓ đi giữa mục còn lại, Enter chạy mục khớp đầu tiên, Esc xoá chữ rồi mới đóng. Khung có ô lọc lấy
|
|
15
|
+
* tên từ nút mở (Radix nối `aria-labelledby`). Menu con mang sẵn giá trị: `DropdownMenuPropertyPicker`.
|
|
16
|
+
* Nút mở của menu có ô lọc nên mang `aria-haspopup="dialog"` (đặt trên `DropdownMenuTrigger`): Radix ghi `"menu"`, mà thứ bật ra là
|
|
17
|
+
* một khung `dialog` có ô gõ — nút không biết menu của nó có ô lọc hay không, nên gói không tự đổi được.
|
|
10
18
|
*/
|
|
19
|
+
/** Tuỳ chọn của `DropdownMenuContent filter` (4.4.0). */
|
|
20
|
+
type DropdownMenuFilterOptions = MenuFilterOptions;
|
|
11
21
|
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
12
22
|
declare function DropdownMenu({ ...props }: DropdownMenuProps): React.JSX.Element;
|
|
13
23
|
type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>;
|
|
14
24
|
declare function DropdownMenuPortal({ ...props }: DropdownMenuPortalProps): React.JSX.Element;
|
|
15
25
|
type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
16
26
|
declare function DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps): React.JSX.Element;
|
|
17
|
-
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content
|
|
18
|
-
|
|
27
|
+
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content> & {
|
|
28
|
+
/**
|
|
29
|
+
* (4.4.0) Ô gõ lọc mục ở đầu menu. `true` = chữ mặc định của namespace `menuFilter`; object để đặt riêng chữ gợi ý, tên ô gõ, mô
|
|
30
|
+
* tả, câu «không khớp». Vắng = menu như trước. Có ô lọc thì khung mang `role="dialog"` (tên: nút mở) và các mục nằm trong một
|
|
31
|
+
* `role="menu"` riêng — xem `src/lib/menu-filter.tsx`. Đặt `aria-haspopup="dialog"` trên `DropdownMenuTrigger` của menu này.
|
|
32
|
+
*/
|
|
33
|
+
filter?: boolean | DropdownMenuFilterOptions;
|
|
34
|
+
};
|
|
35
|
+
declare function DropdownMenuContent({ className, sideOffset, filter, children, onCloseAutoFocus, onEscapeKeyDown, onKeyDownCapture, ...props }: DropdownMenuContentProps): React.JSX.Element;
|
|
19
36
|
type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;
|
|
20
37
|
declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): React.JSX.Element;
|
|
21
38
|
type DropdownMenuItemVariant = "default" | "destructive";
|
|
@@ -24,14 +41,22 @@ type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.I
|
|
|
24
41
|
inset?: boolean;
|
|
25
42
|
/** "destructive" tô đỏ cho thao tác nguy hiểm. Mặc định "default". */
|
|
26
43
|
variant?: DropdownMenuItemVariant;
|
|
44
|
+
/** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`) — ngoài chữ của mục. */
|
|
45
|
+
keywords?: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
declare function DropdownMenuItem({ className, inset, variant, keywords, ...props }: DropdownMenuItemProps): React.JSX.Element;
|
|
48
|
+
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
49
|
+
/** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`). */
|
|
50
|
+
keywords?: readonly string[];
|
|
27
51
|
};
|
|
28
|
-
declare function
|
|
29
|
-
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
30
|
-
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
|
|
52
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, keywords, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
|
|
31
53
|
type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;
|
|
32
54
|
declare function DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps): React.JSX.Element;
|
|
33
|
-
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem
|
|
34
|
-
|
|
55
|
+
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
56
|
+
/** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`). */
|
|
57
|
+
keywords?: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
declare function DropdownMenuRadioItem({ className, children, keywords, ...props }: DropdownMenuRadioItemProps): React.JSX.Element;
|
|
35
60
|
type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
36
61
|
inset?: boolean;
|
|
37
62
|
/**
|
|
@@ -50,9 +75,11 @@ type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Su
|
|
|
50
75
|
declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): React.JSX.Element;
|
|
51
76
|
type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
52
77
|
inset?: boolean;
|
|
78
|
+
/** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`) — ngoài chữ của mục. */
|
|
79
|
+
keywords?: readonly string[];
|
|
53
80
|
};
|
|
54
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
|
|
81
|
+
declare function DropdownMenuSubTrigger({ className, inset, keywords, children, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
|
|
55
82
|
type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
|
|
56
|
-
declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
|
|
83
|
+
declare function DropdownMenuSubContent({ className, children, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
|
|
57
84
|
|
|
58
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemVariant, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
85
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, type DropdownMenuFilterOptions, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemVariant, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -3,6 +3,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
5
5
|
import { cn } from "../../lib/cn.js";
|
|
6
|
+
import {
|
|
7
|
+
MenuFilterBoundary,
|
|
8
|
+
useMenuFilter,
|
|
9
|
+
useMenuFiltering,
|
|
10
|
+
useMenuItemFilteredOut
|
|
11
|
+
} from "../../lib/menu-filter.js";
|
|
12
|
+
import { MENU_FILTER_ACTIVE_CLASS, menuFilteredOutClass } from "../../lib/menu-filter-classes.js";
|
|
13
|
+
const FILTER_TEXT_SKIP = /* @__PURE__ */ new Set([DropdownMenuShortcut]);
|
|
6
14
|
function DropdownMenu({ ...props }) {
|
|
7
15
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
8
16
|
}
|
|
@@ -12,7 +20,21 @@ function DropdownMenuPortal({ ...props }) {
|
|
|
12
20
|
function DropdownMenuTrigger({ ...props }) {
|
|
13
21
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
14
22
|
}
|
|
15
|
-
function DropdownMenuContent({
|
|
23
|
+
function DropdownMenuContent({
|
|
24
|
+
className,
|
|
25
|
+
sideOffset = 4,
|
|
26
|
+
filter,
|
|
27
|
+
children,
|
|
28
|
+
onCloseAutoFocus,
|
|
29
|
+
onEscapeKeyDown,
|
|
30
|
+
onKeyDownCapture,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
const menuFilter = useMenuFilter(
|
|
34
|
+
filter,
|
|
35
|
+
{ onCloseAutoFocus, onEscapeKeyDown, onKeyDownCapture },
|
|
36
|
+
{ slot: "dropdown-menu", listClassName: "p-(--menu-pad)", withDefaultLabel: false, returnFocus: false }
|
|
37
|
+
);
|
|
16
38
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
17
39
|
DropdownMenuPrimitive.Content,
|
|
18
40
|
{
|
|
@@ -20,16 +42,25 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
20
42
|
sideOffset,
|
|
21
43
|
className: cn(
|
|
22
44
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-(--menu-radius) border p-(--menu-pad) shadow-overlay",
|
|
45
|
+
menuFilter.contentClassName,
|
|
23
46
|
className
|
|
24
47
|
),
|
|
25
|
-
...
|
|
48
|
+
...menuFilter.contentProps,
|
|
49
|
+
...props,
|
|
50
|
+
children: menuFilter.wrap(children)
|
|
26
51
|
}
|
|
27
52
|
) });
|
|
28
53
|
}
|
|
29
54
|
function DropdownMenuGroup({ ...props }) {
|
|
30
55
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
31
56
|
}
|
|
32
|
-
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
57
|
+
function DropdownMenuItem({ className, inset, variant = "default", keywords, ...props }) {
|
|
58
|
+
const filteredOut = useMenuItemFilteredOut({
|
|
59
|
+
children: props.children,
|
|
60
|
+
textValue: props.textValue,
|
|
61
|
+
keywords,
|
|
62
|
+
skip: FILTER_TEXT_SKIP
|
|
63
|
+
});
|
|
33
64
|
return /* @__PURE__ */ jsx(
|
|
34
65
|
DropdownMenuPrimitive.Item,
|
|
35
66
|
{
|
|
@@ -38,23 +69,36 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
38
69
|
"data-variant": variant,
|
|
39
70
|
className: cn(
|
|
40
71
|
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-ink data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive-ink data-[variant=destructive]:*:[svg]:!text-destructive-ink [&_svg:not([class*='text-'])]:text-(--menu-icon-fg) relative flex cursor-default items-center gap-(--menu-item-gap) mt-1 first:mt-0 rounded-(--menu-item-radius) px-(--menu-item-px) py-(--menu-item-py) text-(length:--menu-item-text) text-(--menu-item-fg) leading-(--menu-item-leading) outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
41
|
-
|
|
72
|
+
MENU_FILTER_ACTIVE_CLASS,
|
|
73
|
+
"data-[variant=destructive]:data-[filter-active]:bg-destructive/10 dark:data-[variant=destructive]:data-[filter-active]:bg-destructive/20 data-[variant=destructive]:data-[filter-active]:text-destructive-ink",
|
|
74
|
+
className,
|
|
75
|
+
menuFilteredOutClass(filteredOut)
|
|
42
76
|
),
|
|
43
|
-
...props
|
|
77
|
+
...props,
|
|
78
|
+
hidden: filteredOut || props.hidden
|
|
44
79
|
}
|
|
45
80
|
);
|
|
46
81
|
}
|
|
47
|
-
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
82
|
+
function DropdownMenuCheckboxItem({ className, children, checked, keywords, ...props }) {
|
|
83
|
+
const filteredOut = useMenuItemFilteredOut({
|
|
84
|
+
children,
|
|
85
|
+
textValue: props.textValue,
|
|
86
|
+
keywords,
|
|
87
|
+
skip: FILTER_TEXT_SKIP
|
|
88
|
+
});
|
|
48
89
|
return /* @__PURE__ */ jsxs(
|
|
49
90
|
DropdownMenuPrimitive.CheckboxItem,
|
|
50
91
|
{
|
|
51
92
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
52
93
|
className: cn(
|
|
53
94
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
54
|
-
|
|
95
|
+
MENU_FILTER_ACTIVE_CLASS,
|
|
96
|
+
className,
|
|
97
|
+
menuFilteredOutClass(filteredOut)
|
|
55
98
|
),
|
|
56
99
|
checked,
|
|
57
100
|
...props,
|
|
101
|
+
hidden: filteredOut || props.hidden,
|
|
58
102
|
children: [
|
|
59
103
|
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
60
104
|
children
|
|
@@ -65,16 +109,25 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
|
65
109
|
function DropdownMenuRadioGroup({ ...props }) {
|
|
66
110
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
67
111
|
}
|
|
68
|
-
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
112
|
+
function DropdownMenuRadioItem({ className, children, keywords, ...props }) {
|
|
113
|
+
const filteredOut = useMenuItemFilteredOut({
|
|
114
|
+
children,
|
|
115
|
+
textValue: props.textValue,
|
|
116
|
+
keywords,
|
|
117
|
+
skip: FILTER_TEXT_SKIP
|
|
118
|
+
});
|
|
69
119
|
return /* @__PURE__ */ jsxs(
|
|
70
120
|
DropdownMenuPrimitive.RadioItem,
|
|
71
121
|
{
|
|
72
122
|
"data-slot": "dropdown-menu-radio-item",
|
|
73
123
|
className: cn(
|
|
74
124
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
75
|
-
|
|
125
|
+
MENU_FILTER_ACTIVE_CLASS,
|
|
126
|
+
className,
|
|
127
|
+
menuFilteredOutClass(filteredOut)
|
|
76
128
|
),
|
|
77
129
|
...props,
|
|
130
|
+
hidden: filteredOut || props.hidden,
|
|
78
131
|
children: [
|
|
79
132
|
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
80
133
|
children
|
|
@@ -83,6 +136,7 @@ function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
|
83
136
|
);
|
|
84
137
|
}
|
|
85
138
|
function DropdownMenuLabel({ className, inset, variant = "default", ...props }) {
|
|
139
|
+
const filtering = useMenuFiltering();
|
|
86
140
|
return /* @__PURE__ */ jsx(
|
|
87
141
|
DropdownMenuPrimitive.Label,
|
|
88
142
|
{
|
|
@@ -94,17 +148,20 @@ function DropdownMenuLabel({ className, inset, variant = "default", ...props })
|
|
|
94
148
|
"data-[inset]:pl-8",
|
|
95
149
|
className
|
|
96
150
|
),
|
|
97
|
-
...props
|
|
151
|
+
...props,
|
|
152
|
+
hidden: filtering || props.hidden
|
|
98
153
|
}
|
|
99
154
|
);
|
|
100
155
|
}
|
|
101
156
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
157
|
+
const filtering = useMenuFiltering();
|
|
102
158
|
return /* @__PURE__ */ jsx(
|
|
103
159
|
DropdownMenuPrimitive.Separator,
|
|
104
160
|
{
|
|
105
161
|
"data-slot": "dropdown-menu-separator",
|
|
106
162
|
className: cn("bg-border mx-(--menu-separator-mx) my-(--menu-separator-my) h-px", className),
|
|
107
|
-
...props
|
|
163
|
+
...props,
|
|
164
|
+
hidden: filtering || props.hidden
|
|
108
165
|
}
|
|
109
166
|
);
|
|
110
167
|
}
|
|
@@ -121,7 +178,13 @@ function DropdownMenuShortcut({ className, ...props }) {
|
|
|
121
178
|
function DropdownMenuSub({ ...props }) {
|
|
122
179
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
123
180
|
}
|
|
124
|
-
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
181
|
+
function DropdownMenuSubTrigger({ className, inset, keywords, children, ...props }) {
|
|
182
|
+
const filteredOut = useMenuItemFilteredOut({
|
|
183
|
+
children,
|
|
184
|
+
textValue: props.textValue,
|
|
185
|
+
keywords,
|
|
186
|
+
skip: FILTER_TEXT_SKIP
|
|
187
|
+
});
|
|
125
188
|
return /* @__PURE__ */ jsxs(
|
|
126
189
|
DropdownMenuPrimitive.SubTrigger,
|
|
127
190
|
{
|
|
@@ -129,9 +192,12 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
129
192
|
"data-inset": inset,
|
|
130
193
|
className: cn(
|
|
131
194
|
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
132
|
-
|
|
195
|
+
MENU_FILTER_ACTIVE_CLASS,
|
|
196
|
+
className,
|
|
197
|
+
menuFilteredOutClass(filteredOut)
|
|
133
198
|
),
|
|
134
199
|
...props,
|
|
200
|
+
hidden: filteredOut || props.hidden,
|
|
135
201
|
children: [
|
|
136
202
|
children,
|
|
137
203
|
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
@@ -139,7 +205,7 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
139
205
|
}
|
|
140
206
|
);
|
|
141
207
|
}
|
|
142
|
-
function DropdownMenuSubContent({ className, ...props }) {
|
|
208
|
+
function DropdownMenuSubContent({ className, children, ...props }) {
|
|
143
209
|
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
144
210
|
DropdownMenuPrimitive.SubContent,
|
|
145
211
|
{
|
|
@@ -148,7 +214,8 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
148
214
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-overlay",
|
|
149
215
|
className
|
|
150
216
|
),
|
|
151
|
-
...props
|
|
217
|
+
...props,
|
|
218
|
+
children: /* @__PURE__ */ jsx(MenuFilterBoundary, { children })
|
|
152
219
|
}
|
|
153
220
|
) });
|
|
154
221
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { cn } from \"../../lib/cn.js\";\n\n/**\n * DropdownMenu — menu bung ra từ một nút (Radix DropdownMenu).\n *\n * Xương sống của UserMenu, menu thao tác trên dòng bảng, WorkspaceSwitcher.\n * `DropdownMenuItem` có `variant=\"destructive\"` cho mục nguy hiểm (Xóa, Đăng xuất)\n * và `inset` để thụt lề cho ngang hàng với mục có icon chọn.\n */\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>;\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nexport type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;\n\nfunction DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content>;\n\nfunction DropdownMenuContent({ className, sideOffset = 4, ...props }: DropdownMenuContentProps) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-(--menu-radius) border p-(--menu-pad) shadow-overlay\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;\n\nfunction DropdownMenuGroup({ ...props }: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nexport type DropdownMenuItemVariant = \"default\" | \"destructive\";\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n /** Thụt lề trái để thẳng hàng với mục có ô đánh dấu. */\n inset?: boolean;\n /** \"destructive\" tô đỏ cho thao tác nguy hiểm. Mặc định \"default\". */\n variant?: DropdownMenuItemVariant;\n};\n\nfunction DropdownMenuItem({ className, inset, variant = \"default\", ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n // `text-destructive-ink` chứ KHÔNG `text-destructive`: `--destructive` là màu NỀN (nút xoá),\n // ghim một giá trị cho cả hai theme nên làm CHỮ trên nền popover tối chỉ được 3,53:1 ✗ —\n // và tệ thêm khi focus vì nền chuyển sang `bg-destructive/20` (2,98:1 ✗). Bậc ink đạt cả\n // hai theme, cả hai nền: 7,15:1 / 6,18:1 (light, nghỉ / focus) · 6,42:1 / 5,42:1 (dark).\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-ink data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive-ink data-[variant=destructive]:*:[svg]:!text-destructive-ink [&_svg:not([class*='text-'])]:text-(--menu-icon-fg) relative flex cursor-default items-center gap-(--menu-item-gap) mt-1 first:mt-0 rounded-(--menu-item-radius) px-(--menu-item-px) py-(--menu-item-py) text-(length:--menu-item-text) text-(--menu-item-fg) leading-(--menu-item-leading) outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;\n\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nexport type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;\n\nfunction DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;\n\nfunction DropdownMenuRadioItem({ className, children, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nexport type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n /**\n * `\"default\"` — nhãn thường (chữ 14px đậm vừa). `\"section\"` (3.20.0) — nhãn MỤC chữ HOA nhỏ, màu\n * `--muted-foreground`, đặt đầu một nhóm mục (\"Vai trò của bạn\"); cỡ/độ đậm/giãn chữ theo token\n * `--menu-section-*` (green: `.acct-h` của bản mẫu v4), đệm ngang theo `--menu-item-px` để thẳng mép chữ mục.\n */\n variant?: \"default\" | \"section\";\n};\n\nfunction DropdownMenuLabel({ className, inset, variant = \"default\", ...props }: DropdownMenuLabelProps) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n variant === \"section\"\n ? \"px-(--menu-item-px) pt-2 pb-1 text-(length:--menu-section-text) leading-normal font-(--menu-section-weight) tracking-(--menu-section-tracking) uppercase text-muted-foreground\"\n : \"px-2 py-1.5 text-sm font-medium\",\n \"data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>;\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border mx-(--menu-separator-mx) my-(--menu-separator-my) h-px\", className)}\n {...props}\n />\n );\n}\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<\"span\">;\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>;\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nexport type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n};\n\nfunction DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\n/*\n * ─ VÌ SAO `SubContent` PHẢI BỌC `Portal` ─\n *\n * Không bọc thì Radix render nó (kèm lớp bọc định vị `position: fixed`) làm CON của\n * `DropdownMenuContent`, mà `DropdownMenuContent` có `overflow-x-hidden overflow-y-auto`. `position: fixed`\n * bình thường thoát được `overflow` — TRỪ KHI có tổ tiên tạo containing block cho nó, và\n * `DropdownMenuContent` tạo đúng thứ đó: các lớp `data-[state=open]:animate-in` / `zoom-in-95` /\n * `slide-in-from-*` animate `transform`, với `animation-fill-mode: both` nên transform CÒN LẠI\n * sau khi hiệu ứng chạy xong (`scale(1)` vẫn là transform, không phải `none`).\n *\n * Hệ quả: submenu mở sang BÊN CẠNH menu cha, tức hoàn toàn nằm ngoài hộp của cha theo chiều\n * ngang, và bị `overflow-x-hidden` cắt sạch. Người dùng thấy mục có mũi tên ▸ mà bấm/rê vào\n * không ra gì — không lỗi, không cảnh báo.\n *\n * Đây là hồi quy đã biết của shadcn/ui: nó xuất hiện đúng lúc `DropdownMenuContent` được thêm\n * `max-h-… overflow-y-auto`. Bọc `Portal` đưa submenu ra thẳng `document.body`, thoát cả\n * `overflow` lẫn containing block.\n *\n * ⚠ Đừng \"sửa\" bằng cách bỏ `overflow-y-auto` ở `DropdownMenuContent`: lớp đó có việc của nó (menu\n * dài hơn màn hình thì phải cuộn được).\n */\nexport type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>;\n\nfunction DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-overlay\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n};\n"],"mappings":";AAkBS,cAuEL,YAvEK;AAhBT,YAAY,2BAA2B;AACvC,SAAS,WAAW,kBAAkB,kBAAkB;AAExD,SAAS,UAAU;AAYnB,SAAS,aAAa,EAAE,GAAG,MAAM,GAAsB;AACrD,SAAO,oBAAC,sBAAsB,MAAtB,EAA2B,aAAU,iBAAiB,GAAG,OAAO;AAC1E;AAIA,SAAS,mBAAmB,EAAE,GAAG,MAAM,GAA4B;AACjE,SAAO,oBAAC,sBAAsB,QAAtB,EAA6B,aAAU,wBAAwB,GAAG,OAAO;AACnF;AAIA,SAAS,oBAAoB,EAAE,GAAG,MAAM,GAA6B;AACnE,SAAO,oBAAC,sBAAsB,SAAtB,EAA8B,aAAU,yBAAyB,GAAG,OAAO;AACrF;AAIA,SAAS,oBAAoB,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAA6B;AAC9F,SACE,oBAAC,sBAAsB,QAAtB,EACC;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;AAIA,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAA2B;AAC/D,SAAO,oBAAC,sBAAsB,OAAtB,EAA4B,aAAU,uBAAuB,GAAG,OAAO;AACjF;AAWA,SAAS,iBAAiB,EAAE,WAAW,OAAO,UAAU,WAAW,GAAG,MAAM,GAA0B;AACpG,SACE;AAAA,IAAC,sB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,GAAG;AAAA;AAAA,EACN;AAEJ;AAIA,SAAS,sBAAsB,EAAE,WAAW,GAAG,MAAM,GAA+B;AAClF,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,oEAAoE,SAAS;AAAA,MAC1F,GAAG;AAAA;AAAA,EACN;AAEJ;AAIA,SAAS,qBAAqB,EAAE,WAAW,GAAG,MAAM,GAA8B;AAChF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;AAIA,SAAS,gBAAgB,EAAE,GAAG,MAAM,GAAyB;AAC3D,SAAO,oBAAC,sBAAsB,KAAtB,EAA0B,aAAU,qBAAqB,GAAG,OAAO;AAC7E;AAMA,SAAS,uBAAuB,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAgC;AACrG,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,oBAAiB,WAAU,kBAAiB;AAAA;AAAA;AAAA,EAC/C;AAEJ;AAyBA,SAAS,uBAAuB,EAAE,WAAW,GAAG,MAAM,GAAgC;AACpF,SACE,oBAAC,sBAAsB,QAAtB,EACC;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { cn } from \"../../lib/cn.js\";\nimport {\n MenuFilterBoundary,\n type MenuFilterOptions,\n useMenuFilter,\n useMenuFiltering,\n useMenuItemFilteredOut\n} from \"../../lib/menu-filter.js\";\nimport { MENU_FILTER_ACTIVE_CLASS, menuFilteredOutClass } from \"../../lib/menu-filter-classes.js\";\n\n/**\n * DropdownMenu — menu bung ra từ một nút (Radix DropdownMenu).\n *\n * Xương sống của UserMenu, menu thao tác trên dòng bảng, WorkspaceSwitcher.\n * `DropdownMenuItem` có `variant=\"destructive\"` cho mục nguy hiểm (Xóa, Đăng xuất)\n * và `inset` để thụt lề cho ngang hàng với mục có icon chọn.\n *\n * Ô LỌC (4.4.0): `<DropdownMenuContent filter>` — cùng lõi với `ContextMenuContent filter` (`src/lib/menu-filter.tsx`): gõ lọc\n * mục theo chữ + `keywords`, ↑↓ đi giữa mục còn lại, Enter chạy mục khớp đầu tiên, Esc xoá chữ rồi mới đóng. Khung có ô lọc lấy\n * tên từ nút mở (Radix nối `aria-labelledby`). Menu con mang sẵn giá trị: `DropdownMenuPropertyPicker`.\n * Nút mở của menu có ô lọc nên mang `aria-haspopup=\"dialog\"` (đặt trên `DropdownMenuTrigger`): Radix ghi `\"menu\"`, mà thứ bật ra là\n * một khung `dialog` có ô gõ — nút không biết menu của nó có ô lọc hay không, nên gói không tự đổi được.\n */\n\n/** Tuỳ chọn của `DropdownMenuContent filter` (4.4.0). */\nexport type DropdownMenuFilterOptions = MenuFilterOptions;\n\n/** Phần tử bỏ qua khi đọc chữ lọc của một mục — phím tắt ở mép phải không phải tên của mục. */\nconst FILTER_TEXT_SKIP: ReadonlySet<unknown> = new Set<unknown>([DropdownMenuShortcut]);\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>;\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nexport type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;\n\nfunction DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content> & {\n /**\n * (4.4.0) Ô gõ lọc mục ở đầu menu. `true` = chữ mặc định của namespace `menuFilter`; object để đặt riêng chữ gợi ý, tên ô gõ, mô\n * tả, câu «không khớp». Vắng = menu như trước. Có ô lọc thì khung mang `role=\"dialog\"` (tên: nút mở) và các mục nằm trong một\n * `role=\"menu\"` riêng — xem `src/lib/menu-filter.tsx`. Đặt `aria-haspopup=\"dialog\"` trên `DropdownMenuTrigger` của menu này.\n */\n filter?: boolean | DropdownMenuFilterOptions;\n};\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n filter,\n children,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onKeyDownCapture,\n ...props\n}: DropdownMenuContentProps) {\n const menuFilter = useMenuFilter(\n filter,\n { onCloseAutoFocus, onEscapeKeyDown, onKeyDownCapture },\n { slot: \"dropdown-menu\", listClassName: \"p-(--menu-pad)\", withDefaultLabel: false, returnFocus: false }\n );\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-(--menu-radius) border p-(--menu-pad) shadow-overlay\",\n menuFilter.contentClassName,\n className\n )}\n {...menuFilter.contentProps}\n {...props}\n >\n {menuFilter.wrap(children)}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;\n\nfunction DropdownMenuGroup({ ...props }: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nexport type DropdownMenuItemVariant = \"default\" | \"destructive\";\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n /** Thụt lề trái để thẳng hàng với mục có ô đánh dấu. */\n inset?: boolean;\n /** \"destructive\" tô đỏ cho thao tác nguy hiểm. Mặc định \"default\". */\n variant?: DropdownMenuItemVariant;\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`) — ngoài chữ của mục. */\n keywords?: readonly string[];\n};\n\nfunction DropdownMenuItem({ className, inset, variant = \"default\", keywords, ...props }: DropdownMenuItemProps) {\n const filteredOut = useMenuItemFilteredOut({\n children: props.children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n // `text-destructive-ink` chứ KHÔNG `text-destructive`: `--destructive` là màu NỀN (nút xoá),\n // ghim một giá trị cho cả hai theme nên làm CHỮ trên nền popover tối chỉ được 3,53:1 ✗ —\n // và tệ thêm khi focus vì nền chuyển sang `bg-destructive/20` (2,98:1 ✗). Bậc ink đạt cả\n // hai theme, cả hai nền: 7,15:1 / 6,18:1 (light, nghỉ / focus) · 6,42:1 / 5,42:1 (dark).\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive-ink data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive-ink data-[variant=destructive]:*:[svg]:!text-destructive-ink [&_svg:not([class*='text-'])]:text-(--menu-icon-fg) relative flex cursor-default items-center gap-(--menu-item-gap) mt-1 first:mt-0 rounded-(--menu-item-radius) px-(--menu-item-px) py-(--menu-item-py) text-(length:--menu-item-text) text-(--menu-item-fg) leading-(--menu-item-leading) outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n \"data-[variant=destructive]:data-[filter-active]:bg-destructive/10 dark:data-[variant=destructive]:data-[filter-active]:bg-destructive/20 data-[variant=destructive]:data-[filter-active]:text-destructive-ink\",\n className,\n menuFilteredOutClass(filteredOut)\n )}\n {...props}\n hidden={filteredOut || props.hidden}\n />\n );\n}\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`). */\n keywords?: readonly string[];\n};\n\nfunction DropdownMenuCheckboxItem({ className, children, checked, keywords, ...props }: DropdownMenuCheckboxItemProps) {\n const filteredOut = useMenuItemFilteredOut({\n children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n className,\n menuFilteredOutClass(filteredOut)\n )}\n checked={checked}\n {...props}\n hidden={filteredOut || props.hidden}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nexport type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;\n\nfunction DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`). */\n keywords?: readonly string[];\n};\n\nfunction DropdownMenuRadioItem({ className, children, keywords, ...props }: DropdownMenuRadioItemProps) {\n const filteredOut = useMenuItemFilteredOut({\n children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm py-(--menu-item-py) pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n className,\n menuFilteredOutClass(filteredOut)\n )}\n {...props}\n hidden={filteredOut || props.hidden}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nexport type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n /**\n * `\"default\"` — nhãn thường (chữ 14px đậm vừa). `\"section\"` (3.20.0) — nhãn MỤC chữ HOA nhỏ, màu\n * `--muted-foreground`, đặt đầu một nhóm mục (\"Vai trò của bạn\"); cỡ/độ đậm/giãn chữ theo token\n * `--menu-section-*` (green: `.acct-h` của bản mẫu v4), đệm ngang theo `--menu-item-px` để thẳng mép chữ mục.\n */\n variant?: \"default\" | \"section\";\n};\n\nfunction DropdownMenuLabel({ className, inset, variant = \"default\", ...props }: DropdownMenuLabelProps) {\n /* Đang lọc thì danh sách là các mục khớp, phẳng — nhãn nhóm và vạch chia ẩn. */\n const filtering = useMenuFiltering();\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n variant === \"section\"\n ? \"px-(--menu-item-px) pt-2 pb-1 text-(length:--menu-section-text) leading-normal font-(--menu-section-weight) tracking-(--menu-section-tracking) uppercase text-muted-foreground\"\n : \"px-2 py-1.5 text-sm font-medium\",\n \"data-[inset]:pl-8\",\n className\n )}\n {...props}\n hidden={filtering || props.hidden}\n />\n );\n}\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>;\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n const filtering = useMenuFiltering();\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border mx-(--menu-separator-mx) my-(--menu-separator-my) h-px\", className)}\n {...props}\n hidden={filtering || props.hidden}\n />\n );\n}\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<\"span\">;\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>;\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nexport type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n /** (4.4.0) Từ khoá phụ cho ô lọc của menu (`DropdownMenuContent filter`) — ngoài chữ của mục. */\n keywords?: readonly string[];\n};\n\nfunction DropdownMenuSubTrigger({ className, inset, keywords, children, ...props }: DropdownMenuSubTriggerProps) {\n const filteredOut = useMenuItemFilteredOut({\n children,\n textValue: props.textValue,\n keywords,\n skip: FILTER_TEXT_SKIP\n });\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 mt-1 first:mt-0 rounded-sm px-2 py-(--menu-item-py) text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n MENU_FILTER_ACTIVE_CLASS,\n className,\n menuFilteredOutClass(filteredOut)\n )}\n {...props}\n hidden={filteredOut || props.hidden}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\n/*\n * ─ VÌ SAO `SubContent` PHẢI BỌC `Portal` ─\n *\n * Không bọc thì Radix render nó (kèm lớp bọc định vị `position: fixed`) làm CON của\n * `DropdownMenuContent`, mà `DropdownMenuContent` có `overflow-x-hidden overflow-y-auto`. `position: fixed`\n * bình thường thoát được `overflow` — TRỪ KHI có tổ tiên tạo containing block cho nó, và\n * `DropdownMenuContent` tạo đúng thứ đó: các lớp `data-[state=open]:animate-in` / `zoom-in-95` /\n * `slide-in-from-*` animate `transform`, với `animation-fill-mode: both` nên transform CÒN LẠI\n * sau khi hiệu ứng chạy xong (`scale(1)` vẫn là transform, không phải `none`).\n *\n * Hệ quả: submenu mở sang BÊN CẠNH menu cha, tức hoàn toàn nằm ngoài hộp của cha theo chiều\n * ngang, và bị `overflow-x-hidden` cắt sạch. Người dùng thấy mục có mũi tên ▸ mà bấm/rê vào\n * không ra gì — không lỗi, không cảnh báo.\n *\n * Đây là hồi quy đã biết của shadcn/ui: nó xuất hiện đúng lúc `DropdownMenuContent` được thêm\n * `max-h-… overflow-y-auto`. Bọc `Portal` đưa submenu ra thẳng `document.body`, thoát cả\n * `overflow` lẫn containing block.\n *\n * ⚠ Đừng \"sửa\" bằng cách bỏ `overflow-y-auto` ở `DropdownMenuContent`: lớp đó có việc của nó (menu\n * dài hơn màn hình thì phải cuộn được).\n */\nexport type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>;\n\nfunction DropdownMenuSubContent({ className, children, ...props }: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-overlay\",\n className\n )}\n {...props}\n >\n {/* Mục của menu con không lọc theo ô gõ của menu cha (xem `menu-filter`). */}\n <MenuFilterBoundary>{children}</MenuFilterBoundary>\n </DropdownMenuPrimitive.SubContent>\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n};\n"],"mappings":";AAsCS,cAqHL,YArHK;AApCT,YAAY,2BAA2B;AACvC,SAAS,WAAW,kBAAkB,kBAAkB;AAExD,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B,4BAA4B;AAoB/D,MAAM,mBAAyC,oBAAI,IAAa,CAAC,oBAAoB,CAAC;AAItF,SAAS,aAAa,EAAE,GAAG,MAAM,GAAsB;AACrD,SAAO,oBAAC,sBAAsB,MAAtB,EAA2B,aAAU,iBAAiB,GAAG,OAAO;AAC1E;AAIA,SAAS,mBAAmB,EAAE,GAAG,MAAM,GAA4B;AACjE,SAAO,oBAAC,sBAAsB,QAAtB,EAA6B,aAAU,wBAAwB,GAAG,OAAO;AACnF;AAIA,SAAS,oBAAoB,EAAE,GAAG,MAAM,GAA6B;AACnE,SAAO,oBAAC,sBAAsB,SAAtB,EAA8B,aAAU,yBAAyB,GAAG,OAAO;AACrF;AAWA,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA6B;AAC3B,QAAM,aAAa;AAAA,IACjB;AAAA,IACA,EAAE,kBAAkB,iBAAiB,iBAAiB;AAAA,IACtD,EAAE,MAAM,iBAAiB,eAAe,kBAAkB,kBAAkB,OAAO,aA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A,EAChC,GACF;AAEJ;","names":[]}
|
|
@@ -1068,7 +1068,7 @@ function MultiSelectCell({
|
|
|
1068
1068
|
}
|
|
1069
1069
|
)
|
|
1070
1070
|
] }),
|
|
1071
|
-
/* @__PURE__ */ jsxs(CommandList, { className: "max-h-full", children: [
|
|
1071
|
+
/* @__PURE__ */ jsxs(CommandList, { label: msg.grid.listLabel, className: "max-h-full", children: [
|
|
1072
1072
|
/* @__PURE__ */ jsx(CommandEmpty, { children: msg.cell.optionEmpty }),
|
|
1073
1073
|
/* @__PURE__ */ jsx(CommandGroup, { className: "max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden", children: options.map((option) => {
|
|
1074
1074
|
const isSelected2 = selectedValuesSet.has(option.value);
|