@iankibetsh/shframework 0.1.9 → 0.2.2

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.
Files changed (3) hide show
  1. package/dist/library.js +345 -271
  2. package/dist/library.mjs +345 -271
  3. package/package.json +1 -1
package/dist/library.js CHANGED
@@ -1655,7 +1655,7 @@ var script$5 = {
1655
1655
  components: {
1656
1656
  ShPhone: script$6
1657
1657
  },
1658
- props: ['action', 'classes', 'hasTerms', 'country_code', 'submit_btn_class', 'fields', 'columns', 'placeholders', 'field_permissions', 'retain_data_after_submission', 'current_data', 'action_label', 'fill_selects', 'phones', 'success_callback', 'failed_callback', 'labels'],
1658
+ props: ['action', 'classes', 'hasTerms', 'country_code', 'submit_btn_class', 'fields', 'columns', 'placeholders', 'field_permissions', 'retain_data_after_submission', 'current_data', 'action_label', 'fill_selects', 'phones', 'successCallback', 'failed_callback', 'labels'],
1659
1659
  data: function () {
1660
1660
  return {
1661
1661
  form_elements: {},
@@ -1824,11 +1824,11 @@ var script$5 = {
1824
1824
  Object.keys(this.form_files).forEach(key => {
1825
1825
  this.form_errors[key] = null;
1826
1826
  });
1827
- if (this.success_callback) {
1828
- if (typeof this.success_callback === 'function') {
1829
- this.success_callback(res.data);
1827
+ if (this.successCallback) {
1828
+ if (typeof this.successCallback === 'function') {
1829
+ this.successCallback(res.data);
1830
1830
  } else {
1831
- this.$emit(this.success_callback, res.data);
1831
+ this.$emit(this.successCallback, res.data);
1832
1832
  }
1833
1833
  }
1834
1834
  NProgress__default["default"].done();
@@ -2824,11 +2824,14 @@ var script$1 = {
2824
2824
  windowWidth: function () {
2825
2825
  return window.innerWidth
2826
2826
  },
2827
+ user () {
2828
+ return null
2829
+ },
2827
2830
  hasDefaultSlot () {
2828
2831
  return !!this.$slots.default
2829
2832
  },
2830
- user () {
2831
- return this.global.state.user
2833
+ hasRecordsSlot () {
2834
+ return !!this.$slots.records
2832
2835
  }
2833
2836
  }
2834
2837
  };
@@ -2858,22 +2861,58 @@ const _hoisted_12 = /*#__PURE__*/vue.createElementVNode("span", { class: "sh-sea
2858
2861
  /*#__PURE__*/vue.createElementVNode("i", { class: "bi bi-search mb-0" })
2859
2862
  ], -1 /* HOISTED */);
2860
2863
  const _hoisted_13 = {
2861
- key: 2,
2864
+ key: 0,
2865
+ class: "text-center"
2866
+ };
2867
+ const _hoisted_14 = /*#__PURE__*/vue.createElementVNode("div", {
2868
+ class: "spinner-border",
2869
+ role: "status"
2870
+ }, [
2871
+ /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
2872
+ ], -1 /* HOISTED */);
2873
+ const _hoisted_15 = [
2874
+ _hoisted_14
2875
+ ];
2876
+ const _hoisted_16 = {
2877
+ key: 1,
2878
+ class: "alert alert-danger"
2879
+ };
2880
+ const _hoisted_17 = { colspan: 2 };
2881
+ const _hoisted_18 = {
2882
+ key: 0,
2883
+ class: "text-center"
2884
+ };
2885
+ const _hoisted_19 = /*#__PURE__*/vue.createElementVNode("div", {
2886
+ class: "spinner-border",
2887
+ role: "status"
2888
+ }, [
2889
+ /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
2890
+ ], -1 /* HOISTED */);
2891
+ const _hoisted_20 = [
2892
+ _hoisted_19
2893
+ ];
2894
+ const _hoisted_21 = {
2895
+ key: 1,
2896
+ class: "alert alert-danger"
2897
+ };
2898
+ const _hoisted_22 = { colspan: 2 };
2899
+ const _hoisted_23 = {
2900
+ key: 4,
2862
2901
  class: "table"
2863
2902
  };
2864
- const _hoisted_14 = ["onClick"];
2865
- const _hoisted_15 = ["onClick"];
2866
- const _hoisted_16 = ["onClick"];
2867
- const _hoisted_17 = {
2903
+ const _hoisted_24 = ["onClick"];
2904
+ const _hoisted_25 = ["onClick"];
2905
+ const _hoisted_26 = ["onClick"];
2906
+ const _hoisted_27 = {
2868
2907
  key: 0,
2869
2908
  class: "text-capitalize"
2870
2909
  };
2871
- const _hoisted_18 = {
2910
+ const _hoisted_28 = {
2872
2911
  key: 0,
2873
2912
  class: "text-center"
2874
2913
  };
2875
- const _hoisted_19 = ["colspan"];
2876
- const _hoisted_20 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
2914
+ const _hoisted_29 = ["colspan"];
2915
+ const _hoisted_30 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
2877
2916
  /*#__PURE__*/vue.createElementVNode("div", {
2878
2917
  class: "spinner-border",
2879
2918
  role: "status"
@@ -2881,46 +2920,46 @@ const _hoisted_20 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-ce
2881
2920
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
2882
2921
  ])
2883
2922
  ], -1 /* HOISTED */);
2884
- const _hoisted_21 = [
2885
- _hoisted_20
2923
+ const _hoisted_31 = [
2924
+ _hoisted_30
2886
2925
  ];
2887
- const _hoisted_22 = {
2926
+ const _hoisted_32 = {
2888
2927
  key: 1,
2889
2928
  class: "text-center alert alert-danger"
2890
2929
  };
2891
- const _hoisted_23 = ["colspan"];
2892
- const _hoisted_24 = {
2930
+ const _hoisted_33 = ["colspan"];
2931
+ const _hoisted_34 = {
2893
2932
  key: 2,
2894
2933
  class: "text-center alert alert-info no_records"
2895
2934
  };
2896
- const _hoisted_25 = ["colspan"];
2897
- const _hoisted_26 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
2898
- const _hoisted_27 = /*#__PURE__*/vue.createTextVNode(" No records found ");
2899
- const _hoisted_28 = [
2900
- _hoisted_26,
2901
- _hoisted_27
2935
+ const _hoisted_35 = ["colspan"];
2936
+ const _hoisted_36 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
2937
+ const _hoisted_37 = /*#__PURE__*/vue.createTextVNode(" No records found ");
2938
+ const _hoisted_38 = [
2939
+ _hoisted_36,
2940
+ _hoisted_37
2902
2941
  ];
2903
- const _hoisted_29 = ["onClick"];
2904
- const _hoisted_30 = { key: 1 };
2905
- const _hoisted_31 = {
2942
+ const _hoisted_39 = ["onClick"];
2943
+ const _hoisted_40 = { key: 1 };
2944
+ const _hoisted_41 = {
2906
2945
  key: 2,
2907
2946
  class: "text-success fw-bold"
2908
2947
  };
2909
- const _hoisted_32 = { key: 3 };
2910
- const _hoisted_33 = ["innerHTML"];
2911
- const _hoisted_34 = ["innerHTML"];
2912
- const _hoisted_35 = ["innerHTML"];
2913
- const _hoisted_36 = {
2948
+ const _hoisted_42 = { key: 3 };
2949
+ const _hoisted_43 = ["innerHTML"];
2950
+ const _hoisted_44 = ["innerHTML"];
2951
+ const _hoisted_45 = ["innerHTML"];
2952
+ const _hoisted_46 = {
2914
2953
  key: 0,
2915
2954
  style: {"white-space":"nowrap"}
2916
2955
  };
2917
- const _hoisted_37 = ["title", "onClick"];
2918
- const _hoisted_38 = { key: 3 };
2919
- const _hoisted_39 = {
2956
+ const _hoisted_47 = ["title", "onClick"];
2957
+ const _hoisted_48 = { key: 5 };
2958
+ const _hoisted_49 = {
2920
2959
  key: 0,
2921
2960
  class: "text-center"
2922
2961
  };
2923
- const _hoisted_40 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
2962
+ const _hoisted_50 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-center" }, [
2924
2963
  /*#__PURE__*/vue.createElementVNode("div", {
2925
2964
  class: "spinner-border",
2926
2965
  role: "status"
@@ -2928,38 +2967,38 @@ const _hoisted_40 = /*#__PURE__*/vue.createElementVNode("div", { class: "text-ce
2928
2967
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
2929
2968
  ])
2930
2969
  ], -1 /* HOISTED */);
2931
- const _hoisted_41 = [
2932
- _hoisted_40
2970
+ const _hoisted_51 = [
2971
+ _hoisted_50
2933
2972
  ];
2934
- const _hoisted_42 = { key: 1 };
2935
- const _hoisted_43 = {
2973
+ const _hoisted_52 = { key: 1 };
2974
+ const _hoisted_53 = {
2936
2975
  key: 2,
2937
2976
  class: "mobile-list-items"
2938
2977
  };
2939
- const _hoisted_44 = ["onClick"];
2940
- const _hoisted_45 = {
2978
+ const _hoisted_54 = ["onClick"];
2979
+ const _hoisted_55 = {
2941
2980
  key: 0,
2942
2981
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2943
2982
  };
2944
- const _hoisted_46 = {
2983
+ const _hoisted_56 = {
2945
2984
  key: 1,
2946
2985
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2947
2986
  };
2948
- const _hoisted_47 = {
2987
+ const _hoisted_57 = {
2949
2988
  key: 2,
2950
2989
  class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2951
2990
  };
2952
- const _hoisted_48 = { key: 1 };
2953
- const _hoisted_49 = {
2991
+ const _hoisted_58 = { key: 1 };
2992
+ const _hoisted_59 = {
2954
2993
  key: 2,
2955
2994
  class: "text-primary fw-bold"
2956
2995
  };
2957
- const _hoisted_50 = ["innerHTML"];
2958
- const _hoisted_51 = ["innerHTML"];
2959
- const _hoisted_52 = ["innerHTML"];
2960
- const _hoisted_53 = /*#__PURE__*/vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */);
2961
- const _hoisted_54 = { key: 0 };
2962
- const _hoisted_55 = ["title", "onClick"];
2996
+ const _hoisted_60 = ["innerHTML"];
2997
+ const _hoisted_61 = ["innerHTML"];
2998
+ const _hoisted_62 = ["innerHTML"];
2999
+ const _hoisted_63 = /*#__PURE__*/vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */);
3000
+ const _hoisted_64 = { key: 0 };
3001
+ const _hoisted_65 = ["title", "onClick"];
2963
3002
 
2964
3003
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
2965
3004
  const _component_router_link = vue.resolveComponent("router-link");
@@ -3003,169 +3042,103 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3003
3042
  ])
3004
3043
  ]))
3005
3044
  : vue.createCommentVNode("v-if", true),
3006
- ($options.windowWidth > 700)
3007
- ? (vue.openBlock(), vue.createElementBlock("table", _hoisted_13, [
3008
- vue.createElementVNode("thead", null, [
3009
- vue.createElementVNode("tr", null, [
3010
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (title) => {
3011
- return (vue.openBlock(), vue.createElementBlock("th", {
3012
- key: title[0]
3013
- }, [
3014
- (typeof title === 'string')
3015
- ? (vue.openBlock(), vue.createElementBlock("a", {
3016
- key: 0,
3017
- class: "text-capitalize",
3018
- onClick: $event => ($options.changeKey('order_by',title))
3019
- }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_14))
3020
- : (typeof title === 'function')
3045
+ ($options.hasDefaultSlot)
3046
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
3047
+ ($data.loading === 'loading')
3048
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, _hoisted_15))
3049
+ : ($data.loading === 'error')
3050
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
3051
+ vue.createElementVNode("span", _hoisted_17, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
3052
+ ]))
3053
+ : vue.createCommentVNode("v-if", true),
3054
+ ($data.loading === 'done')
3055
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList($data.records, (record) => {
3056
+ return vue.renderSlot(_ctx.$slots, "default", {
3057
+ key: record.id,
3058
+ record: record
3059
+ })
3060
+ }), 128 /* KEYED_FRAGMENT */))
3061
+ : vue.createCommentVNode("v-if", true)
3062
+ ], 64 /* STABLE_FRAGMENT */))
3063
+ : vue.createCommentVNode("v-if", true),
3064
+ ($options.hasRecordsSlot)
3065
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
3066
+ ($data.loading === 'loading')
3067
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, _hoisted_20))
3068
+ : ($data.loading === 'error')
3069
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
3070
+ vue.createElementVNode("span", _hoisted_22, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
3071
+ ]))
3072
+ : vue.createCommentVNode("v-if", true),
3073
+ ($data.loading === 'done')
3074
+ ? vue.renderSlot(_ctx.$slots, "records", {
3075
+ key: 2,
3076
+ records: $data.records
3077
+ })
3078
+ : vue.createCommentVNode("v-if", true)
3079
+ ], 64 /* STABLE_FRAGMENT */))
3080
+ : ($options.windowWidth > 700)
3081
+ ? (vue.openBlock(), vue.createElementBlock("table", _hoisted_23, [
3082
+ vue.createElementVNode("thead", null, [
3083
+ vue.createElementVNode("tr", null, [
3084
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (title) => {
3085
+ return (vue.openBlock(), vue.createElementBlock("th", {
3086
+ key: title[0]
3087
+ }, [
3088
+ (typeof title === 'string')
3021
3089
  ? (vue.openBlock(), vue.createElementBlock("a", {
3022
- key: 1,
3090
+ key: 0,
3023
3091
  class: "text-capitalize",
3024
3092
  onClick: $event => ($options.changeKey('order_by',title))
3025
- }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15))
3026
- : (vue.openBlock(), vue.createElementBlock("a", {
3027
- key: 2,
3028
- class: "text-capitalize",
3029
- onClick: $event => ($options.changeKey('order_by',title[0]))
3030
- }, vue.toDisplayString(title[1].replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
3031
- ]))
3032
- }), 128 /* KEYED_FRAGMENT */)),
3033
- ($props.actions)
3034
- ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_17, vue.toDisplayString($props.actions.label), 1 /* TEXT */))
3035
- : vue.createCommentVNode("v-if", true)
3036
- ])
3037
- ]),
3038
- vue.createElementVNode("tbody", null, [
3039
- ($data.loading === 'loading')
3040
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_18, [
3041
- vue.createElementVNode("td", {
3042
- colspan: $props.headers.length
3043
- }, _hoisted_21, 8 /* PROPS */, _hoisted_19)
3044
- ]))
3045
- : ($data.loading === 'error')
3046
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_22, [
3093
+ }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_24))
3094
+ : (typeof title === 'function')
3095
+ ? (vue.openBlock(), vue.createElementBlock("a", {
3096
+ key: 1,
3097
+ class: "text-capitalize",
3098
+ onClick: $event => ($options.changeKey('order_by',title))
3099
+ }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_25))
3100
+ : (vue.openBlock(), vue.createElementBlock("a", {
3101
+ key: 2,
3102
+ class: "text-capitalize",
3103
+ onClick: $event => ($options.changeKey('order_by',title[0]))
3104
+ }, vue.toDisplayString(title[1].replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_26))
3105
+ ]))
3106
+ }), 128 /* KEYED_FRAGMENT */)),
3107
+ ($props.actions)
3108
+ ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_27, vue.toDisplayString($props.actions.label), 1 /* TEXT */))
3109
+ : vue.createCommentVNode("v-if", true)
3110
+ ])
3111
+ ]),
3112
+ vue.createElementVNode("tbody", null, [
3113
+ ($data.loading === 'loading')
3114
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_28, [
3047
3115
  vue.createElementVNode("td", {
3048
3116
  colspan: $props.headers.length
3049
- }, vue.toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_23)
3117
+ }, _hoisted_31, 8 /* PROPS */, _hoisted_29)
3050
3118
  ]))
3051
- : ($data.records.length === 0)
3052
- ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_24, [
3119
+ : ($data.loading === 'error')
3120
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_32, [
3053
3121
  vue.createElementVNode("td", {
3054
- colspan: $props.actions ? $props.headers.length + 1 : $props.headers.length
3055
- }, _hoisted_28, 8 /* PROPS */, _hoisted_25)
3122
+ colspan: $props.headers.length
3123
+ }, vue.toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_33)
3056
3124
  ]))
3057
- : ($data.loading === 'done')
3058
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList($data.records, (record, index) => {
3059
- return (vue.openBlock(), vue.createElementBlock("tr", {
3060
- key: record.id,
3061
- class: vue.normalizeClass(record.class),
3062
- onClick: $event => ($options.rowSelected(record))
3063
- }, [
3064
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3065
- return (vue.openBlock(), vue.createElementBlock("td", {
3066
- key: key[0]
3067
- }, [
3068
- (typeof key === 'string' && $props.links && $props.links[key])
3069
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3070
- key: 0,
3071
- to: $options.replaceLinkUrl($props.links[key],record),
3072
- class: vue.normalizeClass($options.getLinkClass($props.links[key])),
3073
- innerHTML: record[key]
3074
- }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3075
- : ($options.getFieldType(key) === 'numeric')
3076
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_30, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3077
- : ($options.getFieldType(key) === 'money')
3078
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_31, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3079
- : ($options.getFieldType(key) === 'date')
3080
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_32, vue.toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
3081
- : (typeof key === 'string')
3082
- ? (vue.openBlock(), vue.createElementBlock("span", {
3083
- key: 4,
3084
- innerHTML: record[key]
3085
- }, null, 8 /* PROPS */, _hoisted_33))
3086
- : (typeof key === 'function')
3087
- ? (vue.openBlock(), vue.createElementBlock("span", {
3088
- key: 5,
3089
- innerHTML: key(record, index)
3090
- }, null, 8 /* PROPS */, _hoisted_34))
3091
- : (vue.openBlock(), vue.createElementBlock("span", {
3092
- key: 6,
3093
- innerHTML: record[key[0]]
3094
- }, null, 8 /* PROPS */, _hoisted_35))
3095
- ]))
3096
- }), 128 /* KEYED_FRAGMENT */)),
3097
- ($props.actions)
3098
- ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_36, [
3099
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3100
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3101
- key: act.path
3102
- }, [
3103
- (!act.permission || $options.user.isAllowedTo(act.permission))
3104
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3105
- (!act.validator || act.validator(record))
3106
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3107
- (act.emits)
3108
- ? (vue.openBlock(), vue.createElementBlock("button", {
3109
- key: 0,
3110
- title: act.title,
3111
- class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3112
- onClick: $event => ($options.doEmitAction(act.emits,record))
3113
- }, vue.toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_37))
3114
- : vue.createCommentVNode("v-if", true),
3115
- (!act.emits)
3116
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3117
- key: 1,
3118
- title: act.title,
3119
- to: $options.replaceActionUrl(act.path,record),
3120
- class: vue.normalizeClass(act.class)
3121
- }, {
3122
- default: vue.withCtx(() => [
3123
- vue.createTextVNode(vue.toDisplayString(act.label), 1 /* TEXT */)
3124
- ]),
3125
- _: 2 /* DYNAMIC */
3126
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3127
- : vue.createCommentVNode("v-if", true)
3128
- ], 64 /* STABLE_FRAGMENT */))
3129
- : vue.createCommentVNode("v-if", true)
3130
- ], 64 /* STABLE_FRAGMENT */))
3131
- : vue.createCommentVNode("v-if", true)
3132
- ], 64 /* STABLE_FRAGMENT */))
3133
- }), 128 /* KEYED_FRAGMENT */))
3134
- ]))
3135
- : vue.createCommentVNode("v-if", true)
3136
- ], 10 /* CLASS, PROPS */, _hoisted_29))
3137
- }), 128 /* KEYED_FRAGMENT */))
3138
- : vue.createCommentVNode("v-if", true)
3139
- ])
3140
- ]))
3141
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, [
3142
- ($data.loading === 'loading')
3143
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, _hoisted_41))
3144
- : ($data.loading === 'error')
3145
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42, [
3146
- vue.createElementVNode("span", null, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
3147
- ]))
3148
- : ($data.loading === 'done')
3149
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_43, [
3150
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.records, (record, index) => {
3151
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3152
- key: record.id
3153
- }, [
3154
- vue.createElementVNode("h3", null, vue.toDisplayString(_ctx.mobile_view), 1 /* TEXT */),
3155
- vue.createElementVNode("div", {
3156
- class: "single-mobile-req bg-light p-3",
3157
- onClick: $event => ($options.rowSelected(record))
3158
- }, [
3159
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3160
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3161
- key: key[0]
3162
- }, [
3163
- (typeof key === 'string' )
3164
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_45, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3165
- : (typeof key === 'function')
3166
- ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_46, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3167
- : (vue.openBlock(), vue.createElementBlock("p", _hoisted_47, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3168
- vue.createElementVNode("span", null, [
3125
+ : ($data.records.length === 0)
3126
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_34, [
3127
+ vue.createElementVNode("td", {
3128
+ colspan: $props.actions ? $props.headers.length + 1 : $props.headers.length
3129
+ }, _hoisted_38, 8 /* PROPS */, _hoisted_35)
3130
+ ]))
3131
+ : ($data.loading === 'done')
3132
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList($data.records, (record, index) => {
3133
+ return (vue.openBlock(), vue.createElementBlock("tr", {
3134
+ key: record.id,
3135
+ class: vue.normalizeClass(record.class),
3136
+ onClick: $event => ($options.rowSelected(record))
3137
+ }, [
3138
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3139
+ return (vue.openBlock(), vue.createElementBlock("td", {
3140
+ key: key[0]
3141
+ }, [
3169
3142
  (typeof key === 'string' && $props.links && $props.links[key])
3170
3143
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3171
3144
  key: 0,
@@ -3174,75 +3147,176 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3174
3147
  innerHTML: record[key]
3175
3148
  }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3176
3149
  : ($options.getFieldType(key) === 'numeric')
3177
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_48, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3150
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_40, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3178
3151
  : ($options.getFieldType(key) === 'money')
3179
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_49, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3180
- : (typeof key === 'string')
3181
- ? (vue.openBlock(), vue.createElementBlock("span", {
3182
- key: 3,
3183
- innerHTML: record[key]
3184
- }, null, 8 /* PROPS */, _hoisted_50))
3185
- : (typeof key === 'function')
3152
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_41, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3153
+ : ($options.getFieldType(key) === 'date')
3154
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_42, vue.toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
3155
+ : (typeof key === 'string')
3186
3156
  ? (vue.openBlock(), vue.createElementBlock("span", {
3187
3157
  key: 4,
3188
- innerHTML: key(record, index )
3189
- }, null, 8 /* PROPS */, _hoisted_51))
3190
- : (vue.openBlock(), vue.createElementBlock("span", {
3191
- key: 5,
3192
- innerHTML: record[key[0]]
3193
- }, null, 8 /* PROPS */, _hoisted_52))
3194
- ]),
3195
- _hoisted_53
3196
- ], 64 /* STABLE_FRAGMENT */))
3197
- }), 128 /* KEYED_FRAGMENT */)),
3198
- ($props.actions)
3199
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_54, [
3200
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3201
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3202
- key: act.path
3203
- }, [
3204
- (!act.permission || $options.user.isAllowedTo(act.permission))
3205
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3206
- (!act.validator || act.validator(record))
3207
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3208
- (act.emits)
3209
- ? (vue.openBlock(), vue.createElementBlock("button", {
3210
- key: 0,
3211
- title: act.title,
3212
- class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3213
- onClick: $event => ($options.doEmitAction(act.emits,record))
3214
- }, vue.toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_55))
3215
- : vue.createCommentVNode("v-if", true),
3216
- (!act.emits)
3217
- ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3218
- key: 1,
3219
- title: act.title,
3220
- to: $options.replaceActionUrl(act.path,record),
3221
- class: vue.normalizeClass(act.class)
3222
- }, {
3223
- default: vue.withCtx(() => [
3224
- vue.createTextVNode(vue.toDisplayString(act.label), 1 /* TEXT */)
3225
- ]),
3226
- _: 2 /* DYNAMIC */
3227
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3228
- : vue.createCommentVNode("v-if", true)
3229
- ], 64 /* STABLE_FRAGMENT */))
3230
- : vue.createCommentVNode("v-if", true)
3231
- ], 64 /* STABLE_FRAGMENT */))
3232
- : vue.createCommentVNode("v-if", true)
3233
- ], 64 /* STABLE_FRAGMENT */))
3234
- }), 128 /* KEYED_FRAGMENT */))
3158
+ innerHTML: record[key]
3159
+ }, null, 8 /* PROPS */, _hoisted_43))
3160
+ : (typeof key === 'function')
3161
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3162
+ key: 5,
3163
+ innerHTML: key(record, index)
3164
+ }, null, 8 /* PROPS */, _hoisted_44))
3165
+ : (vue.openBlock(), vue.createElementBlock("span", {
3166
+ key: 6,
3167
+ innerHTML: record[key[0]]
3168
+ }, null, 8 /* PROPS */, _hoisted_45))
3235
3169
  ]))
3236
- : vue.createCommentVNode("v-if", true)
3237
- ], 8 /* PROPS */, _hoisted_44)
3238
- ], 64 /* STABLE_FRAGMENT */))
3239
- }), 128 /* KEYED_FRAGMENT */))
3170
+ }), 128 /* KEYED_FRAGMENT */)),
3171
+ ($props.actions)
3172
+ ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_46, [
3173
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3174
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3175
+ key: act.path
3176
+ }, [
3177
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3178
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3179
+ (!act.validator || act.validator(record))
3180
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3181
+ (act.emits)
3182
+ ? (vue.openBlock(), vue.createElementBlock("button", {
3183
+ key: 0,
3184
+ title: act.title,
3185
+ class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3186
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3187
+ }, vue.toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_47))
3188
+ : vue.createCommentVNode("v-if", true),
3189
+ (!act.emits)
3190
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3191
+ key: 1,
3192
+ title: act.title,
3193
+ to: $options.replaceActionUrl(act.path,record),
3194
+ class: vue.normalizeClass(act.class)
3195
+ }, {
3196
+ default: vue.withCtx(() => [
3197
+ vue.createTextVNode(vue.toDisplayString(act.label), 1 /* TEXT */)
3198
+ ]),
3199
+ _: 2 /* DYNAMIC */
3200
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3201
+ : vue.createCommentVNode("v-if", true)
3202
+ ], 64 /* STABLE_FRAGMENT */))
3203
+ : vue.createCommentVNode("v-if", true)
3204
+ ], 64 /* STABLE_FRAGMENT */))
3205
+ : vue.createCommentVNode("v-if", true)
3206
+ ], 64 /* STABLE_FRAGMENT */))
3207
+ }), 128 /* KEYED_FRAGMENT */))
3208
+ ]))
3209
+ : vue.createCommentVNode("v-if", true)
3210
+ ], 10 /* CLASS, PROPS */, _hoisted_39))
3211
+ }), 128 /* KEYED_FRAGMENT */))
3212
+ : vue.createCommentVNode("v-if", true)
3213
+ ])
3214
+ ]))
3215
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_48, [
3216
+ ($data.loading === 'loading')
3217
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_49, _hoisted_51))
3218
+ : ($data.loading === 'error')
3219
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_52, [
3220
+ vue.createElementVNode("span", null, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
3240
3221
  ]))
3241
- : vue.createCommentVNode("v-if", true)
3242
- ])),
3222
+ : ($data.loading === 'done')
3223
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_53, [
3224
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.records, (record, index) => {
3225
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3226
+ key: record.id
3227
+ }, [
3228
+ vue.createElementVNode("h3", null, vue.toDisplayString(_ctx.mobile_view), 1 /* TEXT */),
3229
+ vue.createElementVNode("div", {
3230
+ class: "single-mobile-req bg-light p-3",
3231
+ onClick: $event => ($options.rowSelected(record))
3232
+ }, [
3233
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3234
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3235
+ key: key[0]
3236
+ }, [
3237
+ (typeof key === 'string' )
3238
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_55, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3239
+ : (typeof key === 'function')
3240
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_56, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3241
+ : (vue.openBlock(), vue.createElementBlock("p", _hoisted_57, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3242
+ vue.createElementVNode("span", null, [
3243
+ (typeof key === 'string' && $props.links && $props.links[key])
3244
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3245
+ key: 0,
3246
+ to: $options.replaceLinkUrl($props.links[key],record),
3247
+ class: vue.normalizeClass($options.getLinkClass($props.links[key])),
3248
+ innerHTML: record[key]
3249
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3250
+ : ($options.getFieldType(key) === 'numeric')
3251
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_58, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3252
+ : ($options.getFieldType(key) === 'money')
3253
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_59, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3254
+ : (typeof key === 'string')
3255
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3256
+ key: 3,
3257
+ innerHTML: record[key]
3258
+ }, null, 8 /* PROPS */, _hoisted_60))
3259
+ : (typeof key === 'function')
3260
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3261
+ key: 4,
3262
+ innerHTML: key(record, index )
3263
+ }, null, 8 /* PROPS */, _hoisted_61))
3264
+ : (vue.openBlock(), vue.createElementBlock("span", {
3265
+ key: 5,
3266
+ innerHTML: record[key[0]]
3267
+ }, null, 8 /* PROPS */, _hoisted_62))
3268
+ ]),
3269
+ _hoisted_63
3270
+ ], 64 /* STABLE_FRAGMENT */))
3271
+ }), 128 /* KEYED_FRAGMENT */)),
3272
+ ($props.actions)
3273
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_64, [
3274
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3275
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3276
+ key: act.path
3277
+ }, [
3278
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3279
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3280
+ (!act.validator || act.validator(record))
3281
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3282
+ (act.emits)
3283
+ ? (vue.openBlock(), vue.createElementBlock("button", {
3284
+ key: 0,
3285
+ title: act.title,
3286
+ class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3287
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3288
+ }, vue.toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_65))
3289
+ : vue.createCommentVNode("v-if", true),
3290
+ (!act.emits)
3291
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3292
+ key: 1,
3293
+ title: act.title,
3294
+ to: $options.replaceActionUrl(act.path,record),
3295
+ class: vue.normalizeClass(act.class)
3296
+ }, {
3297
+ default: vue.withCtx(() => [
3298
+ vue.createTextVNode(vue.toDisplayString(act.label), 1 /* TEXT */)
3299
+ ]),
3300
+ _: 2 /* DYNAMIC */
3301
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3302
+ : vue.createCommentVNode("v-if", true)
3303
+ ], 64 /* STABLE_FRAGMENT */))
3304
+ : vue.createCommentVNode("v-if", true)
3305
+ ], 64 /* STABLE_FRAGMENT */))
3306
+ : vue.createCommentVNode("v-if", true)
3307
+ ], 64 /* STABLE_FRAGMENT */))
3308
+ }), 128 /* KEYED_FRAGMENT */))
3309
+ ]))
3310
+ : vue.createCommentVNode("v-if", true)
3311
+ ], 8 /* PROPS */, _hoisted_54)
3312
+ ], 64 /* STABLE_FRAGMENT */))
3313
+ }), 128 /* KEYED_FRAGMENT */))
3314
+ ]))
3315
+ : vue.createCommentVNode("v-if", true)
3316
+ ])),
3243
3317
  ($data.pagination_data)
3244
3318
  ? (vue.openBlock(), vue.createBlock(_component_pagination, {
3245
- key: 4,
3319
+ key: 6,
3246
3320
  onLoadMoreRecords: $options.loadMoreRecords,
3247
3321
  "hide-load-more": $props.hideLoadMore,
3248
3322
  "hide-count": $props.hideCount,