@iankibetsh/shframework 5.6.3 → 5.6.5

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
@@ -4475,6 +4475,9 @@ vue.onMounted(()=>{
4475
4475
  if(!url.value) {
4476
4476
  url.value = '';
4477
4477
  }
4478
+ if(typeof url.value === 'function'){
4479
+ url.value = url.value(props.record);
4480
+ }
4478
4481
  // replace params in url with record key e.g {id} replaced with record.id
4479
4482
  url.value = url.value.replace(/{(\w+)}/g, (match, key) => {
4480
4483
  return props.record[key]
@@ -4497,6 +4500,13 @@ const doEmitAction = (callBack,item)=>{
4497
4500
  }
4498
4501
  };
4499
4502
 
4503
+ const actionSuccessful = (res)=>{
4504
+ doEmitAction('actionSuccessful',res,props.record);
4505
+ };
4506
+
4507
+ const actionFailed = (res)=>{
4508
+ doEmitAction('actionFailed',res,props.record);
4509
+ };
4500
4510
  const {user} = pinia.storeToRefs(useUserStore());
4501
4511
 
4502
4512
  return (_ctx, _cache) => {
@@ -4509,9 +4519,9 @@ return (_ctx, _cache) => {
4509
4519
  (['confirmAction','confirmaction','confirm-action','confirm'].includes(__props.action.type))
4510
4520
  ? (vue.openBlock(), vue.createBlock(script$j, {
4511
4521
  key: 0,
4512
- onActionSuccessful: _cache[0] || (_cache[0] = $event => (doEmitAction('actionSuccessful',__props.record))),
4513
- onActionFailed: _cache[1] || (_cache[1] = $event => (doEmitAction('actionFailed',__props.record))),
4514
- onActionCanceled: _cache[2] || (_cache[2] = $event => (doEmitAction('actionCanceled',__props.record))),
4522
+ onActionSuccessful: actionSuccessful,
4523
+ onActionFailed: actionFailed,
4524
+ onActionCanceled: _cache[0] || (_cache[0] = $event => (doEmitAction('actionCanceled',__props.record))),
4515
4525
  "loading-message": __props.action.label,
4516
4526
  class: vue.normalizeClass(__props.action.class + __props.actionClass),
4517
4527
  url: url.value
@@ -4530,9 +4540,9 @@ return (_ctx, _cache) => {
4530
4540
  : (['silentAction','silentaction','silent-action','silent'].includes(__props.action.type))
4531
4541
  ? (vue.openBlock(), vue.createBlock(script$i, {
4532
4542
  key: 1,
4533
- onActionSuccessful: _cache[3] || (_cache[3] = $event => (doEmitAction('actionSuccessful',__props.record))),
4534
- onActionFailed: _cache[4] || (_cache[4] = $event => (doEmitAction('actionFailed',__props.record))),
4535
- onActionCanceled: _cache[5] || (_cache[5] = $event => (doEmitAction('actionCanceled',__props.record))),
4543
+ onActionSuccessful: actionSuccessful,
4544
+ onActionFailed: actionFailed,
4545
+ onActionCanceled: _cache[1] || (_cache[1] = $event => (doEmitAction('actionCanceled',__props.record))),
4536
4546
  "loading-message": __props.action.label,
4537
4547
  class: vue.normalizeClass(__props.action.class +' '+ __props.actionClass),
4538
4548
  url: url.value
@@ -4574,7 +4584,7 @@ return (_ctx, _cache) => {
4574
4584
  },
4575
4585
  __props.actionClass
4576
4586
  ]),
4577
- onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits, __props.record)))
4587
+ onClick: _cache[2] || (_cache[2] = $event => (doEmitAction(__props.action.emits, __props.record)))
4578
4588
  }, [
4579
4589
  (__props.action.icon)
4580
4590
  ? (vue.openBlock(), vue.createElementBlock("span", {
package/dist/library.mjs CHANGED
@@ -4464,6 +4464,9 @@ onMounted(()=>{
4464
4464
  if(!url.value) {
4465
4465
  url.value = '';
4466
4466
  }
4467
+ if(typeof url.value === 'function'){
4468
+ url.value = url.value(props.record);
4469
+ }
4467
4470
  // replace params in url with record key e.g {id} replaced with record.id
4468
4471
  url.value = url.value.replace(/{(\w+)}/g, (match, key) => {
4469
4472
  return props.record[key]
@@ -4486,6 +4489,13 @@ const doEmitAction = (callBack,item)=>{
4486
4489
  }
4487
4490
  };
4488
4491
 
4492
+ const actionSuccessful = (res)=>{
4493
+ doEmitAction('actionSuccessful',res,props.record);
4494
+ };
4495
+
4496
+ const actionFailed = (res)=>{
4497
+ doEmitAction('actionFailed',res,props.record);
4498
+ };
4489
4499
  const {user} = storeToRefs(useUserStore());
4490
4500
 
4491
4501
  return (_ctx, _cache) => {
@@ -4498,9 +4508,9 @@ return (_ctx, _cache) => {
4498
4508
  (['confirmAction','confirmaction','confirm-action','confirm'].includes(__props.action.type))
4499
4509
  ? (openBlock(), createBlock(script$j, {
4500
4510
  key: 0,
4501
- onActionSuccessful: _cache[0] || (_cache[0] = $event => (doEmitAction('actionSuccessful',__props.record))),
4502
- onActionFailed: _cache[1] || (_cache[1] = $event => (doEmitAction('actionFailed',__props.record))),
4503
- onActionCanceled: _cache[2] || (_cache[2] = $event => (doEmitAction('actionCanceled',__props.record))),
4511
+ onActionSuccessful: actionSuccessful,
4512
+ onActionFailed: actionFailed,
4513
+ onActionCanceled: _cache[0] || (_cache[0] = $event => (doEmitAction('actionCanceled',__props.record))),
4504
4514
  "loading-message": __props.action.label,
4505
4515
  class: normalizeClass(__props.action.class + __props.actionClass),
4506
4516
  url: url.value
@@ -4519,9 +4529,9 @@ return (_ctx, _cache) => {
4519
4529
  : (['silentAction','silentaction','silent-action','silent'].includes(__props.action.type))
4520
4530
  ? (openBlock(), createBlock(script$i, {
4521
4531
  key: 1,
4522
- onActionSuccessful: _cache[3] || (_cache[3] = $event => (doEmitAction('actionSuccessful',__props.record))),
4523
- onActionFailed: _cache[4] || (_cache[4] = $event => (doEmitAction('actionFailed',__props.record))),
4524
- onActionCanceled: _cache[5] || (_cache[5] = $event => (doEmitAction('actionCanceled',__props.record))),
4532
+ onActionSuccessful: actionSuccessful,
4533
+ onActionFailed: actionFailed,
4534
+ onActionCanceled: _cache[1] || (_cache[1] = $event => (doEmitAction('actionCanceled',__props.record))),
4525
4535
  "loading-message": __props.action.label,
4526
4536
  class: normalizeClass(__props.action.class +' '+ __props.actionClass),
4527
4537
  url: url.value
@@ -4563,7 +4573,7 @@ return (_ctx, _cache) => {
4563
4573
  },
4564
4574
  __props.actionClass
4565
4575
  ]),
4566
- onClick: _cache[6] || (_cache[6] = $event => (doEmitAction(__props.action.emits, __props.record)))
4576
+ onClick: _cache[2] || (_cache[2] = $event => (doEmitAction(__props.action.emits, __props.record)))
4567
4577
  }, [
4568
4578
  (__props.action.icon)
4569
4579
  ? (openBlock(), createElementBlock("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.6.3",
3
+ "version": "5.6.5",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",