- 
                Notifications
    You must be signed in to change notification settings 
- Fork 327
feat(grid): add mouse hover show align lines #3768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| <template> | ||
| <tiny-grid | ||
| :data="tableData" | ||
| :edit-config="{}" | ||
| :mouse-config="{ hover: true }" | ||
| :keyboard-config="{ isCut: true }" | ||
| column-min-width="200px" | ||
| height="200" | ||
| > | ||
| <tiny-grid-column type="index" width="60"></tiny-grid-column> | ||
| <tiny-grid-column field="name" :editor="{ component: 'input' }" title="名称"></tiny-grid-column> | ||
| <tiny-grid-column field="area" title="所属区域"></tiny-grid-column> | ||
| <tiny-grid-column field="address" title="地址"></tiny-grid-column> | ||
| <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||
| <tiny-grid-column field="name" :editor="{ component: 'input' }" title="名称"></tiny-grid-column> | ||
| <tiny-grid-column field="area" title="所属区域"></tiny-grid-column> | ||
| <tiny-grid-column field="address" title="地址"></tiny-grid-column> | ||
| <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||
| </tiny-grid> | ||
| </template> | ||
|  | ||
| <script setup> | ||
| import { TinyGrid, TinyGridColumn } from '@opentiny/vue' | ||
| import { ref } from 'vue' | ||
|  | ||
| const tableData = ref([ | ||
| { | ||
| id: '1', | ||
| name: 'GFD 科技 YX 公司', | ||
| area: '华东区', | ||
| address: '福州', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '2', | ||
| name: 'WWWW 科技 YX 公司', | ||
| area: '华南区', | ||
| address: '深圳福田区', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '3', | ||
| name: 'RFV 有限责任公司', | ||
| area: '华南区', | ||
| address: '中山市', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '4', | ||
| name: 'TGBYX 公司', | ||
| area: '华北区', | ||
| address: '梅州', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '5', | ||
| name: 'YHN 科技 YX 公司', | ||
| area: '华南区', | ||
| address: '韶关', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '6', | ||
| name: '康康物业 YX 公司', | ||
| area: '华北区', | ||
| address: '广州天河区', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| } | ||
| ]) | ||
| </script> | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| <template> | ||
| <tiny-grid | ||
| :data="tableData" | ||
| :edit-config="{}" | ||
| :mouse-config="{ hover: true }" | ||
| :keyboard-config="{ isCut: true }" | ||
| column-min-width="200px" | ||
| height="200" | ||
| > | ||
| <tiny-grid-column type="index" width="60"></tiny-grid-column> | ||
| <tiny-grid-column field="name" :editor="{ component: 'input' }" title="名称"></tiny-grid-column> | ||
| <tiny-grid-column field="area" title="所属区域"></tiny-grid-column> | ||
| <tiny-grid-column field="address" title="地址"></tiny-grid-column> | ||
| <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||
| <tiny-grid-column field="name" :editor="{ component: 'input' }" title="名称"></tiny-grid-column> | ||
| <tiny-grid-column field="area" title="所属区域"></tiny-grid-column> | ||
| <tiny-grid-column field="address" title="地址"></tiny-grid-column> | ||
| <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||
| </tiny-grid> | ||
| </template> | ||
|  | ||
| <script> | ||
| import { TinyGrid, TinyGridColumn } from '@opentiny/vue' | ||
|  | ||
| export default { | ||
| components: { | ||
| TinyGrid, | ||
| TinyGridColumn | ||
| }, | ||
| data() { | ||
| return { | ||
| tableData: [ | ||
| { | ||
| id: '1', | ||
| name: 'GFD 科技 YX 公司', | ||
| area: '华东区', | ||
| address: '福州', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '2', | ||
| name: 'WWWW 科技 YX 公司', | ||
| area: '华南区', | ||
| address: '深圳福田区', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '3', | ||
| name: 'RFV 有限责任公司', | ||
| area: '华南区', | ||
| address: '中山市', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '4', | ||
| name: 'TGBYX 公司', | ||
| area: '华北区', | ||
| address: '梅州', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '5', | ||
| name: 'YHN 科技 YX 公司', | ||
| area: '华南区', | ||
| address: '韶关', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| }, | ||
| { | ||
| id: '6', | ||
| name: '康康物业 YX 公司', | ||
| area: '华北区', | ||
| address: '广州天河区', | ||
| introduction: '公司技术和研发实力雄厚,是国家 863 项目的参与者,并被政府认定为“高新技术企业”。' | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| </script> | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -270,16 +270,14 @@ | |
|  | ||
| // tiny新增滚动条放置表格内 | ||
| tbody tr.row__last-visible { | ||
| @apply relative; | ||
|  | ||
| &::after { | ||
| @apply content-['']; | ||
| @apply absolute; | ||
| @apply bottom-0; | ||
| @apply left-0; | ||
| @apply right-0; | ||
| @apply bottom-0; | ||
| @apply h-px; | ||
| top: calc(var(--body-container-scroll-height) - 1px); | ||
| width: var(--body-container-scroll-width); | ||
| @apply bg-color-border-separator; | ||
| @apply ~'z-[3]'; | ||
| } | ||
|  | @@ -727,6 +725,83 @@ | |
| } | ||
| } | ||
|  | ||
| &__hover-align { | ||
| .@{grid-prefix-cls}-body__column:hover { | ||
| @apply bg-color-fill-6; | ||
| } | ||
| .@{grid-prefix-cls}-body__row:hover { | ||
| @apply bg-color-fill-6; | ||
| } | ||
| } | ||
| 
      Comment on lines
    
      +728
     to 
      +735
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainVerify consistency with base theme implementation. The SAAS theme's  Additionally, both themes use different background color approaches: 
 Run the following script to compare the implementations: 🏁 Script executed: #!/bin/bash
# Compare hover-align implementations between base and SAAS themes
echo "=== Base theme hover-align block ==="
rg -A5 "&__hover-align" packages/theme/src/grid/table.less
echo -e "\n=== SAAS theme hover-align block ==="
rg -A5 "&__hover-align" packages/theme-saas/src/grid/table.lessLength of output: 379 Verify and align hover styles and background color in SAAS theme 
 🤖 Prompt for AI Agents | ||
|  | ||
| // 行列对齐辅助线 | ||
| & &-body__hover-align-y-bar { | ||
| --after-left-offset: 0; | ||
|  | ||
| display: none; | ||
| @apply ~'z-[9]'; | ||
| @apply absolute; | ||
| @apply top-0; | ||
| @apply left-0; | ||
|  | ||
| &:before { | ||
| @apply absolute; | ||
| @apply content-['']; | ||
| @apply block; | ||
| @apply h-full; | ||
| border-left-width: 1px; | ||
| border-left-style: dashed; | ||
| @apply border-color-border-focus; | ||
| } | ||
|  | ||
| &:after { | ||
| @apply top-0; | ||
| @apply right-0; | ||
| @apply content-['']; | ||
| @apply absolute; | ||
| @apply block; | ||
| @apply h-full; | ||
| border-left-width: 1px; | ||
| border-left-style: dashed; | ||
| @apply border-color-border-focus; | ||
| left: var(--after-left-offset); | ||
| } | ||
| } | ||
|  | ||
| & &-body__hover-align-x-bar { | ||
| --after-top-offset: 0; | ||
|  | ||
| display: none; | ||
| @apply ~'z-[9]'; | ||
| @apply absolute; | ||
| @apply h-0; | ||
| @apply top-0; | ||
| @apply left-0; | ||
|  | ||
| &:before { | ||
| @apply absolute; | ||
| @apply content-['']; | ||
| @apply block; | ||
| @apply w-full; | ||
| border-top-width: 1px; | ||
| border-top-style: dashed; | ||
| @apply border-color-border-focus; | ||
| } | ||
|  | ||
| &:after { | ||
| @apply top-0; | ||
| @apply right-0; | ||
| @apply content-['']; | ||
| @apply absolute; | ||
| @apply block; | ||
| @apply w-full; | ||
| border-top-width: 1px; | ||
| border-top-style: dashed; | ||
| @apply border-color-border-focus; | ||
| top: var(--after-top-offset); | ||
| } | ||
| } | ||
|  | ||
| // 树形节点 | ||
| & &-tree__indent { | ||
| @apply inline-block; | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting inconsistency and add English translation.
Two issues with the
simplest-pageraddition:sizes、 prev), butpager、simplest-pagerlacks the space beforesimplest-pager.simplest-pager, creating incomplete documentation.Apply this diff to fix both issues:
📝 Committable suggestion
🤖 Prompt for AI Agents