feat: BasePopper supports custom display area via css variables#169
feat: BasePopper supports custom display area via css variables#169hexqi merged 1 commit intoopentiny:developfrom
Conversation
WalkthroughThe updates introduce new CSS variables for constraining dropdown and popper positioning, standardizing all popper placement to use only Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PillsPopper
participant TrDropdownMenu
participant BasePopper
User->>PillsPopper: Interacts with pills
PillsPopper->>PillsPopper: Compute leftRange (container bounds)
PillsPopper->>TrDropdownMenu: Pass leftRange as CSS variables
TrDropdownMenu->>BasePopper: Inherit CSS variables for min/max top/left
BasePopper->>BasePopper: Clamp position using CSS variables
Estimated code review effort3 (~45 minutes) Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
docs/demos/suggestion/pills-popper.vueOops! Something went wrong! :( ESLint: 9.31.0 Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it. packages/components/src/base-popper/index.vueOops! Something went wrong! :( ESLint: 9.31.0 Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it. packages/components/src/dropdown-menu/index.vueOops! Something went wrong! :( ESLint: 9.31.0 Error: The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
8e8894d to
a62364c
Compare
BasePopper支持通过 css 变量自定义显示区域。如果BasePopper设置了prevent-overflow属性,那么弹出框位置不会超出viewpoint。在此基础上,增加了自定义显示区域的功能,让弹出框位置不会超出自定义的显示区域新增如下 css 变量:
--tr-base-popper-min-top,默认值0px--tr-base-popper-max-bottom,默认值100%--tr-base-popper-min-left,默认值0px--tr-base-popper-max-right,默认值100%DropdownMenu使用了基础的BasePopper组件。如果只需要配置 DropdownMenu 的自定义显示区域,设置如下 css 变量--tr-dropdown-menu-min-top,默认值0px--tr-dropdown-menu-max-bottom,默认值100%--tr-dropdown-menu-min-left,默认值0px--tr-dropdown-menu-max-right,默认值100%以上的 css 变量都是
:root范围的,如果只需要针对具体的元素自定义区域,增加 css 选择器优先级即可Summary by CodeRabbit
Summary by CodeRabbit
New Features
Documentation
Style