├── .babelrc ├── .npmrc ├── .vscode └── settings.json ├── dist ├── js │ ├── es6 │ │ ├── utilities-dom.d.ts │ │ ├── index.d.ts │ │ ├── index.js.map │ │ ├── index.js │ │ ├── utilities.d.ts │ │ ├── resizable-event-data.d.ts │ │ ├── resizable-options.d.ts │ │ ├── resizable-event-data.js.map │ │ ├── resizable-constants.js.map │ │ ├── resizable-event-data.js │ │ ├── utilities.js.map │ │ ├── resizable-constants.d.ts │ │ ├── resizable-options.js.map │ │ ├── utilities-dom.js.map │ │ ├── utilities-dom.js │ │ ├── utilities.js │ │ ├── resizable-constants.js │ │ ├── resizable-options.js │ │ ├── resizable-table-columns.d.ts │ │ └── resizable-table-columns.js.map │ ├── index.es2015.d.ts │ └── bundle │ │ └── index.min.js ├── samples │ ├── site.css │ ├── store.js │ ├── index.html │ ├── bootstrap.html │ └── dev.html └── css │ ├── resizable-table-columns.min.css │ └── resizable-table-columns.css ├── sources ├── ts │ ├── index.ts │ ├── resizable-event-data.ts │ ├── utilities-dom.ts │ ├── utilities.ts │ ├── resizable-options.ts │ └── resizable-constants.ts └── scss │ └── resizable-table-columns.scss ├── rollup.config.mjs ├── .editorconfig ├── scripts ├── clean-dist.js └── minify-files.js ├── .mocharc.yaml ├── .github └── workflows │ ├── test.yml │ └── npmpublish.yml ├── .nycrc ├── LICENSE ├── .gitignore ├── tests ├── resizable-table-columns.dispose.ts ├── resizable-options.ts ├── utilities.js ├── utilities-dom.js ├── resizable-table-columns.ts └── resizable-table-columns.constructor.ts ├── package.json ├── README.md └── tsconfig.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env"] 3 | } 4 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | save-exact=true 2 | package-lock=true 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules\\typescript\\lib" 3 | } 4 | -------------------------------------------------------------------------------- /dist/js/es6/utilities-dom.d.ts: -------------------------------------------------------------------------------- 1 | export declare class UtilitiesDOM { 2 | static getDataAttributesValues(el: HTMLElement): object | null; 3 | } 4 | -------------------------------------------------------------------------------- /dist/js/es6/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './resizable-constants'; 2 | export * from './resizable-event-data'; 3 | export * from './resizable-options'; 4 | export * from './resizable-table-columns'; 5 | export * from './utilities-dom'; 6 | export * from './utilities'; 7 | -------------------------------------------------------------------------------- /sources/ts/index.ts: -------------------------------------------------------------------------------- 1 | export * from './resizable-constants'; 2 | export * from './resizable-event-data'; 3 | export * from './resizable-options'; 4 | export * from './resizable-table-columns'; 5 | export * from './utilities-dom'; 6 | export * from './utilities'; 7 | -------------------------------------------------------------------------------- /dist/js/es6/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../sources/ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"} -------------------------------------------------------------------------------- /dist/js/es6/index.js: -------------------------------------------------------------------------------- 1 | export * from './resizable-constants'; 2 | export * from './resizable-event-data'; 3 | export * from './resizable-options'; 4 | export * from './resizable-table-columns'; 5 | export * from './utilities-dom'; 6 | export * from './utilities'; 7 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /rollup.config.mjs: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | input: './dist/js/es6/index.js', 4 | context: 'window', 5 | output: { 6 | format: 'umd', 7 | name: 'validide_resizableTableColumns', 8 | dir: './dist/js/bundle/', 9 | sourcemap: true 10 | } 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | 14 | [/dist/**] 15 | charset = none 16 | end_of_line = none 17 | indent_size = none 18 | indent_style = none 19 | insert_final_newline = none 20 | trim_trailing_whitespace = none 21 | -------------------------------------------------------------------------------- /scripts/clean-dist.js: -------------------------------------------------------------------------------- 1 | const glob = require("glob"); 2 | const rimraf = require("rimraf"); 3 | 4 | const pathsToClean = [ 5 | "./dist/js", 6 | "./dist/css" 7 | ]; 8 | 9 | for(let i=0; i< pathsToClean.length; i++) { 10 | let matches = glob.sync(pathsToClean[i], []); 11 | for(let j=0; j < matches.length; j++) { 12 | rimraf.sync(matches[j]); 13 | } 14 | } 15 | 16 | // console.log("Done cleaning!"); 17 | -------------------------------------------------------------------------------- /.mocharc.yaml: -------------------------------------------------------------------------------- 1 | # https://mochajs.org/#command-line-usage 2 | # https://github.com/mochajs/mocha/tree/master/example/config 3 | 4 | extension: 5 | - ts 6 | recursive: true 7 | require: 8 | - ts-node/register # replace with ts-node/register/transpile-only if you have custom types 9 | - source-map-support/register 10 | bail: false 11 | color: true 12 | full-trace: false 13 | reporter: spec 14 | spec: tests/**/*.ts 15 | -------------------------------------------------------------------------------- /dist/samples/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol" 3 | } 4 | .text-center { 5 | text-align: center; 6 | } 7 | .content { 8 | max-width: 960px; 9 | margin: auto; 10 | } 11 | 12 | table.data { 13 | border-collapse: collapse; 14 | } 15 | 16 | table.data tr th, 17 | table.data tr td { 18 | border: 1px solid #ccc; 19 | } -------------------------------------------------------------------------------- /dist/js/es6/utilities.d.ts: -------------------------------------------------------------------------------- 1 | export interface IIndexedCollection { 2 | [name: string]: T; 3 | } 4 | export declare class Utilities { 5 | static regexEscapeRegex: RegExp; 6 | static kebabCaseRegex: RegExp; 7 | static trueRegex: RegExp; 8 | static falseRegex: RegExp; 9 | static onlyWhiteSpace: RegExp; 10 | static notEmptyOrWhiteSpace: RegExp; 11 | static kebabCaseToCamelCase(str: string): string; 12 | static parseStringToType(str: string): any; 13 | } 14 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-event-data.d.ts: -------------------------------------------------------------------------------- 1 | export declare class WidthsData { 2 | column: number; 3 | table: number; 4 | } 5 | export declare class PointerData { 6 | x: number | null; 7 | isDoubleClick: boolean; 8 | } 9 | export declare class ResizableEventData { 10 | column: HTMLTableCellElement; 11 | dragHandler: HTMLDivElement; 12 | pointer: PointerData; 13 | originalWidths: WidthsData; 14 | newWidths: WidthsData; 15 | constructor(column: HTMLTableCellElement, dragHandler: HTMLDivElement); 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | test: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v3 9 | - uses: actions/setup-node@v3 10 | with: 11 | node-version: 16 12 | - run: npm ci 13 | - run: npm run build 14 | - run: npm test 15 | 16 | # - uses: coverallsapp/github-action@master 17 | # with: 18 | # github-token: "${{ secrets.GITHUB_TOKEN }}" 19 | # path-to-lcov: "./coverage/lcov.info" 20 | -------------------------------------------------------------------------------- /.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@istanbuljs/nyc-config-typescript", 3 | "all": true, 4 | "extension": [ 5 | ".ts", 6 | ".tsx" 7 | ], 8 | "exclude": [ 9 | "**/*.d.ts", 10 | "tests/**/*.*", 11 | "dist/**/*.*", 12 | "scripts/**/*.*", 13 | "coverage/**/*.*", 14 | ".build/**/*.*", 15 | "docs/**/*.*", 16 | "rollup.config.js" 17 | ], 18 | "reporter": [ 19 | "text", 20 | "lcov", 21 | "html" 22 | ], 23 | "branches": 5, 24 | "lines": 5, 25 | "functions": 5, 26 | "statements": 5, 27 | "check-coverage": true 28 | } 29 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-options.d.ts: -------------------------------------------------------------------------------- 1 | export interface IStore { 2 | get(id: string): any; 3 | set(id: string, data: any): void; 4 | } 5 | export declare class ResizableOptions { 6 | resizeFromBody: boolean; 7 | minWidth: null | number; 8 | maxWidth: null | number; 9 | maxInitialWidthHint: null | number; 10 | doubleClickDelay: number; 11 | store: IStore | null; 12 | constructor(options?: null | object, element?: null | HTMLElement); 13 | overrideValues(options?: null | object): void; 14 | overrideValuesFromElement(element?: null | HTMLElement): void; 15 | } 16 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-event-data.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"resizable-event-data.js","sourceRoot":"","sources":["../../../sources/ts/resizable-event-data.ts"],"names":[],"mappings":"AAAA;IAAA;QACE,WAAM,GAAW,CAAC,CAAC;QACnB,UAAK,GAAW,CAAC,CAAC;IACpB,CAAC;IAAD,iBAAC;AAAD,CAAC,AAHD,IAGC;;AAED;IAAA;QACE,MAAC,GAAkB,IAAI,CAAC;QACxB,kBAAa,GAAY,KAAK,CAAC;IACjC,CAAC;IAAD,kBAAC;AAAD,CAAC,AAHD,IAGC;;AAED;IAOE,4BAAY,MAA4B,EAAE,WAA2B;QAJrE,YAAO,GAAgB,IAAI,WAAW,EAAE,CAAC;QACzC,mBAAc,GAAe,IAAI,UAAU,EAAE,CAAC;QAC9C,cAAS,GAAe,IAAI,UAAU,EAAE,CAAC;QAGrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IACH,yBAAC;AAAD,CAAC,AAXD,IAWC"} -------------------------------------------------------------------------------- /sources/ts/resizable-event-data.ts: -------------------------------------------------------------------------------- 1 | export class WidthsData { 2 | column: number = 0; 3 | table: number = 0; 4 | } 5 | 6 | export class PointerData { 7 | x: number | null = null; 8 | isDoubleClick: boolean = false; 9 | } 10 | 11 | export class ResizableEventData { 12 | column: HTMLTableCellElement; 13 | dragHandler: HTMLDivElement; 14 | pointer: PointerData = new PointerData(); 15 | originalWidths: WidthsData = new WidthsData(); 16 | newWidths: WidthsData = new WidthsData(); 17 | 18 | constructor(column: HTMLTableCellElement, dragHandler: HTMLDivElement) { 19 | this.column = column; 20 | this.dragHandler = dragHandler; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-constants.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"resizable-constants.js","sourceRoot":"","sources":["../../../sources/ts/resizable-constants.ts"],"names":[],"mappings":"AA6BA;IAAA;IA2BA,CAAC;IA1BQ,mCAAgB,GAAW,0BAA0B,CAAC;IACtD,0BAAO,GAAsB;QAClC,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,aAAa;QACtB,eAAe,EAAE,sBAAsB;QACvC,MAAM,EAAE,YAAY;QACpB,aAAa,EAAC,oBAAoB;QAClC,cAAc,EAAC,qBAAqB;KACrC,CAAC;IACK,6BAAU,GAAyB;QACxC,aAAa,EAAE,oBAAoB;QACnC,kBAAkB,EAAE,0BAA0B;KAC/C,CAAC;IACK,uBAAI,GAAmB;QAC5B,SAAS,EAAE,cAAc;QACzB,cAAc,EAAE,mBAAmB;KACpC,CAAC;IACK,yBAAM,GAAY;QACvB,WAAW,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;QACxC,WAAW,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;QACvC,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;QAClC,YAAY,EAAE,CAAC,QAAQ,CAAC;QACxB,gBAAgB,EAAE,sBAAsB;QACxC,WAAW,EAAE,iBAAiB;QAC9B,eAAe,EAAE,qBAAqB;KACvC,CAAA;IACH,yBAAC;CAAA,AA3BD,IA2BC;SA3BY,kBAAkB"} -------------------------------------------------------------------------------- /dist/js/es6/resizable-event-data.js: -------------------------------------------------------------------------------- 1 | var WidthsData = /** @class */ (function () { 2 | function WidthsData() { 3 | this.column = 0; 4 | this.table = 0; 5 | } 6 | return WidthsData; 7 | }()); 8 | export { WidthsData }; 9 | var PointerData = /** @class */ (function () { 10 | function PointerData() { 11 | this.x = null; 12 | this.isDoubleClick = false; 13 | } 14 | return PointerData; 15 | }()); 16 | export { PointerData }; 17 | var ResizableEventData = /** @class */ (function () { 18 | function ResizableEventData(column, dragHandler) { 19 | this.pointer = new PointerData(); 20 | this.originalWidths = new WidthsData(); 21 | this.newWidths = new WidthsData(); 22 | this.column = column; 23 | this.dragHandler = dragHandler; 24 | } 25 | return ResizableEventData; 26 | }()); 27 | export { ResizableEventData }; 28 | //# sourceMappingURL=resizable-event-data.js.map -------------------------------------------------------------------------------- /sources/ts/utilities-dom.ts: -------------------------------------------------------------------------------- 1 | import { IIndexedCollection, Utilities } from './utilities' 2 | 3 | export class UtilitiesDOM { 4 | static getDataAttributesValues(el: HTMLElement): object | null { 5 | if (!el) 6 | return null; 7 | 8 | const returnValue: IIndexedCollection = {}; 9 | if (el.dataset) { 10 | for (let prop in el.dataset) { 11 | if (el.dataset.hasOwnProperty(prop)) { 12 | returnValue[prop] = Utilities.parseStringToType(el.dataset[prop] || ''); 13 | } 14 | } 15 | } 16 | else { 17 | for (let i = 0; i < el.attributes.length; i++) { 18 | if (!/^data\-/.test(el.attributes[i].name)) 19 | continue; 20 | 21 | const name = Utilities.kebabCaseToCamelCase(el.attributes[i].name.replace('data-', '')); 22 | returnValue[name] = Utilities.parseStringToType(el.attributes[i].value); 23 | } 24 | } 25 | 26 | return returnValue; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scripts/minify-files.js: -------------------------------------------------------------------------------- 1 | const _fs = require('fs'); 2 | const _path = require('path'); 3 | const _glob = require('glob'); 4 | const _uglifycss = require('uglifycss'); 5 | const _uglifyJS = require("uglify-js"); 6 | 7 | 8 | function writeMinifiedFileSync(path, content, encding) { 9 | const file = _path.parse(path); 10 | const minifiedFilePath = _path.join(file.dir, `${file.name}.min${file.ext}`); 11 | // console.log(minifiedFilePath); 12 | _fs.writeFileSync(minifiedFilePath, content, encding); 13 | } 14 | 15 | 16 | _glob 17 | .sync('./dist/css/**/*.css', []) 18 | .forEach((f) => { 19 | writeMinifiedFileSync(f, _uglifycss.processFiles([f], {}), 'utf8'); 20 | // console.log(`Minified "${f}"`); 21 | }); 22 | 23 | 24 | _glob 25 | .sync('./dist/js/bundle/**/*.js', []) 26 | .forEach((f) => { 27 | writeMinifiedFileSync(f, _uglifyJS.minify(_fs.readFileSync(f, 'utf8'), {}).code, 'utf8'); 28 | // console.log(`Minified "${f}"`); 29 | }); 30 | -------------------------------------------------------------------------------- /dist/js/es6/utilities.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../sources/ts/utilities.ts"],"names":[],"mappings":"AAIA;IAAA;IA6BA,CAAC;IArBQ,8BAAoB,GAA3B,UAA4B,GAAW;QACrC,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC;IAEM,2BAAiB,GAAxB,UAAyB,GAAW;QAClC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;YACvD,OAAO,GAAG,CAAC;QAEb,IAAI,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YAC/B,OAAO,IAAI,CAAC;QAEd,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;YAChC,OAAO,KAAK,CAAC;QAEf,IAAI,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC5C,IAAM,IAAI,GAAG,CAAC,GAAG,CAAC;YAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;gBACd,OAAO,IAAI,CAAC;SACf;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IA3BM,0BAAgB,GAAW,qCAAqC,CAAC;IACjE,wBAAc,GAAW,SAAS,CAAC;IACnC,mBAAS,GAAW,SAAS,CAAC;IAC9B,oBAAU,GAAW,UAAU,CAAC;IAChC,wBAAc,GAAW,MAAM,CAAC;IAChC,8BAAoB,GAAW,IAAI,CAAC;IAuB7C,gBAAC;CAAA,AA7BD,IA6BC;SA7BY,SAAS"} -------------------------------------------------------------------------------- /dist/js/es6/resizable-constants.d.ts: -------------------------------------------------------------------------------- 1 | export interface IClassesConstants { 2 | table: string; 3 | wrapper: string; 4 | handleContainer: string; 5 | handle: string; 6 | tableResizing: string; 7 | columnResizing: string; 8 | } 9 | export interface IAttributesConstants { 10 | dataResizable: string; 11 | dataResizableTable: string; 12 | } 13 | export interface IDataConstants { 14 | resizable: string; 15 | resizableTable: string; 16 | } 17 | export interface IEvents { 18 | pointerDown: Array; 19 | pointerMove: Array; 20 | pointerUp: Array; 21 | windowResize: Array; 22 | eventResizeStart: string; 23 | eventResize: string; 24 | eventResizeStop: string; 25 | } 26 | export declare class ResizableConstants { 27 | static dataPropertyName: string; 28 | static classes: IClassesConstants; 29 | static attributes: IAttributesConstants; 30 | static data: IDataConstants; 31 | static events: IEvents; 32 | } 33 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-options.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"resizable-options.js","sourceRoot":"","sources":["../../../sources/ts/resizable-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAO/C;IAQE,0BAAY,OAA6B,EAAE,OAAkC;QAAjE,wBAAA,EAAA,cAA6B;QAAE,wBAAA,EAAA,cAAkC;QAC3E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAGD,yCAAc,GAAd,UAAe,OAA6B;QAA7B,wBAAA,EAAA,cAA6B;QAC1C,IAAI,CAAC,OAAO;YACV,OAAO;QAET,KAAK,IAAI,IAAI,IAAI,OAAO,EAAE;YACxB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;gBAC5B,IAAY,CAAC,IAAI,CAAC,GAAI,OAAe,CAAC,IAAI,CAAC,CAAC;aAC9C;SACF;IACH,CAAC;IAED,oDAAyB,GAAzB,UAA0B,OAAkC;QAAlC,wBAAA,EAAA,cAAkC;QAC1D,IAAI,CAAC,OAAO;YACV,OAAO;QAET,IAAM,cAAc,GAAG,YAAY,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACrE,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC;IACH,uBAAC;AAAD,CAAC,AAvCD,IAuCC"} -------------------------------------------------------------------------------- /dist/js/es6/utilities-dom.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utilities-dom.js","sourceRoot":"","sources":["../../../sources/ts/utilities-dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,SAAS,EAAE,MAAM,aAAa,CAAA;AAE3D;IAAA;IAyBA,CAAC;IAxBQ,oCAAuB,GAA9B,UAA+B,EAAe;QAC5C,IAAI,CAAC,EAAE;YACL,OAAO,IAAI,CAAC;QAEd,IAAM,WAAW,GAA4B,EAAE,CAAC;QAChD,IAAI,EAAE,CAAC,OAAO,EAAE;YACd,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;gBAC3B,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;oBACnC,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;iBACzE;aACF;SACF;aACI;YACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBACxC,SAAS;gBAEX,IAAM,MAAI,GAAG,SAAS,CAAC,oBAAoB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;gBACxF,WAAW,CAAC,MAAI,CAAC,GAAG,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aACzE;SACF;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IACH,mBAAC;AAAD,CAAC,AAzBD,IAyBC"} -------------------------------------------------------------------------------- /sources/ts/utilities.ts: -------------------------------------------------------------------------------- 1 | export interface IIndexedCollection { 2 | [name: string]: T; 3 | } 4 | 5 | export class Utilities { 6 | static regexEscapeRegex: RegExp = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g; 7 | static kebabCaseRegex: RegExp = /(\-\w)/g; 8 | static trueRegex: RegExp = /^true$/i; 9 | static falseRegex: RegExp = /^false$/i; 10 | static onlyWhiteSpace: RegExp = /^\s$/; 11 | static notEmptyOrWhiteSpace: RegExp = /\S/; 12 | 13 | static kebabCaseToCamelCase(str: string) { 14 | return str.replace(Utilities.kebabCaseRegex, function (m) { return m[1].toUpperCase(); }); 15 | } 16 | 17 | static parseStringToType(str: string): any { 18 | if (str.length == 0 || Utilities.onlyWhiteSpace.test(str)) 19 | return str; 20 | 21 | if (Utilities.trueRegex.test(str)) 22 | return true; 23 | 24 | if (Utilities.falseRegex.test(str)) 25 | return false; 26 | 27 | if (Utilities.notEmptyOrWhiteSpace.test(str)) { 28 | const temp = +str; 29 | if (!isNaN(temp)) 30 | return temp; 31 | } 32 | return str; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Valentin Dide 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | -------------------------------------------------------------------------------- /dist/js/es6/utilities-dom.js: -------------------------------------------------------------------------------- 1 | import { Utilities } from './utilities'; 2 | var UtilitiesDOM = /** @class */ (function () { 3 | function UtilitiesDOM() { 4 | } 5 | UtilitiesDOM.getDataAttributesValues = function (el) { 6 | if (!el) 7 | return null; 8 | var returnValue = {}; 9 | if (el.dataset) { 10 | for (var prop in el.dataset) { 11 | if (el.dataset.hasOwnProperty(prop)) { 12 | returnValue[prop] = Utilities.parseStringToType(el.dataset[prop] || ''); 13 | } 14 | } 15 | } 16 | else { 17 | for (var i = 0; i < el.attributes.length; i++) { 18 | if (!/^data\-/.test(el.attributes[i].name)) 19 | continue; 20 | var name_1 = Utilities.kebabCaseToCamelCase(el.attributes[i].name.replace('data-', '')); 21 | returnValue[name_1] = Utilities.parseStringToType(el.attributes[i].value); 22 | } 23 | } 24 | return returnValue; 25 | }; 26 | return UtilitiesDOM; 27 | }()); 28 | export { UtilitiesDOM }; 29 | //# sourceMappingURL=utilities-dom.js.map -------------------------------------------------------------------------------- /dist/js/es6/utilities.js: -------------------------------------------------------------------------------- 1 | var Utilities = /** @class */ (function () { 2 | function Utilities() { 3 | } 4 | Utilities.kebabCaseToCamelCase = function (str) { 5 | return str.replace(Utilities.kebabCaseRegex, function (m) { return m[1].toUpperCase(); }); 6 | }; 7 | Utilities.parseStringToType = function (str) { 8 | if (str.length == 0 || Utilities.onlyWhiteSpace.test(str)) 9 | return str; 10 | if (Utilities.trueRegex.test(str)) 11 | return true; 12 | if (Utilities.falseRegex.test(str)) 13 | return false; 14 | if (Utilities.notEmptyOrWhiteSpace.test(str)) { 15 | var temp = +str; 16 | if (!isNaN(temp)) 17 | return temp; 18 | } 19 | return str; 20 | }; 21 | Utilities.regexEscapeRegex = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g; 22 | Utilities.kebabCaseRegex = /(\-\w)/g; 23 | Utilities.trueRegex = /^true$/i; 24 | Utilities.falseRegex = /^false$/i; 25 | Utilities.onlyWhiteSpace = /^\s$/; 26 | Utilities.notEmptyOrWhiteSpace = /\S/; 27 | return Utilities; 28 | }()); 29 | export { Utilities }; 30 | //# sourceMappingURL=utilities.js.map -------------------------------------------------------------------------------- /dist/js/es6/resizable-constants.js: -------------------------------------------------------------------------------- 1 | var ResizableConstants = /** @class */ (function () { 2 | function ResizableConstants() { 3 | } 4 | ResizableConstants.dataPropertyName = 'validide_rtc_data_object'; 5 | ResizableConstants.classes = { 6 | table: 'rtc-table', 7 | wrapper: 'rtc-wrapper', 8 | handleContainer: 'rtc-handle-container', 9 | handle: 'rtc-handle', 10 | tableResizing: 'rtc-table-resizing', 11 | columnResizing: 'rtc-column-resizing', 12 | }; 13 | ResizableConstants.attributes = { 14 | dataResizable: 'data-rtc-resizable', 15 | dataResizableTable: 'data-rtc-resizable-table' 16 | }; 17 | ResizableConstants.data = { 18 | resizable: 'rtcResizable', 19 | resizableTable: 'rtcResizableTable' 20 | }; 21 | ResizableConstants.events = { 22 | pointerDown: ['mousedown', 'touchstart'], 23 | pointerMove: ['mousemove', 'touchmove'], 24 | pointerUp: ['mouseup', 'touchend'], 25 | windowResize: ['resize'], 26 | eventResizeStart: 'eventResizeStart.rtc', 27 | eventResize: 'eventResize.rtc', 28 | eventResizeStop: 'eventResizeStop.rtc' 29 | }; 30 | return ResizableConstants; 31 | }()); 32 | export { ResizableConstants }; 33 | //# sourceMappingURL=resizable-constants.js.map -------------------------------------------------------------------------------- /sources/ts/resizable-options.ts: -------------------------------------------------------------------------------- 1 | import { UtilitiesDOM } from './utilities-dom'; 2 | 3 | export interface IStore { 4 | get(id: string): any; 5 | set(id: string, data: any): void 6 | } 7 | 8 | export class ResizableOptions { 9 | resizeFromBody: boolean; 10 | minWidth: null | number; 11 | maxWidth: null | number; 12 | maxInitialWidthHint: null | number; 13 | doubleClickDelay: number; 14 | store: IStore | null; 15 | 16 | constructor(options: null | object = null, element: null | HTMLElement = null) { 17 | this.resizeFromBody = true; 18 | this.minWidth = 40; 19 | this.maxWidth = null; 20 | this.doubleClickDelay = 500; 21 | this.maxInitialWidthHint = null; 22 | this.store = null; 23 | 24 | this.overrideValues(options); 25 | this.overrideValuesFromElement(element); 26 | } 27 | 28 | 29 | overrideValues(options: null | object = null): void { 30 | if (!options) 31 | return; 32 | 33 | for (let prop in options) { 34 | if (this.hasOwnProperty(prop)) { 35 | (this as any)[prop] = (options as any)[prop]; 36 | } 37 | } 38 | } 39 | 40 | overrideValuesFromElement(element: null | HTMLElement = null): void { 41 | if (!element) 42 | return; 43 | 44 | const elementOptions = UtilitiesDOM.getDataAttributesValues(element); 45 | this.overrideValues(elementOptions) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-options.js: -------------------------------------------------------------------------------- 1 | import { UtilitiesDOM } from './utilities-dom'; 2 | var ResizableOptions = /** @class */ (function () { 3 | function ResizableOptions(options, element) { 4 | if (options === void 0) { options = null; } 5 | if (element === void 0) { element = null; } 6 | this.resizeFromBody = true; 7 | this.minWidth = 40; 8 | this.maxWidth = null; 9 | this.doubleClickDelay = 500; 10 | this.maxInitialWidthHint = null; 11 | this.store = null; 12 | this.overrideValues(options); 13 | this.overrideValuesFromElement(element); 14 | } 15 | ResizableOptions.prototype.overrideValues = function (options) { 16 | if (options === void 0) { options = null; } 17 | if (!options) 18 | return; 19 | for (var prop in options) { 20 | if (this.hasOwnProperty(prop)) { 21 | this[prop] = options[prop]; 22 | } 23 | } 24 | }; 25 | ResizableOptions.prototype.overrideValuesFromElement = function (element) { 26 | if (element === void 0) { element = null; } 27 | if (!element) 28 | return; 29 | var elementOptions = UtilitiesDOM.getDataAttributesValues(element); 30 | this.overrideValues(elementOptions); 31 | }; 32 | return ResizableOptions; 33 | }()); 34 | export { ResizableOptions }; 35 | //# sourceMappingURL=resizable-options.js.map -------------------------------------------------------------------------------- /dist/css/resizable-table-columns.min.css: -------------------------------------------------------------------------------- 1 | .rtc-hidden{display:none !important}.rtc-wrapper{position:relative;overflow-x:auto}.rtc-wrapper table.rtc-table{table-layout:fixed;border-collapse:collapse;white-space:nowrap;margin:0;width:auto}.rtc-wrapper table.rtc-table thead,.rtc-wrapper table.rtc-table tbody,.rtc-wrapper table.rtc-table tfoot{margin:0}.rtc-wrapper table.rtc-table thead tr,.rtc-wrapper table.rtc-table tbody tr,.rtc-wrapper table.rtc-table tfoot tr{margin:0}.rtc-wrapper table.rtc-table thead tr th,.rtc-wrapper table.rtc-table thead tr td,.rtc-wrapper table.rtc-table tbody tr th,.rtc-wrapper table.rtc-table tbody tr td,.rtc-wrapper table.rtc-table tfoot tr th,.rtc-wrapper table.rtc-table tfoot tr td{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rtc-wrapper table.rtc-table.rtc-table-resizing{cursor:col-resize}.rtc-wrapper table.rtc-table.rtc-table-resizing thead,.rtc-wrapper table.rtc-table.rtc-table-resizing thead>th,.rtc-wrapper table.rtc-table.rtc-table-resizing thead>th>a{cursor:col-resize}.rtc-wrapper table.rtc-table thead tr.invisible,.rtc-wrapper table.rtc-table thead tr.invisible th{border:0;margin:0;padding:0;height:0 !important}.rtc-wrapper .rtc-handle-container{position:relative;padding:0;margin:0;border:0}.rtc-wrapper .rtc-handle-container .rtc-handle{position:absolute;width:6.5px;margin-left:-3.575px;z-index:2;cursor:col-resize}.rtc-wrapper .rtc-handle-container .rtc-handle:last-of-type{width:4.5px;margin-left:-4.95px} -------------------------------------------------------------------------------- /sources/scss/resizable-table-columns.scss: -------------------------------------------------------------------------------- 1 | $cursorResize: col-resize; 2 | $handleWidth: 2.5px; 3 | $handleMargin: 2px; 4 | 5 | .rtc-hidden { 6 | display: none !important; 7 | } 8 | 9 | .rtc-wrapper { 10 | position: relative; 11 | overflow-x: auto; 12 | 13 | table.rtc-table { 14 | table-layout: fixed; 15 | border-collapse: collapse; 16 | white-space: nowrap; 17 | margin: 0; 18 | width: auto; 19 | 20 | thead, 21 | tbody, 22 | tfoot { 23 | margin: 0; 24 | 25 | tr { 26 | margin: 0; 27 | 28 | th, 29 | td { 30 | margin: 0; 31 | white-space: nowrap; 32 | overflow: hidden; 33 | text-overflow: ellipsis; 34 | } 35 | } 36 | } 37 | 38 | &.rtc-table-resizing { 39 | cursor: $cursorResize; 40 | 41 | thead, 42 | thead > th, 43 | thead > th > a { 44 | cursor: $cursorResize; 45 | } 46 | } 47 | 48 | thead tr.invisible, 49 | thead tr.invisible th { 50 | border: none; 51 | margin: 0; 52 | padding: 0; 53 | height: 0 !important; 54 | } 55 | } 56 | 57 | .rtc-handle-container { 58 | position: relative; 59 | padding: 0; 60 | margin: 0; 61 | border: 0; 62 | 63 | .rtc-handle { 64 | position: absolute; 65 | width: 2 * $handleMargin + $handleWidth; 66 | margin-left: -1.1 * ($handleMargin + $handleWidth/2); 67 | z-index: 2; 68 | cursor: $cursorResize; 69 | 70 | &:last-of-type { 71 | width: $handleMargin + $handleWidth; 72 | margin-left: -1.1 * ($handleMargin + $handleWidth); 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /sources/ts/resizable-constants.ts: -------------------------------------------------------------------------------- 1 | export interface IClassesConstants { 2 | table: string; 3 | wrapper: string; 4 | handleContainer: string; 5 | handle: string; 6 | tableResizing: string; 7 | columnResizing: string; 8 | } 9 | 10 | export interface IAttributesConstants { 11 | dataResizable: string; 12 | dataResizableTable: string; 13 | } 14 | 15 | export interface IDataConstants { 16 | resizable: string; 17 | resizableTable: string; 18 | } 19 | 20 | export interface IEvents { 21 | pointerDown: Array; 22 | pointerMove: Array; 23 | pointerUp: Array; 24 | windowResize: Array; 25 | eventResizeStart: string; 26 | eventResize: string; 27 | eventResizeStop: string; 28 | } 29 | 30 | export class ResizableConstants { 31 | static dataPropertyName: string = 'validide_rtc_data_object'; 32 | static classes: IClassesConstants = { 33 | table: 'rtc-table', 34 | wrapper: 'rtc-wrapper', 35 | handleContainer: 'rtc-handle-container', 36 | handle: 'rtc-handle', 37 | tableResizing:'rtc-table-resizing', 38 | columnResizing:'rtc-column-resizing', 39 | }; 40 | static attributes: IAttributesConstants = { 41 | dataResizable: 'data-rtc-resizable', 42 | dataResizableTable: 'data-rtc-resizable-table' 43 | }; 44 | static data: IDataConstants = { 45 | resizable: 'rtcResizable', 46 | resizableTable: 'rtcResizableTable' 47 | }; 48 | static events: IEvents = { 49 | pointerDown: ['mousedown', 'touchstart'], 50 | pointerMove: ['mousemove', 'touchmove'], 51 | pointerUp: ['mouseup', 'touchend'], 52 | windowResize: ['resize'], 53 | eventResizeStart: 'eventResizeStart.rtc', 54 | eventResize: 'eventResize.rtc', 55 | eventResizeStop: 'eventResizeStop.rtc' 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /dist/css/resizable-table-columns.css: -------------------------------------------------------------------------------- 1 | .rtc-hidden { 2 | display: none !important; 3 | } 4 | 5 | .rtc-wrapper { 6 | position: relative; 7 | overflow-x: auto; 8 | } 9 | 10 | .rtc-wrapper table.rtc-table { 11 | table-layout: fixed; 12 | border-collapse: collapse; 13 | white-space: nowrap; 14 | margin: 0; 15 | width: auto; 16 | } 17 | 18 | .rtc-wrapper table.rtc-table thead, 19 | .rtc-wrapper table.rtc-table tbody, 20 | .rtc-wrapper table.rtc-table tfoot { 21 | margin: 0; 22 | } 23 | 24 | .rtc-wrapper table.rtc-table thead tr, 25 | .rtc-wrapper table.rtc-table tbody tr, 26 | .rtc-wrapper table.rtc-table tfoot tr { 27 | margin: 0; 28 | } 29 | 30 | .rtc-wrapper table.rtc-table thead tr th, 31 | .rtc-wrapper table.rtc-table thead tr td, 32 | .rtc-wrapper table.rtc-table tbody tr th, 33 | .rtc-wrapper table.rtc-table tbody tr td, 34 | .rtc-wrapper table.rtc-table tfoot tr th, 35 | .rtc-wrapper table.rtc-table tfoot tr td { 36 | margin: 0; 37 | white-space: nowrap; 38 | overflow: hidden; 39 | text-overflow: ellipsis; 40 | } 41 | 42 | .rtc-wrapper table.rtc-table.rtc-table-resizing { 43 | cursor: col-resize; 44 | } 45 | 46 | .rtc-wrapper table.rtc-table.rtc-table-resizing thead, 47 | .rtc-wrapper table.rtc-table.rtc-table-resizing thead > th, 48 | .rtc-wrapper table.rtc-table.rtc-table-resizing thead > th > a { 49 | cursor: col-resize; 50 | } 51 | 52 | .rtc-wrapper table.rtc-table thead tr.invisible, 53 | .rtc-wrapper table.rtc-table thead tr.invisible th { 54 | border: none; 55 | margin: 0; 56 | padding: 0; 57 | height: 0 !important; 58 | } 59 | 60 | .rtc-wrapper .rtc-handle-container { 61 | position: relative; 62 | padding: 0; 63 | margin: 0; 64 | border: 0; 65 | } 66 | 67 | .rtc-wrapper .rtc-handle-container .rtc-handle { 68 | position: absolute; 69 | width: 6.5px; 70 | margin-left: -3.575px; 71 | z-index: 2; 72 | cursor: col-resize; 73 | } 74 | 75 | .rtc-wrapper .rtc-handle-container .rtc-handle:last-of-type { 76 | width: 4.5px; 77 | margin-left: -4.95px; 78 | } 79 | -------------------------------------------------------------------------------- /tests/resizable-table-columns.dispose.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | import { assert } from 'chai'; 6 | import { JSDOM } from 'jsdom'; 7 | import { ResizableConstants } from '../sources/ts/resizable-constants'; 8 | import { ResizableOptions } from '../sources/ts/resizable-options'; 9 | import { ResizableTableColumns } from '../sources/ts/resizable-table-columns'; 10 | 11 | describe('ResizableTableColumns', function () { 12 | describe('.dispose', function () { 13 | const DOM = new JSDOM(` 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
45 | 46 | `); 47 | 48 | it('Should dispose the object', function () { 49 | const el = DOM.window.document.getElementById('valid-table'); 50 | assert.isNotNull(el, 'Table element should be found in dom'); 51 | 52 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 53 | rtc.dispose(); 54 | 55 | assert.isObject(rtc); 56 | assert.isTrue(typeof (el as any)[ResizableConstants.dataPropertyName] === 'undefined'); 57 | }); 58 | }); 59 | }); 60 | -------------------------------------------------------------------------------- /.github/workflows/npmpublish.yml: -------------------------------------------------------------------------------- 1 | name: Node.js Package 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - uses: actions/setup-node@v3 13 | with: 14 | node-version: 16 15 | - run: npm ci 16 | - run: npm test 17 | 18 | publish-packages: 19 | needs: build 20 | runs-on: ubuntu-latest 21 | steps: 22 | 23 | # checkout the repo 24 | - uses: actions/checkout@v3 25 | - uses: actions/setup-node@v3 26 | with: 27 | node-version: 16 28 | registry-url: https://registry.npmjs.org/ 29 | - run: npm ci 30 | - run: npm run build 31 | 32 | # extract tag name 33 | - id: branch_name 34 | name: Get branch name 35 | run: | 36 | echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} 37 | echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} 38 | echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} 39 | # update version 40 | - id: update_version 41 | name: Update version 42 | run: | 43 | echo $SOURCE_NAME 44 | echo $SOURCE_BRANCH 45 | echo $SOURCE_TAG 46 | npm --no-git-tag-version version $SOURCE_TAG 47 | env: 48 | SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} 49 | SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} 50 | SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} 51 | 52 | # publish to NPMJS 53 | - uses: actions/setup-node@v3 54 | with: 55 | registry-url: https://registry.npmjs.org/ 56 | scope: '@validide' 57 | - run: | 58 | npm config set @validide:registry https://registry.npmjs.org/ 59 | npm publish --access public 60 | env: 61 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 62 | # publish to GitHub Pacakge Registry 63 | - uses: actions/setup-node@v3 64 | with: 65 | registry-url: https://npm.pkg.github.com/ 66 | scope: '@validide' 67 | - run: | 68 | npm config set @validide:registry https://npm.pkg.github.com/ 69 | npm publish --access public 70 | env: 71 | NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} 72 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-table-columns.d.ts: -------------------------------------------------------------------------------- 1 | import { ResizableEventData } from './resizable-event-data'; 2 | import { ResizableOptions } from './resizable-options'; 3 | interface IHeaderDetails { 4 | el: HTMLElement; 5 | detail: T; 6 | } 7 | export declare class ResizableTableColumns { 8 | static instancesCount: number; 9 | static windowResizeHandlerRef: null | ((event: Event) => void); 10 | table: HTMLTableElement; 11 | options: ResizableOptions; 12 | id: number; 13 | wrapper: HTMLDivElement | null; 14 | ownerDocument: Document; 15 | tableHeaders: HTMLTableHeaderCellElement[]; 16 | dragHandlesContainer: HTMLDivElement | null; 17 | originalWidths: IHeaderDetails[]; 18 | eventData: ResizableEventData | null; 19 | lastPointerDown: number; 20 | onPointerDownRef: any; 21 | onPointerMoveRef: any; 22 | onPointerUpRef: any; 23 | constructor(table: HTMLTableElement, options: ResizableOptions | null); 24 | init(): void; 25 | dispose(): void; 26 | validateMarkup(): void; 27 | wrapTable(): void; 28 | unwrapTable(): void; 29 | assignTableHeaders(): void; 30 | storeOriginalWidths(): void; 31 | restoreOriginalWidths(): void; 32 | setHeaderWidths(): void; 33 | constrainWidth(el: HTMLElement, width: number): number; 34 | createDragHandles(): void; 35 | destroyDragHandles(): void; 36 | getDragHandlers(): Array; 37 | restoreColumnWidths(): void; 38 | checkTableWidth(): void; 39 | syncHandleWidths(): void; 40 | getResizableHeaders(): HTMLTableCellElement[]; 41 | handlePointerDown(event: Event): void; 42 | handlePointerMove(event: Event): void; 43 | handlePointerUp(): void; 44 | handleDoubleClick(): void; 45 | attachHandlers(): void; 46 | detachHandlers(): void; 47 | refreshWrapperStyle(): void; 48 | saveColumnWidths(): void; 49 | createHandlerReferences(): void; 50 | registerWindowResizeHandler(): void; 51 | handleWindowResize(): void; 52 | updateWidth(cell: HTMLElement, suggestedWidth: number, skipConstrainCheck: boolean, skipTableResize: boolean): number; 53 | static onWindowResize(event: Event): void; 54 | static generateColumnId(el: HTMLElement): string; 55 | static generateTableId(table: HTMLTableElement): string; 56 | static setWidth(element: HTMLElement, width: number): void; 57 | static getInstanceId(): number; 58 | static debounce: any>(func: Function, wait: number, immediate: boolean) => (...args: Parameters) => ReturnType; 59 | static getPointerX(event: Event): number | null; 60 | static getTextWidth(contentElement: HTMLElement, measurementElement: HTMLElement): number; 61 | static getOffset(el: HTMLElement): { 62 | top: number; 63 | left: number; 64 | }; 65 | } 66 | export {}; 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@validide/resizable-table-columns", 3 | "version": "0.0.1", 4 | "description": "Simple Javascript resizable table columns", 5 | "main": "./dist/js/bundle/index.js", 6 | "module": "./dist/js/es6/index.js", 7 | "types": "./dist/js/index.es2015.d.ts", 8 | "exports": { 9 | ".": { 10 | "import": "./dist/js/es6/index.js", 11 | "require": "./dist/js/bundle/index.js" 12 | } 13 | }, 14 | "scripts": { 15 | "clean-dist": "node ./scripts/clean-dist.js", 16 | "minify-files": "node ./scripts/minify-files.js", 17 | "tsc": "tsc", 18 | "tsc:w": "tsc --module es2015 --target ES5 -w", 19 | "rollup:w": "rollup --config ./rollup.config.mjs --watch", 20 | "scss-base": " node-sass ./sources/scss --output-style expanded --precision 6 --output ./dist/css/", 21 | "scss-base:w": "node-sass ./sources/scss --output-style expanded --precision 6 --output ./dist/css/ --watch", 22 | "prebuild-dev": "npm run clean-dist", 23 | "build-dev": "npm run scss-base && npm run tsc", 24 | "dev": "concurrently --raw \"npm run scss-base:w\" \"npm run tsc:w\" \"npm run rollup:w\"", 25 | "post-css": "postcss --no-map --use autoprefixer --autoprefixer.browsers \"Chrome >= 45, Firefox >= 38, Edge >= 12, Explorer >= 10, iOS >= 9, Safari >= 9, Android >= 4.4, Opera >= 30\" --replace ./dist/css/*.css", 26 | "post-process-dist": "npm run post-css && npm run minify-files", 27 | "prebuild": "npm run clean-dist", 28 | "build": "npm run scss-base && tsc --module es2015 --target ES2015 --declaration --outFile ./dist/js/index.es2015.js --emitDeclarationOnly && tsc --module es2015 --target ES5 && rollup --config ./rollup.config.mjs && npm run post-process-dist", 29 | "test": "nyc mocha" 30 | }, 31 | "repository": { 32 | "type": "git", 33 | "url": "git+https://github.com/validide/resizable-table-columns.git" 34 | }, 35 | "keywords": [ 36 | "resizable", 37 | "table", 38 | "columns" 39 | ], 40 | "author": "Valentin Dide", 41 | "license": "MIT", 42 | "bugs": { 43 | "url": "https://github.com/validide/resizable-table-columns/issues" 44 | }, 45 | "homepage": "https://github.com/validide/resizable-table-columns#readme", 46 | "files": [ 47 | "dist", 48 | "sources" 49 | ], 50 | "devDependencies": { 51 | "@istanbuljs/nyc-config-typescript": "1.0.2", 52 | "@types/chai": "4.3.4", 53 | "@types/jsdom": "20.0.1", 54 | "@types/mocha": "10.0.1", 55 | "autoprefixer": "10.4.13", 56 | "babel-preset-env": "1.7.0", 57 | "babel-register": "6.26.0", 58 | "chai": "4.3.7", 59 | "concurrently": "7.6.0", 60 | "glob": "8.0.3", 61 | "jsdom": "21.0.0", 62 | "mocha": "10.8.2", 63 | "node-sass": "9.0.0", 64 | "nyc": "15.1.0", 65 | "postcss": "8.4.31", 66 | "postcss-cli": "10.1.0", 67 | "rimraf": "3.0.2", 68 | "rollup": "3.29.5", 69 | "ts-node": "10.9.1", 70 | "typescript": "4.9.4", 71 | "uglify-js": "3.17.4", 72 | "uglifycss": "0.0.29" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple JavaScript resizable table columns 2 | Inspired by **[jquery-resizable-columns](https://github.com/dobtco/jquery-resizable-columns)** 3 | ## Status 4 | 5 | At the moment the project is in "maintenance mode". I will not be investing any more time into developing new features of fixing any bugs. 6 | 7 | 8 | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/f963825a192e4c9a8fd148212fec5c13)](https://www.codacy.com/gh/validide/resizable-table-columns/dashboard?utm_source=github.com&utm_medium=referral&utm_content=validide/resizable-table-columns&utm_campaign=Badge_Grade) 9 | [![npm version](https://img.shields.io/npm/v/@validide/resizable-table-columns)](https://www.npmjs.com/package/@validide/resizable-table-columns) 10 | 11 | ## Usage 12 | 13 | ### Basic 14 | - Add the `resizable-table-columns.css` file to the page. 15 | - Add the `bundle/index.js` file to the page. 16 | - Optionally add a store library 17 | - Add the HTML table markup 18 | - Create a new instance of the resizable table like below 19 | 20 | 21 | ``` html 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817
51 | 52 | ``` 53 | 54 | ```js 55 | //will use the default options 56 | new ResizableTableColumns(tableElement, null); 57 | 58 | //override the default options 59 | new ResizableTableColumns(tableElement, { 60 | resizeFromBody: false, 61 | store: store 62 | }); 63 | 64 | // The store needs to implement the following interface 65 | interface IStore { 66 | get(id: string): any; 67 | set(id: string, data: any): void 68 | } 69 | ``` 70 | 71 | ### Default configuration options 72 | ```js 73 | var options = { 74 | // boolean - The resize handle will span the entire height of the table 75 | resizeFromBody: true, 76 | 77 | // null or number - The minimum width any column in the table should have 78 | minWidth: 40, 79 | 80 | // null or number - The maximum width any column in the table should have 81 | maxWidth: null, 82 | 83 | // number - The maximum number off milliseconds between to pointer down events to consider the action a 'double click' 84 | doubleClickDelay: 500, 85 | 86 | // data store provider (ex: https://github.com/marcuswestin/store.js) 87 | store: null, 88 | 89 | // null or number - The suggestion for how wide (in pixels) a cell might be in case the content is really wide. 90 | maxInitialWidthHint: null 91 | } 92 | ``` 93 | 94 | ## Supported Browsers 95 | All modern browsers are supported. IE and older browsers might require polyfills for the library to work. 96 | 97 | ## Demos 98 | * [Demo](https://validide.github.io/resizable-table-columns/dist/samples/index.html) 99 | * [Bootstrap Demo](https://validide.github.io/resizable-table-columns/dist/samples/bootstrap.html) 100 | -------------------------------------------------------------------------------- /tests/resizable-options.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | import { assert } from 'chai'; 6 | import { JSDOM } from 'jsdom'; 7 | import { ResizableOptions } from '../sources/ts/resizable-options'; 8 | 9 | describe('ResizableOptions', function () { 10 | const DOM = new JSDOM(` 11 | 12 | 13 | 14 |
19 | 20 | `); 21 | 22 | describe('.constructor', function () { 23 | it('No params', function () { 24 | const opts = new ResizableOptions(); 25 | assert.isObject(opts); 26 | assert.isNotNull(opts); 27 | }); 28 | 29 | it('With "options" argument', function () { 30 | const store = {}; 31 | const defaultOpts = new ResizableOptions(); 32 | defaultOpts.store = store as any; 33 | defaultOpts.maxWidth = Math.random(); 34 | 35 | const opts = new ResizableOptions(defaultOpts); 36 | 37 | assert.isObject(opts); 38 | assert.isNotNull(opts); 39 | assert.deepEqual(defaultOpts.store, opts.store); 40 | assert.deepEqual(defaultOpts.maxWidth, opts.maxWidth); 41 | }); 42 | 43 | it('With "element" argument', function () { 44 | const el = DOM.window.document.getElementById('the-table'); 45 | assert.isNotNull(el, 'Table element should be found in dom'); 46 | 47 | const opts = new ResizableOptions(null, el); 48 | 49 | assert.isObject(opts); 50 | assert.isNotNull(opts); 51 | assert.isTrue(opts.resizeFromBody); 52 | assert.isNumber(opts.maxWidth); 53 | assert.equal(opts.maxWidth, 213); 54 | 55 | }); 56 | 57 | it('With "options" and "element" arguments', function () { 58 | const store = {}; 59 | const defaultOpts = new ResizableOptions(); 60 | defaultOpts.store = store as any; 61 | defaultOpts.maxWidth = 2000; 62 | 63 | const el = DOM.window.document.getElementById('the-table'); 64 | assert.isNotNull(el, 'Table element should be found in dom'); 65 | 66 | const opts = new ResizableOptions(defaultOpts, el); 67 | 68 | assert.isObject(opts); 69 | assert.isNotNull(opts); 70 | assert.deepEqual(opts.store, opts.store); 71 | assert.isTrue(opts.resizeFromBody); 72 | assert.isNumber(opts.maxWidth); 73 | assert.equal(opts.maxWidth, 213); 74 | }); 75 | }); 76 | 77 | describe('.overrideValues', function () { 78 | it('Should not fail when called with no params', function () { 79 | const opts = new ResizableOptions(); 80 | opts.overrideValues(); 81 | assert.equal(opts.minWidth, opts.minWidth); 82 | }); 83 | 84 | it('Should not fail when called with null param', function () { 85 | const opts = new ResizableOptions(); 86 | opts.overrideValues(null); 87 | assert.equal(opts.minWidth, opts.minWidth); 88 | }); 89 | 90 | it('Should override values', function () { 91 | const opts = new ResizableOptions(); 92 | const obj = { minWidth: -10 }; 93 | opts.overrideValues(obj); 94 | assert.equal(obj.minWidth, opts.minWidth); 95 | }); 96 | }); 97 | 98 | describe('.overrideValuesFromElement', function () { 99 | it('Should not fail when called with no params', function () { 100 | const opts = new ResizableOptions(); 101 | opts.overrideValuesFromElement(); 102 | assert.equal(opts.minWidth, opts.minWidth); 103 | }); 104 | 105 | it('Should not fail when called with null param', function () { 106 | const opts = new ResizableOptions(); 107 | opts.overrideValuesFromElement(null); 108 | assert.equal(opts.minWidth, opts.minWidth); 109 | }); 110 | 111 | it('Should override values', function () { 112 | const opts = new ResizableOptions(); 113 | const el = DOM.window.document.getElementById('the-table'); 114 | assert.isNotNull(el, 'Table element should be found in dom'); 115 | 116 | opts.overrideValuesFromElement(el); 117 | assert.equal(opts.minWidth, -10); 118 | assert.isTrue(opts.resizeFromBody); 119 | assert.isNumber(opts.maxWidth); 120 | assert.equal(opts.maxWidth, 213); 121 | }); 122 | }); 123 | 124 | }); 125 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ 5 | "module": "commonjs", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 6 | // "lib": [], /* Specify library files to be included in the compilation: */ 7 | // "allowJs": true, /* Allow javascript files to be compiled. */ 8 | // "checkJs": true, /* Report errors in .js files. */ 9 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 10 | "declaration": true, /* Generates corresponding '.d.ts' file. */ 11 | "sourceMap": true, /* Generates corresponding '.map' file. */ 12 | // "outFile": "./", /* Concatenate and emit output to single file. */ 13 | "outDir": "./dist/js/es6/", /* Redirect output structure to the directory. */ 14 | "rootDir": "./sources/ts/", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 15 | "removeComments": false, /* Do not emit comments to output. */ 16 | // "noEmit": true, /* Do not emit outputs. */ 17 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 18 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 19 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 20 | /* Strict Type-Checking Options */ 21 | "strict": true, /* Enable all strict type-checking options. */ 22 | "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 23 | "strictNullChecks": true, /* Enable strict null checks. */ 24 | "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 25 | "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 26 | /* Additional Checks */ 27 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 28 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 29 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 30 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 31 | /* Module Resolution Options */ 32 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 33 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 34 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 35 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 36 | // "typeRoots": [], /* List of folders to include type definitions from. */ 37 | // "types": [], /* Type declaration files to be included in compilation. */ 38 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 39 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 40 | /* Source Map Options */ 41 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 42 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ 43 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 44 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 45 | /* Experimental Options */ 46 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 47 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 48 | }, 49 | "exclude": [ 50 | ".build", 51 | "coverage", 52 | "dist", 53 | "tests", 54 | "node_modules", 55 | "!node_modules/@types", 56 | "!node_modules/@types" 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /dist/js/index.es2015.d.ts: -------------------------------------------------------------------------------- 1 | declare module "resizable-constants" { 2 | export interface IClassesConstants { 3 | table: string; 4 | wrapper: string; 5 | handleContainer: string; 6 | handle: string; 7 | tableResizing: string; 8 | columnResizing: string; 9 | } 10 | export interface IAttributesConstants { 11 | dataResizable: string; 12 | dataResizableTable: string; 13 | } 14 | export interface IDataConstants { 15 | resizable: string; 16 | resizableTable: string; 17 | } 18 | export interface IEvents { 19 | pointerDown: Array; 20 | pointerMove: Array; 21 | pointerUp: Array; 22 | windowResize: Array; 23 | eventResizeStart: string; 24 | eventResize: string; 25 | eventResizeStop: string; 26 | } 27 | export class ResizableConstants { 28 | static dataPropertyName: string; 29 | static classes: IClassesConstants; 30 | static attributes: IAttributesConstants; 31 | static data: IDataConstants; 32 | static events: IEvents; 33 | } 34 | } 35 | declare module "resizable-event-data" { 36 | export class WidthsData { 37 | column: number; 38 | table: number; 39 | } 40 | export class PointerData { 41 | x: number | null; 42 | isDoubleClick: boolean; 43 | } 44 | export class ResizableEventData { 45 | column: HTMLTableCellElement; 46 | dragHandler: HTMLDivElement; 47 | pointer: PointerData; 48 | originalWidths: WidthsData; 49 | newWidths: WidthsData; 50 | constructor(column: HTMLTableCellElement, dragHandler: HTMLDivElement); 51 | } 52 | } 53 | declare module "utilities" { 54 | export interface IIndexedCollection { 55 | [name: string]: T; 56 | } 57 | export class Utilities { 58 | static regexEscapeRegex: RegExp; 59 | static kebabCaseRegex: RegExp; 60 | static trueRegex: RegExp; 61 | static falseRegex: RegExp; 62 | static onlyWhiteSpace: RegExp; 63 | static notEmptyOrWhiteSpace: RegExp; 64 | static kebabCaseToCamelCase(str: string): string; 65 | static parseStringToType(str: string): any; 66 | } 67 | } 68 | declare module "utilities-dom" { 69 | export class UtilitiesDOM { 70 | static getDataAttributesValues(el: HTMLElement): object | null; 71 | } 72 | } 73 | declare module "resizable-options" { 74 | export interface IStore { 75 | get(id: string): any; 76 | set(id: string, data: any): void; 77 | } 78 | export class ResizableOptions { 79 | resizeFromBody: boolean; 80 | minWidth: null | number; 81 | maxWidth: null | number; 82 | maxInitialWidthHint: null | number; 83 | doubleClickDelay: number; 84 | store: IStore | null; 85 | constructor(options?: null | object, element?: null | HTMLElement); 86 | overrideValues(options?: null | object): void; 87 | overrideValuesFromElement(element?: null | HTMLElement): void; 88 | } 89 | } 90 | declare module "resizable-table-columns" { 91 | import { ResizableEventData } from "resizable-event-data"; 92 | import { ResizableOptions } from "resizable-options"; 93 | interface IHeaderDetails { 94 | el: HTMLElement; 95 | detail: T; 96 | } 97 | export class ResizableTableColumns { 98 | static instancesCount: number; 99 | static windowResizeHandlerRef: null | ((event: Event) => void); 100 | table: HTMLTableElement; 101 | options: ResizableOptions; 102 | id: number; 103 | wrapper: HTMLDivElement | null; 104 | ownerDocument: Document; 105 | tableHeaders: HTMLTableHeaderCellElement[]; 106 | dragHandlesContainer: HTMLDivElement | null; 107 | originalWidths: IHeaderDetails[]; 108 | eventData: ResizableEventData | null; 109 | lastPointerDown: number; 110 | onPointerDownRef: any; 111 | onPointerMoveRef: any; 112 | onPointerUpRef: any; 113 | constructor(table: HTMLTableElement, options: ResizableOptions | null); 114 | init(): void; 115 | dispose(): void; 116 | validateMarkup(): void; 117 | wrapTable(): void; 118 | unwrapTable(): void; 119 | assignTableHeaders(): void; 120 | storeOriginalWidths(): void; 121 | restoreOriginalWidths(): void; 122 | setHeaderWidths(): void; 123 | constrainWidth(el: HTMLElement, width: number): number; 124 | createDragHandles(): void; 125 | destroyDragHandles(): void; 126 | getDragHandlers(): Array; 127 | restoreColumnWidths(): void; 128 | checkTableWidth(): void; 129 | syncHandleWidths(): void; 130 | getResizableHeaders(): HTMLTableCellElement[]; 131 | handlePointerDown(event: Event): void; 132 | handlePointerMove(event: Event): void; 133 | handlePointerUp(): void; 134 | handleDoubleClick(): void; 135 | attachHandlers(): void; 136 | detachHandlers(): void; 137 | refreshWrapperStyle(): void; 138 | saveColumnWidths(): void; 139 | createHandlerReferences(): void; 140 | registerWindowResizeHandler(): void; 141 | handleWindowResize(): void; 142 | updateWidth(cell: HTMLElement, suggestedWidth: number, skipConstrainCheck: boolean, skipTableResize: boolean): number; 143 | static onWindowResize(event: Event): void; 144 | static generateColumnId(el: HTMLElement): string; 145 | static generateTableId(table: HTMLTableElement): string; 146 | static setWidth(element: HTMLElement, width: number): void; 147 | static getInstanceId(): number; 148 | static debounce: any>(func: Function, wait: number, immediate: boolean) => (...args: Parameters) => ReturnType; 149 | static getPointerX(event: Event): number | null; 150 | static getTextWidth(contentElement: HTMLElement, measurementElement: HTMLElement): number; 151 | static getOffset(el: HTMLElement): { 152 | top: number; 153 | left: number; 154 | }; 155 | } 156 | } 157 | declare module "index" { 158 | export * from "resizable-constants"; 159 | export * from "resizable-event-data"; 160 | export * from "resizable-options"; 161 | export * from "resizable-table-columns"; 162 | export * from "utilities-dom"; 163 | export * from "utilities"; 164 | } 165 | -------------------------------------------------------------------------------- /dist/samples/store.js: -------------------------------------------------------------------------------- 1 | /* FROM: https://raw.githubusercontent.com/marcuswestin/store.js/master/dist/store.modern.min.js */ 2 | /* store.js - Copyright (c) 2010-2017 Marcus Westin */ 3 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.store=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[a]={exports:{}};t[a][0].call(f.exports,function(e){var n=t[a][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0;n--)if(l(t[n])){var r=t[n].split("="),o=unescape(r[0]),i=unescape(r[1]);e(i,o)}}function i(e,t){e&&(p.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function a(e){e&&s(e)&&(p.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(){o(function(e,t){a(t)})}function s(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(p.cookie)}var c=e("../src/util"),f=c.Global,l=c.trim;t.exports={name:"cookieStorage",read:r,write:i,each:o,remove:a,clearAll:u};var p=f.document},{"../src/util":3}],5:[function(e,t,n){"use strict";function r(){return f.localStorage}function o(e){return r().getItem(e)}function i(e,t){return r().setItem(e,t)}function a(e){for(var t=r().length-1;t>=0;t--){var n=r().key(t);e(o(n),n)}}function u(e){return r().removeItem(e)}function s(){return r().clear()}var c=e("../src/util"),f=c.Global;t.exports={name:"localStorage",read:o,write:i,each:a,remove:u,clearAll:s}},{"../src/util":3}],6:[function(e,t,n){"use strict";function r(e){return s[e]}function o(e,t){s[e]=t}function i(e){for(var t in s)s.hasOwnProperty(t)&&e(s[t],t)}function a(e){delete s[e]}function u(e){s={}}t.exports={name:"memoryStorage",read:r,write:o,each:i,remove:a,clearAll:u};var s={}},{}],7:[function(e,t,n){"use strict";function r(){return f.sessionStorage}function o(e){return r().getItem(e)}function i(e,t){return r().setItem(e,t)}function a(e){for(var t=r().length-1;t>=0;t--){var n=r().key(t);e(o(n),n)}}function u(e){return r().removeItem(e)}function s(){return r().clear()}var c=e("../src/util"),f=c.Global;t.exports={name:"sessionStorage",read:o,write:i,each:a,remove:u,clearAll:s}},{"../src/util":3}]},{},[1])(1)}); -------------------------------------------------------------------------------- /tests/utilities.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | import { assert } from 'chai'; 5 | import Utilities from '../dist/js/es6/utilities'; 6 | 7 | describe('Utilities', function () { 8 | describe('.escapeRegExp', function () { 9 | it('Should not change "randomText"', function () { 10 | assert.equal(Utilities.escapeRegExp('randomText'), 'randomText'); 11 | }); 12 | 13 | it('Should change "random-text\\" to "random\\-text\\\\"', function () { 14 | assert.equal(Utilities.escapeRegExp('random-text\\'), 'random\\-text\\\\'); 15 | }); 16 | 17 | it('Should change "random.text" to "random\\.text"', function () { 18 | assert.equal(Utilities.escapeRegExp('random.text'), 'random\\.text'); 19 | }); 20 | }); 21 | 22 | describe('.kebabCaseToCamelCase', function () { 23 | it('Should change "kebab-case" to "kebabCase"', function () { 24 | assert.equal(Utilities.kebabCaseToCamelCase('kebab-case'), 'kebabCase'); 25 | }); 26 | }); 27 | 28 | describe('.parseStringToType', function () { 29 | it('Should be string for empty', function () { 30 | const tesString = ''; 31 | const result = Utilities.parseStringToType(tesString); 32 | assert.isString(result); 33 | assert.equal(result, result); 34 | }); 35 | 36 | it('Should be string for whitespace', function () { 37 | const tesString = ' \n\r\t'; 38 | const result = Utilities.parseStringToType(tesString); 39 | assert.isString(result); 40 | assert.equal(result, tesString); 41 | }); 42 | 43 | it('Should be string', function () { 44 | const tesString = 'some test 12 .34 \r \t \n some more'; 45 | const result = Utilities.parseStringToType(tesString); 46 | assert.isString(result); 47 | assert.equal(result, tesString); 48 | }); 49 | 50 | it('Should be string for "10px"', function () { 51 | const tesString = '10px'; 52 | const result = Utilities.parseStringToType(tesString); 53 | assert.isString(result); 54 | assert.equal(result, tesString); 55 | }); 56 | 57 | it('Should be string for "1.2.3"', function () { 58 | const tesString = '1.2.3'; 59 | const result = Utilities.parseStringToType(tesString); 60 | assert.isString(result); 61 | assert.equal(result, tesString); 62 | }); 63 | 64 | it('Should be string for "10e"', function () { 65 | const tesString = '10e'; 66 | const result = Utilities.parseStringToType(tesString); 67 | assert.isString(result); 68 | assert.equal(result, tesString); 69 | }); 70 | 71 | it('Should be boolen "true"', function () { 72 | const result = Utilities.parseStringToType('tRue'); 73 | assert.isBoolean(result); 74 | assert.isTrue(result); 75 | }); 76 | 77 | it('Should be boolen "false"', function () { 78 | const result = Utilities.parseStringToType('FaLsE'); 79 | assert.isBoolean(result); 80 | assert.isFalse(result); 81 | }); 82 | 83 | it('Should be number "-1"', function () { 84 | const result = Utilities.parseStringToType('-1'); 85 | assert.isNumber(result); 86 | assert.equal(result, -1); 87 | }); 88 | 89 | it('Should be number "1"', function () { 90 | const result = Utilities.parseStringToType('1'); 91 | assert.isNumber(result); 92 | assert.equal(result, 1); 93 | }); 94 | 95 | it('Should be number ".1"', function () { 96 | const result = Utilities.parseStringToType('.1'); 97 | assert.isNumber(result); 98 | assert.equal(result, 0.1); 99 | }); 100 | 101 | it('Should be number "-.1"', function () { 102 | const result = Utilities.parseStringToType('-.1'); 103 | assert.isNumber(result); 104 | assert.equal(result, -0.1); 105 | }); 106 | 107 | it('Should be number "0.1"', function () { 108 | const result = Utilities.parseStringToType('0.1'); 109 | assert.isNumber(result); 110 | assert.equal(result, 0.1); 111 | }); 112 | 113 | it('Should be number "-0.1"', function () { 114 | const result = Utilities.parseStringToType('-0.1'); 115 | assert.isNumber(result); 116 | assert.equal(result, -0.1); 117 | }); 118 | 119 | it('Should be number "1e+30"', function () { 120 | const result = Utilities.parseStringToType('1e+30'); 121 | assert.isNumber(result); 122 | assert.equal(result, 1e+30); 123 | }); 124 | 125 | it('Should be number "Infinity"', function () { 126 | const result = Utilities.parseStringToType('Infinity'); 127 | assert.isNumber(result); 128 | assert.equal(result, Infinity); 129 | }); 130 | 131 | it('Should be number "-Infinity"', function () { 132 | const result = Utilities.parseStringToType('-Infinity'); 133 | assert.isNumber(result); 134 | assert.equal(result, -Infinity); 135 | }); 136 | }); 137 | 138 | describe('.parseStyleDimension', function () { 139 | it('Should parse "12"(string) to 12(number)', function () { 140 | assert.equal(Utilities.parseStyleDimension('12', false), 12); 141 | }); 142 | 143 | it('Should parse "12px"(string) to 12(number)', function () { 144 | assert.equal(Utilities.parseStyleDimension('12px', false), 12); 145 | }); 146 | 147 | it('Should parse 12(number) to 12(number)', function () { 148 | assert.equal(Utilities.parseStyleDimension(12, false), 12); 149 | }); 150 | 151 | it('Should parse "13.12"(string) to 13.12(number)', function () { 152 | assert.equal(Utilities.parseStyleDimension('13.12', false), 13.12); 153 | }); 154 | 155 | it('Should parse "13.12px"(string) to 13.12(number)', function () { 156 | assert.equal(Utilities.parseStyleDimension('13.12px', false), 13.12); 157 | }); 158 | 159 | it('Should parse 13.12(number) to 13.12(number)', function () { 160 | assert.equal(Utilities.parseStyleDimension(13.12, false), 13.12); 161 | }); 162 | 163 | it('Should parse "13,12"(string) to 13.12(number)', function () { 164 | assert.equal(Utilities.parseStyleDimension('13,12', false), 13.12); 165 | }); 166 | 167 | it('Should parse "13,12px"(string) to 13.12(number)', function () { 168 | assert.equal(Utilities.parseStyleDimension('13,12px', false), 13.12); 169 | }); 170 | 171 | it('Should parse ""(empty string) to 0(number)', function () { 172 | assert.equal(Utilities.parseStyleDimension('', false), 0); 173 | }); 174 | 175 | it('Should parse "undefined" to 0(number)', function () { 176 | assert.equal(Utilities.parseStyleDimension(void (0), false), 0); 177 | }); 178 | 179 | it('Should parse "null" to 0(number)', function () { 180 | assert.equal(Utilities.parseStyleDimension(null, false), 0); 181 | }); 182 | 183 | it('Should parse {}(object) to 0(number)', function () { 184 | assert.equal(Utilities.parseStyleDimension({}, false), 0); 185 | }); 186 | 187 | it('Should parse "12em"(string) to 12(number)', function () { 188 | assert.equal(Utilities.parseStyleDimension('12em', true), 12); 189 | }); 190 | 191 | it('Should parse ""(empty string) to ""(empty string)', function () { 192 | const toParse = ''; 193 | assert.equal(Utilities.parseStyleDimension(toParse, true), toParse); 194 | }); 195 | 196 | it('Should parse "undefined" to "undefined"', function () { 197 | assert.equal(Utilities.parseStyleDimension(void (0), true), void (0)); 198 | }); 199 | 200 | it('Should parse "null" to "null"', function () { 201 | assert.equal(Utilities.parseStyleDimension(null, true), null); 202 | }); 203 | 204 | it('Should parse {}(object) to {}(object)', function () { 205 | var obj = {}; 206 | assert.deepEqual(Utilities.parseStyleDimension(obj, true), obj); 207 | }); 208 | }); 209 | 210 | 211 | }); 212 | -------------------------------------------------------------------------------- /tests/utilities-dom.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | import { assert } from 'chai'; 6 | import { JSDOM } from '../node_modules/jsdom/lib/api'; 7 | import UtilitiesDOM from '../dist/js/es6/utilities-dom'; 8 | 9 | describe('UtilitiesDOM', function () { 10 | const DOM = new JSDOM(``); 11 | const testClass = 'test-class'; 12 | const otherTestClass = 'other-test-class'; 13 | 14 | describe('.hasClass', function () { 15 | it('Should be true', function () { 16 | const el = DOM.window.document.createElement('span'); 17 | el.className = testClass; 18 | assert.equal(UtilitiesDOM.hasClass(el, testClass), true); 19 | }); 20 | 21 | it('Should be false', function () { 22 | const el = DOM.window.document.createElement('span'); 23 | el.className = testClass; 24 | assert.equal(UtilitiesDOM.hasClass(el, otherTestClass), false); 25 | }); 26 | }); 27 | 28 | describe('.addClass', function () { 29 | it('Add class', function () { 30 | const el = DOM.window.document.createElement('span'); 31 | UtilitiesDOM.addClass(el, testClass); 32 | assert.equal(el.className, testClass); 33 | assert.equal(UtilitiesDOM.hasClass(el, testClass), true); 34 | }); 35 | 36 | it('Do not add class twice', function () { 37 | const el = DOM.window.document.createElement('span'); 38 | el.className = testClass; 39 | UtilitiesDOM.addClass(el, testClass); 40 | assert.equal(el.className, testClass); 41 | assert.equal(UtilitiesDOM.hasClass(el, testClass), true); 42 | }); 43 | 44 | it('Do not alter exiting class', function () { 45 | const el = DOM.window.document.createElement('span'); 46 | el.className = otherTestClass; 47 | UtilitiesDOM.addClass(el, testClass); 48 | assert.equal(el.className, `${otherTestClass} ${testClass}`); 49 | assert.equal(UtilitiesDOM.hasClass(el, testClass), true); 50 | assert.equal(UtilitiesDOM.hasClass(el, otherTestClass), true); 51 | }); 52 | }); 53 | 54 | describe('.removeClass', function () { 55 | it('Do not fail if missing', function () { 56 | const el = DOM.window.document.createElement('span'); 57 | UtilitiesDOM.removeClass(el, testClass); 58 | assert.equal(el.className, ''); 59 | assert.equal(UtilitiesDOM.hasClass(el, testClass), false); 60 | }); 61 | 62 | it('Remove class', function () { 63 | const el = DOM.window.document.createElement('span'); 64 | el.className = testClass; 65 | UtilitiesDOM.removeClass(el, testClass); 66 | assert.equal(el.className, ''); 67 | assert.equal(UtilitiesDOM.hasClass(el, testClass), false); 68 | }); 69 | 70 | it('Remove class if multiple', function () { 71 | const el = DOM.window.document.createElement('span'); 72 | el.className = `${testClass} ${testClass} ${testClass}`; 73 | UtilitiesDOM.removeClass(el, testClass); 74 | assert.equal(el.className, ''); 75 | assert.equal(UtilitiesDOM.hasClass(el, testClass), false); 76 | }); 77 | 78 | it('Do not alter exiting class', function () { 79 | const el = DOM.window.document.createElement('span'); 80 | el.className = otherTestClass; 81 | UtilitiesDOM.removeClass(el, testClass); 82 | assert.equal(el.className, otherTestClass); 83 | assert.equal(UtilitiesDOM.hasClass(el, testClass), false); 84 | assert.equal(UtilitiesDOM.hasClass(el, otherTestClass), true); 85 | }); 86 | }); 87 | 88 | describe('.getDataAttributesValues', function () { 89 | it('Should be "null" if not element is provided', function () { 90 | const dataValues = UtilitiesDOM.getDataAttributesValues(); 91 | assert.equal(dataValues, null); 92 | }); 93 | 94 | it('Should be true', function () { 95 | const dataValues = UtilitiesDOM.getDataAttributesValues(DOM.window.document.body); 96 | 97 | assert.equal(dataValues.hasOwnProperty('testValueOne'), true); 98 | assert.equal(dataValues.hasOwnProperty('testValueTwo'), true); 99 | assert.equal(dataValues.hasOwnProperty('testValueMissing'), false); 100 | assert.equal(dataValues['testValueOne'], 'one'); 101 | assert.equal(dataValues['testValueTwo'], 'two'); 102 | }); 103 | }); 104 | 105 | describe('.getMinCssWidth', function () { 106 | it('Should be null', function () { 107 | const el = DOM.window.document.createElement('span'); 108 | assert.equal(UtilitiesDOM.getMinCssWidth(el), null); 109 | }); 110 | 111 | it('Should be null 2', function () { 112 | const el = DOM.window.document.createElement('span'); 113 | el.style.minWidth = 'random.px' 114 | assert.equal(UtilitiesDOM.getMinCssWidth(el), null); 115 | }); 116 | 117 | it('Should be 13.25', function () { 118 | const el = DOM.window.document.createElement('span'); 119 | el.style.minWidth = '13.25' 120 | assert.equal(UtilitiesDOM.getMinCssWidth(el), 13.25); 121 | }); 122 | 123 | it('Should be 25.15', function () { 124 | const el = DOM.window.document.createElement('span'); 125 | el.style.minWidth = '25.15px' 126 | assert.equal(UtilitiesDOM.getMinCssWidth(el), 25.15); 127 | }); 128 | }); 129 | 130 | describe('.getMaxCssWidth', function () { 131 | it('Should be null', function () { 132 | const el = DOM.window.document.createElement('span'); 133 | assert.equal(UtilitiesDOM.getMaxCssWidth(el), null); 134 | }); 135 | 136 | it('Should be null 2', function () { 137 | const el = DOM.window.document.createElement('span'); 138 | el.style.maxWidth = 'random.px' 139 | assert.equal(UtilitiesDOM.getMaxCssWidth(el), null); 140 | }); 141 | 142 | it('Should be 13.25', function () { 143 | const el = DOM.window.document.createElement('span'); 144 | el.style.maxWidth = '13.25' 145 | assert.equal(UtilitiesDOM.getMaxCssWidth(el), 13.25); 146 | }); 147 | 148 | it('Should be 25.15', function () { 149 | const el = DOM.window.document.createElement('span'); 150 | el.style.maxWidth = '25.15px' 151 | assert.equal(UtilitiesDOM.getMaxCssWidth(el), 25.15); 152 | }); 153 | }); 154 | 155 | describe('.getOffset', function () { 156 | it('Should be null', function () { 157 | assert.equal(UtilitiesDOM.getOffset(null), null); 158 | }); 159 | }); 160 | 161 | describe('.matches', function () { 162 | it('Should be true', function () { 163 | const body = DOM.window.document.body; 164 | assert.equal(UtilitiesDOM.matches(body, '[data-test-value-one="one"]'), true); 165 | }); 166 | it('Should be true', function () { 167 | const body = DOM.window.document.body; 168 | assert.equal(UtilitiesDOM.matches(body, '[data-test-value-one]'), true); 169 | }); 170 | it('Should be true', function () { 171 | const body = DOM.window.document.body; 172 | assert.equal(UtilitiesDOM.matches(body, '.matches-test'), true); 173 | }); 174 | it('Should be false', function () { 175 | const body = DOM.window.document.body; 176 | assert.equal(UtilitiesDOM.matches(body, '.not-matches-test'), false); 177 | }); 178 | it('Should be false', function () { 179 | const body = DOM.window.document.body; 180 | assert.equal(UtilitiesDOM.matches(body, '[data-test-value-one="not-one"]'), false); 181 | }); 182 | }); 183 | 184 | describe('.closest', function () { 185 | it('Should be the same element', function () { 186 | const el = DOM.window.document.getElementById('closest-test'); 187 | assert.isNotNull(el, 'Element should be found in dom'); 188 | const closest = UtilitiesDOM.closest(el, '.closest-test-class'); 189 | assert.equal(closest, el); 190 | }); 191 | it('Should be the body element', function () { 192 | const el = DOM.window.document.getElementById('closest-test'); 193 | assert.isNotNull(el, 'Element should be found in dom'); 194 | const body = DOM.window.document.body; 195 | const closest = UtilitiesDOM.closest(el, '[data-test-value-one="one"]'); 196 | assert.equal(closest, body); 197 | }); 198 | it('Should be the body element', function () { 199 | const el = DOM.window.document.getElementById('closest-test'); 200 | assert.isNotNull(el, 'Element should be found in dom'); 201 | const body = DOM.window.document.body; 202 | const closest = UtilitiesDOM.closest(el, '[data-test-value-one]'); 203 | assert.equal(closest, body); 204 | }); 205 | it('Should be the body element', function () { 206 | const el = DOM.window.document.getElementById('closest-test'); 207 | assert.isNotNull(el, 'Element should be found in dom'); 208 | const body = DOM.window.document.body; 209 | const closest = UtilitiesDOM.closest(el, '.matches-test'); 210 | assert.equal(closest, body); 211 | }); 212 | it('Should be null', function () { 213 | const el = DOM.window.document.getElementById('closest-test'); 214 | assert.isNotNull(el, 'Element should be found in dom'); 215 | const closest = UtilitiesDOM.closest(el, '.not-matches-test'); 216 | assert.equal(closest, null); 217 | }); 218 | it('Should be null', function () { 219 | const el = DOM.window.document.getElementById('closest-test'); 220 | assert.isNotNull(el, 'Element should be found in dom'); 221 | const closest = UtilitiesDOM.closest(el, '[data-test-value-one="not-one"]'); 222 | assert.equal(closest, null); 223 | }); 224 | }); 225 | 226 | }); 227 | -------------------------------------------------------------------------------- /tests/resizable-table-columns.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | import { assert } from 'chai'; 6 | import { JSDOM } from 'jsdom'; 7 | import { ResizableConstants } from '../sources/ts/resizable-constants'; 8 | import { ResizableOptions } from '../sources/ts/resizable-options'; 9 | import { ResizableTableColumns } from '../sources/ts/resizable-table-columns'; 10 | import { UtilitiesDOM } from '../sources/ts/utilities-dom'; 11 | 12 | describe('ResizableTableColumns', function () { 13 | const DOM = new JSDOM(` 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
45 | 46 | `); 47 | 48 | const dynamicTable = ` 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
`; 87 | 88 | const el = DOM.window.document.getElementById('valid-table') as HTMLTableElement; 89 | const rtc = new ResizableTableColumns(el, null); 90 | 91 | describe('Constructor calls', function () { 92 | 93 | let container: HTMLElement, el: HTMLTableElement, rtc: ResizableTableColumns; 94 | before(function () { 95 | container = DOM.window.document.createElement('div'); 96 | container.innerHTML = dynamicTable; 97 | 98 | DOM.window.document.body.appendChild(container); 99 | const overriders = new ResizableOptions(); 100 | overriders.minWidth = 130; 101 | overriders.maxWidth = 170; 102 | el = container.querySelector('table') as HTMLTableElement; 103 | rtc = new ResizableTableColumns(el, overriders); 104 | }); 105 | 106 | after(function () { 107 | rtc.dispose(); 108 | DOM.window.document.body.removeChild(container); 109 | }); 110 | 111 | it('Should ".wrapTable()"', function () { 112 | const wrapper = el.parentNode as HTMLElement; 113 | assert.isNotNull(wrapper, 'Table wrapper is missing.'); 114 | assert.equal(wrapper.nodeName, 'DIV', 'Table wrapper is not a DIV.'); 115 | assert.isTrue(wrapper.classList.contains('rtc-wrapper'), 'Table wrapper does not have the required class.'); 116 | assert.isTrue(el.classList.contains('rtc-table'), 'Table does not have the required class.'); 117 | }); 118 | 119 | it('Should ".asignTableHeaders()"', function () { 120 | assert.isNotNull(rtc.tableHeaders, '"tableHeaders" is null.'); 121 | assert.equal(rtc.tableHeaders.length, 9, '"tableHeaders" count mismatch.'); 122 | for (let index = 0; index < rtc.tableHeaders.length; index++) { 123 | let th = rtc.tableHeaders[index]; 124 | assert.equal(th.id, `th${index + 1}`, 'Header order mismatch.'); 125 | } 126 | }); 127 | 128 | it('Should ".storeOriginalWidths()"', function () { 129 | assert.isNotNull(rtc.originalWidths, '"originalWidths" is null.'); 130 | assert.equal(rtc.originalWidths[rtc.originalWidths.length - 1].detail, '7000px'); 131 | 132 | for (let index = 0; index < rtc.tableHeaders.length - 1; index++) { 133 | const th = rtc.tableHeaders[index]; 134 | assert.equal(rtc.originalWidths[index].detail, (100 + ((index + 1) * 10)) + 'px'); 135 | } 136 | }); 137 | 138 | it('Should ".setHeaderWidths()"', function () { 139 | for (let index = 0; index < rtc.tableHeaders.length; index++) { 140 | const th = rtc.tableHeaders[index]; 141 | let width = rtc.constrainWidth(th, th.offsetWidth); 142 | assert.equal(th.style.width, (width.toFixed(2)) + 'px', `Column index ${index}`); 143 | } 144 | }); 145 | 146 | it('Should ".createDragHandles()"', function () { 147 | const dragWrapper = el.parentNode?.childNodes[0] as HTMLElement; 148 | assert.isNotNull(dragWrapper, 'Drag wrapper is missing.'); 149 | assert.equal(dragWrapper.nodeName, 'DIV', 'Drag wrapper is not a DIV.'); 150 | assert.isTrue(dragWrapper.classList.contains('rtc-handle-container'), 'Drag wrapper does not have the required class.'); 151 | 152 | const resizableHeaders = rtc.getResizableHeaders(); 153 | assert.equal(dragWrapper.childNodes.length, resizableHeaders.length); 154 | 155 | for (let index = 0; index < dragWrapper.childNodes.length; index++) { 156 | assert.isTrue((dragWrapper.childNodes as any)[index].classList.contains('rtc-handle')); 157 | } 158 | }); 159 | }); 160 | 161 | describe('Dispose calls', function () { 162 | let container: HTMLElement, el: HTMLTableElement, rtc: ResizableTableColumns; 163 | before(function () { 164 | container = DOM.window.document.createElement('div'); 165 | container.innerHTML = dynamicTable; 166 | 167 | DOM.window.document.body.appendChild(container); 168 | el = container.querySelector('table') as HTMLTableElement; 169 | rtc = new ResizableTableColumns(el, null); 170 | rtc.dispose(); 171 | }); 172 | 173 | after(function () { 174 | DOM.window.document.body.removeChild(container); 175 | }); 176 | 177 | it('Should ".unwrapTable()"', function () { 178 | assert.equal(el.parentNode, container, 'The "unwrapTable" method failed to restpre the original parent.'); 179 | assert.isFalse(el.classList.contains('rtc-table'), 'Table still has the required class.'); 180 | }); 181 | 182 | it('Should ".restoreOriginalWidths()"', function () { 183 | for (let index = 1; index <= 9; index++) { 184 | const th = DOM.window.document.getElementById(`th${index}`) as HTMLElement; 185 | assert.equal(th.style.width, (100 + ((index) * 10)) + 'px'); 186 | } 187 | assert.equal(el.style.width, '7000px', 'Original table width was not restored.'); 188 | }); 189 | 190 | it('Should ".destroyDragHandles()"', function () { 191 | assert.equal(container.querySelectorAll('.rtc-handle-container').length, 0); 192 | assert.equal(container.querySelectorAll('.rtc-handle').length, 0); 193 | }); 194 | }); 195 | 196 | describe('Instance methods', function () { 197 | it('.getResizableHeaders()', function () { 198 | const unresizable = rtc.getResizableHeaders() 199 | .filter((el, idx) => { 200 | return !el.hasAttribute('data-rtc-resizable'); 201 | }); 202 | assert.equal(unresizable.length, 0); 203 | }); 204 | 205 | it('.getDragHandlers()', function () { 206 | const dragHandlers = rtc.getDragHandlers(); 207 | for (let index = 0; index < dragHandlers.length; index++) { 208 | assert.equal(dragHandlers[index].nodeName, 'DIV'); 209 | assert.isTrue(dragHandlers[index].classList.contains('rtc-handle')); 210 | } 211 | }); 212 | }); 213 | 214 | describe('.createHandlerReferences()', function () { 215 | it('Create "onPointerDownRef"', function () { 216 | assert.isTrue(typeof rtc.onPointerDownRef === 'function'); 217 | }); 218 | 219 | it('Create "onPointerMoveRef"', function () { 220 | assert.isTrue(typeof rtc.onPointerMoveRef === 'function'); 221 | }); 222 | 223 | it('Create "onPointerUpRef"', function () { 224 | assert.isTrue(typeof rtc.onPointerUpRef === 'function'); 225 | }); 226 | }); 227 | 228 | describe('.registerWindowResizeHandler()', function () { 229 | it('Should be true "registerWindowResizeHandler"', function () { 230 | assert.isTrue(ResizableTableColumns.windowResizeHandlerRef != null); 231 | }); 232 | }); 233 | 234 | describe('static.generateTableId()', function () { 235 | it('Should be "" (empty string) if attriute is missing', function () { 236 | const el = DOM.window.document.createElement('table'); 237 | const id = ResizableTableColumns.generateTableId(el); 238 | assert.equal(id, ''); 239 | }); 240 | 241 | it('Should be "rtc/table_one" if attriute value is " table_one "', function () { 242 | const el = DOM.window.document.createElement('table'); 243 | el.setAttribute('data-rtc-resizable-table', ' table_one ') 244 | const id = ResizableTableColumns.generateTableId(el); 245 | assert.equal(id, 'rtc/table_one'); 246 | }); 247 | 248 | it('Should be "rtc/table_two_two" if attriute value is "table.two.two"', function () { 249 | const el = DOM.window.document.createElement('table'); 250 | el.setAttribute('data-rtc-resizable-table', 'table.two.two') 251 | const id = ResizableTableColumns.generateTableId(el); 252 | assert.equal(id, 'rtc/table_two_two'); 253 | }); 254 | }); 255 | 256 | describe('static.generateColumnId()', function () { 257 | it('Should be "" (empty string) if attriute is missing', function () { 258 | const el = DOM.window.document.createElement('div'); 259 | const id = ResizableTableColumns.generateColumnId(el); 260 | assert.equal(id, ''); 261 | }); 262 | 263 | it('Should be "column_one" if attriute value is " column_one "', function () { 264 | const el = DOM.window.document.createElement('div'); 265 | el.setAttribute('data-rtc-resizable', ' column_one ') 266 | const id = ResizableTableColumns.generateColumnId(el); 267 | assert.equal(id, 'column_one'); 268 | }); 269 | 270 | it('Should be "cell_two_two" if attriute value is "cell.two.two"', function () { 271 | const el = DOM.window.document.createElement('div'); 272 | el.setAttribute('data-rtc-resizable', 'cell.two.two') 273 | const id = ResizableTableColumns.generateColumnId(el); 274 | assert.equal(id, 'cell_two_two'); 275 | }); 276 | }); 277 | 278 | describe('static.setWidth()', function () { 279 | it('Should be 0 for -1', function () { 280 | const el = DOM.window.document.createElement('span'); 281 | ResizableTableColumns.setWidth(el, -1); 282 | assert.equal(el.style.width, '0px'); 283 | }); 284 | 285 | it('Should be 0 for 0', function () { 286 | const el = DOM.window.document.createElement('span'); 287 | ResizableTableColumns.setWidth(el, 0); 288 | assert.equal(el.style.width, '0px'); 289 | }); 290 | 291 | it('Should be 2px for 2', function () { 292 | const el = DOM.window.document.createElement('span'); 293 | ResizableTableColumns.setWidth(el, 2); 294 | assert.equal(el.style.width, '2.00px'); 295 | }); 296 | 297 | it('Should be 3.10px for 3.1', function () { 298 | const el = DOM.window.document.createElement('span'); 299 | ResizableTableColumns.setWidth(el, 3.1); 300 | assert.equal(el.style.width, '3.10px'); 301 | }); 302 | 303 | it('Should be 4.25px for 4.25', function () { 304 | const el = DOM.window.document.createElement('span'); 305 | ResizableTableColumns.setWidth(el, 4.25); 306 | assert.equal(el.style.width, '4.25px'); 307 | }); 308 | 309 | it('Should be 5.45px for 5.449', function () { 310 | const el = DOM.window.document.createElement('span'); 311 | ResizableTableColumns.setWidth(el, 5.451); 312 | assert.equal(el.style.width, '5.45px'); 313 | }); 314 | 315 | it('Should be 5.45px for 5.450', function () { 316 | const el = DOM.window.document.createElement('span'); 317 | ResizableTableColumns.setWidth(el, 5.450); 318 | assert.equal(el.style.width, '5.45px'); 319 | }); 320 | 321 | it('Should be 5.46px for 5.451', function () { 322 | const el = DOM.window.document.createElement('span'); 323 | ResizableTableColumns.setWidth(el, 5.451); 324 | assert.equal(el.style.width, '5.45px'); 325 | }); 326 | }); 327 | 328 | describe('static.getInstanceId()', function () { 329 | it('Incement after each call', function () { 330 | const id1 = ResizableTableColumns.getInstanceId(); 331 | const id2 = ResizableTableColumns.getInstanceId(); 332 | 333 | assert.equal(id2, id1 + 1); 334 | }); 335 | }); 336 | }); 337 | -------------------------------------------------------------------------------- /dist/samples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Resizable Table Columns 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 |
28 |

Resizable Table Columns

29 |
30 |

Simple example

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817
2LindaKorea, SouthKATimkur6490 Ut Rd.54262017-02-14T22:58:55-08:005DD78B29-5B58-F2D9-3D36-8FB80C3121A7
3LeonardBritish Indian Ocean TerritoryPBSousa971-4168 Sit St.49012018-05-21T06:02:19-07:0043416183-B9A7-9E24-3FBD-42093FB3B9F4
4LionelNigeriaVästra Götalands länLidköpingP.O. Box 168, 2045 Quis, Ave114012018-04-26T19:07:30-07:0016A49C04-4CD6-DAB7-B6F6-9F441487D0CD
5DillonFijiLower AustriaSchwechat308-7449 Fermentum Av.C1W 2W02017-08-30T22:53:40-07:00650F3DCA-D979-6629-0CB1-643E1D289239
6MacyHaitiQCMontebelloAp #738-1107 Varius Ave406642018-07-03T03:12:45-07:007A4609A1-E4D6-3327-7329-4ACB8950F9A2
7KyleLebanonHBBremen283-2898 Nec, Av.3818702018-07-15T17:01:24-07:0003D5BF83-F1EA-05E1-2B76-37A1996A4007
8DylanLiechtensteinONGloucester203-4972 Quis, St.479472017-07-24T02:04:07-07:0064FF2C19-E62B-FCB0-91C0-E6493EDBEB72
9OprahSpainHerediaHerediaP.O. Box 668, 6923 Dolor. St.35392018-05-17T20:59:41-07:00D08BC557-A7BB-CE2D-652D-CCE2DBC79DA1
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
158 |
159 | 160 |
161 |

Complex header example

162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 |
Address 1Address 2Last updated
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817
2LindaKorea, SouthKATimkur6490 Ut Rd.54262017-02-14T22:58:55-08:005DD78B29-5B58-F2D9-3D36-8FB80C3121A7
3LeonardBritish Indian Ocean TerritoryPBSousa971-4168 Sit St.49012018-05-21T06:02:19-07:0043416183-B9A7-9E24-3FBD-42093FB3B9F4
4LionelNigeriaVästra Götalands länLidköpingP.O. Box 168, 2045 Quis, Ave114012018-04-26T19:07:30-07:0016A49C04-4CD6-DAB7-B6F6-9F441487D0CD
5DillonFijiLower AustriaSchwechat308-7449 Fermentum Av.C1W 2W02017-08-30T22:53:40-07:00650F3DCA-D979-6629-0CB1-643E1D289239
6MacyHaitiQCMontebelloAp #738-1107 Varius Ave406642018-07-03T03:12:45-07:007A4609A1-E4D6-3327-7329-4ACB8950F9A2
7KyleLebanonHBBremen283-2898 Nec, Av.3818702018-07-15T17:01:24-07:0003D5BF83-F1EA-05E1-2B76-37A1996A4007
8DylanLiechtensteinONGloucester203-4972 Quis, St.479472017-07-24T02:04:07-07:0064FF2C19-E62B-FCB0-91C0-E6493EDBEB72
9OprahSpainHerediaHerediaP.O. Box 668, 6923 Dolor. St.35392018-05-17T20:59:41-07:00D08BC557-A7BB-CE2D-652D-CCE2DBC79DA1
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
306 |
307 |
308 | 309 | 310 | 311 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /dist/samples/bootstrap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Resizable Table Columns 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 |
28 |

Resizable Table Columns

29 |
30 |

Simple example

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817
2LindaKorea, SouthKATimkur6490 Ut Rd.54262017-02-14T22:58:55-08:005DD78B29-5B58-F2D9-3D36-8FB80C3121A7
3LeonardBritish Indian Ocean TerritoryPBSousa971-4168 Sit St.49012018-05-21T06:02:19-07:0043416183-B9A7-9E24-3FBD-42093FB3B9F4
4LionelNigeriaVästra Götalands länLidköpingP.O. Box 168, 2045 Quis, Ave114012018-04-26T19:07:30-07:0016A49C04-4CD6-DAB7-B6F6-9F441487D0CD
5DillonFijiLower AustriaSchwechat308-7449 Fermentum Av.C1W 2W02017-08-30T22:53:40-07:00650F3DCA-D979-6629-0CB1-643E1D289239
6MacyHaitiQCMontebelloAp #738-1107 Varius Ave406642018-07-03T03:12:45-07:007A4609A1-E4D6-3327-7329-4ACB8950F9A2
7KyleLebanonHBBremen283-2898 Nec, Av.3818702018-07-15T17:01:24-07:0003D5BF83-F1EA-05E1-2B76-37A1996A4007
8DylanLiechtensteinONGloucester203-4972 Quis, St.479472017-07-24T02:04:07-07:0064FF2C19-E62B-FCB0-91C0-E6493EDBEB72
9OprahSpainHerediaHerediaP.O. Box 668, 6923 Dolor. St.35392018-05-17T20:59:41-07:00D08BC557-A7BB-CE2D-652D-CCE2DBC79DA1
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
158 |
159 | 160 |
161 |

Complex header example

162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 |
Address 1Address 2Last updated
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817
2LindaKorea, SouthKATimkur6490 Ut Rd.54262017-02-14T22:58:55-08:005DD78B29-5B58-F2D9-3D36-8FB80C3121A7
3LeonardBritish Indian Ocean TerritoryPBSousa971-4168 Sit St.49012018-05-21T06:02:19-07:0043416183-B9A7-9E24-3FBD-42093FB3B9F4
4LionelNigeriaVästra Götalands länLidköpingP.O. Box 168, 2045 Quis, Ave114012018-04-26T19:07:30-07:0016A49C04-4CD6-DAB7-B6F6-9F441487D0CD
5DillonFijiLower AustriaSchwechat308-7449 Fermentum Av.C1W 2W02017-08-30T22:53:40-07:00650F3DCA-D979-6629-0CB1-643E1D289239
6MacyHaitiQCMontebelloAp #738-1107 Varius Ave406642018-07-03T03:12:45-07:007A4609A1-E4D6-3327-7329-4ACB8950F9A2
7KyleLebanonHBBremen283-2898 Nec, Av.3818702018-07-15T17:01:24-07:0003D5BF83-F1EA-05E1-2B76-37A1996A4007
8DylanLiechtensteinONGloucester203-4972 Quis, St.479472017-07-24T02:04:07-07:0064FF2C19-E62B-FCB0-91C0-E6493EDBEB72
9OprahSpainHerediaHerediaP.O. Box 668, 6923 Dolor. St.35392018-05-17T20:59:41-07:00D08BC557-A7BB-CE2D-652D-CCE2DBC79DA1
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
306 |
307 |
308 | 309 | 310 | 311 | 334 | 335 | 336 | -------------------------------------------------------------------------------- /dist/samples/dev.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Resizable Table Columns 8 | 9 | 10 | 11 | 12 | 13 | 14 | 26 | 27 | 28 | 29 | 30 |
31 |

Resizable Table Columns

32 |
33 |

Simple example

34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 |
No.NameCountryRegionCityStreetPost CodeLast updatedUUIDRemarks
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817Some very long remarks to test if this will cause the cell to initially be a lot longer than we would like it to be.
2LindaKorea, SouthKATimkur6490 Ut Rd.54262017-02-14T22:58:55-08:005DD78B29-5B58-F2D9-3D36-8FB80C3121A7
3LeonardBritish Indian Ocean TerritoryPBSousa971-4168 Sit St.49012018-05-21T06:02:19-07:0043416183-B9A7-9E24-3FBD-42093FB3B9F4
4LionelNigeriaVästra Götalands länLidköpingP.O. Box 168, 2045 Quis, Ave114012018-04-26T19:07:30-07:0016A49C04-4CD6-DAB7-B6F6-9F441487D0CD
5DillonFijiLower AustriaSchwechat308-7449 Fermentum Av.C1W 2W02017-08-30T22:53:40-07:00650F3DCA-D979-6629-0CB1-643E1D289239
6MacyHaitiQCMontebelloAp #738-1107 Varius Ave406642018-07-03T03:12:45-07:007A4609A1-E4D6-3327-7329-4ACB8950F9A2
7KyleLebanonHBBremen283-2898 Nec, Av.3818702018-07-15T17:01:24-07:0003D5BF83-F1EA-05E1-2B76-37A1996A4007
8DylanLiechtensteinONGloucester203-4972 Quis, St.479472017-07-24T02:04:07-07:0064FF2C19-E62B-FCB0-91C0-E6493EDBEB72
9OprahSpainHerediaHerediaP.O. Box 668, 6923 Dolor. St.35392018-05-17T20:59:41-07:00D08BC557-A7BB-CE2D-652D-CCE2DBC79DA1
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
172 |
173 | 174 |
175 |

Complex header example

176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 |
Address 1Address 2Last updated
No.NameCountryRegionCityStreetPost CodeLast updatedUUID
1EugeniaSerbiaMNMinneapolisAp #207-8285 Nibh Rd.417542017-11-15T16:52:00-08:00E212DAC2-220E-9589-D96A-3B58242E9817
2LindaKorea, SouthKATimkur6490 Ut Rd.54262017-02-14T22:58:55-08:005DD78B29-5B58-F2D9-3D36-8FB80C3121A7
3LeonardBritish Indian Ocean TerritoryPBSousa971-4168 Sit St.49012018-05-21T06:02:19-07:0043416183-B9A7-9E24-3FBD-42093FB3B9F4
4LionelNigeriaVästra Götalands länLidköpingP.O. Box 168, 2045 Quis, Ave114012018-04-26T19:07:30-07:0016A49C04-4CD6-DAB7-B6F6-9F441487D0CD
5DillonFijiLower AustriaSchwechat308-7449 Fermentum Av.C1W 2W02017-08-30T22:53:40-07:00650F3DCA-D979-6629-0CB1-643E1D289239
6MacyHaitiQCMontebelloAp #738-1107 Varius Ave406642018-07-03T03:12:45-07:007A4609A1-E4D6-3327-7329-4ACB8950F9A2
7KyleLebanonHBBremen283-2898 Nec, Av.3818702018-07-15T17:01:24-07:0003D5BF83-F1EA-05E1-2B76-37A1996A4007
8DylanLiechtensteinONGloucester203-4972 Quis, St.479472017-07-24T02:04:07-07:0064FF2C19-E62B-FCB0-91C0-E6493EDBEB72
9OprahSpainHerediaHerediaP.O. Box 668, 6923 Dolor. St.35392018-05-17T20:59:41-07:00D08BC557-A7BB-CE2D-652D-CCE2DBC79DA1
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
320 |
321 |
322 | 323 | 324 | 325 | 355 | 356 | 357 | -------------------------------------------------------------------------------- /dist/js/bundle/index.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).validide_resizableTableColumns={})}(this,function(e){"use strict";t.dataPropertyName="validide_rtc_data_object",t.classes={table:"rtc-table",wrapper:"rtc-wrapper",handleContainer:"rtc-handle-container",handle:"rtc-handle",tableResizing:"rtc-table-resizing",columnResizing:"rtc-column-resizing"},t.attributes={dataResizable:"data-rtc-resizable",dataResizableTable:"data-rtc-resizable-table"},t.data={resizable:"rtcResizable",resizableTable:"rtcResizableTable"},t.events={pointerDown:["mousedown","touchstart"],pointerMove:["mousemove","touchmove"],pointerUp:["mouseup","touchend"],windowResize:["resize"],eventResizeStart:"eventResizeStart.rtc",eventResize:"eventResize.rtc",eventResizeStop:"eventResizeStop.rtc"};var f=t;function t(){}var n=function(){this.column=0,this.table=0},i=function(){this.x=null,this.isDoubleClick=!1},l=function(e,t){this.pointer=new i,this.originalWidths=new n,this.newWidths=new n,this.column=e,this.dragHandler=t},a=(s.kebabCaseToCamelCase=function(e){return e.replace(s.kebabCaseRegex,function(e){return e[1].toUpperCase()})},s.parseStringToType=function(e){if(0!=e.length&&!s.onlyWhiteSpace.test(e)){if(s.trueRegex.test(e))return!0;if(s.falseRegex.test(e))return!1;if(s.notEmptyOrWhiteSpace.test(e)){var t=+e;if(!isNaN(t))return t}}return e},s.regexEscapeRegex=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,s.kebabCaseRegex=/(\-\w)/g,s.trueRegex=/^true$/i,s.falseRegex=/^false$/i,s.onlyWhiteSpace=/^\s$/,s.notEmptyOrWhiteSpace=/\S/,s);function s(){}r.getDataAttributesValues=function(e){if(!e)return null;var t={};if(e.dataset)for(var n in e.dataset)e.dataset.hasOwnProperty(n)&&(t[n]=a.parseStringToType(e.dataset[n]||""));else for(var i=0;i if you wish to recreate them";this.dragHandlesContainer=this.ownerDocument.createElement("div"),null!=(e=this.wrapper)&&e.insertBefore(this.dragHandlesContainer,this.table),this.dragHandlesContainer.classList.add(f.classes.handleContainer),this.getResizableHeaders().forEach(function(){var e,t=i.ownerDocument.createElement("div");t.classList.add(f.classes.handle),null!=(e=i.dragHandlesContainer)&&e.appendChild(t)}),f.events.pointerDown.forEach(function(e,t){var n;null!=(n=i.dragHandlesContainer)&&n.addEventListener(e,i.onPointerDownRef,!1)})},b.prototype.destroyDragHandles=function(){var e,i=this;null!==this.dragHandlesContainer&&(f.events.pointerDown.forEach(function(e,t){var n;null!=(n=i.dragHandlesContainer)&&n.removeEventListener(e,i.onPointerDownRef,!1)}),null!=(e=null==(e=this.dragHandlesContainer)?void 0:e.parentElement))&&e.removeChild(this.dragHandlesContainer)},b.prototype.getDragHandlers=function(){var e=null==this.dragHandlesContainer?null:this.dragHandlesContainer.querySelectorAll(".".concat(f.classes.handle));return e?Array.prototype.slice.call(e).filter(function(e){return"DIV"===e.nodeName}):new Array},b.prototype.restoreColumnWidths=function(){var e,n;this.options.store&&0!==(e=b.generateTableId(this.table)).length&&(n=this.options.store.get(e))&&(this.getResizableHeaders().forEach(function(e){var t=n.columns[b.generateColumnId(e)];void 0!==t&&b.setWidth(e,t)}),void 0!==n.table)&&b.setWidth(this.table,n.table)},b.prototype.checkTableWidth=function(){var e=this.wrapper.clientWidth,t=e-this.table.offsetWidth;if(!(t<=0)){for(var n,i,a,s=0,o=0,r=[],l=(this.tableHeaders.forEach(function(e,t){e.hasAttribute(f.attributes.dataResizable)&&(e={el:e,detail:e.offsetWidth},r.push(e),s+=e.detail)}),0),h=null;n=r.shift();){var l=t-o,h=n.el,d=Math.floor(n.detail/s*t),d=Math.min(d,l);if(t<=(o+=this.updateWidth(n.el,n.detail+d,!1,!0)-n.detail))break}0<(l=t-o)&&(a=(i=(null==(i=r[0])?void 0:i.el)||h||this.tableHeaders[this.tableHeaders.length-1]).offsetWidth,this.updateWidth(i,a,!0,!0)),b.setWidth(this.table,e)}},b.prototype.syncHandleWidths=function(){var a=this,e=this.table.clientWidth,s=(b.setWidth(this.dragHandlesContainer,e),this.dragHandlesContainer.style.minWidth="".concat(e,"px"),this.getResizableHeaders());this.getDragHandlers().forEach(function(e,t){var n,i=(a.options.resizeFromBody?a.table:a.table.tHead).clientHeight;t=(n=this.getResizableHeaders()).length)||(o=(t=(new Date).getTime())-this.lastPointerDown 2 | /// 3 | /// 4 | 5 | import { assert } from 'chai'; 6 | import { JSDOM } from 'jsdom'; 7 | import { ResizableConstants } from '../sources/ts/resizable-constants'; 8 | import { ResizableOptions } from '../sources/ts/resizable-options'; 9 | import { ResizableTableColumns } from '../sources/ts/resizable-table-columns'; 10 | 11 | describe('ResizableTableColumns', function () { 12 | describe('constructor', function () { 13 | const DOM = new JSDOM(` 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 |
No.NameCounrtyRegionCityStreetPost CodeLast updatedUUID
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
10AlexanderFijiIstanbulIstanbulP.O. Box 879, 3462 Diam. St.JS5Z 4UZ2016-10-03T23:00:32-07:00F854BE7E-C117-7B9A-F3D5-9EAD294315D0
194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 |
203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 |
211 | 212 | 213 | 214 | 215 | 216 |
217 | 218 | 219 | 220 |
221 | 222 | `); 223 | 224 | it('Should construct the object', function () { 225 | const el = DOM.window.document.getElementById('valid-table'); 226 | assert.isNotNull(el, 'Table element should be found in dom'); 227 | 228 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 229 | 230 | assert.isObject(rtc); 231 | assert.isObject((el as any)[ResizableConstants.dataPropertyName]); 232 | assert.deepEqual(rtc, (el as any)[ResizableConstants.dataPropertyName]); 233 | }); 234 | 235 | it('Should fail to construct - undefined table ', function () { 236 | let theError = ''; 237 | try { 238 | const rtc = new ResizableTableColumns(void (0) as unknown as HTMLTableElement, null); 239 | } catch (error) { 240 | theError = error as string; 241 | } 242 | 243 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 244 | assert.isTrue(theError.indexOf('Invalid argument: "table".') == 0); 245 | }); 246 | 247 | it('Should fail to construct - null table ', function () { 248 | let theError = ''; 249 | try { 250 | const rtc = new ResizableTableColumns(null as unknown as HTMLTableElement, null); 251 | } catch (error) { 252 | theError = error as string; 253 | } 254 | 255 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 256 | assert.isTrue(theError.indexOf('Invalid argument: "table".') == 0); 257 | }); 258 | 259 | it('Should fail to construct - plain object table ', function () { 260 | let theError = ''; 261 | try { 262 | const rtc = new ResizableTableColumns({} as unknown as HTMLTableElement, null); 263 | } catch (error) { 264 | theError = error as string; 265 | } 266 | 267 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 268 | assert.isTrue(theError.indexOf('Invalid argument: "table".') == 0); 269 | }); 270 | 271 | it('Should fail to construct - plain HTMLTableElement table ', function () { 272 | let theError = ''; 273 | const el = DOM.window.document.createElement('table'); 274 | 275 | try { 276 | (el as any)[ResizableConstants.dataPropertyName] = {}; 277 | const rtc = new ResizableTableColumns(el, null); 278 | } catch (error) { 279 | theError = error as string; 280 | } 281 | 282 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 283 | assert.isTrue(theError.indexOf(`Existing "${ResizableConstants.dataPropertyName}" property.`) == 0); 284 | }); 285 | 286 | it('Should fail to construct - missing head and body', function () { 287 | let theError = ''; 288 | 289 | try { 290 | const el = DOM.window.document.getElementById('missing-head-and-body'); 291 | assert.isNotNull(el, 'Table element should be found in dom'); 292 | 293 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 294 | } catch (error) { 295 | theError = error as string; 296 | } 297 | 298 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 299 | assert.isTrue(theError.indexOf('Markup validation: thead count') == 0, theError); 300 | }); 301 | 302 | it('Should fail to construct - missing head and body 2', function () { 303 | let theError = ''; 304 | 305 | try { 306 | const el = DOM.window.document.getElementById('missing-head-and-body-2'); 307 | assert.isNotNull(el, 'Table element should be found in dom'); 308 | 309 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 310 | } catch (error) { 311 | theError = error as string; 312 | } 313 | 314 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 315 | assert.isTrue(theError.indexOf('Markup validation: thead count') == 0, theError); 316 | }); 317 | 318 | it('Should fail to construct - missing head', function () { 319 | let theError = ''; 320 | 321 | try { 322 | const el = DOM.window.document.getElementById('missing-head'); 323 | assert.isNotNull(el, 'Table element should be found in dom'); 324 | 325 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 326 | } catch (error) { 327 | theError = error as string; 328 | } 329 | 330 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 331 | assert.isTrue(theError.indexOf('Markup validation: thead count') == 0, theError); 332 | }); 333 | 334 | it('Should fail to construct - missing body', function () { 335 | let theError = ''; 336 | 337 | try { 338 | const el = DOM.window.document.getElementById('missing-body'); 339 | assert.isNotNull(el, 'Table element should be found in dom'); 340 | 341 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 342 | } catch (error) { 343 | theError = error as string; 344 | } 345 | 346 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 347 | assert.isTrue(theError.indexOf('Markup validation: tbody count') == 0, theError); 348 | }); 349 | 350 | it('Should fail to construct - multiple heads', function () { 351 | let theError = ''; 352 | 353 | try { 354 | const el = DOM.window.document.getElementById('double-head'); 355 | assert.isNotNull(el, 'Table element should be found in dom'); 356 | 357 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 358 | } catch (error) { 359 | theError = error as string; 360 | } 361 | 362 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 363 | assert.isTrue(theError.indexOf('Markup validation: thead count') == 0, theError); 364 | }); 365 | 366 | it('Should fail to construct - multiple bodies', function () { 367 | let theError = ''; 368 | 369 | try { 370 | const el = DOM.window.document.getElementById('double-body'); 371 | assert.isNotNull(el, 'Table element should be found in dom'); 372 | 373 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 374 | } catch (error) { 375 | theError = error as string; 376 | } 377 | 378 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 379 | assert.isTrue(theError.indexOf('Markup validation: tbody count') == 0, theError); 380 | }); 381 | 382 | it('Should fail to construct - invalid header', function () { 383 | let theError = ''; 384 | 385 | try { 386 | const el = DOM.window.document.getElementById('invalid-header'); 387 | assert.isNotNull(el, 'Table element should be found in dom'); 388 | 389 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 390 | } catch (error) { 391 | theError = error as string; 392 | } 393 | 394 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 395 | assert.isTrue(theError.indexOf('Markup validation: thead first row invalid') == 0, theError); 396 | }); 397 | 398 | it('Should fail to construct - invalid header 2', function () { 399 | let theError = ''; 400 | 401 | try { 402 | const el = DOM.window.document.getElementById('invalid-header2'); 403 | assert.isNotNull(el, 'Table element should be found in dom'); 404 | 405 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 406 | } catch (error) { 407 | theError = error as string; 408 | } 409 | 410 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 411 | assert.isTrue(theError.indexOf('Markup validation: thead first row cells count') == 0, theError); 412 | }); 413 | 414 | it('Should fail to construct - invalid header 3', function () { 415 | let theError = ''; 416 | 417 | try { 418 | const el = DOM.window.document.getElementById('invalid-header3'); 419 | assert.isNotNull(el, 'Table element should be found in dom'); 420 | 421 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 422 | } catch (error) { 423 | theError = error as string; 424 | } 425 | 426 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 427 | assert.isTrue(theError.indexOf('Markup validation: thead first row cells count') == 0, theError); 428 | }); 429 | 430 | it('Should fail to construct - invalid header 4', function () { 431 | let theError = ''; 432 | 433 | try { 434 | const el = DOM.window.document.getElementById('invalid-header4'); 435 | assert.isNotNull(el, 'Table element should be found in dom'); 436 | 437 | const rtc = new ResizableTableColumns(el as HTMLTableElement, null); 438 | } catch (error) { 439 | theError = error as string; 440 | } 441 | 442 | assert.isTrue(theError.length > 0, 'The lenght of the error mesage(' + theError + ') should be > 0.'); 443 | assert.isTrue(theError.indexOf('Markup validation: thead row count') == 0, theError); 444 | }); 445 | 446 | it('Each new object should have a new id', function () { 447 | const el = DOM.window.document.getElementById('valid-table'); 448 | assert.isNotNull(el, 'Table element should be found in dom'); 449 | 450 | if (typeof (el as any)[ResizableConstants.dataPropertyName] !== 'undefined') { 451 | (el as any)[ResizableConstants.dataPropertyName].dispose(); 452 | } 453 | 454 | let rtc = new ResizableTableColumns(el as HTMLTableElement, null); 455 | const id1 = rtc.id; 456 | rtc.dispose(); 457 | 458 | rtc = new ResizableTableColumns(el as HTMLTableElement, null); 459 | const id2 = rtc.id; 460 | rtc.dispose(); 461 | 462 | rtc = new ResizableTableColumns(el as HTMLTableElement, null); 463 | const id3 = rtc.id; 464 | rtc.dispose(); 465 | 466 | assert.equal(id2, id1 + 1); 467 | assert.equal(id3, id2 + 1); 468 | }); 469 | 470 | }); 471 | }); 472 | -------------------------------------------------------------------------------- /dist/js/es6/resizable-table-columns.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"resizable-table-columns.js","sourceRoot":"","sources":["../../../sources/ts/resizable-table-columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAWvD;IAoBE,+BAAY,KAAuB,EAAE,OAAgC;QACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAa,KAAM,CAAC,QAAQ,EAAE,KAAK,2BAA2B;YAC3G,MAAM,0HAA0H,CAAC;QAEnI,IAAI,OAAQ,KAAa,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,KAAK,WAAW;YAC5E,MAAM,qBAAa,kBAAkB,CAAC,gBAAgB,wDAA6C,kBAAkB,CAAC,gBAAgB,uBAAoB,CAAC;QAE7J,IAAI,CAAC,EAAE,GAAG,qBAAqB,CAAC,aAAa,EAAE,CAAC;QAChD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAA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