vue-laravel-crud 1.4.31 → 1.4.33
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/dist/vue-laravel-crud.esm.js +75 -12
- package/dist/vue-laravel-crud.min.js +9 -3
- package/dist/vue-laravel-crud.ssr.js +74 -15
- package/package.json +8 -7
- package/src/vue-laravel-crud.vue +40 -13
|
@@ -17305,7 +17305,21 @@ var moment$1 = {
|
|
|
17305
17305
|
})));
|
|
17306
17306
|
} (moment$1));
|
|
17307
17307
|
|
|
17308
|
-
var moment = momentExports;var
|
|
17308
|
+
var moment = momentExports;var vueInfiniteLoadingExports = {};
|
|
17309
|
+
var vueInfiniteLoading = {
|
|
17310
|
+
get exports(){ return vueInfiniteLoadingExports; },
|
|
17311
|
+
set exports(v){ vueInfiniteLoadingExports = v; },
|
|
17312
|
+
};/*!
|
|
17313
|
+
* vue-infinite-loading v2.4.5
|
|
17314
|
+
* (c) 2016-2020 PeachScript
|
|
17315
|
+
* MIT License
|
|
17316
|
+
*/
|
|
17317
|
+
|
|
17318
|
+
(function (module, exports) {
|
|
17319
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i});},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(t,e,n){var i=n(6);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0, n(3).default)("6223ff68",i,!0,{});},function(t,e,n){var i=n(8);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0, n(3).default)("27f0e51f",i,!0,{});},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var a=(o=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),r=i.sources.map((function(t){return "/*# sourceURL="+i.sourceRoot+t+" */"}));return [n].concat(r).concat([a]).join("\n")}var o;return [n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},a=0;a<this.length;a++){var r=this[a][0];"number"==typeof r&&(i[r]=!0);}for(a=0;a<t.length;a++){var o=t[a];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),e.push(o));}},e};},function(t,e,n){function i(t,e){for(var n=[],i={},a=0;a<e.length;a++){var r=e[a],o=r[0],s={id:t+":"+a,css:r[1],media:r[2],sourceMap:r[3]};i[o]?i[o].parts.push(s):n.push(i[o]={id:o,parts:[s]});}return n}n.r(e),n.d(e,"default",(function(){return f}));var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r={},o=a&&(document.head||document.getElementsByTagName("head")[0]),s=null,l=0,d=!1,c=function(){},u=null,p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,n,a){d=n,u=a||{};var o=i(t,e);return b(o),function(e){for(var n=[],a=0;a<o.length;a++){var s=o[a];(l=r[s.id]).refs--,n.push(l);}e?b(o=i(t,e)):o=[];for(a=0;a<n.length;a++){var l;if(0===(l=n[a]).refs){for(var d=0;d<l.parts.length;d++)l.parts[d]();delete r[l.id];}}}}function b(t){for(var e=0;e<t.length;e++){var n=t[e],i=r[n.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](n.parts[a]);for(;a<n.parts.length;a++)i.parts.push(m(n.parts[a]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length);}else {var o=[];for(a=0;a<n.parts.length;a++)o.push(m(n.parts[a]));r[n.id]={id:n.id,refs:1,parts:o};}}}function h(){var t=document.createElement("style");return t.type="text/css",o.appendChild(t),t}function m(t){var e,n,i=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(i){if(d)return c;i.parentNode.removeChild(i);}if(p){var a=l++;i=s||(s=h()),e=w.bind(null,i,a,!1),n=w.bind(null,i,a,!0);}else i=h(),e=y.bind(null,i),n=function(){i.parentNode.removeChild(i);};return e(t),function(i){if(i){if(i.css===t.css&&i.media===t.media&&i.sourceMap===t.sourceMap)return;e(t=i);}else n();}}var g,v=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,i){var a=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=v(e,a);else {var r=document.createTextNode(a),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r);}}function y(t,e){var n=e.css,i=e.media,a=e.sourceMap;if(i&&t.setAttribute("media",i),u.ssrId&&t.setAttribute("data-vue-ssr-id",e.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else {for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n));}}},function(t,e){function n(e){return "function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n;},function(t,e,n){n.r(e);var i=n(0),a=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}));}(r);e.default=a.a;},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,'.loading-wave-dots[data-v-46b20d22]{position:relative}.loading-wave-dots[data-v-46b20d22] .wave-item{position:absolute;top:50%;left:50%;display:inline-block;margin-top:-4px;width:8px;height:8px;border-radius:50%;-webkit-animation:loading-wave-dots-data-v-46b20d22 linear 2.8s infinite;animation:loading-wave-dots-data-v-46b20d22 linear 2.8s infinite}.loading-wave-dots[data-v-46b20d22] .wave-item:first-child{margin-left:-36px}.loading-wave-dots[data-v-46b20d22] .wave-item:nth-child(2){margin-left:-20px;-webkit-animation-delay:.14s;animation-delay:.14s}.loading-wave-dots[data-v-46b20d22] .wave-item:nth-child(3){margin-left:-4px;-webkit-animation-delay:.28s;animation-delay:.28s}.loading-wave-dots[data-v-46b20d22] .wave-item:nth-child(4){margin-left:12px;-webkit-animation-delay:.42s;animation-delay:.42s}.loading-wave-dots[data-v-46b20d22] .wave-item:last-child{margin-left:28px;-webkit-animation-delay:.56s;animation-delay:.56s}@-webkit-keyframes loading-wave-dots-data-v-46b20d22{0%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}10%{-webkit-transform:translateY(-6px);transform:translateY(-6px);background:#999}20%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}to{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}}@keyframes loading-wave-dots-data-v-46b20d22{0%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}10%{-webkit-transform:translateY(-6px);transform:translateY(-6px);background:#999}20%{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}to{-webkit-transform:translateY(0);transform:translateY(0);background:#bbb}}.loading-circles[data-v-46b20d22] .circle-item{width:5px;height:5px;-webkit-animation:loading-circles-data-v-46b20d22 linear .75s infinite;animation:loading-circles-data-v-46b20d22 linear .75s infinite}.loading-circles[data-v-46b20d22] .circle-item:first-child{margin-top:-14.5px;margin-left:-2.5px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(2){margin-top:-11.26px;margin-left:6.26px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(3){margin-top:-2.5px;margin-left:9.5px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(4){margin-top:6.26px;margin-left:6.26px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(5){margin-top:9.5px;margin-left:-2.5px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(6){margin-top:6.26px;margin-left:-11.26px}.loading-circles[data-v-46b20d22] .circle-item:nth-child(7){margin-top:-2.5px;margin-left:-14.5px}.loading-circles[data-v-46b20d22] .circle-item:last-child{margin-top:-11.26px;margin-left:-11.26px}@-webkit-keyframes loading-circles-data-v-46b20d22{0%{background:#dfdfdf}90%{background:#505050}to{background:#dfdfdf}}@keyframes loading-circles-data-v-46b20d22{0%{background:#dfdfdf}90%{background:#505050}to{background:#dfdfdf}}.loading-bubbles[data-v-46b20d22] .bubble-item{background:#666;-webkit-animation:loading-bubbles-data-v-46b20d22 linear .75s infinite;animation:loading-bubbles-data-v-46b20d22 linear .75s infinite}.loading-bubbles[data-v-46b20d22] .bubble-item:first-child{margin-top:-12.5px;margin-left:-.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(2){margin-top:-9.26px;margin-left:8.26px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(3){margin-top:-.5px;margin-left:11.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(4){margin-top:8.26px;margin-left:8.26px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(5){margin-top:11.5px;margin-left:-.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(6){margin-top:8.26px;margin-left:-9.26px}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(7){margin-top:-.5px;margin-left:-12.5px}.loading-bubbles[data-v-46b20d22] .bubble-item:last-child{margin-top:-9.26px;margin-left:-9.26px}@-webkit-keyframes loading-bubbles-data-v-46b20d22{0%{width:1px;height:1px;box-shadow:0 0 0 3px #666}90%{width:1px;height:1px;box-shadow:0 0 0 0 #666}to{width:1px;height:1px;box-shadow:0 0 0 3px #666}}@keyframes loading-bubbles-data-v-46b20d22{0%{width:1px;height:1px;box-shadow:0 0 0 3px #666}90%{width:1px;height:1px;box-shadow:0 0 0 0 #666}to{width:1px;height:1px;box-shadow:0 0 0 3px #666}}.loading-default[data-v-46b20d22]{position:relative;border:1px solid #999;-webkit-animation:loading-rotating-data-v-46b20d22 ease 1.5s infinite;animation:loading-rotating-data-v-46b20d22 ease 1.5s infinite}.loading-default[data-v-46b20d22]:before{content:"";position:absolute;display:block;top:0;left:50%;margin-top:-3px;margin-left:-3px;width:6px;height:6px;background-color:#999;border-radius:50%}.loading-spiral[data-v-46b20d22]{border:2px solid #777;border-right-color:transparent;-webkit-animation:loading-rotating-data-v-46b20d22 linear .85s infinite;animation:loading-rotating-data-v-46b20d22 linear .85s infinite}@-webkit-keyframes loading-rotating-data-v-46b20d22{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotating-data-v-46b20d22{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.loading-bubbles[data-v-46b20d22],.loading-circles[data-v-46b20d22]{position:relative}.loading-bubbles[data-v-46b20d22] .bubble-item,.loading-circles[data-v-46b20d22] .circle-item{position:absolute;top:50%;left:50%;display:inline-block;border-radius:50%}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(2),.loading-circles[data-v-46b20d22] .circle-item:nth-child(2){-webkit-animation-delay:93ms;animation-delay:93ms}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(3),.loading-circles[data-v-46b20d22] .circle-item:nth-child(3){-webkit-animation-delay:.186s;animation-delay:.186s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(4),.loading-circles[data-v-46b20d22] .circle-item:nth-child(4){-webkit-animation-delay:.279s;animation-delay:.279s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(5),.loading-circles[data-v-46b20d22] .circle-item:nth-child(5){-webkit-animation-delay:.372s;animation-delay:.372s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(6),.loading-circles[data-v-46b20d22] .circle-item:nth-child(6){-webkit-animation-delay:.465s;animation-delay:.465s}.loading-bubbles[data-v-46b20d22] .bubble-item:nth-child(7),.loading-circles[data-v-46b20d22] .circle-item:nth-child(7){-webkit-animation-delay:.558s;animation-delay:.558s}.loading-bubbles[data-v-46b20d22] .bubble-item:last-child,.loading-circles[data-v-46b20d22] .circle-item:last-child{-webkit-animation-delay:.651s;animation-delay:.651s}',""]);},function(t,e,n){n.r(e);var i=n(1),a=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}));}(r);e.default=a.a;},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,".infinite-loading-container[data-v-644ea9c9]{clear:both;text-align:center}.infinite-loading-container[data-v-644ea9c9] [class^=loading-]{display:inline-block;margin:5px 0;width:28px;height:28px;font-size:28px;line-height:28px;border-radius:50%}.btn-try-infinite[data-v-644ea9c9]{margin-top:5px;padding:5px 10px;color:#999;font-size:14px;line-height:1;background:transparent;border:1px solid #ccc;border-radius:3px;outline:none;cursor:pointer}.btn-try-infinite[data-v-644ea9c9]:not(:active):hover{opacity:.8}",""]);},function(t,e,n){n.r(e);var i={throttleLimit:50,loopCheckTimeout:1e3,loopCheckMaxCalls:10},a=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){return t={passive:!0},!0}});window.addEventListener("testpassive",e,e),window.remove("testpassive",e,e);}catch(t){}return t}(),r={STATE_CHANGER:["emit `loaded` and `complete` event through component instance of `$refs` may cause error, so it will be deprecated soon, please use the `$state` argument instead (`$state` just the special `$event` variable):","\ntemplate:",'<infinite-loading @infinite="infiniteHandler"></infinite-loading>',"\nscript:\n...\ninfiniteHandler($state) {\n ajax('https://www.example.com/api/news')\n .then((res) => {\n if (res.data.length) {\n $state.loaded();\n } else {\n $state.complete();\n }\n });\n}\n...","","more details: https://github.com/PeachScript/vue-infinite-loading/issues/57#issuecomment-324370549"].join("\n"),INFINITE_EVENT:"`:on-infinite` property will be deprecated soon, please use `@infinite` event instead.",IDENTIFIER:"the `reset` event will be deprecated soon, please reset this component by change the `identifier` property."},o={INFINITE_LOOP:["executed the callback function more than ".concat(i.loopCheckMaxCalls," times for a short time, it looks like searched a wrong scroll wrapper that doest not has fixed height or maximum height, please check it. If you want to force to set a element as scroll wrapper ranther than automatic searching, you can do this:"),'\n\x3c!-- add a special attribute for the real scroll wrapper --\x3e\n<div infinite-wrapper>\n ...\n \x3c!-- set force-use-infinite-wrapper --\x3e\n <infinite-loading force-use-infinite-wrapper></infinite-loading>\n</div>\nor\n<div class="infinite-wrapper">\n ...\n \x3c!-- set force-use-infinite-wrapper as css selector of the real scroll wrapper --\x3e\n <infinite-loading force-use-infinite-wrapper=".infinite-wrapper"></infinite-loading>\n</div>\n ',"more details: https://github.com/PeachScript/vue-infinite-loading/issues/55#issuecomment-316934169"].join("\n")},s={READY:0,LOADING:1,COMPLETE:2,ERROR:3},l={color:"#666",fontSize:"14px",padding:"10px 0"},d={mode:"development",props:{spinner:"default",distance:100,forceUseInfiniteWrapper:!1},system:i,slots:{noResults:"No results :(",noMore:"No more data :)",error:"Opps, something went wrong :(",errorBtnText:"Retry",spinner:""},WARNINGS:r,ERRORS:o,STATUS:s},c=n(4),u=n.n(c),p={BUBBLES:{render:function(t){return t("span",{attrs:{class:"loading-bubbles"}},Array.apply(Array,Array(8)).map((function(){return t("span",{attrs:{class:"bubble-item"}})})))}},CIRCLES:{render:function(t){return t("span",{attrs:{class:"loading-circles"}},Array.apply(Array,Array(8)).map((function(){return t("span",{attrs:{class:"circle-item"}})})))}},DEFAULT:{render:function(t){return t("i",{attrs:{class:"loading-default"}})}},SPIRAL:{render:function(t){return t("i",{attrs:{class:"loading-spiral"}})}},WAVEDOTS:{render:function(t){return t("span",{attrs:{class:"loading-wave-dots"}},Array.apply(Array,Array(5)).map((function(){return t("span",{attrs:{class:"wave-item"}})})))}}};function f(t,e,n,i,a,r,o,s){var l,d="function"==typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=n,d._compiled=!0),i&&(d.functional=!0),r&&(d._scopeId="data-v-"+r),o?(l=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__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o);},d._ssrRegister=l):a&&(l=s?function(){a.call(this,this.$root.$options.shadowRoot);}:a),l)if(d.functional){d._injectStyles=l;var c=d.render;d.render=function(t,e){return l.call(e),c(t,e)};}else {var u=d.beforeCreate;d.beforeCreate=u?[].concat(u,l):[l];}return {exports:t,options:d}}var b=f({name:"Spinner",computed:{spinnerView:function(){return p[(this.$attrs.spinner||"").toUpperCase()]||this.spinnerInConfig},spinnerInConfig:function(){return d.slots.spinner&&"string"==typeof d.slots.spinner?{render:function(){return this._v(d.slots.spinner)}}:"object"===u()(d.slots.spinner)?d.slots.spinner:p[d.props.spinner.toUpperCase()]||p.DEFAULT}}},(function(){var t=this.$createElement;return (this._self._c||t)(this.spinnerView,{tag:"component"})}),[],!1,(function(t){var e=n(5);e.__inject__&&e.__inject__(t);}),"46b20d22",null).exports;function h(t){"production"!==d.mode&&console.warn("[Vue-infinite-loading warn]: ".concat(t));}function m(t){console.error("[Vue-infinite-loading error]: ".concat(t));}var g={timers:[],caches:[],throttle:function(t){var e=this;-1===this.caches.indexOf(t)&&(this.caches.push(t),this.timers.push(setTimeout((function(){t(),e.caches.splice(e.caches.indexOf(t),1),e.timers.shift();}),d.system.throttleLimit)));},reset:function(){this.timers.forEach((function(t){clearTimeout(t);})),this.timers.length=0,this.caches=[];}},v={isChecked:!1,timer:null,times:0,track:function(){var t=this;this.times+=1,clearTimeout(this.timer),this.timer=setTimeout((function(){t.isChecked=!0;}),d.system.loopCheckTimeout),this.times>d.system.loopCheckMaxCalls&&(m(o.INFINITE_LOOP),this.isChecked=!0);}},w={key:"_infiniteScrollHeight",getScrollElm:function(t){return t===window?document.documentElement:t},save:function(t){var e=this.getScrollElm(t);e[this.key]=e.scrollHeight;},restore:function(t){var e=this.getScrollElm(t);"number"==typeof e[this.key]&&(e.scrollTop=e.scrollHeight-e[this.key]+e.scrollTop),this.remove(e);},remove:function(t){void 0!==t[this.key]&&delete t[this.key];}};function y(t){return t.replace(/[A-Z]/g,(function(t){return "-".concat(t.toLowerCase())}))}function x(t){return t.offsetWidth+t.offsetHeight>0}var k=f({name:"InfiniteLoading",data:function(){return {scrollParent:null,scrollHandler:null,isFirstLoad:!0,status:s.READY,slots:d.slots}},components:{Spinner:b},computed:{isShowSpinner:function(){return this.status===s.LOADING},isShowError:function(){return this.status===s.ERROR},isShowNoResults:function(){return this.status===s.COMPLETE&&this.isFirstLoad},isShowNoMore:function(){return this.status===s.COMPLETE&&!this.isFirstLoad},slotStyles:function(){var t=this,e={};return Object.keys(d.slots).forEach((function(n){var i=y(n);(!t.$slots[i]&&!d.slots[n].render||t.$slots[i]&&!t.$slots[i][0].tag)&&(e[n]=l);})),e}},props:{distance:{type:Number,default:d.props.distance},spinner:String,direction:{type:String,default:"bottom"},forceUseInfiniteWrapper:{type:[Boolean,String],default:d.props.forceUseInfiniteWrapper},identifier:{default:+new Date},onInfinite:Function},watch:{identifier:function(){this.stateChanger.reset();}},mounted:function(){var t=this;this.$watch("forceUseInfiniteWrapper",(function(){t.scrollParent=t.getScrollParent();}),{immediate:!0}),this.scrollHandler=function(e){t.status===s.READY&&(e&&e.constructor===Event&&x(t.$el)?g.throttle(t.attemptLoad):t.attemptLoad());},setTimeout((function(){t.scrollHandler(),t.scrollParent.addEventListener("scroll",t.scrollHandler,a);}),1),this.$on("$InfiniteLoading:loaded",(function(e){t.isFirstLoad=!1,"top"===t.direction&&t.$nextTick((function(){w.restore(t.scrollParent);})),t.status===s.LOADING&&t.$nextTick(t.attemptLoad.bind(null,!0)),e&&e.target===t||h(r.STATE_CHANGER);})),this.$on("$InfiniteLoading:complete",(function(e){t.status=s.COMPLETE,t.$nextTick((function(){t.$forceUpdate();})),t.scrollParent.removeEventListener("scroll",t.scrollHandler,a),e&&e.target===t||h(r.STATE_CHANGER);})),this.$on("$InfiniteLoading:reset",(function(e){t.status=s.READY,t.isFirstLoad=!0,w.remove(t.scrollParent),t.scrollParent.addEventListener("scroll",t.scrollHandler,a),setTimeout((function(){g.reset(),t.scrollHandler();}),1),e&&e.target===t||h(r.IDENTIFIER);})),this.stateChanger={loaded:function(){t.$emit("$InfiniteLoading:loaded",{target:t});},complete:function(){t.$emit("$InfiniteLoading:complete",{target:t});},reset:function(){t.$emit("$InfiniteLoading:reset",{target:t});},error:function(){t.status=s.ERROR,g.reset();}},this.onInfinite&&h(r.INFINITE_EVENT);},deactivated:function(){this.status===s.LOADING&&(this.status=s.READY),this.scrollParent.removeEventListener("scroll",this.scrollHandler,a);},activated:function(){this.scrollParent.addEventListener("scroll",this.scrollHandler,a);},methods:{attemptLoad:function(t){var e=this;this.status!==s.COMPLETE&&x(this.$el)&&this.getCurrentDistance()<=this.distance?(this.status=s.LOADING,"top"===this.direction&&this.$nextTick((function(){w.save(e.scrollParent);})),"function"==typeof this.onInfinite?this.onInfinite.call(null,this.stateChanger):this.$emit("infinite",this.stateChanger),!t||this.forceUseInfiniteWrapper||v.isChecked||v.track()):this.status===s.LOADING&&(this.status=s.READY);},getCurrentDistance:function(){var t;"top"===this.direction?t="number"==typeof this.scrollParent.scrollTop?this.scrollParent.scrollTop:this.scrollParent.pageYOffset:t=this.$el.getBoundingClientRect().top-(this.scrollParent===window?window.innerHeight:this.scrollParent.getBoundingClientRect().bottom);return t},getScrollParent:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$el;return "string"==typeof this.forceUseInfiniteWrapper&&(t=document.querySelector(this.forceUseInfiniteWrapper)),t||("BODY"===e.tagName?t=window:!this.forceUseInfiniteWrapper&&["scroll","auto"].indexOf(getComputedStyle(e).overflowY)>-1?t=e:(e.hasAttribute("infinite-wrapper")||e.hasAttribute("data-infinite-wrapper"))&&(t=e)),t||this.getScrollParent(e.parentNode)}},destroyed:function(){!this.status!==s.COMPLETE&&(g.reset(),w.remove(this.scrollParent),this.scrollParent.removeEventListener("scroll",this.scrollHandler,a));}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"infinite-loading-container"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowSpinner,expression:"isShowSpinner"}],staticClass:"infinite-status-prompt",style:t.slotStyles.spinner},[t._t("spinner",[n("spinner",{attrs:{spinner:t.spinner}})])],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowNoResults,expression:"isShowNoResults"}],staticClass:"infinite-status-prompt",style:t.slotStyles.noResults},[t._t("no-results",[t.slots.noResults.render?n(t.slots.noResults,{tag:"component"}):[t._v(t._s(t.slots.noResults))]])],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowNoMore,expression:"isShowNoMore"}],staticClass:"infinite-status-prompt",style:t.slotStyles.noMore},[t._t("no-more",[t.slots.noMore.render?n(t.slots.noMore,{tag:"component"}):[t._v(t._s(t.slots.noMore))]])],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowError,expression:"isShowError"}],staticClass:"infinite-status-prompt",style:t.slotStyles.error},[t._t("error",[t.slots.error.render?n(t.slots.error,{tag:"component",attrs:{trigger:t.attemptLoad}}):[t._v("\n "+t._s(t.slots.error)+"\n "),n("br"),t._v(" "),n("button",{staticClass:"btn-try-infinite",domProps:{textContent:t._s(t.slots.errorBtnText)},on:{click:t.attemptLoad}})]],{trigger:t.attemptLoad})],2)])}),[],!1,(function(t){var e=n(7);e.__inject__&&e.__inject__(t);}),"644ea9c9",null).exports;function E(t){d.mode=t.config.productionTip?"development":"production";}Object.defineProperty(k,"install",{configurable:!1,enumerable:!1,value:function(t,e){Object.assign(d.props,e&&e.props),Object.assign(d.slots,e&&e.slots),Object.assign(d.system,e&&e.system),t.component("infinite-loading",k),E(t);}}),"undefined"!=typeof window&&window.Vue&&(window.Vue.component("infinite-loading",k),E(window.Vue));e.default=k;}])}));
|
|
17320
|
+
} (vueInfiniteLoading));
|
|
17321
|
+
|
|
17322
|
+
var InfiniteLoading = /*@__PURE__*/getDefaultExportFromCjs(vueInfiniteLoadingExports);var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}var css = "tr td[data-v-72152dad]:last-child,\ntr td[data-v-72152dad]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-72152dad] {\n display: flex;\n justify-content: center; }\n\n.crud-header[data-v-72152dad] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-72152dad] .crud-title[data-v-72152dad] {\n margin: 0; }\n .crud-header[data-v-72152dad] .crud-search[data-v-72152dad] {\n max-width: 15rem; }\n .crud-header[data-v-72152dad] .crud-search[data-v-72152dad] .btn[data-v-72152dad] {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 0.375rem;\n border-bottom-right-radius: 0.375rem; }\n .crud-header[data-v-72152dad] .crud-search[data-v-72152dad] .btn[data-v-72152dad].open[data-v-72152dad] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-72152dad] .table-options[data-v-72152dad] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-72152dad] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-72152dad] {\n table-layout: auto; }\n .table[data-v-72152dad] tbody[data-v-72152dad] td[data-v-72152dad] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-72152dad] tbody[data-v-72152dad] td[data-v-72152dad]::-webkit-scrollbar {\n display: none; } }\n";
|
|
17309
17323
|
n(css, {});function normalizeComponent (
|
|
17310
17324
|
scriptExports,
|
|
17311
17325
|
render,
|
|
@@ -17400,7 +17414,8 @@ n(css, {});function normalizeComponent (
|
|
|
17400
17414
|
}var _sfc_main = {
|
|
17401
17415
|
name: "VueLaravelCrud",
|
|
17402
17416
|
components: {
|
|
17403
|
-
draggable: draggable
|
|
17417
|
+
draggable: draggable,
|
|
17418
|
+
InfiniteLoading: InfiniteLoading
|
|
17404
17419
|
},
|
|
17405
17420
|
data: function data() {
|
|
17406
17421
|
return {
|
|
@@ -17490,6 +17505,10 @@ n(css, {});function normalizeComponent (
|
|
|
17490
17505
|
type: Boolean,
|
|
17491
17506
|
default: false
|
|
17492
17507
|
},
|
|
17508
|
+
infiniteScroll: {
|
|
17509
|
+
type: Boolean,
|
|
17510
|
+
default: false
|
|
17511
|
+
},
|
|
17493
17512
|
sortable: {
|
|
17494
17513
|
type: Boolean,
|
|
17495
17514
|
default: false
|
|
@@ -17724,10 +17743,21 @@ n(css, {});function normalizeComponent (
|
|
|
17724
17743
|
}
|
|
17725
17744
|
},
|
|
17726
17745
|
methods: {
|
|
17746
|
+
loadMore: function loadMore() {
|
|
17747
|
+
var hasNextPage = this.pagination.current_page * this.pagination.per_page < this.pagination.total;
|
|
17748
|
+
if (hasNextPage) {
|
|
17749
|
+
var page = this.pagination.current_page + 1;
|
|
17750
|
+
this.fetchItems(page, true);
|
|
17751
|
+
}
|
|
17752
|
+
},
|
|
17727
17753
|
onDraggableAdded: function onDraggableAdded(event) {
|
|
17728
17754
|
console.log('Se agregó un nuevo elemento a la lista', event);
|
|
17729
17755
|
this.$emit("draggableAdded", event);
|
|
17730
17756
|
},
|
|
17757
|
+
onDraggableChange: function onDraggableChange(event) {
|
|
17758
|
+
console.log('Lista change', event);
|
|
17759
|
+
this.$emit("draggableChange", event);
|
|
17760
|
+
},
|
|
17731
17761
|
setupFilters: function setupFilters() {
|
|
17732
17762
|
var _this2 = this;
|
|
17733
17763
|
this.columns.forEach(function (column) {
|
|
@@ -17932,7 +17962,7 @@ n(css, {});function normalizeComponent (
|
|
|
17932
17962
|
page = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : 1;
|
|
17933
17963
|
_this8.loading = true;
|
|
17934
17964
|
_this8.$emit("beforeFetch", {});
|
|
17935
|
-
_context.next =
|
|
17965
|
+
_context.next = 6;
|
|
17936
17966
|
return _this8.model.api().get('', {
|
|
17937
17967
|
params: {
|
|
17938
17968
|
page: page,
|
|
@@ -17940,12 +17970,12 @@ n(css, {});function normalizeComponent (
|
|
|
17940
17970
|
filters: JSON.stringify(_this8.finalFilters)
|
|
17941
17971
|
}
|
|
17942
17972
|
});
|
|
17943
|
-
case
|
|
17973
|
+
case 6:
|
|
17944
17974
|
result = _context.sent;
|
|
17945
17975
|
_this8.items = result.entities[_this8.model.entity];
|
|
17946
17976
|
console.debug("fetch page vuex ", page, _this8.items);
|
|
17947
17977
|
_this8.loading = false;
|
|
17948
|
-
case
|
|
17978
|
+
case 10:
|
|
17949
17979
|
case "end":
|
|
17950
17980
|
return _context.stop();
|
|
17951
17981
|
}
|
|
@@ -17955,12 +17985,13 @@ n(css, {});function normalizeComponent (
|
|
|
17955
17985
|
fetchItems: function fetchItems() {
|
|
17956
17986
|
var _this9 = this;
|
|
17957
17987
|
var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
17988
|
+
var concat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
17958
17989
|
if (!this.ajax) {
|
|
17959
17990
|
return;
|
|
17960
17991
|
}
|
|
17961
17992
|
this.$emit("beforeFetch", {});
|
|
17962
17993
|
if (this.useVuexORM) {
|
|
17963
|
-
return this.fetchItemsVuex(page);
|
|
17994
|
+
return this.fetchItemsVuex(page, concat);
|
|
17964
17995
|
}
|
|
17965
17996
|
this.loading = true;
|
|
17966
17997
|
axios.get(this.apiUrl + "/" + this.modelName, {
|
|
@@ -17998,9 +18029,17 @@ n(css, {});function normalizeComponent (
|
|
|
17998
18029
|
itemswithgroup.push(item);
|
|
17999
18030
|
}
|
|
18000
18031
|
});
|
|
18001
|
-
|
|
18032
|
+
if (concat) {
|
|
18033
|
+
_this9.items = _this9.items.concat(itemswithgroup);
|
|
18034
|
+
} else {
|
|
18035
|
+
_this9.items = itemswithgroup;
|
|
18036
|
+
}
|
|
18002
18037
|
} else {
|
|
18003
|
-
|
|
18038
|
+
if (concat) {
|
|
18039
|
+
_this9.items = _this9.items.concat(items);
|
|
18040
|
+
} else {
|
|
18041
|
+
_this9.items = items;
|
|
18042
|
+
}
|
|
18004
18043
|
}
|
|
18005
18044
|
_this9.loading = false;
|
|
18006
18045
|
_this9.$emit("afterFetch", {});
|
|
@@ -18903,6 +18942,9 @@ var _sfc_render = function render() {
|
|
|
18903
18942
|
},
|
|
18904
18943
|
"add": function add($event) {
|
|
18905
18944
|
return _vm.onDraggableAdded($event);
|
|
18945
|
+
},
|
|
18946
|
+
"change": function change($event) {
|
|
18947
|
+
return _vm.onDraggableChange($event);
|
|
18906
18948
|
}
|
|
18907
18949
|
},
|
|
18908
18950
|
model: {
|
|
@@ -18912,7 +18954,7 @@ var _sfc_render = function render() {
|
|
|
18912
18954
|
},
|
|
18913
18955
|
expression: "items"
|
|
18914
18956
|
}
|
|
18915
|
-
}, _vm._l(_vm.itemsList, function (item, index) {
|
|
18957
|
+
}, [_vm._l(_vm.itemsList, function (item, index) {
|
|
18916
18958
|
return _c('tr', {
|
|
18917
18959
|
key: index,
|
|
18918
18960
|
staticClass: "item",
|
|
@@ -19003,7 +19045,14 @@ var _sfc_render = function render() {
|
|
|
19003
19045
|
}, {
|
|
19004
19046
|
"item": item
|
|
19005
19047
|
})], 2);
|
|
19006
|
-
}),
|
|
19048
|
+
}), _vm.infiniteScroll ? _c('infinite-loading', {
|
|
19049
|
+
directives: [{
|
|
19050
|
+
name: "infinite-scroll",
|
|
19051
|
+
rawName: "v-infinite-scroll",
|
|
19052
|
+
value: _vm.loadMore,
|
|
19053
|
+
expression: "loadMore"
|
|
19054
|
+
}]
|
|
19055
|
+
}) : _vm._e()], 2)], 1), _vm.items.length == 0 ? _c('p', {
|
|
19007
19056
|
staticClass: "p-3"
|
|
19008
19057
|
}, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e()]) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CARDS ? _c('div', [_vm.items.length == 0 ? _c('p', {
|
|
19009
19058
|
staticClass: "p-3"
|
|
@@ -19026,6 +19075,9 @@ var _sfc_render = function render() {
|
|
|
19026
19075
|
},
|
|
19027
19076
|
"add": function add($event) {
|
|
19028
19077
|
return _vm.onDraggableAdded($event);
|
|
19078
|
+
},
|
|
19079
|
+
"change": function change($event) {
|
|
19080
|
+
return _vm.onDraggableChange($event);
|
|
19029
19081
|
}
|
|
19030
19082
|
},
|
|
19031
19083
|
model: {
|
|
@@ -19035,7 +19087,7 @@ var _sfc_render = function render() {
|
|
|
19035
19087
|
},
|
|
19036
19088
|
expression: "items"
|
|
19037
19089
|
}
|
|
19038
|
-
}, _vm._l(_vm.itemsList, function (item, index) {
|
|
19090
|
+
}, [_vm._l(_vm.itemsList, function (item, index) {
|
|
19039
19091
|
return _c('b-col', {
|
|
19040
19092
|
key: index,
|
|
19041
19093
|
staticClass: "item",
|
|
@@ -19120,7 +19172,14 @@ var _sfc_render = function render() {
|
|
|
19120
19172
|
}, {
|
|
19121
19173
|
"item": item
|
|
19122
19174
|
})], 2)], 1);
|
|
19123
|
-
}),
|
|
19175
|
+
}), _vm.infiniteScroll ? _c('infinite-loading', {
|
|
19176
|
+
directives: [{
|
|
19177
|
+
name: "infinite-scroll",
|
|
19178
|
+
rawName: "v-infinite-scroll",
|
|
19179
|
+
value: _vm.loadMore,
|
|
19180
|
+
expression: "loadMore"
|
|
19181
|
+
}]
|
|
19182
|
+
}) : _vm._e()], 2)], 1) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
|
|
19124
19183
|
class: _vm.listContainerClass
|
|
19125
19184
|
}, [_vm.items.length == 0 ? _c('p', {
|
|
19126
19185
|
staticClass: "p-3"
|
|
@@ -19131,7 +19190,7 @@ var _sfc_render = function render() {
|
|
|
19131
19190
|
}, [_vm._t("card", null, {
|
|
19132
19191
|
"item": item
|
|
19133
19192
|
})], 2);
|
|
19134
|
-
})], 2)]) : _vm._e()]), _c('div', {
|
|
19193
|
+
})], 2)]) : _vm._e()]), !_vm.infiniteScroll ? _c('div', {
|
|
19135
19194
|
staticClass: "crud-paginator"
|
|
19136
19195
|
}, [_vm.showPaginator ? _c('b-pagination', {
|
|
19137
19196
|
attrs: {
|
|
@@ -19150,7 +19209,7 @@ var _sfc_render = function render() {
|
|
|
19150
19209
|
},
|
|
19151
19210
|
expression: "pagination.current_page"
|
|
19152
19211
|
}
|
|
19153
|
-
}) : _vm._e()], 1), _c('b-modal', {
|
|
19212
|
+
}) : _vm._e()], 1) : _vm._e(), _c('b-modal', {
|
|
19154
19213
|
attrs: {
|
|
19155
19214
|
"id": 'modal-form-item-' + _vm.modelName,
|
|
19156
19215
|
"hide-footer": "",
|
|
@@ -19267,7 +19326,7 @@ var _sfc_render = function render() {
|
|
|
19267
19326
|
}) : _vm._e()], 2)], 1);
|
|
19268
19327
|
};
|
|
19269
19328
|
var _sfc_staticRenderFns = [];
|
|
19270
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
19329
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "72152dad", null, null);
|
|
19271
19330
|
var component$1 = __component__.exports;// Import vue component
|
|
19272
19331
|
|
|
19273
19332
|
// Default export is installable instance of component.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-laravel-crud",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.33",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/clonixdev/vue-laravel-crud",
|
|
6
6
|
"main": "dist/vue-laravel-crud.ssr.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"axios": "^1.3.5",
|
|
24
24
|
"bootstrap-vue": "^2.21.2",
|
|
25
25
|
"moment": "^2.29.1",
|
|
26
|
+
"vue-infinite-loading": "^2.4.5",
|
|
26
27
|
"vuedraggable": "^2.24.3"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
"@vitejs/plugin-vue2": "^2.2.0",
|
|
38
39
|
"@vue/cli-plugin-babel": "^5.0.8",
|
|
39
40
|
"@vue/cli-service": "^5.0.8",
|
|
41
|
+
"@vuex-orm/core": "^0.36.4",
|
|
42
|
+
"@vuex-orm/plugin-axios": "^0.9.4",
|
|
40
43
|
"cross-env": "^7.0.3",
|
|
41
44
|
"minimist": "^1.2.5",
|
|
42
45
|
"node-sass": "^8.0.0",
|
|
@@ -46,15 +49,13 @@
|
|
|
46
49
|
"rollup-plugin-terser": "^7.0.2",
|
|
47
50
|
"vue": "^2.7.14",
|
|
48
51
|
"vue-template-compiler": "^2.7.14",
|
|
49
|
-
"vuex": "^3.6.2"
|
|
50
|
-
"@vuex-orm/core": "^0.36.4",
|
|
51
|
-
"@vuex-orm/plugin-axios": "^0.9.4"
|
|
52
|
+
"vuex": "^3.6.2"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
|
-
"vue": "^2.7.14",
|
|
55
|
-
"vuex": "^3.6.2",
|
|
56
55
|
"@vuex-orm/core": "^0.36.4",
|
|
57
|
-
"@vuex-orm/plugin-axios": "^0.9.4"
|
|
56
|
+
"@vuex-orm/plugin-axios": "^0.9.4",
|
|
57
|
+
"vue": "^2.7.14",
|
|
58
|
+
"vuex": "^3.6.2"
|
|
58
59
|
},
|
|
59
60
|
"engines": {
|
|
60
61
|
"node": ">=14"
|
package/src/vue-laravel-crud.vue
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import draggable from "vuedraggable";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import moment from "moment";
|
|
5
|
+
import InfiniteLoading from 'vue-infinite-loading';
|
|
5
6
|
|
|
6
7
|
export default /*#__PURE__*/ {
|
|
7
8
|
name: "VueLaravelCrud",
|
|
8
9
|
components: {
|
|
9
10
|
draggable,
|
|
11
|
+
InfiniteLoading
|
|
10
12
|
},
|
|
11
13
|
data() {
|
|
12
14
|
return {
|
|
@@ -94,6 +96,11 @@ export default /*#__PURE__*/ {
|
|
|
94
96
|
type: Boolean,
|
|
95
97
|
default: false,
|
|
96
98
|
},
|
|
99
|
+
|
|
100
|
+
infiniteScroll: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false,
|
|
103
|
+
},
|
|
97
104
|
sortable: {
|
|
98
105
|
type: Boolean,
|
|
99
106
|
default: false,
|
|
@@ -274,10 +281,10 @@ export default /*#__PURE__*/ {
|
|
|
274
281
|
|
|
275
282
|
draggableOptions: {
|
|
276
283
|
type: Object,
|
|
277
|
-
default: function() {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
284
|
+
default: function () {
|
|
285
|
+
return { clone: false };
|
|
286
|
+
}
|
|
287
|
+
|
|
281
288
|
},
|
|
282
289
|
},
|
|
283
290
|
|
|
@@ -351,11 +358,21 @@ export default /*#__PURE__*/ {
|
|
|
351
358
|
},
|
|
352
359
|
},
|
|
353
360
|
methods: {
|
|
354
|
-
|
|
361
|
+
loadMore() {
|
|
362
|
+
const hasNextPage = (this.pagination.current_page * this.pagination.per_page) < this.pagination.total;
|
|
363
|
+
if (hasNextPage) {
|
|
364
|
+
const page = this.pagination.current_page + 1;
|
|
365
|
+
this.fetchItems(page,true);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
355
368
|
onDraggableAdded(event) {
|
|
356
369
|
console.log('Se agregó un nuevo elemento a la lista', event);
|
|
357
370
|
this.$emit("draggableAdded", event);
|
|
358
371
|
},
|
|
372
|
+
onDraggableChange(event) {
|
|
373
|
+
console.log('Lista change', event);
|
|
374
|
+
this.$emit("draggableChange", event);
|
|
375
|
+
},
|
|
359
376
|
setupFilters() {
|
|
360
377
|
this.columns.forEach((column) => {
|
|
361
378
|
if (this.isColumnHasFilter(column)) {
|
|
@@ -543,7 +560,7 @@ export default /*#__PURE__*/ {
|
|
|
543
560
|
}, 1);
|
|
544
561
|
},
|
|
545
562
|
|
|
546
|
-
async fetchItemsVuex(page = 1) {
|
|
563
|
+
async fetchItemsVuex(page = 1, concat = false) {
|
|
547
564
|
this.loading = true;
|
|
548
565
|
this.$emit("beforeFetch", {});
|
|
549
566
|
const result = await this.model.api().get('', {
|
|
@@ -557,13 +574,13 @@ export default /*#__PURE__*/ {
|
|
|
557
574
|
console.debug("fetch page vuex ", page, this.items);
|
|
558
575
|
this.loading = false;
|
|
559
576
|
},
|
|
560
|
-
fetchItems(page = 1) {
|
|
577
|
+
fetchItems(page = 1, concat = false) {
|
|
561
578
|
if (!this.ajax) {
|
|
562
579
|
return;
|
|
563
580
|
}
|
|
564
581
|
this.$emit("beforeFetch", {});
|
|
565
582
|
if (this.useVuexORM) {
|
|
566
|
-
return this.fetchItemsVuex(page);
|
|
583
|
+
return this.fetchItemsVuex(page, concat);
|
|
567
584
|
}
|
|
568
585
|
this.loading = true;
|
|
569
586
|
axios
|
|
@@ -604,9 +621,17 @@ export default /*#__PURE__*/ {
|
|
|
604
621
|
itemswithgroup.push(item);
|
|
605
622
|
}
|
|
606
623
|
});
|
|
607
|
-
|
|
624
|
+
if (concat) {
|
|
625
|
+
this.items = this.items.concat(itemswithgroup);
|
|
626
|
+
} else {
|
|
627
|
+
this.items = itemswithgroup;
|
|
628
|
+
}
|
|
608
629
|
} else {
|
|
609
|
-
|
|
630
|
+
if (concat) {
|
|
631
|
+
this.items = this.items.concat(items);
|
|
632
|
+
} else {
|
|
633
|
+
this.items = items;
|
|
634
|
+
}
|
|
610
635
|
}
|
|
611
636
|
|
|
612
637
|
this.loading = false;
|
|
@@ -1179,7 +1204,7 @@ export default /*#__PURE__*/ {
|
|
|
1179
1204
|
|
|
1180
1205
|
<draggable v-model="items" :group="draggableGroup" tag="tbody" :draggable="orderable ? '.item' : '.none'"
|
|
1181
1206
|
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1182
|
-
:options="draggableOptions">
|
|
1207
|
+
@change="onDraggableChange($event)" :options="draggableOptions">
|
|
1183
1208
|
<tr v-for="(item, index) in itemsList" v-bind:key="index" @mouseover="onRowHover(item, index)"
|
|
1184
1209
|
@click="onRowClick(item, index)" class="item">
|
|
1185
1210
|
|
|
@@ -1251,6 +1276,7 @@ export default /*#__PURE__*/ {
|
|
|
1251
1276
|
</slot>
|
|
1252
1277
|
|
|
1253
1278
|
</tr>
|
|
1279
|
+
<infinite-loading v-infinite-scroll="loadMore" v-if="infiniteScroll" />
|
|
1254
1280
|
</draggable>
|
|
1255
1281
|
</table>
|
|
1256
1282
|
<p v-if="items.length == 0" class="p-3">
|
|
@@ -1265,7 +1291,7 @@ export default /*#__PURE__*/ {
|
|
|
1265
1291
|
|
|
1266
1292
|
<draggable v-model="items" :group="draggableGroup" class="row" :draggable="orderable ? '.item' : '.none'"
|
|
1267
1293
|
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1268
|
-
:options="draggableOptions">
|
|
1294
|
+
@change="onDraggableChange($event)" :options="draggableOptions">
|
|
1269
1295
|
<b-col v-for="(item, index) in itemsList" v-bind:key="index" :cols="colXs" :sm="colSm" :md="colMd" :lg="colLg"
|
|
1270
1296
|
:xl="colXl" class="item">
|
|
1271
1297
|
<b-card :title="item.title" tag="article" class="mb-2 card-crud" :class="cardClass"
|
|
@@ -1327,6 +1353,7 @@ export default /*#__PURE__*/ {
|
|
|
1327
1353
|
</template>
|
|
1328
1354
|
</b-card>
|
|
1329
1355
|
</b-col>
|
|
1356
|
+
<infinite-loading v-infinite-scroll="loadMore" v-if="infiniteScroll" />
|
|
1330
1357
|
</draggable>
|
|
1331
1358
|
</div>
|
|
1332
1359
|
|
|
@@ -1341,7 +1368,7 @@ export default /*#__PURE__*/ {
|
|
|
1341
1368
|
</div>
|
|
1342
1369
|
</div>
|
|
1343
1370
|
</b-overlay>
|
|
1344
|
-
<div class="crud-paginator">
|
|
1371
|
+
<div class="crud-paginator" v-if="!infiniteScroll">
|
|
1345
1372
|
<b-pagination v-if="showPaginator" v-model="pagination.current_page" :total-rows="pagination.total"
|
|
1346
1373
|
:per-page="pagination.per_page" @change="onPaginationChange($event)"></b-pagination>
|
|
1347
1374
|
</div>
|