vue-slim-tables 0.0.4 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.yml +28 -0
- package/README.md +49 -2
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +1 -1
- package/package.json +22 -17
- package/src/js/components/loading_row.vue +22 -0
- package/src/js/components/table.vue +151 -0
- package/src/js/index.js +1 -1
- package/src/stylesheets/index.scss +89 -13
- package/src/js/components/VueSlimTable.vue +0 -112
package/.eslintrc.yml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
extends:
|
|
2
|
+
- airbnb-base
|
|
3
|
+
- plugin:vue/base
|
|
4
|
+
- plugin:vue/recommended
|
|
5
|
+
- plugin:vue/strongly-recommended
|
|
6
|
+
plugins:
|
|
7
|
+
- vue
|
|
8
|
+
env:
|
|
9
|
+
browser: true
|
|
10
|
+
parserOptions:
|
|
11
|
+
ecmaVersion: 2019
|
|
12
|
+
rules:
|
|
13
|
+
semi:
|
|
14
|
+
- error
|
|
15
|
+
- never
|
|
16
|
+
vue/html-closing-bracket-newline:
|
|
17
|
+
- error
|
|
18
|
+
- { singleline: never, multiline: never }
|
|
19
|
+
vue/html-indent:
|
|
20
|
+
- error
|
|
21
|
+
- 2
|
|
22
|
+
- { alignAttributesVertically: false }
|
|
23
|
+
vue/max-attributes-per-line:
|
|
24
|
+
- error
|
|
25
|
+
- { singleline: 3, multiline: { max: 3 } }
|
|
26
|
+
vue/multi-word-component-names:
|
|
27
|
+
- error
|
|
28
|
+
- ignores: ['table']
|
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Vue Slim Tables
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Installation & basic usage
|
|
4
|
+
```sh
|
|
5
|
+
yarn add vue-slim-tables
|
|
6
|
+
// or
|
|
7
|
+
npm install vue-slim-tables
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<template>
|
|
12
|
+
<VueSlimTables :columns="columns" remote="/users" />
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
created() {
|
|
18
|
+
this.columns = [
|
|
19
|
+
{ key: 'id', title: 'ID' },
|
|
20
|
+
{ key: 'name', title: 'Name' },
|
|
21
|
+
{ key: 'phone', title: 'Phone' }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Props
|
|
29
|
+
| Prop | Type | Required | Description |
|
|
30
|
+
| - | - | - | - |
|
|
31
|
+
| columns | Array | true | Array of column objects described below |
|
|
32
|
+
| source | [String, Function] | true | `string` is for async fetching rows<br/>`function` for more complicated async load |
|
|
33
|
+
| perPage | Number | false | Number or rows to display |
|
|
34
|
+
|
|
35
|
+
#### Column object
|
|
36
|
+
| Key | Type | Required | Description |
|
|
37
|
+
| - | - | - | - |
|
|
38
|
+
| key | String | true | `Uniq` key that used for ordering and slots |
|
|
39
|
+
| title | String | true | Displayed in thead |
|
|
40
|
+
| orderable | Boolean | false | Ordering by column `key` |
|
|
41
|
+
|
|
42
|
+
### Slots
|
|
43
|
+
| Slot | Props | Description |
|
|
44
|
+
| - | - | - |
|
|
45
|
+
| #head:${column.key} | { column } | Rewrite column thead with custom html |
|
|
46
|
+
| #row | { row, index, columns } | Rewrite whole row |
|
|
47
|
+
| #row:empty | - | Rewrite empty table row markup |
|
|
48
|
+
| #row:loading | - | Rewrite loading table rows markup |
|
|
49
|
+
| #cell:${column.key} | { row, index, column, value } | Rewrite cell with custom html |
|
|
50
|
+
| #pagination | { page, rows } | Rewrite pagination with your own implementation |
|
package/dist/bundle.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@keyframes moving-gradient{0%{background-position:-250px 0}100%{background-position:250px 0}}.
|
|
1
|
+
@keyframes moving-gradient{0%{background-position:-250px 0}100%{background-position:250px 0}}.vst-th{line-height:20px}.vst-orderable:hover{cursor:pointer}.vst-orderable:hover .vst-orderable-toggle{color:#555 !important}.vst-orderable-toggle{font-size:20px;float:right;color:#ccc !important}.vst-orderable-toggle:after{content:" \2194";display:inline-block;transform:rotate(-90deg)}.vst-orderable-toggle.desc:after{content:" \2191";transform:rotate(0)}.vst-orderable-toggle.asc:after{content:" \2193";transform:rotate(0)}.vst-loading-row div{height:20px;background:linear-gradient(to right, #eee 20%, #ddd 50%, #eee 80%);background-size:500px 20px;animation-name:moving-gradient;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear;animation-fill-mode:forwards}.vst tr td.vst-loading-row-1 div{animation-delay:-1000ms}.vst tr td.vst-loading-row-2 div{animation-delay:-900ms}.vst tr td.vst-loading-row-3 div{animation-delay:-800ms}.vst tr td.vst-loading-row-4 div{animation-delay:-700ms}.vst tr td.vst-loading-row-5 div{animation-delay:-600ms}.vst tr td.vst-loading-row-6 div{animation-delay:-500ms}.vst tr td.vst-loading-row-7 div{animation-delay:-400ms}.vst tr td.vst-loading-row-8 div{animation-delay:-300ms}.vst tr td.vst-loading-row-9 div{animation-delay:-200ms}.vst tr td.vst-loading-row-10 div{animation-delay:-100ms}.vst-pagination{display:flex;padding-left:0;list-style:none;border-radius:0.25rem}.vst-pagination a{position:relative;display:block;padding:8px 12px;padding:0.5rem 0.75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.vst-pagination a:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.vst-page-item.disabled .vst-page-link{pointer-events:none;color:#6c757d;cursor:auto;background-color:#fff}.vst-page-item .vst-page-link{cursor:pointer}
|
|
2
2
|
|
package/dist/bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueSlimTable=t():e.VueSlimTable=t()}(window,(function(){return(()=>{var e={56:(e,t,r)=>{"use strict";r.r(t);r(145);var n=r(129),a=r.n(n),i=r(582);const s=function(e,t,r,n,a,i,s,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):a&&(l=o?function(){a.call(this,this.$root.$options.shadowRoot)}:a),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}({props:{columns:{type:Array,required:!0},remoteUrl:String,perPage:{type:Number,default:25},customFilters:{type:Object,default:()=>({})},onFetchedCallback:Function,wrapperClass:String,tableClass:String,emptyRowsClass:String,emptyRowsText:{type:String,default:"No records found"},totalRowsCountKey:{type:String,default:"totalCount"}},data:()=>({page:1,rows:[],rowsTotalCount:0,syncState:"initial"}),methods:{fetchData(e){const t=a().stringify({per_page:this.perPage,page:e,...this.customFilters},{arrayFormat:"brackets"});this.syncState="syncing",this.rows=[],fetch(`${this.remoteUrl}?${t}`).then(e=>e.json()).then(e=>{this.rows=e.rows,this.rowsTotalCount=Math.ceil(e[this.totalRowsCountKey]/this.perPage),this.onFetchedCallback&&this.onFetchedCallback(e),this.syncState="fetched"})}},watch:{page(e){this.fetchData(e)},customFilters(){1===this.page?this.fetchData(1):this.page=1}},components:{paginate:r.n(i)()},mounted(){this.fetchData(this.page)}},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{class:e.wrapperClass},[r("table",{class:e.tableClass},[r("thead",[r("tr",e._l(e.columns,(function(t){return r("th",[e._v(e._s(t.title))])})),0)]),e._v(" "),r("tbody",[e._l(e.rows,(function(t){return r("tr",e._l(e.columns,(function(n){return r("td",[n.component?r(n.component,{tag:"component",attrs:{params:t,value:t[n.key]}}):[e._v(e._s(t[n.key]))]],2)})),0)})),e._v(" "),"fetched"==e.syncState&&0===e.rows.length?r("tr",[r("td",{staticClass:"text-center ",class:e.emptyRowsClass,attrs:{colspan:e.columns.length}},[e._v("\n "+e._s(e.emptyRowsText)+"\n ")])]):e._e(),e._v(" "),"syncing"==e.syncState?e._l(e.perPage,(function(t){return r("tr",[r("td",{staticClass:"vue-slim-tables-loading-row",attrs:{colspan:e.columns.length}},[r("div")])])})):e._e()],2)]),e._v(" "),e.rowsTotalCount>1?r("paginate",{attrs:{"page-count":e.rowsTotalCount,"container-class":"pagination mt-3","page-class":"page-item","page-link-class":"page-link","prev-class":"page-item","prev-link-class":"page-link","next-class":"page-item","next-link-class":"page-link","prev-text":"<-","next-text":"->"},model:{value:e.page,callback:function(t){e.page=t},expression:"page"}}):e._e()],1)}),[],!1,null,null,null).exports;r.d(t,{default:()=>o});const o=s},145:()=>{},798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},129:(e,t,r)=>{"use strict";var n=r(261),a=r(235),i=r(798);e.exports={formats:i,parse:a,stringify:n}},235:(e,t,r)=>{"use strict";var n=r(769),a=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},o=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,s=/(\[[^[\]]*])/.exec(n),o=s?n.slice(0,s.index):n,l=[];if(o){if(!r.plainObjects&&a.call(Object.prototype,o)&&!r.allowPrototypes)return;l.push(o)}for(var c=0;null!==(s=i.exec(n))&&c<r.depth;){if(c+=1,!r.plainObjects&&a.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+n.slice(s.index)+"]"),function(e,t,r){for(var n=t,a=e.length-1;a>=0;--a){var i,s=e[a];if("[]"===s&&r.parseArrays)i=[].concat(n);else{i=r.plainObjects?Object.create(null):{};var o="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(o,10);r.parseArrays||""!==o?!isNaN(l)&&s!==o&&String(l)===o&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[])[l]=n:i[o]=n:i={0:n}}n=i}return n}(l,t,r)}};e.exports=function(e,t){var r=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth?e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,o={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,u=l.split(t.delimiter,c),d=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r<u.length;++r)0===u[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===u[r]?p="utf-8":"utf8=%26%2310003%3B"===u[r]&&(p="iso-8859-1"),d=r,r=u.length);for(r=0;r<u.length;++r)if(r!==d){var f,g,h=u[r],y=h.indexOf("]="),v=-1===y?h.indexOf("="):y+1;-1===v?(f=t.decoder(h,i.decoder,p),g=t.strictNullHandling?null:""):(f=t.decoder(h.slice(0,v),i.decoder,p),g=t.decoder(h.slice(v+1),i.decoder,p)),g&&t.interpretNumericEntities&&"iso-8859-1"===p&&(g=s(g)),g&&t.comma&&g.indexOf(",")>-1&&(g=g.split(",")),a.call(o,f)?o[f]=n.combine(o[f],g):o[f]=g}return o}(e,r):e,c=r.plainObjects?Object.create(null):{},u=Object.keys(l),d=0;d<u.length;++d){var p=u[d],f=o(p,l[p],r);c=n.merge(c,f,r)}return n.compact(c)}},261:(e,t,r)=>{"use strict";var n=r(769),a=r(798),i=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Array.isArray,l=Array.prototype.push,c=function(e,t){l.apply(e,o(t)?t:[t])},u=Date.prototype.toISOString,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,formatter:a.formatters[a.default],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,r,a,i,s,l,u,p,f,g,h,y,v){var m=t;if("function"==typeof u?m=u(r,m):m instanceof Date?m=g(m):"comma"===a&&o(m)&&(m=m.join(",")),null===m){if(i)return l&&!y?l(r,d.encoder,v):r;m=""}if("string"==typeof m||"number"==typeof m||"boolean"==typeof m||n.isBuffer(m))return l?[h(y?r:l(r,d.encoder,v))+"="+h(l(m,d.encoder,v))]:[h(r)+"="+h(String(m))];var b,C=[];if(void 0===m)return C;if(o(u))b=u;else{var x=Object.keys(m);b=p?x.sort(p):x}for(var k=0;k<b.length;++k){var P=b[k];s&&null===m[P]||(o(m)?c(C,e(m[P],"function"==typeof a?a(r,P):r,a,i,s,l,u,p,f,g,h,y,v)):c(C,e(m[P],r+(f?"."+P:"["+P+"]"),a,i,s,l,u,p,f,g,h,y,v)))}return C};e.exports=function(e,t){var r,n=e,l=function(e){if(!e)return d;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=a.default;if(void 0!==e.format){if(!i.call(a.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=a.formatters[r],s=d.filter;return("function"==typeof e.filter||o(e.filter))&&(s=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===e.allowDots?d.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:s,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);"function"==typeof l.filter?n=(0,l.filter)("",n):o(l.filter)&&(r=l.filter);var u,f=[];if("object"!=typeof n||null===n)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var g=s[u];r||(r=Object.keys(n)),l.sort&&r.sort(l.sort);for(var h=0;h<r.length;++h){var y=r[h];l.skipNulls&&null===n[y]||c(f,p(n[y],y,g,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.formatter,l.encodeValuesOnly,l.charset))}var v=f.join(l.delimiter),m=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),v.length>0?m+v:""}},769:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],a=0;a<t.length;++a)for(var i=t[a],s=i.obj[i.prop],o=Object.keys(s),l=0;l<o.length;++l){var c=o[l],u=s[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var a=[],i=0;i<n.length;++i)void 0!==n[i]&&a.push(n[i]);t.obj[t.prop]=a}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r){if(0===e.length)return e;var a="string"==typeof e?e:String(e);if("iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var i="",s=0;s<a.length;++s){var o=a.charCodeAt(s);45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?i+=a.charAt(s):o<128?i+=n[o]:o<2048?i+=n[192|o>>6]+n[128|63&o]:o<55296||o>=57344?i+=n[224|o>>12]+n[128|o>>6&63]+n[128|63&o]:(s+=1,o=65536+((1023&o)<<10|1023&a.charCodeAt(s)),i+=n[240|o>>18]+n[128|o>>12&63]+n[128|o>>6&63]+n[128|63&o])}return i},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(n,i,s){if(!i)return n;if("object"!=typeof i){if(r(n))n.push(i);else{if(!n||"object"!=typeof n)return[n,i];(s&&(s.plainObjects||s.allowPrototypes)||!t.call(Object.prototype,i))&&(n[i]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(i);var o=n;return r(n)&&!r(i)&&(o=a(n,s)),r(n)&&r(i)?(i.forEach((function(r,a){if(t.call(n,a)){var i=n[a];i&&"object"==typeof i&&r&&"object"==typeof r?n[a]=e(i,r,s):n.push(r)}else n[a]=r})),n):Object.keys(i).reduce((function(r,n){var a=i[n];return t.call(r,n)?r[n]=e(r[n],a,s):r[n]=a,r}),o)}}},582:function(e){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=n.default},function(e,t,r){r(2);var n=r(6)(r(7),r(8),"data-v-82963a40",null);e.exports=n.exports},function(e,t,r){var n=r(3);"string"==typeof n&&(n=[[e.id,n,""]]),r(5)(n,{}),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(4)()).push([e.id,"a[data-v-82963a40]{cursor:pointer}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var r=this[t];r[2]?e.push("@media "+r[2]+"{"+r[1]+"}"):e.push(r[1])}return e.join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},a=0;a<this.length;a++){var i=this[a][0];"number"==typeof i&&(n[i]=!0)}for(a=0;a<t.length;a++){var s=t[a];"number"==typeof s[0]&&n[s[0]]||(r&&!s[2]?s[2]=r:r&&(s[2]="("+s[2]+") and ("+r+")"),e.push(s))}},e}},function(e,t,r){function n(e,t){for(var r=0;r<e.length;r++){var n=e[r],a=c[n.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](n.parts[i]);for(;i<n.parts.length;i++)a.parts.push(s(n.parts[i],t))}else{var o=[];for(i=0;i<n.parts.length;i++)o.push(s(n.parts[i],t));c[n.id]={id:n.id,refs:1,parts:o}}}}function a(e){for(var t=[],r={},n=0;n<e.length;n++){var a=e[n],i=a[0],s={css:a[1],media:a[2],sourceMap:a[3]};r[i]?r[i].parts.push(s):t.push(r[i]={id:i,parts:[s]})}return t}function i(e){var t=document.createElement("style");return t.type="text/css",function(e,t){var r=p(),n=h[h.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),h.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(t)}}(e,t),t}function s(e,t){var r,n,a;if(t.singleton){var s=g++;r=f||(f=i(t)),n=o.bind(null,r,s,!1),a=o.bind(null,r,s,!0)}else r=i(t),n=l.bind(null,r),a=function(){!function(e){e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else a()}}function o(e,t,r,n){var a=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=y(t,a);else{var i=document.createTextNode(a),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function l(e,t){var r=t.css,n=t.media,a=t.sourceMap;if(n&&e.setAttribute("media",n),a&&(r+="\n/*# sourceURL="+a.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var c={},u=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},d=u((function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())})),p=u((function(){return document.head||document.getElementsByTagName("head")[0]})),f=null,g=0,h=[];e.exports=function(e,t){void 0===(t=t||{}).singleton&&(t.singleton=d()),void 0===t.insertAt&&(t.insertAt="bottom");var r=a(e);return n(r,t),function(e){for(var i=[],s=0;s<r.length;s++){var o=r[s];(l=c[o.id]).refs--,i.push(l)}for(e&&n(a(e),t),s=0;s<i.length;s++){var l;if(0===(l=i[s]).refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete c[l.id]}}}};var y=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t,r,n){var a,i=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(a=e,i=e.default);var o="function"==typeof i?i.options:i;if(t&&(o.render=t.render,o.staticRenderFns=t.staticRenderFns),r&&(o._scopeId=r),n){var l=o.computed||(o.computed={});Object.keys(n).forEach((function(e){var t=n[e];l[e]=function(){return t}}))}return{esModule:a,exports:i,options:o}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{value:{type:Number},pageCount:{type:Number,required:!0},forcePage:{type:Number},clickHandler:{type:Function,default:function(){}},pageRange:{type:Number,default:3},marginPages:{type:Number,default:1},prevText:{type:String,default:"Prev"},nextText:{type:String,default:"Next"},breakViewText:{type:String,default:"…"},containerClass:{type:String},pageClass:{type:String},pageLinkClass:{type:String},prevClass:{type:String},prevLinkClass:{type:String},nextClass:{type:String},nextLinkClass:{type:String},breakViewClass:{type:String},breakViewLinkClass:{type:String},activeClass:{type:String,default:"active"},disabledClass:{type:String,default:"disabled"},noLiSurround:{type:Boolean,default:!1},firstLastButton:{type:Boolean,default:!1},firstButtonText:{type:String,default:"First"},lastButtonText:{type:String,default:"Last"},hidePrevNext:{type:Boolean,default:!1}},beforeUpdate:function(){void 0!==this.forcePage&&this.forcePage!==this.selected&&(this.selected=this.forcePage)},computed:{selected:{get:function(){return this.value||this.innerValue},set:function(e){this.innerValue=e}},pages:function(){var e=this,t={};if(this.pageCount<=this.pageRange)for(var r=0;r<this.pageCount;r++){var n={index:r,content:r+1,selected:r===this.selected-1};t[r]=n}else{for(var a=Math.floor(this.pageRange/2),i=function(r){var n={index:r,content:r+1,selected:r===e.selected-1};t[r]=n},s=function(e){t[e]={disabled:!0,breakView:!0}},o=0;o<this.marginPages;o++)i(o);var l=0;this.selected-a>0&&(l=this.selected-1-a);var c=l+this.pageRange-1;c>=this.pageCount&&(l=(c=this.pageCount-1)-this.pageRange+1);for(var u=l;u<=c&&u<=this.pageCount-1;u++)i(u);l>this.marginPages&&s(l-1),c+1<this.pageCount-this.marginPages&&s(c+1);for(var d=this.pageCount-1;d>=this.pageCount-this.marginPages;d--)i(d)}return t}},data:function(){return{innerValue:1}},methods:{handlePageSelected:function(e){this.selected!==e&&(this.innerValue=e,this.$emit("input",e),this.clickHandler(e))},prevPage:function(){this.selected<=1||this.handlePageSelected(this.selected-1)},nextPage:function(){this.selected>=this.pageCount||this.handlePageSelected(this.selected+1)},firstPageSelected:function(){return 1===this.selected},lastPageSelected:function(){return this.selected===this.pageCount||0===this.pageCount},selectFirstPage:function(){this.selected<=1||this.handlePageSelected(1)},selectLastPage:function(){this.selected>=this.pageCount||this.handlePageSelected(this.pageCount)}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.noLiSurround?r("div",{class:e.containerClass},[e.firstLastButton?r("a",{class:[e.pageLinkClass,e.firstPageSelected()?e.disabledClass:""],attrs:{tabindex:"0"},domProps:{innerHTML:e._s(e.firstButtonText)},on:{click:function(t){e.selectFirstPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.selectFirstPage():null}}}):e._e(),e._v(" "),e.firstPageSelected()&&e.hidePrevNext?e._e():r("a",{class:[e.prevLinkClass,e.firstPageSelected()?e.disabledClass:""],attrs:{tabindex:"0"},domProps:{innerHTML:e._s(e.prevText)},on:{click:function(t){e.prevPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.prevPage():null}}}),e._v(" "),e._l(e.pages,(function(t){return[t.breakView?r("a",{class:[e.pageLinkClass,e.breakViewLinkClass,t.disabled?e.disabledClass:""],attrs:{tabindex:"0"}},[e._t("breakViewContent",[e._v(e._s(e.breakViewText))])],2):t.disabled?r("a",{class:[e.pageLinkClass,t.selected?e.activeClass:"",e.disabledClass],attrs:{tabindex:"0"}},[e._v(e._s(t.content))]):r("a",{class:[e.pageLinkClass,t.selected?e.activeClass:""],attrs:{tabindex:"0"},on:{click:function(r){e.handlePageSelected(t.index+1)},keyup:function(r){return"button"in r||!e._k(r.keyCode,"enter",13)?void e.handlePageSelected(t.index+1):null}}},[e._v(e._s(t.content))])]})),e._v(" "),e.lastPageSelected()&&e.hidePrevNext?e._e():r("a",{class:[e.nextLinkClass,e.lastPageSelected()?e.disabledClass:""],attrs:{tabindex:"0"},domProps:{innerHTML:e._s(e.nextText)},on:{click:function(t){e.nextPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.nextPage():null}}}),e._v(" "),e.firstLastButton?r("a",{class:[e.pageLinkClass,e.lastPageSelected()?e.disabledClass:""],attrs:{tabindex:"0"},domProps:{innerHTML:e._s(e.lastButtonText)},on:{click:function(t){e.selectLastPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.selectLastPage():null}}}):e._e()],2):r("ul",{class:e.containerClass},[e.firstLastButton?r("li",{class:[e.pageClass,e.firstPageSelected()?e.disabledClass:""]},[r("a",{class:e.pageLinkClass,attrs:{tabindex:e.firstPageSelected()?-1:0},domProps:{innerHTML:e._s(e.firstButtonText)},on:{click:function(t){e.selectFirstPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.selectFirstPage():null}}})]):e._e(),e._v(" "),e.firstPageSelected()&&e.hidePrevNext?e._e():r("li",{class:[e.prevClass,e.firstPageSelected()?e.disabledClass:""]},[r("a",{class:e.prevLinkClass,attrs:{tabindex:e.firstPageSelected()?-1:0},domProps:{innerHTML:e._s(e.prevText)},on:{click:function(t){e.prevPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.prevPage():null}}})]),e._v(" "),e._l(e.pages,(function(t){return r("li",{class:[e.pageClass,t.selected?e.activeClass:"",t.disabled?e.disabledClass:"",t.breakView?e.breakViewClass:""]},[t.breakView?r("a",{class:[e.pageLinkClass,e.breakViewLinkClass],attrs:{tabindex:"0"}},[e._t("breakViewContent",[e._v(e._s(e.breakViewText))])],2):t.disabled?r("a",{class:e.pageLinkClass,attrs:{tabindex:"0"}},[e._v(e._s(t.content))]):r("a",{class:e.pageLinkClass,attrs:{tabindex:"0"},on:{click:function(r){e.handlePageSelected(t.index+1)},keyup:function(r){return"button"in r||!e._k(r.keyCode,"enter",13)?void e.handlePageSelected(t.index+1):null}}},[e._v(e._s(t.content))])])})),e._v(" "),e.lastPageSelected()&&e.hidePrevNext?e._e():r("li",{class:[e.nextClass,e.lastPageSelected()?e.disabledClass:""]},[r("a",{class:e.nextLinkClass,attrs:{tabindex:e.lastPageSelected()?-1:0},domProps:{innerHTML:e._s(e.nextText)},on:{click:function(t){e.nextPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.nextPage():null}}})]),e._v(" "),e.firstLastButton?r("li",{class:[e.pageClass,e.lastPageSelected()?e.disabledClass:""]},[r("a",{class:e.pageLinkClass,attrs:{tabindex:e.lastPageSelected()?-1:0},domProps:{innerHTML:e._s(e.lastButtonText)},on:{click:function(t){e.selectLastPage()},keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13)?void e.selectLastPage():null}}})]):e._e()],2)},staticRenderFns:[]}}])}},t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(56)})()}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueSlimTable=e():t.VueSlimTable=e()}(self,(function(){return(()=>{var t={924:(t,e,r)=>{"use strict";var o=r(210),n=r(559),i=n(o("String.prototype.indexOf"));t.exports=function(t,e){var r=o(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?n(r):r}},559:(t,e,r)=>{"use strict";var o=r(612),n=r(210),i=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),c=n("%Reflect.apply%",!0)||o.call(a,i),p=n("%Object.getOwnPropertyDescriptor%",!0),l=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){var e=c(o,a,arguments);if(p&&l){var r=p(e,"length");r.configurable&&l(e,"length",{value:1+u(0,t.length-(arguments.length-1))})}return e};var f=function(){return c(o,i,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,o=Object.prototype.toString,n="[object Function]";t.exports=function(t){var i=this;if("function"!=typeof i||o.call(i)!==n)throw new TypeError(e+i);for(var a,c=r.call(arguments,1),p=function(){if(this instanceof a){var e=i.apply(this,c.concat(r.call(arguments)));return Object(e)===e?e:this}return i.apply(t,c.concat(r.call(arguments)))},l=Math.max(0,i.length-c.length),u=[],f=0;f<l;f++)u.push("$"+f);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(p),i.prototype){var s=function(){};s.prototype=i.prototype,a.prototype=new s,s.prototype=null}return a}},612:(t,e,r)=>{"use strict";var o=r(648);t.exports=Function.prototype.bind||o},210:(t,e,r)=>{"use strict";var o,n=SyntaxError,i=Function,a=TypeError,c=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var l=function(){throw new a},u=p?function(){try{return l}catch(t){try{return p(arguments,"callee").get}catch(t){return l}}}():l,f=r(405)(),s=Object.getPrototypeOf||function(t){return t.__proto__},y={},d="undefined"==typeof Uint8Array?o:s(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":f?s([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?s(s([][Symbol.iterator]())):o,"%JSON%":"object"==typeof JSON?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?s((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?s((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?s(""[Symbol.iterator]()):o,"%Symbol%":f?Symbol:o,"%SyntaxError%":n,"%ThrowTypeError%":u,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet},h=function t(e){var r;if("%AsyncFunction%"===e)r=c("async function () {}");else if("%GeneratorFunction%"===e)r=c("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=c("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(r=s(n.prototype))}return g[e]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(612),v=r(642),S=m.call(Function.call,Array.prototype.concat),j=m.call(Function.apply,Array.prototype.splice),O=m.call(Function.call,String.prototype.replace),w=m.call(Function.call,String.prototype.slice),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,x=function(t){var e=w(t,0,1),r=w(t,-1);if("%"===e&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new n("invalid intrinsic syntax, expected opening `%`");var o=[];return O(t,A,(function(t,e,r,n){o[o.length]=r?O(n,P,"$1"):e||t})),o},E=function(t,e){var r,o=t;if(v(b,o)&&(o="%"+(r=b[o])[0]+"%"),v(g,o)){var i=g[o];if(i===y&&(i=h(o)),void 0===i&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:i}}throw new n("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');var r=x(t),o=r.length>0?r[0]:"",i=E("%"+o+"%",e),c=i.name,l=i.value,u=!1,f=i.alias;f&&(o=f[0],j(r,S([0,1],f)));for(var s=1,y=!0;s<r.length;s+=1){var d=r[s],h=w(d,0,1),b=w(d,-1);if(('"'===h||"'"===h||"`"===h||'"'===b||"'"===b||"`"===b)&&h!==b)throw new n("property names with quotes must have matching quotes");if("constructor"!==d&&y||(u=!0),v(g,c="%"+(o+="."+d)+"%"))l=g[c];else if(null!=l){if(!(d in l)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(p&&s+1>=r.length){var m=p(l,d);l=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:l[d]}else y=v(l,d),l=l[d];y&&!u&&(g[c]=l)}}return l}},405:(t,e,r)=>{"use strict";var o="undefined"!=typeof Symbol&&Symbol,n=r(419);t.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},642:(t,e,r)=>{"use strict";var o=r(612);t.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},631:(t,e,r)=>{var o="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=o&&n&&"function"==typeof n.get?n.get:null,a=o&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,p=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=c&&p&&"function"==typeof p.get?p.get:null,u=c&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,s="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,g=Object.prototype.toString,h=Function.prototype.toString,b=String.prototype.match,m="function"==typeof BigInt?BigInt.prototype.valueOf:null,v=Object.getOwnPropertySymbols,S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,O=Object.prototype.propertyIsEnumerable,w=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),A=r(654).custom,P=A&&R(A)?A:null,x="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function E(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function k(t){return String(t).replace(/"/g,""")}function _(t){return!("[object Array]"!==I(t)||x&&"object"==typeof t&&x in t)}function R(t){if(j)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!S)return!1;try{return S.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,o,n){var c=r||{};if(N(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(N(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=!N(c,"customInspect")||c.customInspect;if("boolean"!=typeof p&&"symbol"!==p)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(N(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return M(e,c);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var g=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=g&&g>0&&"object"==typeof e)return _(e)?"[Array]":"[Object]";var v=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=Array(t.indent+1).join(" ")}return{base:r,prev:Array(e+1).join(r)}}(c,o);if(void 0===n)n=[];else if(D(n,e)>=0)return"[Circular]";function O(e,r,i){if(r&&(n=n.slice()).push(r),i){var a={depth:c.depth};return N(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),t(e,a,o+1,n)}return t(e,c,o+1,n)}if("function"==typeof e){var A=function(t){if(t.name)return t.name;var e=b.call(h.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),F=B(e,O);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(F.length>0?" { "+F.join(", ")+" }":"")}if(R(e)){var C=j?String(e).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):S.call(e);return"object"!=typeof e||j?C:U(C)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var $="<"+String(e.nodeName).toLowerCase(),G=e.attributes||[],V=0;V<G.length;V++)$+=" "+G[V].name+"="+E(k(G[V].value),"double",c);return $+=">",e.childNodes&&e.childNodes.length&&($+="..."),$+="</"+String(e.nodeName).toLowerCase()+">"}if(_(e)){if(0===e.length)return"[]";var q=B(e,O);return v&&!function(t){for(var e=0;e<t.length;e++)if(D(t[e],"\n")>=0)return!1;return!0}(q)?"["+L(q,v)+"]":"[ "+q.join(", ")+" ]"}if(function(t){return!("[object Error]"!==I(t)||x&&"object"==typeof t&&x in t)}(e)){var H=B(e,O);return 0===H.length?"["+String(e)+"]":"{ ["+String(e)+"] "+H.join(", ")+" }"}if("object"==typeof e&&p){if(P&&"function"==typeof e[P])return e[P]();if("symbol"!==p&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var z=[];return a.call(e,(function(t,r){z.push(O(r,e,!0)+" => "+O(t,e))})),W("Map",i.call(e),z,v)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var Q=[];return u.call(e,(function(t){Q.push(O(t,e))})),W("Set",l.call(e),Q,v)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{s.call(t,s)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return T("WeakMap");if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t,s);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return T("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return T("WeakRef");if(function(t){return!("[object Number]"!==I(t)||x&&"object"==typeof t&&x in t)}(e))return U(O(Number(e)));if(function(t){if(!t||"object"!=typeof t||!m)return!1;try{return m.call(t),!0}catch(t){}return!1}(e))return U(O(m.call(e)));if(function(t){return!("[object Boolean]"!==I(t)||x&&"object"==typeof t&&x in t)}(e))return U(d.call(e));if(function(t){return!("[object String]"!==I(t)||x&&"object"==typeof t&&x in t)}(e))return U(O(String(e)));if(!function(t){return!("[object Date]"!==I(t)||x&&"object"==typeof t&&x in t)}(e)&&!function(t){return!("[object RegExp]"!==I(t)||x&&"object"==typeof t&&x in t)}(e)){var J=B(e,O),X=w?w(e)===Object.prototype:e instanceof Object||e.constructor===Object,K=e instanceof Object?"":"null prototype",Y=!X&&x&&Object(e)===e&&x in e?I(e).slice(8,-1):K?"Object":"",Z=(X||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(Y||K?"["+[].concat(Y||[],K||[]).join(": ")+"] ":"");return 0===J.length?Z+"{}":v?Z+"{"+L(J,v)+"}":Z+"{ "+J.join(", ")+" }"}return String(e)};var F=Object.prototype.hasOwnProperty||function(t){return t in this};function N(t,e){return F.call(t,e)}function I(t){return g.call(t)}function D(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function M(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return M(t.slice(0,e.maxStringLength),e)+o}return E(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,C),"single",e)}function C(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function U(t){return"Object("+t+")"}function T(t){return t+" { ? }"}function W(t,e,r,o){return t+" ("+e+") {"+(o?L(r,o):r.join(", "))+"}"}function L(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+t.join(","+r)+"\n"+e.prev}function B(t,e){var r=_(t),o=[];if(r){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=N(t,n)?e(t[n],t):""}var i,a="function"==typeof v?v(t):[];if(j){i={};for(var c=0;c<a.length;c++)i["$"+a[c]]=a[c]}for(var p in t)N(t,p)&&(r&&String(Number(p))===p&&p<t.length||j&&i["$"+p]instanceof Symbol||(/[^\w$]/.test(p)?o.push(e(p,t)+": "+e(t[p],t)):o.push(p+": "+e(t[p],t))));if("function"==typeof v)for(var l=0;l<a.length;l++)O.call(t,a[l])&&o.push("["+e(a[l])+"]: "+e(t[a[l]],t));return o}},798:t=>{"use strict";var e=String.prototype.replace,r=/%20/g,o="RFC1738",n="RFC3986";t.exports={default:n,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:o,RFC3986:n}},129:(t,e,r)=>{"use strict";var o=r(261),n=r(235),i=r(798);t.exports={formats:i,parse:n,stringify:o}},235:(t,e,r)=>{"use strict";var o=r(769),n=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},p=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},l=function(t,e,r,o){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(i),l=c?i.slice(0,c.index):i,u=[];if(l){if(!r.plainObjects&&n.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var f=0;r.depth>0&&null!==(c=a.exec(i))&&f<r.depth;){if(f+=1,!r.plainObjects&&n.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+i.slice(c.index)+"]"),function(t,e,r,o){for(var n=o?e:p(e,r),i=t.length-1;i>=0;--i){var a,c=t[i];if("[]"===c&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var l="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(l,10);r.parseArrays||""!==l?!isNaN(u)&&c!==l&&String(u)===l&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=n:a[l]=n:a={0:n}}n=a}return n}(u,e,r,o)}};t.exports=function(t,e){var r=function(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof t?function(t,e){var r,l={},u=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,f=e.parameterLimit===1/0?void 0:e.parameterLimit,s=u.split(e.delimiter,f),y=-1,d=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?d="utf-8":"utf8=%26%2310003%3B"===s[r]&&(d="iso-8859-1"),y=r,r=s.length);for(r=0;r<s.length;++r)if(r!==y){var g,h,b=s[r],m=b.indexOf("]="),v=-1===m?b.indexOf("="):m+1;-1===v?(g=e.decoder(b,a.decoder,d,"key"),h=e.strictNullHandling?null:""):(g=e.decoder(b.slice(0,v),a.decoder,d,"key"),h=o.maybeMap(p(b.slice(v+1),e),(function(t){return e.decoder(t,a.decoder,d,"value")}))),h&&e.interpretNumericEntities&&"iso-8859-1"===d&&(h=c(h)),b.indexOf("[]=")>-1&&(h=i(h)?[h]:h),n.call(l,g)?l[g]=o.combine(l[g],h):l[g]=h}return l}(t,r):t,f=r.plainObjects?Object.create(null):{},s=Object.keys(u),y=0;y<s.length;++y){var d=s[y],g=l(d,u[d],r,"string"==typeof t);f=o.merge(f,g,r)}return!0===r.allowSparse?f:o.compact(f)}},261:(t,e,r)=>{"use strict";var o=r(478),n=r(769),i=r(798),a=Object.prototype.hasOwnProperty,c={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},p=Array.isArray,l=String.prototype.split,u=Array.prototype.push,f=function(t,e){u.apply(t,p(e)?e:[e])},s=Date.prototype.toISOString,y=i.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:y,formatter:i.formatters[y],indices:!1,serializeDate:function(t){return s.call(t)},skipNulls:!1,strictNullHandling:!1},g={},h=function t(e,r,i,a,c,u,s,y,h,b,m,v,S,j,O){for(var w,A=e,P=O,x=0,E=!1;void 0!==(P=P.get(g))&&!E;){var k=P.get(e);if(x+=1,void 0!==k){if(k===x)throw new RangeError("Cyclic object value");E=!0}void 0===P.get(g)&&(x=0)}if("function"==typeof s?A=s(r,A):A instanceof Date?A=b(A):"comma"===i&&p(A)&&(A=n.maybeMap(A,(function(t){return t instanceof Date?b(t):t}))),null===A){if(a)return u&&!S?u(r,d.encoder,j,"key",m):r;A=""}if("string"==typeof(w=A)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||n.isBuffer(A)){if(u){var _=S?r:u(r,d.encoder,j,"key",m);if("comma"===i&&S){for(var R=l.call(String(A),","),F="",N=0;N<R.length;++N)F+=(0===N?"":",")+v(u(R[N],d.encoder,j,"value",m));return[v(_)+"="+F]}return[v(_)+"="+v(u(A,d.encoder,j,"value",m))]}return[v(r)+"="+v(String(A))]}var I,D=[];if(void 0===A)return D;if("comma"===i&&p(A))I=[{value:A.length>0?A.join(",")||null:void 0}];else if(p(s))I=s;else{var M=Object.keys(A);I=y?M.sort(y):M}for(var C=0;C<I.length;++C){var U=I[C],T="object"==typeof U&&void 0!==U.value?U.value:A[U];if(!c||null!==T){var W=p(A)?"function"==typeof i?i(r,U):r:r+(h?"."+U:"["+U+"]");O.set(e,x);var L=o();L.set(g,O),f(D,t(T,W,i,a,c,u,s,y,h,b,m,v,S,j,L))}}return D};t.exports=function(t,e){var r,n=t,l=function(t){if(!t)return d;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||d.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==t.format){if(!a.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=i.formatters[r],n=d.filter;return("function"==typeof t.filter||p(t.filter))&&(n=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===t.allowDots?d.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:d.charsetSentinel,delimiter:void 0===t.delimiter?d.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:d.encode,encoder:"function"==typeof t.encoder?t.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:d.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:d.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:d.strictNullHandling}}(e);"function"==typeof l.filter?n=(0,l.filter)("",n):p(l.filter)&&(r=l.filter);var u,s=[];if("object"!=typeof n||null===n)return"";u=e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var y=c[u];r||(r=Object.keys(n)),l.sort&&r.sort(l.sort);for(var g=o(),b=0;b<r.length;++b){var m=r[b];l.skipNulls&&null===n[m]||f(s,h(n[m],m,y,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,g))}var v=s.join(l.delimiter),S=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),v.length>0?S+v:""}},769:(t,e,r)=>{"use strict";var o=r(798),n=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),c=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)void 0!==t[o]&&(r[o]=t[o]);return r};t.exports={arrayToObject:c,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o<e.length;++o)for(var n=e[o],a=n.obj[n.prop],c=Object.keys(a),p=0;p<c.length;++p){var l=c[p],u=a[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(e.push({obj:a,prop:l}),r.push(u))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(i(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,r){var o=t.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,r,n,i){if(0===t.length)return t;var c=t;if("symbol"==typeof t?c=Symbol.prototype.toString.call(t):"string"!=typeof t&&(c=String(t)),"iso-8859-1"===r)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var p="",l=0;l<c.length;++l){var u=c.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===o.RFC1738&&(40===u||41===u)?p+=c.charAt(l):u<128?p+=a[u]:u<2048?p+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?p+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&c.charCodeAt(l)),p+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return p},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(i(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(e(t[o]));return r}return e(t)},merge:function t(e,r,o){if(!r)return e;if("object"!=typeof r){if(i(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(o&&(o.plainObjects||o.allowPrototypes)||!n.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var a=e;return i(e)&&!i(r)&&(a=c(e,o)),i(e)&&i(r)?(r.forEach((function(r,i){if(n.call(e,i)){var a=e[i];a&&"object"==typeof a&&r&&"object"==typeof r?e[i]=t(a,r,o):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var a=r[i];return n.call(e,i)?e[i]=t(e[i],a,o):e[i]=a,e}),a)}}},478:(t,e,r)=>{"use strict";var o=r(210),n=r(924),i=r(631),a=o("%TypeError%"),c=o("%WeakMap%",!0),p=o("%Map%",!0),l=n("WeakMap.prototype.get",!0),u=n("WeakMap.prototype.set",!0),f=n("WeakMap.prototype.has",!0),s=n("Map.prototype.get",!0),y=n("Map.prototype.set",!0),d=n("Map.prototype.has",!0),g=function(t,e){for(var r,o=t;null!==(r=o.next);o=r)if(r.key===e)return o.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,o={assert:function(t){if(!o.has(t))throw new a("Side channel does not contain "+i(t))},get:function(o){if(c&&o&&("object"==typeof o||"function"==typeof o)){if(t)return l(t,o)}else if(p){if(e)return s(e,o)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,o)},has:function(o){if(c&&o&&("object"==typeof o||"function"==typeof o)){if(t)return f(t,o)}else if(p){if(e)return d(e,o)}else if(r)return function(t,e){return!!g(t,e)}(r,o);return!1},set:function(o,n){c&&o&&("object"==typeof o||"function"==typeof o)?(t||(t=new c),u(t,o,n)):p?(e||(e=new p),y(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=g(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o}},654:()=>{}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>a});var t=r(129),e=r.n(t);function n(t,e,r,o,n,i,a,c){var p,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=r,l._compiled=!0),o&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),a?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=p):n&&(p=c?function(){n.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:n),p)if(l.functional){l._injectStyles=p;var u=l.render;l.render=function(t,e){return p.call(e),u(t,e)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,p):[p]}return{exports:t,options:l}}var i=n({props:{columnsLength:{type:Number,required:!0}},data:()=>({randNum:Math.floor(10*Math.random())+1})},(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("tr",[r("td",{class:["vst-loading-row","vst-loading-row-"+t.randNum],attrs:{colspan:t.columnsLength}},[r("div")])])}),[],!1,null,null,null);const a=n({components:{LoadingRow:i.exports},props:{columns:{type:Array,required:!0},source:{type:[String,Function],required:!0},perPage:{type:Number,default:25}},data:()=>({page:1,rows:[],syncState:"initial",orders:{}}),watch:{page:"fetchData",orders:"refetch",perPage:"refetch"},created(){this.fetchData()},methods:{reload(){this.fetchData(this.page)},async fetchData(t=1){const r={per_page:this.perPage,page:t},o=Object.keys(this.orders);let n;if(o.length&&(r.order=o.map((t=>({field:t,direction:this.orders[t]})))),this.syncState="syncing",this.rows=[],"string"==typeof this.source){const t=await fetch(`${this.source}?${e().stringify(r,{arrayFormat:"brackets"})}`);n=await t.json()}else n=await this.source(r);this.rows=n,this.syncState="fetched"},onOrderClick(t){"asc"===this.orders[t]?this.orders={[t]:"desc"}:"desc"===this.orders[t]?this.orders={}:this.orders={[t]:"asc"}},refetch(){1===this.page?this.fetchData(1):this.page=1}}},(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("table",{staticClass:"vst"},[t.columns.length?r("thead",[r("tr",t._l(t.columns,(function(e){return r("th",{key:e.key,class:["vst-th",{"vst-orderable":e.orderable}],on:{click:function(r){r.preventDefault(),e.orderable&&t.onOrderClick(e.key)}}},[t._t("head:"+e.key,(function(){return[t._v("\n "+t._s(e.title)+"\n ")]}),{column:e}),t._v(" "),e.orderable?r("a",{class:"vst-orderable-toggle "+(t.orders[e.key]||""),attrs:{href:"#"}}):t._e()],2)})),0)]):t._e(),t._v(" "),r("tbody",[t._l(t.rows,(function(e,o){return t._t("row",(function(){return[r("tr",{key:e.id||o},t._l(t.columns,(function(n){return r("td",{key:n.key},[t._t("cell:"+n.key,(function(){return[t._v("\n "+t._s(e[n.key])+"\n ")]}),{row:e,value:e[n.key],column:n,index:o})],2)})),0)]}),{row:e,index:o,columns:t.columns})})),t._v(" "),"fetched"===t.syncState&&0===t.rows.length?t._t("row:empty",(function(){return[r("tr",[r("td",{attrs:{colspan:t.columns.length}},[t._v("\n No records found\n ")])])]})):t._e(),t._v(" "),"syncing"===t.syncState?t._t("row:loading",(function(){return t._l(t.perPage,(function(e,o){return r("LoadingRow",{key:"loadingRow"+o,attrs:{"columns-length":t.columns.length}})}))})):t._e()],2),t._v(" "),r("tfoot",[r("tr",[r("td",{attrs:{colspan:t.columns.length}},[t._t("pagination",(function(){return[t.page>1||t.rows.length===t.perPage?r("ul",{staticClass:"vst-pagination mt-3"},[r("li",{class:["vst-page-item",{disabled:1===t.page}]},[r("a",{staticClass:"vst-page-link",on:{click:function(e){e.preventDefault(),t.page-=1}}},[t._v("←")])]),t._v(" "),r("li",{class:["vst-page-item",{disabled:t.rows.length<t.perPage}]},[r("a",{staticClass:"vst-page-link",on:{click:function(e){e.preventDefault(),t.page+=1}}},[t._v("→")])])]):t._e()]}),{page:t.page,rows:t.rows})],2)])])])}),[],!1,null,null,null).exports})(),o})()}));
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-slim-tables",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"main": "dist/bundle.js",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "rm -rf ./dist && NODE_ENV=production webpack --config ./webpack.config.js"
|
|
6
|
+
"build": "rm -rf ./dist && NODE_ENV=production webpack --config ./webpack.config.js",
|
|
7
|
+
"eslint": "eslint ./src/js/ --ext 'js,vue'",
|
|
8
|
+
"lint": "yarn run eslint --fix"
|
|
7
9
|
},
|
|
8
10
|
"keywords": [
|
|
9
11
|
"vue",
|
|
@@ -18,22 +20,25 @@
|
|
|
18
20
|
"license": "MIT",
|
|
19
21
|
"private": false,
|
|
20
22
|
"devDependencies": {
|
|
21
|
-
"@babel/core": "^7.
|
|
22
|
-
"babel-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
23
|
+
"@babel/core": "^7.16.7",
|
|
24
|
+
"babel-loader": "^8.2.3",
|
|
25
|
+
"css-loader": "^6.5.1",
|
|
26
|
+
"eslint": "^8.6.0",
|
|
27
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
28
|
+
"eslint-plugin-import": "^2.25.4",
|
|
29
|
+
"eslint-plugin-vue": "8.2.0",
|
|
30
|
+
"mini-css-extract-plugin": "^2.4.6",
|
|
31
|
+
"node-sass": "^7.0.1",
|
|
32
|
+
"sass-loader": "^12.4.0",
|
|
33
|
+
"style-loader": "^3.3.1",
|
|
34
|
+
"vue": "^2.6.14",
|
|
35
|
+
"vue-loader": "^15.9.8",
|
|
36
|
+
"vue-template-compiler": "^2.6.14",
|
|
37
|
+
"webpack": "^5.65.0",
|
|
38
|
+
"webpack-cli": "^4.9.1",
|
|
39
|
+
"webpack-dev-server": "^4.7.2"
|
|
35
40
|
},
|
|
36
41
|
"dependencies": {
|
|
37
|
-
"
|
|
42
|
+
"qs": "^6.10.2"
|
|
38
43
|
}
|
|
39
44
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tr>
|
|
3
|
+
<td
|
|
4
|
+
:colspan="columnsLength"
|
|
5
|
+
:class="['vst-loading-row', `vst-loading-row-${randNum}`]">
|
|
6
|
+
<div />
|
|
7
|
+
</td>
|
|
8
|
+
</tr>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
props: {
|
|
14
|
+
columnsLength: { type: Number, required: true },
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
randNum: Math.floor(Math.random() * 10) + 1,
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<table class="vst">
|
|
3
|
+
<thead v-if="columns.length">
|
|
4
|
+
<tr>
|
|
5
|
+
<th
|
|
6
|
+
v-for="column in columns"
|
|
7
|
+
:key="column.key"
|
|
8
|
+
:class="['vst-th', { 'vst-orderable': column.orderable }]"
|
|
9
|
+
@click.prevent="column.orderable ? onOrderClick(column.key) : null">
|
|
10
|
+
<slot
|
|
11
|
+
:name="`head:${column.key}`"
|
|
12
|
+
:column="column">
|
|
13
|
+
{{ column.title }}
|
|
14
|
+
</slot>
|
|
15
|
+
<a
|
|
16
|
+
v-if="column.orderable"
|
|
17
|
+
href="#"
|
|
18
|
+
:class="`vst-orderable-toggle ${orders[column.key] || ''}`" />
|
|
19
|
+
</th>
|
|
20
|
+
</tr>
|
|
21
|
+
</thead>
|
|
22
|
+
<tbody>
|
|
23
|
+
<slot
|
|
24
|
+
v-for="(row, i) in rows"
|
|
25
|
+
name="row"
|
|
26
|
+
:row="row"
|
|
27
|
+
:index="i"
|
|
28
|
+
:columns="columns">
|
|
29
|
+
<tr :key="row.id || i">
|
|
30
|
+
<td
|
|
31
|
+
v-for="column in columns"
|
|
32
|
+
:key="column.key">
|
|
33
|
+
<slot
|
|
34
|
+
:name="`cell:${column.key}`"
|
|
35
|
+
:row="row"
|
|
36
|
+
:value="row[column.key]"
|
|
37
|
+
:column="column"
|
|
38
|
+
:index="i">
|
|
39
|
+
{{ row[column.key] }}
|
|
40
|
+
</slot>
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
</slot>
|
|
44
|
+
|
|
45
|
+
<slot v-if="syncState === 'fetched' && rows.length === 0" name="row:empty">
|
|
46
|
+
<tr>
|
|
47
|
+
<td :colspan="columns.length">
|
|
48
|
+
No records found
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
</slot>
|
|
52
|
+
|
|
53
|
+
<slot v-if="syncState === 'syncing'" name="row:loading">
|
|
54
|
+
<LoadingRow
|
|
55
|
+
v-for="(row, i) in perPage"
|
|
56
|
+
:key="`loadingRow${i}`"
|
|
57
|
+
:columns-length="columns.length" />
|
|
58
|
+
</slot>
|
|
59
|
+
</tbody>
|
|
60
|
+
<tfoot>
|
|
61
|
+
<tr>
|
|
62
|
+
<td :colspan="columns.length">
|
|
63
|
+
<slot name="pagination" :page="page" :rows="rows">
|
|
64
|
+
<ul v-if="page > 1 || rows.length === perPage" class="vst-pagination mt-3">
|
|
65
|
+
<li :class="['vst-page-item', { disabled: page === 1 }]">
|
|
66
|
+
<a class="vst-page-link" @click.prevent="page -= 1">←</a>
|
|
67
|
+
</li>
|
|
68
|
+
|
|
69
|
+
<li :class="['vst-page-item', { disabled: rows.length < perPage }]">
|
|
70
|
+
<a class="vst-page-link" @click.prevent="page += 1">→</a>
|
|
71
|
+
</li>
|
|
72
|
+
</ul>
|
|
73
|
+
</slot>
|
|
74
|
+
</td>
|
|
75
|
+
</tr>
|
|
76
|
+
</tfoot>
|
|
77
|
+
</table>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script>
|
|
81
|
+
import qs from 'qs'
|
|
82
|
+
import LoadingRow from './loading_row.vue'
|
|
83
|
+
|
|
84
|
+
export default {
|
|
85
|
+
components: { LoadingRow },
|
|
86
|
+
props: {
|
|
87
|
+
columns: { type: Array, required: true },
|
|
88
|
+
source: { type: [String, Function], required: true },
|
|
89
|
+
perPage: { type: Number, default: 25 },
|
|
90
|
+
},
|
|
91
|
+
data() {
|
|
92
|
+
return {
|
|
93
|
+
page: 1,
|
|
94
|
+
rows: [],
|
|
95
|
+
syncState: 'initial',
|
|
96
|
+
orders: {},
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
watch: {
|
|
100
|
+
page: 'fetchData',
|
|
101
|
+
orders: 'refetch',
|
|
102
|
+
perPage: 'refetch',
|
|
103
|
+
},
|
|
104
|
+
created() {
|
|
105
|
+
this.fetchData()
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
reload() {
|
|
109
|
+
this.fetchData(this.page)
|
|
110
|
+
},
|
|
111
|
+
async fetchData(page = 1) {
|
|
112
|
+
const params = { per_page: this.perPage, page }
|
|
113
|
+
|
|
114
|
+
const orderKeys = Object.keys(this.orders)
|
|
115
|
+
if (orderKeys.length) {
|
|
116
|
+
params.order = orderKeys.map((key) => ({ field: key, direction: this.orders[key] }))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
this.syncState = 'syncing'
|
|
120
|
+
this.rows = []
|
|
121
|
+
|
|
122
|
+
let data
|
|
123
|
+
if (typeof this.source === 'string') {
|
|
124
|
+
const response = await fetch(`${this.source}?${qs.stringify(params, { arrayFormat: 'brackets' })}`)
|
|
125
|
+
data = await response.json()
|
|
126
|
+
} else {
|
|
127
|
+
data = await this.source(params)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.rows = data
|
|
131
|
+
this.syncState = 'fetched'
|
|
132
|
+
},
|
|
133
|
+
onOrderClick(key) {
|
|
134
|
+
if (this.orders[key] === 'asc') {
|
|
135
|
+
this.orders = { [key]: 'desc' }
|
|
136
|
+
} else if (this.orders[key] === 'desc') {
|
|
137
|
+
this.orders = {}
|
|
138
|
+
} else {
|
|
139
|
+
this.orders = { [key]: 'asc' }
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
refetch() {
|
|
143
|
+
if (this.page === 1) {
|
|
144
|
+
this.fetchData(1)
|
|
145
|
+
} else {
|
|
146
|
+
this.page = 1
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
</script>
|
package/src/js/index.js
CHANGED
|
@@ -3,19 +3,95 @@
|
|
|
3
3
|
100% { background-position: 250px 0; }
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
.vst {
|
|
7
|
+
&-th {
|
|
8
|
+
line-height: 20px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&-orderable:hover {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
|
|
14
|
+
.vst-orderable-toggle {
|
|
15
|
+
color: #555 !important;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-orderable-toggle {
|
|
20
|
+
font-size: 20px;
|
|
21
|
+
float: right;
|
|
22
|
+
color: #ccc !important;
|
|
23
|
+
|
|
24
|
+
&:after {
|
|
25
|
+
content: " \2194";
|
|
26
|
+
display: inline-block;
|
|
27
|
+
transform: rotate(-90deg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.desc:after {
|
|
31
|
+
content: " \2191";
|
|
32
|
+
transform: rotate(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.asc:after {
|
|
36
|
+
content: " \2193";
|
|
37
|
+
transform: rotate(0);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-loading-row div {
|
|
42
|
+
height: 20px;
|
|
43
|
+
background: linear-gradient(to right, #eee 20%, #ddd 50%, #eee 80%);
|
|
44
|
+
background-size: 500px 20px;
|
|
45
|
+
animation-name: moving-gradient;
|
|
46
|
+
animation-duration: 1s;
|
|
47
|
+
animation-iteration-count: infinite;
|
|
48
|
+
animation-timing-function: linear;
|
|
49
|
+
animation-fill-mode: forwards;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
tr td.vst-loading-row {
|
|
53
|
+
@for $i from 1 through 10 {
|
|
54
|
+
&-#{$i} div {
|
|
55
|
+
animation-delay: #{($i - 11)*100}ms;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-pagination {
|
|
61
|
+
display: flex;
|
|
62
|
+
padding-left: 0;
|
|
63
|
+
list-style: none;
|
|
64
|
+
border-radius: 0.25rem;
|
|
65
|
+
|
|
66
|
+
a {
|
|
67
|
+
position: relative;
|
|
68
|
+
display: block;
|
|
69
|
+
padding: 8px 12px;
|
|
70
|
+
padding: 0.5rem 0.75rem;
|
|
71
|
+
margin-left: -1px;
|
|
72
|
+
line-height: 1.25;
|
|
73
|
+
color: #007bff;
|
|
74
|
+
background-color: #fff;
|
|
75
|
+
border: 1px solid #dee2e6;
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
z-index: 2;
|
|
79
|
+
color: #0056b3;
|
|
80
|
+
text-decoration: none;
|
|
81
|
+
background-color: #e9ecef;
|
|
82
|
+
border-color: #dee2e6;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&-page-item.disabled .vst-page-link {
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
color: #6c757d;
|
|
90
|
+
cursor: auto;
|
|
91
|
+
background-color: #fff;
|
|
92
|
+
}
|
|
16
93
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
animation-delay: #{($i - 11)*100}ms;
|
|
94
|
+
&-page-item .vst-page-link {
|
|
95
|
+
cursor: pointer;
|
|
20
96
|
}
|
|
21
97
|
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="wrapperClass">
|
|
3
|
-
<table :class="tableClass">
|
|
4
|
-
<thead>
|
|
5
|
-
<tr>
|
|
6
|
-
<th v-for="col in columns">{{ col.title }}</th>
|
|
7
|
-
</tr>
|
|
8
|
-
</thead>
|
|
9
|
-
<tbody>
|
|
10
|
-
<tr v-for="row in rows">
|
|
11
|
-
<td v-for="col in columns">
|
|
12
|
-
<component v-if="col.component" :is="col.component" :params="row" :value="row[col.key]" />
|
|
13
|
-
<template v-else>{{row[col.key]}}</template>
|
|
14
|
-
</td>
|
|
15
|
-
</tr>
|
|
16
|
-
|
|
17
|
-
<tr v-if="syncState == 'fetched' && rows.length === 0">
|
|
18
|
-
<td :colspan="columns.length" class="text-center " :class="emptyRowsClass">
|
|
19
|
-
{{ emptyRowsText }}
|
|
20
|
-
</td>
|
|
21
|
-
</tr>
|
|
22
|
-
|
|
23
|
-
<template v-if="syncState == 'syncing'">
|
|
24
|
-
<tr v-for="row in perPage">
|
|
25
|
-
<td :colspan="columns.length" class="vue-slim-tables-loading-row">
|
|
26
|
-
<div></div>
|
|
27
|
-
</td>
|
|
28
|
-
</tr>
|
|
29
|
-
</template>
|
|
30
|
-
</tbody>
|
|
31
|
-
</table>
|
|
32
|
-
<paginate
|
|
33
|
-
v-if="rowsTotalCount > 1"
|
|
34
|
-
v-model="page"
|
|
35
|
-
:page-count="rowsTotalCount"
|
|
36
|
-
container-class="pagination mt-3"
|
|
37
|
-
page-class="page-item"
|
|
38
|
-
page-link-class="page-link"
|
|
39
|
-
prev-class="page-item"
|
|
40
|
-
prev-link-class="page-link"
|
|
41
|
-
next-class="page-item"
|
|
42
|
-
next-link-class="page-link"
|
|
43
|
-
prev-text="<-"
|
|
44
|
-
next-text="->"
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<script>
|
|
50
|
-
import qs from 'qs'
|
|
51
|
-
import VuejsPaginate from 'vuejs-paginate'
|
|
52
|
-
|
|
53
|
-
export default {
|
|
54
|
-
props: {
|
|
55
|
-
columns: { type: Array, required: true },
|
|
56
|
-
remoteUrl: String,
|
|
57
|
-
perPage: { type: Number, default: 25 },
|
|
58
|
-
customFilters: { type: Object, default() { return {} } },
|
|
59
|
-
onFetchedCallback: Function,
|
|
60
|
-
wrapperClass: String,
|
|
61
|
-
tableClass: String,
|
|
62
|
-
emptyRowsClass: String,
|
|
63
|
-
emptyRowsText: { type: String, default: 'No records found' },
|
|
64
|
-
totalRowsCountKey: { type: String, default: 'totalCount' }
|
|
65
|
-
},
|
|
66
|
-
data() {
|
|
67
|
-
return {
|
|
68
|
-
page: 1,
|
|
69
|
-
rows: [],
|
|
70
|
-
rowsTotalCount: 0,
|
|
71
|
-
syncState: 'initial'
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
fetchData(page) {
|
|
76
|
-
const params = qs.stringify({
|
|
77
|
-
per_page: this.perPage,
|
|
78
|
-
page: page,
|
|
79
|
-
...this.customFilters
|
|
80
|
-
}, { arrayFormat: 'brackets' })
|
|
81
|
-
|
|
82
|
-
this.syncState = 'syncing'
|
|
83
|
-
this.rows = []
|
|
84
|
-
|
|
85
|
-
fetch(`${this.remoteUrl}?${params}`)
|
|
86
|
-
.then(res => res.json())
|
|
87
|
-
.then(res => {
|
|
88
|
-
this.rows = res.rows
|
|
89
|
-
this.rowsTotalCount = Math.ceil(res[this.totalRowsCountKey] / this.perPage)
|
|
90
|
-
this.onFetchedCallback && this.onFetchedCallback(res)
|
|
91
|
-
this.syncState = 'fetched'
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
watch: {
|
|
96
|
-
page(val) {
|
|
97
|
-
this.fetchData(val)
|
|
98
|
-
},
|
|
99
|
-
customFilters() {
|
|
100
|
-
if (this.page === 1) {
|
|
101
|
-
this.fetchData(1)
|
|
102
|
-
} else {
|
|
103
|
-
this.page = 1
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
components: { paginate: VuejsPaginate },
|
|
108
|
-
mounted() {
|
|
109
|
-
this.fetchData(this.page)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
</script>
|