Skip to content

Commit fb0428e

Browse files
committed
V2
1 parent 4a7a3c3 commit fb0428e

17 files changed

+86
-126
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,47 @@ Inspired by **[jquery-resizable-columns](https://github.com/dobtco/jquery-resiza
55
[![npm version](https://img.shields.io/npm/v/@validide/resizable-table-columns)](https://www.npmjs.com/package/@validide/resizable-table-columns)
66

77
## Usage
8+
89
### Basic
10+
- Add the `resizable-table-columns.css` file to the page.
11+
- Add the `bundle/index.js` file to the page.
12+
- Optionally add a store library
13+
- Add the HTML table markup
14+
- Create a new instance of the resizable table like below
15+
16+
17+
``` html
18+
19+
<table class="data" data-rtc-resizable-table="table.one">
20+
<thead>
21+
<tr>
22+
<th>No.</th><!-- THIS COLUMN WILL NOT BE RESIZABLE -->
23+
<th data-rtc-resizable="name">Name</th>
24+
<th data-rtc-resizable="country">Counrty</th>
25+
<th data-rtc-resizable="region">Region</th>
26+
<th>City</th><!-- THIS COLUMN WILL NOT BE RESIZABLE -->
27+
<th data-rtc-resizable="street">Street</th>
28+
<th data-rtc-resizable="post-code">Post Code</th>
29+
<th data-rtc-resizable="last-update">Last updated</th>
30+
<th data-rtc-resizable="uuid">UUID</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr>
35+
<td>1</td>
36+
<td>Eugenia</td>
37+
<td>Serbia</td>
38+
<td>MN</td>
39+
<td>Minneapolis</td>
40+
<td>Ap #207-8285 Nibh Rd.</td>
41+
<td>41754</td>
42+
<td>2017-11-15T16:52:00-08:00</td>
43+
<td>E212DAC2-220E-9589-D96A-3B58242E9817</td>
44+
</tr>
45+
</tbody>
46+
</table>
47+
48+
```
949

1050
```js
1151
//will use the default options
@@ -16,6 +56,12 @@ new ResizableTableColumns(tableElement, {
1656
resizeFromBody: false,
1757
store: store
1858
});
59+
60+
// The store needs to implement the following interface
61+
interface IStore {
62+
get(id: string): any;
63+
set(id: string, data: any): void
64+
}
1965
```
2066

2167
### Default configuration options
@@ -42,7 +88,7 @@ var options = {
4288
```
4389

4490
## Supported Browsers
45-
IE 10 and above
91+
All modern browsers are supported. IE and older browsers might require polyfills for the library to work.
4692

4793
## Demos
4894
* [Demo](https://validide.github.io/resizable-table-columns/dist/samples/index.html)

dist/js/bundle/index.js

Lines changed: 0 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/bundle/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/bundle/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/es6/resizable-options.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
export interface IStore {
2+
get(id: string): any;
3+
set(id: string, data: any): void;
4+
}
15
export declare class ResizableOptions {
26
resizeFromBody: boolean;
37
minWidth: null | number;
48
maxWidth: null | number;
59
maxInitialWidthHint: null | number;
610
doubleClickDelay: number;
7-
store: any;
11+
store: IStore | null;
812
constructor(options?: null | object, element?: null | HTMLElement);
913
overrideValues(options?: null | object): void;
1014
overrideValuesFromElement(element?: null | HTMLElement): void;

dist/js/es6/resizable-options.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/es6/resizable-table-columns.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/es6/utilities.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export declare class Utilities {
88
static falseRegex: RegExp;
99
static onlyWhiteSpace: RegExp;
1010
static notEmptyOrWhiteSpace: RegExp;
11-
static escapeRegExp(str: string): string;
1211
static kebabCaseToCamelCase(str: string): string;
1312
static parseStringToType(str: string): any;
14-
static parseStyleDimension(dimension: string | number | undefined, returnOriginal: boolean): number | string | undefined;
1513
}

dist/js/es6/utilities.js

Lines changed: 0 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/es6/utilities.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)