@iankibetsh/shframework 0.6.5 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import Axios from 'axios';
2
2
  import moment from 'moment';
3
- import { inject, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, shallowRef, resolveDynamicComponent, computed, isRef, vModelCheckbox } from 'vue';
3
+ import { inject, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, shallowRef, resolveDynamicComponent, computed, isRef, vModelCheckbox, watch, pushScopeId, popScopeId } from 'vue';
4
4
  import NProgress from 'nprogress';
5
5
  import Editor from '@tinymce/tinymce-vue';
6
6
  import Swal from 'sweetalert2';
7
7
  import { defineStore, storeToRefs } from 'pinia';
8
- import { useRoute } from 'vue-router';
8
+ import { useRoute, useRouter } from 'vue-router';
9
9
 
10
10
  function setItem (key, value) {
11
11
  let toStore = value;
@@ -62,9 +62,7 @@ const axios = Axios.create({
62
62
  baseURL: apiUrl
63
63
  });
64
64
  function doGet (endPoint, data) {
65
- if(!checkSession()){
66
- window.location.reload();
67
- }
65
+ if(!checkSession());
68
66
  return axios.get(endPoint, {
69
67
  params: data,
70
68
  crossOrigin: true,
@@ -75,9 +73,7 @@ function doGet (endPoint, data) {
75
73
  })
76
74
  }
77
75
  function doPost (endPoint, data) {
78
- if(!checkSession()){
79
- window.location.reload();
80
- }
76
+ if(!checkSession());
81
77
  return axios.post(endPoint,
82
78
  data,
83
79
  {
@@ -1566,7 +1562,7 @@ const countries = [
1566
1562
  }
1567
1563
  ];
1568
1564
 
1569
- var script$b = {
1565
+ var script$c = {
1570
1566
  name: 'ShPhone',
1571
1567
  props: ['modelValue', 'country_code'],
1572
1568
  data () {
@@ -1628,19 +1624,19 @@ var script$b = {
1628
1624
  }
1629
1625
  };
1630
1626
 
1631
- const _hoisted_1$b = { class: "sh-phone mb-3" };
1632
- const _hoisted_2$a = {
1627
+ const _hoisted_1$c = { class: "sh-phone mb-3" };
1628
+ const _hoisted_2$b = {
1633
1629
  key: 0,
1634
1630
  style: {"display":"contents"}
1635
1631
  };
1636
- const _hoisted_3$a = ["src"];
1637
- const _hoisted_4$a = ["value"];
1632
+ const _hoisted_3$b = ["src"];
1633
+ const _hoisted_4$b = ["value"];
1638
1634
 
1639
1635
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1640
- return (openBlock(), createElementBlock("div", _hoisted_1$b, [
1636
+ return (openBlock(), createElementBlock("div", _hoisted_1$c, [
1641
1637
  ($data.selectedCountry)
1642
- ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
1643
- createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$a),
1638
+ ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
1639
+ createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$b),
1644
1640
  createTextVNode(" " + toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
1645
1641
  ]))
1646
1642
  : createCommentVNode("v-if", true),
@@ -1653,7 +1649,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1653
1649
  return (openBlock(), createElementBlock("option", {
1654
1650
  value: country,
1655
1651
  key: country.dialCode
1656
- }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$a))
1652
+ }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$b))
1657
1653
  }), 128 /* KEYED_FRAGMENT */))
1658
1654
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
1659
1655
  [vModelSelect, $data.selectedCountry]
@@ -1671,10 +1667,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1671
1667
  ]))
1672
1668
  }
1673
1669
 
1674
- script$b.render = render$7;
1675
- script$b.__file = "src/lib/components/ShPhone.vue";
1670
+ script$c.render = render$7;
1671
+ script$c.__file = "src/lib/components/ShPhone.vue";
1676
1672
 
1677
- var script$a = {
1673
+ var script$b = {
1678
1674
  name: 'ShEditor',
1679
1675
  props: ['modelValue'],
1680
1676
  components: {
@@ -1713,7 +1709,7 @@ var script$a = {
1713
1709
  }
1714
1710
  };
1715
1711
 
1716
- const _hoisted_1$a = /*#__PURE__*/createElementVNode("textarea", {
1712
+ const _hoisted_1$b = /*#__PURE__*/createElementVNode("textarea", {
1717
1713
  id: "tiny",
1718
1714
  style: {"display":"none"},
1719
1715
  "data-cy": "tinymce_editor"
@@ -1723,7 +1719,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1723
1719
  const _component_editor = resolveComponent("editor");
1724
1720
 
1725
1721
  return (openBlock(), createElementBlock(Fragment, null, [
1726
- _hoisted_1$a,
1722
+ _hoisted_1$b,
1727
1723
  createElementVNode("div", {
1728
1724
  onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
1729
1725
  class: "sh-editor w-100"
@@ -1748,31 +1744,31 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1748
1744
  ], 64 /* STABLE_FRAGMENT */))
1749
1745
  }
1750
1746
 
1751
- script$a.render = render$6;
1752
- script$a.__file = "src/lib/components/FormComponent/ShEditor.vue";
1747
+ script$b.render = render$6;
1748
+ script$b.__file = "src/lib/components/FormComponent/ShEditor.vue";
1753
1749
 
1754
- const _hoisted_1$9 = {
1750
+ const _hoisted_1$a = {
1755
1751
  key: 0,
1756
1752
  class: "dropdown sh-suggest"
1757
1753
  };
1758
- const _hoisted_2$9 = ["id"];
1759
- const _hoisted_3$9 = { class: "badge bg-secondary m-1 sh-selected-item" };
1760
- const _hoisted_4$9 = ["onClick"];
1761
- const _hoisted_5$7 = ["id"];
1762
- const _hoisted_6$4 = ["id", "aria-labelledby"];
1763
- const _hoisted_7$3 = { key: 0 };
1764
- const _hoisted_8$2 = ["onClick"];
1765
- const _hoisted_9$2 = {
1754
+ const _hoisted_2$a = ["id"];
1755
+ const _hoisted_3$a = { class: "badge bg-secondary m-1 sh-selected-item" };
1756
+ const _hoisted_4$a = ["onClick"];
1757
+ const _hoisted_5$8 = ["id"];
1758
+ const _hoisted_6$5 = ["id", "aria-labelledby"];
1759
+ const _hoisted_7$4 = { key: 0 };
1760
+ const _hoisted_8$3 = ["onClick"];
1761
+ const _hoisted_9$3 = {
1766
1762
  key: 1,
1767
1763
  class: "dropdown-item sh-suggest-no-results"
1768
1764
  };
1769
- const _hoisted_10$3 = {
1765
+ const _hoisted_10$4 = {
1770
1766
  key: 2,
1771
1767
  class: "dropdown-item sh-suggest-no-input"
1772
1768
  };
1773
1769
 
1774
1770
 
1775
- var script$9 = {
1771
+ var script$a = {
1776
1772
  __name: 'ShSuggest',
1777
1773
  props: ['fillSelects','modelValue'],
1778
1774
  emits: ['update:modelValue'],
@@ -1853,7 +1849,7 @@ function filterData(e){
1853
1849
 
1854
1850
  return (_ctx, _cache) => {
1855
1851
  return (unref(id))
1856
- ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
1852
+ ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
1857
1853
  createElementVNode("div", {
1858
1854
  id: unref(id),
1859
1855
  "data-bs-toggle": "dropdown",
@@ -1862,14 +1858,14 @@ return (_ctx, _cache) => {
1862
1858
  }, [
1863
1859
  createElementVNode("div", null, [
1864
1860
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedSuggestions), (sgt) => {
1865
- return (openBlock(), createElementBlock("h5", _hoisted_3$9, [
1861
+ return (openBlock(), createElementBlock("h5", _hoisted_3$a, [
1866
1862
  createTextVNode(toDisplayString(sgt.name) + " ", 1 /* TEXT */),
1867
1863
  createElementVNode("button", {
1868
1864
  onClick: $event => (removeSuggestion(sgt.id)),
1869
1865
  type: "button",
1870
1866
  class: "btn-close border-start border-1 ms-1",
1871
1867
  "aria-label": "Close"
1872
- }, null, 8 /* PROPS */, _hoisted_4$9)
1868
+ }, null, 8 /* PROPS */, _hoisted_4$a)
1873
1869
  ]))
1874
1870
  }), 256 /* UNKEYED_FRAGMENT */))
1875
1871
  ]),
@@ -1879,8 +1875,8 @@ return (_ctx, _cache) => {
1879
1875
  onClick: filterData,
1880
1876
  onInput: filterData,
1881
1877
  class: "flex-fill h-100 sh-suggestion-input"
1882
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_5$7)
1883
- ], 8 /* PROPS */, _hoisted_2$9),
1878
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_5$8)
1879
+ ], 8 /* PROPS */, _hoisted_2$a),
1884
1880
  createElementVNode("ul", {
1885
1881
  class: "dropdown-menu w-100",
1886
1882
  id: 'dropwdown_section' + unref(id),
@@ -1892,20 +1888,20 @@ return (_ctx, _cache) => {
1892
1888
  key: suggestion.id
1893
1889
  }, [
1894
1890
  (suggestion.name)
1895
- ? (openBlock(), createElementBlock("li", _hoisted_7$3, [
1891
+ ? (openBlock(), createElementBlock("li", _hoisted_7$4, [
1896
1892
  createElementVNode("a", {
1897
1893
  onClick: $event => (addSuggestion(suggestion)),
1898
1894
  class: normalizeClass(["dropdown-item", unref(selectedSuggestions).includes(suggestion) ? 'active':'']),
1899
1895
  href: "#"
1900
- }, toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$2)
1896
+ }, toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$3)
1901
1897
  ]))
1902
1898
  : createCommentVNode("v-if", true)
1903
1899
  ], 64 /* STABLE_FRAGMENT */))
1904
1900
  }), 128 /* KEYED_FRAGMENT */))
1905
1901
  : (unref(searchText))
1906
- ? (openBlock(), createElementBlock("li", _hoisted_9$2, " No results found "))
1907
- : (openBlock(), createElementBlock("li", _hoisted_10$3, " Type to search... "))
1908
- ], 8 /* PROPS */, _hoisted_6$4)
1902
+ ? (openBlock(), createElementBlock("li", _hoisted_9$3, " No results found "))
1903
+ : (openBlock(), createElementBlock("li", _hoisted_10$4, " Type to search... "))
1904
+ ], 8 /* PROPS */, _hoisted_6$5)
1909
1905
  ]))
1910
1906
  : createCommentVNode("v-if", true)
1911
1907
  }
@@ -1913,15 +1909,15 @@ return (_ctx, _cache) => {
1913
1909
 
1914
1910
  };
1915
1911
 
1916
- script$9.__scopeId = "data-v-5b767123";
1917
- script$9.__file = "src/lib/components/FormComponent/ShSuggest.vue";
1912
+ script$a.__scopeId = "data-v-5b767123";
1913
+ script$a.__file = "src/lib/components/FormComponent/ShSuggest.vue";
1918
1914
 
1919
- var script$8 = {
1915
+ var script$9 = {
1920
1916
  name: 'ShForm',
1921
1917
  components: {
1922
- ShSuggest: script$9,
1923
- ShEditor: script$a,
1924
- ShPhone: script$b
1918
+ ShSuggest: script$a,
1919
+ ShEditor: script$b,
1920
+ ShPhone: script$c
1925
1921
  },
1926
1922
  props: [
1927
1923
  'action',
@@ -2228,23 +2224,23 @@ var script$8 = {
2228
2224
  }
2229
2225
  };
2230
2226
 
2231
- const _hoisted_1$8 = {
2227
+ const _hoisted_1$9 = {
2232
2228
  ref: "ShAutoForm",
2233
2229
  class: "sh-form"
2234
2230
  };
2235
- const _hoisted_2$8 = {
2231
+ const _hoisted_2$9 = {
2236
2232
  key: 0,
2237
2233
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2238
2234
  role: "alert"
2239
2235
  };
2240
- const _hoisted_3$8 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2241
- const _hoisted_4$8 = { key: 0 };
2242
- const _hoisted_5$6 = { key: 1 };
2243
- const _hoisted_6$3 = { class: "row" };
2244
- const _hoisted_7$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2245
- const _hoisted_8$1 = { class: "col-md-12" };
2246
- const _hoisted_9$1 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
2247
- const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2236
+ const _hoisted_3$9 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2237
+ const _hoisted_4$9 = { key: 0 };
2238
+ const _hoisted_5$7 = { key: 1 };
2239
+ const _hoisted_6$4 = { class: "row" };
2240
+ const _hoisted_7$3 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2241
+ const _hoisted_8$2 = { class: "col-md-12" };
2242
+ const _hoisted_9$2 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
2243
+ const _hoisted_10$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2248
2244
  const _hoisted_11$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2249
2245
  const _hoisted_12$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2250
2246
  const _hoisted_13$2 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
@@ -2293,15 +2289,15 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2293
2289
  const _component_ShSuggest = resolveComponent("ShSuggest");
2294
2290
  const _component_ShEditor = resolveComponent("ShEditor");
2295
2291
 
2296
- return (openBlock(), createElementBlock("form", _hoisted_1$8, [
2292
+ return (openBlock(), createElementBlock("form", _hoisted_1$9, [
2297
2293
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2298
2294
  createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2299
2295
  (_ctx.form_status == 3)
2300
- ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
2301
- _hoisted_3$8,
2296
+ ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
2297
+ _hoisted_3$9,
2302
2298
  (_ctx.errorText)
2303
- ? (openBlock(), createElementBlock("span", _hoisted_4$8, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2304
- : (openBlock(), createElementBlock("span", _hoisted_5$6, "Unexpected Error Occurred")),
2299
+ ? (openBlock(), createElementBlock("span", _hoisted_4$9, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2300
+ : (openBlock(), createElementBlock("span", _hoisted_5$7, "Unexpected Error Occurred")),
2305
2301
  createElementVNode("button", {
2306
2302
  onClick: _cache[0] || (_cache[0] = (...args) => ($options.hideError && $options.hideError(...args))),
2307
2303
  type: "button",
@@ -2316,14 +2312,14 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2316
2312
  }, null, 512 /* NEED_PATCH */), [
2317
2313
  [vModelText, _ctx.form_elements['id']]
2318
2314
  ]),
2319
- createElementVNode("div", _hoisted_6$3, [
2315
+ createElementVNode("div", _hoisted_6$4, [
2320
2316
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.fields, (field) => {
2321
2317
  return (openBlock(), createElementBlock("div", {
2322
2318
  class: normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
2323
2319
  key: field
2324
2320
  }, [
2325
- createElementVNode("label", _hoisted_7$2, toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2326
- createElementVNode("div", _hoisted_8$1, [
2321
+ createElementVNode("label", _hoisted_7$3, toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2322
+ createElementVNode("div", _hoisted_8$2, [
2327
2323
  ($options.getFieldType(field) === 'file')
2328
2324
  ? (openBlock(), createElementBlock("input", {
2329
2325
  key: 0,
@@ -2336,7 +2332,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2336
2332
  ref: 'file_'+field,
2337
2333
  onChange: $event => ($options.handleFileUpload(field)),
2338
2334
  type: "file"
2339
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$1))
2335
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$2))
2340
2336
  : createCommentVNode("v-if", true),
2341
2337
  ($options.getFieldType(field) === 'numeric')
2342
2338
  ? withDirectives((openBlock(), createElementBlock("input", {
@@ -2348,7 +2344,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2348
2344
  class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2349
2345
  "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2350
2346
  type: "number"
2351
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$2)), [
2347
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$3)), [
2352
2348
  [vModelText, _ctx.form_elements[field]]
2353
2349
  ])
2354
2350
  : createCommentVNode("v-if", true),
@@ -2498,10 +2494,10 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2498
2494
  ], 512 /* NEED_PATCH */))
2499
2495
  }
2500
2496
 
2501
- script$8.render = render$5;
2502
- script$8.__file = "src/lib/components/ShForm.vue";
2497
+ script$9.render = render$5;
2498
+ script$9.__file = "src/lib/components/ShForm.vue";
2503
2499
 
2504
- var script$7 = {
2500
+ var script$8 = {
2505
2501
  name: 'ShCanvas',
2506
2502
  props: ['canvasTitle', 'canvasId', 'position'],
2507
2503
  components: {
@@ -2518,13 +2514,13 @@ var script$7 = {
2518
2514
  }
2519
2515
  };
2520
2516
 
2521
- const _hoisted_1$7 = ["id"];
2522
- const _hoisted_2$7 = { class: "offcanvas-header" };
2523
- const _hoisted_3$7 = {
2517
+ const _hoisted_1$8 = ["id"];
2518
+ const _hoisted_2$8 = { class: "offcanvas-header" };
2519
+ const _hoisted_3$8 = {
2524
2520
  class: "offcanvas-title",
2525
2521
  id: "offcanvasScrollingLabel"
2526
2522
  };
2527
- const _hoisted_4$7 = { class: "offcanvas-body" };
2523
+ const _hoisted_4$8 = { class: "offcanvas-body" };
2528
2524
 
2529
2525
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2530
2526
  return (openBlock(), createElementBlock("div", {
@@ -2534,8 +2530,8 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2534
2530
  id: $props.canvasId,
2535
2531
  "aria-labelledby": "offcanvasScrollingLabel"
2536
2532
  }, [
2537
- createElementVNode("div", _hoisted_2$7, [
2538
- createElementVNode("h5", _hoisted_3$7, toDisplayString($props.canvasTitle), 1 /* TEXT */),
2533
+ createElementVNode("div", _hoisted_2$8, [
2534
+ createElementVNode("h5", _hoisted_3$8, toDisplayString($props.canvasTitle), 1 /* TEXT */),
2539
2535
  createElementVNode("button", {
2540
2536
  type: "button",
2541
2537
  ref: "closecanvas",
@@ -2545,33 +2541,33 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2545
2541
  "aria-label": "Close"
2546
2542
  }, null, 512 /* NEED_PATCH */)
2547
2543
  ]),
2548
- createElementVNode("div", _hoisted_4$7, [
2544
+ createElementVNode("div", _hoisted_4$8, [
2549
2545
  renderSlot(_ctx.$slots, "default")
2550
2546
  ])
2551
- ], 10 /* CLASS, PROPS */, _hoisted_1$7))
2547
+ ], 10 /* CLASS, PROPS */, _hoisted_1$8))
2552
2548
  }
2553
2549
 
2554
- script$7.render = render$4;
2555
- script$7.__file = "src/lib/components/ShCanvas.vue";
2550
+ script$8.render = render$4;
2551
+ script$8.__file = "src/lib/components/ShCanvas.vue";
2556
2552
 
2557
- var script$6 = {
2553
+ var script$7 = {
2558
2554
  name: 'ShModal',
2559
2555
  props: ['modalTitle', 'modalId', 'modalSize'],
2560
2556
  components: {
2561
2557
  }
2562
2558
  };
2563
2559
 
2564
- const _hoisted_1$6 = ["id"];
2565
- const _hoisted_2$6 = { class: "modal-content" };
2566
- const _hoisted_3$6 = { class: "modal-header" };
2567
- const _hoisted_4$6 = { class: "modal-title" };
2568
- const _hoisted_5$5 = /*#__PURE__*/createElementVNode("button", {
2560
+ const _hoisted_1$7 = ["id"];
2561
+ const _hoisted_2$7 = { class: "modal-content" };
2562
+ const _hoisted_3$7 = { class: "modal-header" };
2563
+ const _hoisted_4$7 = { class: "modal-title" };
2564
+ const _hoisted_5$6 = /*#__PURE__*/createElementVNode("button", {
2569
2565
  class: "btn btn-danger btn-sm",
2570
2566
  "data-bs-dismiss": "modal",
2571
2567
  "data-dismiss": "modal"
2572
2568
  }, "×", -1 /* HOISTED */);
2573
- const _hoisted_6$2 = { class: "modal-body" };
2574
- const _hoisted_7$1 = { class: "section" };
2569
+ const _hoisted_6$3 = { class: "modal-body" };
2570
+ const _hoisted_7$2 = { class: "section" };
2575
2571
 
2576
2572
  function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2577
2573
  return (openBlock(), createElementBlock("div", {
@@ -2584,25 +2580,25 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2584
2580
  createElementVNode("div", {
2585
2581
  class: normalizeClass(["modal-dialog", `modal-${$props.modalSize}`])
2586
2582
  }, [
2587
- createElementVNode("div", _hoisted_2$6, [
2588
- createElementVNode("div", _hoisted_3$6, [
2589
- createElementVNode("h3", _hoisted_4$6, toDisplayString($props.modalTitle), 1 /* TEXT */),
2590
- _hoisted_5$5
2583
+ createElementVNode("div", _hoisted_2$7, [
2584
+ createElementVNode("div", _hoisted_3$7, [
2585
+ createElementVNode("h3", _hoisted_4$7, toDisplayString($props.modalTitle), 1 /* TEXT */),
2586
+ _hoisted_5$6
2591
2587
  ]),
2592
- createElementVNode("div", _hoisted_6$2, [
2593
- createElementVNode("div", _hoisted_7$1, [
2588
+ createElementVNode("div", _hoisted_6$3, [
2589
+ createElementVNode("div", _hoisted_7$2, [
2594
2590
  renderSlot(_ctx.$slots, "default")
2595
2591
  ])
2596
2592
  ])
2597
2593
  ])
2598
2594
  ], 2 /* CLASS */)
2599
- ], 8 /* PROPS */, _hoisted_1$6))
2595
+ ], 8 /* PROPS */, _hoisted_1$7))
2600
2596
  }
2601
2597
 
2602
- script$6.render = render$3;
2603
- script$6.__file = "src/lib/components/ShModal.vue";
2598
+ script$7.render = render$3;
2599
+ script$7.__file = "src/lib/components/ShModal.vue";
2604
2600
 
2605
- var script$5 = {
2601
+ var script$6 = {
2606
2602
  name: 'Pagination',
2607
2603
  props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore'],
2608
2604
  data () {
@@ -2673,13 +2669,13 @@ var script$5 = {
2673
2669
  }
2674
2670
  };
2675
2671
 
2676
- const _hoisted_1$5 = { key: 0 };
2677
- const _hoisted_2$5 = { class: "record_count_body mb-3" };
2678
- const _hoisted_3$5 = /*#__PURE__*/createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2679
- const _hoisted_4$5 = /*#__PURE__*/createTextVNode("  ");
2680
- const _hoisted_5$4 = /*#__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);
2681
- const _hoisted_10$1 = [
2682
- _hoisted_5$4
2672
+ const _hoisted_1$6 = { key: 0 };
2673
+ const _hoisted_2$6 = { class: "record_count_body mb-3" };
2674
+ const _hoisted_3$6 = /*#__PURE__*/createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2675
+ const _hoisted_4$6 = /*#__PURE__*/createTextVNode("  ");
2676
+ const _hoisted_5$5 = /*#__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);
2677
+ const _hoisted_10$2 = [
2678
+ _hoisted_5$5
2683
2679
  ];
2684
2680
  const _hoisted_11$1 = { class: "record_counts" };
2685
2681
  const _hoisted_12$1 = {
@@ -2720,15 +2716,15 @@ const _hoisted_23$1 = {
2720
2716
 
2721
2717
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2722
2718
  return (!$props.loadMore)
2723
- ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
2724
- createElementVNode("div", _hoisted_2$5, [
2725
- _hoisted_3$5,
2726
- _hoisted_4$5,
2719
+ ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
2720
+ createElementVNode("div", _hoisted_2$6, [
2721
+ _hoisted_3$6,
2722
+ _hoisted_4$6,
2727
2723
  withDirectives(createElementVNode("select", {
2728
2724
  class: "select_per_page",
2729
2725
  onChange: _cache[0] || (_cache[0] = (...args) => ($options.changePerPage && $options.changePerPage(...args))),
2730
2726
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.per_page) = $event))
2731
- }, _hoisted_10$1, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
2727
+ }, _hoisted_10$2, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
2732
2728
  [vModelSelect, $data.per_page]
2733
2729
  ]),
2734
2730
  createElementVNode("span", _hoisted_11$1, " of " + toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
@@ -2792,8 +2788,8 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2792
2788
  ]))
2793
2789
  }
2794
2790
 
2795
- script$5.render = render$2;
2796
- script$5.__file = "src/lib/components/list_templates/Pagination.vue";
2791
+ script$6.render = render$2;
2792
+ script$6.__file = "src/lib/components/list_templates/Pagination.vue";
2797
2793
 
2798
2794
  function swalSuccess (message) {
2799
2795
  Swal.fire('Success!', message, 'success');
@@ -2967,7 +2963,7 @@ var shRepo = {
2967
2963
  formatDate
2968
2964
  };
2969
2965
 
2970
- var script$4 = {
2966
+ var script$5 = {
2971
2967
  name: 'sh-table',
2972
2968
  props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover'],
2973
2969
  inject: ['channel', 'global'],
@@ -3166,7 +3162,7 @@ var script$4 = {
3166
3162
  this.reloadData();
3167
3163
  },
3168
3164
  components: {
3169
- pagination: script$5
3165
+ pagination: script$6
3170
3166
  },
3171
3167
  computed: {
3172
3168
  windowWidth: function () {
@@ -3184,26 +3180,26 @@ var script$4 = {
3184
3180
  }
3185
3181
  };
3186
3182
 
3187
- const _hoisted_1$4 = { class: "auto-table mt-2" };
3188
- const _hoisted_2$4 = {
3183
+ const _hoisted_1$5 = { class: "auto-table mt-2" };
3184
+ const _hoisted_2$5 = {
3189
3185
  key: 0,
3190
3186
  class: "col-md-4 mb-2"
3191
3187
  };
3192
- const _hoisted_3$4 = ["disabled"];
3193
- const _hoisted_4$4 = /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
3194
- const _hoisted_5$3 = /*#__PURE__*/createTextVNode(" Export ");
3195
- const _hoisted_6$1 = /*#__PURE__*/createElementVNode("span", {
3188
+ const _hoisted_3$5 = ["disabled"];
3189
+ const _hoisted_4$5 = /*#__PURE__*/createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */);
3190
+ const _hoisted_5$4 = /*#__PURE__*/createTextVNode(" Export ");
3191
+ const _hoisted_6$2 = /*#__PURE__*/createElementVNode("span", {
3196
3192
  class: "spinner-border spinner-border-sm",
3197
3193
  role: "status",
3198
3194
  "aria-hidden": "true"
3199
3195
  }, null, -1 /* HOISTED */);
3200
- const _hoisted_7 = /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* HOISTED */);
3201
- const _hoisted_8 = {
3196
+ const _hoisted_7$1 = /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* HOISTED */);
3197
+ const _hoisted_8$1 = {
3202
3198
  key: 1,
3203
3199
  class: "row"
3204
3200
  };
3205
- const _hoisted_9 = { class: "col-12 mb-3" };
3206
- const _hoisted_10 = { class: "sh-search-bar" };
3201
+ const _hoisted_9$1 = { class: "col-12 mb-3" };
3202
+ const _hoisted_10$1 = { class: "sh-search-bar" };
3207
3203
  const _hoisted_11 = ["placeholder"];
3208
3204
  const _hoisted_12 = {
3209
3205
  key: 0,
@@ -3347,9 +3343,9 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3347
3343
  const _component_router_link = resolveComponent("router-link");
3348
3344
  const _component_pagination = resolveComponent("pagination");
3349
3345
 
3350
- return (openBlock(), createElementBlock("div", _hoisted_1$4, [
3346
+ return (openBlock(), createElementBlock("div", _hoisted_1$5, [
3351
3347
  ($props.hasDownload)
3352
- ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
3348
+ ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
3353
3349
  createElementVNode("button", {
3354
3350
  disabled: $data.downloading,
3355
3351
  class: "btn btn-warning btn-sm",
@@ -3357,20 +3353,20 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3357
3353
  }, [
3358
3354
  (!$data.downloading)
3359
3355
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3360
- _hoisted_4$4,
3361
- _hoisted_5$3
3356
+ _hoisted_4$5,
3357
+ _hoisted_5$4
3362
3358
  ], 64 /* STABLE_FRAGMENT */))
3363
3359
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3364
- _hoisted_6$1,
3365
- _hoisted_7
3360
+ _hoisted_6$2,
3361
+ _hoisted_7$1
3366
3362
  ], 64 /* STABLE_FRAGMENT */))
3367
- ], 8 /* PROPS */, _hoisted_3$4)
3363
+ ], 8 /* PROPS */, _hoisted_3$5)
3368
3364
  ]))
3369
3365
  : createCommentVNode("v-if", true),
3370
3366
  (!$props.hideSearch)
3371
- ? (openBlock(), createElementBlock("div", _hoisted_8, [
3372
- createElementVNode("div", _hoisted_9, [
3373
- createElementVNode("div", _hoisted_10, [
3367
+ ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
3368
+ createElementVNode("div", _hoisted_9$1, [
3369
+ createElementVNode("div", _hoisted_10$1, [
3374
3370
  withDirectives(createElementVNode("input", {
3375
3371
  type: "search",
3376
3372
  onChange: _cache[1] || (_cache[1] = $event => ($options.reloadData(1))),
@@ -3673,10 +3669,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3673
3669
  ]))
3674
3670
  }
3675
3671
 
3676
- script$4.render = render$1;
3677
- script$4.__file = "src/lib/components/ShTable.vue";
3672
+ script$5.render = render$1;
3673
+ script$5.__file = "src/lib/components/ShTable.vue";
3678
3674
 
3679
- var script$3 = {
3675
+ var script$4 = {
3680
3676
  name: 'ShTabs',
3681
3677
  props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive'],
3682
3678
  data () {
@@ -3757,14 +3753,14 @@ var script$3 = {
3757
3753
  }
3758
3754
  };
3759
3755
 
3760
- const _hoisted_1$3 = {
3756
+ const _hoisted_1$4 = {
3761
3757
  key: 0,
3762
3758
  class: "navbar navbar-expand-lg sh-horizontal-tabs"
3763
3759
  };
3764
- const _hoisted_2$3 = ["data-bs-target"];
3765
- const _hoisted_3$3 = /*#__PURE__*/createElementVNode("i", { class: "bi-chevron-right float-end" }, null, -1 /* HOISTED */);
3766
- const _hoisted_4$3 = ["id"];
3767
- const _hoisted_5$2 = { class: "tab-content" };
3760
+ const _hoisted_2$4 = ["data-bs-target"];
3761
+ const _hoisted_3$4 = /*#__PURE__*/createElementVNode("i", { class: "bi-chevron-right float-end" }, null, -1 /* HOISTED */);
3762
+ const _hoisted_4$4 = ["id"];
3763
+ const _hoisted_5$3 = { class: "tab-content" };
3768
3764
 
3769
3765
  function render(_ctx, _cache, $props, $setup, $data, $options) {
3770
3766
  const _component_router_link = resolveComponent("router-link");
@@ -3772,7 +3768,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3772
3768
 
3773
3769
  return (openBlock(), createElementBlock(Fragment, null, [
3774
3770
  ($data.generatedId)
3775
- ? (openBlock(), createElementBlock("nav", _hoisted_1$3, [
3771
+ ? (openBlock(), createElementBlock("nav", _hoisted_1$4, [
3776
3772
  ($data.isResponsive)
3777
3773
  ? (openBlock(), createElementBlock("a", {
3778
3774
  key: 0,
@@ -3785,8 +3781,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3785
3781
  "aria-label": "Toggle navigation"
3786
3782
  }, [
3787
3783
  createTextVNode(toDisplayString($data.currentTab) + " ", 1 /* TEXT */),
3788
- _hoisted_3$3
3789
- ], 8 /* PROPS */, _hoisted_2$3))
3784
+ _hoisted_3$4
3785
+ ], 8 /* PROPS */, _hoisted_2$4))
3790
3786
  : createCommentVNode("v-if", true),
3791
3787
  createElementVNode("div", {
3792
3788
  class: normalizeClass($data.isResponsive ? 'collapse navbar-collapse':''),
@@ -3815,10 +3811,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3815
3811
  ]))
3816
3812
  }), 128 /* KEYED_FRAGMENT */))
3817
3813
  ], 2 /* CLASS */)
3818
- ], 10 /* CLASS, PROPS */, _hoisted_4$3)
3814
+ ], 10 /* CLASS, PROPS */, _hoisted_4$4)
3819
3815
  ]))
3820
3816
  : createCommentVNode("v-if", true),
3821
- createElementVNode("div", _hoisted_5$2, [
3817
+ createElementVNode("div", _hoisted_5$3, [
3822
3818
  createVNode(_component_router_view, {
3823
3819
  currentTab: $data.currentTab,
3824
3820
  sharedData: $props.sharedData,
@@ -3828,21 +3824,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
3828
3824
  ], 64 /* STABLE_FRAGMENT */))
3829
3825
  }
3830
3826
 
3831
- script$3.render = render;
3832
- script$3.__file = "src/lib/components/ShTabs.vue";
3827
+ script$4.render = render;
3828
+ script$4.__file = "src/lib/components/ShTabs.vue";
3833
3829
 
3834
- const _hoisted_1$2 = {
3830
+ const _hoisted_1$3 = {
3835
3831
  class: "nav nav-tabs",
3836
3832
  role: "tablist"
3837
3833
  };
3838
- const _hoisted_2$2 = {
3834
+ const _hoisted_2$3 = {
3839
3835
  class: "nav-item",
3840
3836
  role: "presentation"
3841
3837
  };
3842
- const _hoisted_3$2 = ["onClick"];
3843
- const _hoisted_4$2 = { class: "tab-content" };
3838
+ const _hoisted_3$3 = ["onClick"];
3839
+ const _hoisted_4$3 = { class: "tab-content" };
3844
3840
 
3845
- var script$2 = {
3841
+ var script$3 = {
3846
3842
  __name: 'ShDynamicTabs',
3847
3843
  props: ['tabs'],
3848
3844
  setup(__props) {
@@ -3867,17 +3863,17 @@ function setTab(tab){
3867
3863
 
3868
3864
  return (_ctx, _cache) => {
3869
3865
  return (openBlock(), createElementBlock(Fragment, null, [
3870
- createElementVNode("ul", _hoisted_1$2, [
3866
+ createElementVNode("ul", _hoisted_1$3, [
3871
3867
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab) => {
3872
- return (openBlock(), createElementBlock("li", _hoisted_2$2, [
3868
+ return (openBlock(), createElementBlock("li", _hoisted_2$3, [
3873
3869
  createElementVNode("button", {
3874
3870
  onClick: $event => (setTab(tab)),
3875
3871
  class: normalizeClass(["nav-link", unref(currentTab) === tab ? 'active':''])
3876
- }, toDisplayString(tab.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_3$2)
3872
+ }, toDisplayString(tab.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_3$3)
3877
3873
  ]))
3878
3874
  }), 256 /* UNKEYED_FRAGMENT */))
3879
3875
  ]),
3880
- createElementVNode("div", _hoisted_4$2, [
3876
+ createElementVNode("div", _hoisted_4$3, [
3881
3877
  (unref(currentTab))
3882
3878
  ? (openBlock(), createBlock(resolveDynamicComponent(unref(currentTab).component), { key: 0 }))
3883
3879
  : createCommentVNode("v-if", true)
@@ -3888,7 +3884,7 @@ return (_ctx, _cache) => {
3888
3884
 
3889
3885
  };
3890
3886
 
3891
- script$2.__file = "src/lib/components/ShDynamicTabs.vue";
3887
+ script$3.__file = "src/lib/components/ShDynamicTabs.vue";
3892
3888
 
3893
3889
  const useUserStore = defineStore('user-store', {
3894
3890
  state: () => ({
@@ -3934,6 +3930,10 @@ const useUserStore = defineStore('user-store', {
3934
3930
  this.user = user;
3935
3931
  }).catch((reason) => {
3936
3932
  if (reason.response && reason.response.status) {
3933
+ if(reason.response.status === 401) {
3934
+ ShStorage.setItem('user',null);
3935
+ this.user = null;
3936
+ }
3937
3937
  this.loggedOut = true;
3938
3938
  }
3939
3939
  });
@@ -3970,22 +3970,22 @@ const useUserStore = defineStore('user-store', {
3970
3970
  }
3971
3971
  });
3972
3972
 
3973
- const _hoisted_1$1 = /*#__PURE__*/createElementVNode("h5", null, "Departments (updated)", -1 /* HOISTED */);
3974
- const _hoisted_2$1 = {
3973
+ const _hoisted_1$2 = /*#__PURE__*/createElementVNode("h5", null, "Departments (updated)", -1 /* HOISTED */);
3974
+ const _hoisted_2$2 = {
3975
3975
  "data-bs-toggle": "modal",
3976
3976
  ref: "addDeptBtn",
3977
3977
  href: "#department_modal",
3978
3978
  class: "btn btn-info btn-sm"
3979
3979
  };
3980
- const _hoisted_3$1 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* HOISTED */);
3981
- const _hoisted_4$1 = /*#__PURE__*/createTextVNode(" ADD DEPARTMENT");
3982
- const _hoisted_5$1 = [
3983
- _hoisted_3$1,
3984
- _hoisted_4$1
3980
+ const _hoisted_3$2 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* HOISTED */);
3981
+ const _hoisted_4$2 = /*#__PURE__*/createTextVNode(" ADD DEPARTMENT");
3982
+ const _hoisted_5$2 = [
3983
+ _hoisted_3$2,
3984
+ _hoisted_4$2
3985
3985
  ];
3986
3986
 
3987
3987
 
3988
- var script$1 = {
3988
+ var script$2 = {
3989
3989
  __name: 'Departments',
3990
3990
  setup(__props) {
3991
3991
 
@@ -4007,9 +4007,9 @@ function departmentAdded (response) {
4007
4007
 
4008
4008
  return (_ctx, _cache) => {
4009
4009
  return (openBlock(), createElementBlock(Fragment, null, [
4010
- _hoisted_1$1,
4011
- createElementVNode("a", _hoisted_2$1, _hoisted_5$1, 512 /* NEED_PATCH */),
4012
- createVNode(script$4, {
4010
+ _hoisted_1$2,
4011
+ createElementVNode("a", _hoisted_2$2, _hoisted_5$2, 512 /* NEED_PATCH */),
4012
+ createVNode(script$5, {
4013
4013
  reload: unref(reload),
4014
4014
  onRowSelected: _ctx.rowSelected,
4015
4015
  headers: ['id','name','description', 'created_at'],
@@ -4025,12 +4025,12 @@ return (_ctx, _cache) => {
4025
4025
  ]
4026
4026
  }
4027
4027
  }, null, 8 /* PROPS */, ["reload", "onRowSelected"]),
4028
- createVNode(script$6, {
4028
+ createVNode(script$7, {
4029
4029
  "modal-id": "department_modal",
4030
4030
  "modal-title": "Department Form"
4031
4031
  }, {
4032
4032
  default: withCtx(() => [
4033
- createVNode(script$8, {
4033
+ createVNode(script$9, {
4034
4034
  "success-callback": "departmentAdded",
4035
4035
  onDepartmentAdded: departmentAdded,
4036
4036
  action: "admin/departments/store",
@@ -4045,9 +4045,9 @@ return (_ctx, _cache) => {
4045
4045
 
4046
4046
  };
4047
4047
 
4048
- script$1.__file = "src/lib/components/core/Departments/Departments.vue";
4048
+ script$2.__file = "src/lib/components/core/Departments/Departments.vue";
4049
4049
 
4050
- const _hoisted_1 = /*#__PURE__*/createElementVNode("a", {
4050
+ const _hoisted_1$1 = /*#__PURE__*/createElementVNode("a", {
4051
4051
  href: "#addModule",
4052
4052
  class: "btn btn-info btn-sm",
4053
4053
  "data-bs-toggle": "modal"
@@ -4055,16 +4055,16 @@ const _hoisted_1 = /*#__PURE__*/createElementVNode("a", {
4055
4055
  /*#__PURE__*/createElementVNode("i", { class: "bi-plus" }),
4056
4056
  /*#__PURE__*/createTextVNode(" ADD Module")
4057
4057
  ], -1 /* HOISTED */);
4058
- const _hoisted_2 = { class: "text-primary text-capitalize" };
4059
- const _hoisted_3 = ["value"];
4060
- const _hoisted_4 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-save" }, null, -1 /* HOISTED */);
4061
- const _hoisted_5 = /*#__PURE__*/createTextVNode(" Submit");
4062
- const _hoisted_6 = [
4063
- _hoisted_4,
4064
- _hoisted_5
4058
+ const _hoisted_2$1 = { class: "text-primary text-capitalize" };
4059
+ const _hoisted_3$1 = ["value"];
4060
+ const _hoisted_4$1 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-save" }, null, -1 /* HOISTED */);
4061
+ const _hoisted_5$1 = /*#__PURE__*/createTextVNode(" Submit");
4062
+ const _hoisted_6$1 = [
4063
+ _hoisted_4$1,
4064
+ _hoisted_5$1
4065
4065
  ];
4066
4066
 
4067
- var script = {
4067
+ var script$1 = {
4068
4068
  __name: 'Department',
4069
4069
  setup(__props) {
4070
4070
 
@@ -4157,9 +4157,9 @@ function submitPermissions() {
4157
4157
  return (_ctx, _cache) => {
4158
4158
  return (unref(department))
4159
4159
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4160
- _hoisted_1,
4160
+ _hoisted_1$1,
4161
4161
  createElementVNode("h5", null, "Department #" + toDisplayString(unref(department).id) + " - " + toDisplayString(unref(department).name) + " Allowed Modules", 1 /* TEXT */),
4162
- createVNode(script$4, {
4162
+ createVNode(script$5, {
4163
4163
  actions: {
4164
4164
  label: 'Actions',
4165
4165
  actions: [
@@ -4179,12 +4179,12 @@ return (_ctx, _cache) => {
4179
4179
  headers: ['id',showModule,'created_at'],
4180
4180
  "end-point": 'admin/departments/department/list-modules/' + id.value
4181
4181
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
4182
- createVNode(script$6, {
4182
+ createVNode(script$7, {
4183
4183
  "modal-id": "addModule",
4184
4184
  "modal-title": "Add Module Department"
4185
4185
  }, {
4186
4186
  default: withCtx(() => [
4187
- createVNode(script$8, {
4187
+ createVNode(script$9, {
4188
4188
  "reload-select-items": unref(reload),
4189
4189
  "success-callback": moduleAdded,
4190
4190
  "fill-selects": {
@@ -4206,7 +4206,7 @@ return (_ctx, _cache) => {
4206
4206
  ref: permissionCanvasBtn,
4207
4207
  "data-bs-toggle": "offcanvas"
4208
4208
  }, null, 512 /* NEED_PATCH */),
4209
- createVNode(script$7, {
4209
+ createVNode(script$8, {
4210
4210
  "canvas-id": "permissionsCanvas",
4211
4211
  position: "end enlarged",
4212
4212
  "canvas-title": "Module Permissions"
@@ -4214,7 +4214,7 @@ return (_ctx, _cache) => {
4214
4214
  default: withCtx(() => [
4215
4215
  (unref(getModule))
4216
4216
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4217
- createElementVNode("h5", _hoisted_2, "Permissions for " + toDisplayString(unref(getModule).module), 1 /* TEXT */),
4217
+ createElementVNode("h5", _hoisted_2$1, "Permissions for " + toDisplayString(unref(getModule).module), 1 /* TEXT */),
4218
4218
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(modulePermissions), (permission) => {
4219
4219
  return (openBlock(), createElementBlock("div", {
4220
4220
  key: permission,
@@ -4227,7 +4227,7 @@ return (_ctx, _cache) => {
4227
4227
  type: "checkbox",
4228
4228
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(selectedPermissions) ? (selectedPermissions).value = $event : selectedPermissions = $event)),
4229
4229
  value: permission
4230
- }, null, 8 /* PROPS */, _hoisted_3), [
4230
+ }, null, 8 /* PROPS */, _hoisted_3$1), [
4231
4231
  [vModelCheckbox, unref(selectedPermissions)]
4232
4232
  ]),
4233
4233
  createTextVNode(" " + toDisplayString(getPermissionLabel(permission)), 1 /* TEXT */)
@@ -4237,7 +4237,7 @@ return (_ctx, _cache) => {
4237
4237
  createElementVNode("button", {
4238
4238
  onClick: submitPermissions,
4239
4239
  class: "btn btn-info"
4240
- }, _hoisted_6)
4240
+ }, _hoisted_6$1)
4241
4241
  ], 64 /* STABLE_FRAGMENT */))
4242
4242
  : createCommentVNode("v-if", true)
4243
4243
  ]),
@@ -4250,7 +4250,122 @@ return (_ctx, _cache) => {
4250
4250
 
4251
4251
  };
4252
4252
 
4253
- script.__file = "src/lib/components/core/Departments/department/Department.vue";
4253
+ script$1.__file = "src/lib/components/core/Departments/department/Department.vue";
4254
+
4255
+ const _withScopeId = n => (pushScopeId("data-v-2911509a"),n=n(),popScopeId(),n);
4256
+ const _hoisted_1 = {
4257
+ key: 0,
4258
+ class: "alert alert-info"
4259
+ };
4260
+ const _hoisted_2 = /*#__PURE__*/createTextVNode("You are signed is as ");
4261
+ const _hoisted_3 = {
4262
+ key: 0,
4263
+ class: "sh-login-section"
4264
+ };
4265
+ const _hoisted_4 = { class: "sh-auth-footer" };
4266
+ const _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("strong", { class: "sh-forgot-link text-primary" }, "Forgotten password?", -1 /* HOISTED */));
4267
+ const _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/createElementVNode("strong", { class: "bi-dot" }, null, -1 /* HOISTED */));
4268
+ const _hoisted_7 = {
4269
+ key: 1,
4270
+ class: "sh-register-section"
4271
+ };
4272
+ const _hoisted_8 = {
4273
+ key: 0,
4274
+ class: "sh-register-title"
4275
+ };
4276
+ const _hoisted_9 = {
4277
+ key: 1,
4278
+ class: "sh-register-link"
4279
+ };
4280
+ const _hoisted_10 = { class: "sh-auth-footer" };
4281
+
4282
+ var script = {
4283
+ __name: 'ShAuth',
4284
+ setup(__props) {
4285
+
4286
+ const router = useRouter();
4287
+ const userStore = useUserStore();
4288
+ userStore.setUser();
4289
+ const {user} = storeToRefs(userStore);
4290
+ const section = ref('login');
4291
+ const registerEndpoint = inject('registerEndpoint');
4292
+ const loginEndpoint = inject('loginEndpoint');
4293
+ const registrationFields = inject('registrationFields');
4294
+ const registerTitle = inject('registerTitle');
4295
+ const registerSubTitle = inject('registerSubTitle');
4296
+ inject('redirectRegister');
4297
+ const redirectLogin = inject('redirectLogin');
4298
+ function goToSection(newSection){
4299
+ section.value = newSection;
4300
+ }
4301
+ watch(user,(newUser) => {
4302
+ if(newUser.value) {
4303
+ router.push(redirectLogin);
4304
+ }
4305
+ });
4306
+ function loginSuccessful(res){
4307
+ userStore.setAccessToken(res.token);
4308
+ userStore.setUser();
4309
+ router.push(redirectLogin);
4310
+ }
4311
+
4312
+ return (_ctx, _cache) => {
4313
+ return (unref(user))
4314
+ ? (openBlock(), createElementBlock("div", _hoisted_1, [
4315
+ _hoisted_2,
4316
+ createElementVNode("strong", null, toDisplayString(unref(user).name), 1 /* TEXT */)
4317
+ ]))
4318
+ : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4319
+ (section.value === 'login')
4320
+ ? (openBlock(), createElementBlock("div", _hoisted_3, [
4321
+ createVNode(script$9, {
4322
+ class: "sh-login-form",
4323
+ fields: ['email','password'],
4324
+ "action-label": "Login",
4325
+ action: unref(loginEndpoint),
4326
+ "success-callback": loginSuccessful
4327
+ }, null, 8 /* PROPS */, ["action"]),
4328
+ createElementVNode("div", _hoisted_4, [
4329
+ _hoisted_5,
4330
+ _hoisted_6,
4331
+ createElementVNode("strong", {
4332
+ onClick: _cache[0] || (_cache[0] = $event => (goToSection('register'))),
4333
+ class: "sh-register-link text-primary"
4334
+ }, "Sign Up")
4335
+ ])
4336
+ ]))
4337
+ : createCommentVNode("v-if", true),
4338
+ (section.value === 'register')
4339
+ ? (openBlock(), createElementBlock("div", _hoisted_7, [
4340
+ (unref(registerTitle))
4341
+ ? (openBlock(), createElementBlock("h3", _hoisted_8, toDisplayString(unref(registerTitle)), 1 /* TEXT */))
4342
+ : createCommentVNode("v-if", true),
4343
+ (unref(registerSubTitle))
4344
+ ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
4345
+ : createCommentVNode("v-if", true),
4346
+ createVNode(script$9, {
4347
+ class: "sh-login-form",
4348
+ fields: unref(registrationFields),
4349
+ "action-label": "Sign Up",
4350
+ action: unref(registerEndpoint),
4351
+ "success-callback": loginSuccessful
4352
+ }, null, 8 /* PROPS */, ["fields", "action"]),
4353
+ createElementVNode("div", _hoisted_10, [
4354
+ createElementVNode("strong", {
4355
+ onClick: _cache[1] || (_cache[1] = $event => (goToSection('login'))),
4356
+ class: "sh-register-link text-primary"
4357
+ }, "Already have an account?")
4358
+ ])
4359
+ ]))
4360
+ : createCommentVNode("v-if", true)
4361
+ ], 64 /* STABLE_FRAGMENT */))
4362
+ }
4363
+ }
4364
+
4365
+ };
4366
+
4367
+ script.__scopeId = "data-v-2911509a";
4368
+ script.__file = "src/lib/components/core/auth/ShAuth.vue";
4254
4369
 
4255
4370
  const ShFrontend = {
4256
4371
  install: (app, options) => {
@@ -4258,17 +4373,36 @@ const ShFrontend = {
4258
4373
  app.provide('sessionTimeout',options.sessionTimeout);
4259
4374
  ShStorage.setItem('sessionTimeout',options.sessionTimeout);
4260
4375
  }
4376
+ const loginEndpoint = options.loginEndpoint ?? 'auth/login';
4377
+ const registerEndpoint = options.registerEndpoint ?? 'auth/register';
4378
+ const registerTitle = options.registerTitle ?? 'Create a new account';
4379
+ const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
4380
+ const redirectLogin = options.redirectLogin ?? `/`;
4381
+ const redirectRegister = options.redirectRegister ?? `/`;
4382
+ const registrationFields = options.registrationFields ?? ['name','email','phone','password','password_confirmation'];
4383
+ const AuthComponent = options.authComponent ?? script;
4384
+ app.provide('loginEndpoint',loginEndpoint);
4385
+ app.provide('registerEndpoint', registerEndpoint);
4386
+ app.provide('registrationFields', registrationFields);
4387
+ app.provide('registerTitle', registerTitle);
4388
+ app.provide('registerSubTitle', registerSubTitle);
4389
+ app.provide('redirectLogin', redirectLogin);
4390
+ app.provide('redirectRegister', redirectRegister);
4261
4391
  if(options.router) {
4392
+ options.router.addRoute({
4393
+ path: '/sh-auth',
4394
+ component: AuthComponent
4395
+ });
4262
4396
  options.router.addRoute({
4263
4397
  path: '/sh-departments',
4264
- component: script$1
4398
+ component: script$2
4265
4399
  });
4266
4400
  options.router.addRoute({
4267
4401
  path: '/sh-departments/permissions/:id',
4268
- component: script
4402
+ component: script$1
4269
4403
  });
4270
4404
  }
4271
4405
  }
4272
4406
  };
4273
4407
 
4274
- export { script$7 as ShCanvas, script$2 as ShDynamicTabs, script$8 as ShForm, ShFrontend, script$6 as ShModal, script$b as ShPhone, script$4 as ShTable, script$3 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
4408
+ export { script$8 as ShCanvas, script$3 as ShDynamicTabs, script$9 as ShForm, ShFrontend, script$7 as ShModal, script$c as ShPhone, script$5 as ShTable, script$4 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };