From d8189c7ae816713b2d935c85ca9d4a77ca074599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=AE=BE?= Date: Sat, 10 Dec 2022 15:50:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtable=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-table/README.md | 15 ++++++------ packages/react-table/src/TableTr.tsx | 5 +++- packages/react-table/src/ThComponent.tsx | 6 +++-- packages/react-table/src/Thead.tsx | 5 ++++ packages/react-table/src/style/index.less | 24 +++++++++++++++++-- website/src/components/Markdown/Markdown.tsx | 2 ++ .../src/components/Markdown/index.module.less | 6 +++++ website/src/layouts/BaseLayout.tsx | 2 +- 8 files changed, 51 insertions(+), 14 deletions(-) diff --git a/packages/react-table/README.md b/packages/react-table/README.md index 854cf37616..52db8a8fb9 100644 --- a/packages/react-table/README.md +++ b/packages/react-table/README.md @@ -22,7 +22,7 @@ import { Table, Button } from 'uiw'; const columns = [ { // title: '姓名', - ellipsis: true, + ellipsis: true, title: ({ key }) => { return ( 字段: {key} @@ -59,7 +59,7 @@ const dataSource = [ ]; const Demo = () => (
- +
); export default Demo @@ -810,8 +810,7 @@ import { Table, Button } from 'uiw'; const columns = [ { // title: '姓名', - ellipsis: true, - width: 1000, + ellipsis: true, title: ({ key }) => { return ( 字段: {key} @@ -849,7 +848,7 @@ const dataSource = [ const Demo = () => (
这个是footer} columns={columns} data={dataSource} /> @@ -873,18 +872,18 @@ const columns = [ title: '姓名', ellipsis: true, // fixed: true, - width: 50, + width: 400, key: 'name', }, { // fixed: true, title: '年龄', - width: 50, style: { color: 'red' }, + width: 400, key: 'age', }, { title: '地址', - width: 50, key: 'info', + width: 400, }, { title: '操作', key: 'edit', diff --git a/packages/react-table/src/TableTr.tsx b/packages/react-table/src/TableTr.tsx index e9da4362d4..83c40c336a 100644 --- a/packages/react-table/src/TableTr.tsx +++ b/packages/react-table/src/TableTr.tsx @@ -82,6 +82,7 @@ export default function TableTr(props: TableTr {data.map((trData, rowNum) => { const key = rowKey ? trData[rowKey] : rowNum; + let rightFixedNum = 0; return ( @@ -115,7 +116,9 @@ export default function TableTr(props: TableTr } if (keyName.fixed) { if (keyName.fixed === 'right') { - objs.className = `${prefixCls}-fixed-right`; + rightFixedNum = rightFixedNum + 1; + const cls = rightFixedNum === 1 ? `${prefixCls}-fixed-right-first` : ''; + objs.className = `${prefixCls}-fixed-right ${cls}`; } else { objs.className = `${prefixCls}-fixed-true`; } diff --git a/packages/react-table/src/ThComponent.tsx b/packages/react-table/src/ThComponent.tsx index 3201cbe2c4..b5dc8628f8 100644 --- a/packages/react-table/src/ThComponent.tsx +++ b/packages/react-table/src/ThComponent.tsx @@ -4,6 +4,7 @@ import { locationFixed } from './util'; interface ThComponentProps { colNum: number; + rightNum: number; item: TableColumns; prefixCls: string; titleNode: JSX.Element; @@ -24,12 +25,13 @@ export default class ThComponent extends Component> { } render() { - const { colNum, prefixCls, item, titleNode, onCellHead, rowNum, locationWidth } = this.props; + const { colNum, rightNum, prefixCls, item, titleNode, onCellHead, rowNum, locationWidth } = this.props; const { title, key, render, children, ellipsis, fixed = false, ...thProps } = item; let cls = ''; if (fixed) { if (fixed === 'right') { - cls = prefixCls + '-fixed-right'; + const rightCls = rightNum === 1 ? `${prefixCls}-fixed-right-first` : ''; + cls = prefixCls + '-fixed-right ' + rightCls; } else { cls = prefixCls + '-fixed-true'; } diff --git a/packages/react-table/src/Thead.tsx b/packages/react-table/src/Thead.tsx index d4c600e4cd..55becafd6e 100644 --- a/packages/react-table/src/Thead.tsx +++ b/packages/react-table/src/Thead.tsx @@ -25,6 +25,7 @@ export default function TheadComponent( updateLocation, ...other } = props; + let rightFixedNum = 0; return ( {data && @@ -41,9 +42,13 @@ export default function TheadComponent( if (thProps.colSpan === 0) { return null; } + if (fixed === 'right') { + rightFixedNum = rightFixedNum + 1; + } return ( table { display: table !important; margin: 0 !important; - width: 100%; + // width: 100% !important; border-spacing: 0; border-collapse: collapse; tr > th, @@ -92,8 +94,15 @@ content: ''; pointer-events: none; } + &-fixed-true::before { + content: ''; + position: absolute; + left: -1px; + top: 0; + bottom: 0; + border-left: 1px solid #dfe2e5; + } &-fixed-right::after { - box-shadow: inset -10px 0 8px -8px rgb(0 0 0 / 15%); position: absolute; top: 0; bottom: -1px; @@ -105,6 +114,17 @@ pointer-events: none; border-right: 1px solid #f0f0f0; } + &-fixed-right-first::after { + box-shadow: inset -10px 0 8px -8px rgb(0 0 0 / 15%); + } + &-fixed-right::before { + content: ''; + position: absolute; + right: -1px; + top: 0; + bottom: 0; + border-right: 1px solid #dfe2e5; + } &-bordered { > table { tr > th, diff --git a/website/src/components/Markdown/Markdown.tsx b/website/src/components/Markdown/Markdown.tsx index b2954ad65a..a30f7368b6 100644 --- a/website/src/components/Markdown/Markdown.tsx +++ b/website/src/components/Markdown/Markdown.tsx @@ -4,6 +4,7 @@ import { getMetaId, isMeta, getURLParameters, CodeBlockData } from 'markdown-rea import MarkdownPreview from '@uiw/react-markdown-preview'; import { CodeProps } from 'react-markdown/lib/ast-to-react'; import Footer from './Footer'; +import styles from './index.module.less'; /** * @@ -59,6 +60,7 @@ export default function Markdown(props: MarkdownProps) { return ( {state.layout === 'top' ? ( - +
From 87ed7482a7f9fd3e6d4d43cb2e43c1fbf198f9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=AE=BE?= Date: Mon, 19 Dec 2022 09:46:27 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtable=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-table/src/style/index.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-table/src/style/index.less b/packages/react-table/src/style/index.less index 5b86f26cdd..10793f27cf 100644 --- a/packages/react-table/src/style/index.less +++ b/packages/react-table/src/style/index.less @@ -6,7 +6,7 @@ > table { display: table !important; margin: 0 !important; - // width: 100% !important; + width: 100% !important; border-spacing: 0; border-collapse: collapse; tr > th, From 6274faecfe7cc192911c1a94fd9c48f43f7a38ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=AE=BE?= Date: Thu, 20 Apr 2023 10:34:43 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix(DatePicker):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A5=E5=8E=86=E5=B9=B4=E4=BB=BD=E9=80=89=E6=8B=A9=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-date-picker/src/DatePickerYear.tsx | 1 - packages/react-date-picker/src/index.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-date-picker/src/DatePickerYear.tsx b/packages/react-date-picker/src/DatePickerYear.tsx index 5f123c1081..ebe955ad25 100644 --- a/packages/react-date-picker/src/DatePickerYear.tsx +++ b/packages/react-date-picker/src/DatePickerYear.tsx @@ -23,7 +23,6 @@ export function DatePickerYear(props: DatePickerYearProps) { const date = new Date(activeYear!); date.setFullYear(year); setActiveYear(date); - onSelected!(year, true); } else { onSelected!(year); } diff --git a/packages/react-date-picker/src/index.tsx b/packages/react-date-picker/src/index.tsx index 4e5852053d..2fad39f8bf 100644 --- a/packages/react-date-picker/src/index.tsx +++ b/packages/react-date-picker/src/index.tsx @@ -167,7 +167,7 @@ export default function DatePicker(props: DatePickerProps) { {type === 'time' && ( From d205f1aa6dfce2583bb5234c4bb73000de06a76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=AE=BE?= Date: Thu, 20 Apr 2023 11:05:36 +0800 Subject: [PATCH 4/6] chore(deps): update dependency lerna to v6.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bc0946660..da8e8e51f9 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "compile-less-cli": "~1.8.11", "husky": "~8.0.0", "kkt": "~7.3.0", - "lerna": "^6.0.0", + "lerna": "~6.0.0", "lint-staged": "^13.0.3", "prettier": "~2.8.0", "react": "~18.2.0", From 09eea551f5a916336ab64a0bbe4703bec2e6d7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=AE=BE?= Date: Thu, 20 Apr 2023 18:10:11 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix(OverlayTrigger):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B5=8C=E5=A5=97=E5=BC=B9=E5=87=BA=E5=AF=BC=E8=87=B4=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E5=B1=82=E7=BA=A7=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-overlay-trigger/src/index.tsx | 16 +++++++++++++--- website/src/layouts/index.module.less | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/react-overlay-trigger/src/index.tsx b/packages/react-overlay-trigger/src/index.tsx index 52899dc593..c69c83124c 100644 --- a/packages/react-overlay-trigger/src/index.tsx +++ b/packages/react-overlay-trigger/src/index.tsx @@ -251,13 +251,22 @@ export default React.forwardRef((props, function hide() { if (!isOpen) return; - zIndex.current -= 1; + if (zIndex.current <= 999) { + zIndex.current = 999; + } else { + zIndex.current -= 1; + } setIsOpen(false); } function show() { if (isOpen) return; - zIndex.current += 1; + const nodeIndex = triggerRef.current?.style.zIndex; + if (nodeIndex) { + zIndex.current = Number(nodeIndex) + 1; + } else { + zIndex.current += 1; + } setIsOpen(true); } @@ -305,6 +314,7 @@ export default React.forwardRef((props, Object.assign({}, child.props, { ...triggerProps, ref: triggerRef, + style: { zIndex: zIndex.current }, className: [child.props.className, disabled ? `${prefixCls}-disabled` : null] .filter(Boolean) .join(' ') @@ -326,7 +336,7 @@ export default React.forwardRef((props, Object.assign({ ...overlay.props, ref: popupRef, - className: [overlay.props && overlay.props.className, placement].filter(Boolean).join(' ').trim(), + className: ['aaa', overlay.props && overlay.props.className, placement].filter(Boolean).join(' ').trim(), }), )} diff --git a/website/src/layouts/index.module.less b/website/src/layouts/index.module.less index cb00a69ab5..2714ebfa9d 100755 --- a/website/src/layouts/index.module.less +++ b/website/src/layouts/index.module.less @@ -22,6 +22,8 @@ } .layoutWrap { + position: relative; + z-index: 1; background-color: #fff; min-height: calc(100vh - 53px); } From b7af0bdada484bf83e2a8372d71f1a470d7695b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=AE=BE?= Date: Thu, 20 Apr 2023 18:14:35 +0800 Subject: [PATCH 6/6] remove other class --- packages/react-overlay-trigger/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-overlay-trigger/src/index.tsx b/packages/react-overlay-trigger/src/index.tsx index c69c83124c..7d52f7a4cd 100644 --- a/packages/react-overlay-trigger/src/index.tsx +++ b/packages/react-overlay-trigger/src/index.tsx @@ -336,7 +336,7 @@ export default React.forwardRef((props, Object.assign({ ...overlay.props, ref: popupRef, - className: ['aaa', overlay.props && overlay.props.className, placement].filter(Boolean).join(' ').trim(), + className: [overlay.props && overlay.props.className, placement].filter(Boolean).join(' ').trim(), }), )}