@iankibetsh/shframework 4.1.1 → 4.1.4

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
@@ -1910,7 +1910,7 @@ const countries = [
1910
1910
  }
1911
1911
  ];
1912
1912
 
1913
- var script$u = {
1913
+ var script$v = {
1914
1914
  name: 'PhoneInput',
1915
1915
  props: ['modelValue', 'country_code'],
1916
1916
  data () {
@@ -1980,7 +1980,7 @@ var script$u = {
1980
1980
  }
1981
1981
  };
1982
1982
 
1983
- const _hoisted_1$n = { class: "sh-phone mb-3" };
1983
+ const _hoisted_1$o = { class: "sh-phone mb-3" };
1984
1984
  const _hoisted_2$e = {
1985
1985
  key: 0,
1986
1986
  style: {"display":"contents"}
@@ -1989,7 +1989,7 @@ const _hoisted_3$d = ["src"];
1989
1989
  const _hoisted_4$d = ["value"];
1990
1990
 
1991
1991
  function render$3(_ctx, _cache, $props, $setup, $data, $options) {
1992
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
1992
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
1993
1993
  ($data.selectedCountry)
1994
1994
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$e, [
1995
1995
  vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$d),
@@ -2023,10 +2023,10 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2023
2023
  ]))
2024
2024
  }
2025
2025
 
2026
- script$u.render = render$3;
2027
- script$u.__file = "src/lib/components/form-components/PhoneInput.vue";
2026
+ script$v.render = render$3;
2027
+ script$v.__file = "src/lib/components/form-components/PhoneInput.vue";
2028
2028
 
2029
- const _hoisted_1$m = {
2029
+ const _hoisted_1$n = {
2030
2030
  key: 0,
2031
2031
  class: "dropdown sh-suggest"
2032
2032
  };
@@ -2047,7 +2047,7 @@ const _hoisted_10$6 = {
2047
2047
  };
2048
2048
 
2049
2049
 
2050
- var script$t = {
2050
+ var script$u = {
2051
2051
  __name: 'ShSuggest',
2052
2052
  props: ['data','allowMultiple','url','modelValue'],
2053
2053
  emits: ['update:modelValue'],
@@ -2131,7 +2131,7 @@ function filterData(e){
2131
2131
 
2132
2132
  return (_ctx, _cache) => {
2133
2133
  return (vue.unref(id))
2134
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
2134
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
2135
2135
  vue.createElementVNode("div", {
2136
2136
  id: vue.unref(id),
2137
2137
  "data-bs-toggle": "dropdown",
@@ -2192,15 +2192,15 @@ return (_ctx, _cache) => {
2192
2192
 
2193
2193
  };
2194
2194
 
2195
- script$t.__scopeId = "data-v-71cc9569";
2196
- script$t.__file = "src/lib/components/form-components/ShSuggest.vue";
2195
+ script$u.__scopeId = "data-v-71cc9569";
2196
+ script$u.__file = "src/lib/components/form-components/ShSuggest.vue";
2197
2197
 
2198
- var script$s = {
2198
+ var script$t = {
2199
2199
  name: 'ShForm',
2200
2200
  components: {
2201
- PhoneInput: script$u,
2202
- ShSuggest: script$t,
2203
- ShPhone: script$u
2201
+ PhoneInput: script$v,
2202
+ ShSuggest: script$u,
2203
+ ShPhone: script$v
2204
2204
  },
2205
2205
  props: [
2206
2206
  'action',
@@ -2524,7 +2524,7 @@ var script$s = {
2524
2524
  }
2525
2525
  };
2526
2526
 
2527
- const _hoisted_1$l = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2527
+ const _hoisted_1$m = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2528
2528
  const _hoisted_2$c = {
2529
2529
  ref: "ShAutoForm",
2530
2530
  class: "sh-form"
@@ -2585,7 +2585,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2585
2585
  const _component_ShSuggest = vue.resolveComponent("ShSuggest");
2586
2586
 
2587
2587
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2588
- _hoisted_1$l,
2588
+ _hoisted_1$m,
2589
2589
  vue.createElementVNode("form", _hoisted_2$c, [
2590
2590
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2591
2591
  vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
@@ -2793,10 +2793,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2793
2793
  ], 64 /* STABLE_FRAGMENT */))
2794
2794
  }
2795
2795
 
2796
- script$s.render = render$2;
2797
- script$s.__file = "src/lib/components/ShForm.vue";
2796
+ script$t.render = render$2;
2797
+ script$t.__file = "src/lib/components/ShForm.vue";
2798
2798
 
2799
- var script$r = {
2799
+ var script$s = {
2800
2800
  __name: 'EmailInput',
2801
2801
  props: ['modelValue','label'],
2802
2802
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2836,12 +2836,12 @@ return (_ctx, _cache) => {
2836
2836
 
2837
2837
  };
2838
2838
 
2839
- script$r.__file = "src/lib/components/form-components/EmailInput.vue";
2839
+ script$s.__file = "src/lib/components/form-components/EmailInput.vue";
2840
2840
 
2841
- const _hoisted_1$k = ["min", "max"];
2841
+ const _hoisted_1$l = ["min", "max"];
2842
2842
 
2843
2843
 
2844
- var script$q = {
2844
+ var script$r = {
2845
2845
  __name: 'NumberInput',
2846
2846
  props: ['modelValue','label','min','max'],
2847
2847
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2875,7 +2875,7 @@ return (_ctx, _cache) => {
2875
2875
  onChange: modelValueUpdated,
2876
2876
  onKeydown: modelValueUpdated,
2877
2877
  onUpdated: modelValueUpdated
2878
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$k)), [
2878
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$l)), [
2879
2879
  [vue.vModelText, inputModel.value]
2880
2880
  ])
2881
2881
  }
@@ -2883,9 +2883,9 @@ return (_ctx, _cache) => {
2883
2883
 
2884
2884
  };
2885
2885
 
2886
- script$q.__file = "src/lib/components/form-components/NumberInput.vue";
2886
+ script$r.__file = "src/lib/components/form-components/NumberInput.vue";
2887
2887
 
2888
- var script$p = {
2888
+ var script$q = {
2889
2889
  __name: 'TextInput',
2890
2890
  props: ['modelValue','label','isInvalid'],
2891
2891
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2927,9 +2927,9 @@ return (_ctx, _cache) => {
2927
2927
 
2928
2928
  };
2929
2929
 
2930
- script$p.__file = "src/lib/components/form-components/TextInput.vue";
2930
+ script$q.__file = "src/lib/components/form-components/TextInput.vue";
2931
2931
 
2932
- var script$o = {
2932
+ var script$p = {
2933
2933
  __name: 'TextAreaInput',
2934
2934
  props: ['modelValue','label'],
2935
2935
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2969,12 +2969,12 @@ return (_ctx, _cache) => {
2969
2969
 
2970
2970
  };
2971
2971
 
2972
- script$o.__file = "src/lib/components/form-components/TextAreaInput.vue";
2972
+ script$p.__file = "src/lib/components/form-components/TextAreaInput.vue";
2973
2973
 
2974
- const _hoisted_1$j = ["value"];
2974
+ const _hoisted_1$k = ["value"];
2975
2975
 
2976
2976
 
2977
- var script$n = {
2977
+ var script$o = {
2978
2978
  __name: 'SelectInput',
2979
2979
  props: ['modelValue','label','data','dataUrl'],
2980
2980
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2992,8 +2992,9 @@ const modelValueUpdated = (e) => {
2992
2992
  };
2993
2993
  vue.onMounted(()=>{
2994
2994
  props.modelValue && (inputModel.value = props.modelValue);
2995
- if(props.data){
2996
- selectOptions.value = props.data.map(item=>{
2995
+ const options = props.data ?? props.options;
2996
+ if(options){
2997
+ selectOptions.value = options.map(item=>{
2997
2998
  return {
2998
2999
  id: typeof item.id !== 'undefined' ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
2999
3000
  name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
@@ -3029,7 +3030,7 @@ return (_ctx, _cache) => {
3029
3030
  return (vue.openBlock(), vue.createElementBlock("option", {
3030
3031
  key: option.id,
3031
3032
  value: option.id
3032
- }, vue.toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$j))
3033
+ }, vue.toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$k))
3033
3034
  }), 128 /* KEYED_FRAGMENT */))
3034
3035
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
3035
3036
  [vue.vModelSelect, inputModel.value]
@@ -3039,9 +3040,9 @@ return (_ctx, _cache) => {
3039
3040
 
3040
3041
  };
3041
3042
 
3042
- script$n.__file = "src/lib/components/form-components/SelectInput.vue";
3043
+ script$o.__file = "src/lib/components/form-components/SelectInput.vue";
3043
3044
 
3044
- var script$m = {
3045
+ var script$n = {
3045
3046
  __name: 'PasswordInput',
3046
3047
  props: ['modelValue','label'],
3047
3048
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3077,9 +3078,9 @@ return (_ctx, _cache) => {
3077
3078
 
3078
3079
  };
3079
3080
 
3080
- script$m.__file = "src/lib/components/form-components/PasswordInput.vue";
3081
+ script$n.__file = "src/lib/components/form-components/PasswordInput.vue";
3081
3082
 
3082
- const _hoisted_1$i = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3083
+ const _hoisted_1$j = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3083
3084
  const _hoisted_2$b = ["onUpdate:modelValue"];
3084
3085
  const _hoisted_3$a = ["innerHTML"];
3085
3086
  const _hoisted_4$a = ["innerHTML"];
@@ -3106,7 +3107,7 @@ const _hoisted_12$3 = {
3106
3107
  const _hoisted_13$3 = { key: 1 };
3107
3108
 
3108
3109
 
3109
- var script$l = {
3110
+ var script$m = {
3110
3111
  __name: 'ShAutoForm',
3111
3112
  props: [
3112
3113
  'action','successCallback','retainDataAfterSubmission',
@@ -3139,19 +3140,19 @@ const getFieldComponent = (fieldObj)=>{
3139
3140
  const defaultPhones = ['phone'];
3140
3141
  const defaultEmails = ['email'];
3141
3142
  const formComponents = vue.inject('formComponents');
3142
- const TextComponent = formComponents.text ?? script$p;
3143
- const TextAreaComponent = formComponents.textArea ?? script$o;
3144
- const EmailComponent = formComponents.email ?? script$r;
3145
- const PhoneComponent = formComponents.phone ?? script$u;
3146
- const NumberComponent = formComponents.number ?? script$q;
3147
- const SelectComponent = formComponents.select ?? script$n;
3148
- const PasswordComponent = formComponents.password ?? script$m;
3143
+ const TextComponent = formComponents.text ?? script$q;
3144
+ const TextAreaComponent = formComponents.textArea ?? script$p;
3145
+ const EmailComponent = formComponents.email ?? script$s;
3146
+ const PhoneComponent = formComponents.phone ?? script$v;
3147
+ const NumberComponent = formComponents.number ?? script$r;
3148
+ const SelectComponent = formComponents.select ?? script$o;
3149
+ const PasswordComponent = formComponents.password ?? script$n;
3149
3150
  if(props.customComponents && props.customComponents[field]) {
3150
3151
  return props.customComponents[field]
3151
3152
  }
3152
3153
  if(fieldObj.type){
3153
3154
  if(fieldObj.type === 'suggest' || fieldObj.type === 'suggests'){
3154
- return script$t
3155
+ return script$u
3155
3156
  }
3156
3157
  return fieldObj.type === 'number' ? NumberComponent:fieldObj.type === 'textarea' ? TextAreaComponent : fieldObj.type === 'email' ? EmailComponent : fieldObj.type === 'phone' ? PhoneComponent : fieldObj.type === 'password' ? PasswordComponent:fieldObj.type === 'select' ? SelectComponent:TextComponent
3157
3158
  }else
@@ -3160,16 +3161,16 @@ const getFieldComponent = (fieldObj)=>{
3160
3161
  }
3161
3162
  else
3162
3163
  if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
3163
- return formComponents.textArea ?? script$o
3164
+ return formComponents.textArea ?? script$p
3164
3165
  } else
3165
3166
  if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
3166
- return formComponents.email ?? script$r
3167
+ return formComponents.email ?? script$s
3167
3168
  } else
3168
3169
  if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
3169
- return formComponents.phone ?? script$u
3170
+ return formComponents.phone ?? script$v
3170
3171
  } else
3171
3172
  if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
3172
- return formComponents.number ?? script$q
3173
+ return formComponents.number ?? script$r
3173
3174
  }
3174
3175
  // else
3175
3176
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
@@ -3178,7 +3179,7 @@ const getFieldComponent = (fieldObj)=>{
3178
3179
  // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3179
3180
  // return formComponents.date ?? DateInput
3180
3181
  // }
3181
- return formComponents.text ?? script$p
3182
+ return formComponents.text ?? script$q
3182
3183
  };
3183
3184
  const shFormElementClasses = vue.ref(null);
3184
3185
  shFormElementClasses.value = vue.inject('shFormElementClasses');
@@ -3316,7 +3317,7 @@ vue.onMounted((ev)=>{
3316
3317
 
3317
3318
  return (_ctx, _cache) => {
3318
3319
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3319
- _hoisted_1$i,
3320
+ _hoisted_1$j,
3320
3321
  vue.createElementVNode("form", {
3321
3322
  class: vue.normalizeClass([__props.formClass, "sh-form"]),
3322
3323
  ref_key: "shAutoForm",
@@ -3402,12 +3403,12 @@ return (_ctx, _cache) => {
3402
3403
 
3403
3404
  };
3404
3405
 
3405
- script$l.__file = "src/lib/components/ShAutoForm.vue";
3406
+ script$m.__file = "src/lib/components/ShAutoForm.vue";
3406
3407
 
3407
- const _hoisted_1$h = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3408
+ const _hoisted_1$i = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3408
3409
  const _hoisted_2$a = { class: "dropdown" };
3409
3410
 
3410
- var script$k = {
3411
+ var script$l = {
3411
3412
  __name: 'ShDropDownForm',
3412
3413
  props: ['action',
3413
3414
  'classes',
@@ -3437,7 +3438,7 @@ const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3437
3438
 
3438
3439
  return (_ctx, _cache) => {
3439
3440
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3440
- _hoisted_1$h,
3441
+ _hoisted_1$i,
3441
3442
  vue.createElementVNode("div", _hoisted_2$a, [
3442
3443
  vue.createElementVNode("a", {
3443
3444
  class: vue.normalizeClass(vue.unref(btnClass)),
@@ -3454,7 +3455,7 @@ return (_ctx, _cache) => {
3454
3455
  class: "dropdown-menu px-2 py-1",
3455
3456
  "aria-labelledby": dropdownId
3456
3457
  }, [
3457
- vue.createVNode(script$s, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3458
+ vue.createVNode(script$t, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3458
3459
  ])
3459
3460
  ])
3460
3461
  ], 64 /* STABLE_FRAGMENT */))
@@ -3463,9 +3464,9 @@ return (_ctx, _cache) => {
3463
3464
 
3464
3465
  };
3465
3466
 
3466
- script$k.__file = "src/lib/components/ShDropDownForm.vue";
3467
+ script$l.__file = "src/lib/components/ShDropDownForm.vue";
3467
3468
 
3468
- const _hoisted_1$g = ["id"];
3469
+ const _hoisted_1$h = ["id"];
3469
3470
  const _hoisted_2$9 = { class: "modal-content" };
3470
3471
  const _hoisted_3$9 = { class: "modal-header" };
3471
3472
  const _hoisted_4$9 = { class: "modal-title" };
@@ -3478,7 +3479,7 @@ const _hoisted_6$5 = { class: "modal-body" };
3478
3479
  const _hoisted_7$4 = { class: "section" };
3479
3480
 
3480
3481
 
3481
- var script$j = {
3482
+ var script$k = {
3482
3483
  __name: 'ShModal',
3483
3484
  props: {
3484
3485
  modalId: {
@@ -3535,17 +3536,17 @@ return (_ctx, _cache) => {
3535
3536
  ])
3536
3537
  ])
3537
3538
  ], 2 /* CLASS */)
3538
- ], 8 /* PROPS */, _hoisted_1$g))
3539
+ ], 8 /* PROPS */, _hoisted_1$h))
3539
3540
  }
3540
3541
  }
3541
3542
 
3542
3543
  };
3543
3544
 
3544
- script$j.__file = "src/lib/components/ShModal.vue";
3545
+ script$k.__file = "src/lib/components/ShModal.vue";
3545
3546
 
3546
- const _hoisted_1$f = ["href"];
3547
+ const _hoisted_1$g = ["href"];
3547
3548
 
3548
- var script$i = {
3549
+ var script$j = {
3549
3550
  __name: 'ShModalForm',
3550
3551
  props: ['action',
3551
3552
  'classes',
@@ -3584,13 +3585,13 @@ return (_ctx, _cache) => {
3584
3585
  "data-bs-toggle": "modal"
3585
3586
  }, [
3586
3587
  vue.renderSlot(_ctx.$slots, "default")
3587
- ], 10 /* CLASS, PROPS */, _hoisted_1$f),
3588
- vue.createVNode(script$j, {
3588
+ ], 10 /* CLASS, PROPS */, _hoisted_1$g),
3589
+ vue.createVNode(script$k, {
3589
3590
  "modal-id": modalId,
3590
3591
  "modal-title": __props.modalTitle
3591
3592
  }, {
3592
3593
  default: vue.withCtx(() => [
3593
- vue.createVNode(script$s, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3594
+ vue.createVNode(script$t, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3594
3595
  ]),
3595
3596
  _: 1 /* STABLE */
3596
3597
  }, 8 /* PROPS */, ["modal-title"])
@@ -3600,11 +3601,11 @@ return (_ctx, _cache) => {
3600
3601
 
3601
3602
  };
3602
3603
 
3603
- script$i.__file = "src/lib/components/ShModalForm.vue";
3604
+ script$j.__file = "src/lib/components/ShModalForm.vue";
3604
3605
 
3605
- const _hoisted_1$e = ["href"];
3606
+ const _hoisted_1$f = ["href"];
3606
3607
 
3607
- var script$h = {
3608
+ var script$i = {
3608
3609
  __name: 'ShModalFormAuto',
3609
3610
  props: ['action',
3610
3611
  'classes',
@@ -3644,13 +3645,13 @@ return (_ctx, _cache) => {
3644
3645
  "data-bs-toggle": "modal"
3645
3646
  }, [
3646
3647
  vue.renderSlot(_ctx.$slots, "default")
3647
- ], 10 /* CLASS, PROPS */, _hoisted_1$e),
3648
- vue.createVNode(script$j, {
3648
+ ], 10 /* CLASS, PROPS */, _hoisted_1$f),
3649
+ vue.createVNode(script$k, {
3649
3650
  "modal-id": modalId,
3650
3651
  "modal-title": __props.modalTitle
3651
3652
  }, {
3652
3653
  default: vue.withCtx(() => [
3653
- vue.createVNode(script$l, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3654
+ vue.createVNode(script$m, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3654
3655
  ]),
3655
3656
  _: 1 /* STABLE */
3656
3657
  }, 8 /* PROPS */, ["modal-title"])
@@ -3660,9 +3661,9 @@ return (_ctx, _cache) => {
3660
3661
 
3661
3662
  };
3662
3663
 
3663
- script$h.__file = "src/lib/components/ShModalFormAuto.vue";
3664
+ script$i.__file = "src/lib/components/ShModalFormAuto.vue";
3664
3665
 
3665
- const _hoisted_1$d = ["id"];
3666
+ const _hoisted_1$e = ["id"];
3666
3667
  const _hoisted_2$8 = { class: "offcanvas-header" };
3667
3668
  const _hoisted_3$8 = {
3668
3669
  class: "offcanvas-title",
@@ -3670,7 +3671,7 @@ const _hoisted_3$8 = {
3670
3671
  };
3671
3672
  const _hoisted_4$8 = { class: "offcanvas-body" };
3672
3673
 
3673
- var script$g = {
3674
+ var script$h = {
3674
3675
  __name: 'ShCanvas',
3675
3676
  props: {
3676
3677
  canvasId: {
@@ -3729,13 +3730,29 @@ return (_ctx, _cache) => {
3729
3730
  vue.createElementVNode("div", _hoisted_4$8, [
3730
3731
  vue.renderSlot(_ctx.$slots, "default")
3731
3732
  ])
3732
- ], 10 /* CLASS, PROPS */, _hoisted_1$d))
3733
+ ], 10 /* CLASS, PROPS */, _hoisted_1$e))
3733
3734
  }
3734
3735
  }
3735
3736
 
3736
3737
  };
3737
3738
 
3738
- script$g.__file = "src/lib/components/ShCanvas.vue";
3739
+ script$h.__file = "src/lib/components/ShCanvas.vue";
3740
+
3741
+ const _hoisted_1$d = { class: "callout callout-info" };
3742
+
3743
+ function render$1(_ctx, _cache) {
3744
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
3745
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
3746
+ vue.createTextVNode(" No records found ")
3747
+ ])
3748
+ ]))
3749
+ }
3750
+
3751
+ const script$g = {};
3752
+
3753
+ script$g.render = render$1;
3754
+ script$g.__scopeId = "data-v-55cf77fb";
3755
+ script$g.__file = "src/lib/components/others/NoRecords.vue";
3739
3756
 
3740
3757
  var script$f = {
3741
3758
  name: 'Pagination',
@@ -3856,7 +3873,7 @@ const _hoisted_23$1 = {
3856
3873
  class: "spinner-border"
3857
3874
  };
3858
3875
 
3859
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3876
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
3860
3877
  return ($props.paginationStyle !== 'loadMore')
3861
3878
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
3862
3879
  vue.createElementVNode("div", _hoisted_2$7, [
@@ -3933,7 +3950,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3933
3950
  ]))
3934
3951
  }
3935
3952
 
3936
- script$f.render = render$1;
3953
+ script$f.render = render;
3937
3954
  script$f.__file = "src/lib/components/list_templates/Pagination.vue";
3938
3955
 
3939
3956
  const _hoisted_1$b = /*#__PURE__*/vue.createElementVNode("span", {
@@ -4326,309 +4343,6 @@ return (_ctx, _cache) => {
4326
4343
 
4327
4344
  script$c.__file = "src/lib/components/ShRange.vue";
4328
4345
 
4329
- var script$b = {
4330
- name: 'sh-table',
4331
- props: ['endPoint', 'headers','cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange'],
4332
- data() {
4333
- return {
4334
- order_by: '',
4335
- order_method: '',
4336
- per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
4337
- page: 1,
4338
- exactMatch: false,
4339
- filter_value: '',
4340
- loading: 'loading',
4341
- loading_error: '',
4342
- records: [],
4343
- total: 0,
4344
- pagination_data: null,
4345
- moreDetailsId: null,
4346
- moreDetailsModel: null,
4347
- downloading: false,
4348
- appUrl: window.VITE_APP_API_URL,
4349
- hasCanvas: 0,
4350
- selectedRecord: null,
4351
- timeOut: null,
4352
- tableHeaders: [],
4353
- pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle', 'loadMore'),
4354
- range: null,
4355
- from: null,
4356
- to: null,
4357
- period: null
4358
- }
4359
- },
4360
- mounted() {
4361
- if (this.headers) {
4362
- this.tableHeaders = this.headers;
4363
- }
4364
-
4365
- if (this.actions && this.actions.actions) {
4366
- this.actions.actions.forEach(action => {
4367
- if (action.canvasComponent) {
4368
- this.hasCanvas = true;
4369
- }
4370
- });
4371
- }
4372
- if(this.cacheKey){
4373
- this.setCachedData();
4374
- }
4375
- this.reloadData();
4376
- },
4377
- methods: {
4378
- rangeChanged: function (newRange) {
4379
- this.range = newRange;
4380
- this.from = newRange.from.format('L');
4381
- this.to = newRange.to.format('L');
4382
- this.period = newRange.period;
4383
- this.reloadData();
4384
- },
4385
- userTyping: function () {
4386
- if (this.timeOut) {
4387
- clearTimeout(this.timeOut);
4388
- }
4389
- const self = this;
4390
- this.timeOut = setTimeout(() => {
4391
- self.reloadData(1);
4392
- }, 800);
4393
- },
4394
- cleanCanvasProps: function (actions) {
4395
- let replaced = actions;
4396
- replaced.class = null;
4397
- return replaced
4398
- },
4399
- newRecordAdded: function (ev) {
4400
- const record = ev.log;
4401
- if (record.user) {
4402
- record.user = record.user.name;
4403
- }
4404
- this.records.unshift(record);
4405
- },
4406
- canvasClosed: function () {
4407
- this.selectedRecord = null;
4408
- },
4409
- rowSelected: function (row) {
4410
- this.selectedRecord = null;
4411
- setTimeout(() => {
4412
- this.selectedRecord = row;
4413
- this.$emit('rowSelected', row);
4414
- }, 100);
4415
- },
4416
- changeKey: function (key, value) {
4417
- this[key] = value;
4418
- if (key === 'order_by') {
4419
- this.order_method = (this.order_method === 'desc') ? 'asc' : 'desc';
4420
- }
4421
- if (key === 'per_page') {
4422
- this.page = 1;
4423
- }
4424
- this.reloadData();
4425
- },
4426
- getLinkClass: function (config) {
4427
- if (typeof config === 'object') {
4428
- return config.class
4429
- }
4430
- return ''
4431
- },
4432
- reloadNotifications: function () {
4433
- this.reloadData();
4434
- },
4435
- replaceActionUrl: function (path, obj) {
4436
- if (path) {
4437
- var matches = path.match(/\{(.*?)\}/g);
4438
- try {
4439
- matches.forEach(key => {
4440
- key = key.replace('{', '');
4441
- key = key.replace('}', '');
4442
- path = path.replace(`{${key}}`, obj[key]);
4443
- });
4444
- return path
4445
- } catch (e) {
4446
- return path
4447
- }
4448
- }
4449
- return ''
4450
- },
4451
- doEmitAction: function (action, data) {
4452
- if (typeof action === 'function') {
4453
- action(data);
4454
- } else {
4455
- this.$emit(action, data);
4456
- }
4457
- },
4458
- getFieldType: function (field) {
4459
- const numbers = ['age', 'interest_rate_pa'];
4460
- const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
4461
- const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
4462
- if (numbers.includes(field)) {
4463
- return 'numeric'
4464
- }
4465
- if (moneys.includes(field)) {
4466
- return 'money'
4467
- }
4468
- if (dates.includes(field)) {
4469
- return 'date'
4470
- }
4471
- return 'string'
4472
- },
4473
- replaceLinkUrl: function (path, obj) {
4474
- if (typeof path === 'object') {
4475
- path = path.link ?? path.url;
4476
- }
4477
- var matches = path.match(/\{(.*?)\}/g);
4478
- matches && matches.forEach(key => {
4479
- key = key.replace('{', '');
4480
- key = key.replace('}', '');
4481
- path = path.replace(`{${key}}`, obj[key]);
4482
- });
4483
- return path
4484
- },
4485
- formatDate: function (date) {
4486
- return moment__default["default"](date).format('lll')
4487
- },
4488
- setMoreDetailsModel: function (row) {
4489
- this.moreDetailsModel = null;
4490
- this.moreDetailsModel = row;
4491
- },
4492
- loadMoreRecords: function () {
4493
- this.reloadData(this.page + 1, 1);
4494
- },
4495
- exportData: function (template) {
4496
- this.downloading = true;
4497
- const headers = [];
4498
- const fields = this.downloadFields ? this.downloadFields : this.headers;
4499
- fields.forEach(header => {
4500
- if (typeof header === 'string') {
4501
- headers.push(header);
4502
- }
4503
- });
4504
- const data = {
4505
- titles: headers,
4506
- export: 1
4507
- };
4508
- shApis.doPost(this.endPoint, data).then(res => {
4509
- this.downloading = false;
4510
- if (res.data.file) {
4511
- const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
4512
- window.location.href = url;
4513
- // window.open('https://facebook.com')
4514
- // window.open(this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name, '_blank').focus()
4515
- }
4516
- }).catch(reason => {
4517
- this.downloading = false;
4518
- const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText}`;
4519
- shRepo.swalError('Error', error);
4520
- });
4521
- },
4522
- setCachedData: function () {
4523
- if (this.cacheKey) {
4524
- this.records = ShStorage.getItem('sh_table_cache_' + this.cacheKey, []);
4525
- }
4526
- },
4527
- reloadData: function (page, append) {
4528
- if (typeof page !== 'undefined') {
4529
- this.page = page;
4530
- }
4531
- if (this.cacheKey && this.records && this.records.length > 0 && this.page < 2 ) {
4532
- this.loading = 'done';
4533
- } else if(!append){
4534
- this.loading = 'loading';
4535
- }
4536
- const data = {
4537
- order_by: this.order_by,
4538
- order_method: this.order_method,
4539
- per_page: this.per_page,
4540
- page: this.page,
4541
- filter_value: this.filter_value,
4542
- paginated: true,
4543
- from: this.from,
4544
- to: this.to,
4545
- period: this.period,
4546
- exact: this.exactMatch
4547
- };
4548
- if (this.pagination_data) {
4549
- this.pagination_data.loading = 1;
4550
- }
4551
- let endPoint = this.endPoint;
4552
- if (!this.endPoint && this.query) {
4553
- //send ql query
4554
- endPoint = 'sh-ql';
4555
- data.query = this.query;
4556
- }
4557
- shApis.doGet(endPoint, data).then(req => {
4558
- this.$emit('dataReloaded', this.pagination_data);
4559
- this.loading = 'done';
4560
- const response = req.data.data;
4561
- if(this.page < 2 && this.cacheKey){
4562
- ShStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
4563
- }
4564
- this.pagination_data = {
4565
- current: response.current_page,
4566
- start: response.from,
4567
- end: response.last_page,
4568
- record_count: response.total,
4569
- per_page: response.per_page,
4570
- loading: 0,
4571
- displayCount: response.total > response.per_page ? response.per_page : response.total
4572
- };
4573
- if (!this.headers && response.total > 0) {
4574
- this.tableHeaders = Object.keys(response.data[0]);
4575
- }
4576
- if (append) {
4577
- this.records.push(...response.data);
4578
- let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
4579
- if (totalShown > response.total) {
4580
- totalShown = response.total;
4581
- }
4582
- this.pagination_data.displayCount = totalShown;
4583
- const scrollingElement = (document.scrollingElement || document.body);
4584
- scrollingElement.scrollTop = scrollingElement.scrollHeight;
4585
- } else {
4586
- this.records = response.data;
4587
- }
4588
- }).catch(reason => {
4589
- const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText} (${this.endPoint})`;
4590
- this.loading_error = error;
4591
- this.loading = 'error';
4592
- });
4593
- }
4594
- },
4595
- watch: {
4596
- hideIds: {
4597
- handler(newValue) {
4598
- this.records = this.records.filter(record => !newValue.includes(record.id) && record);
4599
- },
4600
- deep: true
4601
- },
4602
- reload() {
4603
- this.reloadData();
4604
- },
4605
- endPoint() {
4606
- this.reloadData();
4607
- }
4608
- },
4609
- components: {
4610
- ShRange: script$c,
4611
- ShSilentAction: script$d,
4612
- ShConfirmAction: script$e,
4613
- ShCanvas: script$g,
4614
- pagination: script$f
4615
- },
4616
- computed: {
4617
- windowWidth: function () {
4618
- return window.innerWidth
4619
- },
4620
- user() {
4621
- return null
4622
- },
4623
- hasDefaultSlot() {
4624
- return !!this.$slots.default
4625
- },
4626
- hasRecordsSlot() {
4627
- return !!this.$slots.records
4628
- }
4629
- }
4630
- };
4631
-
4632
4346
  const _hoisted_1$8 = { class: "auto-table mt-2" };
4633
4347
  const _hoisted_2$5 = {
4634
4348
  key: 0,
@@ -4674,40 +4388,39 @@ const _hoisted_16$1 = {
4674
4388
  key: 1,
4675
4389
  class: "alert alert-danger"
4676
4390
  };
4677
- const _hoisted_17$1 = { colspan: 2 };
4678
- const _hoisted_18$1 = {
4391
+ const _hoisted_17$1 = {
4679
4392
  key: 0,
4680
4393
  class: "text-center"
4681
4394
  };
4682
- const _hoisted_19 = /*#__PURE__*/vue.createElementVNode("div", {
4395
+ const _hoisted_18$1 = /*#__PURE__*/vue.createElementVNode("div", {
4683
4396
  class: "spinner-border",
4684
4397
  role: "status"
4685
4398
  }, [
4686
4399
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4687
4400
  ], -1 /* HOISTED */);
4688
- const _hoisted_20 = [
4689
- _hoisted_19
4401
+ const _hoisted_19 = [
4402
+ _hoisted_18$1
4690
4403
  ];
4691
- const _hoisted_21 = {
4404
+ const _hoisted_20 = {
4692
4405
  key: 1,
4693
4406
  class: "alert alert-danger"
4694
4407
  };
4695
- const _hoisted_22 = { colspan: 2 };
4696
- const _hoisted_23 = { class: "sh-thead" };
4408
+ const _hoisted_21 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
4409
+ const _hoisted_22 = { class: "sh-thead" };
4410
+ const _hoisted_23 = ["onClick"];
4697
4411
  const _hoisted_24 = ["onClick"];
4698
4412
  const _hoisted_25 = ["onClick"];
4699
- const _hoisted_26 = ["onClick"];
4700
- const _hoisted_27 = {
4413
+ const _hoisted_26 = {
4701
4414
  key: 0,
4702
4415
  class: "text-capitalize"
4703
4416
  };
4704
- const _hoisted_28 = { class: "sh-tbody" };
4705
- const _hoisted_29 = {
4417
+ const _hoisted_27 = { class: "sh-tbody" };
4418
+ const _hoisted_28 = {
4706
4419
  key: 0,
4707
4420
  class: "text-center"
4708
4421
  };
4709
- const _hoisted_30 = ["colspan"];
4710
- const _hoisted_31 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
4422
+ const _hoisted_29 = ["colspan"];
4423
+ const _hoisted_30 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
4711
4424
  /*#__PURE__*/vue.createElementVNode("div", {
4712
4425
  class: "spinner-border",
4713
4426
  role: "status"
@@ -4715,42 +4428,42 @@ const _hoisted_31 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-ce
4715
4428
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4716
4429
  ])
4717
4430
  ], -1 /* HOISTED */);
4718
- const _hoisted_32 = [
4719
- _hoisted_31
4431
+ const _hoisted_31 = [
4432
+ _hoisted_30
4720
4433
  ];
4721
- const _hoisted_33 = {
4434
+ const _hoisted_32 = {
4722
4435
  key: 1,
4723
4436
  class: "text-center alert alert-danger"
4724
4437
  };
4725
- const _hoisted_34 = ["colspan"];
4726
- const _hoisted_35 = {
4438
+ const _hoisted_33 = ["colspan"];
4439
+ const _hoisted_34 = {
4727
4440
  key: 2,
4728
4441
  class: "text-center alert alert-info no_records"
4729
4442
  };
4730
- const _hoisted_36 = ["colspan"];
4731
- const _hoisted_37 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
4732
- const _hoisted_38 = ["onClick"];
4733
- const _hoisted_39 = { key: 1 };
4734
- const _hoisted_40 = {
4443
+ const _hoisted_35 = ["colspan"];
4444
+ const _hoisted_36 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
4445
+ const _hoisted_37 = ["onClick"];
4446
+ const _hoisted_38 = { key: 1 };
4447
+ const _hoisted_39 = {
4735
4448
  key: 2,
4736
4449
  class: "text-success fw-bold"
4737
4450
  };
4738
- const _hoisted_41 = { key: 3 };
4451
+ const _hoisted_40 = { key: 3 };
4452
+ const _hoisted_41 = ["innerHTML"];
4739
4453
  const _hoisted_42 = ["innerHTML"];
4740
4454
  const _hoisted_43 = ["innerHTML"];
4741
- const _hoisted_44 = ["innerHTML"];
4742
- const _hoisted_45 = {
4455
+ const _hoisted_44 = {
4743
4456
  key: 0,
4744
4457
  style: {"white-space":"nowrap"}
4745
4458
  };
4746
- const _hoisted_46 = ["href"];
4747
- const _hoisted_47 = ["title", "onClick"];
4748
- const _hoisted_48 = { key: 5 };
4749
- const _hoisted_49 = {
4459
+ const _hoisted_45 = ["href"];
4460
+ const _hoisted_46 = ["title", "onClick"];
4461
+ const _hoisted_47 = { key: 5 };
4462
+ const _hoisted_48 = {
4750
4463
  key: 0,
4751
4464
  class: "text-center"
4752
4465
  };
4753
- const _hoisted_50 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
4466
+ const _hoisted_49 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
4754
4467
  /*#__PURE__*/vue.createElementVNode("div", {
4755
4468
  class: "spinner-border",
4756
4469
  role: "status"
@@ -4758,58 +4471,362 @@ const _hoisted_50 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-ce
4758
4471
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4759
4472
  ])
4760
4473
  ], -1 /* HOISTED */);
4761
- const _hoisted_51 = [
4762
- _hoisted_50
4474
+ const _hoisted_50 = [
4475
+ _hoisted_49
4763
4476
  ];
4764
- const _hoisted_52 = { key: 1 };
4765
- const _hoisted_53 = {
4477
+ const _hoisted_51 = { key: 1 };
4478
+ const _hoisted_52 = {
4766
4479
  key: 2,
4767
4480
  class: "mobile-list-items"
4768
4481
  };
4769
- const _hoisted_54 = ["onClick"];
4770
- const _hoisted_55 = {
4482
+ const _hoisted_53 = ["onClick"];
4483
+ const _hoisted_54 = {
4771
4484
  key: 0,
4772
4485
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
4773
4486
  };
4774
- const _hoisted_56 = {
4487
+ const _hoisted_55 = {
4775
4488
  key: 1,
4776
4489
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
4777
4490
  };
4778
- const _hoisted_57 = {
4491
+ const _hoisted_56 = {
4779
4492
  key: 2,
4780
4493
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
4781
4494
  };
4782
- const _hoisted_58 = { key: 1 };
4783
- const _hoisted_59 = {
4495
+ const _hoisted_57 = { key: 1 };
4496
+ const _hoisted_58 = {
4784
4497
  key: 2,
4785
4498
  class: "text-primary fw-bold"
4786
4499
  };
4787
- const _hoisted_60 = { key: 3 };
4500
+ const _hoisted_59 = { key: 3 };
4501
+ const _hoisted_60 = ["innerHTML"];
4788
4502
  const _hoisted_61 = ["innerHTML"];
4789
4503
  const _hoisted_62 = ["innerHTML"];
4790
- const _hoisted_63 = ["innerHTML"];
4791
- const _hoisted_64 = /*#__PURE__*/vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */);
4792
- const _hoisted_65 = { key: 0 };
4793
- const _hoisted_66 = ["href"];
4794
- const _hoisted_67 = ["title", "onClick"];
4504
+ const _hoisted_63 = /*#__PURE__*/vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */);
4505
+ const _hoisted_64 = { key: 0 };
4506
+ const _hoisted_65 = ["href"];
4507
+ const _hoisted_66 = ["title", "onClick"];
4508
+
4509
+ const __default__ = {
4510
+ name: 'sh-table',
4511
+ props: ['endPoint', 'headers', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','noRecordsMessage'],
4512
+ data(){
4513
+ return {
4514
+ order_by: '',
4515
+ order_method: '',
4516
+ per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
4517
+ page: 1,
4518
+ exactMatch: false,
4519
+ filter_value: '',
4520
+ loading: 'loading',
4521
+ loading_error: '',
4522
+ records: [],
4523
+ total: 0,
4524
+ pagination_data: null,
4525
+ moreDetailsId: null,
4526
+ moreDetailsModel: null,
4527
+ downloading: false,
4528
+ appUrl: window.VITE_APP_API_URL,
4529
+ hasCanvas: 0,
4530
+ selectedRecord: null,
4531
+ timeOut: null,
4532
+ tableHeaders: [],
4533
+ pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle', 'loadMore'),
4534
+ range: null,
4535
+ from: null,
4536
+ to: null,
4537
+ period: null
4538
+ }
4539
+ },
4540
+ mounted(){
4541
+ if (this.headers) {
4542
+ this.tableHeaders = this.headers;
4543
+ }
4795
4544
 
4796
- function render(_ctx, _cache, $props, $setup, $data, $options) {
4797
- const _component_sh_range = vue.resolveComponent("sh-range");
4545
+ if (this.actions && this.actions.actions) {
4546
+ this.actions.actions.forEach(action => {
4547
+ if (action.canvasComponent) {
4548
+ this.hasCanvas = true;
4549
+ }
4550
+ });
4551
+ }
4552
+ if (this.cacheKey) {
4553
+ this.setCachedData();
4554
+ }
4555
+ this.reloadData();
4556
+ },
4557
+ methods: {
4558
+ rangeChanged: function (newRange){
4559
+ this.range = newRange;
4560
+ this.from = newRange.from.format('L');
4561
+ this.to = newRange.to.format('L');
4562
+ this.period = newRange.period;
4563
+ this.reloadData();
4564
+ },
4565
+ userTyping: function (){
4566
+ if (this.timeOut) {
4567
+ clearTimeout(this.timeOut);
4568
+ }
4569
+ const self = this;
4570
+ this.timeOut = setTimeout(() => {
4571
+ self.reloadData(1);
4572
+ }, 800);
4573
+ },
4574
+ cleanCanvasProps: function (actions){
4575
+ let replaced = actions;
4576
+ replaced.class = null;
4577
+ return replaced
4578
+ },
4579
+ newRecordAdded: function (ev){
4580
+ const record = ev.log;
4581
+ if (record.user) {
4582
+ record.user = record.user.name;
4583
+ }
4584
+ this.records.unshift(record);
4585
+ },
4586
+ canvasClosed: function (){
4587
+ this.selectedRecord = null;
4588
+ },
4589
+ rowSelected: function (row){
4590
+ this.selectedRecord = null;
4591
+ setTimeout(() => {
4592
+ this.selectedRecord = row;
4593
+ this.$emit('rowSelected', row);
4594
+ }, 100);
4595
+ },
4596
+ changeKey: function (key, value){
4597
+ this[key] = value;
4598
+ if (key === 'order_by') {
4599
+ this.order_method = (this.order_method === 'desc') ? 'asc' : 'desc';
4600
+ }
4601
+ if (key === 'per_page') {
4602
+ this.page = 1;
4603
+ }
4604
+ this.reloadData();
4605
+ },
4606
+ getLinkClass: function (config){
4607
+ if (typeof config === 'object') {
4608
+ return config.class
4609
+ }
4610
+ return ''
4611
+ },
4612
+ reloadNotifications: function (){
4613
+ this.reloadData();
4614
+ },
4615
+ replaceActionUrl: function (path, obj){
4616
+ if (path) {
4617
+ var matches = path.match(/\{(.*?)\}/g);
4618
+ try {
4619
+ matches.forEach(key => {
4620
+ key = key.replace('{', '');
4621
+ key = key.replace('}', '');
4622
+ path = path.replace(`{${key}}`, obj[key]);
4623
+ });
4624
+ return path
4625
+ } catch (e) {
4626
+ return path
4627
+ }
4628
+ }
4629
+ return ''
4630
+ },
4631
+ doEmitAction: function (action, data){
4632
+ if (typeof action === 'function') {
4633
+ action(data);
4634
+ } else {
4635
+ this.$emit(action, data);
4636
+ }
4637
+ },
4638
+ getFieldType: function (field){
4639
+ const numbers = ['age', 'interest_rate_pa'];
4640
+ const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
4641
+ const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
4642
+ if (numbers.includes(field)) {
4643
+ return 'numeric'
4644
+ }
4645
+ if (moneys.includes(field)) {
4646
+ return 'money'
4647
+ }
4648
+ if (dates.includes(field)) {
4649
+ return 'date'
4650
+ }
4651
+ return 'string'
4652
+ },
4653
+ replaceLinkUrl: function (path, obj){
4654
+ if (typeof path === 'object') {
4655
+ path = path.link ?? path.url;
4656
+ }
4657
+ var matches = path.match(/\{(.*?)\}/g);
4658
+ matches && matches.forEach(key => {
4659
+ key = key.replace('{', '');
4660
+ key = key.replace('}', '');
4661
+ path = path.replace(`{${key}}`, obj[key]);
4662
+ });
4663
+ return path
4664
+ },
4665
+ formatDate: function (date){
4666
+ return moment__default["default"](date).format('lll')
4667
+ },
4668
+ setMoreDetailsModel: function (row){
4669
+ this.moreDetailsModel = null;
4670
+ this.moreDetailsModel = row;
4671
+ },
4672
+ loadMoreRecords: function (){
4673
+ this.reloadData(this.page + 1, 1);
4674
+ },
4675
+ exportData: function (template){
4676
+ this.downloading = true;
4677
+ const headers = [];
4678
+ const fields = this.downloadFields ? this.downloadFields : this.headers;
4679
+ fields.forEach(header => {
4680
+ if (typeof header === 'string') {
4681
+ headers.push(header);
4682
+ }
4683
+ });
4684
+ const data = {
4685
+ titles: headers,
4686
+ export: 1
4687
+ };
4688
+ shApis.doPost(this.endPoint, data).then(res => {
4689
+ this.downloading = false;
4690
+ if (res.data.file) {
4691
+ const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
4692
+ window.location.href = url;
4693
+ // window.open('https://facebook.com')
4694
+ // window.open(this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name, '_blank').focus()
4695
+ }
4696
+ }).catch(reason => {
4697
+ this.downloading = false;
4698
+ const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText}`;
4699
+ shRepo.swalError('Error', error);
4700
+ });
4701
+ },
4702
+ setCachedData: function (){
4703
+ if (this.cacheKey) {
4704
+ this.records = ShStorage.getItem('sh_table_cache_' + this.cacheKey, []);
4705
+ }
4706
+ },
4707
+ reloadData: function (page, append){
4708
+ if (typeof page !== 'undefined') {
4709
+ this.page = page;
4710
+ }
4711
+ if (this.cacheKey && this.records && this.page < 2) {
4712
+ this.loading = 'done';
4713
+ } else if (!append) {
4714
+ this.loading = 'loading';
4715
+ }
4716
+ const data = {
4717
+ order_by: this.order_by,
4718
+ order_method: this.order_method,
4719
+ per_page: this.per_page,
4720
+ page: this.page,
4721
+ filter_value: this.filter_value,
4722
+ paginated: true,
4723
+ from: this.from,
4724
+ to: this.to,
4725
+ period: this.period,
4726
+ exact: this.exactMatch
4727
+ };
4728
+ if (this.pagination_data) {
4729
+ this.pagination_data.loading = 1;
4730
+ }
4731
+ let endPoint = this.endPoint;
4732
+ if (!this.endPoint && this.query) {
4733
+ //send ql query
4734
+ endPoint = 'sh-ql';
4735
+ data.query = this.query;
4736
+ }
4737
+ shApis.doGet(endPoint, data).then(req => {
4738
+ this.$emit('dataReloaded', this.pagination_data);
4739
+ this.loading = 'done';
4740
+ const response = req.data.data;
4741
+ if (this.page < 2 && this.cacheKey) {
4742
+ ShStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
4743
+ }
4744
+ this.pagination_data = {
4745
+ current: response.current_page,
4746
+ start: response.from,
4747
+ end: response.last_page,
4748
+ record_count: response.total,
4749
+ per_page: response.per_page,
4750
+ loading: 0,
4751
+ displayCount: response.total > response.per_page ? response.per_page : response.total
4752
+ };
4753
+ if (!this.headers && response.total > 0) {
4754
+ this.tableHeaders = Object.keys(response.data[0]);
4755
+ }
4756
+ if (append) {
4757
+ this.records.push(...response.data);
4758
+ let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
4759
+ if (totalShown > response.total) {
4760
+ totalShown = response.total;
4761
+ }
4762
+ this.pagination_data.displayCount = totalShown;
4763
+ const scrollingElement = (document.scrollingElement || document.body);
4764
+ scrollingElement.scrollTop = scrollingElement.scrollHeight;
4765
+ } else {
4766
+ this.records = response.data;
4767
+ }
4768
+ }).catch(reason => {
4769
+ const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText} (${this.endPoint})`;
4770
+ this.loading_error = error;
4771
+ this.loading = 'error';
4772
+ });
4773
+ }
4774
+ },
4775
+ watch: {
4776
+ hideIds: {
4777
+ handler(newValue){
4778
+ this.records = this.records.filter(record => !newValue.includes(record.id) && record);
4779
+ },
4780
+ deep: true
4781
+ },
4782
+ reload(){
4783
+ this.reloadData();
4784
+ },
4785
+ endPoint(){
4786
+ this.reloadData();
4787
+ }
4788
+ },
4789
+ components: {
4790
+ ShRange: script$c,
4791
+ ShSilentAction: script$d,
4792
+ ShConfirmAction: script$e,
4793
+ ShCanvas: script$h,
4794
+ pagination: script$f
4795
+ },
4796
+ computed: {
4797
+ windowWidth: function (){
4798
+ return window.innerWidth
4799
+ },
4800
+ user(){
4801
+ return null
4802
+ },
4803
+ hasDefaultSlot(){
4804
+ return !!this.$slots.default
4805
+ },
4806
+ hasRecordsSlot(){
4807
+ return !!this.$slots.records
4808
+ }
4809
+ }
4810
+ };
4811
+
4812
+
4813
+ var script$b = /*#__PURE__*/Object.assign(__default__, {
4814
+ setup(__props) {
4815
+
4816
+ const noRecordsComponent = vue.inject('noRecordsComponent', script$g);
4817
+
4818
+ return (_ctx, _cache) => {
4798
4819
  const _component_router_link = vue.resolveComponent("router-link");
4799
- const _component_sh_confirm_action = vue.resolveComponent("sh-confirm-action");
4800
- const _component_sh_silent_action = vue.resolveComponent("sh-silent-action");
4801
- const _component_pagination = vue.resolveComponent("pagination");
4802
- const _component_sh_canvas = vue.resolveComponent("sh-canvas");
4803
4820
 
4804
4821
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
4805
- ($props.hasDownload)
4822
+ (__props.hasDownload)
4806
4823
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, [
4807
4824
  vue.createElementVNode("button", {
4808
- disabled: $data.downloading,
4825
+ disabled: _ctx.downloading,
4809
4826
  class: "btn btn-warning btn-sm",
4810
- onClick: _cache[0] || (_cache[0] = $event => ($options.exportData()))
4827
+ onClick: _cache[0] || (_cache[0] = $event => (_ctx.exportData()))
4811
4828
  }, [
4812
- (!$data.downloading)
4829
+ (!_ctx.downloading)
4813
4830
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
4814
4831
  _hoisted_4$5,
4815
4832
  vue.createTextVNode(" Export ")
@@ -4821,37 +4838,37 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4821
4838
  ], 8 /* PROPS */, _hoisted_3$5)
4822
4839
  ]))
4823
4840
  : vue.createCommentVNode("v-if", true),
4824
- (!$props.hideSearch)
4841
+ (!__props.hideSearch)
4825
4842
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
4826
4843
  vue.createElementVNode("div", _hoisted_8$2, [
4827
- ($props.hasRange)
4844
+ (__props.hasRange)
4828
4845
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, [
4829
- vue.createVNode(_component_sh_range, { onRangeSelected: $options.rangeChanged }, null, 8 /* PROPS */, ["onRangeSelected"])
4846
+ vue.createVNode(script$c, { onRangeSelected: _ctx.rangeChanged }, null, 8 /* PROPS */, ["onRangeSelected"])
4830
4847
  ]))
4831
4848
  : vue.createCommentVNode("v-if", true),
4832
4849
  vue.createElementVNode("div", {
4833
- class: vue.normalizeClass(["sh-search-bar input-group", $props.hasRange ? 'ms-2':''])
4850
+ class: vue.normalizeClass(["sh-search-bar input-group", __props.hasRange ? 'ms-2':''])
4834
4851
  }, [
4835
4852
  vue.withDirectives(vue.createElementVNode("input", {
4836
- onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.userTyping && $options.userTyping(...args))),
4837
- onKeyup: _cache[2] || (_cache[2] = (...args) => ($options.userTyping && $options.userTyping(...args))),
4853
+ onKeydown: _cache[1] || (_cache[1] = (...args) => (_ctx.userTyping && _ctx.userTyping(...args))),
4854
+ onKeyup: _cache[2] || (_cache[2] = (...args) => (_ctx.userTyping && _ctx.userTyping(...args))),
4838
4855
  type: "search",
4839
- onChange: _cache[3] || (_cache[3] = $event => ($options.reloadData(1))),
4840
- "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => (($data.filter_value) = $event)),
4841
- placeholder: $props.searchPlaceholder ? $props.searchPlaceholder : 'Search',
4856
+ onChange: _cache[3] || (_cache[3] = $event => (_ctx.reloadData(1))),
4857
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((_ctx.filter_value) = $event)),
4858
+ placeholder: __props.searchPlaceholder ? __props.searchPlaceholder : 'Search',
4842
4859
  class: "form-control sh-search-input"
4843
4860
  }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_10$1), [
4844
- [vue.vModelText, $data.filter_value]
4861
+ [vue.vModelText, _ctx.filter_value]
4845
4862
  ]),
4846
- ($data.filter_value.length > 1)
4863
+ (_ctx.filter_value.length > 1)
4847
4864
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11$1, [
4848
4865
  vue.withDirectives(vue.createElementVNode("input", {
4849
- onChange: _cache[5] || (_cache[5] = (...args) => ($options.reloadData && $options.reloadData(...args))),
4866
+ onChange: _cache[5] || (_cache[5] = (...args) => (_ctx.reloadData && _ctx.reloadData(...args))),
4850
4867
  value: true,
4851
- "onUpdate:modelValue": _cache[6] || (_cache[6] = $event => (($data.exactMatch) = $event)),
4868
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = $event => ((_ctx.exactMatch) = $event)),
4852
4869
  type: "checkbox"
4853
4870
  }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
4854
- [vue.vModelCheckbox, $data.exactMatch]
4871
+ [vue.vModelCheckbox, _ctx.exactMatch]
4855
4872
  ]),
4856
4873
  _hoisted_12$1
4857
4874
  ]))
@@ -4860,17 +4877,17 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4860
4877
  ])
4861
4878
  ]))
4862
4879
  : vue.createCommentVNode("v-if", true),
4863
- ($options.hasDefaultSlot)
4880
+ (_ctx.hasDefaultSlot)
4864
4881
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
4865
- ($data.loading === 'loading')
4882
+ (_ctx.loading === 'loading')
4866
4883
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$1, _hoisted_15$1))
4867
- : ($data.loading === 'error')
4884
+ : (_ctx.loading === 'error')
4868
4885
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, [
4869
- vue.createElementVNode("span", _hoisted_17$1, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
4886
+ vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
4870
4887
  ]))
4871
4888
  : vue.createCommentVNode("v-if", true),
4872
- ($data.loading === 'done')
4873
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList($data.records, (record) => {
4889
+ (_ctx.loading === 'done')
4890
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.records, (record) => {
4874
4891
  return vue.renderSlot(_ctx.$slots, "default", {
4875
4892
  key: record.id,
4876
4893
  record: record
@@ -4878,137 +4895,145 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4878
4895
  }), 128 /* KEYED_FRAGMENT */))
4879
4896
  : vue.createCommentVNode("v-if", true)
4880
4897
  ], 64 /* STABLE_FRAGMENT */))
4881
- : ($options.hasRecordsSlot)
4898
+ : (_ctx.hasRecordsSlot)
4882
4899
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
4883
- ($data.loading === 'loading')
4884
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, _hoisted_20))
4885
- : ($data.loading === 'error')
4886
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
4887
- vue.createElementVNode("span", _hoisted_22, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
4900
+ (_ctx.loading === 'loading')
4901
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$1, _hoisted_19))
4902
+ : (_ctx.loading === 'error')
4903
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20, [
4904
+ vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
4888
4905
  ]))
4889
4906
  : vue.createCommentVNode("v-if", true),
4890
- ($data.loading === 'done')
4891
- ? vue.renderSlot(_ctx.$slots, "records", {
4892
- key: 2,
4893
- records: $data.records
4894
- })
4907
+ (_ctx.loading === 'done')
4908
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
4909
+ (_ctx.records.length === 0)
4910
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(noRecordsComponent)), { key: 0 }, {
4911
+ default: vue.withCtx(() => [
4912
+ _hoisted_21,
4913
+ vue.createTextVNode(" " + vue.toDisplayString(__props.noRecordsMessage ?? 'No records found'), 1 /* TEXT */)
4914
+ ]),
4915
+ _: 1 /* STABLE */
4916
+ }))
4917
+ : vue.createCommentVNode("v-if", true),
4918
+ vue.renderSlot(_ctx.$slots, "records", { records: _ctx.records })
4919
+ ], 64 /* STABLE_FRAGMENT */))
4895
4920
  : vue.createCommentVNode("v-if", true)
4896
4921
  ], 64 /* STABLE_FRAGMENT */))
4897
- : ($options.windowWidth > 700)
4922
+ : (_ctx.windowWidth > 700)
4898
4923
  ? (vue.openBlock(), vue.createElementBlock("table", {
4899
4924
  key: 4,
4900
- class: vue.normalizeClass(["table sh-table", $props.tableHover ? 'table-hover':''])
4925
+ class: vue.normalizeClass(["table sh-table", __props.tableHover ? 'table-hover':''])
4901
4926
  }, [
4902
- vue.createElementVNode("thead", _hoisted_23, [
4927
+ vue.createElementVNode("thead", _hoisted_22, [
4903
4928
  vue.createElementVNode("tr", null, [
4904
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableHeaders, (title) => {
4929
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (title) => {
4905
4930
  return (vue.openBlock(), vue.createElementBlock("th", { key: title }, [
4906
4931
  (typeof title === 'string')
4907
4932
  ? (vue.openBlock(), vue.createElementBlock("a", {
4908
4933
  key: 0,
4909
4934
  class: "text-capitalize",
4910
- onClick: $event => ($options.changeKey('order_by',title))
4911
- }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_24))
4935
+ onClick: $event => (_ctx.changeKey('order_by',title))
4936
+ }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_23))
4912
4937
  : (typeof title === 'function')
4913
4938
  ? (vue.openBlock(), vue.createElementBlock("a", {
4914
4939
  key: 1,
4915
4940
  class: "text-capitalize",
4916
- onClick: $event => ($options.changeKey('order_by',title(null)))
4917
- }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_25))
4941
+ onClick: $event => (_ctx.changeKey('order_by',title(null)))
4942
+ }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_24))
4918
4943
  : (typeof title !== 'undefined')
4919
4944
  ? (vue.openBlock(), vue.createElementBlock("a", {
4920
4945
  key: 2,
4921
4946
  class: "text-capitalize",
4922
- onClick: $event => ($options.changeKey('order_by',title))
4923
- }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_26))
4947
+ onClick: $event => (_ctx.changeKey('order_by',title))
4948
+ }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_25))
4924
4949
  : vue.createCommentVNode("v-if", true)
4925
4950
  ]))
4926
4951
  }), 128 /* KEYED_FRAGMENT */)),
4927
- ($props.actions)
4928
- ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_27, vue.toDisplayString($props.actions.label), 1 /* TEXT */))
4952
+ (__props.actions)
4953
+ ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_26, vue.toDisplayString(__props.actions.label), 1 /* TEXT */))
4929
4954
  : vue.createCommentVNode("v-if", true)
4930
4955
  ])
4931
4956
  ]),
4932
- vue.createElementVNode("tbody", _hoisted_28, [
4933
- ($data.loading === 'loading')
4934
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_29, [
4957
+ vue.createElementVNode("tbody", _hoisted_27, [
4958
+ (_ctx.loading === 'loading')
4959
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_28, [
4935
4960
  vue.createElementVNode("td", {
4936
- colspan: $data.tableHeaders.length
4937
- }, _hoisted_32, 8 /* PROPS */, _hoisted_30)
4961
+ colspan: _ctx.tableHeaders.length
4962
+ }, _hoisted_31, 8 /* PROPS */, _hoisted_29)
4938
4963
  ]))
4939
- : ($data.loading === 'error')
4940
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_33, [
4964
+ : (_ctx.loading === 'error')
4965
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_32, [
4941
4966
  vue.createElementVNode("td", {
4942
- colspan: $data.tableHeaders.length
4943
- }, vue.toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_34)
4967
+ colspan: _ctx.tableHeaders.length
4968
+ }, vue.toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_33)
4944
4969
  ]))
4945
- : ($data.records.length === 0)
4946
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_35, [
4970
+ : (_ctx.records.length === 0)
4971
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_34, [
4947
4972
  vue.createElementVNode("td", {
4948
- colspan: $props.actions ? $data.tableHeaders.length + 1 : $data.tableHeaders.length
4973
+ colspan: __props.actions ? _ctx.tableHeaders.length + 1 : _ctx.tableHeaders.length
4949
4974
  }, [
4950
- _hoisted_37,
4975
+ _hoisted_36,
4951
4976
  vue.createTextVNode(" No records found ")
4952
- ], 8 /* PROPS */, _hoisted_36)
4977
+ ], 8 /* PROPS */, _hoisted_35)
4953
4978
  ]))
4954
- : ($data.loading === 'done')
4955
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList($data.records, (record, index) => {
4979
+ : (_ctx.loading === 'done')
4980
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(_ctx.records, (record, index) => {
4956
4981
  return (vue.openBlock(), vue.createElementBlock("tr", {
4957
4982
  key: record.id,
4958
4983
  class: vue.normalizeClass(record.class),
4959
- onClick: $event => ($options.rowSelected(record))
4984
+ onClick: $event => (_ctx.rowSelected(record))
4960
4985
  }, [
4961
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableHeaders, (key) => {
4986
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (key) => {
4962
4987
  return (vue.openBlock(), vue.createElementBlock("td", { key: key }, [
4963
- (typeof key === 'string' && $props.links && $props.links[key])
4988
+ (typeof key === 'string' && __props.links && __props.links[key])
4964
4989
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
4965
4990
  key: 0,
4966
- target: $props.links[key].target ? '_blank':'',
4967
- to: $options.replaceLinkUrl($props.links[key],record),
4968
- class: vue.normalizeClass($options.getLinkClass($props.links[key])),
4991
+ target: __props.links[key].target ? '_blank':'',
4992
+ to: _ctx.replaceLinkUrl(__props.links[key],record),
4993
+ class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
4969
4994
  innerHTML: record[key]
4970
4995
  }, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
4971
- : ($options.getFieldType(key) === 'numeric')
4972
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_39, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
4973
- : ($options.getFieldType(key) === 'money')
4974
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_40, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
4975
- : ($options.getFieldType(key) === 'date')
4976
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_41, vue.toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
4996
+ : (_ctx.getFieldType(key) === 'numeric')
4997
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_38, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
4998
+ : (_ctx.getFieldType(key) === 'money')
4999
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_39, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5000
+ : (_ctx.getFieldType(key) === 'date')
5001
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_40, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
4977
5002
  : (typeof key === 'string')
4978
5003
  ? (vue.openBlock(), vue.createElementBlock("span", {
4979
5004
  key: 4,
4980
5005
  innerHTML: record[key]
4981
- }, null, 8 /* PROPS */, _hoisted_42))
5006
+ }, null, 8 /* PROPS */, _hoisted_41))
4982
5007
  : (typeof key === 'function')
4983
5008
  ? (vue.openBlock(), vue.createElementBlock("span", {
4984
5009
  key: 5,
4985
5010
  innerHTML: key(record, index)
4986
- }, null, 8 /* PROPS */, _hoisted_43))
5011
+ }, null, 8 /* PROPS */, _hoisted_42))
4987
5012
  : (vue.openBlock(), vue.createElementBlock("span", {
4988
5013
  key: 6,
4989
5014
  innerHTML: record[key[0]]
4990
- }, null, 8 /* PROPS */, _hoisted_44))
5015
+ }, null, 8 /* PROPS */, _hoisted_43))
4991
5016
  ]))
4992
5017
  }), 128 /* KEYED_FRAGMENT */)),
4993
- ($props.actions)
4994
- ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_45, [
4995
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
5018
+ (__props.actions)
5019
+ ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_44, [
5020
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions.actions, (act) => {
4996
5021
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
4997
5022
  key: act.path
4998
5023
  }, [
4999
- (!act.permission || $options.user.isAllowedTo(act.permission))
5024
+ (!act.permission || _ctx.user.isAllowedTo(act.permission))
5000
5025
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
5001
5026
  (!act.validator || act.validator(record))
5002
5027
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
5003
5028
  (['confirmAction','confirmaction','confirm-action','confirm'].includes(act.type))
5004
- ? (vue.openBlock(), vue.createBlock(_component_sh_confirm_action, {
5029
+ ? (vue.openBlock(), vue.createBlock(script$e, {
5005
5030
  key: 0,
5006
- onActionSuccessful: $event => ($options.doEmitAction('actionSuccessful',record)),
5007
- onActionFailed: $event => ($options.doEmitAction('actionFailed',record)),
5008
- onActionCanceled: $event => ($options.doEmitAction('actionCanceled',record)),
5031
+ onActionSuccessful: $event => (_ctx.doEmitAction('actionSuccessful',record)),
5032
+ onActionFailed: $event => (_ctx.doEmitAction('actionFailed',record)),
5033
+ onActionCanceled: $event => (_ctx.doEmitAction('actionCanceled',record)),
5009
5034
  "loading-message": act.label,
5010
5035
  class: vue.normalizeClass(act.class),
5011
- url: $options.replaceActionUrl(act.url,record)
5036
+ url: _ctx.replaceActionUrl(act.url,record)
5012
5037
  }, {
5013
5038
  default: vue.withCtx(() => [
5014
5039
  (act.icon)
@@ -5022,14 +5047,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5022
5047
  _: 2 /* DYNAMIC */
5023
5048
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onActionSuccessful", "onActionFailed", "onActionCanceled", "loading-message", "class", "url"]))
5024
5049
  : (['silentAction','silentaction','silent-action','silent'].includes(act.type))
5025
- ? (vue.openBlock(), vue.createBlock(_component_sh_silent_action, {
5050
+ ? (vue.openBlock(), vue.createBlock(script$d, {
5026
5051
  key: 1,
5027
- onActionSuccessful: $event => ($options.doEmitAction('actionSuccessful',record)),
5028
- onActionFailed: $event => ($options.doEmitAction('actionFailed',record)),
5029
- onActionCanceled: $event => ($options.doEmitAction('actionCanceled',record)),
5052
+ onActionSuccessful: $event => (_ctx.doEmitAction('actionSuccessful',record)),
5053
+ onActionFailed: $event => (_ctx.doEmitAction('actionFailed',record)),
5054
+ onActionCanceled: $event => (_ctx.doEmitAction('actionCanceled',record)),
5030
5055
  "loading-message": act.label,
5031
5056
  class: vue.normalizeClass(act.class),
5032
- url: $options.replaceActionUrl(act.url,record)
5057
+ url: _ctx.replaceActionUrl(act.url,record)
5033
5058
  }, {
5034
5059
  default: vue.withCtx(() => [
5035
5060
  (act.icon)
@@ -5056,13 +5081,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5056
5081
  }, null, 2 /* CLASS */))
5057
5082
  : vue.createCommentVNode("v-if", true),
5058
5083
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
5059
- ], 10 /* CLASS, PROPS */, _hoisted_46))
5084
+ ], 10 /* CLASS, PROPS */, _hoisted_45))
5060
5085
  : (act.emits)
5061
5086
  ? (vue.openBlock(), vue.createElementBlock("button", {
5062
5087
  key: 3,
5063
5088
  title: act.title,
5064
5089
  class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
5065
- onClick: $event => ($options.doEmitAction(act.emits,record))
5090
+ onClick: $event => (_ctx.doEmitAction(act.emits,record))
5066
5091
  }, [
5067
5092
  (act.icon)
5068
5093
  ? (vue.openBlock(), vue.createElementBlock("span", {
@@ -5071,12 +5096,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5071
5096
  }, null, 2 /* CLASS */))
5072
5097
  : vue.createCommentVNode("v-if", true),
5073
5098
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
5074
- ], 10 /* CLASS, PROPS */, _hoisted_47))
5099
+ ], 10 /* CLASS, PROPS */, _hoisted_46))
5075
5100
  : (!act.emits)
5076
5101
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5077
5102
  key: 4,
5078
5103
  title: act.title,
5079
- to: $options.replaceActionUrl(act.path,record),
5104
+ to: _ctx.replaceActionUrl(act.path,record),
5080
5105
  class: vue.normalizeClass(act.class)
5081
5106
  }, {
5082
5107
  default: vue.withCtx(() => [
@@ -5099,74 +5124,74 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5099
5124
  }), 128 /* KEYED_FRAGMENT */))
5100
5125
  ]))
5101
5126
  : vue.createCommentVNode("v-if", true)
5102
- ], 10 /* CLASS, PROPS */, _hoisted_38))
5127
+ ], 10 /* CLASS, PROPS */, _hoisted_37))
5103
5128
  }), 128 /* KEYED_FRAGMENT */))
5104
5129
  : vue.createCommentVNode("v-if", true)
5105
5130
  ])
5106
5131
  ], 2 /* CLASS */))
5107
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_48, [
5108
- ($data.loading === 'loading')
5109
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_49, _hoisted_51))
5110
- : ($data.loading === 'error')
5111
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_52, [
5112
- vue.createElementVNode("span", null, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
5132
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_47, [
5133
+ (_ctx.loading === 'loading')
5134
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_48, _hoisted_50))
5135
+ : (_ctx.loading === 'error')
5136
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_51, [
5137
+ vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
5113
5138
  ]))
5114
- : ($data.loading === 'done')
5115
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_53, [
5116
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.records, (record, index) => {
5139
+ : (_ctx.loading === 'done')
5140
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_52, [
5141
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.records, (record, index) => {
5117
5142
  return (vue.openBlock(), vue.createElementBlock("div", {
5118
5143
  key: record.id,
5119
5144
  class: "single-mobile-req bg-light p-3",
5120
- onClick: $event => ($options.rowSelected(record))
5145
+ onClick: $event => (_ctx.rowSelected(record))
5121
5146
  }, [
5122
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableHeaders, (key) => {
5147
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (key) => {
5123
5148
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5124
5149
  key: key[0]
5125
5150
  }, [
5126
5151
  (typeof key === 'string' )
5127
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_55, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
5152
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_54, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
5128
5153
  : (typeof key === 'function')
5129
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_56, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
5130
- : (vue.openBlock(), vue.createElementBlock("p", _hoisted_57, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
5154
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_55, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
5155
+ : (vue.openBlock(), vue.createElementBlock("p", _hoisted_56, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
5131
5156
  vue.createElementVNode("span", null, [
5132
- (typeof key === 'string' && $props.links && $props.links[key])
5157
+ (typeof key === 'string' && __props.links && __props.links[key])
5133
5158
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5134
5159
  key: 0,
5135
- to: $options.replaceLinkUrl($props.links[key],record),
5136
- class: vue.normalizeClass($options.getLinkClass($props.links[key])),
5160
+ to: _ctx.replaceLinkUrl(__props.links[key],record),
5161
+ class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5137
5162
  innerHTML: record[key]
5138
5163
  }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
5139
- : ($options.getFieldType(key) === 'numeric')
5140
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_58, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5141
- : ($options.getFieldType(key) === 'money')
5142
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_59, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5143
- : ($options.getFieldType(key) === 'date')
5144
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_60, vue.toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
5164
+ : (_ctx.getFieldType(key) === 'numeric')
5165
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_57, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5166
+ : (_ctx.getFieldType(key) === 'money')
5167
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_58, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5168
+ : (_ctx.getFieldType(key) === 'date')
5169
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_59, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5145
5170
  : (typeof key === 'string')
5146
5171
  ? (vue.openBlock(), vue.createElementBlock("span", {
5147
5172
  key: 4,
5148
5173
  innerHTML: record[key]
5149
- }, null, 8 /* PROPS */, _hoisted_61))
5174
+ }, null, 8 /* PROPS */, _hoisted_60))
5150
5175
  : (typeof key === 'function')
5151
5176
  ? (vue.openBlock(), vue.createElementBlock("span", {
5152
5177
  key: 5,
5153
5178
  innerHTML: key(record, index )
5154
- }, null, 8 /* PROPS */, _hoisted_62))
5179
+ }, null, 8 /* PROPS */, _hoisted_61))
5155
5180
  : (vue.openBlock(), vue.createElementBlock("span", {
5156
5181
  key: 6,
5157
5182
  innerHTML: record[key[0]]
5158
- }, null, 8 /* PROPS */, _hoisted_63))
5183
+ }, null, 8 /* PROPS */, _hoisted_62))
5159
5184
  ]),
5160
- _hoisted_64
5185
+ _hoisted_63
5161
5186
  ], 64 /* STABLE_FRAGMENT */))
5162
5187
  }), 128 /* KEYED_FRAGMENT */)),
5163
- ($props.actions)
5164
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_65, [
5165
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
5188
+ (__props.actions)
5189
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_64, [
5190
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions.actions, (act) => {
5166
5191
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5167
5192
  key: act.path
5168
5193
  }, [
5169
- (!act.permission || $options.user.isAllowedTo(act.permission))
5194
+ (!act.permission || _ctx.user.isAllowedTo(act.permission))
5170
5195
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
5171
5196
  (!act.validator || act.validator(record))
5172
5197
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
@@ -5184,13 +5209,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5184
5209
  }, null, 2 /* CLASS */))
5185
5210
  : vue.createCommentVNode("v-if", true),
5186
5211
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
5187
- ], 10 /* CLASS, PROPS */, _hoisted_66))
5212
+ ], 10 /* CLASS, PROPS */, _hoisted_65))
5188
5213
  : (act.emits)
5189
5214
  ? (vue.openBlock(), vue.createElementBlock("button", {
5190
5215
  key: 1,
5191
5216
  title: act.title,
5192
5217
  class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
5193
- onClick: $event => ($options.doEmitAction(act.emits,record))
5218
+ onClick: $event => (_ctx.doEmitAction(act.emits,record))
5194
5219
  }, [
5195
5220
  (act.icon)
5196
5221
  ? (vue.openBlock(), vue.createElementBlock("span", {
@@ -5199,12 +5224,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5199
5224
  }, null, 2 /* CLASS */))
5200
5225
  : vue.createCommentVNode("v-if", true),
5201
5226
  vue.createTextVNode(" " + vue.toDisplayString(act.label), 1 /* TEXT */)
5202
- ], 10 /* CLASS, PROPS */, _hoisted_67))
5227
+ ], 10 /* CLASS, PROPS */, _hoisted_66))
5203
5228
  : (!act.emits)
5204
5229
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5205
5230
  key: 2,
5206
5231
  title: act.title,
5207
- to: $options.replaceActionUrl(act.path,record),
5232
+ to: _ctx.replaceActionUrl(act.path,record),
5208
5233
  class: vue.normalizeClass(act.class)
5209
5234
  }, {
5210
5235
  default: vue.withCtx(() => [
@@ -5227,42 +5252,42 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5227
5252
  }), 128 /* KEYED_FRAGMENT */))
5228
5253
  ]))
5229
5254
  : vue.createCommentVNode("v-if", true)
5230
- ], 8 /* PROPS */, _hoisted_54))
5255
+ ], 8 /* PROPS */, _hoisted_53))
5231
5256
  }), 128 /* KEYED_FRAGMENT */))
5232
5257
  ]))
5233
5258
  : vue.createCommentVNode("v-if", true)
5234
5259
  ])),
5235
- ($data.pagination_data)
5236
- ? (vue.openBlock(), vue.createBlock(_component_pagination, {
5260
+ (_ctx.pagination_data)
5261
+ ? (vue.openBlock(), vue.createBlock(script$f, {
5237
5262
  key: 6,
5238
- onLoadMoreRecords: $options.loadMoreRecords,
5239
- "hide-load-more": $props.hideLoadMore,
5240
- "hide-count": $props.hideCount,
5241
- pagination_data: $data.pagination_data,
5242
- onChangeKey: $options.changeKey,
5243
- "pagination-style": $data.pageStyle
5263
+ onLoadMoreRecords: _ctx.loadMoreRecords,
5264
+ "hide-load-more": __props.hideLoadMore,
5265
+ "hide-count": __props.hideCount,
5266
+ pagination_data: _ctx.pagination_data,
5267
+ onChangeKey: _ctx.changeKey,
5268
+ "pagination-style": _ctx.pageStyle
5244
5269
  }, null, 8 /* PROPS */, ["onLoadMoreRecords", "hide-load-more", "hide-count", "pagination_data", "onChangeKey", "pagination-style"]))
5245
5270
  : vue.createCommentVNode("v-if", true),
5246
- ($props.actions)
5247
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 7 }, vue.renderList($props.actions.actions, (action) => {
5271
+ (__props.actions)
5272
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 7 }, vue.renderList(__props.actions.actions, (action) => {
5248
5273
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5249
5274
  key: action.label
5250
5275
  }, [
5251
5276
  (action.canvasId)
5252
- ? (vue.openBlock(), vue.createBlock(_component_sh_canvas, {
5277
+ ? (vue.openBlock(), vue.createBlock(script$h, {
5253
5278
  key: 0,
5254
- onOffcanvasClosed: $options.canvasClosed,
5279
+ onOffcanvasClosed: _ctx.canvasClosed,
5255
5280
  position: action.canvasPosition,
5256
5281
  "canvas-size": action.canvasSize,
5257
5282
  "canvas-title": action.canvasTitle,
5258
5283
  "canvas-id": action.canvasId
5259
5284
  }, {
5260
5285
  default: vue.withCtx(() => [
5261
- ($data.selectedRecord)
5286
+ (_ctx.selectedRecord)
5262
5287
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(action.canvasComponent), vue.mergeProps({
5263
5288
  key: 0,
5264
- onRecordUpdated: $options.reloadData
5265
- }, $options.cleanCanvasProps(action), { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["onRecordUpdated", "record"]))
5289
+ onRecordUpdated: _ctx.reloadData
5290
+ }, _ctx.cleanCanvasProps(action), { record: _ctx.selectedRecord }), null, 16 /* FULL_PROPS */, ["onRecordUpdated", "record"]))
5266
5291
  : vue.createCommentVNode("v-if", true)
5267
5292
  ]),
5268
5293
  _: 2 /* DYNAMIC */
@@ -5273,8 +5298,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5273
5298
  : vue.createCommentVNode("v-if", true)
5274
5299
  ]))
5275
5300
  }
5301
+ }
5302
+
5303
+ });
5276
5304
 
5277
- script$b.render = render;
5278
5305
  script$b.__file = "src/lib/components/ShTable.vue";
5279
5306
 
5280
5307
  var script$a = {
@@ -5957,7 +5984,7 @@ return (_ctx, _cache) => {
5957
5984
  class: "d-none"
5958
5985
  }, "Open Modal", 8 /* PROPS */, _hoisted_1$3),
5959
5986
  (popUp.value === 'modal')
5960
- ? (vue.openBlock(), vue.createBlock(script$j, {
5987
+ ? (vue.openBlock(), vue.createBlock(script$k, {
5961
5988
  key: 0,
5962
5989
  "modal-title": title.value,
5963
5990
  "modal-id": vue.unref(modalId),
@@ -5972,7 +5999,7 @@ return (_ctx, _cache) => {
5972
5999
  }, 8 /* PROPS */, ["modal-title", "modal-id", "modal-size"]))
5973
6000
  : vue.createCommentVNode("v-if", true),
5974
6001
  (['offcanvas','canvas','offCanvas'].includes(popUp.value))
5975
- ? (vue.openBlock(), vue.createBlock(script$g, {
6002
+ ? (vue.openBlock(), vue.createBlock(script$h, {
5976
6003
  key: 1,
5977
6004
  "canvas-id": vue.unref(canvasId),
5978
6005
  "canvas-title": title.value,
@@ -6003,7 +6030,7 @@ const fields = route.query.fields.split(',');
6003
6030
  const action = route.query.action;
6004
6031
 
6005
6032
  return (_ctx, _cache) => {
6006
- return (vue.openBlock(), vue.createBlock(script$l, {
6033
+ return (vue.openBlock(), vue.createBlock(script$m, {
6007
6034
  fields: vue.unref(fields),
6008
6035
  action: vue.unref(action)
6009
6036
  }, null, 8 /* PROPS */, ["fields", "action"]))
@@ -6104,7 +6131,7 @@ const goBack = () => {
6104
6131
  return (_ctx, _cache) => {
6105
6132
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
6106
6133
  (popUp.value === 'modal')
6107
- ? (vue.openBlock(), vue.createBlock(script$j, {
6134
+ ? (vue.openBlock(), vue.createBlock(script$k, {
6108
6135
  key: 0,
6109
6136
  "modal-title": title.value,
6110
6137
  "data-bs-backdrop": "static",
@@ -6119,7 +6146,7 @@ return (_ctx, _cache) => {
6119
6146
  }, 8 /* PROPS */, ["modal-title", "modal-id", "modal-size"]))
6120
6147
  : vue.createCommentVNode("v-if", true),
6121
6148
  (['offcanvas','canvas','offCanvas'].includes(popUp.value))
6122
- ? (vue.openBlock(), vue.createBlock(script$g, {
6149
+ ? (vue.openBlock(), vue.createBlock(script$h, {
6123
6150
  "canvas-title": title.value,
6124
6151
  key: size.value + position.value,
6125
6152
  "canvas-id": vue.unref(canvasId),
@@ -6224,12 +6251,12 @@ return (_ctx, _cache) => {
6224
6251
  ]
6225
6252
  }
6226
6253
  }, null, 8 /* PROPS */, ["reload", "actions"]),
6227
- vue.createVNode(script$j, {
6254
+ vue.createVNode(script$k, {
6228
6255
  "modal-id": "sh_department_modal",
6229
6256
  "modal-title": "Department Form"
6230
6257
  }, {
6231
6258
  default: vue.withCtx(() => [
6232
- vue.createVNode(script$s, {
6259
+ vue.createVNode(script$t, {
6233
6260
  "success-callback": "departmentAdded",
6234
6261
  "current-data": department.value,
6235
6262
  onDepartmentAdded: departmentAdded,
@@ -6384,12 +6411,12 @@ return (_ctx, _cache) => {
6384
6411
  headers: ['id',showModule,'created_at'],
6385
6412
  "end-point": 'admin/departments/department/list-modules/' + id.value
6386
6413
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
6387
- vue.createVNode(script$j, {
6414
+ vue.createVNode(script$k, {
6388
6415
  "modal-id": "addModule",
6389
6416
  "modal-title": "Add Module Department"
6390
6417
  }, {
6391
6418
  default: vue.withCtx(() => [
6392
- vue.createVNode(script$s, {
6419
+ vue.createVNode(script$t, {
6393
6420
  "reload-select-items": vue.unref(reload),
6394
6421
  "success-callback": moduleAdded,
6395
6422
  "fill-selects": {
@@ -6411,7 +6438,7 @@ return (_ctx, _cache) => {
6411
6438
  ref: permissionCanvasBtn,
6412
6439
  "data-bs-toggle": "offcanvas"
6413
6440
  }, null, 512 /* NEED_PATCH */),
6414
- vue.createVNode(script$g, {
6441
+ vue.createVNode(script$h, {
6415
6442
  "canvas-id": "permissionsCanvas",
6416
6443
  position: "end enlarged",
6417
6444
  "canvas-title": "Module Permissions"
@@ -6526,7 +6553,7 @@ return (_ctx, _cache) => {
6526
6553
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
6527
6554
  (section.value === 'login')
6528
6555
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
6529
- vue.createVNode(script$s, {
6556
+ vue.createVNode(script$t, {
6530
6557
  class: "sh-login-form",
6531
6558
  fields: ['email','password'],
6532
6559
  "action-label": "Login",
@@ -6551,7 +6578,7 @@ return (_ctx, _cache) => {
6551
6578
  (vue.unref(registerSubTitle))
6552
6579
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, vue.toDisplayString(vue.unref(registerSubTitle)), 1 /* TEXT */))
6553
6580
  : vue.createCommentVNode("v-if", true),
6554
- vue.createVNode(script$s, {
6581
+ vue.createVNode(script$t, {
6555
6582
  class: "sh-login-form",
6556
6583
  fields: vue.unref(registrationFields),
6557
6584
  "action-label": "Sign Up",
@@ -6598,10 +6625,11 @@ const ShFrontend = {
6598
6625
  const registerTitle = options.registerTitle ?? 'Create a new account';
6599
6626
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
6600
6627
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
6601
- options.formTextInput ?? script$p;
6628
+ options.formTextInput ?? script$q;
6602
6629
  const loginUrl = options.loginUrl ?? `/login`;
6603
6630
  const redirectLogin = options.redirectLogin ?? `/`;
6604
6631
  const redirectRegister = options.redirectRegister ?? `/`;
6632
+ const noRecordsComponent = options.noRecordsComponent ?? script$g;
6605
6633
  const registrationFields = options.registrationFields ?? ['name','email','phone','password','password_confirmation'];
6606
6634
  const AuthComponent = options.authComponent ?? script;
6607
6635
  app.provide('loginEndpoint',loginEndpoint);
@@ -6615,6 +6643,7 @@ const ShFrontend = {
6615
6643
  app.provide('formComponents', options.shFormComponents ?? {});
6616
6644
  app.provide('loginUrl', loginUrl);
6617
6645
  app.provide('shFormElementClasses',defaultFormElementClasses);
6646
+ app.provide('noRecordsComponent',noRecordsComponent);
6618
6647
  window.swalPosition = swalPosition;
6619
6648
  if(options.router) {
6620
6649
  options.router.addRoute({
@@ -6658,24 +6687,24 @@ var shGql = {
6658
6687
 
6659
6688
  exports.Countries = countries;
6660
6689
  exports.ManagePermissions = script$6;
6661
- exports.ShAutoForm = script$l;
6662
- exports.ShCanvas = script$g;
6690
+ exports.ShAutoForm = script$m;
6691
+ exports.ShCanvas = script$h;
6663
6692
  exports.ShCanvasBtn = script$7;
6664
6693
  exports.ShConfirmAction = script$e;
6665
- exports.ShDropDownForm = script$k;
6694
+ exports.ShDropDownForm = script$l;
6666
6695
  exports.ShDynamicTabs = script$9;
6667
- exports.ShForm = script$s;
6696
+ exports.ShForm = script$t;
6668
6697
  exports.ShFrontend = ShFrontend;
6669
- exports.ShModal = script$j;
6698
+ exports.ShModal = script$k;
6670
6699
  exports.ShModalBtn = script$8;
6671
- exports.ShModalForm = script$i;
6672
- exports.ShModalFormAuto = script$h;
6673
- exports.ShPhone = script$u;
6700
+ exports.ShModalForm = script$j;
6701
+ exports.ShModalFormAuto = script$i;
6702
+ exports.ShPhone = script$v;
6674
6703
  exports.ShQueryPopups = script$3;
6675
6704
  exports.ShRange = script$c;
6676
6705
  exports.ShRoutePopups = script$5;
6677
6706
  exports.ShSilentAction = script$d;
6678
- exports.ShSuggest = script$t;
6707
+ exports.ShSuggest = script$u;
6679
6708
  exports.ShTable = script$b;
6680
6709
  exports.ShTabs = script$a;
6681
6710
  exports.shApis = shApis;