vue-laravel-crud 1.4.32 → 1.4.34
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 +63 -12
- package/dist/vue-laravel-crud.min.js +9 -3
- package/dist/vue-laravel-crud.ssr.js +62 -15
- package/package.json +8 -7
- package/src/vue-laravel-crud.vue +43 -16
|
@@ -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-b157fcc6]:last-child,\ntr td[data-v-b157fcc6]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-b157fcc6] {\n display: flex;\n justify-content: center; }\n\n.crud-header[data-v-b157fcc6] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-b157fcc6] .crud-title[data-v-b157fcc6] {\n margin: 0; }\n .crud-header[data-v-b157fcc6] .crud-search[data-v-b157fcc6] {\n max-width: 15rem; }\n .crud-header[data-v-b157fcc6] .crud-search[data-v-b157fcc6] .btn[data-v-b157fcc6] {\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-b157fcc6] .crud-search[data-v-b157fcc6] .btn[data-v-b157fcc6].open[data-v-b157fcc6] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-b157fcc6] .table-options[data-v-b157fcc6] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-b157fcc6] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-b157fcc6] {\n table-layout: auto; }\n .table[data-v-b157fcc6] tbody[data-v-b157fcc6] td[data-v-b157fcc6] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-b157fcc6] tbody[data-v-b157fcc6] td[data-v-b157fcc6]::-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,6 +17743,17 @@ n(css, {});function normalizeComponent (
|
|
|
17724
17743
|
}
|
|
17725
17744
|
},
|
|
17726
17745
|
methods: {
|
|
17746
|
+
infiniteHandler: function infiniteHandler($state) {
|
|
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).then(function () {
|
|
17751
|
+
$state.loaded();
|
|
17752
|
+
});
|
|
17753
|
+
} else {
|
|
17754
|
+
$state.complete();
|
|
17755
|
+
}
|
|
17756
|
+
},
|
|
17727
17757
|
onDraggableAdded: function onDraggableAdded(event) {
|
|
17728
17758
|
console.log('Se agregó un nuevo elemento a la lista', event);
|
|
17729
17759
|
this.$emit("draggableAdded", event);
|
|
@@ -17936,7 +17966,7 @@ n(css, {});function normalizeComponent (
|
|
|
17936
17966
|
page = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : 1;
|
|
17937
17967
|
_this8.loading = true;
|
|
17938
17968
|
_this8.$emit("beforeFetch", {});
|
|
17939
|
-
_context.next =
|
|
17969
|
+
_context.next = 6;
|
|
17940
17970
|
return _this8.model.api().get('', {
|
|
17941
17971
|
params: {
|
|
17942
17972
|
page: page,
|
|
@@ -17944,12 +17974,12 @@ n(css, {});function normalizeComponent (
|
|
|
17944
17974
|
filters: JSON.stringify(_this8.finalFilters)
|
|
17945
17975
|
}
|
|
17946
17976
|
});
|
|
17947
|
-
case
|
|
17977
|
+
case 6:
|
|
17948
17978
|
result = _context.sent;
|
|
17949
17979
|
_this8.items = result.entities[_this8.model.entity];
|
|
17950
17980
|
console.debug("fetch page vuex ", page, _this8.items);
|
|
17951
17981
|
_this8.loading = false;
|
|
17952
|
-
case
|
|
17982
|
+
case 10:
|
|
17953
17983
|
case "end":
|
|
17954
17984
|
return _context.stop();
|
|
17955
17985
|
}
|
|
@@ -17959,12 +17989,13 @@ n(css, {});function normalizeComponent (
|
|
|
17959
17989
|
fetchItems: function fetchItems() {
|
|
17960
17990
|
var _this9 = this;
|
|
17961
17991
|
var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
17992
|
+
var concat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
17962
17993
|
if (!this.ajax) {
|
|
17963
17994
|
return;
|
|
17964
17995
|
}
|
|
17965
17996
|
this.$emit("beforeFetch", {});
|
|
17966
17997
|
if (this.useVuexORM) {
|
|
17967
|
-
return this.fetchItemsVuex(page);
|
|
17998
|
+
return this.fetchItemsVuex(page, concat);
|
|
17968
17999
|
}
|
|
17969
18000
|
this.loading = true;
|
|
17970
18001
|
axios.get(this.apiUrl + "/" + this.modelName, {
|
|
@@ -18002,9 +18033,17 @@ n(css, {});function normalizeComponent (
|
|
|
18002
18033
|
itemswithgroup.push(item);
|
|
18003
18034
|
}
|
|
18004
18035
|
});
|
|
18005
|
-
|
|
18036
|
+
if (concat) {
|
|
18037
|
+
_this9.items = _this9.items.concat(itemswithgroup);
|
|
18038
|
+
} else {
|
|
18039
|
+
_this9.items = itemswithgroup;
|
|
18040
|
+
}
|
|
18006
18041
|
} else {
|
|
18007
|
-
|
|
18042
|
+
if (concat) {
|
|
18043
|
+
_this9.items = _this9.items.concat(items);
|
|
18044
|
+
} else {
|
|
18045
|
+
_this9.items = items;
|
|
18046
|
+
}
|
|
18008
18047
|
}
|
|
18009
18048
|
_this9.loading = false;
|
|
18010
18049
|
_this9.$emit("afterFetch", {});
|
|
@@ -18919,7 +18958,7 @@ var _sfc_render = function render() {
|
|
|
18919
18958
|
},
|
|
18920
18959
|
expression: "items"
|
|
18921
18960
|
}
|
|
18922
|
-
}, _vm._l(_vm.itemsList, function (item, index) {
|
|
18961
|
+
}, [_vm._l(_vm.itemsList, function (item, index) {
|
|
18923
18962
|
return _c('tr', {
|
|
18924
18963
|
key: index,
|
|
18925
18964
|
staticClass: "item",
|
|
@@ -19010,7 +19049,11 @@ var _sfc_render = function render() {
|
|
|
19010
19049
|
}, {
|
|
19011
19050
|
"item": item
|
|
19012
19051
|
})], 2);
|
|
19013
|
-
}),
|
|
19052
|
+
}), _vm.infiniteScroll ? _c('infinite-loading', {
|
|
19053
|
+
on: {
|
|
19054
|
+
"infinite": _vm.infiniteHandler
|
|
19055
|
+
}
|
|
19056
|
+
}) : _vm._e()], 2)], 1), _vm.items.length == 0 ? _c('p', {
|
|
19014
19057
|
staticClass: "p-3"
|
|
19015
19058
|
}, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e()]) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CARDS ? _c('div', [_vm.items.length == 0 ? _c('p', {
|
|
19016
19059
|
staticClass: "p-3"
|
|
@@ -19045,7 +19088,7 @@ var _sfc_render = function render() {
|
|
|
19045
19088
|
},
|
|
19046
19089
|
expression: "items"
|
|
19047
19090
|
}
|
|
19048
|
-
}, _vm._l(_vm.itemsList, function (item, index) {
|
|
19091
|
+
}, [_vm._l(_vm.itemsList, function (item, index) {
|
|
19049
19092
|
return _c('b-col', {
|
|
19050
19093
|
key: index,
|
|
19051
19094
|
staticClass: "item",
|
|
@@ -19130,7 +19173,11 @@ var _sfc_render = function render() {
|
|
|
19130
19173
|
}, {
|
|
19131
19174
|
"item": item
|
|
19132
19175
|
})], 2)], 1);
|
|
19133
|
-
}),
|
|
19176
|
+
}), _vm.infiniteScroll ? _c('infinite-loading', {
|
|
19177
|
+
on: {
|
|
19178
|
+
"infinite": _vm.infiniteHandler
|
|
19179
|
+
}
|
|
19180
|
+
}) : _vm._e()], 2)], 1) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
|
|
19134
19181
|
class: _vm.listContainerClass
|
|
19135
19182
|
}, [_vm.items.length == 0 ? _c('p', {
|
|
19136
19183
|
staticClass: "p-3"
|
|
@@ -19141,7 +19188,7 @@ var _sfc_render = function render() {
|
|
|
19141
19188
|
}, [_vm._t("card", null, {
|
|
19142
19189
|
"item": item
|
|
19143
19190
|
})], 2);
|
|
19144
|
-
})], 2)]) : _vm._e()]), _c('div', {
|
|
19191
|
+
})], 2)]) : _vm._e()]), !_vm.infiniteScroll ? _c('div', {
|
|
19145
19192
|
staticClass: "crud-paginator"
|
|
19146
19193
|
}, [_vm.showPaginator ? _c('b-pagination', {
|
|
19147
19194
|
attrs: {
|
|
@@ -19160,7 +19207,7 @@ var _sfc_render = function render() {
|
|
|
19160
19207
|
},
|
|
19161
19208
|
expression: "pagination.current_page"
|
|
19162
19209
|
}
|
|
19163
|
-
}) : _vm._e()], 1), _c('b-modal', {
|
|
19210
|
+
}) : _vm._e()], 1) : _vm._e(), _c('b-modal', {
|
|
19164
19211
|
attrs: {
|
|
19165
19212
|
"id": 'modal-form-item-' + _vm.modelName,
|
|
19166
19213
|
"hide-footer": "",
|
|
@@ -19277,7 +19324,7 @@ var _sfc_render = function render() {
|
|
|
19277
19324
|
}) : _vm._e()], 2)], 1);
|
|
19278
19325
|
};
|
|
19279
19326
|
var _sfc_staticRenderFns = [];
|
|
19280
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
19327
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "b157fcc6", null, null);
|
|
19281
19328
|
var component$1 = __component__.exports;// Import vue component
|
|
19282
19329
|
|
|
19283
19330
|
// 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.34",
|
|
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,12 +358,22 @@ export default /*#__PURE__*/ {
|
|
|
351
358
|
},
|
|
352
359
|
},
|
|
353
360
|
methods: {
|
|
354
|
-
|
|
361
|
+
infiniteHandler($state) {
|
|
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).then(() => {
|
|
366
|
+
$state.loaded();
|
|
367
|
+
});
|
|
368
|
+
}else{
|
|
369
|
+
$state.complete();
|
|
370
|
+
}
|
|
371
|
+
},
|
|
355
372
|
onDraggableAdded(event) {
|
|
356
373
|
console.log('Se agregó un nuevo elemento a la lista', event);
|
|
357
374
|
this.$emit("draggableAdded", event);
|
|
358
375
|
},
|
|
359
|
-
onDraggableChange(event){
|
|
376
|
+
onDraggableChange(event) {
|
|
360
377
|
console.log('Lista change', event);
|
|
361
378
|
this.$emit("draggableChange", event);
|
|
362
379
|
},
|
|
@@ -547,7 +564,7 @@ export default /*#__PURE__*/ {
|
|
|
547
564
|
}, 1);
|
|
548
565
|
},
|
|
549
566
|
|
|
550
|
-
async fetchItemsVuex(page = 1) {
|
|
567
|
+
async fetchItemsVuex(page = 1, concat = false) {
|
|
551
568
|
this.loading = true;
|
|
552
569
|
this.$emit("beforeFetch", {});
|
|
553
570
|
const result = await this.model.api().get('', {
|
|
@@ -561,13 +578,13 @@ export default /*#__PURE__*/ {
|
|
|
561
578
|
console.debug("fetch page vuex ", page, this.items);
|
|
562
579
|
this.loading = false;
|
|
563
580
|
},
|
|
564
|
-
fetchItems(page = 1) {
|
|
581
|
+
fetchItems(page = 1, concat = false) {
|
|
565
582
|
if (!this.ajax) {
|
|
566
583
|
return;
|
|
567
584
|
}
|
|
568
585
|
this.$emit("beforeFetch", {});
|
|
569
586
|
if (this.useVuexORM) {
|
|
570
|
-
return this.fetchItemsVuex(page);
|
|
587
|
+
return this.fetchItemsVuex(page, concat);
|
|
571
588
|
}
|
|
572
589
|
this.loading = true;
|
|
573
590
|
axios
|
|
@@ -608,9 +625,17 @@ export default /*#__PURE__*/ {
|
|
|
608
625
|
itemswithgroup.push(item);
|
|
609
626
|
}
|
|
610
627
|
});
|
|
611
|
-
|
|
628
|
+
if (concat) {
|
|
629
|
+
this.items = this.items.concat(itemswithgroup);
|
|
630
|
+
} else {
|
|
631
|
+
this.items = itemswithgroup;
|
|
632
|
+
}
|
|
612
633
|
} else {
|
|
613
|
-
|
|
634
|
+
if (concat) {
|
|
635
|
+
this.items = this.items.concat(items);
|
|
636
|
+
} else {
|
|
637
|
+
this.items = items;
|
|
638
|
+
}
|
|
614
639
|
}
|
|
615
640
|
|
|
616
641
|
this.loading = false;
|
|
@@ -1182,8 +1207,8 @@ export default /*#__PURE__*/ {
|
|
|
1182
1207
|
</thead>
|
|
1183
1208
|
|
|
1184
1209
|
<draggable v-model="items" :group="draggableGroup" tag="tbody" :draggable="orderable ? '.item' : '.none'"
|
|
1185
|
-
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1186
|
-
:options="draggableOptions">
|
|
1210
|
+
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1211
|
+
@change="onDraggableChange($event)" :options="draggableOptions">
|
|
1187
1212
|
<tr v-for="(item, index) in itemsList" v-bind:key="index" @mouseover="onRowHover(item, index)"
|
|
1188
1213
|
@click="onRowClick(item, index)" class="item">
|
|
1189
1214
|
|
|
@@ -1255,6 +1280,7 @@ export default /*#__PURE__*/ {
|
|
|
1255
1280
|
</slot>
|
|
1256
1281
|
|
|
1257
1282
|
</tr>
|
|
1283
|
+
<infinite-loading @infinite="infiniteHandler" v-if="infiniteScroll" />
|
|
1258
1284
|
</draggable>
|
|
1259
1285
|
</table>
|
|
1260
1286
|
<p v-if="items.length == 0" class="p-3">
|
|
@@ -1268,8 +1294,8 @@ export default /*#__PURE__*/ {
|
|
|
1268
1294
|
</p>
|
|
1269
1295
|
|
|
1270
1296
|
<draggable v-model="items" :group="draggableGroup" class="row" :draggable="orderable ? '.item' : '.none'"
|
|
1271
|
-
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1272
|
-
:options="draggableOptions">
|
|
1297
|
+
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1298
|
+
@change="onDraggableChange($event)" :options="draggableOptions">
|
|
1273
1299
|
<b-col v-for="(item, index) in itemsList" v-bind:key="index" :cols="colXs" :sm="colSm" :md="colMd" :lg="colLg"
|
|
1274
1300
|
:xl="colXl" class="item">
|
|
1275
1301
|
<b-card :title="item.title" tag="article" class="mb-2 card-crud" :class="cardClass"
|
|
@@ -1331,6 +1357,7 @@ export default /*#__PURE__*/ {
|
|
|
1331
1357
|
</template>
|
|
1332
1358
|
</b-card>
|
|
1333
1359
|
</b-col>
|
|
1360
|
+
<infinite-loading @infinite="infiniteHandler" v-if="infiniteScroll" />
|
|
1334
1361
|
</draggable>
|
|
1335
1362
|
</div>
|
|
1336
1363
|
|
|
@@ -1345,7 +1372,7 @@ export default /*#__PURE__*/ {
|
|
|
1345
1372
|
</div>
|
|
1346
1373
|
</div>
|
|
1347
1374
|
</b-overlay>
|
|
1348
|
-
<div class="crud-paginator">
|
|
1375
|
+
<div class="crud-paginator" v-if="!infiniteScroll">
|
|
1349
1376
|
<b-pagination v-if="showPaginator" v-model="pagination.current_page" :total-rows="pagination.total"
|
|
1350
1377
|
:per-page="pagination.per_page" @change="onPaginationChange($event)"></b-pagination>
|
|
1351
1378
|
</div>
|