@iankibetsh/shframework 4.8.8 → 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 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
- emits: ['actionSuccessful','actionFailed','actionCanceled'],
4410
- setup(__props, { emit: __emit }) {
4408
+ props: ['action','record','actionClass','emitAction'],
4409
+ setup(__props) {
4411
4410
 
4412
4411
  const props = __props;
4413
4412
 
4414
- const doEmitAction = __emit;
4413
+
4414
+
4415
4415
 
4416
4416
  const url = vue.ref(props.action.path || props.action.url || props.action.link);
4417
4417
 
@@ -4430,6 +4430,17 @@ vue.onMounted(()=>{
4430
4430
  });
4431
4431
  });
4432
4432
 
4433
+
4434
+
4435
+
4436
+ const doEmitAction = (callBack,item)=>{
4437
+ if(typeof callBack === 'function'){
4438
+ callBack(props.record);
4439
+ } else {
4440
+ props.emitAction(callBack,item);
4441
+ }
4442
+ };
4443
+
4433
4444
  const {user} = pinia.storeToRefs(useUserStore());
4434
4445
 
4435
4446
  return (_ctx, _cache) => {
@@ -4501,7 +4512,7 @@ return (_ctx, _cache) => {
4501
4512
  key: 3,
4502
4513
  title: __props.action.title,
4503
4514
  class: vue.normalizeClass(__props.action.class ? __props.action.class:'btn btn-default' + __props.actionClass),
4504
- onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits,__props.record)))
4515
+ onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits, __props.record)))
4505
4516
  }, [
4506
4517
  (__props.action.icon)
4507
4518
  ? (vue.openBlock(), vue.createElementBlock("span", {
@@ -4564,7 +4575,7 @@ const _hoisted_5$8 = { class: "dropdown-menu" };
4564
4575
 
4565
4576
  var script$g = {
4566
4577
  __name: 'TableActions',
4567
- props: ['actions','record'],
4578
+ props: ['actions','record','emitAction'],
4568
4579
  setup(__props) {
4569
4580
 
4570
4581
  const props = __props;
@@ -4587,10 +4598,11 @@ return (_ctx, _cache) => {
4587
4598
  }, [
4588
4599
  vue.createVNode(script$h, {
4589
4600
  "action-class": " dropdown-item",
4601
+ "emit-action": __props.emitAction,
4590
4602
  class: vue.normalizeClass(act.class),
4591
4603
  action: act,
4592
4604
  record: __props.record
4593
- }, null, 8 /* PROPS */, ["class", "action", "record"])
4605
+ }, null, 8 /* PROPS */, ["emit-action", "class", "action", "record"])
4594
4606
  ]))
4595
4607
  }), 128 /* KEYED_FRAGMENT */))
4596
4608
  ])
@@ -4598,9 +4610,10 @@ return (_ctx, _cache) => {
4598
4610
  : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(actionItems), (act) => {
4599
4611
  return (vue.openBlock(), vue.createBlock(script$h, {
4600
4612
  key: act.label,
4613
+ "emit-action": __props.emitAction,
4601
4614
  action: act,
4602
4615
  record: __props.record
4603
- }, null, 8 /* PROPS */, ["action", "record"]))
4616
+ }, null, 8 /* PROPS */, ["emit-action", "action", "record"]))
4604
4617
  }), 128 /* KEYED_FRAGMENT */))
4605
4618
  }
4606
4619
  }
@@ -5496,6 +5509,14 @@ const noRecordsComponent = vue.inject('noRecordsComponent', script$k);
5496
5509
 
5497
5510
  pinia.storeToRefs(useUserStore());
5498
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
+
5499
5520
 
5500
5521
  return (_ctx, _cache) => {
5501
5522
  const _component_router_link = vue.resolveComponent("router-link");
@@ -5701,10 +5722,11 @@ return (_ctx, _cache) => {
5701
5722
  innerHTML: key(record, index)
5702
5723
  }, null, 8 /* PROPS */, _hoisted_43))
5703
5724
  : (typeof key === 'object' && key.component)
5704
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), {
5725
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5705
5726
  key: 6,
5706
- item: record
5707
- }, null, 8 /* PROPS */, ["item"]))
5727
+ item: record,
5728
+ ref_for: true
5729
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5708
5730
  : (typeof key === 'object')
5709
5731
  ? (vue.openBlock(), vue.createElementBlock("span", {
5710
5732
  key: 7,
@@ -5719,9 +5741,10 @@ return (_ctx, _cache) => {
5719
5741
  (__props.actions)
5720
5742
  ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_46, [
5721
5743
  vue.createVNode(script$g, {
5744
+ emitAction: _ctx.doEmitAction,
5722
5745
  actions: __props.actions,
5723
5746
  record: record
5724
- }, null, 8 /* PROPS */, ["actions", "record"])
5747
+ }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5725
5748
  ]))
5726
5749
  : vue.createCommentVNode("v-if", true)
5727
5750
  ], 10 /* CLASS, PROPS */, _hoisted_38))
@@ -5775,10 +5798,11 @@ return (_ctx, _cache) => {
5775
5798
  innerHTML: record[key]
5776
5799
  }, null, 8 /* PROPS */, _hoisted_61))
5777
5800
  : (typeof key === 'object' && key.component)
5778
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), {
5801
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5779
5802
  key: 5,
5780
- item: record
5781
- }, null, 8 /* PROPS */, ["item"]))
5803
+ item: record,
5804
+ ref_for: true
5805
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5782
5806
  : (typeof key === 'object')
5783
5807
  ? (vue.openBlock(), vue.createElementBlock("span", {
5784
5808
  key: 6,
@@ -5800,9 +5824,10 @@ return (_ctx, _cache) => {
5800
5824
  (__props.actions)
5801
5825
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_66, [
5802
5826
  vue.createVNode(script$g, {
5827
+ emitAction: _ctx.doEmitAction,
5803
5828
  actions: __props.actions,
5804
5829
  record: record
5805
- }, null, 8 /* PROPS */, ["actions", "record"])
5830
+ }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5806
5831
  ]))
5807
5832
  : vue.createCommentVNode("v-if", true)
5808
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
- emits: ['actionSuccessful','actionFailed','actionCanceled'],
4398
- setup(__props, { emit: __emit }) {
4396
+ props: ['action','record','actionClass','emitAction'],
4397
+ setup(__props) {
4399
4398
 
4400
4399
  const props = __props;
4401
4400
 
4402
- const doEmitAction = __emit;
4401
+
4402
+
4403
4403
 
4404
4404
  const url = ref(props.action.path || props.action.url || props.action.link);
4405
4405
 
@@ -4418,6 +4418,17 @@ onMounted(()=>{
4418
4418
  });
4419
4419
  });
4420
4420
 
4421
+
4422
+
4423
+
4424
+ const doEmitAction = (callBack,item)=>{
4425
+ if(typeof callBack === 'function'){
4426
+ callBack(props.record);
4427
+ } else {
4428
+ props.emitAction(callBack,item);
4429
+ }
4430
+ };
4431
+
4421
4432
  const {user} = storeToRefs(useUserStore());
4422
4433
 
4423
4434
  return (_ctx, _cache) => {
@@ -4489,7 +4500,7 @@ return (_ctx, _cache) => {
4489
4500
  key: 3,
4490
4501
  title: __props.action.title,
4491
4502
  class: normalizeClass(__props.action.class ? __props.action.class:'btn btn-default' + __props.actionClass),
4492
- onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits,__props.record)))
4503
+ onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits, __props.record)))
4493
4504
  }, [
4494
4505
  (__props.action.icon)
4495
4506
  ? (openBlock(), createElementBlock("span", {
@@ -4552,7 +4563,7 @@ const _hoisted_5$8 = { class: "dropdown-menu" };
4552
4563
 
4553
4564
  var script$g = {
4554
4565
  __name: 'TableActions',
4555
- props: ['actions','record'],
4566
+ props: ['actions','record','emitAction'],
4556
4567
  setup(__props) {
4557
4568
 
4558
4569
  const props = __props;
@@ -4575,10 +4586,11 @@ return (_ctx, _cache) => {
4575
4586
  }, [
4576
4587
  createVNode(script$h, {
4577
4588
  "action-class": " dropdown-item",
4589
+ "emit-action": __props.emitAction,
4578
4590
  class: normalizeClass(act.class),
4579
4591
  action: act,
4580
4592
  record: __props.record
4581
- }, null, 8 /* PROPS */, ["class", "action", "record"])
4593
+ }, null, 8 /* PROPS */, ["emit-action", "class", "action", "record"])
4582
4594
  ]))
4583
4595
  }), 128 /* KEYED_FRAGMENT */))
4584
4596
  ])
@@ -4586,9 +4598,10 @@ return (_ctx, _cache) => {
4586
4598
  : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(actionItems), (act) => {
4587
4599
  return (openBlock(), createBlock(script$h, {
4588
4600
  key: act.label,
4601
+ "emit-action": __props.emitAction,
4589
4602
  action: act,
4590
4603
  record: __props.record
4591
- }, null, 8 /* PROPS */, ["action", "record"]))
4604
+ }, null, 8 /* PROPS */, ["emit-action", "action", "record"]))
4592
4605
  }), 128 /* KEYED_FRAGMENT */))
4593
4606
  }
4594
4607
  }
@@ -5484,6 +5497,14 @@ const noRecordsComponent = inject('noRecordsComponent', script$k);
5484
5497
 
5485
5498
  storeToRefs(useUserStore());
5486
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
+
5487
5508
 
5488
5509
  return (_ctx, _cache) => {
5489
5510
  const _component_router_link = resolveComponent("router-link");
@@ -5689,10 +5710,11 @@ return (_ctx, _cache) => {
5689
5710
  innerHTML: key(record, index)
5690
5711
  }, null, 8 /* PROPS */, _hoisted_43))
5691
5712
  : (typeof key === 'object' && key.component)
5692
- ? (openBlock(), createBlock(resolveDynamicComponent(key.component), {
5713
+ ? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
5693
5714
  key: 6,
5694
- item: record
5695
- }, null, 8 /* PROPS */, ["item"]))
5715
+ item: record,
5716
+ ref_for: true
5717
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5696
5718
  : (typeof key === 'object')
5697
5719
  ? (openBlock(), createElementBlock("span", {
5698
5720
  key: 7,
@@ -5707,9 +5729,10 @@ return (_ctx, _cache) => {
5707
5729
  (__props.actions)
5708
5730
  ? (openBlock(), createElementBlock("td", _hoisted_46, [
5709
5731
  createVNode(script$g, {
5732
+ emitAction: _ctx.doEmitAction,
5710
5733
  actions: __props.actions,
5711
5734
  record: record
5712
- }, null, 8 /* PROPS */, ["actions", "record"])
5735
+ }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5713
5736
  ]))
5714
5737
  : createCommentVNode("v-if", true)
5715
5738
  ], 10 /* CLASS, PROPS */, _hoisted_38))
@@ -5763,10 +5786,11 @@ return (_ctx, _cache) => {
5763
5786
  innerHTML: record[key]
5764
5787
  }, null, 8 /* PROPS */, _hoisted_61))
5765
5788
  : (typeof key === 'object' && key.component)
5766
- ? (openBlock(), createBlock(resolveDynamicComponent(key.component), {
5789
+ ? (openBlock(), createBlock(resolveDynamicComponent(key.component), mergeProps({
5767
5790
  key: 5,
5768
- item: record
5769
- }, null, 8 /* PROPS */, ["item"]))
5791
+ item: record,
5792
+ ref_for: true
5793
+ }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5770
5794
  : (typeof key === 'object')
5771
5795
  ? (openBlock(), createElementBlock("span", {
5772
5796
  key: 6,
@@ -5788,9 +5812,10 @@ return (_ctx, _cache) => {
5788
5812
  (__props.actions)
5789
5813
  ? (openBlock(), createElementBlock("div", _hoisted_66, [
5790
5814
  createVNode(script$g, {
5815
+ emitAction: _ctx.doEmitAction,
5791
5816
  actions: __props.actions,
5792
5817
  record: record
5793
- }, null, 8 /* PROPS */, ["actions", "record"])
5818
+ }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5794
5819
  ]))
5795
5820
  : createCommentVNode("v-if", true)
5796
5821
  ], 8 /* PROPS */, _hoisted_53))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "4.8.8",
3
+ "version": "5.0.0",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",