Skip to content

Commit

Permalink
Merge branch 'main' into fix/verticalAlign
Browse files Browse the repository at this point in the history
  • Loading branch information
simonguo committed Nov 9, 2023
2 parents 1e52b05 + a4e1482 commit 07dcf3b
Show file tree
Hide file tree
Showing 17 changed files with 2,741 additions and 2,479 deletions.
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# [5.15.0](https://github.com/rsuite/rsuite-table/compare/5.14.0...5.15.0) (2023-10-26)


### Bug Fixes

* **Table:** fix table cell text cannot be copied ([8a9f06b](https://github.com/rsuite/rsuite-table/commit/8a9f06bf34c83ba6c48c5da2c0988c83faea2d5c))


### Features

* add a script to prepend the use client directive ([#466](https://github.com/rsuite/rsuite-table/issues/466)) ([24369c5](https://github.com/rsuite/rsuite-table/commit/24369c583786fea1757131b417ce25aa3bc3a4f8))



# [5.14.0](https://github.com/rsuite/rsuite-table/compare/5.13.0...5.14.0) (2023-10-19)

### Features

* **Table:** add an option to define rowExpandedHeight as function [#465](https://github.com/rsuite/rsuite-table/pull/465)


# [5.13.0](https://github.com/rsuite/rsuite-table/compare/5.12.0...5.13.0) (2023-10-17)


### Bug Fixes

* **Table:** fix table scroll width not excluding scroll bar width ([#461](https://github.com/rsuite/rsuite-table/issues/461)) ([88b0575](https://github.com/rsuite/rsuite-table/commit/88b0575954460539e7d5f29ee06d9251f89e8d23))
* **TreeTable:** fix incorrect scrolling position of tree nodes after collapse ([#462](https://github.com/rsuite/rsuite-table/issues/462)) ([0e0c8dc](https://github.com/rsuite/rsuite-table/commit/0e0c8dc6357846997533f82aeea6da64d315034a))


### Features

* **Table:** support table scrolling through keyboard arrow keys ([#463](https://github.com/rsuite/rsuite-table/issues/463)) ([bf451a8](https://github.com/rsuite/rsuite-table/commit/bf451a8c65ab24a3812fd16e1f176a977eddd223))



# [5.12.0](https://github.com/rsuite/rsuite-table/compare/5.11.1...5.12.0) (2023-09-06)


### Features

* **Next.js:** add 'use client' to all components ([#456](https://github.com/rsuite/rsuite-table/issues/456)) ([ed49fe1](https://github.com/rsuite/rsuite-table/commit/ed49fe1a76a23878bcad62f4f521ffc95cf4b8e9))



## [5.11.1](https://github.com/rsuite/rsuite-table/compare/5.11.0...5.11.1) (2023-08-31)


### Bug Fixes

* **HeaderCell:** fix type extension ([#448](https://github.com/rsuite/rsuite-table/issues/448)) ([a8c9246](https://github.com/rsuite/rsuite-table/commit/a8c9246c362ef43545ecc021f273de58d05faedf))
* **Column:** fix column width reset after children update ([#447](https://github.com/rsuite/rsuite-table/pull/447))

# [5.11.0](https://github.com/rsuite/rsuite-table/compare/5.10.6...5.11.0) (2023-07-06)


### Features

* **column:** add support for flexGrow with resizable ([#440](https://github.com/rsuite/rsuite-table/issues/440)) ([68c81f1](https://github.com/rsuite/rsuite-table/commit/68c81f1a7c0c49532f7112c6cdabc5abd6b555f1))



## [5.10.6](https://github.com/rsuite/rsuite-table/compare/5.10.5...5.10.6) (2023-06-02)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const App = () => (
| renderRowExpanded | (rowDate?: Object) => React.ReactNode | Customize what you can do to expand a zone |
| renderTreeToggle | (icon:node,rowData:object,expanded:boolean)=> node | Tree table, the callback function in the expanded node |
| rowClassName | string , (rowData:object, rowIndex:number)=>string | Add an optional extra class name to row |
| rowExpandedHeight | number `(100)` | Set the height of an expandable area |
| rowExpandedHeight | number `(100)`, (rowDate?: Object) => number | Set the height of an expandable area |
| rowHeight | number`(46)`, (rowData: object) => number | Row height |
| rowKey | string `('key')` | Each row corresponds to the unique `key` in `data` |
| rtl | boolean | Right to left |
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/CustomCellTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,7 @@ If you need to define row heights based on the content of your data in practical
...
</Table>
```

When used in conjunction with `renderRowExpanded`, it should be noted that the height returned in `rowHeight` needs to include the height of `renderRowExpanded`.

Reference example https://github.com/rsuite/rsuite-table/issues/454#issuecomment-1756703149
6 changes: 4 additions & 2 deletions docs/examples/ResizableColumnTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
const data = mockUsers(20);

const App = () => {
const [width, setWidth] = React.useState(null);

return (
<Table bordered height={400} data={data}>
<Column width={50} align="center" fixed>
Expand All @@ -30,12 +32,12 @@ const App = () => {
<Cell dataKey="lastName" />
</Column>

<Column width={200} resizable>
<Column width={width} resizable flexGrow={1} onResize={width => setWidth(width)}>
<HeaderCell>City</HeaderCell>
<Cell dataKey="city" />
</Column>

<Column width={200} resizable>
<Column width={200} resizable flexGrow={1}>
<HeaderCell>Street</HeaderCell>
<Cell dataKey="street" />
</Column>
Expand Down
21 changes: 15 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ const less = require('gulp-less');
const postcss = require('gulp-postcss');
const sourcemaps = require('gulp-sourcemaps');
const rename = require('gulp-rename');
const insert = require('gulp-insert');
const gulp = require('gulp');
const babelrc = require('./babel.config.js');
const STYLE_SOURCE_DIR = './src/less';
const STYLE_DIST_DIR = './dist/css';
const TS_SOURCE_DIR = ['./src/**/*.tsx', './src/**/*.ts', '!./src/**/*.d.ts'];
const ESM_DIR = './es';
const LIB_DIR = './lib';
const CJS_DIR = './lib';
const DIST_DIR = './dist';

function buildLess() {
Expand All @@ -36,7 +37,14 @@ function buildCSS() {
}

function buildLib() {
return gulp.src(TS_SOURCE_DIR).pipe(babel(babelrc())).pipe(gulp.dest(LIB_DIR));
return (
gulp
.src(TS_SOURCE_DIR)
.pipe(babel(babelrc()))
// adds the 'use-client' directive to /lib exported from rsuite-talbe
.pipe(insert.prepend(`'use client';\n`))
.pipe(gulp.dest(CJS_DIR))
);
}

function buildEsm() {
Expand All @@ -48,18 +56,19 @@ function buildEsm() {
NODE_ENV: 'esm'
})
)
)
) // adds the 'use-client' directive to /es exported from rsuite-talbe
.pipe(insert.prepend(`'use client';\n`))
.pipe(gulp.dest(ESM_DIR));
}

function copyTypescriptDeclarationFiles() {
return gulp.src('./src/**/*.d.ts').pipe(gulp.dest(LIB_DIR)).pipe(gulp.dest(ESM_DIR));
return gulp.src('./src/**/*.d.ts').pipe(gulp.dest(CJS_DIR)).pipe(gulp.dest(ESM_DIR));
}

function copyLessFiles() {
return gulp
.src(['./src/**/*.less', './src/**/fonts/**/*'])
.pipe(gulp.dest(LIB_DIR))
.pipe(gulp.dest(CJS_DIR))
.pipe(gulp.dest(ESM_DIR));
}

Expand All @@ -68,7 +77,7 @@ function copyFontFiles() {
}

function clean(done) {
del.sync([LIB_DIR, ESM_DIR, DIST_DIR], { force: true });
del.sync([CJS_DIR, ESM_DIR, DIST_DIR], { force: true });
done();
}

Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rsuite-table",
"version": "5.10.6",
"version": "5.15.0",
"description": "A React table component",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand All @@ -12,6 +12,7 @@
"build:gulp": "gulp build",
"build:types": "npx tsc --emitDeclarationOnly --outDir lib && npx tsc --emitDeclarationOnly --outDir es",
"build:docs": "rm -rf assets && NODE_ENV=production webpack",
"postbuild": "mocha test/build.test.js",
"dev": "webpack serve --mode development --port 3100 --host 0.0.0.0 --progress",
"publish:docs": "node docs/gh-pages.js",
"tdd": "cross-env NODE_ENV=test karma start",
Expand Down Expand Up @@ -72,8 +73,8 @@
"@types/prop-types": "^15.7.1",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"autoprefixer": "^8.3.0",
"babel-loader": "^8.2.2",
"babel-plugin-date-fns": "^0.2.1",
Expand All @@ -98,6 +99,7 @@
"gh-pages": "^0.12.0",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-insert": "^0.5.0",
"gulp-less": "^5.0.0",
"gulp-postcss": "^7.0.1",
"gulp-rename": "^1.2.2",
Expand Down Expand Up @@ -131,7 +133,7 @@
"sinon-chai": "^3.7.0",
"style-loader": "^0.13.1",
"ts-expect": "^1.3.0",
"typescript": "^4.5.5",
"typescript": "^5.2.2",
"url-loader": "^0.5.7",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
Expand Down
Loading

0 comments on commit 07dcf3b

Please sign in to comment.