@iankibetsh/shframework 1.0.4 → 1.0.6

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
@@ -1574,7 +1574,7 @@ const countries = [
1574
1574
  }
1575
1575
  ];
1576
1576
 
1577
- var script$e = {
1577
+ var script$f = {
1578
1578
  name: 'ShPhone',
1579
1579
  props: ['modelValue', 'country_code'],
1580
1580
  data () {
@@ -1636,7 +1636,7 @@ var script$e = {
1636
1636
  }
1637
1637
  };
1638
1638
 
1639
- const _hoisted_1$d = { class: "sh-phone mb-3" };
1639
+ const _hoisted_1$e = { class: "sh-phone mb-3" };
1640
1640
  const _hoisted_2$b = {
1641
1641
  key: 0,
1642
1642
  style: {"display":"contents"}
@@ -1645,7 +1645,7 @@ const _hoisted_3$a = ["src"];
1645
1645
  const _hoisted_4$a = ["value"];
1646
1646
 
1647
1647
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1648
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
1648
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
1649
1649
  ($data.selectedCountry)
1650
1650
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, [
1651
1651
  vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$a),
@@ -1679,10 +1679,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1679
1679
  ]))
1680
1680
  }
1681
1681
 
1682
- script$e.render = render$7;
1683
- script$e.__file = "src/lib/components/ShPhone.vue";
1682
+ script$f.render = render$7;
1683
+ script$f.__file = "src/lib/components/ShPhone.vue";
1684
1684
 
1685
- var script$d = {
1685
+ var script$e = {
1686
1686
  name: 'ShEditor',
1687
1687
  props: ['modelValue'],
1688
1688
  components: {
@@ -1721,7 +1721,7 @@ var script$d = {
1721
1721
  }
1722
1722
  };
1723
1723
 
1724
- const _hoisted_1$c = /*#__PURE__*/vue.createElementVNode("textarea", {
1724
+ const _hoisted_1$d = /*#__PURE__*/vue.createElementVNode("textarea", {
1725
1725
  id: "tiny",
1726
1726
  style: {"display":"none"},
1727
1727
  "data-cy": "tinymce_editor"
@@ -1731,7 +1731,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1731
1731
  const _component_editor = vue.resolveComponent("editor");
1732
1732
 
1733
1733
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1734
- _hoisted_1$c,
1734
+ _hoisted_1$d,
1735
1735
  vue.createElementVNode("div", {
1736
1736
  onFocusin: _cache[1] || (_cache[1] = vue.withModifiers(() => {}, ["stop"])),
1737
1737
  class: "sh-editor w-100"
@@ -1756,10 +1756,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1756
1756
  ], 64 /* STABLE_FRAGMENT */))
1757
1757
  }
1758
1758
 
1759
- script$d.render = render$6;
1760
- script$d.__file = "src/lib/components/FormComponent/ShEditor.vue";
1759
+ script$e.render = render$6;
1760
+ script$e.__file = "src/lib/components/FormComponent/ShEditor.vue";
1761
1761
 
1762
- const _hoisted_1$b = {
1762
+ const _hoisted_1$c = {
1763
1763
  key: 0,
1764
1764
  class: "dropdown sh-suggest"
1765
1765
  };
@@ -1780,7 +1780,7 @@ const _hoisted_10$3 = {
1780
1780
  };
1781
1781
 
1782
1782
 
1783
- var script$c = {
1783
+ var script$d = {
1784
1784
  __name: 'ShSuggest',
1785
1785
  props: ['fillSelects','modelValue'],
1786
1786
  emits: ['update:modelValue'],
@@ -1861,7 +1861,7 @@ function filterData(e){
1861
1861
 
1862
1862
  return (_ctx, _cache) => {
1863
1863
  return (vue.unref(id))
1864
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
1864
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
1865
1865
  vue.createElementVNode("div", {
1866
1866
  id: vue.unref(id),
1867
1867
  "data-bs-toggle": "dropdown",
@@ -1921,15 +1921,15 @@ return (_ctx, _cache) => {
1921
1921
 
1922
1922
  };
1923
1923
 
1924
- script$c.__scopeId = "data-v-5b767123";
1925
- script$c.__file = "src/lib/components/FormComponent/ShSuggest.vue";
1924
+ script$d.__scopeId = "data-v-5b767123";
1925
+ script$d.__file = "src/lib/components/FormComponent/ShSuggest.vue";
1926
1926
 
1927
- var script$b = {
1927
+ var script$c = {
1928
1928
  name: 'ShForm',
1929
1929
  components: {
1930
- ShSuggest: script$c,
1931
- ShEditor: script$d,
1932
- ShPhone: script$e
1930
+ ShSuggest: script$d,
1931
+ ShEditor: script$e,
1932
+ ShPhone: script$f
1933
1933
  },
1934
1934
  props: [
1935
1935
  'action',
@@ -2241,7 +2241,7 @@ var script$b = {
2241
2241
  }
2242
2242
  };
2243
2243
 
2244
- const _hoisted_1$a = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2244
+ const _hoisted_1$b = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2245
2245
  const _hoisted_2$9 = {
2246
2246
  ref: "ShAutoForm",
2247
2247
  class: "sh-form"
@@ -2303,7 +2303,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2303
2303
  const _component_ShEditor = vue.resolveComponent("ShEditor");
2304
2304
 
2305
2305
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2306
- _hoisted_1$a,
2306
+ _hoisted_1$b,
2307
2307
  vue.createElementVNode("form", _hoisted_2$9, [
2308
2308
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2309
2309
  vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
@@ -2520,13 +2520,13 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2520
2520
  ], 64 /* STABLE_FRAGMENT */))
2521
2521
  }
2522
2522
 
2523
- script$b.render = render$5;
2524
- script$b.__file = "src/lib/components/ShForm.vue";
2523
+ script$c.render = render$5;
2524
+ script$c.__file = "src/lib/components/ShForm.vue";
2525
2525
 
2526
- const _hoisted_1$9 = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
2526
+ const _hoisted_1$a = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
2527
2527
  const _hoisted_2$8 = { class: "dropdown" };
2528
2528
 
2529
- var script$a = {
2529
+ var script$b = {
2530
2530
  __name: 'ShDropDownForm',
2531
2531
  props: ['action',
2532
2532
  'classes',
@@ -2556,7 +2556,7 @@ const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
2556
2556
 
2557
2557
  return (_ctx, _cache) => {
2558
2558
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2559
- _hoisted_1$9,
2559
+ _hoisted_1$a,
2560
2560
  vue.createElementVNode("div", _hoisted_2$8, [
2561
2561
  vue.createElementVNode("a", {
2562
2562
  class: vue.normalizeClass(vue.unref(btnClass)),
@@ -2573,7 +2573,7 @@ return (_ctx, _cache) => {
2573
2573
  class: "dropdown-menu px-2 py-1",
2574
2574
  "aria-labelledby": dropdownId
2575
2575
  }, [
2576
- vue.createVNode(script$b, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2576
+ vue.createVNode(script$c, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2577
2577
  ])
2578
2578
  ])
2579
2579
  ], 64 /* STABLE_FRAGMENT */))
@@ -2582,16 +2582,16 @@ return (_ctx, _cache) => {
2582
2582
 
2583
2583
  };
2584
2584
 
2585
- script$a.__file = "src/lib/components/ShDropDownForm.vue";
2585
+ script$b.__file = "src/lib/components/ShDropDownForm.vue";
2586
2586
 
2587
- var script$9 = {
2587
+ var script$a = {
2588
2588
  name: 'ShModal',
2589
2589
  props: ['modalTitle', 'modalId', 'modalSize'],
2590
2590
  components: {
2591
2591
  }
2592
2592
  };
2593
2593
 
2594
- const _hoisted_1$8 = ["id"];
2594
+ const _hoisted_1$9 = ["id"];
2595
2595
  const _hoisted_2$7 = { class: "modal-content" };
2596
2596
  const _hoisted_3$7 = { class: "modal-header" };
2597
2597
  const _hoisted_4$7 = { class: "modal-title" };
@@ -2624,15 +2624,15 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2624
2624
  ])
2625
2625
  ])
2626
2626
  ], 2 /* CLASS */)
2627
- ], 8 /* PROPS */, _hoisted_1$8))
2627
+ ], 8 /* PROPS */, _hoisted_1$9))
2628
2628
  }
2629
2629
 
2630
- script$9.render = render$4;
2631
- script$9.__file = "src/lib/components/ShModal.vue";
2630
+ script$a.render = render$4;
2631
+ script$a.__file = "src/lib/components/ShModal.vue";
2632
2632
 
2633
- const _hoisted_1$7 = ["href"];
2633
+ const _hoisted_1$8 = ["href"];
2634
2634
 
2635
- var script$8 = {
2635
+ var script$9 = {
2636
2636
  __name: 'ShModalForm',
2637
2637
  props: ['action',
2638
2638
  'classes',
@@ -2668,13 +2668,13 @@ return (_ctx, _cache) => {
2668
2668
  "data-bs-toggle": "modal"
2669
2669
  }, [
2670
2670
  vue.renderSlot(_ctx.$slots, "default")
2671
- ], 10 /* CLASS, PROPS */, _hoisted_1$7),
2672
- vue.createVNode(script$9, {
2671
+ ], 10 /* CLASS, PROPS */, _hoisted_1$8),
2672
+ vue.createVNode(script$a, {
2673
2673
  "modal-id": modalId,
2674
2674
  "modal-title": __props.modalTitle
2675
2675
  }, {
2676
2676
  default: vue.withCtx(() => [
2677
- vue.createVNode(script$b, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2677
+ vue.createVNode(script$c, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2678
2678
  ]),
2679
2679
  _: 1 /* STABLE */
2680
2680
  }, 8 /* PROPS */, ["modal-title"])
@@ -2684,9 +2684,9 @@ return (_ctx, _cache) => {
2684
2684
 
2685
2685
  };
2686
2686
 
2687
- script$8.__file = "src/lib/components/ShModalForm.vue";
2687
+ script$9.__file = "src/lib/components/ShModalForm.vue";
2688
2688
 
2689
- var script$7 = {
2689
+ var script$8 = {
2690
2690
  name: 'ShCanvas',
2691
2691
  props: ['canvasTitle', 'canvasId', 'position','canvasSize'],
2692
2692
  components: {
@@ -2703,7 +2703,7 @@ var script$7 = {
2703
2703
  }
2704
2704
  };
2705
2705
 
2706
- const _hoisted_1$6 = ["id"];
2706
+ const _hoisted_1$7 = ["id"];
2707
2707
  const _hoisted_2$6 = { class: "offcanvas-header" };
2708
2708
  const _hoisted_3$6 = {
2709
2709
  class: "offcanvas-title",
@@ -2733,13 +2733,13 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2733
2733
  vue.createElementVNode("div", _hoisted_4$6, [
2734
2734
  vue.renderSlot(_ctx.$slots, "default")
2735
2735
  ])
2736
- ], 10 /* CLASS, PROPS */, _hoisted_1$6))
2736
+ ], 10 /* CLASS, PROPS */, _hoisted_1$7))
2737
2737
  }
2738
2738
 
2739
- script$7.render = render$3;
2740
- script$7.__file = "src/lib/components/ShCanvas.vue";
2739
+ script$8.render = render$3;
2740
+ script$8.__file = "src/lib/components/ShCanvas.vue";
2741
2741
 
2742
- var script$6 = {
2742
+ var script$7 = {
2743
2743
  name: 'Pagination',
2744
2744
  props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore'],
2745
2745
  data () {
@@ -2810,7 +2810,7 @@ var script$6 = {
2810
2810
  }
2811
2811
  };
2812
2812
 
2813
- const _hoisted_1$5 = { key: 0 };
2813
+ const _hoisted_1$6 = { key: 0 };
2814
2814
  const _hoisted_2$5 = { class: "record_count_body mb-3" };
2815
2815
  const _hoisted_3$5 = /*#__PURE__*/vue.createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2816
2816
  const _hoisted_4$5 = /*#__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);
@@ -2856,7 +2856,7 @@ const _hoisted_22$1 = {
2856
2856
 
2857
2857
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2858
2858
  return (!$props.loadMore)
2859
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
2859
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
2860
2860
  vue.createElementVNode("div", _hoisted_2$5, [
2861
2861
  _hoisted_3$5,
2862
2862
  vue.createTextVNode("  "),
@@ -2928,8 +2928,8 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2928
2928
  ]))
2929
2929
  }
2930
2930
 
2931
- script$6.render = render$2;
2932
- script$6.__file = "src/lib/components/list_templates/Pagination.vue";
2931
+ script$7.render = render$2;
2932
+ script$7.__file = "src/lib/components/list_templates/Pagination.vue";
2933
2933
 
2934
2934
  function swalSuccess (message) {
2935
2935
  Swal__default["default"].fire('Success!', message, 'success');
@@ -3069,20 +3069,15 @@ async function runPlainRequest (url, message, title, data) {
3069
3069
  showLoaderOnConfirm: true,
3070
3070
  preConfirm: () => {
3071
3071
  return shApis.doPost(url, data).then(function (response) {
3072
- Swal__default["default"].fire('Success!', 'Action completed successfully', 'success');
3073
3072
  return {
3074
3073
  response: response.data,
3075
3074
  success: true
3076
3075
  }
3077
3076
  })
3078
- .catch(reason => {
3079
- if (typeof reason.response === 'undefined') {
3080
- Swal__default["default"].fire('Error!', `Connection to ${url} lost`, 'error');
3081
- } else {
3082
- Swal__default["default"].fire(`Error ${reason.response.status}`, reason.response.statusText, 'error');
3083
- }
3077
+ .catch(error => {
3084
3078
  return {
3085
- success: false
3079
+ success: false,
3080
+ error: error
3086
3081
  }
3087
3082
  })
3088
3083
  },
@@ -3110,7 +3105,7 @@ var shRepo = {
3110
3105
  formatDate
3111
3106
  };
3112
3107
 
3113
- var script$5 = {
3108
+ var script$6 = {
3114
3109
  name: 'sh-table',
3115
3110
  props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover'],
3116
3111
  inject: ['channel'],
@@ -3324,8 +3319,8 @@ var script$5 = {
3324
3319
  this.reloadData();
3325
3320
  },
3326
3321
  components: {
3327
- ShCanvas: script$7,
3328
- pagination: script$6
3322
+ ShCanvas: script$8,
3323
+ pagination: script$7
3329
3324
  },
3330
3325
  computed: {
3331
3326
  windowWidth: function () {
@@ -3343,7 +3338,7 @@ var script$5 = {
3343
3338
  }
3344
3339
  };
3345
3340
 
3346
- const _hoisted_1$4 = { class: "auto-table mt-2" };
3341
+ const _hoisted_1$5 = { class: "auto-table mt-2" };
3347
3342
  const _hoisted_2$4 = {
3348
3343
  key: 0,
3349
3344
  class: "col-md-4 mb-2"
@@ -3503,7 +3498,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3503
3498
  const _component_pagination = vue.resolveComponent("pagination");
3504
3499
  const _component_sh_canvas = vue.resolveComponent("sh-canvas");
3505
3500
 
3506
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
3501
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
3507
3502
  ($props.hasDownload)
3508
3503
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [
3509
3504
  vue.createElementVNode("button", {
@@ -3901,10 +3896,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3901
3896
  }, {
3902
3897
  default: vue.withCtx(() => [
3903
3898
  ($data.selectedRecord)
3904
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(action.canvasComponent), {
3905
- key: 0,
3906
- record: $data.selectedRecord
3907
- }, null, 8 /* PROPS */, ["record"]))
3899
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(action.canvasComponent), vue.mergeProps({ key: 0 }, action, { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["record"]))
3908
3900
  : vue.createCommentVNode("v-if", true)
3909
3901
  ]),
3910
3902
  _: 2 /* DYNAMIC */
@@ -3916,10 +3908,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3916
3908
  ]))
3917
3909
  }
3918
3910
 
3919
- script$5.render = render$1;
3920
- script$5.__file = "src/lib/components/ShTable.vue";
3911
+ script$6.render = render$1;
3912
+ script$6.__file = "src/lib/components/ShTable.vue";
3921
3913
 
3922
- var script$4 = {
3914
+ var script$5 = {
3923
3915
  name: 'ShTabs',
3924
3916
  props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive','classOne','classTwo','classes'],
3925
3917
  data () {
@@ -4040,10 +4032,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4040
4032
  ], 64 /* STABLE_FRAGMENT */))
4041
4033
  }
4042
4034
 
4043
- script$4.render = render;
4044
- script$4.__file = "src/lib/components/ShTabs.vue";
4035
+ script$5.render = render;
4036
+ script$5.__file = "src/lib/components/ShTabs.vue";
4045
4037
 
4046
- const _hoisted_1$3 = {
4038
+ const _hoisted_1$4 = {
4047
4039
  class: "nav nav-tabs",
4048
4040
  role: "tablist"
4049
4041
  };
@@ -4054,7 +4046,7 @@ const _hoisted_2$3 = {
4054
4046
  const _hoisted_3$3 = ["onClick"];
4055
4047
  const _hoisted_4$3 = { class: "tab-content" };
4056
4048
 
4057
- var script$3 = {
4049
+ var script$4 = {
4058
4050
  __name: 'ShDynamicTabs',
4059
4051
  props: ['tabs','data'],
4060
4052
  setup(__props) {
@@ -4079,7 +4071,7 @@ function setTab(tab){
4079
4071
 
4080
4072
  return (_ctx, _cache) => {
4081
4073
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
4082
- vue.createElementVNode("ul", _hoisted_1$3, [
4074
+ vue.createElementVNode("ul", _hoisted_1$4, [
4083
4075
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabs), (tab) => {
4084
4076
  return (vue.openBlock(), vue.createElementBlock("li", _hoisted_2$3, [
4085
4077
  vue.createElementVNode("button", {
@@ -4100,7 +4092,83 @@ return (_ctx, _cache) => {
4100
4092
 
4101
4093
  };
4102
4094
 
4103
- script$3.__file = "src/lib/components/ShDynamicTabs.vue";
4095
+ script$4.__file = "src/lib/components/ShDynamicTabs.vue";
4096
+
4097
+ const _hoisted_1$3 = /*#__PURE__*/vue.createElementVNode("span", {
4098
+ class: "spinner-border spinner-border-sm me-1",
4099
+ role: "status",
4100
+ "aria-hidden": "true"
4101
+ }, null, -1 /* HOISTED */);
4102
+
4103
+ var script$3 = {
4104
+ __name: 'ShSilentAction',
4105
+ props: {
4106
+ data: Object,
4107
+ loadingMessage: {
4108
+ type: String,
4109
+ default: 'Processing'
4110
+ },
4111
+ method: {
4112
+ type: String,
4113
+ default: 'POST'
4114
+ },
4115
+ url: {
4116
+ type: String,
4117
+ required: true
4118
+ }
4119
+ },
4120
+ emits: ['actionSuccessful','actionFailed'],
4121
+ setup(__props, { emit }) {
4122
+
4123
+ const props = __props;
4124
+
4125
+
4126
+ const processing = vue.ref(false);
4127
+
4128
+
4129
+ function runAction(){
4130
+ processing.value = true;
4131
+ if(props.method === 'POST'){
4132
+ shApis.doPost(props.url,props.data).then(res=>{
4133
+ emit('actionSuccessful',res);
4134
+ processing.value = false;
4135
+ }).catch(reason=>{
4136
+ emit('actionFailed', reason);
4137
+ processing.value = false;
4138
+ });
4139
+ }
4140
+ if(props.method === 'GET'){
4141
+ shApis.doGet(props.url,props.data).then(res=>{
4142
+ emit('actionSuccessful',res);
4143
+ processing.value = false;
4144
+ }).catch(reason=>{
4145
+ emit('actionFailed', reason);
4146
+ processing.value = false;
4147
+ });
4148
+ }
4149
+ }
4150
+
4151
+ return (_ctx, _cache) => {
4152
+ return (vue.openBlock(), vue.createElementBlock("a", {
4153
+ class: vue.normalizeClass(processing.value ? 'disabled':''),
4154
+ onClick: runAction
4155
+ }, [
4156
+ (processing.value)
4157
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
4158
+ _hoisted_1$3,
4159
+ vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4160
+ ], 64 /* STABLE_FRAGMENT */))
4161
+ : vue.createCommentVNode("v-if", true),
4162
+ (!processing.value)
4163
+ ? vue.renderSlot(_ctx.$slots, "default", { key: 1 })
4164
+ : vue.createCommentVNode("v-if", true)
4165
+ ], 2 /* CLASS */))
4166
+ }
4167
+ }
4168
+
4169
+ };
4170
+
4171
+ script$3.__file = "src/lib/components/ShSilentAction.vue";
4104
4172
 
4105
4173
  const useUserStore = pinia.defineStore('user-store', {
4106
4174
  state: () => ({
@@ -4228,7 +4296,7 @@ return (_ctx, _cache) => {
4228
4296
  _hoisted_5$2,
4229
4297
  vue.createTextVNode(" ADD DEPARTMENT")
4230
4298
  ], 512 /* NEED_PATCH */),
4231
- vue.createVNode(script$5, {
4299
+ vue.createVNode(script$6, {
4232
4300
  headers: ['id','name','description', 'created_at'],
4233
4301
  "end-point": "admin/departments/list",
4234
4302
  actions: {
@@ -4242,12 +4310,12 @@ return (_ctx, _cache) => {
4242
4310
  ]
4243
4311
  }
4244
4312
  }),
4245
- vue.createVNode(script$9, {
4313
+ vue.createVNode(script$a, {
4246
4314
  "modal-id": "sh-department_modal",
4247
4315
  "modal-title": "Department Form"
4248
4316
  }, {
4249
4317
  default: vue.withCtx(() => [
4250
- vue.createVNode(script$b, {
4318
+ vue.createVNode(script$c, {
4251
4319
  "success-callback": "departmentAdded",
4252
4320
  onDepartmentAdded: departmentAdded,
4253
4321
  action: "admin/departments/store",
@@ -4379,7 +4447,7 @@ return (_ctx, _cache) => {
4379
4447
  vue.createElementVNode("div", _hoisted_2$1, [
4380
4448
  _hoisted_3$1,
4381
4449
  vue.createElementVNode("h5", null, "Department #" + vue.toDisplayString(vue.unref(department).id) + " - " + vue.toDisplayString(vue.unref(department).name) + " Allowed Modules", 1 /* TEXT */),
4382
- vue.createVNode(script$5, {
4450
+ vue.createVNode(script$6, {
4383
4451
  actions: {
4384
4452
  label: 'Actions',
4385
4453
  actions: [
@@ -4399,12 +4467,12 @@ return (_ctx, _cache) => {
4399
4467
  headers: ['id',showModule,'created_at'],
4400
4468
  "end-point": 'admin/departments/department/list-modules/' + id.value
4401
4469
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
4402
- vue.createVNode(script$9, {
4470
+ vue.createVNode(script$a, {
4403
4471
  "modal-id": "addModule",
4404
4472
  "modal-title": "Add Module Department"
4405
4473
  }, {
4406
4474
  default: vue.withCtx(() => [
4407
- vue.createVNode(script$b, {
4475
+ vue.createVNode(script$c, {
4408
4476
  "reload-select-items": vue.unref(reload),
4409
4477
  "success-callback": moduleAdded,
4410
4478
  "fill-selects": {
@@ -4426,7 +4494,7 @@ return (_ctx, _cache) => {
4426
4494
  ref: permissionCanvasBtn,
4427
4495
  "data-bs-toggle": "offcanvas"
4428
4496
  }, null, 512 /* NEED_PATCH */),
4429
- vue.createVNode(script$7, {
4497
+ vue.createVNode(script$8, {
4430
4498
  "canvas-id": "permissionsCanvas",
4431
4499
  position: "end enlarged",
4432
4500
  "canvas-title": "Module Permissions"
@@ -4541,7 +4609,7 @@ return (_ctx, _cache) => {
4541
4609
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
4542
4610
  (section.value === 'login')
4543
4611
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
4544
- vue.createVNode(script$b, {
4612
+ vue.createVNode(script$c, {
4545
4613
  class: "sh-login-form",
4546
4614
  fields: ['email','password'],
4547
4615
  "action-label": "Login",
@@ -4566,7 +4634,7 @@ return (_ctx, _cache) => {
4566
4634
  (vue.unref(registerSubTitle))
4567
4635
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, vue.toDisplayString(vue.unref(registerSubTitle)), 1 /* TEXT */))
4568
4636
  : vue.createCommentVNode("v-if", true),
4569
- vue.createVNode(script$b, {
4637
+ vue.createVNode(script$c, {
4570
4638
  class: "sh-login-form",
4571
4639
  fields: vue.unref(registrationFields),
4572
4640
  "action-label": "Sign Up",
@@ -4630,16 +4698,17 @@ const ShFrontend = {
4630
4698
  }
4631
4699
  };
4632
4700
 
4633
- exports.ShCanvas = script$7;
4634
- exports.ShDropDownForm = script$a;
4635
- exports.ShDynamicTabs = script$3;
4636
- exports.ShForm = script$b;
4701
+ exports.ShCanvas = script$8;
4702
+ exports.ShDropDownForm = script$b;
4703
+ exports.ShDynamicTabs = script$4;
4704
+ exports.ShForm = script$c;
4637
4705
  exports.ShFrontend = ShFrontend;
4638
- exports.ShModal = script$9;
4639
- exports.ShModalForm = script$8;
4640
- exports.ShPhone = script$e;
4641
- exports.ShTable = script$5;
4642
- exports.ShTabs = script$4;
4706
+ exports.ShModal = script$a;
4707
+ exports.ShModalForm = script$9;
4708
+ exports.ShPhone = script$f;
4709
+ exports.ShSilentAction = script$3;
4710
+ exports.ShTable = script$6;
4711
+ exports.ShTabs = script$5;
4643
4712
  exports.shApis = shApis;
4644
4713
  exports.shRepo = shRepo;
4645
4714
  exports.shStorage = ShStorage;
package/dist/library.mjs CHANGED
@@ -1,6 +1,6 @@
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, resolveDynamicComponent, renderSlot, normalizeProps, guardReactiveProps, withCtx, createStaticVNode, shallowRef, mergeProps, computed, isRef, vModelCheckbox, watch, pushScopeId, popScopeId } from 'vue';
3
+ import { inject, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, resolveDynamicComponent, renderSlot, normalizeProps, guardReactiveProps, withCtx, createStaticVNode, mergeProps, shallowRef, 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';
@@ -1562,7 +1562,7 @@ const countries = [
1562
1562
  }
1563
1563
  ];
1564
1564
 
1565
- var script$e = {
1565
+ var script$f = {
1566
1566
  name: 'ShPhone',
1567
1567
  props: ['modelValue', 'country_code'],
1568
1568
  data () {
@@ -1624,7 +1624,7 @@ var script$e = {
1624
1624
  }
1625
1625
  };
1626
1626
 
1627
- const _hoisted_1$d = { class: "sh-phone mb-3" };
1627
+ const _hoisted_1$e = { class: "sh-phone mb-3" };
1628
1628
  const _hoisted_2$b = {
1629
1629
  key: 0,
1630
1630
  style: {"display":"contents"}
@@ -1633,7 +1633,7 @@ const _hoisted_3$a = ["src"];
1633
1633
  const _hoisted_4$a = ["value"];
1634
1634
 
1635
1635
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1636
- return (openBlock(), createElementBlock("div", _hoisted_1$d, [
1636
+ return (openBlock(), createElementBlock("div", _hoisted_1$e, [
1637
1637
  ($data.selectedCountry)
1638
1638
  ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
1639
1639
  createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$a),
@@ -1667,10 +1667,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1667
1667
  ]))
1668
1668
  }
1669
1669
 
1670
- script$e.render = render$7;
1671
- script$e.__file = "src/lib/components/ShPhone.vue";
1670
+ script$f.render = render$7;
1671
+ script$f.__file = "src/lib/components/ShPhone.vue";
1672
1672
 
1673
- var script$d = {
1673
+ var script$e = {
1674
1674
  name: 'ShEditor',
1675
1675
  props: ['modelValue'],
1676
1676
  components: {
@@ -1709,7 +1709,7 @@ var script$d = {
1709
1709
  }
1710
1710
  };
1711
1711
 
1712
- const _hoisted_1$c = /*#__PURE__*/createElementVNode("textarea", {
1712
+ const _hoisted_1$d = /*#__PURE__*/createElementVNode("textarea", {
1713
1713
  id: "tiny",
1714
1714
  style: {"display":"none"},
1715
1715
  "data-cy": "tinymce_editor"
@@ -1719,7 +1719,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1719
1719
  const _component_editor = resolveComponent("editor");
1720
1720
 
1721
1721
  return (openBlock(), createElementBlock(Fragment, null, [
1722
- _hoisted_1$c,
1722
+ _hoisted_1$d,
1723
1723
  createElementVNode("div", {
1724
1724
  onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
1725
1725
  class: "sh-editor w-100"
@@ -1744,10 +1744,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1744
1744
  ], 64 /* STABLE_FRAGMENT */))
1745
1745
  }
1746
1746
 
1747
- script$d.render = render$6;
1748
- script$d.__file = "src/lib/components/FormComponent/ShEditor.vue";
1747
+ script$e.render = render$6;
1748
+ script$e.__file = "src/lib/components/FormComponent/ShEditor.vue";
1749
1749
 
1750
- const _hoisted_1$b = {
1750
+ const _hoisted_1$c = {
1751
1751
  key: 0,
1752
1752
  class: "dropdown sh-suggest"
1753
1753
  };
@@ -1768,7 +1768,7 @@ const _hoisted_10$3 = {
1768
1768
  };
1769
1769
 
1770
1770
 
1771
- var script$c = {
1771
+ var script$d = {
1772
1772
  __name: 'ShSuggest',
1773
1773
  props: ['fillSelects','modelValue'],
1774
1774
  emits: ['update:modelValue'],
@@ -1849,7 +1849,7 @@ function filterData(e){
1849
1849
 
1850
1850
  return (_ctx, _cache) => {
1851
1851
  return (unref(id))
1852
- ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1852
+ ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
1853
1853
  createElementVNode("div", {
1854
1854
  id: unref(id),
1855
1855
  "data-bs-toggle": "dropdown",
@@ -1909,15 +1909,15 @@ return (_ctx, _cache) => {
1909
1909
 
1910
1910
  };
1911
1911
 
1912
- script$c.__scopeId = "data-v-5b767123";
1913
- script$c.__file = "src/lib/components/FormComponent/ShSuggest.vue";
1912
+ script$d.__scopeId = "data-v-5b767123";
1913
+ script$d.__file = "src/lib/components/FormComponent/ShSuggest.vue";
1914
1914
 
1915
- var script$b = {
1915
+ var script$c = {
1916
1916
  name: 'ShForm',
1917
1917
  components: {
1918
- ShSuggest: script$c,
1919
- ShEditor: script$d,
1920
- ShPhone: script$e
1918
+ ShSuggest: script$d,
1919
+ ShEditor: script$e,
1920
+ ShPhone: script$f
1921
1921
  },
1922
1922
  props: [
1923
1923
  'action',
@@ -2229,7 +2229,7 @@ var script$b = {
2229
2229
  }
2230
2230
  };
2231
2231
 
2232
- const _hoisted_1$a = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2232
+ const _hoisted_1$b = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2233
2233
  const _hoisted_2$9 = {
2234
2234
  ref: "ShAutoForm",
2235
2235
  class: "sh-form"
@@ -2291,7 +2291,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2291
2291
  const _component_ShEditor = resolveComponent("ShEditor");
2292
2292
 
2293
2293
  return (openBlock(), createElementBlock(Fragment, null, [
2294
- _hoisted_1$a,
2294
+ _hoisted_1$b,
2295
2295
  createElementVNode("form", _hoisted_2$9, [
2296
2296
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2297
2297
  createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
@@ -2508,13 +2508,13 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2508
2508
  ], 64 /* STABLE_FRAGMENT */))
2509
2509
  }
2510
2510
 
2511
- script$b.render = render$5;
2512
- script$b.__file = "src/lib/components/ShForm.vue";
2511
+ script$c.render = render$5;
2512
+ script$c.__file = "src/lib/components/ShForm.vue";
2513
2513
 
2514
- const _hoisted_1$9 = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
2514
+ const _hoisted_1$a = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
2515
2515
  const _hoisted_2$8 = { class: "dropdown" };
2516
2516
 
2517
- var script$a = {
2517
+ var script$b = {
2518
2518
  __name: 'ShDropDownForm',
2519
2519
  props: ['action',
2520
2520
  'classes',
@@ -2544,7 +2544,7 @@ const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
2544
2544
 
2545
2545
  return (_ctx, _cache) => {
2546
2546
  return (openBlock(), createElementBlock(Fragment, null, [
2547
- _hoisted_1$9,
2547
+ _hoisted_1$a,
2548
2548
  createElementVNode("div", _hoisted_2$8, [
2549
2549
  createElementVNode("a", {
2550
2550
  class: normalizeClass(unref(btnClass)),
@@ -2561,7 +2561,7 @@ return (_ctx, _cache) => {
2561
2561
  class: "dropdown-menu px-2 py-1",
2562
2562
  "aria-labelledby": dropdownId
2563
2563
  }, [
2564
- createVNode(script$b, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2564
+ createVNode(script$c, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2565
2565
  ])
2566
2566
  ])
2567
2567
  ], 64 /* STABLE_FRAGMENT */))
@@ -2570,16 +2570,16 @@ return (_ctx, _cache) => {
2570
2570
 
2571
2571
  };
2572
2572
 
2573
- script$a.__file = "src/lib/components/ShDropDownForm.vue";
2573
+ script$b.__file = "src/lib/components/ShDropDownForm.vue";
2574
2574
 
2575
- var script$9 = {
2575
+ var script$a = {
2576
2576
  name: 'ShModal',
2577
2577
  props: ['modalTitle', 'modalId', 'modalSize'],
2578
2578
  components: {
2579
2579
  }
2580
2580
  };
2581
2581
 
2582
- const _hoisted_1$8 = ["id"];
2582
+ const _hoisted_1$9 = ["id"];
2583
2583
  const _hoisted_2$7 = { class: "modal-content" };
2584
2584
  const _hoisted_3$7 = { class: "modal-header" };
2585
2585
  const _hoisted_4$7 = { class: "modal-title" };
@@ -2612,15 +2612,15 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2612
2612
  ])
2613
2613
  ])
2614
2614
  ], 2 /* CLASS */)
2615
- ], 8 /* PROPS */, _hoisted_1$8))
2615
+ ], 8 /* PROPS */, _hoisted_1$9))
2616
2616
  }
2617
2617
 
2618
- script$9.render = render$4;
2619
- script$9.__file = "src/lib/components/ShModal.vue";
2618
+ script$a.render = render$4;
2619
+ script$a.__file = "src/lib/components/ShModal.vue";
2620
2620
 
2621
- const _hoisted_1$7 = ["href"];
2621
+ const _hoisted_1$8 = ["href"];
2622
2622
 
2623
- var script$8 = {
2623
+ var script$9 = {
2624
2624
  __name: 'ShModalForm',
2625
2625
  props: ['action',
2626
2626
  'classes',
@@ -2656,13 +2656,13 @@ return (_ctx, _cache) => {
2656
2656
  "data-bs-toggle": "modal"
2657
2657
  }, [
2658
2658
  renderSlot(_ctx.$slots, "default")
2659
- ], 10 /* CLASS, PROPS */, _hoisted_1$7),
2660
- createVNode(script$9, {
2659
+ ], 10 /* CLASS, PROPS */, _hoisted_1$8),
2660
+ createVNode(script$a, {
2661
2661
  "modal-id": modalId,
2662
2662
  "modal-title": __props.modalTitle
2663
2663
  }, {
2664
2664
  default: withCtx(() => [
2665
- createVNode(script$b, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2665
+ createVNode(script$c, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2666
2666
  ]),
2667
2667
  _: 1 /* STABLE */
2668
2668
  }, 8 /* PROPS */, ["modal-title"])
@@ -2672,9 +2672,9 @@ return (_ctx, _cache) => {
2672
2672
 
2673
2673
  };
2674
2674
 
2675
- script$8.__file = "src/lib/components/ShModalForm.vue";
2675
+ script$9.__file = "src/lib/components/ShModalForm.vue";
2676
2676
 
2677
- var script$7 = {
2677
+ var script$8 = {
2678
2678
  name: 'ShCanvas',
2679
2679
  props: ['canvasTitle', 'canvasId', 'position','canvasSize'],
2680
2680
  components: {
@@ -2691,7 +2691,7 @@ var script$7 = {
2691
2691
  }
2692
2692
  };
2693
2693
 
2694
- const _hoisted_1$6 = ["id"];
2694
+ const _hoisted_1$7 = ["id"];
2695
2695
  const _hoisted_2$6 = { class: "offcanvas-header" };
2696
2696
  const _hoisted_3$6 = {
2697
2697
  class: "offcanvas-title",
@@ -2721,13 +2721,13 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2721
2721
  createElementVNode("div", _hoisted_4$6, [
2722
2722
  renderSlot(_ctx.$slots, "default")
2723
2723
  ])
2724
- ], 10 /* CLASS, PROPS */, _hoisted_1$6))
2724
+ ], 10 /* CLASS, PROPS */, _hoisted_1$7))
2725
2725
  }
2726
2726
 
2727
- script$7.render = render$3;
2728
- script$7.__file = "src/lib/components/ShCanvas.vue";
2727
+ script$8.render = render$3;
2728
+ script$8.__file = "src/lib/components/ShCanvas.vue";
2729
2729
 
2730
- var script$6 = {
2730
+ var script$7 = {
2731
2731
  name: 'Pagination',
2732
2732
  props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore'],
2733
2733
  data () {
@@ -2798,7 +2798,7 @@ var script$6 = {
2798
2798
  }
2799
2799
  };
2800
2800
 
2801
- const _hoisted_1$5 = { key: 0 };
2801
+ const _hoisted_1$6 = { key: 0 };
2802
2802
  const _hoisted_2$5 = { class: "record_count_body mb-3" };
2803
2803
  const _hoisted_3$5 = /*#__PURE__*/createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2804
2804
  const _hoisted_4$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);
@@ -2844,7 +2844,7 @@ const _hoisted_22$1 = {
2844
2844
 
2845
2845
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2846
2846
  return (!$props.loadMore)
2847
- ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
2847
+ ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
2848
2848
  createElementVNode("div", _hoisted_2$5, [
2849
2849
  _hoisted_3$5,
2850
2850
  createTextVNode("  "),
@@ -2916,8 +2916,8 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2916
2916
  ]))
2917
2917
  }
2918
2918
 
2919
- script$6.render = render$2;
2920
- script$6.__file = "src/lib/components/list_templates/Pagination.vue";
2919
+ script$7.render = render$2;
2920
+ script$7.__file = "src/lib/components/list_templates/Pagination.vue";
2921
2921
 
2922
2922
  function swalSuccess (message) {
2923
2923
  Swal.fire('Success!', message, 'success');
@@ -3057,20 +3057,15 @@ async function runPlainRequest (url, message, title, data) {
3057
3057
  showLoaderOnConfirm: true,
3058
3058
  preConfirm: () => {
3059
3059
  return shApis.doPost(url, data).then(function (response) {
3060
- Swal.fire('Success!', 'Action completed successfully', 'success');
3061
3060
  return {
3062
3061
  response: response.data,
3063
3062
  success: true
3064
3063
  }
3065
3064
  })
3066
- .catch(reason => {
3067
- if (typeof reason.response === 'undefined') {
3068
- Swal.fire('Error!', `Connection to ${url} lost`, 'error');
3069
- } else {
3070
- Swal.fire(`Error ${reason.response.status}`, reason.response.statusText, 'error');
3071
- }
3065
+ .catch(error => {
3072
3066
  return {
3073
- success: false
3067
+ success: false,
3068
+ error: error
3074
3069
  }
3075
3070
  })
3076
3071
  },
@@ -3098,7 +3093,7 @@ var shRepo = {
3098
3093
  formatDate
3099
3094
  };
3100
3095
 
3101
- var script$5 = {
3096
+ var script$6 = {
3102
3097
  name: 'sh-table',
3103
3098
  props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover'],
3104
3099
  inject: ['channel'],
@@ -3312,8 +3307,8 @@ var script$5 = {
3312
3307
  this.reloadData();
3313
3308
  },
3314
3309
  components: {
3315
- ShCanvas: script$7,
3316
- pagination: script$6
3310
+ ShCanvas: script$8,
3311
+ pagination: script$7
3317
3312
  },
3318
3313
  computed: {
3319
3314
  windowWidth: function () {
@@ -3331,7 +3326,7 @@ var script$5 = {
3331
3326
  }
3332
3327
  };
3333
3328
 
3334
- const _hoisted_1$4 = { class: "auto-table mt-2" };
3329
+ const _hoisted_1$5 = { class: "auto-table mt-2" };
3335
3330
  const _hoisted_2$4 = {
3336
3331
  key: 0,
3337
3332
  class: "col-md-4 mb-2"
@@ -3491,7 +3486,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3491
3486
  const _component_pagination = resolveComponent("pagination");
3492
3487
  const _component_sh_canvas = resolveComponent("sh-canvas");
3493
3488
 
3494
- return (openBlock(), createElementBlock("div", _hoisted_1$4, [
3489
+ return (openBlock(), createElementBlock("div", _hoisted_1$5, [
3495
3490
  ($props.hasDownload)
3496
3491
  ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
3497
3492
  createElementVNode("button", {
@@ -3889,10 +3884,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3889
3884
  }, {
3890
3885
  default: withCtx(() => [
3891
3886
  ($data.selectedRecord)
3892
- ? (openBlock(), createBlock(resolveDynamicComponent(action.canvasComponent), {
3893
- key: 0,
3894
- record: $data.selectedRecord
3895
- }, null, 8 /* PROPS */, ["record"]))
3887
+ ? (openBlock(), createBlock(resolveDynamicComponent(action.canvasComponent), mergeProps({ key: 0 }, action, { record: $data.selectedRecord }), null, 16 /* FULL_PROPS */, ["record"]))
3896
3888
  : createCommentVNode("v-if", true)
3897
3889
  ]),
3898
3890
  _: 2 /* DYNAMIC */
@@ -3904,10 +3896,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3904
3896
  ]))
3905
3897
  }
3906
3898
 
3907
- script$5.render = render$1;
3908
- script$5.__file = "src/lib/components/ShTable.vue";
3899
+ script$6.render = render$1;
3900
+ script$6.__file = "src/lib/components/ShTable.vue";
3909
3901
 
3910
- var script$4 = {
3902
+ var script$5 = {
3911
3903
  name: 'ShTabs',
3912
3904
  props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive','classOne','classTwo','classes'],
3913
3905
  data () {
@@ -4028,10 +4020,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4028
4020
  ], 64 /* STABLE_FRAGMENT */))
4029
4021
  }
4030
4022
 
4031
- script$4.render = render;
4032
- script$4.__file = "src/lib/components/ShTabs.vue";
4023
+ script$5.render = render;
4024
+ script$5.__file = "src/lib/components/ShTabs.vue";
4033
4025
 
4034
- const _hoisted_1$3 = {
4026
+ const _hoisted_1$4 = {
4035
4027
  class: "nav nav-tabs",
4036
4028
  role: "tablist"
4037
4029
  };
@@ -4042,7 +4034,7 @@ const _hoisted_2$3 = {
4042
4034
  const _hoisted_3$3 = ["onClick"];
4043
4035
  const _hoisted_4$3 = { class: "tab-content" };
4044
4036
 
4045
- var script$3 = {
4037
+ var script$4 = {
4046
4038
  __name: 'ShDynamicTabs',
4047
4039
  props: ['tabs','data'],
4048
4040
  setup(__props) {
@@ -4067,7 +4059,7 @@ function setTab(tab){
4067
4059
 
4068
4060
  return (_ctx, _cache) => {
4069
4061
  return (openBlock(), createElementBlock(Fragment, null, [
4070
- createElementVNode("ul", _hoisted_1$3, [
4062
+ createElementVNode("ul", _hoisted_1$4, [
4071
4063
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab) => {
4072
4064
  return (openBlock(), createElementBlock("li", _hoisted_2$3, [
4073
4065
  createElementVNode("button", {
@@ -4088,7 +4080,83 @@ return (_ctx, _cache) => {
4088
4080
 
4089
4081
  };
4090
4082
 
4091
- script$3.__file = "src/lib/components/ShDynamicTabs.vue";
4083
+ script$4.__file = "src/lib/components/ShDynamicTabs.vue";
4084
+
4085
+ const _hoisted_1$3 = /*#__PURE__*/createElementVNode("span", {
4086
+ class: "spinner-border spinner-border-sm me-1",
4087
+ role: "status",
4088
+ "aria-hidden": "true"
4089
+ }, null, -1 /* HOISTED */);
4090
+
4091
+ var script$3 = {
4092
+ __name: 'ShSilentAction',
4093
+ props: {
4094
+ data: Object,
4095
+ loadingMessage: {
4096
+ type: String,
4097
+ default: 'Processing'
4098
+ },
4099
+ method: {
4100
+ type: String,
4101
+ default: 'POST'
4102
+ },
4103
+ url: {
4104
+ type: String,
4105
+ required: true
4106
+ }
4107
+ },
4108
+ emits: ['actionSuccessful','actionFailed'],
4109
+ setup(__props, { emit }) {
4110
+
4111
+ const props = __props;
4112
+
4113
+
4114
+ const processing = ref(false);
4115
+
4116
+
4117
+ function runAction(){
4118
+ processing.value = true;
4119
+ if(props.method === 'POST'){
4120
+ shApis.doPost(props.url,props.data).then(res=>{
4121
+ emit('actionSuccessful',res);
4122
+ processing.value = false;
4123
+ }).catch(reason=>{
4124
+ emit('actionFailed', reason);
4125
+ processing.value = false;
4126
+ });
4127
+ }
4128
+ if(props.method === 'GET'){
4129
+ shApis.doGet(props.url,props.data).then(res=>{
4130
+ emit('actionSuccessful',res);
4131
+ processing.value = false;
4132
+ }).catch(reason=>{
4133
+ emit('actionFailed', reason);
4134
+ processing.value = false;
4135
+ });
4136
+ }
4137
+ }
4138
+
4139
+ return (_ctx, _cache) => {
4140
+ return (openBlock(), createElementBlock("a", {
4141
+ class: normalizeClass(processing.value ? 'disabled':''),
4142
+ onClick: runAction
4143
+ }, [
4144
+ (processing.value)
4145
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4146
+ _hoisted_1$3,
4147
+ createElementVNode("span", null, toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4148
+ ], 64 /* STABLE_FRAGMENT */))
4149
+ : createCommentVNode("v-if", true),
4150
+ (!processing.value)
4151
+ ? renderSlot(_ctx.$slots, "default", { key: 1 })
4152
+ : createCommentVNode("v-if", true)
4153
+ ], 2 /* CLASS */))
4154
+ }
4155
+ }
4156
+
4157
+ };
4158
+
4159
+ script$3.__file = "src/lib/components/ShSilentAction.vue";
4092
4160
 
4093
4161
  const useUserStore = defineStore('user-store', {
4094
4162
  state: () => ({
@@ -4216,7 +4284,7 @@ return (_ctx, _cache) => {
4216
4284
  _hoisted_5$2,
4217
4285
  createTextVNode(" ADD DEPARTMENT")
4218
4286
  ], 512 /* NEED_PATCH */),
4219
- createVNode(script$5, {
4287
+ createVNode(script$6, {
4220
4288
  headers: ['id','name','description', 'created_at'],
4221
4289
  "end-point": "admin/departments/list",
4222
4290
  actions: {
@@ -4230,12 +4298,12 @@ return (_ctx, _cache) => {
4230
4298
  ]
4231
4299
  }
4232
4300
  }),
4233
- createVNode(script$9, {
4301
+ createVNode(script$a, {
4234
4302
  "modal-id": "sh-department_modal",
4235
4303
  "modal-title": "Department Form"
4236
4304
  }, {
4237
4305
  default: withCtx(() => [
4238
- createVNode(script$b, {
4306
+ createVNode(script$c, {
4239
4307
  "success-callback": "departmentAdded",
4240
4308
  onDepartmentAdded: departmentAdded,
4241
4309
  action: "admin/departments/store",
@@ -4367,7 +4435,7 @@ return (_ctx, _cache) => {
4367
4435
  createElementVNode("div", _hoisted_2$1, [
4368
4436
  _hoisted_3$1,
4369
4437
  createElementVNode("h5", null, "Department #" + toDisplayString(unref(department).id) + " - " + toDisplayString(unref(department).name) + " Allowed Modules", 1 /* TEXT */),
4370
- createVNode(script$5, {
4438
+ createVNode(script$6, {
4371
4439
  actions: {
4372
4440
  label: 'Actions',
4373
4441
  actions: [
@@ -4387,12 +4455,12 @@ return (_ctx, _cache) => {
4387
4455
  headers: ['id',showModule,'created_at'],
4388
4456
  "end-point": 'admin/departments/department/list-modules/' + id.value
4389
4457
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
4390
- createVNode(script$9, {
4458
+ createVNode(script$a, {
4391
4459
  "modal-id": "addModule",
4392
4460
  "modal-title": "Add Module Department"
4393
4461
  }, {
4394
4462
  default: withCtx(() => [
4395
- createVNode(script$b, {
4463
+ createVNode(script$c, {
4396
4464
  "reload-select-items": unref(reload),
4397
4465
  "success-callback": moduleAdded,
4398
4466
  "fill-selects": {
@@ -4414,7 +4482,7 @@ return (_ctx, _cache) => {
4414
4482
  ref: permissionCanvasBtn,
4415
4483
  "data-bs-toggle": "offcanvas"
4416
4484
  }, null, 512 /* NEED_PATCH */),
4417
- createVNode(script$7, {
4485
+ createVNode(script$8, {
4418
4486
  "canvas-id": "permissionsCanvas",
4419
4487
  position: "end enlarged",
4420
4488
  "canvas-title": "Module Permissions"
@@ -4529,7 +4597,7 @@ return (_ctx, _cache) => {
4529
4597
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4530
4598
  (section.value === 'login')
4531
4599
  ? (openBlock(), createElementBlock("div", _hoisted_2, [
4532
- createVNode(script$b, {
4600
+ createVNode(script$c, {
4533
4601
  class: "sh-login-form",
4534
4602
  fields: ['email','password'],
4535
4603
  "action-label": "Login",
@@ -4554,7 +4622,7 @@ return (_ctx, _cache) => {
4554
4622
  (unref(registerSubTitle))
4555
4623
  ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
4556
4624
  : createCommentVNode("v-if", true),
4557
- createVNode(script$b, {
4625
+ createVNode(script$c, {
4558
4626
  class: "sh-login-form",
4559
4627
  fields: unref(registrationFields),
4560
4628
  "action-label": "Sign Up",
@@ -4618,4 +4686,4 @@ const ShFrontend = {
4618
4686
  }
4619
4687
  };
4620
4688
 
4621
- export { script$7 as ShCanvas, script$a as ShDropDownForm, script$3 as ShDynamicTabs, script$b as ShForm, ShFrontend, script$9 as ShModal, script$8 as ShModalForm, script$e as ShPhone, script$5 as ShTable, script$4 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
4689
+ export { script$8 as ShCanvas, script$b as ShDropDownForm, script$4 as ShDynamicTabs, script$c as ShForm, ShFrontend, script$a as ShModal, script$9 as ShModalForm, script$f as ShPhone, script$3 as ShSilentAction, script$6 as ShTable, script$5 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",