Skip to content

Commit 83f2c49

Browse files
authored
Now with Typescript! (#425)
1 parent 48f7f8a commit 83f2c49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+8290
-6131
lines changed

.browserslistrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.dcignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ insert_final_newline = true
88
charset = utf-8
99
indent_style = space
1010
indent_size = 2
11-
12-
[*.cs]
13-
indent_size = 4

.eslintrc.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ module.exports = {
22
root: true,
33
env: {
44
browser: true,
5-
node: true
5+
node: false
66
},
77
extends: ['plugin:vue/recommended', 'eslint:recommended', 'plugin:import/errors', 'plugin:import/warnings'],
88
parserOptions: {
99
parser: 'babel-eslint'
1010
},
1111
plugins: ['html'],
1212
rules: {
13-
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
14-
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1513
'import/no-unresolved': 'warn'
1614
},
1715
overrides: [

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,4 @@ yarn-error.log
196196
# End of https://www.toptal.com/developers/gitignore/api/linux,macos,node,dotenv,visualstudiocode,vuejs
197197

198198
.dccache
199+
build

bili.config.js

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
1-
module.exports = {
2-
jsCompiler: 'babel',
3-
input: ['src/index.browser.mjs', 'src/index.mjs'],
1+
const config = {
2+
input: 'build/main.js',
43
bundleNodeModules: true,
4+
externals: ['vue'],
55
output: {
66
format: ['cjs', 'esm', 'umd'],
77
minify: true,
88
moduleName: 'Grid',
9-
extractCSS: false
9+
extractCSS: false,
10+
dir: 'dist/'
1011
},
1112
plugins: {
12-
string: {
13-
include: 'node_modules/**/*.css'
14-
},
13+
babel: false,
1514
vue: {
1615
target: 'browser'
17-
},
18-
babel: {
19-
presets: ['vue', ['@babel/preset-env', { useBuiltIns: 'usage', corejs: 3 }]],
20-
plugins: ['@babel/plugin-transform-runtime'],
21-
babelHelpers: 'runtime',
22-
configFile: false
23-
},
24-
'node-resolve': true
25-
},
26-
resolvePlugins: {
27-
string: require('rollup-plugin-string').string
28-
},
29-
external: 'crypto'
16+
}
17+
}
3018
}
19+
export default config

docs/using_with_components.md

Lines changed: 3 additions & 3 deletions

examples/advanced/custom-sort.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Grid } from '../../dist/index.esm.js'
1+
import { Grid } from '../../dist/main.esm.js'
22

33
export default {
44
name: 'CustomSort',

examples/advanced/events.mjs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Grid } from '../../dist/index.esm.js'
1+
import { Grid } from '../../dist/main.esm.js'
22

33
export default {
44
name: 'Events',
@@ -20,13 +20,15 @@ export default {
2020
},
2121
mounted() {
2222
this.$nextTick(() => {
23-
this.$refs.myGrid.grid.on('rowClick', (...args) => {
24-
console.log(`row: ${JSON.stringify(args)}`)
25-
})
23+
if (this.$refs.myGrid && this.$refs.myGrid.grid) {
24+
this.$refs.myGrid.grid.on('rowClick', (...args) => {
25+
console.log(`row: ${JSON.stringify(args)}`)
26+
})
2627

27-
this.$refs.myGrid.grid.on('cellClick', (...args) => {
28-
console.log(`cell: ${JSON.stringify(args)}`)
29-
})
28+
this.$refs.myGrid.grid.on('cellClick', (...args) => {
29+
console.log(`cell: ${JSON.stringify(args)}`)
30+
})
31+
}
3032
})
3133
},
3234
template: `

examples/advanced/force-render.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Grid } from '../../dist/index.esm.js'
1+
import { Grid } from '../../dist/main.esm.js'
22

33
export default {
44
name: 'ForceRender',

0 commit comments

Comments
 (0)