Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
01d880bc
Commit
01d880bc
authored
May 19, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
样式调整
parent
65b1d92d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
113 deletions
+102
-113
craco.config.js
craco.config.js
+18
-0
global.d.ts
src/global.d.ts
+0
-18
index.less
src/index.less
+0
-74
react-app-env.d.ts
src/react-app-env.d.ts
+23
-1
test-table.module.less
src/view/Manage/VirtualTable/test-table.module.less
+58
-17
test-table.tsx
src/view/Manage/VirtualTable/test-table.tsx
+3
-3
No files found.
craco.config.js
View file @
01d880bc
...
@@ -14,6 +14,24 @@ module.exports = {
...
@@ -14,6 +14,24 @@ module.exports = {
{
{
plugin
:
CracoLessPlugin
,
plugin
:
CracoLessPlugin
,
options
:
{
options
:
{
modifyLessRule
(
lessRule
,
context
)
{
// You have to exclude these file suffixes first,
// if you want to modify the less module's suffix
lessRule
.
exclude
=
/
\.
m
\.
less$/
;
return
lessRule
;
},
modifyLessModuleRule
(
lessModuleRule
,
context
)
{
// Configure the file suffix
lessModuleRule
.
test
=
/
\.
m
\.
less$/
;
// Configure the generated local ident name.
const
cssLoader
=
lessModuleRule
.
use
.
find
(
loaderByName
(
"css-loader"
));
cssLoader
.
options
.
modules
=
{
localIdentName
:
"[local]_[hash:base64:5]"
,
};
return
lessModuleRule
;
},
lessLoaderOptions
:
{
lessLoaderOptions
:
{
lessOptions
:
{
lessOptions
:
{
modifyVars
:
{
modifyVars
:
{
...
...
src/global.d.ts
deleted
100644 → 0
View file @
65b1d92d
declare
const
rctable
:
any
;
declare
module
'rc-table'
{
export
default
rctable
;
}
declare
const
nprogress
:
any
;
declare
module
'nprogress'
{
export
default
nprogress
;
}
declare
module
'react-resizable'
{
export
const
Resizable
:
any
}
declare
module
'd3v3'
declare
module
'*'
// for import jsx
\ No newline at end of file
src/index.less
View file @
01d880bc
...
@@ -371,80 +371,6 @@ svg {
...
@@ -371,80 +371,6 @@ svg {
overflow: auto;
overflow: auto;
}
}
.react-contextmenu-wrapper {
display: contents;
}
.react-contextmenu {
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0.25rem;
color: #373a3c;
font-size: 16px;
margin-block-start: 2px;
margin-block-end: 0;
margin-inline-start: 0;
margin-inline-end: 0;
min-inline-size: 160px;
outline: none;
opacity: 0;
padding-block: 5px;
padding-inline: 0;
pointer-events: none;
text-align: start;
transition: opacity 250ms ease !important;
}
.react-contextmenu.react-contextmenu--visible {
opacity: 1;
pointer-events: auto;
}
.react-contextmenu-item {
background: 0 0;
border: 0;
color: #373a3c;
cursor: pointer;
font-weight: 400;
line-height: 1.5;
padding-block: 3px;
padding-inline: 20px;
text-align: inherit;
white-space: nowrap;
}
.react-contextmenu-item.react-contextmenu-item--active,
.react-contextmenu-item.react-contextmenu-item--selected {
color: #fff;
background-color: #20a0ff;
border-color: #20a0ff;
text-decoration: none;
}
.react-contextmenu-item.react-contextmenu-item--disabled,
.react-contextmenu-item.react-contextmenu-item--disabled:hover {
background-color: transparent;
border-color: rgba(0, 0, 0, 0.15);
color: #878a8c;
}
.react-contextmenu-item--divider {
border-block-end: 1px solid rgba(0, 0, 0, 0.15);
cursor: inherit;
margin-block-end: 3px;
padding-block: 2px;
padding-inline: 0;
}
.react-contextmenu-item--divider:hover {
background-color: transparent;
border-color: rgba(0, 0, 0, 0.15);
}
.react-contextmenu-item.react-contextmenu-submenu {
padding: 0;
}
.react-contextmenu-item.react-contextmenu-submenu > .react-contextmenu-item::after {
content: '▶';
display: inline-block;
position: absolute;
inset-inline-end: 7px;
}
//virtual-table
//virtual-table
.rdg {
.rdg {
...
...
src/react-app-env.d.ts
View file @
01d880bc
/// <reference types="react-scripts" />
declare
const
rctable
:
any
;
declare
module
'rc-table'
{
export
default
rctable
;
}
declare
const
nprogress
:
any
;
declare
module
'nprogress'
{
export
default
nprogress
;
}
declare
module
'react-resizable'
{
export
const
Resizable
:
any
}
declare
module
'd3v3'
declare
module
"*.module.less"
{
const
classes
:
{
readonly
[
key
:
string
]:
string
};
export
default
classes
;
}
declare
module
'*'
// for import jsx
\ No newline at end of file
src/view/Manage/VirtualTable/test-table.less
→
src/view/Manage/VirtualTable/test-table.
module.
less
View file @
01d880bc
.virtual-table
{
:global
{
.r
eact-contextmenu-wrapper
{
.r
dg
{
display: contents
;
border: none !important
;
}
}
.contextMenu {
.rdg-header-row {
border: 1px solid black;
.rdg-cell {
box-shadow: none !important;
background-color: #f2f5fc!important;
border-block-end: none !important;
border-inline-end: none !important;
font-weight: normal !important;
&:before {
position: absolute;
top: 50%;
right: 0;
width: 1px;
height: 1.6em;
background-color: rgba(0,0,0,.06);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
transition: background-color .3s;
content: "";
}
}
}
.rdg-row {
.rdg-cell {
box-shadow: none !important;
color: #363636 !important;
border-block-end: 1px solid #f0f0f0 !important;
border-inline-end: none !important;
outline: none !important;
}
}
}
:global(.react-contextmenu-wrapper) {
display: contents;
}
.contextMenu {
border: 1px solid black;
:global{
.react-contextmenu {
.react-contextmenu {
background-color: #fff;
background-color: #fff;
background-clip: padding-box;
background-clip: padding-box;
...
@@ -73,18 +112,19 @@
...
@@ -73,18 +112,19 @@
display: inline-block;
display: inline-block;
position: absolute;
position: absolute;
inset-inline-end: 7px;
inset-inline-end: 7px;
}
}
}
}
}
.loadMoreRowsClassname {
.loadMoreRowsClassname {
inline-size: 180px;
inline-size: 180px;
padding-block: 8px;
padding-block: 8px;
padding-inline: 16px;
padding-inline: 16px;
position: absolute;
position: absolute;
inset-block-end: 8px;
inset-block-end: 8px;
inset-inline-end: 8px;
inset-inline-end: 8px;
color: white;
color: white;
line-height: 35px;
line-height: 35px;
background: rgb(0 0 0 / 0.6);
background: rgb(0 0 0 / 0.6);
}
}
}
\ No newline at end of file
src/view/Manage/VirtualTable/test-table.tsx
View file @
01d880bc
...
@@ -10,7 +10,7 @@ import type { CheckboxChangeEvent } from 'antd/es/checkbox';
...
@@ -10,7 +10,7 @@ import type { CheckboxChangeEvent } from 'antd/es/checkbox';
import
{
nanoid
}
from
'nanoid'
;
import
{
nanoid
}
from
'nanoid'
;
import
{
downNode
,
upNode
}
from
'./test-table-helper'
;
import
{
downNode
,
upNode
}
from
'./test-table-helper'
;
import
'./test-table.less'
;
import
css
from
'./test-table.module.less'
export
enum
RowAction
{
export
enum
RowAction
{
None
,
Expand
,
Select
None
,
Expand
,
Select
...
@@ -227,7 +227,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
...
@@ -227,7 +227,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
return
(
return
(
<>
<>
<
DataGrid
<
DataGrid
className=
'virtual-table'
//
className='virtual-table'
ref=
{
gridRef
}
ref=
{
gridRef
}
{
...
rest
}
{
...
rest
}
...
@@ -276,7 +276,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
...
@@ -276,7 +276,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
onScroll=
{
loadMoreRows
?
handleScroll
:
undefined
}
onScroll=
{
loadMoreRows
?
handleScroll
:
undefined
}
/>
/>
{
contextMenu
&&
createPortal
(
{
contextMenu
&&
createPortal
(
<
div
className=
'contextMenu'
>
<
div
className=
{
classNames
(
css
.
contextMenu
)
}
>
<
ContextMenu
id=
{
contextMenuId
}
rtl=
{
false
}
>
<
ContextMenu
id=
{
contextMenuId
}
rtl=
{
false
}
>
{
contextMenu
.
menu
(
contextItem
)
}
{
contextMenu
.
menu
(
contextItem
)
}
</
ContextMenu
>
</
ContextMenu
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment