@iankibetsh/shframework 5.4.6 → 5.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,4 @@
1
1
 
2
- .colored-toast.swal2-icon-success {
3
- background-color: #a5dc86 !important;
4
- }
5
-
6
- .colored-toast.swal2-icon-error {
7
- background-color: #f27474 !important;
8
- }
9
-
10
- .colored-toast.swal2-icon-warning {
11
- background-color: #f8bb86 !important;
12
- }
13
-
14
- .colored-toast.swal2-icon-info {
15
- background-color: #3fc3ee !important;
16
- }
17
-
18
- .colored-toast.swal2-icon-question {
19
- background-color: #87adbd !important;
20
- }
21
-
22
- .colored-toast .swal2-title {
23
- color: white;
24
- }
25
-
26
- .colored-toast .swal2-close {
27
- color: white;
28
- }
29
-
30
- .colored-toast .swal2-html-container {
31
- color: white;
32
- }
33
-
34
2
  .sh-phone{
35
3
  display: flex;
36
4
  width: 100%;
@@ -63,6 +31,38 @@
63
31
  opacity: 0.5;
64
32
  }
65
33
 
34
+ .colored-toast.swal2-icon-success {
35
+ background-color: #a5dc86 !important;
36
+ }
37
+
38
+ .colored-toast.swal2-icon-error {
39
+ background-color: #f27474 !important;
40
+ }
41
+
42
+ .colored-toast.swal2-icon-warning {
43
+ background-color: #f8bb86 !important;
44
+ }
45
+
46
+ .colored-toast.swal2-icon-info {
47
+ background-color: #3fc3ee !important;
48
+ }
49
+
50
+ .colored-toast.swal2-icon-question {
51
+ background-color: #87adbd !important;
52
+ }
53
+
54
+ .colored-toast .swal2-title {
55
+ color: white;
56
+ }
57
+
58
+ .colored-toast .swal2-close {
59
+ color: white;
60
+ }
61
+
62
+ .colored-toast .swal2-html-container {
63
+ color: white;
64
+ }
65
+
66
66
  .permissions-main {
67
67
  background: #edeff2;
68
68
  }
package/dist/library.js CHANGED
@@ -2116,7 +2116,7 @@ const _hoisted_2$j = {
2116
2116
  style: {"display":"contents"}
2117
2117
  };
2118
2118
  const _hoisted_3$g = ["src"];
2119
- const _hoisted_4$e = ["value"];
2119
+ const _hoisted_4$f = ["value"];
2120
2120
  const _hoisted_5$c = ["disabled"];
2121
2121
 
2122
2122
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
@@ -2136,7 +2136,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2136
2136
  return (vue.openBlock(), vue.createElementBlock("option", {
2137
2137
  value: country,
2138
2138
  key: country.dialCode
2139
- }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$e))
2139
+ }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$f))
2140
2140
  }), 128 /* KEYED_FRAGMENT */))
2141
2141
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
2142
2142
  [vue.vModelSelect, $data.selectedCountry]
@@ -2164,7 +2164,7 @@ const _hoisted_1$q = {
2164
2164
  };
2165
2165
  const _hoisted_2$i = ["id"];
2166
2166
  const _hoisted_3$f = { class: "sh-suggestions-holder" };
2167
- const _hoisted_4$d = { class: "badge bg-secondary m-1 sh-selected-item" };
2167
+ const _hoisted_4$e = { class: "badge bg-secondary m-1 sh-selected-item" };
2168
2168
  const _hoisted_5$b = ["onClick"];
2169
2169
  const _hoisted_6$9 = ["id"];
2170
2170
  const _hoisted_7$8 = ["id", "aria-labelledby"];
@@ -2333,7 +2333,7 @@ return (_ctx, _cache) => {
2333
2333
  }, [
2334
2334
  vue.createElementVNode("div", _hoisted_3$f, [
2335
2335
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(selectedSuggestions), (sgt) => {
2336
- return (vue.openBlock(), vue.createElementBlock("h5", _hoisted_4$d, [
2336
+ return (vue.openBlock(), vue.createElementBlock("h5", _hoisted_4$e, [
2337
2337
  vue.createTextVNode(vue.toDisplayString(sgt.name) + " ", 1 /* TEXT */),
2338
2338
  vue.createElementVNode("button", {
2339
2339
  onClick: $event => (removeSuggestion(sgt.id)),
@@ -2760,7 +2760,7 @@ const _hoisted_2$h = {
2760
2760
  role: "alert"
2761
2761
  };
2762
2762
  const _hoisted_3$e = { key: 0 };
2763
- const _hoisted_4$c = { key: 1 };
2763
+ const _hoisted_4$d = { key: 1 };
2764
2764
  const _hoisted_5$a = { class: "row" };
2765
2765
  const _hoisted_6$8 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2766
2766
  const _hoisted_7$7 = { class: "col-md-12" };
@@ -2802,7 +2802,7 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2802
2802
  _cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */)),
2803
2803
  (_ctx.errorText)
2804
2804
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$e, vue.toDisplayString(_ctx.errorText), 1 /* TEXT */))
2805
- : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$c, "Unexpected Error Occurred")),
2805
+ : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$d, "Unexpected Error Occurred")),
2806
2806
  vue.createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2807
2807
  ]))
2808
2808
  : vue.createCommentVNode("v-if", true),
@@ -3373,7 +3373,7 @@ const _hoisted_3$d = {
3373
3373
  key: 0,
3374
3374
  class: "text-danger sh-required"
3375
3375
  };
3376
- const _hoisted_4$b = ["innerHTML"];
3376
+ const _hoisted_4$c = ["innerHTML"];
3377
3377
  const _hoisted_5$9 = {
3378
3378
  key: 2,
3379
3379
  class: "form-notch"
@@ -3680,7 +3680,7 @@ return (_ctx, _cache) => {
3680
3680
  key: 1,
3681
3681
  class: vue.normalizeClass(getElementClass('formLabel')),
3682
3682
  innerHTML: field.label
3683
- }, null, 10 /* CLASS, PROPS */, _hoisted_4$b))
3683
+ }, null, 10 /* CLASS, PROPS */, _hoisted_4$c))
3684
3684
  : vue.createCommentVNode("v-if", true),
3685
3685
  (vue.unref(isFloating))
3686
3686
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$9, [...(_cache[1] || (_cache[1] = [
@@ -3736,7 +3736,7 @@ script$q.__file = "src/lib/components/ShAutoForm.vue";
3736
3736
  const _hoisted_1$l = ["id", "data-bs-backdrop"];
3737
3737
  const _hoisted_2$f = { class: "modal-content" };
3738
3738
  const _hoisted_3$c = { class: "modal-header" };
3739
- const _hoisted_4$a = { class: "modal-title flex-fill" };
3739
+ const _hoisted_4$b = { class: "modal-title flex-fill" };
3740
3740
  const _hoisted_5$8 = { class: "modal-body" };
3741
3741
  const _hoisted_6$6 = { class: "section" };
3742
3742
 
@@ -3801,7 +3801,7 @@ return (_ctx, _cache) => {
3801
3801
  }, [
3802
3802
  vue.createElementVNode("div", _hoisted_2$f, [
3803
3803
  vue.createElementVNode("div", _hoisted_3$c, [
3804
- vue.createElementVNode("h3", _hoisted_4$a, vue.toDisplayString(__props.modalTitle), 1 /* TEXT */),
3804
+ vue.createElementVNode("h3", _hoisted_4$b, vue.toDisplayString(__props.modalTitle), 1 /* TEXT */),
3805
3805
  _cache[0] || (_cache[0] = vue.createElementVNode("button", {
3806
3806
  type: "button",
3807
3807
  class: "btn-close sh-modal-close",
@@ -4065,7 +4065,7 @@ const _hoisted_3$a = {
4065
4065
  class: "offcanvas-title",
4066
4066
  id: "offcanvasScrollingLabel"
4067
4067
  };
4068
- const _hoisted_4$9 = {
4068
+ const _hoisted_4$a = {
4069
4069
  type: "button",
4070
4070
  ref: "closecanvas",
4071
4071
  class: "btn-close sh-offcanvas-close",
@@ -4122,7 +4122,7 @@ return (_ctx, _cache) => {
4122
4122
  }, [
4123
4123
  vue.createElementVNode("div", _hoisted_2$d, [
4124
4124
  vue.createElementVNode("h5", _hoisted_3$a, vue.toDisplayString(__props.canvasTitle), 1 /* TEXT */),
4125
- vue.createElementVNode("button", _hoisted_4$9, null, 512 /* NEED_PATCH */)
4125
+ vue.createElementVNode("button", _hoisted_4$a, null, 512 /* NEED_PATCH */)
4126
4126
  ]),
4127
4127
  vue.createElementVNode("div", _hoisted_5$7, [
4128
4128
  vue.renderSlot(_ctx.$slots, "default")
@@ -4160,7 +4160,7 @@ const useUserStore = pinia.defineStore('user-store', {
4160
4160
  loggedOut: false
4161
4161
  }),
4162
4162
  actions: {
4163
- setUser (){
4163
+ setUser (defaultEndpoint) {
4164
4164
  let user = null;
4165
4165
  try {
4166
4166
  user = shStorage.getItem('user') ? shStorage.getItem('user') : null;
@@ -4185,7 +4185,7 @@ const useUserStore = pinia.defineStore('user-store', {
4185
4185
  };
4186
4186
  }
4187
4187
  this.user = user;
4188
- const userEndpoint = vue.inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
4188
+ const userEndpoint = defaultEndpoint ?? vue.inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
4189
4189
 
4190
4190
  shApis.doGet(userEndpoint).then(res => {
4191
4191
  let user = res.data.user;
@@ -4618,7 +4618,7 @@ const _hoisted_3$9 = {
4618
4618
  key: 1,
4619
4619
  class: "bi bi-three-dots"
4620
4620
  };
4621
- const _hoisted_4$8 = {
4621
+ const _hoisted_4$9 = {
4622
4622
  key: 2,
4623
4623
  class: "bi bi-three-dots-vertical"
4624
4624
  };
@@ -4647,7 +4647,7 @@ return (_ctx, _cache) => {
4647
4647
  }, null, 2 /* CLASS */))
4648
4648
  : (vue.unref(type) === 'dropdown-horizontal')
4649
4649
  ? (vue.openBlock(), vue.createElementBlock("i", _hoisted_3$9))
4650
- : (vue.openBlock(), vue.createElementBlock("i", _hoisted_4$8))
4650
+ : (vue.openBlock(), vue.createElementBlock("i", _hoisted_4$9))
4651
4651
  ]),
4652
4652
  vue.createElementVNode("ul", _hoisted_5$6, [
4653
4653
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(actionItems), (act) => {
@@ -4765,7 +4765,7 @@ var script$f = {
4765
4765
  const _hoisted_1$d = { key: 0 };
4766
4766
  const _hoisted_2$a = { class: "record_count_body mb-3" };
4767
4767
  const _hoisted_3$8 = ["value"];
4768
- const _hoisted_4$7 = { class: "record_counts" };
4768
+ const _hoisted_4$8 = { class: "record_counts" };
4769
4769
  const _hoisted_5$5 = {
4770
4770
  key: 0,
4771
4771
  "aria-label": "Page navigation"
@@ -4816,7 +4816,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4816
4816
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
4817
4817
  [vue.vModelSelect, $data.per_page]
4818
4818
  ]),
4819
- vue.createElementVNode("span", _hoisted_4$7, " of " + vue.toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
4819
+ vue.createElementVNode("span", _hoisted_4$8, " of " + vue.toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
4820
4820
  ]),
4821
4821
  ($props.pagination_data != null)
4822
4822
  ? (vue.openBlock(), vue.createElementBlock("nav", _hoisted_5$5, [
@@ -4898,7 +4898,7 @@ const _hoisted_3$7 = {
4898
4898
  "data-bs-toggle": "dropdown",
4899
4899
  "aria-expanded": "false"
4900
4900
  };
4901
- const _hoisted_4$6 = ["innerHTML"];
4901
+ const _hoisted_4$7 = ["innerHTML"];
4902
4902
  const _hoisted_5$4 = {
4903
4903
  class: "dropdown-menu sh-range-dropdown",
4904
4904
  "aria-labelledby": "dropdownMenuLink"
@@ -5024,7 +5024,7 @@ return (_ctx, _cache) => {
5024
5024
  vue.createElementVNode("div", _hoisted_3$7, [
5025
5025
  _cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "bi-calendar text-dark" }, null, -1 /* HOISTED */)),
5026
5026
  _cache[3] || (_cache[3] = vue.createTextVNode()),
5027
- vue.createElementVNode("span", { innerHTML: rangeLabel.value }, null, 8 /* PROPS */, _hoisted_4$6)
5027
+ vue.createElementVNode("span", { innerHTML: rangeLabel.value }, null, 8 /* PROPS */, _hoisted_4$7)
5028
5028
  ]),
5029
5029
  vue.createElementVNode("div", _hoisted_5$4, [
5030
5030
  vue.createElementVNode("ul", _hoisted_6$4, [
@@ -5084,7 +5084,7 @@ const _hoisted_2$8 = {
5084
5084
  class: "col-md-4 mb-2"
5085
5085
  };
5086
5086
  const _hoisted_3$6 = ["disabled"];
5087
- const _hoisted_4$5 = {
5087
+ const _hoisted_4$6 = {
5088
5088
  key: 1,
5089
5089
  class: "row"
5090
5090
  };
@@ -5586,7 +5586,7 @@ return (_ctx, _cache) => {
5586
5586
  ]))
5587
5587
  : vue.createCommentVNode("v-if", true),
5588
5588
  (!__props.hideSearch)
5589
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [
5589
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$6, [
5590
5590
  vue.createElementVNode("div", _hoisted_5$3, [
5591
5591
  vue.createElementVNode("div", {
5592
5592
  class: vue.normalizeClass(["sh-search-bar input-group", __props.hasRange ? 'me-2':''])
@@ -5995,11 +5995,15 @@ return (_ctx, _cache) => {
5995
5995
  script$d.__file = "src/lib/components/ShTable.vue";
5996
5996
 
5997
5997
  const _hoisted_1$a = {
5998
+ key: 0,
5999
+ class: "sh_tab_count"
6000
+ };
6001
+ const _hoisted_2$7 = {
5998
6002
  key: 1,
5999
6003
  class: "alert alert-warning"
6000
6004
  };
6001
- const _hoisted_2$7 = { key: 0 };
6002
- const _hoisted_3$5 = { key: 1 };
6005
+ const _hoisted_3$5 = { key: 0 };
6006
+ const _hoisted_4$5 = { key: 1 };
6003
6007
 
6004
6008
 
6005
6009
  var script$c = {
@@ -6044,16 +6048,27 @@ const currentTab = vue.ref('');
6044
6048
  const path = vue.ref(route.path);
6045
6049
  const allowedTabs = vue.ref([]);
6046
6050
  const {user} = pinia.storeToRefs(useUserStore());
6051
+ const realTabCounts = vue.ref({});
6047
6052
  vue.onMounted(()=>{
6048
6053
  if(props.tabs.length === 0){
6049
6054
  return;
6050
6055
  }
6051
6056
  allowedTabs.value = props.tabs.filter(tab=>{
6052
- if(typeof tab === 'object' && tab.permission){
6053
- if(user.value && user.value.isAllowedTo(tab.permission)){
6054
- return tab
6057
+ if(typeof tab === 'object'){
6058
+ if(tab.count || tab.counts){
6059
+ realTabCounts.value[tab.name || tab.key] = tab.count || tab.counts;
6060
+ }
6061
+ if(tab.validator){
6062
+ if(tab.validator()){
6063
+ return tab
6064
+ }
6065
+ return false
6066
+ } else if(tab.permission){
6067
+ if(user.value && user.value.isAllowedTo(tab.permission)){
6068
+ return tab
6069
+ }
6070
+ return false
6055
6071
  }
6056
- return false
6057
6072
  }
6058
6073
  return tab
6059
6074
  });
@@ -6063,9 +6078,12 @@ vue.onMounted(()=>{
6063
6078
  }
6064
6079
  });
6065
6080
 
6066
- vue.watch(()=>props.tabCounts, () => {
6081
+ vue.watch(()=>props, () => {
6082
+ console.log('changed');
6067
6083
  resetTabCounts();
6068
- });
6084
+ },{
6085
+ deep: true}
6086
+ );
6069
6087
 
6070
6088
  vue.watch(()=>route.path,()=>{
6071
6089
  route.fullPath.split('/');
@@ -6086,15 +6104,6 @@ const setTab = (tab) => {
6086
6104
  currentTab.value = label.replace(/_/g, ' ');
6087
6105
  }
6088
6106
  };
6089
- const setTabCounts = (tabCounts) => {
6090
- if (typeof tabCounts === 'object') {
6091
- setCounts(tabCounts);
6092
- } else {
6093
- shApis.doGet(tabCounts).then(res => {
6094
- setCounts(res.data);
6095
- });
6096
- }
6097
- };
6098
6107
  const resetTabCounts = () => {
6099
6108
  const arr = route.fullPath.split('/');
6100
6109
  if (!tabExistsInUrl()) {
@@ -6102,9 +6111,17 @@ const resetTabCounts = () => {
6102
6111
  } else {
6103
6112
  setTab(arr[arr.length - 1]);
6104
6113
  }
6105
- if (props.tabCounts) {
6106
- setTabCounts(props.tabCounts);
6114
+ let tbCounts = props.tabCounts;
6115
+ // merge with realTabCounts
6116
+ if (tbCounts && typeof tbCounts === 'object') {
6117
+ realTabCounts.value = {...realTabCounts.value, ...tbCounts};
6118
+ } else if(typeof tbCounts === 'string') {
6119
+ // it is a string fetch from api
6120
+ shApis.doGet(tbCounts).then(res => {
6121
+ realTabCounts.value = {...realTabCounts.value, ...res.data};
6122
+ });
6107
6123
  }
6124
+
6108
6125
  };
6109
6126
  const tabExistsInUrl = () => {
6110
6127
  let exists = false;
@@ -6116,19 +6133,6 @@ const tabExistsInUrl = () => {
6116
6133
  });
6117
6134
  return exists
6118
6135
  };
6119
- const setCounts = (res) => {
6120
- Object.keys(res).forEach(key => {
6121
- let elem = document.getElementsByClassName('sh_tab_' + key);
6122
- if (elem.length > 0) {
6123
- elem = elem[0];
6124
- let txt = elem.innerHTML;
6125
- txt = txt.split('<i class="d-none"></i>')[0];
6126
- if (parseInt(res[key]) > 0) {
6127
- elem.innerHTML = txt + '<i class="d-none"></i><sup class="sh_tab_count">' + res[key] + '</sup>';
6128
- }
6129
- }
6130
- });
6131
- };
6132
6136
 
6133
6137
  const getTabKey = (tab)=>{
6134
6138
  if(typeof tab === 'string') {
@@ -6159,49 +6163,55 @@ return (_ctx, _cache) => {
6159
6163
  const _component_router_view = vue.resolveComponent("router-view");
6160
6164
  const _directive_if_user_can = vue.resolveDirective("if-user-can");
6161
6165
 
6162
- return (allowedTabs.value.length > 0)
6163
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
6164
- vue.createElementVNode("ul", {
6165
- class: vue.normalizeClass(["nav nav-tabs sh-tabs", __props.classes ?? vue.unref(shRepo).getShConfig('tabsClass','sh-tabs nav-tabs-bordered')])
6166
- }, [
6167
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(allowedTabs.value, (tab) => {
6168
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
6169
- class: "nav-item",
6170
- key: getTabKey(tab)
6171
- }, [
6172
- vue.createVNode(_component_router_link, {
6173
- onClick: $event => (setTab(tab)),
6174
- "active-class": 'active',
6175
- class: vue.normalizeClass(["nav-link text-capitalize", 'sh_tab_' + getTabKey(tab)]),
6176
- to: __props.baseUrl+'/tab/'+getTabKey(tab),
6177
- role: "tab"
6178
- }, {
6179
- default: vue.withCtx(() => [
6180
- vue.createTextVNode(vue.toDisplayString(getTabLabel(tab)), 1 /* TEXT */)
6181
- ]),
6182
- _: 2 /* DYNAMIC */
6183
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "to", "class"])
6184
- ])), [
6185
- [_directive_if_user_can, getTabPermission(tab)]
6186
- ])
6187
- }), 128 /* KEYED_FRAGMENT */))
6188
- ], 2 /* CLASS */),
6189
- vue.createElementVNode("div", {
6190
- class: vue.normalizeClass(["tab-content", __props.classTwo])
6191
- }, [
6192
- (vue.openBlock(), vue.createBlock(_component_router_view, vue.mergeProps(_ctx.$attrs, {
6193
- currentTab: currentTab.value,
6194
- key: path.value,
6195
- sharedData: __props.sharedData,
6196
- tabCounts: __props.tabCounts
6197
- }), null, 16 /* FULL_PROPS */, ["currentTab", "sharedData", "tabCounts"]))
6198
- ], 2 /* CLASS */)
6199
- ], 64 /* STABLE_FRAGMENT */))
6200
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
6201
- (__props.tabs.length)
6202
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, " 403 Not Allowed "))
6203
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, " No tabs found "))
6204
- ]))
6166
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
6167
+ vue.createTextVNode(vue.toDisplayString(currentTab.value) + " ", 1 /* TEXT */),
6168
+ (allowedTabs.value.length > 0)
6169
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
6170
+ vue.createElementVNode("ul", {
6171
+ class: vue.normalizeClass(["nav nav-tabs sh-tabs", __props.classes ?? vue.unref(shRepo).getShConfig('tabsClass','sh-tabs nav-tabs-bordered')])
6172
+ }, [
6173
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(allowedTabs.value, (tab) => {
6174
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
6175
+ class: "nav-item",
6176
+ key: getTabKey(tab)
6177
+ }, [
6178
+ vue.createVNode(_component_router_link, {
6179
+ onClick: $event => (setTab(tab)),
6180
+ "active-class": 'active',
6181
+ class: vue.normalizeClass(["nav-link text-capitalize", 'sh_tab_' + getTabKey(tab)]),
6182
+ to: __props.baseUrl+'/tab/'+getTabKey(tab),
6183
+ role: "tab"
6184
+ }, {
6185
+ default: vue.withCtx(() => [
6186
+ vue.createTextVNode(vue.toDisplayString(getTabLabel(tab)) + " ", 1 /* TEXT */),
6187
+ (realTabCounts.value[getTabKey(tab)] !== undefined && realTabCounts.value[getTabKey(tab)] > 0)
6188
+ ? (vue.openBlock(), vue.createElementBlock("sup", _hoisted_1$a, " (" + vue.toDisplayString(realTabCounts.value[getTabKey(tab)]) + ") ", 1 /* TEXT */))
6189
+ : vue.createCommentVNode("v-if", true)
6190
+ ]),
6191
+ _: 2 /* DYNAMIC */
6192
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "to", "class"])
6193
+ ])), [
6194
+ [_directive_if_user_can, getTabPermission(tab)]
6195
+ ])
6196
+ }), 128 /* KEYED_FRAGMENT */))
6197
+ ], 2 /* CLASS */),
6198
+ vue.createElementVNode("div", {
6199
+ class: vue.normalizeClass(["tab-content", __props.classTwo])
6200
+ }, [
6201
+ (vue.openBlock(), vue.createBlock(_component_router_view, vue.mergeProps(_ctx.$attrs, {
6202
+ currentTab: currentTab.value,
6203
+ key: path.value,
6204
+ sharedData: __props.sharedData,
6205
+ tabCounts: __props.tabCounts
6206
+ }), null, 16 /* FULL_PROPS */, ["currentTab", "sharedData", "tabCounts"]))
6207
+ ], 2 /* CLASS */)
6208
+ ], 64 /* STABLE_FRAGMENT */))
6209
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, [
6210
+ (__props.tabs.length)
6211
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, " 403 Not Allowed "))
6212
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, " No tabs found "))
6213
+ ]))
6214
+ ], 64 /* STABLE_FRAGMENT */))
6205
6215
  }
6206
6216
  }
6207
6217
 
package/dist/library.mjs CHANGED
@@ -2104,7 +2104,7 @@ const _hoisted_2$j = {
2104
2104
  style: {"display":"contents"}
2105
2105
  };
2106
2106
  const _hoisted_3$g = ["src"];
2107
- const _hoisted_4$e = ["value"];
2107
+ const _hoisted_4$f = ["value"];
2108
2108
  const _hoisted_5$c = ["disabled"];
2109
2109
 
2110
2110
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
@@ -2124,7 +2124,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2124
2124
  return (openBlock(), createElementBlock("option", {
2125
2125
  value: country,
2126
2126
  key: country.dialCode
2127
- }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$e))
2127
+ }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$f))
2128
2128
  }), 128 /* KEYED_FRAGMENT */))
2129
2129
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
2130
2130
  [vModelSelect, $data.selectedCountry]
@@ -2152,7 +2152,7 @@ const _hoisted_1$q = {
2152
2152
  };
2153
2153
  const _hoisted_2$i = ["id"];
2154
2154
  const _hoisted_3$f = { class: "sh-suggestions-holder" };
2155
- const _hoisted_4$d = { class: "badge bg-secondary m-1 sh-selected-item" };
2155
+ const _hoisted_4$e = { class: "badge bg-secondary m-1 sh-selected-item" };
2156
2156
  const _hoisted_5$b = ["onClick"];
2157
2157
  const _hoisted_6$9 = ["id"];
2158
2158
  const _hoisted_7$8 = ["id", "aria-labelledby"];
@@ -2321,7 +2321,7 @@ return (_ctx, _cache) => {
2321
2321
  }, [
2322
2322
  createElementVNode("div", _hoisted_3$f, [
2323
2323
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedSuggestions), (sgt) => {
2324
- return (openBlock(), createElementBlock("h5", _hoisted_4$d, [
2324
+ return (openBlock(), createElementBlock("h5", _hoisted_4$e, [
2325
2325
  createTextVNode(toDisplayString(sgt.name) + " ", 1 /* TEXT */),
2326
2326
  createElementVNode("button", {
2327
2327
  onClick: $event => (removeSuggestion(sgt.id)),
@@ -2748,7 +2748,7 @@ const _hoisted_2$h = {
2748
2748
  role: "alert"
2749
2749
  };
2750
2750
  const _hoisted_3$e = { key: 0 };
2751
- const _hoisted_4$c = { key: 1 };
2751
+ const _hoisted_4$d = { key: 1 };
2752
2752
  const _hoisted_5$a = { class: "row" };
2753
2753
  const _hoisted_6$8 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2754
2754
  const _hoisted_7$7 = { class: "col-md-12" };
@@ -2790,7 +2790,7 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2790
2790
  _cache[2] || (_cache[2] = createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */)),
2791
2791
  (_ctx.errorText)
2792
2792
  ? (openBlock(), createElementBlock("span", _hoisted_3$e, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2793
- : (openBlock(), createElementBlock("span", _hoisted_4$c, "Unexpected Error Occurred")),
2793
+ : (openBlock(), createElementBlock("span", _hoisted_4$d, "Unexpected Error Occurred")),
2794
2794
  createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2795
2795
  ]))
2796
2796
  : createCommentVNode("v-if", true),
@@ -3361,7 +3361,7 @@ const _hoisted_3$d = {
3361
3361
  key: 0,
3362
3362
  class: "text-danger sh-required"
3363
3363
  };
3364
- const _hoisted_4$b = ["innerHTML"];
3364
+ const _hoisted_4$c = ["innerHTML"];
3365
3365
  const _hoisted_5$9 = {
3366
3366
  key: 2,
3367
3367
  class: "form-notch"
@@ -3668,7 +3668,7 @@ return (_ctx, _cache) => {
3668
3668
  key: 1,
3669
3669
  class: normalizeClass(getElementClass('formLabel')),
3670
3670
  innerHTML: field.label
3671
- }, null, 10 /* CLASS, PROPS */, _hoisted_4$b))
3671
+ }, null, 10 /* CLASS, PROPS */, _hoisted_4$c))
3672
3672
  : createCommentVNode("v-if", true),
3673
3673
  (unref(isFloating))
3674
3674
  ? (openBlock(), createElementBlock("div", _hoisted_5$9, [...(_cache[1] || (_cache[1] = [
@@ -3724,7 +3724,7 @@ script$q.__file = "src/lib/components/ShAutoForm.vue";
3724
3724
  const _hoisted_1$l = ["id", "data-bs-backdrop"];
3725
3725
  const _hoisted_2$f = { class: "modal-content" };
3726
3726
  const _hoisted_3$c = { class: "modal-header" };
3727
- const _hoisted_4$a = { class: "modal-title flex-fill" };
3727
+ const _hoisted_4$b = { class: "modal-title flex-fill" };
3728
3728
  const _hoisted_5$8 = { class: "modal-body" };
3729
3729
  const _hoisted_6$6 = { class: "section" };
3730
3730
 
@@ -3789,7 +3789,7 @@ return (_ctx, _cache) => {
3789
3789
  }, [
3790
3790
  createElementVNode("div", _hoisted_2$f, [
3791
3791
  createElementVNode("div", _hoisted_3$c, [
3792
- createElementVNode("h3", _hoisted_4$a, toDisplayString(__props.modalTitle), 1 /* TEXT */),
3792
+ createElementVNode("h3", _hoisted_4$b, toDisplayString(__props.modalTitle), 1 /* TEXT */),
3793
3793
  _cache[0] || (_cache[0] = createElementVNode("button", {
3794
3794
  type: "button",
3795
3795
  class: "btn-close sh-modal-close",
@@ -4053,7 +4053,7 @@ const _hoisted_3$a = {
4053
4053
  class: "offcanvas-title",
4054
4054
  id: "offcanvasScrollingLabel"
4055
4055
  };
4056
- const _hoisted_4$9 = {
4056
+ const _hoisted_4$a = {
4057
4057
  type: "button",
4058
4058
  ref: "closecanvas",
4059
4059
  class: "btn-close sh-offcanvas-close",
@@ -4110,7 +4110,7 @@ return (_ctx, _cache) => {
4110
4110
  }, [
4111
4111
  createElementVNode("div", _hoisted_2$d, [
4112
4112
  createElementVNode("h5", _hoisted_3$a, toDisplayString(__props.canvasTitle), 1 /* TEXT */),
4113
- createElementVNode("button", _hoisted_4$9, null, 512 /* NEED_PATCH */)
4113
+ createElementVNode("button", _hoisted_4$a, null, 512 /* NEED_PATCH */)
4114
4114
  ]),
4115
4115
  createElementVNode("div", _hoisted_5$7, [
4116
4116
  renderSlot(_ctx.$slots, "default")
@@ -4148,7 +4148,7 @@ const useUserStore = defineStore('user-store', {
4148
4148
  loggedOut: false
4149
4149
  }),
4150
4150
  actions: {
4151
- setUser (){
4151
+ setUser (defaultEndpoint) {
4152
4152
  let user = null;
4153
4153
  try {
4154
4154
  user = shStorage.getItem('user') ? shStorage.getItem('user') : null;
@@ -4173,7 +4173,7 @@ const useUserStore = defineStore('user-store', {
4173
4173
  };
4174
4174
  }
4175
4175
  this.user = user;
4176
- const userEndpoint = inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
4176
+ const userEndpoint = defaultEndpoint ?? inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
4177
4177
 
4178
4178
  shApis.doGet(userEndpoint).then(res => {
4179
4179
  let user = res.data.user;
@@ -4606,7 +4606,7 @@ const _hoisted_3$9 = {
4606
4606
  key: 1,
4607
4607
  class: "bi bi-three-dots"
4608
4608
  };
4609
- const _hoisted_4$8 = {
4609
+ const _hoisted_4$9 = {
4610
4610
  key: 2,
4611
4611
  class: "bi bi-three-dots-vertical"
4612
4612
  };
@@ -4635,7 +4635,7 @@ return (_ctx, _cache) => {
4635
4635
  }, null, 2 /* CLASS */))
4636
4636
  : (unref(type) === 'dropdown-horizontal')
4637
4637
  ? (openBlock(), createElementBlock("i", _hoisted_3$9))
4638
- : (openBlock(), createElementBlock("i", _hoisted_4$8))
4638
+ : (openBlock(), createElementBlock("i", _hoisted_4$9))
4639
4639
  ]),
4640
4640
  createElementVNode("ul", _hoisted_5$6, [
4641
4641
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(actionItems), (act) => {
@@ -4753,7 +4753,7 @@ var script$f = {
4753
4753
  const _hoisted_1$d = { key: 0 };
4754
4754
  const _hoisted_2$a = { class: "record_count_body mb-3" };
4755
4755
  const _hoisted_3$8 = ["value"];
4756
- const _hoisted_4$7 = { class: "record_counts" };
4756
+ const _hoisted_4$8 = { class: "record_counts" };
4757
4757
  const _hoisted_5$5 = {
4758
4758
  key: 0,
4759
4759
  "aria-label": "Page navigation"
@@ -4804,7 +4804,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4804
4804
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
4805
4805
  [vModelSelect, $data.per_page]
4806
4806
  ]),
4807
- createElementVNode("span", _hoisted_4$7, " of " + toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
4807
+ createElementVNode("span", _hoisted_4$8, " of " + toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
4808
4808
  ]),
4809
4809
  ($props.pagination_data != null)
4810
4810
  ? (openBlock(), createElementBlock("nav", _hoisted_5$5, [
@@ -4886,7 +4886,7 @@ const _hoisted_3$7 = {
4886
4886
  "data-bs-toggle": "dropdown",
4887
4887
  "aria-expanded": "false"
4888
4888
  };
4889
- const _hoisted_4$6 = ["innerHTML"];
4889
+ const _hoisted_4$7 = ["innerHTML"];
4890
4890
  const _hoisted_5$4 = {
4891
4891
  class: "dropdown-menu sh-range-dropdown",
4892
4892
  "aria-labelledby": "dropdownMenuLink"
@@ -5012,7 +5012,7 @@ return (_ctx, _cache) => {
5012
5012
  createElementVNode("div", _hoisted_3$7, [
5013
5013
  _cache[2] || (_cache[2] = createElementVNode("i", { class: "bi-calendar text-dark" }, null, -1 /* HOISTED */)),
5014
5014
  _cache[3] || (_cache[3] = createTextVNode()),
5015
- createElementVNode("span", { innerHTML: rangeLabel.value }, null, 8 /* PROPS */, _hoisted_4$6)
5015
+ createElementVNode("span", { innerHTML: rangeLabel.value }, null, 8 /* PROPS */, _hoisted_4$7)
5016
5016
  ]),
5017
5017
  createElementVNode("div", _hoisted_5$4, [
5018
5018
  createElementVNode("ul", _hoisted_6$4, [
@@ -5072,7 +5072,7 @@ const _hoisted_2$8 = {
5072
5072
  class: "col-md-4 mb-2"
5073
5073
  };
5074
5074
  const _hoisted_3$6 = ["disabled"];
5075
- const _hoisted_4$5 = {
5075
+ const _hoisted_4$6 = {
5076
5076
  key: 1,
5077
5077
  class: "row"
5078
5078
  };
@@ -5574,7 +5574,7 @@ return (_ctx, _cache) => {
5574
5574
  ]))
5575
5575
  : createCommentVNode("v-if", true),
5576
5576
  (!__props.hideSearch)
5577
- ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
5577
+ ? (openBlock(), createElementBlock("div", _hoisted_4$6, [
5578
5578
  createElementVNode("div", _hoisted_5$3, [
5579
5579
  createElementVNode("div", {
5580
5580
  class: normalizeClass(["sh-search-bar input-group", __props.hasRange ? 'me-2':''])
@@ -5983,11 +5983,15 @@ return (_ctx, _cache) => {
5983
5983
  script$d.__file = "src/lib/components/ShTable.vue";
5984
5984
 
5985
5985
  const _hoisted_1$a = {
5986
+ key: 0,
5987
+ class: "sh_tab_count"
5988
+ };
5989
+ const _hoisted_2$7 = {
5986
5990
  key: 1,
5987
5991
  class: "alert alert-warning"
5988
5992
  };
5989
- const _hoisted_2$7 = { key: 0 };
5990
- const _hoisted_3$5 = { key: 1 };
5993
+ const _hoisted_3$5 = { key: 0 };
5994
+ const _hoisted_4$5 = { key: 1 };
5991
5995
 
5992
5996
 
5993
5997
  var script$c = {
@@ -6032,16 +6036,27 @@ const currentTab = ref('');
6032
6036
  const path = ref(route.path);
6033
6037
  const allowedTabs = ref([]);
6034
6038
  const {user} = storeToRefs(useUserStore());
6039
+ const realTabCounts = ref({});
6035
6040
  onMounted(()=>{
6036
6041
  if(props.tabs.length === 0){
6037
6042
  return;
6038
6043
  }
6039
6044
  allowedTabs.value = props.tabs.filter(tab=>{
6040
- if(typeof tab === 'object' && tab.permission){
6041
- if(user.value && user.value.isAllowedTo(tab.permission)){
6042
- return tab
6045
+ if(typeof tab === 'object'){
6046
+ if(tab.count || tab.counts){
6047
+ realTabCounts.value[tab.name || tab.key] = tab.count || tab.counts;
6048
+ }
6049
+ if(tab.validator){
6050
+ if(tab.validator()){
6051
+ return tab
6052
+ }
6053
+ return false
6054
+ } else if(tab.permission){
6055
+ if(user.value && user.value.isAllowedTo(tab.permission)){
6056
+ return tab
6057
+ }
6058
+ return false
6043
6059
  }
6044
- return false
6045
6060
  }
6046
6061
  return tab
6047
6062
  });
@@ -6051,9 +6066,12 @@ onMounted(()=>{
6051
6066
  }
6052
6067
  });
6053
6068
 
6054
- watch(()=>props.tabCounts, () => {
6069
+ watch(()=>props, () => {
6070
+ console.log('changed');
6055
6071
  resetTabCounts();
6056
- });
6072
+ },{
6073
+ deep: true}
6074
+ );
6057
6075
 
6058
6076
  watch(()=>route.path,()=>{
6059
6077
  route.fullPath.split('/');
@@ -6074,15 +6092,6 @@ const setTab = (tab) => {
6074
6092
  currentTab.value = label.replace(/_/g, ' ');
6075
6093
  }
6076
6094
  };
6077
- const setTabCounts = (tabCounts) => {
6078
- if (typeof tabCounts === 'object') {
6079
- setCounts(tabCounts);
6080
- } else {
6081
- shApis.doGet(tabCounts).then(res => {
6082
- setCounts(res.data);
6083
- });
6084
- }
6085
- };
6086
6095
  const resetTabCounts = () => {
6087
6096
  const arr = route.fullPath.split('/');
6088
6097
  if (!tabExistsInUrl()) {
@@ -6090,9 +6099,17 @@ const resetTabCounts = () => {
6090
6099
  } else {
6091
6100
  setTab(arr[arr.length - 1]);
6092
6101
  }
6093
- if (props.tabCounts) {
6094
- setTabCounts(props.tabCounts);
6102
+ let tbCounts = props.tabCounts;
6103
+ // merge with realTabCounts
6104
+ if (tbCounts && typeof tbCounts === 'object') {
6105
+ realTabCounts.value = {...realTabCounts.value, ...tbCounts};
6106
+ } else if(typeof tbCounts === 'string') {
6107
+ // it is a string fetch from api
6108
+ shApis.doGet(tbCounts).then(res => {
6109
+ realTabCounts.value = {...realTabCounts.value, ...res.data};
6110
+ });
6095
6111
  }
6112
+
6096
6113
  };
6097
6114
  const tabExistsInUrl = () => {
6098
6115
  let exists = false;
@@ -6104,19 +6121,6 @@ const tabExistsInUrl = () => {
6104
6121
  });
6105
6122
  return exists
6106
6123
  };
6107
- const setCounts = (res) => {
6108
- Object.keys(res).forEach(key => {
6109
- let elem = document.getElementsByClassName('sh_tab_' + key);
6110
- if (elem.length > 0) {
6111
- elem = elem[0];
6112
- let txt = elem.innerHTML;
6113
- txt = txt.split('<i class="d-none"></i>')[0];
6114
- if (parseInt(res[key]) > 0) {
6115
- elem.innerHTML = txt + '<i class="d-none"></i><sup class="sh_tab_count">' + res[key] + '</sup>';
6116
- }
6117
- }
6118
- });
6119
- };
6120
6124
 
6121
6125
  const getTabKey = (tab)=>{
6122
6126
  if(typeof tab === 'string') {
@@ -6147,49 +6151,55 @@ return (_ctx, _cache) => {
6147
6151
  const _component_router_view = resolveComponent("router-view");
6148
6152
  const _directive_if_user_can = resolveDirective("if-user-can");
6149
6153
 
6150
- return (allowedTabs.value.length > 0)
6151
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
6152
- createElementVNode("ul", {
6153
- class: normalizeClass(["nav nav-tabs sh-tabs", __props.classes ?? unref(shRepo).getShConfig('tabsClass','sh-tabs nav-tabs-bordered')])
6154
- }, [
6155
- (openBlock(true), createElementBlock(Fragment, null, renderList(allowedTabs.value, (tab) => {
6156
- return withDirectives((openBlock(), createElementBlock("li", {
6157
- class: "nav-item",
6158
- key: getTabKey(tab)
6159
- }, [
6160
- createVNode(_component_router_link, {
6161
- onClick: $event => (setTab(tab)),
6162
- "active-class": 'active',
6163
- class: normalizeClass(["nav-link text-capitalize", 'sh_tab_' + getTabKey(tab)]),
6164
- to: __props.baseUrl+'/tab/'+getTabKey(tab),
6165
- role: "tab"
6166
- }, {
6167
- default: withCtx(() => [
6168
- createTextVNode(toDisplayString(getTabLabel(tab)), 1 /* TEXT */)
6169
- ]),
6170
- _: 2 /* DYNAMIC */
6171
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "to", "class"])
6172
- ])), [
6173
- [_directive_if_user_can, getTabPermission(tab)]
6174
- ])
6175
- }), 128 /* KEYED_FRAGMENT */))
6176
- ], 2 /* CLASS */),
6177
- createElementVNode("div", {
6178
- class: normalizeClass(["tab-content", __props.classTwo])
6179
- }, [
6180
- (openBlock(), createBlock(_component_router_view, mergeProps(_ctx.$attrs, {
6181
- currentTab: currentTab.value,
6182
- key: path.value,
6183
- sharedData: __props.sharedData,
6184
- tabCounts: __props.tabCounts
6185
- }), null, 16 /* FULL_PROPS */, ["currentTab", "sharedData", "tabCounts"]))
6186
- ], 2 /* CLASS */)
6187
- ], 64 /* STABLE_FRAGMENT */))
6188
- : (openBlock(), createElementBlock("div", _hoisted_1$a, [
6189
- (__props.tabs.length)
6190
- ? (openBlock(), createElementBlock("div", _hoisted_2$7, " 403 Not Allowed "))
6191
- : (openBlock(), createElementBlock("div", _hoisted_3$5, " No tabs found "))
6192
- ]))
6154
+ return (openBlock(), createElementBlock(Fragment, null, [
6155
+ createTextVNode(toDisplayString(currentTab.value) + " ", 1 /* TEXT */),
6156
+ (allowedTabs.value.length > 0)
6157
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
6158
+ createElementVNode("ul", {
6159
+ class: normalizeClass(["nav nav-tabs sh-tabs", __props.classes ?? unref(shRepo).getShConfig('tabsClass','sh-tabs nav-tabs-bordered')])
6160
+ }, [
6161
+ (openBlock(true), createElementBlock(Fragment, null, renderList(allowedTabs.value, (tab) => {
6162
+ return withDirectives((openBlock(), createElementBlock("li", {
6163
+ class: "nav-item",
6164
+ key: getTabKey(tab)
6165
+ }, [
6166
+ createVNode(_component_router_link, {
6167
+ onClick: $event => (setTab(tab)),
6168
+ "active-class": 'active',
6169
+ class: normalizeClass(["nav-link text-capitalize", 'sh_tab_' + getTabKey(tab)]),
6170
+ to: __props.baseUrl+'/tab/'+getTabKey(tab),
6171
+ role: "tab"
6172
+ }, {
6173
+ default: withCtx(() => [
6174
+ createTextVNode(toDisplayString(getTabLabel(tab)) + " ", 1 /* TEXT */),
6175
+ (realTabCounts.value[getTabKey(tab)] !== undefined && realTabCounts.value[getTabKey(tab)] > 0)
6176
+ ? (openBlock(), createElementBlock("sup", _hoisted_1$a, " (" + toDisplayString(realTabCounts.value[getTabKey(tab)]) + ") ", 1 /* TEXT */))
6177
+ : createCommentVNode("v-if", true)
6178
+ ]),
6179
+ _: 2 /* DYNAMIC */
6180
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "to", "class"])
6181
+ ])), [
6182
+ [_directive_if_user_can, getTabPermission(tab)]
6183
+ ])
6184
+ }), 128 /* KEYED_FRAGMENT */))
6185
+ ], 2 /* CLASS */),
6186
+ createElementVNode("div", {
6187
+ class: normalizeClass(["tab-content", __props.classTwo])
6188
+ }, [
6189
+ (openBlock(), createBlock(_component_router_view, mergeProps(_ctx.$attrs, {
6190
+ currentTab: currentTab.value,
6191
+ key: path.value,
6192
+ sharedData: __props.sharedData,
6193
+ tabCounts: __props.tabCounts
6194
+ }), null, 16 /* FULL_PROPS */, ["currentTab", "sharedData", "tabCounts"]))
6195
+ ], 2 /* CLASS */)
6196
+ ], 64 /* STABLE_FRAGMENT */))
6197
+ : (openBlock(), createElementBlock("div", _hoisted_2$7, [
6198
+ (__props.tabs.length)
6199
+ ? (openBlock(), createElementBlock("div", _hoisted_3$5, " 403 Not Allowed "))
6200
+ : (openBlock(), createElementBlock("div", _hoisted_4$5, " No tabs found "))
6201
+ ]))
6202
+ ], 64 /* STABLE_FRAGMENT */))
6193
6203
  }
6194
6204
  }
6195
6205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.4.6",
3
+ "version": "5.4.9",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",