@iankibetsh/shframework 1.0.7 → 1.0.9

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.
@@ -84,6 +84,10 @@
84
84
  }
85
85
  }
86
86
 
87
+ .sh-forgot-link, .sh-register-link{
88
+ cursor: pointer;
89
+ }
90
+
87
91
  .sh-selected-item{
88
92
  line-height: unset!important;
89
93
  }
@@ -98,7 +102,3 @@
98
102
  margin-bottom: auto;
99
103
  margin-right: 0.255em;
100
104
  }
101
-
102
- .sh-forgot-link, .sh-register-link{
103
- cursor: pointer;
104
- }
package/dist/library.js CHANGED
@@ -8,6 +8,8 @@ var vue = require('vue');
8
8
  var NProgress = require('nprogress');
9
9
  var Editor = require('@tinymce/tinymce-vue');
10
10
  var Swal = require('sweetalert2');
11
+ var ShConfirmAction = require('@/lib/components/ShConfirmAction.vue');
12
+ var ShSilentAction = require('@/lib/components/ShSilentAction.vue');
11
13
  var pinia = require('pinia');
12
14
  var vueRouter = require('vue-router');
13
15
 
@@ -18,6 +20,8 @@ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
18
20
  var NProgress__default = /*#__PURE__*/_interopDefaultLegacy(NProgress);
19
21
  var Editor__default = /*#__PURE__*/_interopDefaultLegacy(Editor);
20
22
  var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
23
+ var ShConfirmAction__default = /*#__PURE__*/_interopDefaultLegacy(ShConfirmAction);
24
+ var ShSilentAction__default = /*#__PURE__*/_interopDefaultLegacy(ShSilentAction);
21
25
 
22
26
  function setItem (key, value) {
23
27
  let toStore = value;
@@ -68,8 +72,12 @@ const checkSession = function (isCheking) {
68
72
  let apiUrl = undefined.VITE_APP_API_URL;
69
73
  // eslint-disable-next-line no-undef
70
74
  if (process.env.NODE_ENV === 'production') {
71
- apiUrl = undefined.VITE_APP_API_PRODUCTION_URL;
75
+ const productionUrl = undefined.VITE_APP_API_PRODUCTION_URL;
76
+ if(productionUrl){
77
+ apiUrl = productionUrl;
78
+ }
72
79
  }
80
+
73
81
  const axios = Axios__default["default"].create({
74
82
  baseURL: apiUrl
75
83
  });
@@ -3107,7 +3115,7 @@ var shRepo = {
3107
3115
 
3108
3116
  var script$7 = {
3109
3117
  name: 'sh-table',
3110
- props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover'],
3118
+ props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds'],
3111
3119
  inject: ['channel'],
3112
3120
  data () {
3113
3121
  return {
@@ -3131,15 +3139,20 @@ var script$7 = {
3131
3139
  },
3132
3140
  mounted () {
3133
3141
  if (this.event) ;
3134
- if(this.actions && this.actions.actions){
3142
+ if (this.actions && this.actions.actions) {
3135
3143
  this.actions.actions.forEach(action => {
3136
- if(action.canvasComponent){
3144
+ if (action.canvasComponent) {
3137
3145
  this.hasCanvas = true;
3138
3146
  }
3139
3147
  });
3140
3148
  }
3141
3149
  },
3142
3150
  methods: {
3151
+ cleanCanvasProps: function (actions) {
3152
+ let replaced = actions;
3153
+ replaced.class = null;
3154
+ return replaced
3155
+ },
3143
3156
  newRecordAdded: function (ev) {
3144
3157
  const record = ev.log;
3145
3158
  if (record.user) {
@@ -3147,15 +3160,15 @@ var script$7 = {
3147
3160
  }
3148
3161
  this.records.unshift(record);
3149
3162
  },
3150
- canvasClosed: function(){
3163
+ canvasClosed: function () {
3151
3164
  this.selectedRecord = null;
3152
3165
  },
3153
3166
  rowSelected: function (row) {
3154
3167
  this.selectedRecord = null;
3155
- setTimeout(()=>{
3168
+ setTimeout(() => {
3156
3169
  this.selectedRecord = row;
3157
3170
  this.$emit('rowSelected', row);
3158
- },100);
3171
+ }, 100);
3159
3172
  },
3160
3173
  changeKey: function (key, value) {
3161
3174
  this[key] = value;
@@ -3180,12 +3193,16 @@ var script$7 = {
3180
3193
  replaceActionUrl: function (path, obj) {
3181
3194
  if (path) {
3182
3195
  var matches = path.match(/\{(.*?)\}/g);
3183
- matches.forEach(key => {
3184
- key = key.replace('{', '');
3185
- key = key.replace('}', '');
3186
- path = path.replace(`{${key}}`, obj[key]);
3187
- });
3188
- return path
3196
+ try {
3197
+ matches.forEach(key => {
3198
+ key = key.replace('{', '');
3199
+ key = key.replace('}', '');
3200
+ path = path.replace(`{${key}}`, obj[key]);
3201
+ });
3202
+ return path
3203
+ } catch (e) {
3204
+ return path
3205
+ }
3189
3206
  }
3190
3207
  return ''
3191
3208
  },
@@ -3262,7 +3279,9 @@ var script$7 = {
3262
3279
  });
3263
3280
  },
3264
3281
  reloadData: function (page, append) {
3265
- if (typeof page !== 'undefined') { this.page = page; }
3282
+ if (typeof page !== 'undefined') {
3283
+ this.page = page;
3284
+ }
3266
3285
  if (!append) {
3267
3286
  this.loading = 'loading';
3268
3287
  }
@@ -3311,6 +3330,12 @@ var script$7 = {
3311
3330
  }
3312
3331
  },
3313
3332
  watch: {
3333
+ hideIds: {
3334
+ handler(newValue) {
3335
+ this.records = this.records.filter(record => !newValue.includes(record.id) && record);
3336
+ },
3337
+ deep: true
3338
+ },
3314
3339
  reload () {
3315
3340
  this.reloadData();
3316
3341
  }
@@ -3319,6 +3344,8 @@ var script$7 = {
3319
3344
  this.reloadData();
3320
3345
  },
3321
3346
  components: {
3347
+ ShSilentAction: ShSilentAction__default["default"],
3348
+ ShConfirmAction: ShConfirmAction__default["default"],
3322
3349
  ShCanvas: script$9,
3323
3350
  pagination: script$8
3324
3351
  },
@@ -3495,6 +3522,8 @@ const _hoisted_64 = ["title", "onClick"];
3495
3522
 
3496
3523
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3497
3524
  const _component_router_link = vue.resolveComponent("router-link");
3525
+ const _component_sh_confirm_action = vue.resolveComponent("sh-confirm-action");
3526
+ const _component_sh_silent_action = vue.resolveComponent("sh-silent-action");
3498
3527
  const _component_pagination = vue.resolveComponent("pagination");
3499
3528
  const _component_sh_canvas = vue.resolveComponent("sh-canvas");
3500
3529
 
@@ -3677,28 +3706,17 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3677
3706
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3678
3707
  (!act.validator || act.validator(record))
3679
3708
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3680
- (act.canvasId)
3681
- ? (vue.openBlock(), vue.createElementBlock("a", {
3709
+ (act.type === 'confirmAction')
3710
+ ? (vue.openBlock(), vue.createBlock(_component_sh_confirm_action, {
3682
3711
  key: 0,
3683
- href: '#' + act.canvasId,
3684
- "data-bs-toggle": "offcanvas",
3685
- class: vue.normalizeClass(act.class)
3686
- }, [
3687
- (act.icon)
3688
- ? (vue.openBlock(), vue.createElementBlock("span", {
3689
- key: 0,
3690
- class: vue.normalizeClass(act.icon)
3691
- }, null, 2 /* CLASS */))
3692
- : vue.createCommentVNode("v-if", true),
3693
- vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3694
- ], 10 /* CLASS, PROPS */, _hoisted_44))
3695
- : (act.emits)
3696
- ? (vue.openBlock(), vue.createElementBlock("button", {
3697
- key: 1,
3698
- title: act.title,
3699
- class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3700
- onClick: $event => ($options.doEmitAction(act.emits,record))
3701
- }, [
3712
+ onActionSuccessful: $event => ($options.doEmitAction('actionSuccessful',record)),
3713
+ onActionFailed: $event => ($options.doEmitAction('actionFailed',record)),
3714
+ onActionCanceled: $event => ($options.doEmitAction('actionCanceled',record)),
3715
+ "loading-message": act.label,
3716
+ class: vue.normalizeClass(act.class),
3717
+ url: $options.replaceActionUrl(act.url,record)
3718
+ }, {
3719
+ default: vue.withCtx(() => [
3702
3720
  (act.icon)
3703
3721
  ? (vue.openBlock(), vue.createElementBlock("span", {
3704
3722
  key: 0,
@@ -3706,15 +3724,52 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3706
3724
  }, null, 2 /* CLASS */))
3707
3725
  : vue.createCommentVNode("v-if", true),
3708
3726
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3709
- ], 10 /* CLASS, PROPS */, _hoisted_45))
3710
- : (!act.emits)
3711
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3727
+ ]),
3728
+ _: 2 /* DYNAMIC */
3729
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onActionSuccessful", "onActionFailed", "onActionCanceled", "loading-message", "class", "url"]))
3730
+ : (act.type === 'silentAction')
3731
+ ? (vue.openBlock(), vue.createBlock(_component_sh_silent_action, {
3732
+ key: 1,
3733
+ onActionSuccessful: $event => ($options.doEmitAction('actionSuccessful',record)),
3734
+ onActionFailed: $event => ($options.doEmitAction('actionFailed',record)),
3735
+ onActionCanceled: $event => ($options.doEmitAction('actionCanceled',record)),
3736
+ "loading-message": act.label,
3737
+ class: vue.normalizeClass(act.class),
3738
+ url: $options.replaceActionUrl(act.url,record)
3739
+ }, {
3740
+ default: vue.withCtx(() => [
3741
+ (act.icon)
3742
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3743
+ key: 0,
3744
+ class: vue.normalizeClass(act.icon)
3745
+ }, null, 2 /* CLASS */))
3746
+ : vue.createCommentVNode("v-if", true),
3747
+ vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3748
+ ]),
3749
+ _: 2 /* DYNAMIC */
3750
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onActionSuccessful", "onActionFailed", "onActionCanceled", "loading-message", "class", "url"]))
3751
+ : (act.canvasId)
3752
+ ? (vue.openBlock(), vue.createElementBlock("a", {
3712
3753
  key: 2,
3713
- title: act.title,
3714
- to: $options.replaceActionUrl(act.path,record),
3754
+ href: '#' + act.canvasId,
3755
+ "data-bs-toggle": "offcanvas",
3715
3756
  class: vue.normalizeClass(act.class)
3716
- }, {
3717
- default: vue.withCtx(() => [
3757
+ }, [
3758
+ (act.icon)
3759
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3760
+ key: 0,
3761
+ class: vue.normalizeClass(act.icon)
3762
+ }, null, 2 /* CLASS */))
3763
+ : vue.createCommentVNode("v-if", true),
3764
+ vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3765
+ ], 10 /* CLASS, PROPS */, _hoisted_44))
3766
+ : (act.emits)
3767
+ ? (vue.openBlock(), vue.createElementBlock("button", {
3768
+ key: 3,
3769
+ title: act.title,
3770
+ class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3771
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3772
+ }, [
3718
3773
  (act.icon)
3719
3774
  ? (vue.openBlock(), vue.createElementBlock("span", {
3720
3775
  key: 0,
@@ -3722,10 +3777,26 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3722
3777
  }, null, 2 /* CLASS */))
3723
3778
  : vue.createCommentVNode("v-if", true),
3724
3779
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3725
- ]),
3726
- _: 2 /* DYNAMIC */
3727
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3728
- : vue.createCommentVNode("v-if", true)
3780
+ ], 10 /* CLASS, PROPS */, _hoisted_45))
3781
+ : (!act.emits)
3782
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3783
+ key: 4,
3784
+ title: act.title,
3785
+ to: $options.replaceActionUrl(act.path,record),
3786
+ class: vue.normalizeClass(act.class)
3787
+ }, {
3788
+ default: vue.withCtx(() => [
3789
+ (act.icon)
3790
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3791
+ key: 0,
3792
+ class: vue.normalizeClass(act.icon)
3793
+ }, null, 2 /* CLASS */))
3794
+ : vue.createCommentVNode("v-if", true),
3795
+ vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3796
+ ]),
3797
+ _: 2 /* DYNAMIC */
3798
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3799
+ : vue.createCommentVNode("v-if", true)
3729
3800
  ], 64 /* STABLE_FRAGMENT */))
3730
3801
  : vue.createCommentVNode("v-if", true)
3731
3802
  ], 64 /* STABLE_FRAGMENT */))
@@ -3749,69 +3820,81 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3749
3820
  : ($data.loading === 'done')
3750
3821
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_51, [
3751
3822
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.records, (record, index) => {
3752
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3753
- key: record.id
3823
+ return (vue.openBlock(), vue.createElementBlock("div", {
3824
+ key: record.id,
3825
+ class: "single-mobile-req bg-light p-3",
3826
+ onClick: $event => ($options.rowSelected(record))
3754
3827
  }, [
3755
- vue.createElementVNode("h3", null, vue.toDisplayString(_ctx.mobile_view), 1 /* TEXT */),
3756
- vue.createElementVNode("div", {
3757
- class: "single-mobile-req bg-light p-3",
3758
- onClick: $event => ($options.rowSelected(record))
3759
- }, [
3760
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3761
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3762
- key: key[0]
3763
- }, [
3764
- (typeof key === 'string' )
3765
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_53, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3766
- : (typeof key === 'function')
3767
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_54, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3768
- : (vue.openBlock(), vue.createElementBlock("p", _hoisted_55, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3769
- vue.createElementVNode("span", null, [
3770
- (typeof key === 'string' && $props.links && $props.links[key])
3771
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3772
- key: 0,
3773
- to: $options.replaceLinkUrl($props.links[key],record),
3774
- class: vue.normalizeClass($options.getLinkClass($props.links[key])),
3775
- innerHTML: record[key]
3776
- }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3777
- : ($options.getFieldType(key) === 'numeric')
3778
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_56, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3779
- : ($options.getFieldType(key) === 'money')
3780
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_57, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3781
- : (typeof key === 'string')
3828
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3829
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3830
+ key: key[0]
3831
+ }, [
3832
+ (typeof key === 'string' )
3833
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_53, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3834
+ : (typeof key === 'function')
3835
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_54, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3836
+ : (vue.openBlock(), vue.createElementBlock("p", _hoisted_55, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3837
+ vue.createElementVNode("span", null, [
3838
+ (typeof key === 'string' && $props.links && $props.links[key])
3839
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3840
+ key: 0,
3841
+ to: $options.replaceLinkUrl($props.links[key],record),
3842
+ class: vue.normalizeClass($options.getLinkClass($props.links[key])),
3843
+ innerHTML: record[key]
3844
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3845
+ : ($options.getFieldType(key) === 'numeric')
3846
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_56, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3847
+ : ($options.getFieldType(key) === 'money')
3848
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_57, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3849
+ : (typeof key === 'string')
3850
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3851
+ key: 3,
3852
+ innerHTML: record[key]
3853
+ }, null, 8 /* PROPS */, _hoisted_58))
3854
+ : (typeof key === 'function')
3782
3855
  ? (vue.openBlock(), vue.createElementBlock("span", {
3783
- key: 3,
3784
- innerHTML: record[key]
3785
- }, null, 8 /* PROPS */, _hoisted_58))
3786
- : (typeof key === 'function')
3787
- ? (vue.openBlock(), vue.createElementBlock("span", {
3788
- key: 4,
3789
- innerHTML: key(record, index )
3790
- }, null, 8 /* PROPS */, _hoisted_59))
3791
- : (vue.openBlock(), vue.createElementBlock("span", {
3792
- key: 5,
3793
- innerHTML: record[key[0]]
3794
- }, null, 8 /* PROPS */, _hoisted_60))
3795
- ]),
3796
- _hoisted_61
3797
- ], 64 /* STABLE_FRAGMENT */))
3798
- }), 128 /* KEYED_FRAGMENT */)),
3799
- ($props.actions)
3800
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_62, [
3801
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3802
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3803
- key: act.path
3804
- }, [
3805
- (!act.permission || $options.user.isAllowedTo(act.permission))
3806
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3807
- (!act.validator || act.validator(record))
3808
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3809
- (act.canvasId)
3810
- ? (vue.openBlock(), vue.createElementBlock("a", {
3811
- key: 0,
3812
- href: '#' + act.canvasId,
3813
- "data-bs-toggle": "offcanvas",
3814
- class: vue.normalizeClass(act.class)
3856
+ key: 4,
3857
+ innerHTML: key(record, index )
3858
+ }, null, 8 /* PROPS */, _hoisted_59))
3859
+ : (vue.openBlock(), vue.createElementBlock("span", {
3860
+ key: 5,
3861
+ innerHTML: record[key[0]]
3862
+ }, null, 8 /* PROPS */, _hoisted_60))
3863
+ ]),
3864
+ _hoisted_61
3865
+ ], 64 /* STABLE_FRAGMENT */))
3866
+ }), 128 /* KEYED_FRAGMENT */)),
3867
+ ($props.actions)
3868
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_62, [
3869
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3870
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3871
+ key: act.path
3872
+ }, [
3873
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3874
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3875
+ (!act.validator || act.validator(record))
3876
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3877
+ (act.canvasId)
3878
+ ? (vue.openBlock(), vue.createElementBlock("a", {
3879
+ key: 0,
3880
+ href: '#' + act.canvasId,
3881
+ "data-bs-toggle": "offcanvas",
3882
+ class: vue.normalizeClass(act.class)
3883
+ }, [
3884
+ (act.icon)
3885
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3886
+ key: 0,
3887
+ class: vue.normalizeClass(act.icon)
3888
+ }, null, 2 /* CLASS */))
3889
+ : vue.createCommentVNode("v-if", true),
3890
+ vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3891
+ ], 10 /* CLASS, PROPS */, _hoisted_63))
3892
+ : (act.emits)
3893
+ ? (vue.openBlock(), vue.createElementBlock("button", {
3894
+ key: 1,
3895
+ title: act.title,
3896
+ class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3897
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3815
3898
  }, [
3816
3899
  (act.icon)
3817
3900
  ? (vue.openBlock(), vue.createElementBlock("span", {
@@ -3820,51 +3903,35 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3820
3903
  }, null, 2 /* CLASS */))
3821
3904
  : vue.createCommentVNode("v-if", true),
3822
3905
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3823
- ], 10 /* CLASS, PROPS */, _hoisted_63))
3824
- : (act.emits)
3825
- ? (vue.openBlock(), vue.createElementBlock("button", {
3826
- key: 1,
3906
+ ], 10 /* CLASS, PROPS */, _hoisted_64))
3907
+ : (!act.emits)
3908
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3909
+ key: 2,
3827
3910
  title: act.title,
3828
- class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3829
- onClick: $event => ($options.doEmitAction(act.emits,record))
3830
- }, [
3831
- (act.icon)
3832
- ? (vue.openBlock(), vue.createElementBlock("span", {
3833
- key: 0,
3834
- class: vue.normalizeClass(act.icon)
3835
- }, null, 2 /* CLASS */))
3836
- : vue.createCommentVNode("v-if", true),
3837
- vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3838
- ], 10 /* CLASS, PROPS */, _hoisted_64))
3839
- : (!act.emits)
3840
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3841
- key: 2,
3842
- title: act.title,
3843
- to: $options.replaceActionUrl(act.path,record),
3844
- class: vue.normalizeClass(act.class)
3845
- }, {
3846
- default: vue.withCtx(() => [
3847
- (act.icon)
3848
- ? (vue.openBlock(), vue.createElementBlock("span", {
3849
- key: 0,
3850
- class: vue.normalizeClass(act.icon)
3851
- }, null, 2 /* CLASS */))
3852
- : vue.createCommentVNode("v-if", true),
3853
- vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3854
- ]),
3855
- _: 2 /* DYNAMIC */
3856
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3857
- : vue.createCommentVNode("v-if", true)
3858
- ], 64 /* STABLE_FRAGMENT */))
3859
- : vue.createCommentVNode("v-if", true)
3860
- ], 64 /* STABLE_FRAGMENT */))
3861
- : vue.createCommentVNode("v-if", true)
3862
- ], 64 /* STABLE_FRAGMENT */))
3863
- }), 128 /* KEYED_FRAGMENT */))
3864
- ]))
3865
- : vue.createCommentVNode("v-if", true)
3866
- ], 8 /* PROPS */, _hoisted_52)
3867
- ], 64 /* STABLE_FRAGMENT */))
3911
+ to: $options.replaceActionUrl(act.path,record),
3912
+ class: vue.normalizeClass(act.class)
3913
+ }, {
3914
+ default: vue.withCtx(() => [
3915
+ (act.icon)
3916
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3917
+ key: 0,
3918
+ class: vue.normalizeClass(act.icon)
3919
+ }, null, 2 /* CLASS */))
3920
+ : vue.createCommentVNode("v-if", true),
3921
+ vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
3922
+ ]),
3923
+ _: 2 /* DYNAMIC */
3924
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3925
+ : vue.createCommentVNode("v-if", true)
3926
+ ], 64 /* STABLE_FRAGMENT */))
3927
+ : vue.createCommentVNode("v-if", true)
3928
+ ], 64 /* STABLE_FRAGMENT */))
3929
+ : vue.createCommentVNode("v-if", true)
3930
+ ], 64 /* STABLE_FRAGMENT */))
3931
+ }), 128 /* KEYED_FRAGMENT */))
3932
+ ]))
3933
+ : vue.createCommentVNode("v-if", true)
3934
+ ], 8 /* PROPS */, _hoisted_52))
3868
3935
  }), 128 /* KEYED_FRAGMENT */))
3869
3936
  ]))
3870
3937
  : vue.createCommentVNode("v-if", true)
@@ -3896,7 +3963,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3896
3963
  }, {
3897
3964
  default: vue.withCtx(() => [
3898
3965
  ($data.selectedRecord)
3899
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(action.canvasComponent), vue.mergeProps({ key: 0 }, action, { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["record"]))
3966
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(action.canvasComponent), vue.mergeProps({ key: 0 }, $options.cleanCanvasProps(action), { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["record"]))
3900
3967
  : vue.createCommentVNode("v-if", true)
3901
3968
  ]),
3902
3969
  _: 2 /* DYNAMIC */
package/dist/library.mjs CHANGED
@@ -4,6 +4,8 @@ import { inject, openBlock, createElementBlock, createElementVNode, createTextVN
4
4
  import NProgress from 'nprogress';
5
5
  import Editor from '@tinymce/tinymce-vue';
6
6
  import Swal from 'sweetalert2';
7
+ import ShConfirmAction from '@/lib/components/ShConfirmAction.vue';
8
+ import ShSilentAction from '@/lib/components/ShSilentAction.vue';
7
9
  import { defineStore, storeToRefs } from 'pinia';
8
10
  import { useRoute, useRouter } from 'vue-router';
9
11
 
@@ -56,8 +58,12 @@ const checkSession = function (isCheking) {
56
58
  let apiUrl = import.meta.env.VITE_APP_API_URL;
57
59
  // eslint-disable-next-line no-undef
58
60
  if (process.env.NODE_ENV === 'production') {
59
- apiUrl = import.meta.env.VITE_APP_API_PRODUCTION_URL;
61
+ const productionUrl = import.meta.env.VITE_APP_API_PRODUCTION_URL;
62
+ if(productionUrl){
63
+ apiUrl = productionUrl;
64
+ }
60
65
  }
66
+
61
67
  const axios = Axios.create({
62
68
  baseURL: apiUrl
63
69
  });
@@ -3095,7 +3101,7 @@ var shRepo = {
3095
3101
 
3096
3102
  var script$7 = {
3097
3103
  name: 'sh-table',
3098
- props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover'],
3104
+ props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds'],
3099
3105
  inject: ['channel'],
3100
3106
  data () {
3101
3107
  return {
@@ -3119,15 +3125,20 @@ var script$7 = {
3119
3125
  },
3120
3126
  mounted () {
3121
3127
  if (this.event) ;
3122
- if(this.actions && this.actions.actions){
3128
+ if (this.actions && this.actions.actions) {
3123
3129
  this.actions.actions.forEach(action => {
3124
- if(action.canvasComponent){
3130
+ if (action.canvasComponent) {
3125
3131
  this.hasCanvas = true;
3126
3132
  }
3127
3133
  });
3128
3134
  }
3129
3135
  },
3130
3136
  methods: {
3137
+ cleanCanvasProps: function (actions) {
3138
+ let replaced = actions;
3139
+ replaced.class = null;
3140
+ return replaced
3141
+ },
3131
3142
  newRecordAdded: function (ev) {
3132
3143
  const record = ev.log;
3133
3144
  if (record.user) {
@@ -3135,15 +3146,15 @@ var script$7 = {
3135
3146
  }
3136
3147
  this.records.unshift(record);
3137
3148
  },
3138
- canvasClosed: function(){
3149
+ canvasClosed: function () {
3139
3150
  this.selectedRecord = null;
3140
3151
  },
3141
3152
  rowSelected: function (row) {
3142
3153
  this.selectedRecord = null;
3143
- setTimeout(()=>{
3154
+ setTimeout(() => {
3144
3155
  this.selectedRecord = row;
3145
3156
  this.$emit('rowSelected', row);
3146
- },100);
3157
+ }, 100);
3147
3158
  },
3148
3159
  changeKey: function (key, value) {
3149
3160
  this[key] = value;
@@ -3168,12 +3179,16 @@ var script$7 = {
3168
3179
  replaceActionUrl: function (path, obj) {
3169
3180
  if (path) {
3170
3181
  var matches = path.match(/\{(.*?)\}/g);
3171
- matches.forEach(key => {
3172
- key = key.replace('{', '');
3173
- key = key.replace('}', '');
3174
- path = path.replace(`{${key}}`, obj[key]);
3175
- });
3176
- return path
3182
+ try {
3183
+ matches.forEach(key => {
3184
+ key = key.replace('{', '');
3185
+ key = key.replace('}', '');
3186
+ path = path.replace(`{${key}}`, obj[key]);
3187
+ });
3188
+ return path
3189
+ } catch (e) {
3190
+ return path
3191
+ }
3177
3192
  }
3178
3193
  return ''
3179
3194
  },
@@ -3250,7 +3265,9 @@ var script$7 = {
3250
3265
  });
3251
3266
  },
3252
3267
  reloadData: function (page, append) {
3253
- if (typeof page !== 'undefined') { this.page = page; }
3268
+ if (typeof page !== 'undefined') {
3269
+ this.page = page;
3270
+ }
3254
3271
  if (!append) {
3255
3272
  this.loading = 'loading';
3256
3273
  }
@@ -3299,6 +3316,12 @@ var script$7 = {
3299
3316
  }
3300
3317
  },
3301
3318
  watch: {
3319
+ hideIds: {
3320
+ handler(newValue) {
3321
+ this.records = this.records.filter(record => !newValue.includes(record.id) && record);
3322
+ },
3323
+ deep: true
3324
+ },
3302
3325
  reload () {
3303
3326
  this.reloadData();
3304
3327
  }
@@ -3307,6 +3330,8 @@ var script$7 = {
3307
3330
  this.reloadData();
3308
3331
  },
3309
3332
  components: {
3333
+ ShSilentAction,
3334
+ ShConfirmAction,
3310
3335
  ShCanvas: script$9,
3311
3336
  pagination: script$8
3312
3337
  },
@@ -3483,6 +3508,8 @@ const _hoisted_64 = ["title", "onClick"];
3483
3508
 
3484
3509
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3485
3510
  const _component_router_link = resolveComponent("router-link");
3511
+ const _component_sh_confirm_action = resolveComponent("sh-confirm-action");
3512
+ const _component_sh_silent_action = resolveComponent("sh-silent-action");
3486
3513
  const _component_pagination = resolveComponent("pagination");
3487
3514
  const _component_sh_canvas = resolveComponent("sh-canvas");
3488
3515
 
@@ -3665,28 +3692,17 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3665
3692
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3666
3693
  (!act.validator || act.validator(record))
3667
3694
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3668
- (act.canvasId)
3669
- ? (openBlock(), createElementBlock("a", {
3695
+ (act.type === 'confirmAction')
3696
+ ? (openBlock(), createBlock(_component_sh_confirm_action, {
3670
3697
  key: 0,
3671
- href: '#' + act.canvasId,
3672
- "data-bs-toggle": "offcanvas",
3673
- class: normalizeClass(act.class)
3674
- }, [
3675
- (act.icon)
3676
- ? (openBlock(), createElementBlock("span", {
3677
- key: 0,
3678
- class: normalizeClass(act.icon)
3679
- }, null, 2 /* CLASS */))
3680
- : createCommentVNode("v-if", true),
3681
- createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3682
- ], 10 /* CLASS, PROPS */, _hoisted_44))
3683
- : (act.emits)
3684
- ? (openBlock(), createElementBlock("button", {
3685
- key: 1,
3686
- title: act.title,
3687
- class: normalizeClass(act.class ? act.class:'btn btn-default'),
3688
- onClick: $event => ($options.doEmitAction(act.emits,record))
3689
- }, [
3698
+ onActionSuccessful: $event => ($options.doEmitAction('actionSuccessful',record)),
3699
+ onActionFailed: $event => ($options.doEmitAction('actionFailed',record)),
3700
+ onActionCanceled: $event => ($options.doEmitAction('actionCanceled',record)),
3701
+ "loading-message": act.label,
3702
+ class: normalizeClass(act.class),
3703
+ url: $options.replaceActionUrl(act.url,record)
3704
+ }, {
3705
+ default: withCtx(() => [
3690
3706
  (act.icon)
3691
3707
  ? (openBlock(), createElementBlock("span", {
3692
3708
  key: 0,
@@ -3694,15 +3710,52 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3694
3710
  }, null, 2 /* CLASS */))
3695
3711
  : createCommentVNode("v-if", true),
3696
3712
  createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3697
- ], 10 /* CLASS, PROPS */, _hoisted_45))
3698
- : (!act.emits)
3699
- ? (openBlock(), createBlock(_component_router_link, {
3713
+ ]),
3714
+ _: 2 /* DYNAMIC */
3715
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onActionSuccessful", "onActionFailed", "onActionCanceled", "loading-message", "class", "url"]))
3716
+ : (act.type === 'silentAction')
3717
+ ? (openBlock(), createBlock(_component_sh_silent_action, {
3718
+ key: 1,
3719
+ onActionSuccessful: $event => ($options.doEmitAction('actionSuccessful',record)),
3720
+ onActionFailed: $event => ($options.doEmitAction('actionFailed',record)),
3721
+ onActionCanceled: $event => ($options.doEmitAction('actionCanceled',record)),
3722
+ "loading-message": act.label,
3723
+ class: normalizeClass(act.class),
3724
+ url: $options.replaceActionUrl(act.url,record)
3725
+ }, {
3726
+ default: withCtx(() => [
3727
+ (act.icon)
3728
+ ? (openBlock(), createElementBlock("span", {
3729
+ key: 0,
3730
+ class: normalizeClass(act.icon)
3731
+ }, null, 2 /* CLASS */))
3732
+ : createCommentVNode("v-if", true),
3733
+ createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3734
+ ]),
3735
+ _: 2 /* DYNAMIC */
3736
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onActionSuccessful", "onActionFailed", "onActionCanceled", "loading-message", "class", "url"]))
3737
+ : (act.canvasId)
3738
+ ? (openBlock(), createElementBlock("a", {
3700
3739
  key: 2,
3701
- title: act.title,
3702
- to: $options.replaceActionUrl(act.path,record),
3740
+ href: '#' + act.canvasId,
3741
+ "data-bs-toggle": "offcanvas",
3703
3742
  class: normalizeClass(act.class)
3704
- }, {
3705
- default: withCtx(() => [
3743
+ }, [
3744
+ (act.icon)
3745
+ ? (openBlock(), createElementBlock("span", {
3746
+ key: 0,
3747
+ class: normalizeClass(act.icon)
3748
+ }, null, 2 /* CLASS */))
3749
+ : createCommentVNode("v-if", true),
3750
+ createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3751
+ ], 10 /* CLASS, PROPS */, _hoisted_44))
3752
+ : (act.emits)
3753
+ ? (openBlock(), createElementBlock("button", {
3754
+ key: 3,
3755
+ title: act.title,
3756
+ class: normalizeClass(act.class ? act.class:'btn btn-default'),
3757
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3758
+ }, [
3706
3759
  (act.icon)
3707
3760
  ? (openBlock(), createElementBlock("span", {
3708
3761
  key: 0,
@@ -3710,10 +3763,26 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3710
3763
  }, null, 2 /* CLASS */))
3711
3764
  : createCommentVNode("v-if", true),
3712
3765
  createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3713
- ]),
3714
- _: 2 /* DYNAMIC */
3715
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3716
- : createCommentVNode("v-if", true)
3766
+ ], 10 /* CLASS, PROPS */, _hoisted_45))
3767
+ : (!act.emits)
3768
+ ? (openBlock(), createBlock(_component_router_link, {
3769
+ key: 4,
3770
+ title: act.title,
3771
+ to: $options.replaceActionUrl(act.path,record),
3772
+ class: normalizeClass(act.class)
3773
+ }, {
3774
+ default: withCtx(() => [
3775
+ (act.icon)
3776
+ ? (openBlock(), createElementBlock("span", {
3777
+ key: 0,
3778
+ class: normalizeClass(act.icon)
3779
+ }, null, 2 /* CLASS */))
3780
+ : createCommentVNode("v-if", true),
3781
+ createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3782
+ ]),
3783
+ _: 2 /* DYNAMIC */
3784
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3785
+ : createCommentVNode("v-if", true)
3717
3786
  ], 64 /* STABLE_FRAGMENT */))
3718
3787
  : createCommentVNode("v-if", true)
3719
3788
  ], 64 /* STABLE_FRAGMENT */))
@@ -3737,69 +3806,81 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3737
3806
  : ($data.loading === 'done')
3738
3807
  ? (openBlock(), createElementBlock("div", _hoisted_51, [
3739
3808
  (openBlock(true), createElementBlock(Fragment, null, renderList($data.records, (record, index) => {
3740
- return (openBlock(), createElementBlock(Fragment, {
3741
- key: record.id
3809
+ return (openBlock(), createElementBlock("div", {
3810
+ key: record.id,
3811
+ class: "single-mobile-req bg-light p-3",
3812
+ onClick: $event => ($options.rowSelected(record))
3742
3813
  }, [
3743
- createElementVNode("h3", null, toDisplayString(_ctx.mobile_view), 1 /* TEXT */),
3744
- createElementVNode("div", {
3745
- class: "single-mobile-req bg-light p-3",
3746
- onClick: $event => ($options.rowSelected(record))
3747
- }, [
3748
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (key) => {
3749
- return (openBlock(), createElementBlock(Fragment, {
3750
- key: key[0]
3751
- }, [
3752
- (typeof key === 'string' )
3753
- ? (openBlock(), createElementBlock("p", _hoisted_53, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3754
- : (typeof key === 'function')
3755
- ? (openBlock(), createElementBlock("p", _hoisted_54, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3756
- : (openBlock(), createElementBlock("p", _hoisted_55, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3757
- createElementVNode("span", null, [
3758
- (typeof key === 'string' && $props.links && $props.links[key])
3759
- ? (openBlock(), createBlock(_component_router_link, {
3760
- key: 0,
3761
- to: $options.replaceLinkUrl($props.links[key],record),
3762
- class: normalizeClass($options.getLinkClass($props.links[key])),
3763
- innerHTML: record[key]
3764
- }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3765
- : ($options.getFieldType(key) === 'numeric')
3766
- ? (openBlock(), createElementBlock("span", _hoisted_56, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3767
- : ($options.getFieldType(key) === 'money')
3768
- ? (openBlock(), createElementBlock("span", _hoisted_57, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3769
- : (typeof key === 'string')
3814
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (key) => {
3815
+ return (openBlock(), createElementBlock(Fragment, {
3816
+ key: key[0]
3817
+ }, [
3818
+ (typeof key === 'string' )
3819
+ ? (openBlock(), createElementBlock("p", _hoisted_53, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3820
+ : (typeof key === 'function')
3821
+ ? (openBlock(), createElementBlock("p", _hoisted_54, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3822
+ : (openBlock(), createElementBlock("p", _hoisted_55, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3823
+ createElementVNode("span", null, [
3824
+ (typeof key === 'string' && $props.links && $props.links[key])
3825
+ ? (openBlock(), createBlock(_component_router_link, {
3826
+ key: 0,
3827
+ to: $options.replaceLinkUrl($props.links[key],record),
3828
+ class: normalizeClass($options.getLinkClass($props.links[key])),
3829
+ innerHTML: record[key]
3830
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3831
+ : ($options.getFieldType(key) === 'numeric')
3832
+ ? (openBlock(), createElementBlock("span", _hoisted_56, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3833
+ : ($options.getFieldType(key) === 'money')
3834
+ ? (openBlock(), createElementBlock("span", _hoisted_57, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3835
+ : (typeof key === 'string')
3836
+ ? (openBlock(), createElementBlock("span", {
3837
+ key: 3,
3838
+ innerHTML: record[key]
3839
+ }, null, 8 /* PROPS */, _hoisted_58))
3840
+ : (typeof key === 'function')
3770
3841
  ? (openBlock(), createElementBlock("span", {
3771
- key: 3,
3772
- innerHTML: record[key]
3773
- }, null, 8 /* PROPS */, _hoisted_58))
3774
- : (typeof key === 'function')
3775
- ? (openBlock(), createElementBlock("span", {
3776
- key: 4,
3777
- innerHTML: key(record, index )
3778
- }, null, 8 /* PROPS */, _hoisted_59))
3779
- : (openBlock(), createElementBlock("span", {
3780
- key: 5,
3781
- innerHTML: record[key[0]]
3782
- }, null, 8 /* PROPS */, _hoisted_60))
3783
- ]),
3784
- _hoisted_61
3785
- ], 64 /* STABLE_FRAGMENT */))
3786
- }), 128 /* KEYED_FRAGMENT */)),
3787
- ($props.actions)
3788
- ? (openBlock(), createElementBlock("div", _hoisted_62, [
3789
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.actions.actions, (act) => {
3790
- return (openBlock(), createElementBlock(Fragment, {
3791
- key: act.path
3792
- }, [
3793
- (!act.permission || $options.user.isAllowedTo(act.permission))
3794
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3795
- (!act.validator || act.validator(record))
3796
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3797
- (act.canvasId)
3798
- ? (openBlock(), createElementBlock("a", {
3799
- key: 0,
3800
- href: '#' + act.canvasId,
3801
- "data-bs-toggle": "offcanvas",
3802
- class: normalizeClass(act.class)
3842
+ key: 4,
3843
+ innerHTML: key(record, index )
3844
+ }, null, 8 /* PROPS */, _hoisted_59))
3845
+ : (openBlock(), createElementBlock("span", {
3846
+ key: 5,
3847
+ innerHTML: record[key[0]]
3848
+ }, null, 8 /* PROPS */, _hoisted_60))
3849
+ ]),
3850
+ _hoisted_61
3851
+ ], 64 /* STABLE_FRAGMENT */))
3852
+ }), 128 /* KEYED_FRAGMENT */)),
3853
+ ($props.actions)
3854
+ ? (openBlock(), createElementBlock("div", _hoisted_62, [
3855
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.actions.actions, (act) => {
3856
+ return (openBlock(), createElementBlock(Fragment, {
3857
+ key: act.path
3858
+ }, [
3859
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3860
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3861
+ (!act.validator || act.validator(record))
3862
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3863
+ (act.canvasId)
3864
+ ? (openBlock(), createElementBlock("a", {
3865
+ key: 0,
3866
+ href: '#' + act.canvasId,
3867
+ "data-bs-toggle": "offcanvas",
3868
+ class: normalizeClass(act.class)
3869
+ }, [
3870
+ (act.icon)
3871
+ ? (openBlock(), createElementBlock("span", {
3872
+ key: 0,
3873
+ class: normalizeClass(act.icon)
3874
+ }, null, 2 /* CLASS */))
3875
+ : createCommentVNode("v-if", true),
3876
+ createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3877
+ ], 10 /* CLASS, PROPS */, _hoisted_63))
3878
+ : (act.emits)
3879
+ ? (openBlock(), createElementBlock("button", {
3880
+ key: 1,
3881
+ title: act.title,
3882
+ class: normalizeClass(act.class ? act.class:'btn btn-default'),
3883
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3803
3884
  }, [
3804
3885
  (act.icon)
3805
3886
  ? (openBlock(), createElementBlock("span", {
@@ -3808,51 +3889,35 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3808
3889
  }, null, 2 /* CLASS */))
3809
3890
  : createCommentVNode("v-if", true),
3810
3891
  createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3811
- ], 10 /* CLASS, PROPS */, _hoisted_63))
3812
- : (act.emits)
3813
- ? (openBlock(), createElementBlock("button", {
3814
- key: 1,
3892
+ ], 10 /* CLASS, PROPS */, _hoisted_64))
3893
+ : (!act.emits)
3894
+ ? (openBlock(), createBlock(_component_router_link, {
3895
+ key: 2,
3815
3896
  title: act.title,
3816
- class: normalizeClass(act.class ? act.class:'btn btn-default'),
3817
- onClick: $event => ($options.doEmitAction(act.emits,record))
3818
- }, [
3819
- (act.icon)
3820
- ? (openBlock(), createElementBlock("span", {
3821
- key: 0,
3822
- class: normalizeClass(act.icon)
3823
- }, null, 2 /* CLASS */))
3824
- : createCommentVNode("v-if", true),
3825
- createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3826
- ], 10 /* CLASS, PROPS */, _hoisted_64))
3827
- : (!act.emits)
3828
- ? (openBlock(), createBlock(_component_router_link, {
3829
- key: 2,
3830
- title: act.title,
3831
- to: $options.replaceActionUrl(act.path,record),
3832
- class: normalizeClass(act.class)
3833
- }, {
3834
- default: withCtx(() => [
3835
- (act.icon)
3836
- ? (openBlock(), createElementBlock("span", {
3837
- key: 0,
3838
- class: normalizeClass(act.icon)
3839
- }, null, 2 /* CLASS */))
3840
- : createCommentVNode("v-if", true),
3841
- createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3842
- ]),
3843
- _: 2 /* DYNAMIC */
3844
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3845
- : createCommentVNode("v-if", true)
3846
- ], 64 /* STABLE_FRAGMENT */))
3847
- : createCommentVNode("v-if", true)
3848
- ], 64 /* STABLE_FRAGMENT */))
3849
- : createCommentVNode("v-if", true)
3850
- ], 64 /* STABLE_FRAGMENT */))
3851
- }), 128 /* KEYED_FRAGMENT */))
3852
- ]))
3853
- : createCommentVNode("v-if", true)
3854
- ], 8 /* PROPS */, _hoisted_52)
3855
- ], 64 /* STABLE_FRAGMENT */))
3897
+ to: $options.replaceActionUrl(act.path,record),
3898
+ class: normalizeClass(act.class)
3899
+ }, {
3900
+ default: withCtx(() => [
3901
+ (act.icon)
3902
+ ? (openBlock(), createElementBlock("span", {
3903
+ key: 0,
3904
+ class: normalizeClass(act.icon)
3905
+ }, null, 2 /* CLASS */))
3906
+ : createCommentVNode("v-if", true),
3907
+ createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
3908
+ ]),
3909
+ _: 2 /* DYNAMIC */
3910
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3911
+ : createCommentVNode("v-if", true)
3912
+ ], 64 /* STABLE_FRAGMENT */))
3913
+ : createCommentVNode("v-if", true)
3914
+ ], 64 /* STABLE_FRAGMENT */))
3915
+ : createCommentVNode("v-if", true)
3916
+ ], 64 /* STABLE_FRAGMENT */))
3917
+ }), 128 /* KEYED_FRAGMENT */))
3918
+ ]))
3919
+ : createCommentVNode("v-if", true)
3920
+ ], 8 /* PROPS */, _hoisted_52))
3856
3921
  }), 128 /* KEYED_FRAGMENT */))
3857
3922
  ]))
3858
3923
  : createCommentVNode("v-if", true)
@@ -3884,7 +3949,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3884
3949
  }, {
3885
3950
  default: withCtx(() => [
3886
3951
  ($data.selectedRecord)
3887
- ? (openBlock(), createBlock(resolveDynamicComponent(action.canvasComponent), mergeProps({ key: 0 }, action, { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["record"]))
3952
+ ? (openBlock(), createBlock(resolveDynamicComponent(action.canvasComponent), mergeProps({ key: 0 }, $options.cleanCanvasProps(action), { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["record"]))
3888
3953
  : createCommentVNode("v-if", true)
3889
3954
  ]),
3890
3955
  _: 2 /* DYNAMIC */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",