-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
887 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
/* eslint-env node */ | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const pkg = require('./package.json'); | ||
|
||
module.exports = { | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
extends: ['react-app', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'prettier'], | ||
extends: [ | ||
'airbnb-typescript', | ||
'react-app', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
'prettier', | ||
], | ||
parserOptions: { | ||
project: './tsconfig.eslint.json', | ||
}, | ||
settings: { | ||
react: { | ||
version: '99.99.99', | ||
version: pkg.devDependencies.react ? 'detect' : '99.99.99', | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'no-continue': 'off', | ||
// '@typescript-eslint/explicit-module-boundary-types': 'off', | ||
// '@typescript-eslint/no-explicit-any': 'off', | ||
// '@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
node-version: '14.x' | ||
- run: npm i -g yarn | ||
- run: yarn set version berry | ||
# - run: cat .yarnrc_patch.yml >> .yarnrc.yml | ||
- run: cat .yarnrc_patch.yml >> .yarnrc.yml | ||
- run: yarn config set checksumBehavior ignore | ||
- name: Cache Node.js modules | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
packageExtensions: | ||
eslint-module-utils@*: | ||
dependencies: | ||
eslint-import-resolver-node: '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
/* eslint-disable class-methods-use-this */ | ||
import { ACellRenderer, ICellRenderContext, PrefetchMixin, uniformContext } from '../src'; | ||
import { Column } from './column'; | ||
import Column from './column'; | ||
|
||
/** @internal */ | ||
export default class TestRenderer extends ACellRenderer<Column<number>> { | ||
protected readonly _context: ICellRenderContext<Column<number>>; | ||
protected readonly privateContext: ICellRenderContext<Column<number>>; | ||
|
||
constructor(root: HTMLElement, id: string, numberOfRows = 1000, numberOfColumns = 20) { | ||
super(root, `#${id}`, { mixins: [PrefetchMixin], striped: true }); | ||
// eslint-disable-next-line no-param-reassign | ||
root.id = id; | ||
|
||
const defaultRowHeight = 20; | ||
|
||
const columns: Column<number>[] = []; | ||
for (let i = 0; i < numberOfColumns; ++i) { | ||
for (let i = 0; i < numberOfColumns; i += 1) { | ||
columns.push(new Column(i, i.toString(36), i === 0 || i === 2)); | ||
} | ||
this._context = Object.assign( | ||
{ | ||
columns, | ||
column: uniformContext(columns.length, 100), | ||
}, | ||
uniformContext(numberOfRows, defaultRowHeight) | ||
); | ||
this.privateContext = { | ||
columns, | ||
column: uniformContext(columns.length, 100), | ||
...uniformContext(numberOfRows, defaultRowHeight), | ||
}; | ||
} | ||
|
||
protected createHeader(document: Document, column: Column<number>) { | ||
return column.header(document); | ||
protected createHeader(doc: Document, column: Column<number>): HTMLElement { | ||
return column.header(doc); | ||
} | ||
|
||
protected updateHeader() { | ||
protected updateHeader(): void { | ||
// nothing do to | ||
} | ||
|
||
protected createCell(document: Document, index: number, column: Column<number>) { | ||
return column.cell(index, document); | ||
protected createCell(doc: Document, index: number, column: Column<number>): HTMLElement { | ||
return column.cell(index, doc); | ||
} | ||
|
||
protected updateCell(node: HTMLElement, index: number, column: Column<number>) { | ||
protected updateCell(node: HTMLElement, index: number, column: Column<number>): HTMLElement { | ||
return column.update(node, index); | ||
} | ||
|
||
run() { | ||
//wait till layouted | ||
run(): void { | ||
// wait till layouted | ||
setTimeout(super.init.bind(this), 100); | ||
} | ||
|
||
protected get context() { | ||
return this._context; | ||
protected get context(): ICellRenderContext<Column<number>> { | ||
return this.privateContext; | ||
} | ||
|
||
protected updateRow(node: HTMLElement, index: number) { | ||
//return abortAble(resolveIn(2000)).then(() => { | ||
super.updateRow(node, index); | ||
//}); | ||
} | ||
// protected updateRow(node: HTMLElement, index: number) { | ||
// // return abortAble(resolveIn(2000)).then(() => { | ||
// super.updateRow(node, index); | ||
// // }); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.