gridjs-vue
Advanced tools
Comparing version 0.3.5 to 0.4.0
@@ -1,2 +0,2 @@ | ||
import"core-js/modules/es.array.concat";import"core-js/modules/es.object.to-string";import"core-js/modules/es.promise";import"core-js/modules/es.regexp.exec";import"core-js/modules/es.string.search";import{Grid as e}from"gridjs";import{nanoid as t}from"nanoid";import i from"element-ready";import s from"gridjs/dist/theme/mermaid.css";import n from"vue-runtime-helpers/dist/normalize-component.mjs";import r from"vue-runtime-helpers/dist/inject-style/browser.mjs";function o(){}function a(e,t,i){return i?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var d=n({render:function(){var e=this.$createElement;return(this._self._c||e)("article",{class:"gridjs__wrapper",attrs:{id:"gridjs__"+this.uuid,"data-uuid":this.uuid}})},staticRenderFns:[]},(function(e){e&&e("data-v-6fbdeeb2_0",{source:".gridjs__wrapper[data-v-6fbdeeb2]{align-items:center;display:flex;height:fit-content;justify-content:center;width:100%}",map:void 0,media:void 0})}),{name:"Grid",props:{autoWidth:{type:Boolean,default:!0},classNames:{type:Object,default:void 0},cols:{type:Array,default:void 0},from:{type:[String,Function],default:void 0},language:{type:Object,default:void 0},pagination:{type:[Object,Boolean],default:!1},rows:{type:[Array,Function],default:void 0},search:{type:Boolean,default:!1},server:{type:[Object,Function],default:void 0},sort:{type:[Object,Boolean],default:!1},styles:{type:Object,default:void 0},theme:{type:String,default:"mermaid"},width:{type:String,default:"100%"}},data:function(){return{dict:{error:{columnsUndefined:"Column headers are undefined",rowsUndefined:"No data to display"}},grid:null,uuid:null,wrapper:null,themes:{mermaid:s}}},computed:{options:function(){var e={autoWidth:this.autoWidth,columns:this.cols?this.cols:[this.dict.error.columnsUndefined],data:this.rows?this.rows:this.from||this.server?void 0:[[this.dict.error.rowsUndefined]],pagination:this.pagination,sort:this.sort,width:this.width};return this.classNames&&(e.className=this.classNames),this.from&&(e.from="string"==typeof this.from?document.querySelector(this.from):document.createRange().createContextualFragment(this.from)),this.language&&(e.language=this.language),this.search&&(e.search=this.search),this.server&&(e.server=this.server),this.styles&&(e.style=this.styles),e}},watch:{autoWidth:function(){this.update()},classNames:function(){this.update()},cols:function(){this.update()},from:function(){this.update()},language:function(){this.update()},pagination:function(){this.update()},rows:function(){this.update()},search:function(){this.update()},server:function(){this.update()},sort:function(){this.update()},styles:function(){this.update()},width:function(){this.update()}},mounted:function(){try{var s=this;return s.uuid=t(),a(i('[data-uuid="'.concat(s.uuid,'"]'),{stopOnDomReady:!1}),(function(t){return s.wrapper=t,i=function(){s.wrapper&&(s.options.data||s.options.from||s.options.server)&&(s.grid=new e(s.options).render(s.wrapper))},(n=function(){if("none"!==s.theme)return function(e,t){if(!t)return e&&e.then?e.then(o):Promise.resolve()}(s.assignTheme())}())&&n.then?n.then(i):i(n);var i,n}))}catch(e){return Promise.reject(e)}},destroyed:function(){this.grid=void 0,this.wrapper=void 0},methods:{assignTheme:function(){try{var e=document.getElementsByTagName("head")[0],t="gridjs__".concat(this.uuid),i=document.createRange().createContextualFragment('\n <style title="'.concat(t,'_theme" type="text/css">\n ').concat(this.themes[this.theme],"\n </style>\n "));for(var s in e.appendChild(i),document.styleSheets)document.styleSheets[s].title==="".concat(t,"_theme")&&(i=document.styleSheets[s]);if(i instanceof CSSStyleSheet)for(var n in i.cssRules){var r=i.cssRules[n].cssText;if(r&&!/@/g.test(r)){var o="#".concat(t," ").concat(r);i.deleteRule(n),i.insertRule(o,n)}}return a()}catch(e){return Promise.reject(e)}},update:function(){this.grid.updateConfig(this.options).forceRender()}}},"data-v-6fbdeeb2",!1,void 0,!1,r,void 0,void 0);function u(e){u.installed||(u.installed=!0,e.component("Grid",d))}var c={install:u},l=null;"undefined"!=typeof window?l=window.Vue:"undefined"!=typeof global&&(l=global.Vue),l&&l.use(c);export default d;export{u as install}; | ||
import{Grid as t,createRef as e,h as i,html as s}from"gridjs";import"core-js/modules/es.array.concat";import"core-js/modules/es.object.to-string";import"core-js/modules/es.promise";import"core-js/modules/es.regexp.exec";import"core-js/modules/es.string.search";import{nanoid as r}from"nanoid";import n from"element-ready";import o from"gridjs/dist/theme/mermaid.css";import a from"vue-runtime-helpers/dist/normalize-component.mjs";import d from"vue-runtime-helpers/dist/inject-style/browser.mjs";function u(){}function c(t,e,i){return i?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}var l=a({render:function(){var t=this.$createElement;return(this._self._c||t)("article",{class:"gridjs__wrapper",attrs:{id:"gridjs__"+this.uuid,"data-uuid":this.uuid}})},staticRenderFns:[]},(function(t){t&&t("data-v-fc3dc69a_0",{source:".gridjs__wrapper[data-v-fc3dc69a]{align-items:center;display:flex;height:fit-content;justify-content:center;width:100%}",map:void 0,media:void 0})}),{name:"Grid",props:{autoWidth:{type:Boolean,default:!0},classNames:{type:Object,default:void 0},cols:{type:Array,default:void 0},from:{type:[String,Function],default:void 0},language:{type:Object,default:void 0},pagination:{type:[Object,Boolean],default:!1},rows:{type:[Array,Function],default:void 0},search:{type:Boolean,default:!1},server:{type:[Object,Function],default:void 0},sort:{type:[Object,Boolean],default:!1},styles:{type:Object,default:void 0},theme:{type:String,default:"mermaid"},width:{type:String,default:"100%"}},data:function(){return{dict:{error:{columnsUndefined:"Column headers are undefined",rowsUndefined:"No data to display"}},grid:null,uuid:null,wrapper:null,themes:{mermaid:o}}},computed:{options:function(){var t={autoWidth:this.autoWidth,columns:this.cols?this.cols:[this.dict.error.columnsUndefined],data:this.rows?this.rows:this.from||this.server?void 0:[[this.dict.error.rowsUndefined]],pagination:this.pagination,sort:this.sort,width:this.width};return this.classNames&&(t.className=this.classNames),this.from&&(t.from="string"==typeof this.from?document.querySelector(this.from):document.createRange().createContextualFragment(this.from())),this.language&&(t.language=this.language),this.search&&(t.search=this.search),this.server&&(t.server=this.server),this.styles&&(t.style=this.styles),t}},watch:{autoWidth:function(){this.update()},classNames:function(){this.update()},cols:function(){this.update()},from:function(){this.update()},language:function(){this.update()},pagination:function(){this.update()},rows:function(){this.update()},search:function(){this.update()},server:function(){this.update()},sort:function(){this.update()},styles:function(){this.update()},width:function(){this.update()}},mounted:function(){try{var e=this;return e.uuid=r(),c(n('[data-uuid="'.concat(e.uuid,'"]'),{stopOnDomReady:!1}),(function(i){return e.wrapper=i,s=function(){e.wrapper&&(e.options.data||e.options.from||e.options.server)&&(e.grid=new t(e.options).render(e.wrapper))},(r=function(){if("none"!==e.theme)return function(t,e){if(!e)return t&&t.then?t.then(u):Promise.resolve()}(e.assignTheme())}())&&r.then?r.then(s):s(r);var s,r}))}catch(t){return Promise.reject(t)}},destroyed:function(){this.grid=void 0,this.wrapper=void 0},methods:{assignTheme:function(){try{var t=document.getElementsByTagName("head")[0],e="gridjs__".concat(this.uuid),i=document.createRange().createContextualFragment('\n <style title="'.concat(e,'_theme" type="text/css">\n ').concat(this.themes[this.theme],"\n </style>\n "));for(var s in t.appendChild(i),document.styleSheets)document.styleSheets[s].title==="".concat(e,"_theme")&&(i=document.styleSheets[s]);if(i instanceof CSSStyleSheet)for(var r in i.cssRules){var n=i.cssRules[r].cssText;if(n&&!/@/g.test(n)){var o="#".concat(e," ").concat(n);i.deleteRule(r),i.insertRule(o,r)}}return c()}catch(t){return Promise.reject(t)}},update:function(){this.grid.updateConfig(this.options).forceRender()}}},"data-v-fc3dc69a",!1,void 0,!1,d,void 0,void 0);function h(t){h.installed||(h.installed=!0,t.component("Grid",l),t.prototype.$gridjs||(t.prototype.$gridjs={createRef:e,h:i,html:s}))}var m={install:h},p=null;"undefined"!=typeof window?p=window.Vue:"undefined"!=typeof global&&(p=global.Vue),p&&p.use(m);export default l;export{l as Grid,m as GridGlobal,h as install}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("core-js/modules/es.array.concat"),require("core-js/modules/es.object.to-string"),require("core-js/modules/es.promise"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.search");var t=require("gridjs"),i=require("nanoid"),r=e(require("element-ready")),n=e(require("gridjs/dist/theme/mermaid.css")),s=e(require("vue-runtime-helpers/dist/normalize-component.mjs")),o=e(require("vue-runtime-helpers/dist/inject-style/browser.mjs"));function a(){}function u(e,t,i){return i?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var d=s({render:function(){var e=this.$createElement;return(this._self._c||e)("article",{class:"gridjs__wrapper",attrs:{id:"gridjs__"+this.uuid,"data-uuid":this.uuid}})},staticRenderFns:[]},(function(e){e&&e("data-v-6fbdeeb2_0",{source:".gridjs__wrapper[data-v-6fbdeeb2]{align-items:center;display:flex;height:fit-content;justify-content:center;width:100%}",map:void 0,media:void 0})}),{name:"Grid",props:{autoWidth:{type:Boolean,default:!0},classNames:{type:Object,default:void 0},cols:{type:Array,default:void 0},from:{type:[String,Function],default:void 0},language:{type:Object,default:void 0},pagination:{type:[Object,Boolean],default:!1},rows:{type:[Array,Function],default:void 0},search:{type:Boolean,default:!1},server:{type:[Object,Function],default:void 0},sort:{type:[Object,Boolean],default:!1},styles:{type:Object,default:void 0},theme:{type:String,default:"mermaid"},width:{type:String,default:"100%"}},data:function(){return{dict:{error:{columnsUndefined:"Column headers are undefined",rowsUndefined:"No data to display"}},grid:null,uuid:null,wrapper:null,themes:{mermaid:n}}},computed:{options:function(){var e={autoWidth:this.autoWidth,columns:this.cols?this.cols:[this.dict.error.columnsUndefined],data:this.rows?this.rows:this.from||this.server?void 0:[[this.dict.error.rowsUndefined]],pagination:this.pagination,sort:this.sort,width:this.width};return this.classNames&&(e.className=this.classNames),this.from&&(e.from="string"==typeof this.from?document.querySelector(this.from):document.createRange().createContextualFragment(this.from)),this.language&&(e.language=this.language),this.search&&(e.search=this.search),this.server&&(e.server=this.server),this.styles&&(e.style=this.styles),e}},watch:{autoWidth:function(){this.update()},classNames:function(){this.update()},cols:function(){this.update()},from:function(){this.update()},language:function(){this.update()},pagination:function(){this.update()},rows:function(){this.update()},search:function(){this.update()},server:function(){this.update()},sort:function(){this.update()},styles:function(){this.update()},width:function(){this.update()}},mounted:function(){try{var e=this;return e.uuid=i.nanoid(),u(r('[data-uuid="'.concat(e.uuid,'"]'),{stopOnDomReady:!1}),(function(i){return e.wrapper=i,r=function(){e.wrapper&&(e.options.data||e.options.from||e.options.server)&&(e.grid=new t.Grid(e.options).render(e.wrapper))},(n=function(){if("none"!==e.theme)return function(e,t){if(!t)return e&&e.then?e.then(a):Promise.resolve()}(e.assignTheme())}())&&n.then?n.then(r):r(n);var r,n}))}catch(e){return Promise.reject(e)}},destroyed:function(){this.grid=void 0,this.wrapper=void 0},methods:{assignTheme:function(){try{var e=document.getElementsByTagName("head")[0],t="gridjs__".concat(this.uuid),i=document.createRange().createContextualFragment('\n <style title="'.concat(t,'_theme" type="text/css">\n ').concat(this.themes[this.theme],"\n </style>\n "));for(var r in e.appendChild(i),document.styleSheets)document.styleSheets[r].title==="".concat(t,"_theme")&&(i=document.styleSheets[r]);if(i instanceof CSSStyleSheet)for(var n in i.cssRules){var s=i.cssRules[n].cssText;if(s&&!/@/g.test(s)){var o="#".concat(t," ").concat(s);i.deleteRule(n),i.insertRule(o,n)}}return u()}catch(e){return Promise.reject(e)}},update:function(){this.grid.updateConfig(this.options).forceRender()}}},"data-v-6fbdeeb2",!1,void 0,!1,o,void 0,void 0);function c(e){c.installed||(c.installed=!0,e.component("Grid",d))}var l={install:c},h=null;"undefined"!=typeof window?h=window.Vue:"undefined"!=typeof global&&(h=global.Vue),h&&h.use(l),exports.default=d,exports.install=c; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("gridjs");require("core-js/modules/es.array.concat"),require("core-js/modules/es.object.to-string"),require("core-js/modules/es.promise"),require("core-js/modules/es.regexp.exec"),require("core-js/modules/es.string.search");var i=require("nanoid"),r=e(require("element-ready")),s=e(require("gridjs/dist/theme/mermaid.css")),n=e(require("vue-runtime-helpers/dist/normalize-component.mjs")),o=e(require("vue-runtime-helpers/dist/inject-style/browser.mjs"));function a(){}function d(e,t,i){return i?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var u=n({render:function(){var e=this.$createElement;return(this._self._c||e)("article",{class:"gridjs__wrapper",attrs:{id:"gridjs__"+this.uuid,"data-uuid":this.uuid}})},staticRenderFns:[]},(function(e){e&&e("data-v-fc3dc69a_0",{source:".gridjs__wrapper[data-v-fc3dc69a]{align-items:center;display:flex;height:fit-content;justify-content:center;width:100%}",map:void 0,media:void 0})}),{name:"Grid",props:{autoWidth:{type:Boolean,default:!0},classNames:{type:Object,default:void 0},cols:{type:Array,default:void 0},from:{type:[String,Function],default:void 0},language:{type:Object,default:void 0},pagination:{type:[Object,Boolean],default:!1},rows:{type:[Array,Function],default:void 0},search:{type:Boolean,default:!1},server:{type:[Object,Function],default:void 0},sort:{type:[Object,Boolean],default:!1},styles:{type:Object,default:void 0},theme:{type:String,default:"mermaid"},width:{type:String,default:"100%"}},data:function(){return{dict:{error:{columnsUndefined:"Column headers are undefined",rowsUndefined:"No data to display"}},grid:null,uuid:null,wrapper:null,themes:{mermaid:s}}},computed:{options:function(){var e={autoWidth:this.autoWidth,columns:this.cols?this.cols:[this.dict.error.columnsUndefined],data:this.rows?this.rows:this.from||this.server?void 0:[[this.dict.error.rowsUndefined]],pagination:this.pagination,sort:this.sort,width:this.width};return this.classNames&&(e.className=this.classNames),this.from&&(e.from="string"==typeof this.from?document.querySelector(this.from):document.createRange().createContextualFragment(this.from())),this.language&&(e.language=this.language),this.search&&(e.search=this.search),this.server&&(e.server=this.server),this.styles&&(e.style=this.styles),e}},watch:{autoWidth:function(){this.update()},classNames:function(){this.update()},cols:function(){this.update()},from:function(){this.update()},language:function(){this.update()},pagination:function(){this.update()},rows:function(){this.update()},search:function(){this.update()},server:function(){this.update()},sort:function(){this.update()},styles:function(){this.update()},width:function(){this.update()}},mounted:function(){try{var e=this;return e.uuid=i.nanoid(),d(r('[data-uuid="'.concat(e.uuid,'"]'),{stopOnDomReady:!1}),(function(i){return e.wrapper=i,r=function(){e.wrapper&&(e.options.data||e.options.from||e.options.server)&&(e.grid=new t.Grid(e.options).render(e.wrapper))},(s=function(){if("none"!==e.theme)return function(e,t){if(!t)return e&&e.then?e.then(a):Promise.resolve()}(e.assignTheme())}())&&s.then?s.then(r):r(s);var r,s}))}catch(e){return Promise.reject(e)}},destroyed:function(){this.grid=void 0,this.wrapper=void 0},methods:{assignTheme:function(){try{var e=document.getElementsByTagName("head")[0],t="gridjs__".concat(this.uuid),i=document.createRange().createContextualFragment('\n <style title="'.concat(t,'_theme" type="text/css">\n ').concat(this.themes[this.theme],"\n </style>\n "));for(var r in e.appendChild(i),document.styleSheets)document.styleSheets[r].title==="".concat(t,"_theme")&&(i=document.styleSheets[r]);if(i instanceof CSSStyleSheet)for(var s in i.cssRules){var n=i.cssRules[s].cssText;if(n&&!/@/g.test(n)){var o="#".concat(t," ").concat(n);i.deleteRule(s),i.insertRule(o,s)}}return d()}catch(e){return Promise.reject(e)}},update:function(){this.grid.updateConfig(this.options).forceRender()}}},"data-v-fc3dc69a",!1,void 0,!1,o,void 0,void 0);function c(e){c.installed||(c.installed=!0,e.component("Grid",u),e.prototype.$gridjs||(e.prototype.$gridjs={createRef:t.createRef,h:t.h,html:t.html}))}var l={install:c},h=null;"undefined"!=typeof window?h=window.Vue:"undefined"!=typeof global&&(h=global.Vue),h&&h.use(l),exports.Grid=u,exports.GridGlobal=l,exports.default=u,exports.install=c; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "gridjs-vue", | ||
"description": "A Vue.js wrapper component for Grid.js", | ||
"version": "0.3.5", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -32,3 +32,3 @@ "private": false, | ||
"element-ready": "^4.1.1", | ||
"gridjs": "^1.8.0", | ||
"gridjs": "^1.11.0", | ||
"nanoid": "^3.1.10", | ||
@@ -41,6 +41,6 @@ "vue-runtime-helpers": "1.1.2" | ||
"devDependencies": { | ||
"@babel/core": "^7.10.3", | ||
"@babel/preset-env": "^7.10.3", | ||
"@babel/core": "^7.10.4", | ||
"@babel/preset-env": "^7.10.4", | ||
"@release-it/keep-a-changelog": "^1.1.1", | ||
"@vue/compiler-sfc": "^3.0.0-beta.15", | ||
"@vue/compiler-sfc": "^3.0.0-beta.20", | ||
"@vue/eslint-config-prettier": "^6.0.0", | ||
@@ -53,17 +53,18 @@ "babel-eslint": "^10.1.0", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^7.3.1", | ||
"eslint": "^7.4.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"leasot": "^11.1.0", | ||
"prettier": "^2.0.5", | ||
"release-it": "^13.6.3", | ||
"rollup": "^2.18.1", | ||
"release-it": "^13.6.5", | ||
"rollup": "^2.21.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-commonjs": "^9.3.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^4.2.0", | ||
"rollup-plugin-string": "^3.0.0", | ||
"rollup-plugin-vue": "^5.0.0", | ||
"typescript": "^3.9.5", | ||
"typescript": "^3.9.6", | ||
"vue-template-compiler": "^2.6.11" | ||
} | ||
} |
@@ -7,2 +7,4 @@ # gridjs-vue | ||
[![npm](https://img.shields.io/npm/v/gridjs-vue?color=41B883&label=current&style=flat-square)](https://www.npmjs.com/package/gridjs-vue) [![Grid.js API version](https://img.shields.io/github/package-json/dependency-version/grid-js/gridjs-vue/gridjs?color=41B883&label=grid.js%20api&style=flat-square)](https://gridjs.io/docs/index) [![David](https://img.shields.io/david/grid-js/gridjs-vue?color=41B883&style=flat-square)](https://david-dm.org/grid-js/gridjs-vue) ![GitHub last commit](https://img.shields.io/github/last-commit/grid-js/gridjs-vue?color=41B883&style=flat-square) [![GitHub issues](https://img.shields.io/github/issues/grid-js/gridjs-vue?color=41B883&style=flat-square)](https://github.com/grid-js/gridjs-vue/issues) [![Discord](https://img.shields.io/discord/711188165850955858?color=41B883&style=flat-square&label=discord)](https://discord.com/invite/K55BwDY) | ||
## Install | ||
@@ -34,5 +36,5 @@ | ||
/* in `main.js` or wherever you specify your global components */ | ||
import Grid from 'gridjs-vue' | ||
import { GridGlobal } from 'gridjs-vue' | ||
Vue.use(Grid) | ||
Vue.use(GridGlobal) | ||
``` | ||
@@ -42,5 +44,5 @@ | ||
Pass `cols` (an array of column headers) and either `rows`, `from`, or `server` as a data source to the component. Everything else is optional. | ||
Pass `cols` (an array of column headers) and either `rows`, `from`, or `server` as a data source to the component. Everything else is optional. Pass in new data to update the table. | ||
Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific configuration options. | ||
Refer to [Grid.js documentation](https://gridjs.io/docs/config/) for specific configuration options. This module may lag behind the main Grid.js module somewhat, so check the API version badge at the top of this README. | ||
@@ -75,2 +77,41 @@ ### Basic Example | ||
### Grid.js Helper Functions | ||
If you install the component as a plugin, rather than importing it directly into your component, the following helpers are added to the Vue prototype and are available globally. | ||
#### `this.$gridjs.createRef` | ||
Returns a [reference to the Grid.js instance](https://gridjs.io/docs/examples/stock-market). | ||
```js | ||
const ref = this.$gridjs.createRef | ||
``` | ||
#### `this.$gridjs.h` | ||
Renders a [Preact virtual DOM instance](https://gridjs.io/docs/examples/virtual-dom). | ||
```js | ||
{ | ||
name: 'Actions', | ||
formatter: (cell, row) => { | ||
return this.$gridjs.h('button', { | ||
className: 'py-2 mb-4 px-4 border rounded-md text-white bg-blue-600', | ||
onClick: () => alert(`Editing "${row.cells[0].data}" "${row.cells[1].data}"`) | ||
} 'Edit'); | ||
} | ||
} | ||
``` | ||
#### `this.$gridjs.html` | ||
Renders [HTML in a formatter function](https://gridjs.io/docs/examples/html-cells). | ||
```js | ||
{ | ||
name: 'Name', | ||
formatter: (cell) => this.$gridjs.html(`<b>${cell}</b>`) | ||
} | ||
``` | ||
### Default Options | ||
@@ -139,5 +180,6 @@ | ||
name: 'Column 2', | ||
id: 'col2' | ||
id: 'col2', | ||
formatter: (cell) => this.$gridjs.html(`<b>${cell}</b>`) | ||
} | ||
] | ||
], | ||
@@ -154,3 +196,3 @@ // AND EITHER an array containing row data (`data` in the Grid.js API) | ||
{ col1: 'row 2', col2: 'row 2' } | ||
] | ||
], | ||
@@ -163,3 +205,3 @@ // OR a function returning an array of row data | ||
] | ||
} | ||
}, | ||
@@ -177,3 +219,3 @@ // OR a string of an HTML table selector to import | ||
` | ||
} | ||
}, | ||
@@ -180,0 +222,0 @@ // OR a server settings function or object |
@@ -1,2 +0,3 @@ | ||
import component from './gridjs-vue.vue' | ||
import { createRef, h, html } from 'gridjs' | ||
import Grid from './gridjs-vue.vue' | ||
@@ -6,3 +7,12 @@ export function install(Vue) { | ||
install.installed = true | ||
Vue.component('Grid', component) | ||
Vue.component('Grid', Grid) | ||
if (!Vue.prototype.$gridjs) { | ||
Vue.prototype.$gridjs = { | ||
createRef, | ||
h, | ||
html | ||
} | ||
} | ||
} | ||
@@ -15,2 +25,3 @@ | ||
let GlobalVue = null | ||
if (typeof window !== 'undefined') { | ||
@@ -21,2 +32,3 @@ GlobalVue = window.Vue | ||
} | ||
if (GlobalVue) { | ||
@@ -26,2 +38,3 @@ GlobalVue.use(plugin) | ||
export default component | ||
export { Grid, plugin as GridGlobal } | ||
export default Grid |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
647509
13
4952
268
26
8
9
Updatedgridjs@^1.11.0