vue-laravel-crud 1.6.0 → 1.6.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/dist/vue-laravel-crud.esm.js +247 -14
- package/dist/vue-laravel-crud.min.js +2 -2
- package/dist/vue-laravel-crud.ssr.js +244 -15
- package/package.json +2 -1
- package/src/vue-laravel-crud.vue +9 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';function _iterableToArrayLimit(r, l) {
|
|
1
|
+
'use strict';require('vue');function _iterableToArrayLimit(r, l) {
|
|
2
2
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
3
3
|
if (null != t) {
|
|
4
4
|
var e,
|
|
@@ -12296,7 +12296,243 @@ vueInfiniteLoading.exports;
|
|
|
12296
12296
|
} (vueInfiniteLoading, vueInfiniteLoading.exports));
|
|
12297
12297
|
|
|
12298
12298
|
var vueInfiniteLoadingExports = vueInfiniteLoading.exports;
|
|
12299
|
-
var InfiniteLoading = /*@__PURE__*/getDefaultExportFromCjs(vueInfiniteLoadingExports)
|
|
12299
|
+
var InfiniteLoading = /*@__PURE__*/getDefaultExportFromCjs(vueInfiniteLoadingExports);/*!
|
|
12300
|
+
* vue-masonry-css v1.0.3
|
|
12301
|
+
* https://github.com/paulcollett/vue-masonry-css
|
|
12302
|
+
* Released under the MIT License.
|
|
12303
|
+
*/
|
|
12304
|
+
|
|
12305
|
+
// the component name `<masonry />`
|
|
12306
|
+
// can be overridden with `Vue.use(Masonry, { name: 'the-masonry' });`
|
|
12307
|
+
var componentName = 'masonry';
|
|
12308
|
+
|
|
12309
|
+
var props = {
|
|
12310
|
+
tag: {
|
|
12311
|
+
type: [String],
|
|
12312
|
+
default: 'div'
|
|
12313
|
+
},
|
|
12314
|
+
cols: {
|
|
12315
|
+
type: [Object, Number, String],
|
|
12316
|
+
default: 2
|
|
12317
|
+
},
|
|
12318
|
+
gutter: {
|
|
12319
|
+
type: [Object, Number, String],
|
|
12320
|
+
default: 0
|
|
12321
|
+
},
|
|
12322
|
+
css: {
|
|
12323
|
+
type: [Boolean],
|
|
12324
|
+
default: true
|
|
12325
|
+
},
|
|
12326
|
+
columnTag: {
|
|
12327
|
+
type: [String],
|
|
12328
|
+
default: 'div'
|
|
12329
|
+
},
|
|
12330
|
+
columnClass: {
|
|
12331
|
+
type: [String, Array, Object],
|
|
12332
|
+
default: function () { return []; }
|
|
12333
|
+
},
|
|
12334
|
+
columnAttr: {
|
|
12335
|
+
type: [Object],
|
|
12336
|
+
default: function () { return ({}); }
|
|
12337
|
+
}
|
|
12338
|
+
};
|
|
12339
|
+
|
|
12340
|
+
// Get the resulting value from `:col=` prop
|
|
12341
|
+
// based on the window width
|
|
12342
|
+
var breakpointValue = function (mixed, windowWidth) {
|
|
12343
|
+
var valueAsNum = parseInt(mixed);
|
|
12344
|
+
|
|
12345
|
+
if(valueAsNum > -1) {
|
|
12346
|
+
return mixed;
|
|
12347
|
+
}else if(typeof mixed !== 'object') {
|
|
12348
|
+
return 0;
|
|
12349
|
+
}
|
|
12350
|
+
|
|
12351
|
+
var matchedBreakpoint = Infinity;
|
|
12352
|
+
var matchedValue = mixed.default || 0;
|
|
12353
|
+
|
|
12354
|
+
for(var k in mixed) {
|
|
12355
|
+
var breakpoint = parseInt(k);
|
|
12356
|
+
var breakpointValRaw = mixed[breakpoint];
|
|
12357
|
+
var breakpointVal = parseInt(breakpointValRaw);
|
|
12358
|
+
|
|
12359
|
+
if(isNaN(breakpoint) || isNaN(breakpointVal)) {
|
|
12360
|
+
continue;
|
|
12361
|
+
}
|
|
12362
|
+
|
|
12363
|
+
var isNewBreakpoint = windowWidth <= breakpoint && breakpoint < matchedBreakpoint;
|
|
12364
|
+
|
|
12365
|
+
if(isNewBreakpoint) {
|
|
12366
|
+
matchedBreakpoint = breakpoint;
|
|
12367
|
+
matchedValue = breakpointValRaw;
|
|
12368
|
+
}
|
|
12369
|
+
}
|
|
12370
|
+
|
|
12371
|
+
return matchedValue;
|
|
12372
|
+
};
|
|
12373
|
+
|
|
12374
|
+
var component$2 = {
|
|
12375
|
+
props: props,
|
|
12376
|
+
|
|
12377
|
+
data: function data() {
|
|
12378
|
+
return {
|
|
12379
|
+
displayColumns: 2,
|
|
12380
|
+
displayGutter: 0
|
|
12381
|
+
}
|
|
12382
|
+
},
|
|
12383
|
+
|
|
12384
|
+
mounted: function mounted() {
|
|
12385
|
+
var this$1$1 = this;
|
|
12386
|
+
|
|
12387
|
+
this.$nextTick(function () {
|
|
12388
|
+
this$1$1.reCalculate();
|
|
12389
|
+
});
|
|
12390
|
+
|
|
12391
|
+
// Bind resize handler to page
|
|
12392
|
+
if(window) {
|
|
12393
|
+
window.addEventListener('resize', this.reCalculate);
|
|
12394
|
+
}
|
|
12395
|
+
},
|
|
12396
|
+
|
|
12397
|
+
updated: function updated() {
|
|
12398
|
+
var this$1$1 = this;
|
|
12399
|
+
|
|
12400
|
+
this.$nextTick(function () {
|
|
12401
|
+
this$1$1.reCalculate();
|
|
12402
|
+
});
|
|
12403
|
+
},
|
|
12404
|
+
|
|
12405
|
+
beforeDestroy: function beforeDestroy() {
|
|
12406
|
+
if(window) {
|
|
12407
|
+
window.removeEventListener('resize', this.reCalculate);
|
|
12408
|
+
}
|
|
12409
|
+
},
|
|
12410
|
+
|
|
12411
|
+
methods: {
|
|
12412
|
+
// Recalculate how many columns to display based on window width
|
|
12413
|
+
// and the value of the passed `:cols=` prop
|
|
12414
|
+
reCalculate: function reCalculate() {
|
|
12415
|
+
var previousWindowWidth = this.windowWidth;
|
|
12416
|
+
|
|
12417
|
+
this.windowWidth = (window ? window.innerWidth : null) || Infinity;
|
|
12418
|
+
|
|
12419
|
+
// Window resize events get triggered on page height
|
|
12420
|
+
// change which when loading the page can result in multiple
|
|
12421
|
+
// needless calculations. We prevent this here.
|
|
12422
|
+
if(previousWindowWidth === this.windowWidth) {
|
|
12423
|
+
return;
|
|
12424
|
+
}
|
|
12425
|
+
|
|
12426
|
+
this._reCalculateColumnCount(this.windowWidth);
|
|
12427
|
+
|
|
12428
|
+
this._reCalculateGutterSize(this.windowWidth);
|
|
12429
|
+
},
|
|
12430
|
+
|
|
12431
|
+
_reCalculateGutterSize: function _reCalculateGutterSize(windowWidth) {
|
|
12432
|
+
this.displayGutter = breakpointValue(this.gutter, windowWidth);
|
|
12433
|
+
},
|
|
12434
|
+
|
|
12435
|
+
_reCalculateColumnCount: function _reCalculateColumnCount(windowWidth) {
|
|
12436
|
+
var newColumns = breakpointValue(this.cols, windowWidth);
|
|
12437
|
+
|
|
12438
|
+
// Make sure we can return a valid value
|
|
12439
|
+
newColumns = Math.max(1, Number(newColumns) || 0);
|
|
12440
|
+
|
|
12441
|
+
this.displayColumns = newColumns;
|
|
12442
|
+
},
|
|
12443
|
+
|
|
12444
|
+
_getChildItemsInColumnsArray: function _getChildItemsInColumnsArray() {
|
|
12445
|
+
var this$1$1 = this;
|
|
12446
|
+
|
|
12447
|
+
var columns = [];
|
|
12448
|
+
var childItems = this.$slots.default || [];
|
|
12449
|
+
|
|
12450
|
+
// This component does not work with a child <transition-group /> ..yet,
|
|
12451
|
+
// so for now we think it may be helpful to ignore until we can find a way for support
|
|
12452
|
+
if(childItems.length === 1 && childItems[0].componentOptions && childItems[0].componentOptions.tag == 'transition-group') {
|
|
12453
|
+
childItems = childItems[0].componentOptions.children;
|
|
12454
|
+
}
|
|
12455
|
+
|
|
12456
|
+
// Loop through child elements
|
|
12457
|
+
for (var i = 0, visibleItemI = 0; i < childItems.length; i++, visibleItemI++) {
|
|
12458
|
+
// skip Vue elements without tags, which includes
|
|
12459
|
+
// whitespace elements and also plain text
|
|
12460
|
+
if(!childItems[i].tag) {
|
|
12461
|
+
visibleItemI--;
|
|
12462
|
+
|
|
12463
|
+
continue;
|
|
12464
|
+
}
|
|
12465
|
+
|
|
12466
|
+
// Get the column index the child item will end up in
|
|
12467
|
+
var columnIndex = visibleItemI % this$1$1.displayColumns;
|
|
12468
|
+
|
|
12469
|
+
if(!columns[columnIndex]) {
|
|
12470
|
+
columns[columnIndex] = [];
|
|
12471
|
+
}
|
|
12472
|
+
|
|
12473
|
+
columns[columnIndex].push(childItems[i]);
|
|
12474
|
+
}
|
|
12475
|
+
|
|
12476
|
+
return columns;
|
|
12477
|
+
}
|
|
12478
|
+
},
|
|
12479
|
+
|
|
12480
|
+
render: function render(createElement) {
|
|
12481
|
+
var this$1$1 = this;
|
|
12482
|
+
|
|
12483
|
+
var columnsContainingChildren = this._getChildItemsInColumnsArray();
|
|
12484
|
+
var isGutterSizeUnitless = parseInt(this.displayGutter) === this.displayGutter * 1;
|
|
12485
|
+
var gutterSizeWithUnit = isGutterSizeUnitless ? ((this.displayGutter) + "px") : this.displayGutter;
|
|
12486
|
+
|
|
12487
|
+
var columnStyle = {
|
|
12488
|
+
boxSizing: 'border-box',
|
|
12489
|
+
backgroundClip: 'padding-box',
|
|
12490
|
+
width: ((100 / this.displayColumns) + "%"),
|
|
12491
|
+
border: '0 solid transparent',
|
|
12492
|
+
borderLeftWidth: gutterSizeWithUnit
|
|
12493
|
+
};
|
|
12494
|
+
|
|
12495
|
+
var columns = columnsContainingChildren.map(function (children, index) {
|
|
12496
|
+
/// Create column element and inject the children
|
|
12497
|
+
return createElement(this$1$1.columnTag, {
|
|
12498
|
+
key: index + '-' + columnsContainingChildren.length,
|
|
12499
|
+
style: this$1$1.css ? columnStyle : null,
|
|
12500
|
+
class: this$1$1.columnClass,
|
|
12501
|
+
attrs: this$1$1.columnAttr
|
|
12502
|
+
}, children); // specify child items here
|
|
12503
|
+
});
|
|
12504
|
+
|
|
12505
|
+
var containerStyle = {
|
|
12506
|
+
display: ['-webkit-box', '-ms-flexbox', 'flex'],
|
|
12507
|
+
marginLeft: ("-" + gutterSizeWithUnit)
|
|
12508
|
+
};
|
|
12509
|
+
|
|
12510
|
+
// Return wrapper with columns
|
|
12511
|
+
return createElement(
|
|
12512
|
+
this.tag, // tag name
|
|
12513
|
+
this.css ? { style: containerStyle } : null, // element options
|
|
12514
|
+
columns // column vue elements
|
|
12515
|
+
);
|
|
12516
|
+
}
|
|
12517
|
+
};
|
|
12518
|
+
|
|
12519
|
+
var Plugin = function () {};
|
|
12520
|
+
|
|
12521
|
+
Plugin.install = function (Vue, options) {
|
|
12522
|
+
if (Plugin.installed) {
|
|
12523
|
+
return;
|
|
12524
|
+
}
|
|
12525
|
+
|
|
12526
|
+
if(options && options.name) {
|
|
12527
|
+
Vue.component(options.name, component$2);
|
|
12528
|
+
} else {
|
|
12529
|
+
Vue.component(componentName, component$2);
|
|
12530
|
+
}
|
|
12531
|
+
};
|
|
12532
|
+
|
|
12533
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
12534
|
+
window.Vue.use(Plugin);
|
|
12535
|
+
}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-658ae951]:last-child,\ntr td[data-v-658ae951]:first-child {\n width: 1%;\n white-space: nowrap; }\n\n.crud-pagination[data-v-658ae951] {\n display: flex;\n align-items: center;\n width: 100%;\n justify-content: center;\n margin-top: 1rem; }\n\n.crud-header[data-v-658ae951] {\n display: flex;\n justify-content: space-between;\n max-height: 3rem; }\n .crud-header[data-v-658ae951] .crud-title[data-v-658ae951] {\n margin: 0; }\n .crud-header[data-v-658ae951] .crud-search[data-v-658ae951] {\n max-width: 15rem; }\n .crud-header[data-v-658ae951] .crud-search[data-v-658ae951] .btn[data-v-658ae951] {\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-658ae951] .crud-search[data-v-658ae951] .btn[data-v-658ae951].open[data-v-658ae951] {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n .crud-header[data-v-658ae951] .table-options[data-v-658ae951] {\n margin-bottom: 1rem;\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n\n.custom-control[data-v-658ae951] {\n position: relative;\n top: -15px; }\n\n@media (min-width: 992px) {\n .table[data-v-658ae951] {\n table-layout: auto; }\n .table[data-v-658ae951] tbody[data-v-658ae951] td[data-v-658ae951] {\n overflow: scroll;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */ }\n .table[data-v-658ae951] tbody[data-v-658ae951] td[data-v-658ae951]::-webkit-scrollbar {\n display: none; } }\n";
|
|
12300
12536
|
n(css, {});function normalizeComponent (
|
|
12301
12537
|
scriptExports,
|
|
12302
12538
|
render,
|
|
@@ -12392,7 +12628,8 @@ n(css, {});function normalizeComponent (
|
|
|
12392
12628
|
name: "VueLaravelCrud",
|
|
12393
12629
|
components: {
|
|
12394
12630
|
draggable: draggable,
|
|
12395
|
-
InfiniteLoading: InfiniteLoading
|
|
12631
|
+
InfiniteLoading: InfiniteLoading,
|
|
12632
|
+
VueMasonry: Plugin
|
|
12396
12633
|
},
|
|
12397
12634
|
data: function data() {
|
|
12398
12635
|
return {
|
|
@@ -14309,7 +14546,6 @@ var _sfc_render = function render() {
|
|
|
14309
14546
|
}), 0)], 1), !_vm.loading && _vm.items && _vm.items.length == 0 && !_vm.infiniteScroll ? _c('p', {
|
|
14310
14547
|
staticClass: "p-3"
|
|
14311
14548
|
}, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e()]) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CARDS ? _c('div', [_c('draggable', {
|
|
14312
|
-
staticClass: "row",
|
|
14313
14549
|
attrs: {
|
|
14314
14550
|
"group": _vm.draggableGroup,
|
|
14315
14551
|
"draggable": _vm.orderable ? '.item' : '.none',
|
|
@@ -14353,16 +14589,9 @@ var _sfc_render = function render() {
|
|
|
14353
14589
|
}
|
|
14354
14590
|
}
|
|
14355
14591
|
}, _vm._l(_vm.itemsList, function (item, index) {
|
|
14356
|
-
return _c('
|
|
14592
|
+
return _c('div', {
|
|
14357
14593
|
key: index,
|
|
14358
|
-
staticClass: "item"
|
|
14359
|
-
attrs: {
|
|
14360
|
-
"cols": _vm.colXs,
|
|
14361
|
-
"sm": _vm.colSm,
|
|
14362
|
-
"md": _vm.colMd,
|
|
14363
|
-
"lg": _vm.colLg,
|
|
14364
|
-
"xl": _vm.colXl
|
|
14365
|
-
}
|
|
14594
|
+
staticClass: "item"
|
|
14366
14595
|
}, [_c('b-card', {
|
|
14367
14596
|
staticClass: "mb-2 card-crud",
|
|
14368
14597
|
class: _vm.cardClass,
|
|
@@ -14437,7 +14666,7 @@ var _sfc_render = function render() {
|
|
|
14437
14666
|
}, {
|
|
14438
14667
|
"item": item
|
|
14439
14668
|
})], 2)], 1);
|
|
14440
|
-
}),
|
|
14669
|
+
}), 0)], 1), !_vm.loading && _vm.items && _vm.items.length == 0 && !_vm.infiniteScroll ? _c('p', {
|
|
14441
14670
|
staticClass: "p-3"
|
|
14442
14671
|
}, [_vm._v(" " + _vm._s(_vm.messageEmptyResults) + " ")]) : _vm._e()], 1) : _vm._e(), _vm.displayMode == _vm.displayModes.MODE_CUSTOM ? _c('div', [_c('div', {
|
|
14443
14672
|
class: _vm.listContainerClass
|
|
@@ -14623,7 +14852,7 @@ var _sfc_render = function render() {
|
|
|
14623
14852
|
}) : _vm._e()], 2)], 1);
|
|
14624
14853
|
};
|
|
14625
14854
|
var _sfc_staticRenderFns = [];
|
|
14626
|
-
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "
|
|
14855
|
+
var __component__ = /*#__PURE__*/normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, "658ae951", null, null);
|
|
14627
14856
|
var component$1 = __component__.exports;// Import vue component
|
|
14628
14857
|
|
|
14629
14858
|
// 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.6.
|
|
3
|
+
"version": "1.6.2",
|
|
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
|
+
"sass-loader": "^14.1.1",
|
|
26
27
|
"vue-infinite-loading": "^2.4.5",
|
|
27
28
|
"vue-masonry-css": "^1.0.3",
|
|
28
29
|
"vuedraggable": "^2.24.3"
|
package/src/vue-laravel-crud.vue
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
import draggable from "vuedraggable";
|
|
3
3
|
import moment from "moment";
|
|
4
4
|
import InfiniteLoading from 'vue-infinite-loading';
|
|
5
|
+
import Vue from 'vue'
|
|
6
|
+
import VueMasonry from 'vue-masonry-css'
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
export default /*#__PURE__*/ {
|
|
7
11
|
name: "VueLaravelCrud",
|
|
8
12
|
components: {
|
|
9
13
|
draggable,
|
|
10
|
-
InfiniteLoading
|
|
14
|
+
InfiniteLoading,
|
|
15
|
+
VueMasonry
|
|
11
16
|
},
|
|
12
17
|
data() {
|
|
13
18
|
return {
|
|
@@ -1554,7 +1559,7 @@ export default /*#__PURE__*/ {
|
|
|
1554
1559
|
</div>
|
|
1555
1560
|
|
|
1556
1561
|
<div v-if="displayMode == displayModes.MODE_CARDS">
|
|
1557
|
-
<draggable v-model="items" :group="draggableGroup"
|
|
1562
|
+
<draggable v-model="items" :group="draggableGroup" :draggable="orderable ? '.item' : '.none'"
|
|
1558
1563
|
@start="drag = true" @end="drag = false" @sort="onSort()" @add="onDraggableAdded($event)"
|
|
1559
1564
|
@change="onDraggableChange($event)" :options="draggableOptions">
|
|
1560
1565
|
<masonry
|
|
@@ -1562,8 +1567,7 @@ export default /*#__PURE__*/ {
|
|
|
1562
1567
|
:gutter="{default: '30px', 700: '15px'}"
|
|
1563
1568
|
>
|
|
1564
1569
|
|
|
1565
|
-
<
|
|
1566
|
-
:xl="colXl" class="item">
|
|
1570
|
+
<div v-for="(item, index) in itemsList" v-bind:key="index" class="item">
|
|
1567
1571
|
<b-card :title="item.title" tag="article" class="mb-2 card-crud" :class="cardClass"
|
|
1568
1572
|
:hideFooter="cardHideFooter">
|
|
1569
1573
|
<slot name="card" v-bind:item="item">
|
|
@@ -1623,7 +1627,7 @@ export default /*#__PURE__*/ {
|
|
|
1623
1627
|
</b-button-group>
|
|
1624
1628
|
</template>
|
|
1625
1629
|
</b-card>
|
|
1626
|
-
</
|
|
1630
|
+
</div>
|
|
1627
1631
|
</masonry>
|
|
1628
1632
|
</draggable>
|
|
1629
1633
|
|