@iankibetsh/shframework 0.4.1 → 0.4.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.
package/dist/library.js CHANGED
@@ -1612,7 +1612,7 @@ const _hoisted_2$6 = {
1612
1612
  style: {"display":"contents"}
1613
1613
  };
1614
1614
  const _hoisted_3$6 = ["src"];
1615
- const _hoisted_4$5 = ["value"];
1615
+ const _hoisted_4$6 = ["value"];
1616
1616
 
1617
1617
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1618
1618
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
@@ -1631,7 +1631,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1631
1631
  return (vue.openBlock(), vue.createElementBlock("option", {
1632
1632
  value: country,
1633
1633
  key: country.dialCode
1634
- }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$5))
1634
+ }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$6))
1635
1635
  }), 128 /* KEYED_FRAGMENT */))
1636
1636
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
1637
1637
  [vue.vModelSelect, $data.selectedCountry]
@@ -2033,10 +2033,10 @@ const _hoisted_2$5 = {
2033
2033
  class: "alert alert-danger"
2034
2034
  };
2035
2035
  const _hoisted_3$5 = /*#__PURE__*/vue.createElementVNode("i", { class: "fa fa-warning" }, null, -1 /* HOISTED */);
2036
- const _hoisted_4$4 = /*#__PURE__*/vue.createTextVNode(" Error");
2037
- const _hoisted_5$3 = [
2036
+ const _hoisted_4$5 = /*#__PURE__*/vue.createTextVNode(" Error");
2037
+ const _hoisted_5$4 = [
2038
2038
  _hoisted_3$5,
2039
- _hoisted_4$4
2039
+ _hoisted_4$5
2040
2040
  ];
2041
2041
  const _hoisted_6$2 = { class: "row" };
2042
2042
  const _hoisted_7$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
@@ -2090,7 +2090,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2090
2090
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2091
2091
  vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2092
2092
  (_ctx.form_status == 3)
2093
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, _hoisted_5$3))
2093
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, _hoisted_5$4))
2094
2094
  : vue.createCommentVNode("v-if", true),
2095
2095
  vue.withDirectives(vue.createElementVNode("input", {
2096
2096
  type: "hidden",
@@ -2293,7 +2293,7 @@ const _hoisted_3$4 = {
2293
2293
  class: "offcanvas-title",
2294
2294
  id: "offcanvasScrollingLabel"
2295
2295
  };
2296
- const _hoisted_4$3 = { class: "offcanvas-body" };
2296
+ const _hoisted_4$4 = { class: "offcanvas-body" };
2297
2297
 
2298
2298
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2299
2299
  return (vue.openBlock(), vue.createElementBlock("div", {
@@ -2314,7 +2314,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2314
2314
  "aria-label": "Close"
2315
2315
  }, null, 512 /* NEED_PATCH */)
2316
2316
  ]),
2317
- vue.createElementVNode("div", _hoisted_4$3, [
2317
+ vue.createElementVNode("div", _hoisted_4$4, [
2318
2318
  vue.renderSlot(_ctx.$slots, "default")
2319
2319
  ])
2320
2320
  ], 10 /* CLASS, PROPS */, _hoisted_1$4))
@@ -2333,8 +2333,8 @@ var script$3 = {
2333
2333
  const _hoisted_1$3 = ["id"];
2334
2334
  const _hoisted_2$3 = { class: "modal-content" };
2335
2335
  const _hoisted_3$3 = { class: "modal-header" };
2336
- const _hoisted_4$2 = { class: "modal-title" };
2337
- const _hoisted_5$2 = /*#__PURE__*/vue.createElementVNode("button", {
2336
+ const _hoisted_4$3 = { class: "modal-title" };
2337
+ const _hoisted_5$3 = /*#__PURE__*/vue.createElementVNode("button", {
2338
2338
  class: "btn btn-danger btn-sm",
2339
2339
  "data-bs-dismiss": "modal",
2340
2340
  "data-dismiss": "modal"
@@ -2355,8 +2355,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2355
2355
  }, [
2356
2356
  vue.createElementVNode("div", _hoisted_2$3, [
2357
2357
  vue.createElementVNode("div", _hoisted_3$3, [
2358
- vue.createElementVNode("h3", _hoisted_4$2, vue.toDisplayString($props.modalTitle), 1 /* TEXT */),
2359
- _hoisted_5$2
2358
+ vue.createElementVNode("h3", _hoisted_4$3, vue.toDisplayString($props.modalTitle), 1 /* TEXT */),
2359
+ _hoisted_5$3
2360
2360
  ]),
2361
2361
  vue.createElementVNode("div", _hoisted_6$1, [
2362
2362
  vue.createElementVNode("div", _hoisted_7$1, [
@@ -2445,10 +2445,10 @@ var script$2 = {
2445
2445
  const _hoisted_1$2 = { key: 0 };
2446
2446
  const _hoisted_2$2 = { class: "record_count_body mb-3" };
2447
2447
  const _hoisted_3$2 = /*#__PURE__*/vue.createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2448
- const _hoisted_4$1 = /*#__PURE__*/vue.createTextVNode("  ");
2449
- const _hoisted_5$1 = /*#__PURE__*/vue.createStaticVNode("<option value=\"10\">10</option><option value=\"25\">25</option><option value=\"50\">50</option><option value=\"100\">100</option><option value=\"200\">200</option>", 5);
2448
+ const _hoisted_4$2 = /*#__PURE__*/vue.createTextVNode("  ");
2449
+ const _hoisted_5$2 = /*#__PURE__*/vue.createStaticVNode("<option value=\"10\">10</option><option value=\"25\">25</option><option value=\"50\">50</option><option value=\"100\">100</option><option value=\"200\">200</option>", 5);
2450
2450
  const _hoisted_10$1 = [
2451
- _hoisted_5$1
2451
+ _hoisted_5$2
2452
2452
  ];
2453
2453
  const _hoisted_11$1 = { class: "record_counts" };
2454
2454
  const _hoisted_12$1 = {
@@ -2492,7 +2492,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2492
2492
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
2493
2493
  vue.createElementVNode("div", _hoisted_2$2, [
2494
2494
  _hoisted_3$2,
2495
- _hoisted_4$1,
2495
+ _hoisted_4$2,
2496
2496
  vue.withDirectives(vue.createElementVNode("select", {
2497
2497
  class: "select_per_page",
2498
2498
  onChange: _cache[0] || (_cache[0] = (...args) => ($options.changePerPage && $options.changePerPage(...args))),
@@ -2959,8 +2959,8 @@ const _hoisted_2$1 = {
2959
2959
  class: "col-md-4 mb-2"
2960
2960
  };
2961
2961
  const _hoisted_3$1 = ["disabled"];
2962
- const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
2963
- const _hoisted_5 = /*#__PURE__*/vue.createTextVNode(" Export ");
2962
+ const _hoisted_4$1 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
2963
+ const _hoisted_5$1 = /*#__PURE__*/vue.createTextVNode(" Export ");
2964
2964
  const _hoisted_6 = /*#__PURE__*/vue.createElementVNode("span", {
2965
2965
  class: "spinner-border spinner-border-sm",
2966
2966
  role: "status",
@@ -3126,8 +3126,8 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3126
3126
  }, [
3127
3127
  (!$data.downloading)
3128
3128
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3129
- _hoisted_4,
3130
- _hoisted_5
3129
+ _hoisted_4$1,
3130
+ _hoisted_5$1
3131
3131
  ], 64 /* STABLE_FRAGMENT */))
3132
3132
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
3133
3133
  _hoisted_6,
@@ -3447,10 +3447,12 @@ script$1.__file = "src/views/ShTable.vue";
3447
3447
 
3448
3448
  var script = {
3449
3449
  name: 'ShTabs',
3450
- props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts'],
3450
+ props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive'],
3451
3451
  data () {
3452
3452
  return {
3453
- currentTab: ''
3453
+ currentTab: '',
3454
+ generatedId: null,
3455
+ isResponsive: typeof this.responsive !== 'undefined'
3454
3456
  }
3455
3457
  },
3456
3458
  watch: {
@@ -3470,9 +3472,14 @@ var script = {
3470
3472
  }
3471
3473
  },
3472
3474
  mounted () {
3475
+ this.generatedId = 'tab' + Math.random().toString(36).slice(2);
3473
3476
  this.resetTabCounts();
3477
+ this.setTab(this.tabs[0]);
3474
3478
  },
3475
3479
  methods: {
3480
+ setTab: function(tab){
3481
+ this.currentTab = tab.replace(/_/g, ' ');
3482
+ },
3476
3483
  setTabCounts: function (tabCounts) {
3477
3484
  if (typeof tabCounts === 'object') {
3478
3485
  this.setCounts(tabCounts);
@@ -3504,7 +3511,7 @@ var script = {
3504
3511
  },
3505
3512
  setCounts: function (res) {
3506
3513
  Object.keys(res).forEach(key => {
3507
- const elem = document.getElementById('sh_tab_' + key);
3514
+ let elem = document.getElementsByClassName('sh_tab_' + key);
3508
3515
  if (elem) {
3509
3516
  let txt = elem.innerHTML;
3510
3517
  txt = txt.split('<i class="d-none"></i>')[0];
@@ -3517,47 +3524,75 @@ var script = {
3517
3524
  }
3518
3525
  };
3519
3526
 
3520
- const _hoisted_1 = { class: "common_tabs sh-horizontal-tabs" };
3521
- const _hoisted_2 = {
3522
- class: "nav nav-tabs mb-2",
3523
- role: "tablist"
3527
+ const _hoisted_1 = {
3528
+ key: 0,
3529
+ class: "navbar navbar-expand-lg sh-horizontal-tabs"
3524
3530
  };
3525
- const _hoisted_3 = { class: "tab-content" };
3531
+ const _hoisted_2 = ["data-bs-target"];
3532
+ const _hoisted_3 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-chevron-right float-end" }, null, -1 /* HOISTED */);
3533
+ const _hoisted_4 = ["id"];
3534
+ const _hoisted_5 = { class: "tab-content" };
3526
3535
 
3527
3536
  function render(_ctx, _cache, $props, $setup, $data, $options) {
3528
3537
  const _component_router_link = vue.resolveComponent("router-link");
3529
3538
  const _component_router_view = vue.resolveComponent("router-view");
3530
3539
 
3531
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
3532
- vue.createElementVNode("ul", _hoisted_2, [
3533
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.tabs, (tab) => {
3534
- return (vue.openBlock(), vue.createElementBlock("li", {
3535
- class: "nav-item",
3536
- key: tab
3537
- }, [
3538
- vue.createVNode(_component_router_link, {
3539
- "active-class": 'active',
3540
- class: "nav-link text-capitalize",
3541
- to: $props.baseUrl+'/tab/'+tab,
3542
- role: "tab",
3543
- id: 'sh_tab_' + tab
3544
- }, {
3545
- default: vue.withCtx(() => [
3546
- vue.createTextVNode(vue.toDisplayString(tab.replace(/_/g, ' ')), 1 /* TEXT */)
3547
- ]),
3548
- _: 2 /* DYNAMIC */
3549
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to", "id"])
3540
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3541
+ ($data.generatedId)
3542
+ ? (vue.openBlock(), vue.createElementBlock("nav", _hoisted_1, [
3543
+ ($data.isResponsive)
3544
+ ? (vue.openBlock(), vue.createElementBlock("a", {
3545
+ key: 0,
3546
+ href: "#",
3547
+ class: "form-control navbar-toggler text-capitalize",
3548
+ "data-bs-toggle": "collapse",
3549
+ "data-bs-target": '#' + $data.generatedId,
3550
+ "aria-controls": "navbarNav",
3551
+ "aria-expanded": "false",
3552
+ "aria-label": "Toggle navigation"
3553
+ }, [
3554
+ vue.createTextVNode(vue.toDisplayString($data.currentTab) + " ", 1 /* TEXT */),
3555
+ _hoisted_3
3556
+ ], 8 /* PROPS */, _hoisted_2))
3557
+ : vue.createCommentVNode("v-if", true),
3558
+ vue.createElementVNode("div", {
3559
+ class: vue.normalizeClass($data.isResponsive ? 'collapse navbar-collapse':''),
3560
+ id: $data.generatedId
3561
+ }, [
3562
+ vue.createElementVNode("ul", {
3563
+ class: vue.normalizeClass($data.isResponsive ? 'navbar-nav nav':'nav')
3564
+ }, [
3565
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.tabs, (tab) => {
3566
+ return (vue.openBlock(), vue.createElementBlock("li", {
3567
+ class: "nav-item",
3568
+ key: tab
3569
+ }, [
3570
+ vue.createVNode(_component_router_link, {
3571
+ onClick: $event => ($options.setTab(tab)),
3572
+ "active-class": 'active',
3573
+ class: vue.normalizeClass(["nav-link text-capitalize", 'sh_tab_' + tab]),
3574
+ to: $props.baseUrl+'/tab/'+tab,
3575
+ role: "tab"
3576
+ }, {
3577
+ default: vue.withCtx(() => [
3578
+ vue.createTextVNode(vue.toDisplayString(tab.replace(/_/g, ' ')), 1 /* TEXT */)
3579
+ ]),
3580
+ _: 2 /* DYNAMIC */
3581
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "to", "class"])
3582
+ ]))
3583
+ }), 128 /* KEYED_FRAGMENT */))
3584
+ ], 2 /* CLASS */)
3585
+ ], 10 /* CLASS, PROPS */, _hoisted_4)
3550
3586
  ]))
3551
- }), 128 /* KEYED_FRAGMENT */))
3552
- ]),
3553
- vue.createElementVNode("div", _hoisted_3, [
3587
+ : vue.createCommentVNode("v-if", true),
3588
+ vue.createElementVNode("div", _hoisted_5, [
3554
3589
  vue.createVNode(_component_router_view, {
3555
3590
  currentTab: $data.currentTab,
3556
3591
  sharedData: $props.sharedData,
3557
3592
  tabCounts: $props.tabCounts
3558
3593
  }, null, 8 /* PROPS */, ["currentTab", "sharedData", "tabCounts"])
3559
3594
  ])
3560
- ]))
3595
+ ], 64 /* STABLE_FRAGMENT */))
3561
3596
  }
3562
3597
 
3563
3598
  script.render = render;
package/dist/library.mjs CHANGED
@@ -1600,7 +1600,7 @@ const _hoisted_2$6 = {
1600
1600
  style: {"display":"contents"}
1601
1601
  };
1602
1602
  const _hoisted_3$6 = ["src"];
1603
- const _hoisted_4$5 = ["value"];
1603
+ const _hoisted_4$6 = ["value"];
1604
1604
 
1605
1605
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1606
1606
  return (openBlock(), createElementBlock("div", _hoisted_1$7, [
@@ -1619,7 +1619,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1619
1619
  return (openBlock(), createElementBlock("option", {
1620
1620
  value: country,
1621
1621
  key: country.dialCode
1622
- }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$5))
1622
+ }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$6))
1623
1623
  }), 128 /* KEYED_FRAGMENT */))
1624
1624
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
1625
1625
  [vModelSelect, $data.selectedCountry]
@@ -2021,10 +2021,10 @@ const _hoisted_2$5 = {
2021
2021
  class: "alert alert-danger"
2022
2022
  };
2023
2023
  const _hoisted_3$5 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-warning" }, null, -1 /* HOISTED */);
2024
- const _hoisted_4$4 = /*#__PURE__*/createTextVNode(" Error");
2025
- const _hoisted_5$3 = [
2024
+ const _hoisted_4$5 = /*#__PURE__*/createTextVNode(" Error");
2025
+ const _hoisted_5$4 = [
2026
2026
  _hoisted_3$5,
2027
- _hoisted_4$4
2027
+ _hoisted_4$5
2028
2028
  ];
2029
2029
  const _hoisted_6$2 = { class: "row" };
2030
2030
  const _hoisted_7$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
@@ -2078,7 +2078,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2078
2078
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2079
2079
  createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2080
2080
  (_ctx.form_status == 3)
2081
- ? (openBlock(), createElementBlock("div", _hoisted_2$5, _hoisted_5$3))
2081
+ ? (openBlock(), createElementBlock("div", _hoisted_2$5, _hoisted_5$4))
2082
2082
  : createCommentVNode("v-if", true),
2083
2083
  withDirectives(createElementVNode("input", {
2084
2084
  type: "hidden",
@@ -2281,7 +2281,7 @@ const _hoisted_3$4 = {
2281
2281
  class: "offcanvas-title",
2282
2282
  id: "offcanvasScrollingLabel"
2283
2283
  };
2284
- const _hoisted_4$3 = { class: "offcanvas-body" };
2284
+ const _hoisted_4$4 = { class: "offcanvas-body" };
2285
2285
 
2286
2286
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2287
2287
  return (openBlock(), createElementBlock("div", {
@@ -2302,7 +2302,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2302
2302
  "aria-label": "Close"
2303
2303
  }, null, 512 /* NEED_PATCH */)
2304
2304
  ]),
2305
- createElementVNode("div", _hoisted_4$3, [
2305
+ createElementVNode("div", _hoisted_4$4, [
2306
2306
  renderSlot(_ctx.$slots, "default")
2307
2307
  ])
2308
2308
  ], 10 /* CLASS, PROPS */, _hoisted_1$4))
@@ -2321,8 +2321,8 @@ var script$3 = {
2321
2321
  const _hoisted_1$3 = ["id"];
2322
2322
  const _hoisted_2$3 = { class: "modal-content" };
2323
2323
  const _hoisted_3$3 = { class: "modal-header" };
2324
- const _hoisted_4$2 = { class: "modal-title" };
2325
- const _hoisted_5$2 = /*#__PURE__*/createElementVNode("button", {
2324
+ const _hoisted_4$3 = { class: "modal-title" };
2325
+ const _hoisted_5$3 = /*#__PURE__*/createElementVNode("button", {
2326
2326
  class: "btn btn-danger btn-sm",
2327
2327
  "data-bs-dismiss": "modal",
2328
2328
  "data-dismiss": "modal"
@@ -2343,8 +2343,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2343
2343
  }, [
2344
2344
  createElementVNode("div", _hoisted_2$3, [
2345
2345
  createElementVNode("div", _hoisted_3$3, [
2346
- createElementVNode("h3", _hoisted_4$2, toDisplayString($props.modalTitle), 1 /* TEXT */),
2347
- _hoisted_5$2
2346
+ createElementVNode("h3", _hoisted_4$3, toDisplayString($props.modalTitle), 1 /* TEXT */),
2347
+ _hoisted_5$3
2348
2348
  ]),
2349
2349
  createElementVNode("div", _hoisted_6$1, [
2350
2350
  createElementVNode("div", _hoisted_7$1, [
@@ -2433,10 +2433,10 @@ var script$2 = {
2433
2433
  const _hoisted_1$2 = { key: 0 };
2434
2434
  const _hoisted_2$2 = { class: "record_count_body mb-3" };
2435
2435
  const _hoisted_3$2 = /*#__PURE__*/createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2436
- const _hoisted_4$1 = /*#__PURE__*/createTextVNode("  ");
2437
- const _hoisted_5$1 = /*#__PURE__*/createStaticVNode("<option value=\"10\">10</option><option value=\"25\">25</option><option value=\"50\">50</option><option value=\"100\">100</option><option value=\"200\">200</option>", 5);
2436
+ const _hoisted_4$2 = /*#__PURE__*/createTextVNode("  ");
2437
+ const _hoisted_5$2 = /*#__PURE__*/createStaticVNode("<option value=\"10\">10</option><option value=\"25\">25</option><option value=\"50\">50</option><option value=\"100\">100</option><option value=\"200\">200</option>", 5);
2438
2438
  const _hoisted_10$1 = [
2439
- _hoisted_5$1
2439
+ _hoisted_5$2
2440
2440
  ];
2441
2441
  const _hoisted_11$1 = { class: "record_counts" };
2442
2442
  const _hoisted_12$1 = {
@@ -2480,7 +2480,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2480
2480
  ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
2481
2481
  createElementVNode("div", _hoisted_2$2, [
2482
2482
  _hoisted_3$2,
2483
- _hoisted_4$1,
2483
+ _hoisted_4$2,
2484
2484
  withDirectives(createElementVNode("select", {
2485
2485
  class: "select_per_page",
2486
2486
  onChange: _cache[0] || (_cache[0] = (...args) => ($options.changePerPage && $options.changePerPage(...args))),
@@ -2947,8 +2947,8 @@ const _hoisted_2$1 = {
2947
2947
  class: "col-md-4 mb-2"
2948
2948
  };
2949
2949
  const _hoisted_3$1 = ["disabled"];
2950
- const _hoisted_4 = /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
2951
- const _hoisted_5 = /*#__PURE__*/createTextVNode(" Export ");
2950
+ const _hoisted_4$1 = /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
2951
+ const _hoisted_5$1 = /*#__PURE__*/createTextVNode(" Export ");
2952
2952
  const _hoisted_6 = /*#__PURE__*/createElementVNode("span", {
2953
2953
  class: "spinner-border spinner-border-sm",
2954
2954
  role: "status",
@@ -3114,8 +3114,8 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3114
3114
  }, [
3115
3115
  (!$data.downloading)
3116
3116
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3117
- _hoisted_4,
3118
- _hoisted_5
3117
+ _hoisted_4$1,
3118
+ _hoisted_5$1
3119
3119
  ], 64 /* STABLE_FRAGMENT */))
3120
3120
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3121
3121
  _hoisted_6,
@@ -3435,10 +3435,12 @@ script$1.__file = "src/views/ShTable.vue";
3435
3435
 
3436
3436
  var script = {
3437
3437
  name: 'ShTabs',
3438
- props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts'],
3438
+ props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive'],
3439
3439
  data () {
3440
3440
  return {
3441
- currentTab: ''
3441
+ currentTab: '',
3442
+ generatedId: null,
3443
+ isResponsive: typeof this.responsive !== 'undefined'
3442
3444
  }
3443
3445
  },
3444
3446
  watch: {
@@ -3458,9 +3460,14 @@ var script = {
3458
3460
  }
3459
3461
  },
3460
3462
  mounted () {
3463
+ this.generatedId = 'tab' + Math.random().toString(36).slice(2);
3461
3464
  this.resetTabCounts();
3465
+ this.setTab(this.tabs[0]);
3462
3466
  },
3463
3467
  methods: {
3468
+ setTab: function(tab){
3469
+ this.currentTab = tab.replace(/_/g, ' ');
3470
+ },
3464
3471
  setTabCounts: function (tabCounts) {
3465
3472
  if (typeof tabCounts === 'object') {
3466
3473
  this.setCounts(tabCounts);
@@ -3492,7 +3499,7 @@ var script = {
3492
3499
  },
3493
3500
  setCounts: function (res) {
3494
3501
  Object.keys(res).forEach(key => {
3495
- const elem = document.getElementById('sh_tab_' + key);
3502
+ let elem = document.getElementsByClassName('sh_tab_' + key);
3496
3503
  if (elem) {
3497
3504
  let txt = elem.innerHTML;
3498
3505
  txt = txt.split('<i class="d-none"></i>')[0];
@@ -3505,47 +3512,75 @@ var script = {
3505
3512
  }
3506
3513
  };
3507
3514
 
3508
- const _hoisted_1 = { class: "common_tabs sh-horizontal-tabs" };
3509
- const _hoisted_2 = {
3510
- class: "nav nav-tabs mb-2",
3511
- role: "tablist"
3515
+ const _hoisted_1 = {
3516
+ key: 0,
3517
+ class: "navbar navbar-expand-lg sh-horizontal-tabs"
3512
3518
  };
3513
- const _hoisted_3 = { class: "tab-content" };
3519
+ const _hoisted_2 = ["data-bs-target"];
3520
+ const _hoisted_3 = /*#__PURE__*/createElementVNode("i", { class: "bi-chevron-right float-end" }, null, -1 /* HOISTED */);
3521
+ const _hoisted_4 = ["id"];
3522
+ const _hoisted_5 = { class: "tab-content" };
3514
3523
 
3515
3524
  function render(_ctx, _cache, $props, $setup, $data, $options) {
3516
3525
  const _component_router_link = resolveComponent("router-link");
3517
3526
  const _component_router_view = resolveComponent("router-view");
3518
3527
 
3519
- return (openBlock(), createElementBlock("div", _hoisted_1, [
3520
- createElementVNode("ul", _hoisted_2, [
3521
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.tabs, (tab) => {
3522
- return (openBlock(), createElementBlock("li", {
3523
- class: "nav-item",
3524
- key: tab
3525
- }, [
3526
- createVNode(_component_router_link, {
3527
- "active-class": 'active',
3528
- class: "nav-link text-capitalize",
3529
- to: $props.baseUrl+'/tab/'+tab,
3530
- role: "tab",
3531
- id: 'sh_tab_' + tab
3532
- }, {
3533
- default: withCtx(() => [
3534
- createTextVNode(toDisplayString(tab.replace(/_/g, ' ')), 1 /* TEXT */)
3535
- ]),
3536
- _: 2 /* DYNAMIC */
3537
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to", "id"])
3528
+ return (openBlock(), createElementBlock(Fragment, null, [
3529
+ ($data.generatedId)
3530
+ ? (openBlock(), createElementBlock("nav", _hoisted_1, [
3531
+ ($data.isResponsive)
3532
+ ? (openBlock(), createElementBlock("a", {
3533
+ key: 0,
3534
+ href: "#",
3535
+ class: "form-control navbar-toggler text-capitalize",
3536
+ "data-bs-toggle": "collapse",
3537
+ "data-bs-target": '#' + $data.generatedId,
3538
+ "aria-controls": "navbarNav",
3539
+ "aria-expanded": "false",
3540
+ "aria-label": "Toggle navigation"
3541
+ }, [
3542
+ createTextVNode(toDisplayString($data.currentTab) + " ", 1 /* TEXT */),
3543
+ _hoisted_3
3544
+ ], 8 /* PROPS */, _hoisted_2))
3545
+ : createCommentVNode("v-if", true),
3546
+ createElementVNode("div", {
3547
+ class: normalizeClass($data.isResponsive ? 'collapse navbar-collapse':''),
3548
+ id: $data.generatedId
3549
+ }, [
3550
+ createElementVNode("ul", {
3551
+ class: normalizeClass($data.isResponsive ? 'navbar-nav nav':'nav')
3552
+ }, [
3553
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.tabs, (tab) => {
3554
+ return (openBlock(), createElementBlock("li", {
3555
+ class: "nav-item",
3556
+ key: tab
3557
+ }, [
3558
+ createVNode(_component_router_link, {
3559
+ onClick: $event => ($options.setTab(tab)),
3560
+ "active-class": 'active',
3561
+ class: normalizeClass(["nav-link text-capitalize", 'sh_tab_' + tab]),
3562
+ to: $props.baseUrl+'/tab/'+tab,
3563
+ role: "tab"
3564
+ }, {
3565
+ default: withCtx(() => [
3566
+ createTextVNode(toDisplayString(tab.replace(/_/g, ' ')), 1 /* TEXT */)
3567
+ ]),
3568
+ _: 2 /* DYNAMIC */
3569
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "to", "class"])
3570
+ ]))
3571
+ }), 128 /* KEYED_FRAGMENT */))
3572
+ ], 2 /* CLASS */)
3573
+ ], 10 /* CLASS, PROPS */, _hoisted_4)
3538
3574
  ]))
3539
- }), 128 /* KEYED_FRAGMENT */))
3540
- ]),
3541
- createElementVNode("div", _hoisted_3, [
3575
+ : createCommentVNode("v-if", true),
3576
+ createElementVNode("div", _hoisted_5, [
3542
3577
  createVNode(_component_router_view, {
3543
3578
  currentTab: $data.currentTab,
3544
3579
  sharedData: $props.sharedData,
3545
3580
  tabCounts: $props.tabCounts
3546
3581
  }, null, 8 /* PROPS */, ["currentTab", "sharedData", "tabCounts"])
3547
3582
  ])
3548
- ]))
3583
+ ], 64 /* STABLE_FRAGMENT */))
3549
3584
  }
3550
3585
 
3551
3586
  script.render = render;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",