Skip to content

Commit 26bb74f

Browse files
authored
Add disableColumnResize option (#210)
1 parent 636b1fe commit 26bb74f

File tree

12 files changed

+32
-16
lines changed

12 files changed

+32
-16
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The fastest open-source data table for web.
2323
[![npm](https://img.shields.io/npm/v/cheetah-grid.svg)](https://www.npmjs.com/package/cheetah-grid)
2424

2525
```html
26-
<script src="https://unpkg.com/cheetah-grid@0.18"></script>
26+
<script src="https://unpkg.com/cheetah-grid@0.19"></script>
2727
```
2828

2929
### Downloading Cheetah Grid using npm
@@ -46,10 +46,10 @@ const cheetahGrid = require("cheetah-grid")
4646

4747
[![npm](https://img.shields.io/npm/v/cheetah-grid.svg)](https://www.npmjs.com/package/cheetah-grid)
4848

49-
[cheetahGrid.es5.min.js](https://unpkg.com/cheetah-grid@0.18/dist/cheetahGrid.es5.min.js)
49+
[cheetahGrid.es5.min.js](https://unpkg.com/cheetah-grid@0.19/dist/cheetahGrid.es5.min.js)
5050

5151
SourceMap
52-
[cheetahGrid.es5.min.js.map](https://unpkg.com/cheetah-grid@0.18/dist/cheetahGrid.es5.min.js.map)
52+
[cheetahGrid.es5.min.js.map](https://unpkg.com/cheetah-grid@0.19/dist/cheetahGrid.es5.min.js.map)
5353

5454

5555
### Downloading Cheetah Grid using GitHub

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cheetah-grid-manager",
33
"private": true,
4-
"version": "0.18.0",
4+
"version": "0.19.0",
55
"description": "Cheetah Grid is a high performance grid engine that works on canvas",
66
"keywords": [
77
"spreadsheet",

packages/cheetah-grid-icon-svg-loader/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cheetah-grid-icon-svg-loader/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cheetah-grid-icon-svg-loader",
3-
"version": "0.18.0",
3+
"version": "0.19.0",
44
"description": "Webpack loader that loads the icon module for Cheetah Grid from SVG.",
55
"main": "lib/index.js",
66
"files": [

packages/cheetah-grid/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cheetah-grid",
3-
"version": "0.18.1",
3+
"version": "0.19.0",
44
"description": "Cheetah Grid is a high performance grid engine that works on canvas",
55
"keywords": [
66
"spreadsheet",

packages/cheetah-grid/src/js/core/DrawGrid.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,9 @@ function _bindEvents(this: DrawGrid): void {
11281128
};
11291129
};
11301130
const canResizeColumn = (col: number): boolean => {
1131+
if (grid[_].disableColumnResize) {
1132+
return false;
1133+
}
11311134
const limit = grid[_].colWidthsLimit[col];
11321135
if (!limit || !limit.min || !limit.max) {
11331136
return true;
@@ -2566,6 +2569,7 @@ interface DrawGridProtected {
25662569
font?: string;
25672570
underlayBackgroundColor?: string;
25682571
keyboardOptions?: DrawGridKeyboardOptions;
2572+
disableColumnResize?: boolean;
25692573

25702574
rowHeightsMap: NumberMap<number>;
25712575
colWidthsMap: NumberMap<string | number>;
@@ -2623,6 +2627,10 @@ export interface DrawGridConstructorOptions {
26232627
* Canvas parent element
26242628
*/
26252629
parentElement?: HTMLElement | null;
2630+
/**
2631+
* Disable column resizing
2632+
*/
2633+
disableColumnResize?: boolean;
26262634
}
26272635
const protectedKey = _;
26282636
/**
@@ -2647,7 +2655,8 @@ export abstract class DrawGrid extends EventTarget implements DrawGridAPI {
26472655
font,
26482656
underlayBackgroundColor,
26492657
keyboardOptions,
2650-
parentElement
2658+
parentElement,
2659+
disableColumnResize
26512660
} = options;
26522661
const protectedSpace = (this[_] = {} as DrawGridProtected);
26532662
style.initDocument();
@@ -2678,6 +2687,7 @@ export abstract class DrawGrid extends EventTarget implements DrawGridAPI {
26782687
protectedSpace.underlayBackgroundColor = underlayBackgroundColor;
26792688

26802689
protectedSpace.keyboardOptions = keyboardOptions;
2690+
protectedSpace.disableColumnResize = disableColumnResize;
26812691

26822692
/////
26832693
protectedSpace.rowHeightsMap = new NumberMap();

packages/demo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cheetah-grid-demo",
33
"private": true,
4-
"version": "0.18.0",
4+
"version": "0.19.0",
55
"description": "",
66
"main": "index.js",
77
"scripts": {

packages/docs/introduction/getting-started-with-vue.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ order: 20
1111
[![npm](https://img.shields.io/npm/v/vue-cheetah-grid.svg)](https://www.npmjs.com/package/vue-cheetah-grid)
1212

1313
```html
14-
<script src="https://unpkg.com/cheetah-grid@0.18"></script>
15-
<script src="https://unpkg.com/vue-cheetah-grid@0.18"></script>
14+
<script src="https://unpkg.com/cheetah-grid@0.19"></script>
15+
<script src="https://unpkg.com/vue-cheetah-grid@0.19"></script>
1616
```
1717

1818
```js

packages/docs/introduction/getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ order: 10
1111
[![npm](https://img.shields.io/npm/v/cheetah-grid.svg)](https://www.npmjs.com/package/cheetah-grid)
1212

1313
```html
14-
<script src="https://unpkg.com/cheetah-grid@0.18"></script>
14+
<script src="https://unpkg.com/cheetah-grid@0.19"></script>
1515
```
1616

1717
### Via npm
@@ -30,11 +30,11 @@ const cheetahGrid = require("cheetah-grid")
3030

3131
[![npm](https://img.shields.io/npm/v/cheetah-grid.svg)](https://www.npmjs.com/package/cheetah-grid)
3232

33-
[cheetahGrid.es5.min.js](https://unpkg.com/cheetah-grid@0.18/dist/cheetahGrid.es5.min.js)
33+
[cheetahGrid.es5.min.js](https://unpkg.com/cheetah-grid@0.19/dist/cheetahGrid.es5.min.js)
3434

3535
#### SourceMap
3636

37-
[cheetahGrid.es5.min.js.map](https://unpkg.com/cheetah-grid@0.18/dist/cheetahGrid.es5.min.js.map)
37+
[cheetahGrid.es5.min.js.map](https://unpkg.com/cheetah-grid@0.19/dist/cheetahGrid.es5.min.js.map)
3838

3939
### Via GitHub
4040

packages/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cheetah-grid-docs",
33
"private": true,
4-
"version": "0.18.0",
4+
"version": "0.19.0",
55
"scripts": {
66
"watch": "vuepress dev . --debug",
77
"build": "npm-run-all build:*",

packages/vue-cheetah-grid/lib/CGrid.vue

+6
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ export default {
296296
moveCellOnTabKey: {
297297
type: Boolean
298298
},
299+
/**
300+
* Specify `true` to disable column resizing
301+
*/
302+
disableColumnResize: {
303+
type: Boolean
304+
},
299305
/**
300306
* Defines a raw options for Cheetah Grid
301307
*/

packages/vue-cheetah-grid/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cheetah-grid",
3-
"version": "0.18.0",
3+
"version": "0.19.0",
44
"description": "Cheetah Grid for Vue.js",
55
"main": "dist/vueCheetahGrid.js",
66
"files": [

0 commit comments

Comments
 (0)