@iankibetsh/shframework 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import Axios from 'axios';
2
2
  import NProgress from 'nprogress';
3
- import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, pushScopeId, popScopeId, createVNode } from 'vue';
3
+ import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, createVNode } from 'vue';
4
4
  import moment from 'moment';
5
5
  import Swal from 'sweetalert2';
6
6
  import { defineStore } from 'pinia';
@@ -2144,7 +2144,7 @@ script$5.__file = "src/views/ShForm.vue";
2144
2144
 
2145
2145
  var script$4 = {
2146
2146
  name: 'ShCanvas',
2147
- props: ['canvas_title', 'canvas_id', 'position'],
2147
+ props: ['canvasTitle', 'canvasId', 'position'],
2148
2148
  components: {
2149
2149
  },
2150
2150
  data () {
@@ -2172,11 +2172,11 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2172
2172
  class: normalizeClass(["offcanvas", $data.side]),
2173
2173
  "data-bs-scroll": "true",
2174
2174
  tabindex: "-1",
2175
- id: $props.canvas_id,
2175
+ id: $props.canvasId,
2176
2176
  "aria-labelledby": "offcanvasScrollingLabel"
2177
2177
  }, [
2178
2178
  createElementVNode("div", _hoisted_2$4, [
2179
- createElementVNode("h5", _hoisted_3$4, toDisplayString($props.canvas_title), 1 /* TEXT */),
2179
+ createElementVNode("h5", _hoisted_3$4, toDisplayString($props.canvasTitle), 1 /* TEXT */),
2180
2180
  createElementVNode("button", {
2181
2181
  type: "button",
2182
2182
  ref: "closecanvas",
@@ -2197,9 +2197,8 @@ script$4.__file = "src/views/ShCanvas.vue";
2197
2197
 
2198
2198
  var script$3 = {
2199
2199
  name: 'ShModal',
2200
- props: ['modal_title', 'modal_id', 'modal_size'],
2200
+ props: ['modalTitle', 'modalId', 'modalSize'],
2201
2201
  components: {
2202
-
2203
2202
  }
2204
2203
  };
2205
2204
 
@@ -2219,16 +2218,16 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2219
2218
  return (openBlock(), createElementBlock("div", {
2220
2219
  class: "modal fade",
2221
2220
  tabindex: "-1",
2222
- id: $props.modal_id,
2221
+ id: $props.modalId,
2223
2222
  "data-focus": "false",
2224
2223
  "aria-hidden": "true"
2225
2224
  }, [
2226
2225
  createElementVNode("div", {
2227
- class: normalizeClass(["modal-dialog", `modal-${$props.modal_size}`])
2226
+ class: normalizeClass(["modal-dialog", `modal-${$props.modalSize}`])
2228
2227
  }, [
2229
2228
  createElementVNode("div", _hoisted_2$3, [
2230
2229
  createElementVNode("div", _hoisted_3$3, [
2231
- createElementVNode("h3", _hoisted_4$2, toDisplayString($props.modal_title), 1 /* TEXT */),
2230
+ createElementVNode("h3", _hoisted_4$2, toDisplayString($props.modalTitle), 1 /* TEXT */),
2232
2231
  _hoisted_5$2
2233
2232
  ]),
2234
2233
  createElementVNode("div", _hoisted_6$1, [
@@ -2611,7 +2610,7 @@ var helpers = {
2611
2610
 
2612
2611
  var script$1 = {
2613
2612
  name: 'sh-table',
2614
- props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'mobile_view', 'hideSearch', 'custom_template', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields'],
2613
+ props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields'],
2615
2614
  inject: ['channel', 'global'],
2616
2615
  data () {
2617
2616
  return {
@@ -2814,31 +2813,32 @@ var script$1 = {
2814
2813
  windowWidth: function () {
2815
2814
  return window.innerWidth
2816
2815
  },
2816
+ user () {
2817
+ return null
2818
+ },
2817
2819
  hasDefaultSlot () {
2818
2820
  return !!this.$slots.default
2819
2821
  },
2820
- user () {
2821
- return this.global.state.user
2822
+ hasRecordsSlot () {
2823
+ return !!this.$slots.records
2822
2824
  }
2823
2825
  }
2824
2826
  };
2825
2827
 
2826
- const _withScopeId = n => (pushScopeId("data-v-a10546a2"),n=n(),popScopeId(),n);
2827
2828
  const _hoisted_1$1 = { class: "auto-table mt-2" };
2828
2829
  const _hoisted_2$1 = {
2829
2830
  key: 0,
2830
2831
  class: "col-md-4 mb-2"
2831
2832
  };
2832
2833
  const _hoisted_3$1 = ["disabled"];
2833
- const _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */));
2834
+ const _hoisted_4 = /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
2834
2835
  const _hoisted_5 = /*#__PURE__*/createTextVNode(" Export ");
2835
- const _hoisted_6 = {
2836
- key: 0,
2837
- style: {"height":"1rem"},
2838
- class: "float-start",
2839
- src: "/assets/img/spinner.gif"
2840
- };
2841
- const _hoisted_7 = /*#__PURE__*/createTextVNode(" Exporting ... ");
2836
+ const _hoisted_6 = /*#__PURE__*/createElementVNode("span", {
2837
+ class: "spinner-border spinner-border-sm",
2838
+ role: "status",
2839
+ "aria-hidden": "true"
2840
+ }, null, -1 /* HOISTED */);
2841
+ const _hoisted_7 = /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* HOISTED */);
2842
2842
  const _hoisted_8 = {
2843
2843
  key: 1,
2844
2844
  class: "row"
@@ -2846,101 +2846,136 @@ const _hoisted_8 = {
2846
2846
  const _hoisted_9 = { class: "col-12 mb-3" };
2847
2847
  const _hoisted_10 = { class: "sh-search-bar" };
2848
2848
  const _hoisted_11 = ["placeholder"];
2849
- const _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("span", { class: "sh-search-icon" }, [
2849
+ const _hoisted_12 = /*#__PURE__*/createElementVNode("span", { class: "sh-search-icon" }, [
2850
2850
  /*#__PURE__*/createElementVNode("i", { class: "bi bi-search mb-0" })
2851
- ], -1 /* HOISTED */));
2851
+ ], -1 /* HOISTED */);
2852
2852
  const _hoisted_13 = {
2853
- key: 2,
2853
+ key: 0,
2854
+ class: "text-center"
2855
+ };
2856
+ const _hoisted_14 = /*#__PURE__*/createElementVNode("span", { colspan: 2 }, [
2857
+ /*#__PURE__*/createElementVNode("img", { src: "/src/views/assets/images/loading.gif" })
2858
+ ], -1 /* HOISTED */);
2859
+ const _hoisted_15 = [
2860
+ _hoisted_14
2861
+ ];
2862
+ const _hoisted_16 = { key: 1 };
2863
+ const _hoisted_17 = { colspan: 2 };
2864
+ const _hoisted_18 = {
2865
+ key: 0,
2866
+ class: "text-center"
2867
+ };
2868
+ const _hoisted_19 = /*#__PURE__*/createElementVNode("span", { colspan: 2 }, [
2869
+ /*#__PURE__*/createElementVNode("img", { src: "/src/views/assets/images/loading.gif" })
2870
+ ], -1 /* HOISTED */);
2871
+ const _hoisted_20 = [
2872
+ _hoisted_19
2873
+ ];
2874
+ const _hoisted_21 = { key: 1 };
2875
+ const _hoisted_22 = { colspan: 2 };
2876
+ const _hoisted_23 = {
2877
+ key: 4,
2854
2878
  class: "table"
2855
2879
  };
2856
- const _hoisted_14 = ["onClick"];
2857
- const _hoisted_15 = ["onClick"];
2858
- const _hoisted_16 = ["onClick"];
2859
- const _hoisted_17 = {
2880
+ const _hoisted_24 = ["onClick"];
2881
+ const _hoisted_25 = ["onClick"];
2882
+ const _hoisted_26 = ["onClick"];
2883
+ const _hoisted_27 = {
2860
2884
  key: 0,
2861
2885
  class: "text-capitalize"
2862
2886
  };
2863
- const _hoisted_18 = {
2887
+ const _hoisted_28 = {
2864
2888
  key: 0,
2865
2889
  class: "text-center"
2866
2890
  };
2867
- const _hoisted_19 = ["colspan"];
2868
- const _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("img", { src: "/assets/img/loading.gif" }, null, -1 /* HOISTED */));
2869
- const _hoisted_21 = [
2870
- _hoisted_20
2891
+ const _hoisted_29 = ["colspan"];
2892
+ const _hoisted_30 = /*#__PURE__*/createElementVNode("div", { class: "text-center" }, [
2893
+ /*#__PURE__*/createElementVNode("div", {
2894
+ class: "spinner-border",
2895
+ role: "status"
2896
+ }, [
2897
+ /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
2898
+ ])
2899
+ ], -1 /* HOISTED */);
2900
+ const _hoisted_31 = [
2901
+ _hoisted_30
2871
2902
  ];
2872
- const _hoisted_22 = {
2903
+ const _hoisted_32 = {
2873
2904
  key: 1,
2874
2905
  class: "text-center alert alert-danger"
2875
2906
  };
2876
- const _hoisted_23 = ["colspan"];
2877
- const _hoisted_24 = {
2907
+ const _hoisted_33 = ["colspan"];
2908
+ const _hoisted_34 = {
2878
2909
  key: 2,
2879
2910
  class: "text-center alert alert-info no_records"
2880
2911
  };
2881
- const _hoisted_25 = ["colspan"];
2882
- const _hoisted_26 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */));
2883
- const _hoisted_27 = /*#__PURE__*/createTextVNode(" No records found ");
2884
- const _hoisted_28 = [
2885
- _hoisted_26,
2886
- _hoisted_27
2912
+ const _hoisted_35 = ["colspan"];
2913
+ const _hoisted_36 = /*#__PURE__*/createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
2914
+ const _hoisted_37 = /*#__PURE__*/createTextVNode(" No records found ");
2915
+ const _hoisted_38 = [
2916
+ _hoisted_36,
2917
+ _hoisted_37
2887
2918
  ];
2888
- const _hoisted_29 = ["onClick"];
2889
- const _hoisted_30 = { key: 1 };
2890
- const _hoisted_31 = {
2919
+ const _hoisted_39 = ["onClick"];
2920
+ const _hoisted_40 = { key: 1 };
2921
+ const _hoisted_41 = {
2891
2922
  key: 2,
2892
2923
  class: "text-success fw-bold"
2893
2924
  };
2894
- const _hoisted_32 = { key: 3 };
2895
- const _hoisted_33 = ["innerHTML"];
2896
- const _hoisted_34 = ["innerHTML"];
2897
- const _hoisted_35 = ["innerHTML"];
2898
- const _hoisted_36 = {
2925
+ const _hoisted_42 = { key: 3 };
2926
+ const _hoisted_43 = ["innerHTML"];
2927
+ const _hoisted_44 = ["innerHTML"];
2928
+ const _hoisted_45 = ["innerHTML"];
2929
+ const _hoisted_46 = {
2899
2930
  key: 0,
2900
2931
  style: {"white-space":"nowrap"}
2901
2932
  };
2902
- const _hoisted_37 = ["title", "onClick"];
2903
- const _hoisted_38 = { key: 3 };
2904
- const _hoisted_39 = {
2933
+ const _hoisted_47 = ["title", "onClick"];
2934
+ const _hoisted_48 = { key: 5 };
2935
+ const _hoisted_49 = {
2905
2936
  key: 0,
2906
2937
  class: "text-center"
2907
2938
  };
2908
- const _hoisted_40 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("span", { colspan: 2 }, [
2909
- /*#__PURE__*/createElementVNode("img", { src: "/assets/img/loading.gif" })
2910
- ], -1 /* HOISTED */));
2911
- const _hoisted_41 = [
2912
- _hoisted_40
2939
+ const _hoisted_50 = /*#__PURE__*/createElementVNode("div", { class: "text-center" }, [
2940
+ /*#__PURE__*/createElementVNode("div", {
2941
+ class: "spinner-border",
2942
+ role: "status"
2943
+ }, [
2944
+ /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
2945
+ ])
2946
+ ], -1 /* HOISTED */);
2947
+ const _hoisted_51 = [
2948
+ _hoisted_50
2913
2949
  ];
2914
- const _hoisted_42 = { key: 1 };
2915
- const _hoisted_43 = { colspan: 2 };
2916
- const _hoisted_44 = {
2950
+ const _hoisted_52 = { key: 1 };
2951
+ const _hoisted_53 = {
2917
2952
  key: 2,
2918
2953
  class: "mobile-list-items"
2919
2954
  };
2920
- const _hoisted_45 = ["onClick"];
2921
- const _hoisted_46 = {
2955
+ const _hoisted_54 = ["onClick"];
2956
+ const _hoisted_55 = {
2922
2957
  key: 0,
2923
2958
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2924
2959
  };
2925
- const _hoisted_47 = {
2960
+ const _hoisted_56 = {
2926
2961
  key: 1,
2927
2962
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2928
2963
  };
2929
- const _hoisted_48 = {
2964
+ const _hoisted_57 = {
2930
2965
  key: 2,
2931
2966
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2932
2967
  };
2933
- const _hoisted_49 = { key: 1 };
2934
- const _hoisted_50 = {
2968
+ const _hoisted_58 = { key: 1 };
2969
+ const _hoisted_59 = {
2935
2970
  key: 2,
2936
2971
  class: "text-primary fw-bold"
2937
2972
  };
2938
- const _hoisted_51 = ["innerHTML"];
2939
- const _hoisted_52 = ["innerHTML"];
2940
- const _hoisted_53 = ["innerHTML"];
2941
- const _hoisted_54 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */));
2942
- const _hoisted_55 = { key: 0 };
2943
- const _hoisted_56 = ["title", "onClick"];
2973
+ const _hoisted_60 = ["innerHTML"];
2974
+ const _hoisted_61 = ["innerHTML"];
2975
+ const _hoisted_62 = ["innerHTML"];
2976
+ const _hoisted_63 = /*#__PURE__*/createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */);
2977
+ const _hoisted_64 = { key: 0 };
2978
+ const _hoisted_65 = ["title", "onClick"];
2944
2979
 
2945
2980
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
2946
2981
  const _component_router_link = resolveComponent("router-link");
@@ -2960,9 +2995,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
2960
2995
  _hoisted_5
2961
2996
  ], 64 /* STABLE_FRAGMENT */))
2962
2997
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2963
- ($data.downloading)
2964
- ? (openBlock(), createElementBlock("img", _hoisted_6))
2965
- : createCommentVNode("v-if", true),
2998
+ _hoisted_6,
2966
2999
  _hoisted_7
2967
3000
  ], 64 /* STABLE_FRAGMENT */))
2968
3001
  ], 8 /* PROPS */, _hoisted_3$1)
@@ -2986,169 +3019,103 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
2986
3019
  ])
2987
3020
  ]))
2988
3021
  : createCommentVNode("v-if", true),
2989
- ($options.windowWidth > 700)
2990
- ? (openBlock(), createElementBlock("table", _hoisted_13, [
2991
- createElementVNode("thead", null, [
2992
- createElementVNode("tr", null, [
2993
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (title) => {
2994
- return (openBlock(), createElementBlock("th", {
2995
- key: title[0]
2996
- }, [
2997
- (typeof title === 'string')
2998
- ? (openBlock(), createElementBlock("a", {
2999
- key: 0,
3000
- class: "text-capitalize",
3001
- onClick: $event => ($options.changeKey('order_by',title))
3002
- }, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_14))
3003
- : (typeof title === 'function')
3022
+ ($options.hasDefaultSlot)
3023
+ ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3024
+ ($data.loading === 'loading')
3025
+ ? (openBlock(), createElementBlock("div", _hoisted_13, _hoisted_15))
3026
+ : ($data.loading === 'error')
3027
+ ? (openBlock(), createElementBlock("div", _hoisted_16, [
3028
+ createElementVNode("span", _hoisted_17, toDisplayString($data.loading_error), 1 /* TEXT */)
3029
+ ]))
3030
+ : createCommentVNode("v-if", true),
3031
+ ($data.loading === 'done')
3032
+ ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList($data.records, (record) => {
3033
+ return renderSlot(_ctx.$slots, "default", {
3034
+ key: record.id,
3035
+ record: record
3036
+ })
3037
+ }), 128 /* KEYED_FRAGMENT */))
3038
+ : createCommentVNode("v-if", true)
3039
+ ], 64 /* STABLE_FRAGMENT */))
3040
+ : createCommentVNode("v-if", true),
3041
+ ($options.hasRecordsSlot)
3042
+ ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
3043
+ ($data.loading === 'loading')
3044
+ ? (openBlock(), createElementBlock("div", _hoisted_18, _hoisted_20))
3045
+ : ($data.loading === 'error')
3046
+ ? (openBlock(), createElementBlock("div", _hoisted_21, [
3047
+ createElementVNode("span", _hoisted_22, toDisplayString($data.loading_error), 1 /* TEXT */)
3048
+ ]))
3049
+ : createCommentVNode("v-if", true),
3050
+ ($data.loading === 'done')
3051
+ ? renderSlot(_ctx.$slots, "records", {
3052
+ key: 2,
3053
+ records: $data.records
3054
+ })
3055
+ : createCommentVNode("v-if", true)
3056
+ ], 64 /* STABLE_FRAGMENT */))
3057
+ : ($options.windowWidth > 700)
3058
+ ? (openBlock(), createElementBlock("table", _hoisted_23, [
3059
+ createElementVNode("thead", null, [
3060
+ createElementVNode("tr", null, [
3061
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (title) => {
3062
+ return (openBlock(), createElementBlock("th", {
3063
+ key: title[0]
3064
+ }, [
3065
+ (typeof title === 'string')
3004
3066
  ? (openBlock(), createElementBlock("a", {
3005
- key: 1,
3067
+ key: 0,
3006
3068
  class: "text-capitalize",
3007
3069
  onClick: $event => ($options.changeKey('order_by',title))
3008
- }, toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15))
3009
- : (openBlock(), createElementBlock("a", {
3010
- key: 2,
3011
- class: "text-capitalize",
3012
- onClick: $event => ($options.changeKey('order_by',title[0]))
3013
- }, toDisplayString(title[1].replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
3014
- ]))
3015
- }), 128 /* KEYED_FRAGMENT */)),
3016
- ($props.actions)
3017
- ? (openBlock(), createElementBlock("th", _hoisted_17, toDisplayString($props.actions.label), 1 /* TEXT */))
3018
- : createCommentVNode("v-if", true)
3019
- ])
3020
- ]),
3021
- createElementVNode("tbody", null, [
3022
- ($data.loading === 'loading')
3023
- ? (openBlock(), createElementBlock("tr", _hoisted_18, [
3024
- createElementVNode("td", {
3025
- colspan: $props.headers.length
3026
- }, _hoisted_21, 8 /* PROPS */, _hoisted_19)
3027
- ]))
3028
- : ($data.loading === 'error')
3029
- ? (openBlock(), createElementBlock("tr", _hoisted_22, [
3070
+ }, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_24))
3071
+ : (typeof title === 'function')
3072
+ ? (openBlock(), createElementBlock("a", {
3073
+ key: 1,
3074
+ class: "text-capitalize",
3075
+ onClick: $event => ($options.changeKey('order_by',title))
3076
+ }, toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_25))
3077
+ : (openBlock(), createElementBlock("a", {
3078
+ key: 2,
3079
+ class: "text-capitalize",
3080
+ onClick: $event => ($options.changeKey('order_by',title[0]))
3081
+ }, toDisplayString(title[1].replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_26))
3082
+ ]))
3083
+ }), 128 /* KEYED_FRAGMENT */)),
3084
+ ($props.actions)
3085
+ ? (openBlock(), createElementBlock("th", _hoisted_27, toDisplayString($props.actions.label), 1 /* TEXT */))
3086
+ : createCommentVNode("v-if", true)
3087
+ ])
3088
+ ]),
3089
+ createElementVNode("tbody", null, [
3090
+ ($data.loading === 'loading')
3091
+ ? (openBlock(), createElementBlock("tr", _hoisted_28, [
3030
3092
  createElementVNode("td", {
3031
3093
  colspan: $props.headers.length
3032
- }, toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_23)
3094
+ }, _hoisted_31, 8 /* PROPS */, _hoisted_29)
3033
3095
  ]))
3034
- : ($data.records.length === 0)
3035
- ? (openBlock(), createElementBlock("tr", _hoisted_24, [
3096
+ : ($data.loading === 'error')
3097
+ ? (openBlock(), createElementBlock("tr", _hoisted_32, [
3036
3098
  createElementVNode("td", {
3037
- colspan: $props.actions ? $props.headers.length + 1 : $props.headers.length
3038
- }, _hoisted_28, 8 /* PROPS */, _hoisted_25)
3099
+ colspan: $props.headers.length
3100
+ }, toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_33)
3039
3101
  ]))
3040
- : ($data.loading === 'done')
3041
- ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList($data.records, (record, index) => {
3042
- return (openBlock(), createElementBlock("tr", {
3043
- key: record.id,
3044
- class: normalizeClass(record.class),
3045
- onClick: $event => ($options.rowSelected(record))
3046
- }, [
3047
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (key) => {
3048
- return (openBlock(), createElementBlock("td", {
3049
- key: key[0]
3050
- }, [
3051
- (typeof key === 'string' && $props.links && $props.links[key])
3052
- ? (openBlock(), createBlock(_component_router_link, {
3053
- key: 0,
3054
- to: $options.replaceLinkUrl($props.links[key],record),
3055
- class: normalizeClass($options.getLinkClass($props.links[key])),
3056
- innerHTML: record[key]
3057
- }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3058
- : ($options.getFieldType(key) === 'numeric')
3059
- ? (openBlock(), createElementBlock("span", _hoisted_30, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3060
- : ($options.getFieldType(key) === 'money')
3061
- ? (openBlock(), createElementBlock("span", _hoisted_31, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3062
- : ($options.getFieldType(key) === 'date')
3063
- ? (openBlock(), createElementBlock("span", _hoisted_32, toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
3064
- : (typeof key === 'string')
3065
- ? (openBlock(), createElementBlock("span", {
3066
- key: 4,
3067
- innerHTML: record[key]
3068
- }, null, 8 /* PROPS */, _hoisted_33))
3069
- : (typeof key === 'function')
3070
- ? (openBlock(), createElementBlock("span", {
3071
- key: 5,
3072
- innerHTML: key(record, index)
3073
- }, null, 8 /* PROPS */, _hoisted_34))
3074
- : (openBlock(), createElementBlock("span", {
3075
- key: 6,
3076
- innerHTML: record[key[0]]
3077
- }, null, 8 /* PROPS */, _hoisted_35))
3078
- ]))
3079
- }), 128 /* KEYED_FRAGMENT */)),
3080
- ($props.actions)
3081
- ? (openBlock(), createElementBlock("td", _hoisted_36, [
3082
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.actions.actions, (act) => {
3083
- return (openBlock(), createElementBlock(Fragment, {
3084
- key: act.path
3085
- }, [
3086
- (!act.permission || $options.user.isAllowedTo(act.permission))
3087
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3088
- (!act.validator || act.validator(record))
3089
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3090
- (act.emits)
3091
- ? (openBlock(), createElementBlock("button", {
3092
- key: 0,
3093
- title: act.title,
3094
- class: normalizeClass(act.class ? act.class:'btn btn-default'),
3095
- onClick: $event => ($options.doEmitAction(act.emits,record))
3096
- }, toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_37))
3097
- : createCommentVNode("v-if", true),
3098
- (!act.emits)
3099
- ? (openBlock(), createBlock(_component_router_link, {
3100
- key: 1,
3101
- title: act.title,
3102
- to: $options.replaceActionUrl(act.path,record),
3103
- class: normalizeClass(act.class)
3104
- }, {
3105
- default: withCtx(() => [
3106
- createTextVNode(toDisplayString(act.label), 1 /* TEXT */)
3107
- ]),
3108
- _: 2 /* DYNAMIC */
3109
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3110
- : createCommentVNode("v-if", true)
3111
- ], 64 /* STABLE_FRAGMENT */))
3112
- : createCommentVNode("v-if", true)
3113
- ], 64 /* STABLE_FRAGMENT */))
3114
- : createCommentVNode("v-if", true)
3115
- ], 64 /* STABLE_FRAGMENT */))
3116
- }), 128 /* KEYED_FRAGMENT */))
3117
- ]))
3118
- : createCommentVNode("v-if", true)
3119
- ], 10 /* CLASS, PROPS */, _hoisted_29))
3120
- }), 128 /* KEYED_FRAGMENT */))
3121
- : createCommentVNode("v-if", true)
3122
- ])
3123
- ]))
3124
- : (openBlock(), createElementBlock("div", _hoisted_38, [
3125
- ($data.loading === 'loading')
3126
- ? (openBlock(), createElementBlock("div", _hoisted_39, _hoisted_41))
3127
- : ($data.loading === 'error')
3128
- ? (openBlock(), createElementBlock("div", _hoisted_42, [
3129
- createElementVNode("span", _hoisted_43, toDisplayString($data.loading_error), 1 /* TEXT */)
3130
- ]))
3131
- : ($data.loading === 'done')
3132
- ? (openBlock(), createElementBlock("div", _hoisted_44, [
3133
- (openBlock(true), createElementBlock(Fragment, null, renderList($data.records, (record, index) => {
3134
- return (openBlock(), createElementBlock(Fragment, {
3135
- key: record.id
3136
- }, [
3137
- createElementVNode("h3", null, toDisplayString($props.mobile_view), 1 /* TEXT */),
3138
- createElementVNode("div", {
3139
- class: "single-mobile-req bg-light p-3",
3140
- onClick: $event => ($options.rowSelected(record))
3141
- }, [
3142
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (key) => {
3143
- return (openBlock(), createElementBlock(Fragment, {
3144
- key: key[0]
3145
- }, [
3146
- (typeof key === 'string' )
3147
- ? (openBlock(), createElementBlock("p", _hoisted_46, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3148
- : (typeof key === 'function')
3149
- ? (openBlock(), createElementBlock("p", _hoisted_47, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3150
- : (openBlock(), createElementBlock("p", _hoisted_48, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3151
- createElementVNode("span", null, [
3102
+ : ($data.records.length === 0)
3103
+ ? (openBlock(), createElementBlock("tr", _hoisted_34, [
3104
+ createElementVNode("td", {
3105
+ colspan: $props.actions ? $props.headers.length + 1 : $props.headers.length
3106
+ }, _hoisted_38, 8 /* PROPS */, _hoisted_35)
3107
+ ]))
3108
+ : ($data.loading === 'done')
3109
+ ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList($data.records, (record, index) => {
3110
+ return (openBlock(), createElementBlock("tr", {
3111
+ key: record.id,
3112
+ class: normalizeClass(record.class),
3113
+ onClick: $event => ($options.rowSelected(record))
3114
+ }, [
3115
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (key) => {
3116
+ return (openBlock(), createElementBlock("td", {
3117
+ key: key[0]
3118
+ }, [
3152
3119
  (typeof key === 'string' && $props.links && $props.links[key])
3153
3120
  ? (openBlock(), createBlock(_component_router_link, {
3154
3121
  key: 0,
@@ -3157,75 +3124,176 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3157
3124
  innerHTML: record[key]
3158
3125
  }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3159
3126
  : ($options.getFieldType(key) === 'numeric')
3160
- ? (openBlock(), createElementBlock("span", _hoisted_49, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3127
+ ? (openBlock(), createElementBlock("span", _hoisted_40, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3161
3128
  : ($options.getFieldType(key) === 'money')
3162
- ? (openBlock(), createElementBlock("span", _hoisted_50, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3163
- : (typeof key === 'string')
3164
- ? (openBlock(), createElementBlock("span", {
3165
- key: 3,
3166
- innerHTML: record[key]
3167
- }, null, 8 /* PROPS */, _hoisted_51))
3168
- : (typeof key === 'function')
3129
+ ? (openBlock(), createElementBlock("span", _hoisted_41, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3130
+ : ($options.getFieldType(key) === 'date')
3131
+ ? (openBlock(), createElementBlock("span", _hoisted_42, toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
3132
+ : (typeof key === 'string')
3169
3133
  ? (openBlock(), createElementBlock("span", {
3170
3134
  key: 4,
3171
- innerHTML: key(record, index )
3172
- }, null, 8 /* PROPS */, _hoisted_52))
3173
- : (openBlock(), createElementBlock("span", {
3174
- key: 5,
3175
- innerHTML: record[key[0]]
3176
- }, null, 8 /* PROPS */, _hoisted_53))
3177
- ]),
3178
- _hoisted_54
3179
- ], 64 /* STABLE_FRAGMENT */))
3180
- }), 128 /* KEYED_FRAGMENT */)),
3181
- ($props.actions)
3182
- ? (openBlock(), createElementBlock("div", _hoisted_55, [
3183
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.actions.actions, (act) => {
3184
- return (openBlock(), createElementBlock(Fragment, {
3185
- key: act.path
3186
- }, [
3187
- (!act.permission || $options.user.isAllowedTo(act.permission))
3188
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3189
- (!act.validator || act.validator(record))
3190
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3191
- (act.emits)
3192
- ? (openBlock(), createElementBlock("button", {
3193
- key: 0,
3194
- title: act.title,
3195
- class: normalizeClass(act.class ? act.class:'btn btn-default'),
3196
- onClick: $event => ($options.doEmitAction(act.emits,record))
3197
- }, toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_56))
3198
- : createCommentVNode("v-if", true),
3199
- (!act.emits)
3200
- ? (openBlock(), createBlock(_component_router_link, {
3201
- key: 1,
3202
- title: act.title,
3203
- to: $options.replaceActionUrl(act.path,record),
3204
- class: normalizeClass(act.class)
3205
- }, {
3206
- default: withCtx(() => [
3207
- createTextVNode(toDisplayString(act.label), 1 /* TEXT */)
3208
- ]),
3209
- _: 2 /* DYNAMIC */
3210
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3211
- : createCommentVNode("v-if", true)
3212
- ], 64 /* STABLE_FRAGMENT */))
3213
- : createCommentVNode("v-if", true)
3214
- ], 64 /* STABLE_FRAGMENT */))
3215
- : createCommentVNode("v-if", true)
3216
- ], 64 /* STABLE_FRAGMENT */))
3217
- }), 128 /* KEYED_FRAGMENT */))
3135
+ innerHTML: record[key]
3136
+ }, null, 8 /* PROPS */, _hoisted_43))
3137
+ : (typeof key === 'function')
3138
+ ? (openBlock(), createElementBlock("span", {
3139
+ key: 5,
3140
+ innerHTML: key(record, index)
3141
+ }, null, 8 /* PROPS */, _hoisted_44))
3142
+ : (openBlock(), createElementBlock("span", {
3143
+ key: 6,
3144
+ innerHTML: record[key[0]]
3145
+ }, null, 8 /* PROPS */, _hoisted_45))
3218
3146
  ]))
3219
- : createCommentVNode("v-if", true)
3220
- ], 8 /* PROPS */, _hoisted_45)
3221
- ], 64 /* STABLE_FRAGMENT */))
3222
- }), 128 /* KEYED_FRAGMENT */))
3147
+ }), 128 /* KEYED_FRAGMENT */)),
3148
+ ($props.actions)
3149
+ ? (openBlock(), createElementBlock("td", _hoisted_46, [
3150
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.actions.actions, (act) => {
3151
+ return (openBlock(), createElementBlock(Fragment, {
3152
+ key: act.path
3153
+ }, [
3154
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3155
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3156
+ (!act.validator || act.validator(record))
3157
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3158
+ (act.emits)
3159
+ ? (openBlock(), createElementBlock("button", {
3160
+ key: 0,
3161
+ title: act.title,
3162
+ class: normalizeClass(act.class ? act.class:'btn btn-default'),
3163
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3164
+ }, toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_47))
3165
+ : createCommentVNode("v-if", true),
3166
+ (!act.emits)
3167
+ ? (openBlock(), createBlock(_component_router_link, {
3168
+ key: 1,
3169
+ title: act.title,
3170
+ to: $options.replaceActionUrl(act.path,record),
3171
+ class: normalizeClass(act.class)
3172
+ }, {
3173
+ default: withCtx(() => [
3174
+ createTextVNode(toDisplayString(act.label), 1 /* TEXT */)
3175
+ ]),
3176
+ _: 2 /* DYNAMIC */
3177
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3178
+ : createCommentVNode("v-if", true)
3179
+ ], 64 /* STABLE_FRAGMENT */))
3180
+ : createCommentVNode("v-if", true)
3181
+ ], 64 /* STABLE_FRAGMENT */))
3182
+ : createCommentVNode("v-if", true)
3183
+ ], 64 /* STABLE_FRAGMENT */))
3184
+ }), 128 /* KEYED_FRAGMENT */))
3185
+ ]))
3186
+ : createCommentVNode("v-if", true)
3187
+ ], 10 /* CLASS, PROPS */, _hoisted_39))
3188
+ }), 128 /* KEYED_FRAGMENT */))
3189
+ : createCommentVNode("v-if", true)
3190
+ ])
3191
+ ]))
3192
+ : (openBlock(), createElementBlock("div", _hoisted_48, [
3193
+ ($data.loading === 'loading')
3194
+ ? (openBlock(), createElementBlock("div", _hoisted_49, _hoisted_51))
3195
+ : ($data.loading === 'error')
3196
+ ? (openBlock(), createElementBlock("div", _hoisted_52, [
3197
+ createElementVNode("span", null, toDisplayString($data.loading_error), 1 /* TEXT */)
3223
3198
  ]))
3224
- : createCommentVNode("v-if", true)
3225
- ])),
3199
+ : ($data.loading === 'done')
3200
+ ? (openBlock(), createElementBlock("div", _hoisted_53, [
3201
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.records, (record, index) => {
3202
+ return (openBlock(), createElementBlock(Fragment, {
3203
+ key: record.id
3204
+ }, [
3205
+ createElementVNode("h3", null, toDisplayString(_ctx.mobile_view), 1 /* TEXT */),
3206
+ createElementVNode("div", {
3207
+ class: "single-mobile-req bg-light p-3",
3208
+ onClick: $event => ($options.rowSelected(record))
3209
+ }, [
3210
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.headers, (key) => {
3211
+ return (openBlock(), createElementBlock(Fragment, {
3212
+ key: key[0]
3213
+ }, [
3214
+ (typeof key === 'string' )
3215
+ ? (openBlock(), createElementBlock("p", _hoisted_55, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3216
+ : (typeof key === 'function')
3217
+ ? (openBlock(), createElementBlock("p", _hoisted_56, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3218
+ : (openBlock(), createElementBlock("p", _hoisted_57, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3219
+ createElementVNode("span", null, [
3220
+ (typeof key === 'string' && $props.links && $props.links[key])
3221
+ ? (openBlock(), createBlock(_component_router_link, {
3222
+ key: 0,
3223
+ to: $options.replaceLinkUrl($props.links[key],record),
3224
+ class: normalizeClass($options.getLinkClass($props.links[key])),
3225
+ innerHTML: record[key]
3226
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3227
+ : ($options.getFieldType(key) === 'numeric')
3228
+ ? (openBlock(), createElementBlock("span", _hoisted_58, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3229
+ : ($options.getFieldType(key) === 'money')
3230
+ ? (openBlock(), createElementBlock("span", _hoisted_59, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3231
+ : (typeof key === 'string')
3232
+ ? (openBlock(), createElementBlock("span", {
3233
+ key: 3,
3234
+ innerHTML: record[key]
3235
+ }, null, 8 /* PROPS */, _hoisted_60))
3236
+ : (typeof key === 'function')
3237
+ ? (openBlock(), createElementBlock("span", {
3238
+ key: 4,
3239
+ innerHTML: key(record, index )
3240
+ }, null, 8 /* PROPS */, _hoisted_61))
3241
+ : (openBlock(), createElementBlock("span", {
3242
+ key: 5,
3243
+ innerHTML: record[key[0]]
3244
+ }, null, 8 /* PROPS */, _hoisted_62))
3245
+ ]),
3246
+ _hoisted_63
3247
+ ], 64 /* STABLE_FRAGMENT */))
3248
+ }), 128 /* KEYED_FRAGMENT */)),
3249
+ ($props.actions)
3250
+ ? (openBlock(), createElementBlock("div", _hoisted_64, [
3251
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.actions.actions, (act) => {
3252
+ return (openBlock(), createElementBlock(Fragment, {
3253
+ key: act.path
3254
+ }, [
3255
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3256
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3257
+ (!act.validator || act.validator(record))
3258
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3259
+ (act.emits)
3260
+ ? (openBlock(), createElementBlock("button", {
3261
+ key: 0,
3262
+ title: act.title,
3263
+ class: normalizeClass(act.class ? act.class:'btn btn-default'),
3264
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3265
+ }, toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_65))
3266
+ : createCommentVNode("v-if", true),
3267
+ (!act.emits)
3268
+ ? (openBlock(), createBlock(_component_router_link, {
3269
+ key: 1,
3270
+ title: act.title,
3271
+ to: $options.replaceActionUrl(act.path,record),
3272
+ class: normalizeClass(act.class)
3273
+ }, {
3274
+ default: withCtx(() => [
3275
+ createTextVNode(toDisplayString(act.label), 1 /* TEXT */)
3276
+ ]),
3277
+ _: 2 /* DYNAMIC */
3278
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3279
+ : createCommentVNode("v-if", true)
3280
+ ], 64 /* STABLE_FRAGMENT */))
3281
+ : createCommentVNode("v-if", true)
3282
+ ], 64 /* STABLE_FRAGMENT */))
3283
+ : createCommentVNode("v-if", true)
3284
+ ], 64 /* STABLE_FRAGMENT */))
3285
+ }), 128 /* KEYED_FRAGMENT */))
3286
+ ]))
3287
+ : createCommentVNode("v-if", true)
3288
+ ], 8 /* PROPS */, _hoisted_54)
3289
+ ], 64 /* STABLE_FRAGMENT */))
3290
+ }), 128 /* KEYED_FRAGMENT */))
3291
+ ]))
3292
+ : createCommentVNode("v-if", true)
3293
+ ])),
3226
3294
  ($data.pagination_data)
3227
3295
  ? (openBlock(), createBlock(_component_pagination, {
3228
- key: 4,
3296
+ key: 6,
3229
3297
  onLoadMoreRecords: $options.loadMoreRecords,
3230
3298
  "hide-load-more": $props.hideLoadMore,
3231
3299
  "hide-count": $props.hideCount,
@@ -3238,7 +3306,6 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3238
3306
  }
3239
3307
 
3240
3308
  script$1.render = render$1;
3241
- script$1.__scopeId = "data-v-a10546a2";
3242
3309
  script$1.__file = "src/views/ShTable.vue";
3243
3310
 
3244
3311
  var script = {
@@ -3421,9 +3488,14 @@ const useUserStore = defineStore('user-store', {
3421
3488
  this.user = null;
3422
3489
  },
3423
3490
  logOut () {
3424
- shstorage.setItem('user',null);
3425
- shstorage.setItem('access_token',null);
3426
- this.user = null;
3491
+ this.signOut();
3492
+ },
3493
+ getUser () {
3494
+ this.setUser();
3495
+ },
3496
+ setAccessToken (accessToken) {
3497
+ shstorage.setItem('access_token', accessToken);
3498
+ this.setUser();
3427
3499
  }
3428
3500
  },
3429
3501
  getters: {