@iankibetsh/shframework 4.8.9 → 5.0.0
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/library.js +34 -18
- package/dist/library.mjs +34 -18
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -4405,13 +4405,13 @@ const _hoisted_2$b = ["title"];
|
|
|
4405
4405
|
|
|
4406
4406
|
var script$h = {
|
|
4407
4407
|
__name: 'SingleAction',
|
|
4408
|
-
props: ['action','record','actionClass'],
|
|
4409
|
-
|
|
4410
|
-
setup(__props, { emit: __emit }) {
|
|
4408
|
+
props: ['action','record','actionClass','emitAction'],
|
|
4409
|
+
setup(__props) {
|
|
4411
4410
|
|
|
4412
4411
|
const props = __props;
|
|
4413
4412
|
|
|
4414
|
-
|
|
4413
|
+
|
|
4414
|
+
|
|
4415
4415
|
|
|
4416
4416
|
const url = vue.ref(props.action.path || props.action.url || props.action.link);
|
|
4417
4417
|
|
|
@@ -4431,11 +4431,13 @@ vue.onMounted(()=>{
|
|
|
4431
4431
|
});
|
|
4432
4432
|
|
|
4433
4433
|
|
|
4434
|
-
|
|
4434
|
+
|
|
4435
|
+
|
|
4436
|
+
const doEmitAction = (callBack,item)=>{
|
|
4435
4437
|
if(typeof callBack === 'function'){
|
|
4436
4438
|
callBack(props.record);
|
|
4437
4439
|
} else {
|
|
4438
|
-
|
|
4440
|
+
props.emitAction(callBack,item);
|
|
4439
4441
|
}
|
|
4440
4442
|
};
|
|
4441
4443
|
|
|
@@ -4510,7 +4512,7 @@ return (_ctx, _cache) => {
|
|
|
4510
4512
|
key: 3,
|
|
4511
4513
|
title: __props.action.title,
|
|
4512
4514
|
class: vue.normalizeClass(__props.action.class ? __props.action.class:'btn btn-default' + __props.actionClass),
|
|
4513
|
-
onClick: _cache[6] || (_cache[6] = $event => (
|
|
4515
|
+
onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits, __props.record)))
|
|
4514
4516
|
}, [
|
|
4515
4517
|
(__props.action.icon)
|
|
4516
4518
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
@@ -4573,7 +4575,7 @@ const _hoisted_5$8 = { class: "dropdown-menu" };
|
|
|
4573
4575
|
|
|
4574
4576
|
var script$g = {
|
|
4575
4577
|
__name: 'TableActions',
|
|
4576
|
-
props: ['actions','record'],
|
|
4578
|
+
props: ['actions','record','emitAction'],
|
|
4577
4579
|
setup(__props) {
|
|
4578
4580
|
|
|
4579
4581
|
const props = __props;
|
|
@@ -4596,10 +4598,11 @@ return (_ctx, _cache) => {
|
|
|
4596
4598
|
}, [
|
|
4597
4599
|
vue.createVNode(script$h, {
|
|
4598
4600
|
"action-class": " dropdown-item",
|
|
4601
|
+
"emit-action": __props.emitAction,
|
|
4599
4602
|
class: vue.normalizeClass(act.class),
|
|
4600
4603
|
action: act,
|
|
4601
4604
|
record: __props.record
|
|
4602
|
-
}, null, 8 /* PROPS */, ["class", "action", "record"])
|
|
4605
|
+
}, null, 8 /* PROPS */, ["emit-action", "class", "action", "record"])
|
|
4603
4606
|
]))
|
|
4604
4607
|
}), 128 /* KEYED_FRAGMENT */))
|
|
4605
4608
|
])
|
|
@@ -4607,9 +4610,10 @@ return (_ctx, _cache) => {
|
|
|
4607
4610
|
: (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(actionItems), (act) => {
|
|
4608
4611
|
return (vue.openBlock(), vue.createBlock(script$h, {
|
|
4609
4612
|
key: act.label,
|
|
4613
|
+
"emit-action": __props.emitAction,
|
|
4610
4614
|
action: act,
|
|
4611
4615
|
record: __props.record
|
|
4612
|
-
}, null, 8 /* PROPS */, ["action", "record"]))
|
|
4616
|
+
}, null, 8 /* PROPS */, ["emit-action", "action", "record"]))
|
|
4613
4617
|
}), 128 /* KEYED_FRAGMENT */))
|
|
4614
4618
|
}
|
|
4615
4619
|
}
|
|
@@ -5505,6 +5509,14 @@ const noRecordsComponent = vue.inject('noRecordsComponent', script$k);
|
|
|
5505
5509
|
|
|
5506
5510
|
pinia.storeToRefs(useUserStore());
|
|
5507
5511
|
|
|
5512
|
+
const cleanColumn = col=>{
|
|
5513
|
+
// remove col.component
|
|
5514
|
+
const newCol = {...col};
|
|
5515
|
+
delete newCol.component;
|
|
5516
|
+
delete newCol.key;
|
|
5517
|
+
return newCol
|
|
5518
|
+
};
|
|
5519
|
+
|
|
5508
5520
|
|
|
5509
5521
|
return (_ctx, _cache) => {
|
|
5510
5522
|
const _component_router_link = vue.resolveComponent("router-link");
|
|
@@ -5710,10 +5722,11 @@ return (_ctx, _cache) => {
|
|
|
5710
5722
|
innerHTML: key(record, index)
|
|
5711
5723
|
}, null, 8 /* PROPS */, _hoisted_43))
|
|
5712
5724
|
: (typeof key === 'object' && key.component)
|
|
5713
|
-
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), {
|
|
5725
|
+
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
|
|
5714
5726
|
key: 6,
|
|
5715
|
-
item: record
|
|
5716
|
-
|
|
5727
|
+
item: record,
|
|
5728
|
+
ref_for: true
|
|
5729
|
+
}, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
|
|
5717
5730
|
: (typeof key === 'object')
|
|
5718
5731
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
5719
5732
|
key: 7,
|
|
@@ -5728,9 +5741,10 @@ return (_ctx, _cache) => {
|
|
|
5728
5741
|
(__props.actions)
|
|
5729
5742
|
? (vue.openBlock(), vue.createElementBlock("td", _hoisted_46, [
|
|
5730
5743
|
vue.createVNode(script$g, {
|
|
5744
|
+
emitAction: _ctx.doEmitAction,
|
|
5731
5745
|
actions: __props.actions,
|
|
5732
5746
|
record: record
|
|
5733
|
-
}, null, 8 /* PROPS */, ["actions", "record"])
|
|
5747
|
+
}, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
|
|
5734
5748
|
]))
|
|
5735
5749
|
: vue.createCommentVNode("v-if", true)
|
|
5736
5750
|
], 10 /* CLASS, PROPS */, _hoisted_38))
|
|
@@ -5784,10 +5798,11 @@ return (_ctx, _cache) => {
|
|
|
5784
5798
|
innerHTML: record[key]
|
|
5785
5799
|
}, null, 8 /* PROPS */, _hoisted_61))
|
|
5786
5800
|
: (typeof key === 'object' && key.component)
|
|
5787
|
-
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), {
|
|
5801
|
+
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
|
|
5788
5802
|
key: 5,
|
|
5789
|
-
item: record
|
|
5790
|
-
|
|
5803
|
+
item: record,
|
|
5804
|
+
ref_for: true
|
|
5805
|
+
}, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
|
|
5791
5806
|
: (typeof key === 'object')
|
|
5792
5807
|
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
5793
5808
|
key: 6,
|
|
@@ -5809,9 +5824,10 @@ return (_ctx, _cache) => {
|
|
|
5809
5824
|
(__props.actions)
|
|
5810
5825
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_66, [
|
|
5811
5826
|
vue.createVNode(script$g, {
|
|
5827
|
+
emitAction: _ctx.doEmitAction,
|
|
5812
5828
|
actions: __props.actions,
|
|
5813
5829
|
record: record
|
|
5814
|
-
}, null, 8 /* PROPS */, ["actions", "record"])
|
|
5830
|
+
}, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
|
|
5815
5831
|
]))
|
|
5816
5832
|
: vue.createCommentVNode("v-if", true)
|
|
5817
5833
|
], 8 /* PROPS */, _hoisted_53))
|
package/dist/library.mjs
CHANGED
|
@@ -4393,13 +4393,13 @@ const _hoisted_2$b = ["title"];
|
|
|
4393
4393
|
|
|
4394
4394
|
var script$h = {
|
|
4395
4395
|
__name: 'SingleAction',
|
|
4396
|
-
props: ['action','record','actionClass'],
|
|
4397
|
-
|
|
4398
|
-
setup(__props, { emit: __emit }) {
|
|
4396
|
+
props: ['action','record','actionClass','emitAction'],
|
|
4397
|
+
setup(__props) {
|
|
4399
4398
|
|
|
4400
4399
|
const props = __props;
|
|
4401
4400
|
|
|
4402
|
-
|
|
4401
|
+
|
|
4402
|
+
|
|
4403
4403
|
|
|
4404
4404
|
const url = ref(props.action.path || props.action.url || props.action.link);
|
|
4405
4405
|
|
|
@@ -4419,11 +4419,13 @@ onMounted(()=>{
|
|
|
4419
4419
|
});
|
|
4420
4420
|
|
|
4421
4421
|
|
|
4422
|
-
|
|
4422
|
+
|
|
4423
|
+
|
|
4424
|
+
const doEmitAction = (callBack,item)=>{
|
|
4423
4425
|
if(typeof callBack === 'function'){
|
|
4424
4426
|
callBack(props.record);
|
|
4425
4427
|
} else {
|
|
4426
|
-
|
|
4428
|
+
props.emitAction(callBack,item);
|
|
4427
4429
|
}
|
|
4428
4430
|
};
|
|
4429
4431
|
|
|
@@ -4498,7 +4500,7 @@ return (_ctx, _cache) => {
|
|
|
4498
4500
|
key: 3,
|
|
4499
4501
|
title: __props.action.title,
|
|
4500
4502
|
class: normalizeClass(__props.action.class ? __props.action.class:'btn btn-default' + __props.actionClass),
|
|
4501
|
-
onClick: _cache[6] || (_cache[6] = $event => (
|
|
4503
|
+
onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits, __props.record)))
|
|
4502
4504
|
}, [
|
|
4503
4505
|
(__props.action.icon)
|
|
4504
4506
|
? (openBlock(), createElementBlock("span", {
|
|
@@ -4561,7 +4563,7 @@ const _hoisted_5$8 = { class: "dropdown-menu" };
|
|
|
4561
4563
|
|
|
4562
4564
|
var script$g = {
|
|
4563
4565
|
__name: 'TableActions',
|
|
4564
|
-
props: ['actions','record'],
|
|
4566
|
+
props: ['actions','record','emitAction'],
|
|
4565
4567
|
setup(__props) {
|
|
4566
4568
|
|
|
4567
4569
|
const props = __props;
|
|
@@ -4584,10 +4586,11 @@ return (_ctx, _cache) => {
|
|
|
4584
4586
|
}, [
|
|
4585
4587
|
createVNode(script$h, {
|
|
4586
4588
|
"action-class": " dropdown-item",
|
|
4589
|
+
"emit-action": __props.emitAction,
|
|
4587
4590
|
class: normalizeClass(act.class),
|
|
4588
4591
|
action: act,
|
|
4589
4592
|
record: __props.record
|
|
4590
|
-
}, null, 8 /* PROPS */, ["class", "action", "record"])
|
|
4593
|
+
}, null, 8 /* PROPS */, ["emit-action", "class", "action", "record"])
|
|
4591
4594
|
]))
|
|
4592
4595
|
}), 128 /* KEYED_FRAGMENT */))
|
|
4593
4596
|
])
|
|
@@ -4595,9 +4598,10 @@ return (_ctx, _cache) => {
|
|
|
4595
4598
|
: (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(actionItems), (act) => {
|
|
4596
4599
|
return (openBlock(), createBlock(script$h, {
|
|
4597
4600
|
key: act.label,
|
|
4601
|
+
"emit-action": __props.emitAction,
|
|
4598
4602
|
action: act,
|
|
4599
4603
|
record: __props.record
|
|
4600
|
-
}, null, 8 /* PROPS */, ["action", "record"]))
|
|
4604
|
+
}, null, 8 /* PROPS */, ["emit-action", "action", "record"]))
|
|
4601
4605
|
}), 128 /* KEYED_FRAGMENT */))
|
|
4602
4606
|
}
|
|
4603
4607
|
}
|
|
@@ -5493,6 +5497,14 @@ const noRecordsComponent = inject('noRecordsComponent', script$k);
|
|
|
5493
5497
|
|
|
5494
5498
|
storeToRefs(useUserStore());
|
|
5495
5499
|
|
|
5500
|
+
const cleanColumn = col=>{
|
|
5501
|
+
// remove col.component
|
|
5502
|
+
const newCol = {...col};
|
|
5503
|
+
delete newCol.component;
|
|
5504
|
+
delete newCol.key;
|
|
5505
|
+
return newCol
|
|
5506
|
+
};
|
|
5507
|
+
|
|
5496
5508
|
|
|
5497
5509
|
return (_ctx, _cache) => {
|
|
5498
5510
|
const _component_router_link = resolveComponent("router-link");
|
|
@@ -5698,10 +5710,11 @@ return (_ctx, _cache) => {
|
|
|
5698
5710
|
innerHTML: key(record, index)
|
|
5699
5711
|
}, null, 8 /* PROPS */, _hoisted_43))
|
|
5700
5712
|
: (typeof key === 'object' && key.component)
|
|
5701
|
-
? (openBlock(), createBlock(resolveDynamicComponent(key.component), {
|
|
5713
|
+
? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
|
|
5702
5714
|
key: 6,
|
|
5703
|
-
item: record
|
|
5704
|
-
|
|
5715
|
+
item: record,
|
|
5716
|
+
ref_for: true
|
|
5717
|
+
}, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
|
|
5705
5718
|
: (typeof key === 'object')
|
|
5706
5719
|
? (openBlock(), createElementBlock("span", {
|
|
5707
5720
|
key: 7,
|
|
@@ -5716,9 +5729,10 @@ return (_ctx, _cache) => {
|
|
|
5716
5729
|
(__props.actions)
|
|
5717
5730
|
? (openBlock(), createElementBlock("td", _hoisted_46, [
|
|
5718
5731
|
createVNode(script$g, {
|
|
5732
|
+
emitAction: _ctx.doEmitAction,
|
|
5719
5733
|
actions: __props.actions,
|
|
5720
5734
|
record: record
|
|
5721
|
-
}, null, 8 /* PROPS */, ["actions", "record"])
|
|
5735
|
+
}, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
|
|
5722
5736
|
]))
|
|
5723
5737
|
: createCommentVNode("v-if", true)
|
|
5724
5738
|
], 10 /* CLASS, PROPS */, _hoisted_38))
|
|
@@ -5772,10 +5786,11 @@ return (_ctx, _cache) => {
|
|
|
5772
5786
|
innerHTML: record[key]
|
|
5773
5787
|
}, null, 8 /* PROPS */, _hoisted_61))
|
|
5774
5788
|
: (typeof key === 'object' && key.component)
|
|
5775
|
-
? (openBlock(), createBlock(resolveDynamicComponent(key.component), {
|
|
5789
|
+
? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
|
|
5776
5790
|
key: 5,
|
|
5777
|
-
item: record
|
|
5778
|
-
|
|
5791
|
+
item: record,
|
|
5792
|
+
ref_for: true
|
|
5793
|
+
}, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
|
|
5779
5794
|
: (typeof key === 'object')
|
|
5780
5795
|
? (openBlock(), createElementBlock("span", {
|
|
5781
5796
|
key: 6,
|
|
@@ -5797,9 +5812,10 @@ return (_ctx, _cache) => {
|
|
|
5797
5812
|
(__props.actions)
|
|
5798
5813
|
? (openBlock(), createElementBlock("div", _hoisted_66, [
|
|
5799
5814
|
createVNode(script$g, {
|
|
5815
|
+
emitAction: _ctx.doEmitAction,
|
|
5800
5816
|
actions: __props.actions,
|
|
5801
5817
|
record: record
|
|
5802
|
-
}, null, 8 /* PROPS */, ["actions", "record"])
|
|
5818
|
+
}, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
|
|
5803
5819
|
]))
|
|
5804
5820
|
: createCommentVNode("v-if", true)
|
|
5805
5821
|
], 8 /* PROPS */, _hoisted_53))
|