@iankibetsh/shframework 5.7.9 → 5.8.1
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/README.md +131 -5
- package/dist/dist/library.mjs.css +9 -0
- package/dist/library.js +340 -203
- package/dist/library.mjs +341 -204
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -9,8 +9,8 @@ var bootstrap = require('bootstrap');
|
|
|
9
9
|
var NProgress = require('nprogress');
|
|
10
10
|
var vue = require('vue');
|
|
11
11
|
var _ = require('lodash');
|
|
12
|
-
var pinia = require('pinia');
|
|
13
12
|
var vueRouter = require('vue-router');
|
|
13
|
+
var pinia = require('pinia');
|
|
14
14
|
|
|
15
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
16
|
|
|
@@ -4494,6 +4494,108 @@ return (_ctx, _cache) => {
|
|
|
4494
4494
|
|
|
4495
4495
|
script$l.__file = "src/lib/components/ShCanvas.vue";
|
|
4496
4496
|
|
|
4497
|
+
const useUserStore = pinia.defineStore('user-store', {
|
|
4498
|
+
state: () => ({
|
|
4499
|
+
user: null,
|
|
4500
|
+
role: null,
|
|
4501
|
+
permissions: null,
|
|
4502
|
+
menus: [],
|
|
4503
|
+
loggedOut: false
|
|
4504
|
+
}),
|
|
4505
|
+
actions: {
|
|
4506
|
+
setUser (defaultEndpoint) {
|
|
4507
|
+
let user = null;
|
|
4508
|
+
try {
|
|
4509
|
+
user = shStorage.getItem('user') ? shStorage.getItem('user') : null;
|
|
4510
|
+
} catch (error) {
|
|
4511
|
+
user= null;
|
|
4512
|
+
}
|
|
4513
|
+
if(typeof user !== 'object'){
|
|
4514
|
+
user = null;
|
|
4515
|
+
}
|
|
4516
|
+
if (user ) {
|
|
4517
|
+
user.isAllowedTo = function (slug) {
|
|
4518
|
+
if (this.permissions) {
|
|
4519
|
+
let permissions = [];
|
|
4520
|
+
if (typeof this.permissions === 'string') {
|
|
4521
|
+
permissions = this.permissions;
|
|
4522
|
+
} else {
|
|
4523
|
+
permissions = this.permissions;
|
|
4524
|
+
}
|
|
4525
|
+
return permissions.includes(slug)
|
|
4526
|
+
}
|
|
4527
|
+
return false
|
|
4528
|
+
};
|
|
4529
|
+
}
|
|
4530
|
+
this.user = user;
|
|
4531
|
+
const userEndpoint = defaultEndpoint ?? vue.inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
|
|
4532
|
+
|
|
4533
|
+
shApis.doGet(userEndpoint).then(res => {
|
|
4534
|
+
let user = res.data.user;
|
|
4535
|
+
if (typeof(user) === 'undefined') {
|
|
4536
|
+
user = res.data;
|
|
4537
|
+
}
|
|
4538
|
+
shStorage.setItem('user',user);
|
|
4539
|
+
user.signOut = this.signOut;
|
|
4540
|
+
user.logout = this.signOut;
|
|
4541
|
+
user.logOut = this.signOut;
|
|
4542
|
+
user.isAllowedTo = function (slug) {
|
|
4543
|
+
if(!slug){
|
|
4544
|
+
return true
|
|
4545
|
+
}
|
|
4546
|
+
if (this.permissions) {
|
|
4547
|
+
let permissions = [];
|
|
4548
|
+
if (typeof this.permissions === 'string') {
|
|
4549
|
+
permissions = this.permissions;
|
|
4550
|
+
} else {
|
|
4551
|
+
permissions = this.permissions;
|
|
4552
|
+
}
|
|
4553
|
+
return permissions.includes(slug)
|
|
4554
|
+
}
|
|
4555
|
+
return false
|
|
4556
|
+
};
|
|
4557
|
+
user.can = user.isAllowedTo;
|
|
4558
|
+
this.user = user;
|
|
4559
|
+
}).catch((reason) => {
|
|
4560
|
+
if (reason.response && reason.response.status) {
|
|
4561
|
+
if(reason.response.status === 401) {
|
|
4562
|
+
shStorage.setItem('user',null);
|
|
4563
|
+
this.user = null;
|
|
4564
|
+
}
|
|
4565
|
+
this.loggedOut = true;
|
|
4566
|
+
}
|
|
4567
|
+
});
|
|
4568
|
+
if (this.user) {
|
|
4569
|
+
if (typeof this.user.permissions === 'string') {
|
|
4570
|
+
this.permissions = this.user.permissions;
|
|
4571
|
+
} else {
|
|
4572
|
+
this.permissions = this.user.permissions;
|
|
4573
|
+
}
|
|
4574
|
+
}
|
|
4575
|
+
const timeNow = luxon.DateTime.now().toISO();
|
|
4576
|
+
shStorage.setItem('session_start',timeNow);
|
|
4577
|
+
},
|
|
4578
|
+
signOut () {
|
|
4579
|
+
shRepo.signOutUser();
|
|
4580
|
+
},
|
|
4581
|
+
logOut () {
|
|
4582
|
+
this.signOut();
|
|
4583
|
+
},
|
|
4584
|
+
getUser () {
|
|
4585
|
+
this.setUser();
|
|
4586
|
+
},
|
|
4587
|
+
setAccessToken (accessToken) {
|
|
4588
|
+
shStorage.setItem('access_token', accessToken);
|
|
4589
|
+
this.setUser();
|
|
4590
|
+
}
|
|
4591
|
+
},
|
|
4592
|
+
getters: {
|
|
4593
|
+
userId (state) {
|
|
4594
|
+
return state.user === null ? null:state.user.id
|
|
4595
|
+
}
|
|
4596
|
+
}
|
|
4597
|
+
});
|
|
4598
|
+
|
|
4497
4599
|
const _hoisted_1$g = { class: "callout callout-info" };
|
|
4498
4600
|
|
|
4499
4601
|
function render$2(_ctx, _cache) {
|
|
@@ -4702,108 +4804,6 @@ return (_ctx, _cache) => {
|
|
|
4702
4804
|
|
|
4703
4805
|
script$i.__file = "src/lib/components/ShSilentAction.vue";
|
|
4704
4806
|
|
|
4705
|
-
const useUserStore = pinia.defineStore('user-store', {
|
|
4706
|
-
state: () => ({
|
|
4707
|
-
user: null,
|
|
4708
|
-
role: null,
|
|
4709
|
-
permissions: null,
|
|
4710
|
-
menus: [],
|
|
4711
|
-
loggedOut: false
|
|
4712
|
-
}),
|
|
4713
|
-
actions: {
|
|
4714
|
-
setUser (defaultEndpoint) {
|
|
4715
|
-
let user = null;
|
|
4716
|
-
try {
|
|
4717
|
-
user = shStorage.getItem('user') ? shStorage.getItem('user') : null;
|
|
4718
|
-
} catch (error) {
|
|
4719
|
-
user= null;
|
|
4720
|
-
}
|
|
4721
|
-
if(typeof user !== 'object'){
|
|
4722
|
-
user = null;
|
|
4723
|
-
}
|
|
4724
|
-
if (user ) {
|
|
4725
|
-
user.isAllowedTo = function (slug) {
|
|
4726
|
-
if (this.permissions) {
|
|
4727
|
-
let permissions = [];
|
|
4728
|
-
if (typeof this.permissions === 'string') {
|
|
4729
|
-
permissions = this.permissions;
|
|
4730
|
-
} else {
|
|
4731
|
-
permissions = this.permissions;
|
|
4732
|
-
}
|
|
4733
|
-
return permissions.includes(slug)
|
|
4734
|
-
}
|
|
4735
|
-
return false
|
|
4736
|
-
};
|
|
4737
|
-
}
|
|
4738
|
-
this.user = user;
|
|
4739
|
-
const userEndpoint = defaultEndpoint ?? vue.inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
|
|
4740
|
-
|
|
4741
|
-
shApis.doGet(userEndpoint).then(res => {
|
|
4742
|
-
let user = res.data.user;
|
|
4743
|
-
if (typeof(user) === 'undefined') {
|
|
4744
|
-
user = res.data;
|
|
4745
|
-
}
|
|
4746
|
-
shStorage.setItem('user',user);
|
|
4747
|
-
user.signOut = this.signOut;
|
|
4748
|
-
user.logout = this.signOut;
|
|
4749
|
-
user.logOut = this.signOut;
|
|
4750
|
-
user.isAllowedTo = function (slug) {
|
|
4751
|
-
if(!slug){
|
|
4752
|
-
return true
|
|
4753
|
-
}
|
|
4754
|
-
if (this.permissions) {
|
|
4755
|
-
let permissions = [];
|
|
4756
|
-
if (typeof this.permissions === 'string') {
|
|
4757
|
-
permissions = this.permissions;
|
|
4758
|
-
} else {
|
|
4759
|
-
permissions = this.permissions;
|
|
4760
|
-
}
|
|
4761
|
-
return permissions.includes(slug)
|
|
4762
|
-
}
|
|
4763
|
-
return false
|
|
4764
|
-
};
|
|
4765
|
-
user.can = user.isAllowedTo;
|
|
4766
|
-
this.user = user;
|
|
4767
|
-
}).catch((reason) => {
|
|
4768
|
-
if (reason.response && reason.response.status) {
|
|
4769
|
-
if(reason.response.status === 401) {
|
|
4770
|
-
shStorage.setItem('user',null);
|
|
4771
|
-
this.user = null;
|
|
4772
|
-
}
|
|
4773
|
-
this.loggedOut = true;
|
|
4774
|
-
}
|
|
4775
|
-
});
|
|
4776
|
-
if (this.user) {
|
|
4777
|
-
if (typeof this.user.permissions === 'string') {
|
|
4778
|
-
this.permissions = this.user.permissions;
|
|
4779
|
-
} else {
|
|
4780
|
-
this.permissions = this.user.permissions;
|
|
4781
|
-
}
|
|
4782
|
-
}
|
|
4783
|
-
const timeNow = luxon.DateTime.now().toISO();
|
|
4784
|
-
shStorage.setItem('session_start',timeNow);
|
|
4785
|
-
},
|
|
4786
|
-
signOut () {
|
|
4787
|
-
shRepo.signOutUser();
|
|
4788
|
-
},
|
|
4789
|
-
logOut () {
|
|
4790
|
-
this.signOut();
|
|
4791
|
-
},
|
|
4792
|
-
getUser () {
|
|
4793
|
-
this.setUser();
|
|
4794
|
-
},
|
|
4795
|
-
setAccessToken (accessToken) {
|
|
4796
|
-
shStorage.setItem('access_token', accessToken);
|
|
4797
|
-
this.setUser();
|
|
4798
|
-
}
|
|
4799
|
-
},
|
|
4800
|
-
getters: {
|
|
4801
|
-
userId (state) {
|
|
4802
|
-
return state.user === null ? null:state.user.id
|
|
4803
|
-
}
|
|
4804
|
-
}
|
|
4805
|
-
});
|
|
4806
|
-
|
|
4807
4807
|
const _hoisted_1$f = ["href"];
|
|
4808
4808
|
const _hoisted_2$c = ["title"];
|
|
4809
4809
|
|
|
@@ -4820,6 +4820,9 @@ const props = __props;
|
|
|
4820
4820
|
|
|
4821
4821
|
const url = vue.ref(props.action.path || props.action.url || props.action.link);
|
|
4822
4822
|
|
|
4823
|
+
const hasAction = vue.computed(() => !!(props.action.callback || props.action.callBack || props.action.emits));
|
|
4824
|
+
const actionValue = vue.computed(() => props.action.callback || props.action.callBack || props.action.emits);
|
|
4825
|
+
|
|
4823
4826
|
vue.onMounted(()=>{
|
|
4824
4827
|
if(!url.value) {
|
|
4825
4828
|
url.value = '';
|
|
@@ -4922,7 +4925,7 @@ return (_ctx, _cache) => {
|
|
|
4922
4925
|
: vue.createCommentVNode("v-if", true),
|
|
4923
4926
|
vue.createTextVNode(" " + vue.toDisplayString(__props.action.label), 1 /* TEXT */)
|
|
4924
4927
|
], 10 /* CLASS, PROPS */, _hoisted_1$f))
|
|
4925
|
-
: (
|
|
4928
|
+
: (hasAction.value)
|
|
4926
4929
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
4927
4930
|
key: 3,
|
|
4928
4931
|
title: __props.action.title,
|
|
@@ -4933,7 +4936,7 @@ return (_ctx, _cache) => {
|
|
|
4933
4936
|
},
|
|
4934
4937
|
__props.actionClass
|
|
4935
4938
|
]),
|
|
4936
|
-
onClick: _cache[2] || (_cache[2] = $event => (doEmitAction(
|
|
4939
|
+
onClick: _cache[2] || (_cache[2] = $event => (doEmitAction(actionValue.value, __props.record)))
|
|
4937
4940
|
}, [
|
|
4938
4941
|
(__props.action.icon)
|
|
4939
4942
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
@@ -4943,7 +4946,7 @@ return (_ctx, _cache) => {
|
|
|
4943
4946
|
: vue.createCommentVNode("v-if", true),
|
|
4944
4947
|
vue.createTextVNode(" " + vue.toDisplayString(__props.action.label), 1 /* TEXT */)
|
|
4945
4948
|
], 10 /* CLASS, PROPS */, _hoisted_2$c))
|
|
4946
|
-
: (!
|
|
4949
|
+
: (!hasAction.value)
|
|
4947
4950
|
? (vue.openBlock(), vue.createBlock(_component_router_link, {
|
|
4948
4951
|
key: 4,
|
|
4949
4952
|
title: __props.action.title,
|
|
@@ -5498,89 +5501,104 @@ const _hoisted_12$1 = {
|
|
|
5498
5501
|
class: "alert alert-danger error-loading"
|
|
5499
5502
|
};
|
|
5500
5503
|
const _hoisted_13$1 = { class: "sh-thead" };
|
|
5501
|
-
const _hoisted_14$1 = {
|
|
5502
|
-
|
|
5504
|
+
const _hoisted_14$1 = {
|
|
5505
|
+
key: 0,
|
|
5506
|
+
style: {"width":"40px"}
|
|
5507
|
+
};
|
|
5508
|
+
const _hoisted_15$1 = { key: 0 };
|
|
5503
5509
|
const _hoisted_16 = ["onClick"];
|
|
5504
5510
|
const _hoisted_17 = ["onClick"];
|
|
5505
5511
|
const _hoisted_18 = ["onClick"];
|
|
5506
|
-
const _hoisted_19 =
|
|
5507
|
-
|
|
5512
|
+
const _hoisted_19 = ["onClick"];
|
|
5513
|
+
const _hoisted_20 = {
|
|
5514
|
+
key: 1,
|
|
5508
5515
|
class: "text-capitalize"
|
|
5509
5516
|
};
|
|
5510
|
-
const
|
|
5511
|
-
const
|
|
5517
|
+
const _hoisted_21 = { class: "sh-tbody" };
|
|
5518
|
+
const _hoisted_22 = {
|
|
5512
5519
|
key: 0,
|
|
5513
5520
|
class: "text-center"
|
|
5514
5521
|
};
|
|
5515
|
-
const
|
|
5516
|
-
const
|
|
5522
|
+
const _hoisted_23 = ["colspan"];
|
|
5523
|
+
const _hoisted_24 = {
|
|
5517
5524
|
key: 1,
|
|
5518
5525
|
class: "text-center alert alert-danger"
|
|
5519
5526
|
};
|
|
5520
|
-
const
|
|
5521
|
-
const
|
|
5527
|
+
const _hoisted_25 = ["colspan"];
|
|
5528
|
+
const _hoisted_26 = {
|
|
5522
5529
|
key: 2,
|
|
5523
5530
|
class: "no_records"
|
|
5524
5531
|
};
|
|
5525
|
-
const
|
|
5526
|
-
const
|
|
5527
|
-
const
|
|
5528
|
-
const
|
|
5529
|
-
const
|
|
5532
|
+
const _hoisted_27 = ["colspan"];
|
|
5533
|
+
const _hoisted_28 = ["onClick"];
|
|
5534
|
+
const _hoisted_29 = ["value", "checked", "onChange"];
|
|
5535
|
+
const _hoisted_30 = { key: 0 };
|
|
5536
|
+
const _hoisted_31 = { key: 1 };
|
|
5537
|
+
const _hoisted_32 = {
|
|
5530
5538
|
key: 2,
|
|
5531
5539
|
class: "text-success fw-bold"
|
|
5532
5540
|
};
|
|
5533
|
-
const
|
|
5534
|
-
const _hoisted_32 = ["innerHTML"];
|
|
5535
|
-
const _hoisted_33 = ["innerHTML"];
|
|
5541
|
+
const _hoisted_33 = { key: 3 };
|
|
5536
5542
|
const _hoisted_34 = ["innerHTML"];
|
|
5537
5543
|
const _hoisted_35 = ["innerHTML"];
|
|
5538
5544
|
const _hoisted_36 = ["innerHTML"];
|
|
5539
5545
|
const _hoisted_37 = ["innerHTML"];
|
|
5540
|
-
const _hoisted_38 =
|
|
5541
|
-
|
|
5546
|
+
const _hoisted_38 = ["innerHTML"];
|
|
5547
|
+
const _hoisted_39 = ["innerHTML"];
|
|
5548
|
+
const _hoisted_40 = {
|
|
5549
|
+
key: 1,
|
|
5542
5550
|
style: {"white-space":"nowrap"}
|
|
5543
5551
|
};
|
|
5544
|
-
const
|
|
5545
|
-
const
|
|
5552
|
+
const _hoisted_41 = { key: 5 };
|
|
5553
|
+
const _hoisted_42 = {
|
|
5546
5554
|
key: 0,
|
|
5547
5555
|
class: "text-center"
|
|
5548
5556
|
};
|
|
5549
|
-
const
|
|
5550
|
-
const
|
|
5557
|
+
const _hoisted_43 = { key: 1 };
|
|
5558
|
+
const _hoisted_44 = {
|
|
5551
5559
|
key: 2,
|
|
5552
5560
|
class: "mobile-list-items"
|
|
5553
5561
|
};
|
|
5554
|
-
const
|
|
5555
|
-
const
|
|
5562
|
+
const _hoisted_45 = ["onClick"];
|
|
5563
|
+
const _hoisted_46 = { class: "form-check" };
|
|
5564
|
+
const _hoisted_47 = ["id", "checked", "onChange"];
|
|
5565
|
+
const _hoisted_48 = ["for"];
|
|
5566
|
+
const _hoisted_49 = {
|
|
5556
5567
|
key: 0,
|
|
5557
5568
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
5558
5569
|
};
|
|
5559
|
-
const
|
|
5570
|
+
const _hoisted_50 = {
|
|
5560
5571
|
key: 1,
|
|
5561
5572
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
5562
5573
|
};
|
|
5563
|
-
const
|
|
5574
|
+
const _hoisted_51 = {
|
|
5564
5575
|
key: 2,
|
|
5565
5576
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
5566
5577
|
};
|
|
5567
|
-
const
|
|
5578
|
+
const _hoisted_52 = {
|
|
5568
5579
|
key: 3,
|
|
5569
5580
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
5570
5581
|
};
|
|
5571
|
-
const
|
|
5572
|
-
const
|
|
5582
|
+
const _hoisted_53 = { key: 1 };
|
|
5583
|
+
const _hoisted_54 = {
|
|
5573
5584
|
key: 2,
|
|
5574
5585
|
class: "text-primary fw-bold"
|
|
5575
5586
|
};
|
|
5576
|
-
const
|
|
5577
|
-
const _hoisted_51 = ["innerHTML"];
|
|
5578
|
-
const _hoisted_52 = ["innerHTML"];
|
|
5579
|
-
const _hoisted_53 = ["innerHTML"];
|
|
5580
|
-
const _hoisted_54 = ["innerHTML"];
|
|
5581
|
-
const _hoisted_55 = ["innerHTML"];
|
|
5587
|
+
const _hoisted_55 = { key: 3 };
|
|
5582
5588
|
const _hoisted_56 = ["innerHTML"];
|
|
5583
|
-
const _hoisted_57 =
|
|
5589
|
+
const _hoisted_57 = ["innerHTML"];
|
|
5590
|
+
const _hoisted_58 = ["innerHTML"];
|
|
5591
|
+
const _hoisted_59 = ["innerHTML"];
|
|
5592
|
+
const _hoisted_60 = ["innerHTML"];
|
|
5593
|
+
const _hoisted_61 = ["innerHTML"];
|
|
5594
|
+
const _hoisted_62 = { key: 1 };
|
|
5595
|
+
const _hoisted_63 = {
|
|
5596
|
+
key: 8,
|
|
5597
|
+
class: "sh-multi-actions-bar shadow-lg border rounded p-3 bg-white d-flex justify-content-between align-items-center animate__animated animate__slideInUp"
|
|
5598
|
+
};
|
|
5599
|
+
const _hoisted_64 = { class: "badge bg-primary rounded-pill me-2" };
|
|
5600
|
+
const _hoisted_65 = { class: "d-flex gap-2" };
|
|
5601
|
+
const _hoisted_66 = ["onClick"];
|
|
5584
5602
|
|
|
5585
5603
|
// --- Props / Emits
|
|
5586
5604
|
|
|
@@ -5615,7 +5633,8 @@ var script$d = {
|
|
|
5615
5633
|
paginationStyle: [String, null],
|
|
5616
5634
|
hasRange: {type: Boolean, default: false},
|
|
5617
5635
|
selectedRange: [Object, null],
|
|
5618
|
-
noRecordsMessage: [String, null]
|
|
5636
|
+
noRecordsMessage: [String, null],
|
|
5637
|
+
multiActions: {type: Array, default: () => []}
|
|
5619
5638
|
},
|
|
5620
5639
|
emits: ['rowSelected', 'dataReloaded', 'dataLoaded'],
|
|
5621
5640
|
setup(__props, { emit: __emit }) {
|
|
@@ -5654,6 +5673,9 @@ const to = vue.ref(null);
|
|
|
5654
5673
|
const period = vue.ref(null);
|
|
5655
5674
|
const lastId = vue.ref(null);
|
|
5656
5675
|
|
|
5676
|
+
const selectedItems = vue.ref([]);
|
|
5677
|
+
const selectAll = vue.ref(false);
|
|
5678
|
+
|
|
5657
5679
|
// Responsive width
|
|
5658
5680
|
const windowWidth = vue.ref(typeof window !== 'undefined' ? window.innerWidth : 1024);
|
|
5659
5681
|
const handleResize = () => (windowWidth.value = window.innerWidth);
|
|
@@ -5719,6 +5741,15 @@ const getSlotName = (key) => {
|
|
|
5719
5741
|
return ''
|
|
5720
5742
|
};
|
|
5721
5743
|
|
|
5744
|
+
const {user} = pinia.storeToRefs(useUserStore());
|
|
5745
|
+
|
|
5746
|
+
const activeMultiActions = vue.computed(() => {
|
|
5747
|
+
return props.multiActions.filter(action => {
|
|
5748
|
+
if (!action.permission) return true
|
|
5749
|
+
return user.value.isAllowedTo(action.permission)
|
|
5750
|
+
})
|
|
5751
|
+
});
|
|
5752
|
+
|
|
5722
5753
|
const cleanColumn = (col) => {
|
|
5723
5754
|
const newCol = {...col};
|
|
5724
5755
|
delete newCol.component;
|
|
@@ -5951,6 +5982,36 @@ const reloadData = (newPage, append) => {
|
|
|
5951
5982
|
});
|
|
5952
5983
|
};
|
|
5953
5984
|
|
|
5985
|
+
const toggleSelectAll = (event) => {
|
|
5986
|
+
if (event.target.checked) {
|
|
5987
|
+
selectedItems.value = records.value.map(r => r.id);
|
|
5988
|
+
} else {
|
|
5989
|
+
selectedItems.value = [];
|
|
5990
|
+
}
|
|
5991
|
+
};
|
|
5992
|
+
|
|
5993
|
+
const toggleSelectItem = (id) => {
|
|
5994
|
+
const index = selectedItems.value.indexOf(id);
|
|
5995
|
+
if (index > -1) {
|
|
5996
|
+
selectedItems.value.splice(index, 1);
|
|
5997
|
+
} else {
|
|
5998
|
+
selectedItems.value.push(id);
|
|
5999
|
+
}
|
|
6000
|
+
};
|
|
6001
|
+
|
|
6002
|
+
const runMultiAction = (action) => {
|
|
6003
|
+
const selectedRecords = records.value.filter(r => selectedItems.value.includes(r.id));
|
|
6004
|
+
if (typeof action.callback === 'function') {
|
|
6005
|
+
action.callback(selectedRecords);
|
|
6006
|
+
}
|
|
6007
|
+
selectedItems.value = [];
|
|
6008
|
+
};
|
|
6009
|
+
|
|
6010
|
+
vue.watch(selectedItems, (newVal) => {
|
|
6011
|
+
selectAll.value = newVal.length === records.value.length && records.value.length > 0;
|
|
6012
|
+
}, {deep: true});
|
|
6013
|
+
|
|
6014
|
+
|
|
5954
6015
|
// --- Watches
|
|
5955
6016
|
vue.watch(() => props.hideIds, (newVal) => {
|
|
5956
6017
|
if (Array.isArray(newVal) && Array.isArray(records.value)) {
|
|
@@ -5979,16 +6040,16 @@ return (_ctx, _cache) => {
|
|
|
5979
6040
|
}, [
|
|
5980
6041
|
(!downloading.value)
|
|
5981
6042
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
5982
|
-
_cache[
|
|
5983
|
-
_cache[
|
|
6043
|
+
_cache[8] || (_cache[8] = vue.createElementVNode("i", { class: "bi-download" }, null, -1 /* CACHED */)),
|
|
6044
|
+
_cache[9] || (_cache[9] = vue.createTextVNode(" Export ", -1 /* CACHED */))
|
|
5984
6045
|
], 64 /* STABLE_FRAGMENT */))
|
|
5985
6046
|
: (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5986
|
-
_cache[
|
|
6047
|
+
_cache[10] || (_cache[10] = vue.createElementVNode("span", {
|
|
5987
6048
|
class: "spinner-border spinner-border-sm",
|
|
5988
6049
|
role: "status",
|
|
5989
6050
|
"aria-hidden": "true"
|
|
5990
6051
|
}, null, -1 /* CACHED */)),
|
|
5991
|
-
_cache[
|
|
6052
|
+
_cache[11] || (_cache[11] = vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* CACHED */))
|
|
5992
6053
|
], 64 /* STABLE_FRAGMENT */))
|
|
5993
6054
|
], 8 /* PROPS */, _hoisted_3$6)
|
|
5994
6055
|
]))
|
|
@@ -6020,7 +6081,7 @@ return (_ctx, _cache) => {
|
|
|
6020
6081
|
}, null, 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
6021
6082
|
[vue.vModelCheckbox, exactMatch.value]
|
|
6022
6083
|
]),
|
|
6023
|
-
_cache[
|
|
6084
|
+
_cache[12] || (_cache[12] = vue.createElementVNode("span", { class: "ms-1" }, "Exact", -1 /* CACHED */))
|
|
6024
6085
|
]))
|
|
6025
6086
|
: vue.createCommentVNode("v-if", true)
|
|
6026
6087
|
], 2 /* CLASS */),
|
|
@@ -6038,7 +6099,7 @@ return (_ctx, _cache) => {
|
|
|
6038
6099
|
(hasDefaultSlot.value)
|
|
6039
6100
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
6040
6101
|
(loading.value === 'loading')
|
|
6041
|
-
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, [...(_cache[
|
|
6102
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, [...(_cache[13] || (_cache[13] = [
|
|
6042
6103
|
vue.createElementVNode("div", {
|
|
6043
6104
|
class: "spinner-border",
|
|
6044
6105
|
role: "status"
|
|
@@ -6063,7 +6124,7 @@ return (_ctx, _cache) => {
|
|
|
6063
6124
|
: (hasRecordsSlot.value)
|
|
6064
6125
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
|
|
6065
6126
|
(loading.value === 'loading' && !__props.cacheKey)
|
|
6066
|
-
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, [...(_cache[
|
|
6127
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, [...(_cache[14] || (_cache[14] = [
|
|
6067
6128
|
vue.createElementVNode("div", {
|
|
6068
6129
|
class: "spinner-border",
|
|
6069
6130
|
role: "status"
|
|
@@ -6081,7 +6142,7 @@ return (_ctx, _cache) => {
|
|
|
6081
6142
|
(!records.value || records.value.length === 0)
|
|
6082
6143
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(noRecordsComponent)), { key: 0 }, {
|
|
6083
6144
|
default: vue.withCtx(() => [
|
|
6084
|
-
_cache[
|
|
6145
|
+
_cache[15] || (_cache[15] = vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* CACHED */)),
|
|
6085
6146
|
vue.createTextVNode(" " + vue.toDisplayString(__props.noRecordsMessage ?? 'No records found'), 1 /* TEXT */)
|
|
6086
6147
|
]),
|
|
6087
6148
|
_: 1 /* STABLE */
|
|
@@ -6098,50 +6159,62 @@ return (_ctx, _cache) => {
|
|
|
6098
6159
|
}, [
|
|
6099
6160
|
vue.createElementVNode("thead", _hoisted_13$1, [
|
|
6100
6161
|
vue.createElementVNode("tr", null, [
|
|
6162
|
+
(activeMultiActions.value.length > 0)
|
|
6163
|
+
? (vue.openBlock(), vue.createElementBlock("th", _hoisted_14$1, [
|
|
6164
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
6165
|
+
type: "checkbox",
|
|
6166
|
+
class: "form-check-input",
|
|
6167
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((selectAll).value = $event)),
|
|
6168
|
+
onChange: toggleSelectAll
|
|
6169
|
+
}, null, 544 /* NEED_HYDRATION, NEED_PATCH */), [
|
|
6170
|
+
[vue.vModelCheckbox, selectAll.value]
|
|
6171
|
+
])
|
|
6172
|
+
]))
|
|
6173
|
+
: vue.createCommentVNode("v-if", true),
|
|
6101
6174
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tableHeaders.value, (title) => {
|
|
6102
6175
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: title }, [
|
|
6103
6176
|
(showColumn(title))
|
|
6104
|
-
? (vue.openBlock(), vue.createElementBlock("th",
|
|
6177
|
+
? (vue.openBlock(), vue.createElementBlock("th", _hoisted_15$1, [
|
|
6105
6178
|
(typeof title === 'string')
|
|
6106
6179
|
? (vue.openBlock(), vue.createElementBlock("a", {
|
|
6107
6180
|
key: 0,
|
|
6108
6181
|
class: "text-capitalize",
|
|
6109
6182
|
onClick: $event => (changeKey('order_by', title))
|
|
6110
|
-
}, vue.toDisplayString(getLabel(title)), 9 /* TEXT, PROPS */,
|
|
6183
|
+
}, vue.toDisplayString(getLabel(title)), 9 /* TEXT, PROPS */, _hoisted_16))
|
|
6111
6184
|
: (typeof title === 'object')
|
|
6112
6185
|
? (vue.openBlock(), vue.createElementBlock("a", {
|
|
6113
6186
|
key: 1,
|
|
6114
6187
|
class: "text-capitalize",
|
|
6115
6188
|
onClick: $event => (changeKey('order_by', title.key))
|
|
6116
|
-
}, vue.toDisplayString(getLabel(title)), 9 /* TEXT, PROPS */,
|
|
6189
|
+
}, vue.toDisplayString(getLabel(title)), 9 /* TEXT, PROPS */, _hoisted_17))
|
|
6117
6190
|
: (typeof title === 'function')
|
|
6118
6191
|
? (vue.openBlock(), vue.createElementBlock("a", {
|
|
6119
6192
|
key: 2,
|
|
6120
6193
|
class: "text-capitalize",
|
|
6121
6194
|
onClick: $event => (changeKey('order_by', title(null)))
|
|
6122
|
-
}, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */,
|
|
6195
|
+
}, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_18))
|
|
6123
6196
|
: (typeof title !== 'undefined')
|
|
6124
6197
|
? (vue.openBlock(), vue.createElementBlock("a", {
|
|
6125
6198
|
key: 3,
|
|
6126
6199
|
class: "text-capitalize",
|
|
6127
6200
|
onClick: $event => (changeKey('order_by', title))
|
|
6128
|
-
}, vue.toDisplayString(String(getLabel(title))), 9 /* TEXT, PROPS */,
|
|
6201
|
+
}, vue.toDisplayString(String(getLabel(title))), 9 /* TEXT, PROPS */, _hoisted_19))
|
|
6129
6202
|
: vue.createCommentVNode("v-if", true)
|
|
6130
6203
|
]))
|
|
6131
6204
|
: vue.createCommentVNode("v-if", true)
|
|
6132
6205
|
], 64 /* STABLE_FRAGMENT */))
|
|
6133
6206
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
6134
6207
|
(__props.actions)
|
|
6135
|
-
? (vue.openBlock(), vue.createElementBlock("th",
|
|
6208
|
+
? (vue.openBlock(), vue.createElementBlock("th", _hoisted_20, vue.toDisplayString(__props.actions.label), 1 /* TEXT */))
|
|
6136
6209
|
: vue.createCommentVNode("v-if", true)
|
|
6137
6210
|
])
|
|
6138
6211
|
]),
|
|
6139
|
-
vue.createElementVNode("tbody",
|
|
6212
|
+
vue.createElementVNode("tbody", _hoisted_21, [
|
|
6140
6213
|
(loading.value === 'loading')
|
|
6141
|
-
? (vue.openBlock(), vue.createElementBlock("tr",
|
|
6214
|
+
? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_22, [
|
|
6142
6215
|
vue.createElementVNode("td", {
|
|
6143
|
-
colspan: tableHeaders.value.length
|
|
6144
|
-
}, [...(_cache[
|
|
6216
|
+
colspan: activeMultiActions.value.length > 0 ? tableHeaders.value.length + 1 : tableHeaders.value.length
|
|
6217
|
+
}, [...(_cache[16] || (_cache[16] = [
|
|
6145
6218
|
vue.createElementVNode("div", { class: "text-center" }, [
|
|
6146
6219
|
vue.createElementVNode("div", {
|
|
6147
6220
|
class: "spinner-border",
|
|
@@ -6150,24 +6223,24 @@ return (_ctx, _cache) => {
|
|
|
6150
6223
|
vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
6151
6224
|
])
|
|
6152
6225
|
], -1 /* CACHED */)
|
|
6153
|
-
]))], 8 /* PROPS */,
|
|
6226
|
+
]))], 8 /* PROPS */, _hoisted_23)
|
|
6154
6227
|
]))
|
|
6155
6228
|
: (loading.value === 'error')
|
|
6156
|
-
? (vue.openBlock(), vue.createElementBlock("tr",
|
|
6229
|
+
? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_24, [
|
|
6157
6230
|
vue.createElementVNode("td", {
|
|
6158
|
-
colspan: tableHeaders.value.length
|
|
6159
|
-
}, vue.toDisplayString(loading_error.value), 9 /* TEXT, PROPS */,
|
|
6231
|
+
colspan: activeMultiActions.value.length > 0 ? tableHeaders.value.length + 1 : tableHeaders.value.length
|
|
6232
|
+
}, vue.toDisplayString(loading_error.value), 9 /* TEXT, PROPS */, _hoisted_25)
|
|
6160
6233
|
]))
|
|
6161
6234
|
: (records.value.length === 0)
|
|
6162
|
-
? (vue.openBlock(), vue.createElementBlock("tr",
|
|
6235
|
+
? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_26, [
|
|
6163
6236
|
vue.createElementVNode("td", {
|
|
6164
|
-
colspan: __props.actions ? tableHeaders.value.length + 1 : tableHeaders.value.length
|
|
6165
|
-
}, [...(_cache[
|
|
6237
|
+
colspan: __props.actions ? tableHeaders.value.length + (activeMultiActions.value.length > 0 ? 2:1) : tableHeaders.value.length + (activeMultiActions.value.length > 0 ? 1:0)
|
|
6238
|
+
}, [...(_cache[17] || (_cache[17] = [
|
|
6166
6239
|
vue.createElementVNode("div", { class: "text-center bg-primary-light px-2 py-1 rounded no_records_div" }, [
|
|
6167
6240
|
vue.createElementVNode("i", { class: "bi-info-circle" }),
|
|
6168
6241
|
vue.createTextVNode(" No records found ")
|
|
6169
6242
|
], -1 /* CACHED */)
|
|
6170
|
-
]))], 8 /* PROPS */,
|
|
6243
|
+
]))], 8 /* PROPS */, _hoisted_27)
|
|
6171
6244
|
]))
|
|
6172
6245
|
: (loading.value === 'done')
|
|
6173
6246
|
? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(records.value, (record, index) => {
|
|
@@ -6176,10 +6249,24 @@ return (_ctx, _cache) => {
|
|
|
6176
6249
|
class: vue.normalizeClass(record.class),
|
|
6177
6250
|
onClick: $event => (rowSelected(record))
|
|
6178
6251
|
}, [
|
|
6252
|
+
(activeMultiActions.value.length > 0)
|
|
6253
|
+
? (vue.openBlock(), vue.createElementBlock("td", {
|
|
6254
|
+
key: 0,
|
|
6255
|
+
onClick: _cache[5] || (_cache[5] = vue.withModifiers(() => {}, ["stop"]))
|
|
6256
|
+
}, [
|
|
6257
|
+
vue.createElementVNode("input", {
|
|
6258
|
+
type: "checkbox",
|
|
6259
|
+
class: "form-check-input",
|
|
6260
|
+
value: record.id,
|
|
6261
|
+
checked: selectedItems.value.includes(record.id),
|
|
6262
|
+
onChange: $event => (toggleSelectItem(record.id))
|
|
6263
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_29)
|
|
6264
|
+
]))
|
|
6265
|
+
: vue.createCommentVNode("v-if", true),
|
|
6179
6266
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tableHeaders.value, (key) => {
|
|
6180
6267
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: key }, [
|
|
6181
6268
|
(showColumn(key))
|
|
6182
|
-
? (vue.openBlock(), vue.createElementBlock("td",
|
|
6269
|
+
? (vue.openBlock(), vue.createElementBlock("td", _hoisted_30, [
|
|
6183
6270
|
vue.renderSlot(_ctx.$slots, getSlotName(key), {
|
|
6184
6271
|
row: record,
|
|
6185
6272
|
index: index
|
|
@@ -6193,31 +6280,31 @@ return (_ctx, _cache) => {
|
|
|
6193
6280
|
innerHTML: getData(record, key)
|
|
6194
6281
|
}, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
|
|
6195
6282
|
: (getFieldType(key) === 'numeric')
|
|
6196
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
6283
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_31, vue.toDisplayString(Intl.NumberFormat().format(getData(record, key))), 1 /* TEXT */))
|
|
6197
6284
|
: (getFieldType(key) === 'money')
|
|
6198
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
6285
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_32, vue.toDisplayString(Intl.NumberFormat().format(getData(record, key))), 1 /* TEXT */))
|
|
6199
6286
|
: (getFieldType(key) === 'date')
|
|
6200
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
6287
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_33, vue.toDisplayString(formatDate(getData(record, key))), 1 /* TEXT */))
|
|
6201
6288
|
: (typeof key === 'string')
|
|
6202
6289
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6203
6290
|
key: 4,
|
|
6204
6291
|
innerHTML: getData(record, key)
|
|
6205
|
-
}, null, 8 /* PROPS */,
|
|
6292
|
+
}, null, 8 /* PROPS */, _hoisted_34))
|
|
6206
6293
|
: (typeof key === 'function')
|
|
6207
6294
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6208
6295
|
key: 5,
|
|
6209
6296
|
innerHTML: key(record, index)
|
|
6210
|
-
}, null, 8 /* PROPS */,
|
|
6297
|
+
}, null, 8 /* PROPS */, _hoisted_35))
|
|
6211
6298
|
: (typeof key === 'object' && key.callBack)
|
|
6212
6299
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6213
6300
|
key: 6,
|
|
6214
6301
|
innerHTML: key.callBack(record, index)
|
|
6215
|
-
}, null, 8 /* PROPS */,
|
|
6302
|
+
}, null, 8 /* PROPS */, _hoisted_36))
|
|
6216
6303
|
: (typeof key === 'object' && key.callback)
|
|
6217
6304
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6218
6305
|
key: 7,
|
|
6219
6306
|
innerHTML: key.callback(record, index)
|
|
6220
|
-
}, null, 8 /* PROPS */,
|
|
6307
|
+
}, null, 8 /* PROPS */, _hoisted_37))
|
|
6221
6308
|
: (typeof key === 'object' && key.component)
|
|
6222
6309
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
|
|
6223
6310
|
key: 8,
|
|
@@ -6227,18 +6314,18 @@ return (_ctx, _cache) => {
|
|
|
6227
6314
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6228
6315
|
key: 9,
|
|
6229
6316
|
innerHTML: getData(record, key.key ?? key.field)
|
|
6230
|
-
}, null, 8 /* PROPS */,
|
|
6317
|
+
}, null, 8 /* PROPS */, _hoisted_38))
|
|
6231
6318
|
: (vue.openBlock(), vue.createElementBlock("span", {
|
|
6232
6319
|
key: 10,
|
|
6233
6320
|
innerHTML: getData(record, key[0])
|
|
6234
|
-
}, null, 8 /* PROPS */,
|
|
6321
|
+
}, null, 8 /* PROPS */, _hoisted_39))
|
|
6235
6322
|
])
|
|
6236
6323
|
]))
|
|
6237
6324
|
: vue.createCommentVNode("v-if", true)
|
|
6238
6325
|
], 64 /* STABLE_FRAGMENT */))
|
|
6239
6326
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
6240
6327
|
(__props.actions)
|
|
6241
|
-
? (vue.openBlock(), vue.createElementBlock("td",
|
|
6328
|
+
? (vue.openBlock(), vue.createElementBlock("td", _hoisted_40, [
|
|
6242
6329
|
vue.createVNode(script$g, {
|
|
6243
6330
|
emitAction: doEmitAction,
|
|
6244
6331
|
actions: __props.actions,
|
|
@@ -6246,14 +6333,14 @@ return (_ctx, _cache) => {
|
|
|
6246
6333
|
}, null, 8 /* PROPS */, ["actions", "record"])
|
|
6247
6334
|
]))
|
|
6248
6335
|
: vue.createCommentVNode("v-if", true)
|
|
6249
|
-
], 10 /* CLASS, PROPS */,
|
|
6336
|
+
], 10 /* CLASS, PROPS */, _hoisted_28))
|
|
6250
6337
|
}), 128 /* KEYED_FRAGMENT */))
|
|
6251
6338
|
: vue.createCommentVNode("v-if", true)
|
|
6252
6339
|
])
|
|
6253
6340
|
], 2 /* CLASS */))
|
|
6254
|
-
: (vue.openBlock(), vue.createElementBlock("div",
|
|
6341
|
+
: (vue.openBlock(), vue.createElementBlock("div", _hoisted_41, [
|
|
6255
6342
|
(loading.value === 'loading')
|
|
6256
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
6343
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42, [...(_cache[18] || (_cache[18] = [
|
|
6257
6344
|
vue.createElementVNode("div", { class: "text-center" }, [
|
|
6258
6345
|
vue.createElementVNode("div", {
|
|
6259
6346
|
class: "spinner-border",
|
|
@@ -6264,17 +6351,38 @@ return (_ctx, _cache) => {
|
|
|
6264
6351
|
], -1 /* CACHED */)
|
|
6265
6352
|
]))]))
|
|
6266
6353
|
: (loading.value === 'error')
|
|
6267
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
6354
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_43, [
|
|
6268
6355
|
vue.createElementVNode("span", null, vue.toDisplayString(loading_error.value), 1 /* TEXT */)
|
|
6269
6356
|
]))
|
|
6270
6357
|
: (loading.value === 'done')
|
|
6271
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
6358
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_44, [
|
|
6272
6359
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (record, index) => {
|
|
6273
6360
|
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
6274
6361
|
key: record.id,
|
|
6275
6362
|
class: "single-mobile-req bg-light p-3",
|
|
6276
6363
|
onClick: $event => (rowSelected(record))
|
|
6277
6364
|
}, [
|
|
6365
|
+
(activeMultiActions.value.length > 0)
|
|
6366
|
+
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
6367
|
+
key: 0,
|
|
6368
|
+
class: "mb-2",
|
|
6369
|
+
onClick: _cache[6] || (_cache[6] = vue.withModifiers(() => {}, ["stop"]))
|
|
6370
|
+
}, [
|
|
6371
|
+
vue.createElementVNode("div", _hoisted_46, [
|
|
6372
|
+
vue.createElementVNode("input", {
|
|
6373
|
+
type: "checkbox",
|
|
6374
|
+
class: "form-check-input",
|
|
6375
|
+
id: 'mobile-check-'+record.id,
|
|
6376
|
+
checked: selectedItems.value.includes(record.id),
|
|
6377
|
+
onChange: $event => (toggleSelectItem(record.id))
|
|
6378
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_47),
|
|
6379
|
+
vue.createElementVNode("label", {
|
|
6380
|
+
class: "form-check-label",
|
|
6381
|
+
for: 'mobile-check-'+record.id
|
|
6382
|
+
}, "Select Item", 8 /* PROPS */, _hoisted_48)
|
|
6383
|
+
])
|
|
6384
|
+
]))
|
|
6385
|
+
: vue.createCommentVNode("v-if", true),
|
|
6278
6386
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tableHeaders.value, (key) => {
|
|
6279
6387
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
6280
6388
|
key: key[0]
|
|
@@ -6282,12 +6390,12 @@ return (_ctx, _cache) => {
|
|
|
6282
6390
|
(showColumn(key))
|
|
6283
6391
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
6284
6392
|
(typeof key === 'string' )
|
|
6285
|
-
? (vue.openBlock(), vue.createElementBlock("p",
|
|
6393
|
+
? (vue.openBlock(), vue.createElementBlock("p", _hoisted_49, vue.toDisplayString(getLabel(key)), 1 /* TEXT */))
|
|
6286
6394
|
: (typeof key === 'function')
|
|
6287
|
-
? (vue.openBlock(), vue.createElementBlock("p",
|
|
6395
|
+
? (vue.openBlock(), vue.createElementBlock("p", _hoisted_50, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
|
|
6288
6396
|
: (typeof key === 'object')
|
|
6289
|
-
? (vue.openBlock(), vue.createElementBlock("p",
|
|
6290
|
-
: (vue.openBlock(), vue.createElementBlock("p",
|
|
6397
|
+
? (vue.openBlock(), vue.createElementBlock("p", _hoisted_51, vue.toDisplayString(getLabel(key)), 1 /* TEXT */))
|
|
6398
|
+
: (vue.openBlock(), vue.createElementBlock("p", _hoisted_52, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
|
|
6291
6399
|
vue.createElementVNode("span", null, [
|
|
6292
6400
|
vue.renderSlot(_ctx.$slots, getSlotName(key), {
|
|
6293
6401
|
row: record,
|
|
@@ -6301,26 +6409,26 @@ return (_ctx, _cache) => {
|
|
|
6301
6409
|
innerHTML: getData(record, key)
|
|
6302
6410
|
}, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
|
|
6303
6411
|
: (getFieldType(key) === 'numeric')
|
|
6304
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
6412
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_53, vue.toDisplayString(Intl.NumberFormat().format(getData(record, key))), 1 /* TEXT */))
|
|
6305
6413
|
: (getFieldType(key) === 'money')
|
|
6306
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
6414
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_54, vue.toDisplayString(Intl.NumberFormat().format(getData(record, key))), 1 /* TEXT */))
|
|
6307
6415
|
: (getFieldType(key) === 'date')
|
|
6308
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
6416
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_55, vue.toDisplayString(formatDate(getData(record, key))), 1 /* TEXT */))
|
|
6309
6417
|
: (typeof key === 'string')
|
|
6310
6418
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6311
6419
|
key: 4,
|
|
6312
6420
|
innerHTML: getData(record, key)
|
|
6313
|
-
}, null, 8 /* PROPS */,
|
|
6421
|
+
}, null, 8 /* PROPS */, _hoisted_56))
|
|
6314
6422
|
: (typeof key === 'object' && key.callBack)
|
|
6315
6423
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6316
6424
|
key: 5,
|
|
6317
6425
|
innerHTML: key.callBack(record, index)
|
|
6318
|
-
}, null, 8 /* PROPS */,
|
|
6426
|
+
}, null, 8 /* PROPS */, _hoisted_57))
|
|
6319
6427
|
: (typeof key === 'object' && key.callback)
|
|
6320
6428
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6321
6429
|
key: 6,
|
|
6322
6430
|
innerHTML: key.callback(record, index)
|
|
6323
|
-
}, null, 8 /* PROPS */,
|
|
6431
|
+
}, null, 8 /* PROPS */, _hoisted_58))
|
|
6324
6432
|
: (typeof key === 'object' && key.component)
|
|
6325
6433
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
|
|
6326
6434
|
key: 7,
|
|
@@ -6330,25 +6438,25 @@ return (_ctx, _cache) => {
|
|
|
6330
6438
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6331
6439
|
key: 8,
|
|
6332
6440
|
innerHTML: getData(record, key.key ?? key.field)
|
|
6333
|
-
}, null, 8 /* PROPS */,
|
|
6441
|
+
}, null, 8 /* PROPS */, _hoisted_59))
|
|
6334
6442
|
: (typeof key === 'function')
|
|
6335
6443
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
6336
6444
|
key: 9,
|
|
6337
6445
|
innerHTML: key(record, index)
|
|
6338
|
-
}, null, 8 /* PROPS */,
|
|
6446
|
+
}, null, 8 /* PROPS */, _hoisted_60))
|
|
6339
6447
|
: (vue.openBlock(), vue.createElementBlock("span", {
|
|
6340
6448
|
key: 10,
|
|
6341
6449
|
innerHTML: getData(record, key[0])
|
|
6342
|
-
}, null, 8 /* PROPS */,
|
|
6450
|
+
}, null, 8 /* PROPS */, _hoisted_61))
|
|
6343
6451
|
])
|
|
6344
6452
|
])
|
|
6345
6453
|
], 64 /* STABLE_FRAGMENT */))
|
|
6346
6454
|
: vue.createCommentVNode("v-if", true),
|
|
6347
|
-
_cache[
|
|
6455
|
+
_cache[19] || (_cache[19] = vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* CACHED */))
|
|
6348
6456
|
], 64 /* STABLE_FRAGMENT */))
|
|
6349
6457
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
6350
6458
|
(__props.actions)
|
|
6351
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
6459
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_62, [
|
|
6352
6460
|
vue.createVNode(script$g, {
|
|
6353
6461
|
emitAction: doEmitAction,
|
|
6354
6462
|
actions: __props.actions,
|
|
@@ -6356,7 +6464,7 @@ return (_ctx, _cache) => {
|
|
|
6356
6464
|
}, null, 8 /* PROPS */, ["actions", "record"])
|
|
6357
6465
|
]))
|
|
6358
6466
|
: vue.createCommentVNode("v-if", true)
|
|
6359
|
-
], 8 /* PROPS */,
|
|
6467
|
+
], 8 /* PROPS */, _hoisted_45))
|
|
6360
6468
|
}), 128 /* KEYED_FRAGMENT */))
|
|
6361
6469
|
]))
|
|
6362
6470
|
: vue.createCommentVNode("v-if", true)
|
|
@@ -6400,6 +6508,35 @@ return (_ctx, _cache) => {
|
|
|
6400
6508
|
: vue.createCommentVNode("v-if", true)
|
|
6401
6509
|
], 64 /* STABLE_FRAGMENT */))
|
|
6402
6510
|
}), 128 /* KEYED_FRAGMENT */))
|
|
6511
|
+
: vue.createCommentVNode("v-if", true),
|
|
6512
|
+
(selectedItems.value.length > 0 && activeMultiActions.value.length > 0)
|
|
6513
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_63, [
|
|
6514
|
+
vue.createElementVNode("div", null, [
|
|
6515
|
+
vue.createElementVNode("span", _hoisted_64, vue.toDisplayString(selectedItems.value.length), 1 /* TEXT */),
|
|
6516
|
+
_cache[20] || (_cache[20] = vue.createTextVNode(" items selected ", -1 /* CACHED */))
|
|
6517
|
+
]),
|
|
6518
|
+
vue.createElementVNode("div", _hoisted_65, [
|
|
6519
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(activeMultiActions.value, (action) => {
|
|
6520
|
+
return (vue.openBlock(), vue.createElementBlock("button", {
|
|
6521
|
+
key: action.label,
|
|
6522
|
+
class: vue.normalizeClass(["btn btn-sm", action.class ?? 'btn-outline-primary']),
|
|
6523
|
+
onClick: $event => (runMultiAction(action))
|
|
6524
|
+
}, [
|
|
6525
|
+
(action.icon)
|
|
6526
|
+
? (vue.openBlock(), vue.createElementBlock("i", {
|
|
6527
|
+
key: 0,
|
|
6528
|
+
class: vue.normalizeClass(action.icon)
|
|
6529
|
+
}, null, 2 /* CLASS */))
|
|
6530
|
+
: vue.createCommentVNode("v-if", true),
|
|
6531
|
+
vue.createTextVNode(" " + vue.toDisplayString(action.label), 1 /* TEXT */)
|
|
6532
|
+
], 10 /* CLASS, PROPS */, _hoisted_66))
|
|
6533
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
6534
|
+
vue.createElementVNode("button", {
|
|
6535
|
+
class: "btn btn-sm btn-light",
|
|
6536
|
+
onClick: _cache[7] || (_cache[7] = $event => (selectedItems.value = []))
|
|
6537
|
+
}, "Cancel")
|
|
6538
|
+
])
|
|
6539
|
+
]))
|
|
6403
6540
|
: vue.createCommentVNode("v-if", true)
|
|
6404
6541
|
]))
|
|
6405
6542
|
}
|