@iankibetsh/shframework 4.6.1 → 4.6.3

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
@@ -2067,15 +2067,15 @@ const _hoisted_2$g = {
2067
2067
  key: 0,
2068
2068
  style: {"display":"contents"}
2069
2069
  };
2070
- const _hoisted_3$e = ["src"];
2071
- const _hoisted_4$e = ["value"];
2070
+ const _hoisted_3$f = ["src"];
2071
+ const _hoisted_4$f = ["value"];
2072
2072
  const _hoisted_5$c = ["disabled"];
2073
2073
 
2074
2074
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2075
2075
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$q, [
2076
2076
  ($data.selectedCountry)
2077
2077
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$g, [
2078
- vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$e),
2078
+ vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$f),
2079
2079
  vue.createTextVNode(" " + vue.toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
2080
2080
  ]))
2081
2081
  : vue.createCommentVNode("v-if", true),
@@ -2088,7 +2088,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2088
2088
  return (vue.openBlock(), vue.createElementBlock("option", {
2089
2089
  value: country,
2090
2090
  key: country.dialCode
2091
- }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$e))
2091
+ }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$f))
2092
2092
  }), 128 /* KEYED_FRAGMENT */))
2093
2093
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
2094
2094
  [vue.vModelSelect, $data.selectedCountry]
@@ -2115,8 +2115,8 @@ const _hoisted_1$p = {
2115
2115
  class: "dropdown sh-suggest"
2116
2116
  };
2117
2117
  const _hoisted_2$f = ["id"];
2118
- const _hoisted_3$d = { class: "sh-suggestions-holder" };
2119
- const _hoisted_4$d = { class: "badge bg-secondary m-1 sh-selected-item" };
2118
+ const _hoisted_3$e = { class: "sh-suggestions-holder" };
2119
+ const _hoisted_4$e = { class: "badge bg-secondary m-1 sh-selected-item" };
2120
2120
  const _hoisted_5$b = ["onClick"];
2121
2121
  const _hoisted_6$a = ["id"];
2122
2122
  const _hoisted_7$9 = ["id", "aria-labelledby"];
@@ -2274,9 +2274,9 @@ return (_ctx, _cache) => {
2274
2274
  class: "p-0 d-flex sh-suggest-control dropdown-toggle",
2275
2275
  "aria-expanded": "false"
2276
2276
  }, [
2277
- vue.createElementVNode("div", _hoisted_3$d, [
2277
+ vue.createElementVNode("div", _hoisted_3$e, [
2278
2278
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(selectedSuggestions), (sgt) => {
2279
- return (vue.openBlock(), vue.createElementBlock("h5", _hoisted_4$d, [
2279
+ return (vue.openBlock(), vue.createElementBlock("h5", _hoisted_4$e, [
2280
2280
  vue.createTextVNode(vue.toDisplayString(sgt.name) + " ", 1 /* TEXT */),
2281
2281
  vue.createElementVNode("button", {
2282
2282
  onClick: $event => (removeSuggestion(sgt.id)),
@@ -2698,12 +2698,12 @@ const _hoisted_2$e = {
2698
2698
  ref: "ShAutoForm",
2699
2699
  class: "sh-form"
2700
2700
  };
2701
- const _hoisted_3$c = {
2701
+ const _hoisted_3$d = {
2702
2702
  key: 0,
2703
2703
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2704
2704
  role: "alert"
2705
2705
  };
2706
- const _hoisted_4$c = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2706
+ const _hoisted_4$d = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2707
2707
  const _hoisted_5$a = { key: 0 };
2708
2708
  const _hoisted_6$9 = { key: 1 };
2709
2709
  const _hoisted_7$8 = { class: "row" };
@@ -2765,8 +2765,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2765
2765
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2766
2766
  vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2767
2767
  (_ctx.form_status == 3)
2768
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$c, [
2769
- _hoisted_4$c,
2768
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$d, [
2769
+ _hoisted_4$d,
2770
2770
  (_ctx.errorText)
2771
2771
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$a, vue.toDisplayString(_ctx.errorText), 1 /* TEXT */))
2772
2772
  : (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$9, "Unexpected Error Occurred")),
@@ -3319,8 +3319,8 @@ script$p.__file = "src/lib/components/form-components/DateInput.vue";
3319
3319
 
3320
3320
  const _hoisted_1$l = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3321
3321
  const _hoisted_2$d = ["onUpdate:modelValue"];
3322
- const _hoisted_3$b = ["innerHTML"];
3323
- const _hoisted_4$b = {
3322
+ const _hoisted_3$c = ["innerHTML"];
3323
+ const _hoisted_4$c = {
3324
3324
  key: 0,
3325
3325
  class: "text-danger sh-required"
3326
3326
  };
@@ -3607,9 +3607,9 @@ return (_ctx, _cache) => {
3607
3607
  vue.createElementVNode("span", {
3608
3608
  innerHTML: field.label,
3609
3609
  class: "sh-label"
3610
- }, null, 8 /* PROPS */, _hoisted_3$b),
3610
+ }, null, 8 /* PROPS */, _hoisted_3$c),
3611
3611
  (field.required)
3612
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$b, "*"))
3612
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$c, "*"))
3613
3613
  : vue.createCommentVNode("v-if", true)
3614
3614
  ], 2 /* CLASS */))
3615
3615
  : vue.createCommentVNode("v-if", true),
@@ -3674,69 +3674,10 @@ return (_ctx, _cache) => {
3674
3674
 
3675
3675
  script$o.__file = "src/lib/components/ShAutoForm.vue";
3676
3676
 
3677
- const _hoisted_1$k = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3678
- const _hoisted_2$c = { class: "dropdown" };
3679
-
3680
- var script$n = {
3681
- __name: 'ShDropDownForm',
3682
- props: ['action',
3683
- 'classes',
3684
- 'hasTerms',
3685
- 'country_code',
3686
- 'submitBtnClass',
3687
- 'fields',
3688
- 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3689
- 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3690
- 'failedCallback', 'labels', 'editors',
3691
- 'datePickers',
3692
- 'textAreas',
3693
- 'files',
3694
- 'phones',
3695
- 'numbers',
3696
- 'customComponent','modalTitle','class'],
3697
- setup(__props) {
3698
-
3699
- const props = __props;
3700
-
3701
- vue.ref(props);
3702
- let btnClass=props.class;
3703
- const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3704
-
3705
-
3706
- return (_ctx, _cache) => {
3707
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3708
- _hoisted_1$k,
3709
- vue.createElementVNode("div", _hoisted_2$c, [
3710
- vue.createElementVNode("a", {
3711
- class: vue.normalizeClass(vue.unref(btnClass)),
3712
- href: "#",
3713
- role: "button",
3714
- id: dropdownId,
3715
- "data-bs-toggle": "dropdown",
3716
- "data-bs-auto-close": "outside",
3717
- "aria-expanded": "false"
3718
- }, [
3719
- vue.renderSlot(_ctx.$slots, "default")
3720
- ], 2 /* CLASS */),
3721
- vue.createElementVNode("div", {
3722
- class: "dropdown-menu px-2 py-1",
3723
- "aria-labelledby": dropdownId
3724
- }, [
3725
- vue.createVNode(script$w, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3726
- ])
3727
- ])
3728
- ], 64 /* STABLE_FRAGMENT */))
3729
- }
3730
- }
3731
-
3732
- };
3733
-
3734
- script$n.__file = "src/lib/components/ShDropDownForm.vue";
3735
-
3736
- const _hoisted_1$j = ["id", "data-bs-backdrop"];
3737
- const _hoisted_2$b = { class: "modal-content" };
3738
- const _hoisted_3$a = { class: "modal-header" };
3739
- const _hoisted_4$a = { class: "modal-title flex-fill" };
3677
+ const _hoisted_1$k = ["id", "data-bs-backdrop"];
3678
+ const _hoisted_2$c = { class: "modal-content" };
3679
+ const _hoisted_3$b = { class: "modal-header" };
3680
+ const _hoisted_4$b = { class: "modal-title flex-fill" };
3740
3681
  const _hoisted_5$8 = /*#__PURE__*/vue.createElementVNode("button", {
3741
3682
  class: "btn btn-danger btn-sm",
3742
3683
  "data-bs-dismiss": "modal",
@@ -3746,7 +3687,7 @@ const _hoisted_6$7 = { class: "modal-body" };
3746
3687
  const _hoisted_7$6 = { class: "section" };
3747
3688
 
3748
3689
 
3749
- var script$m = {
3690
+ var script$n = {
3750
3691
  __name: 'ShModal',
3751
3692
  props: {
3752
3693
  modalId: {
@@ -3804,9 +3745,9 @@ return (_ctx, _cache) => {
3804
3745
  vue.createElementVNode("div", {
3805
3746
  class: vue.normalizeClass(["modal-dialog", modalClasses.value])
3806
3747
  }, [
3807
- vue.createElementVNode("div", _hoisted_2$b, [
3808
- vue.createElementVNode("div", _hoisted_3$a, [
3809
- vue.createElementVNode("h3", _hoisted_4$a, vue.toDisplayString(__props.modalTitle), 1 /* TEXT */),
3748
+ vue.createElementVNode("div", _hoisted_2$c, [
3749
+ vue.createElementVNode("div", _hoisted_3$b, [
3750
+ vue.createElementVNode("h3", _hoisted_4$b, vue.toDisplayString(__props.modalTitle), 1 /* TEXT */),
3810
3751
  _hoisted_5$8
3811
3752
  ]),
3812
3753
  vue.createElementVNode("div", _hoisted_6$7, [
@@ -3816,13 +3757,100 @@ return (_ctx, _cache) => {
3816
3757
  ])
3817
3758
  ])
3818
3759
  ], 2 /* CLASS */)
3819
- ], 8 /* PROPS */, _hoisted_1$j))
3760
+ ], 8 /* PROPS */, _hoisted_1$k))
3761
+ }
3762
+ }
3763
+
3764
+ };
3765
+
3766
+ script$n.__file = "src/lib/components/ShModal.vue";
3767
+
3768
+ const _hoisted_1$j = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3769
+ const _hoisted_2$b = { class: "dropdown" };
3770
+ const _hoisted_3$a = ["id"];
3771
+ const _hoisted_4$a = ["aria-labelledby"];
3772
+
3773
+ var script$m = {
3774
+ __name: 'ShDropDownForm',
3775
+ props: ['action',
3776
+ 'classes',
3777
+ 'method',
3778
+ 'hasTerms',
3779
+ 'country_code',
3780
+ 'submitBtnClass',
3781
+ 'fields',
3782
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3783
+ 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3784
+ 'failedCallback', 'labels', 'editors',
3785
+ 'datePickers',
3786
+ 'required',
3787
+ 'textAreas',
3788
+ 'files',
3789
+ 'phones',
3790
+ 'numbers',
3791
+ 'customComponent','modalTitle','class','successMessage', 'modalId'],
3792
+ emits: ['success','fieldChanged','formSubmitted','formError','modalId'],
3793
+ setup(__props, { emit: __emit }) {
3794
+
3795
+ const props = __props;
3796
+ const emit = __emit;
3797
+ vue.ref(props);
3798
+ let btnClass=props.class;
3799
+ const realModalId = props.modalId ?? 'rand' + (Math.random() + 1).toString(36).substring(2);
3800
+ const success = (res)=>{
3801
+ emit('success',res);
3802
+ };
3803
+ vue.onMounted(()=>{
3804
+ emit('modalId',realModalId);
3805
+ });
3806
+
3807
+ const fieldChanged = (field, value)=>{
3808
+ emit('fieldChanged',field, value);
3809
+ };
3810
+
3811
+ const formSubmitted = (res)=>{
3812
+ emit('formSubmitted',res);
3813
+ };
3814
+
3815
+ const formError = (res)=>{
3816
+ emit('formError',res);
3817
+ };
3818
+
3819
+ return (_ctx, _cache) => {
3820
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3821
+ _hoisted_1$j,
3822
+ vue.createElementVNode("div", _hoisted_2$b, [
3823
+ vue.createElementVNode("a", {
3824
+ class: vue.normalizeClass(vue.unref(btnClass)),
3825
+ href: "#",
3826
+ role: "button",
3827
+ id: _ctx.dropdownId,
3828
+ "data-bs-toggle": "dropdown",
3829
+ "data-bs-auto-close": "outside",
3830
+ "aria-expanded": "false"
3831
+ }, [
3832
+ vue.renderSlot(_ctx.$slots, "default")
3833
+ ], 10 /* CLASS, PROPS */, _hoisted_3$a),
3834
+ vue.createElementVNode("div", {
3835
+ class: "dropdown-menu px-2 py-1",
3836
+ "aria-labelledby": _ctx.dropdownId
3837
+ }, [
3838
+ (vue.openBlock(), vue.createBlock(script$o, vue.mergeProps({
3839
+ onSuccess: success,
3840
+ onFieldChanged: fieldChanged,
3841
+ onFormSubmitted: formSubmitted,
3842
+ onFormError: formError,
3843
+ key: JSON.stringify(__props.currentData ?? {})
3844
+ }, props), null, 16 /* FULL_PROPS */))
3845
+ ], 8 /* PROPS */, _hoisted_4$a)
3846
+ ])
3847
+ ], 64 /* STABLE_FRAGMENT */))
3820
3848
  }
3821
3849
  }
3822
3850
 
3823
3851
  };
3824
3852
 
3825
- script$m.__file = "src/lib/components/ShModal.vue";
3853
+ script$m.__file = "src/lib/components/ShDropDownForm.vue";
3826
3854
 
3827
3855
  const _hoisted_1$i = ["href"];
3828
3856
 
@@ -3872,16 +3900,21 @@ const formError = (res)=>{
3872
3900
  emit('formError',res);
3873
3901
  };
3874
3902
 
3903
+ const emitClick = ()=>{
3904
+ emit('click');
3905
+ };
3906
+
3875
3907
  return (_ctx, _cache) => {
3876
3908
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3877
3909
  vue.createElementVNode("a", {
3878
3910
  class: vue.normalizeClass(vue.unref(btnClass)),
3879
3911
  href: '#' + vue.unref(realModalId),
3880
- "data-bs-toggle": "modal"
3912
+ "data-bs-toggle": "modal",
3913
+ onClick: emitClick
3881
3914
  }, [
3882
3915
  vue.renderSlot(_ctx.$slots, "default")
3883
3916
  ], 10 /* CLASS, PROPS */, _hoisted_1$i),
3884
- vue.createVNode(script$m, {
3917
+ vue.createVNode(script$n, {
3885
3918
  "modal-id": vue.unref(realModalId),
3886
3919
  "modal-title": __props.modalTitle
3887
3920
  }, {
@@ -3945,7 +3978,7 @@ return (_ctx, _cache) => {
3945
3978
  }, [
3946
3979
  vue.renderSlot(_ctx.$slots, "default")
3947
3980
  ], 10 /* CLASS, PROPS */, _hoisted_1$h),
3948
- vue.createVNode(script$m, {
3981
+ vue.createVNode(script$n, {
3949
3982
  "modal-id": modalId,
3950
3983
  "modal-title": __props.modalTitle
3951
3984
  }, {
@@ -6326,7 +6359,7 @@ return (_ctx, _cache) => {
6326
6359
  class: "d-none"
6327
6360
  }, "Open Modal", 8 /* PROPS */, _hoisted_1$5),
6328
6361
  (popUp.value === 'modal')
6329
- ? (vue.openBlock(), vue.createBlock(script$m, {
6362
+ ? (vue.openBlock(), vue.createBlock(script$n, {
6330
6363
  key: 0,
6331
6364
  "modal-title": title.value,
6332
6365
  "modal-id": vue.unref(modalId),
@@ -6475,7 +6508,7 @@ const goBack = () => {
6475
6508
  return (_ctx, _cache) => {
6476
6509
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
6477
6510
  (popUp.value === 'modal')
6478
- ? (vue.openBlock(), vue.createBlock(script$m, {
6511
+ ? (vue.openBlock(), vue.createBlock(script$n, {
6479
6512
  key: 0,
6480
6513
  "modal-title": title.value,
6481
6514
  "data-bs-backdrop": "static",
@@ -6753,7 +6786,7 @@ return (_ctx, _cache) => {
6753
6786
  ]
6754
6787
  }
6755
6788
  }, null, 8 /* PROPS */, ["reload", "actions"]),
6756
- vue.createVNode(script$m, {
6789
+ vue.createVNode(script$n, {
6757
6790
  "modal-id": "sh_department_modal",
6758
6791
  "modal-title": "Department Form"
6759
6792
  }, {
@@ -6913,7 +6946,7 @@ return (_ctx, _cache) => {
6913
6946
  headers: ['id',showModule,'created_at'],
6914
6947
  "end-point": 'admin/departments/department/list-modules/' + id.value
6915
6948
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
6916
- vue.createVNode(script$m, {
6949
+ vue.createVNode(script$n, {
6917
6950
  "modal-id": "addModule",
6918
6951
  "modal-title": "Add Module Department"
6919
6952
  }, {
@@ -7310,11 +7343,11 @@ exports.ShCanvas = script$j;
7310
7343
  exports.ShCanvasBtn = script$9;
7311
7344
  exports.ShCardLayout = script$4;
7312
7345
  exports.ShConfirmAction = script$g;
7313
- exports.ShDropDownForm = script$n;
7346
+ exports.ShDropDownForm = script$m;
7314
7347
  exports.ShDynamicTabs = script$b;
7315
7348
  exports.ShForm = script$w;
7316
7349
  exports.ShFrontend = ShFrontend;
7317
- exports.ShModal = script$m;
7350
+ exports.ShModal = script$n;
7318
7351
  exports.ShModalBtn = script$a;
7319
7352
  exports.ShModalForm = script$l;
7320
7353
  exports.ShModalFormAuto = script$k;
package/dist/library.mjs CHANGED
@@ -3,7 +3,7 @@ import moment from 'moment';
3
3
  import Swal from 'sweetalert2';
4
4
  import { Modal, Offcanvas } from 'bootstrap';
5
5
  import NProgress from 'nprogress';
6
- import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, watch, unref, createBlock, resolveDynamicComponent, normalizeClass, resolveComponent, inject, mergeProps, normalizeStyle, renderSlot, createVNode, normalizeProps, guardReactiveProps, computed, withCtx, vModelCheckbox, shallowRef, pushScopeId, popScopeId, markRaw, isRef } from 'vue';
6
+ import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, watch, unref, createBlock, resolveDynamicComponent, normalizeClass, resolveComponent, inject, mergeProps, normalizeStyle, renderSlot, computed, createVNode, withCtx, vModelCheckbox, shallowRef, normalizeProps, pushScopeId, popScopeId, markRaw, isRef } from 'vue';
7
7
  import _ from 'lodash';
8
8
  import { defineStore, storeToRefs } from 'pinia';
9
9
  import { useRoute, useRouter } from 'vue-router';
@@ -2055,15 +2055,15 @@ const _hoisted_2$g = {
2055
2055
  key: 0,
2056
2056
  style: {"display":"contents"}
2057
2057
  };
2058
- const _hoisted_3$e = ["src"];
2059
- const _hoisted_4$e = ["value"];
2058
+ const _hoisted_3$f = ["src"];
2059
+ const _hoisted_4$f = ["value"];
2060
2060
  const _hoisted_5$c = ["disabled"];
2061
2061
 
2062
2062
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2063
2063
  return (openBlock(), createElementBlock("div", _hoisted_1$q, [
2064
2064
  ($data.selectedCountry)
2065
2065
  ? (openBlock(), createElementBlock("div", _hoisted_2$g, [
2066
- createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$e),
2066
+ createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$f),
2067
2067
  createTextVNode(" " + toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
2068
2068
  ]))
2069
2069
  : createCommentVNode("v-if", true),
@@ -2076,7 +2076,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2076
2076
  return (openBlock(), createElementBlock("option", {
2077
2077
  value: country,
2078
2078
  key: country.dialCode
2079
- }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$e))
2079
+ }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$f))
2080
2080
  }), 128 /* KEYED_FRAGMENT */))
2081
2081
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
2082
2082
  [vModelSelect, $data.selectedCountry]
@@ -2103,8 +2103,8 @@ const _hoisted_1$p = {
2103
2103
  class: "dropdown sh-suggest"
2104
2104
  };
2105
2105
  const _hoisted_2$f = ["id"];
2106
- const _hoisted_3$d = { class: "sh-suggestions-holder" };
2107
- const _hoisted_4$d = { class: "badge bg-secondary m-1 sh-selected-item" };
2106
+ const _hoisted_3$e = { class: "sh-suggestions-holder" };
2107
+ const _hoisted_4$e = { class: "badge bg-secondary m-1 sh-selected-item" };
2108
2108
  const _hoisted_5$b = ["onClick"];
2109
2109
  const _hoisted_6$a = ["id"];
2110
2110
  const _hoisted_7$9 = ["id", "aria-labelledby"];
@@ -2262,9 +2262,9 @@ return (_ctx, _cache) => {
2262
2262
  class: "p-0 d-flex sh-suggest-control dropdown-toggle",
2263
2263
  "aria-expanded": "false"
2264
2264
  }, [
2265
- createElementVNode("div", _hoisted_3$d, [
2265
+ createElementVNode("div", _hoisted_3$e, [
2266
2266
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedSuggestions), (sgt) => {
2267
- return (openBlock(), createElementBlock("h5", _hoisted_4$d, [
2267
+ return (openBlock(), createElementBlock("h5", _hoisted_4$e, [
2268
2268
  createTextVNode(toDisplayString(sgt.name) + " ", 1 /* TEXT */),
2269
2269
  createElementVNode("button", {
2270
2270
  onClick: $event => (removeSuggestion(sgt.id)),
@@ -2686,12 +2686,12 @@ const _hoisted_2$e = {
2686
2686
  ref: "ShAutoForm",
2687
2687
  class: "sh-form"
2688
2688
  };
2689
- const _hoisted_3$c = {
2689
+ const _hoisted_3$d = {
2690
2690
  key: 0,
2691
2691
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2692
2692
  role: "alert"
2693
2693
  };
2694
- const _hoisted_4$c = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2694
+ const _hoisted_4$d = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2695
2695
  const _hoisted_5$a = { key: 0 };
2696
2696
  const _hoisted_6$9 = { key: 1 };
2697
2697
  const _hoisted_7$8 = { class: "row" };
@@ -2753,8 +2753,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2753
2753
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2754
2754
  createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2755
2755
  (_ctx.form_status == 3)
2756
- ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
2757
- _hoisted_4$c,
2756
+ ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
2757
+ _hoisted_4$d,
2758
2758
  (_ctx.errorText)
2759
2759
  ? (openBlock(), createElementBlock("span", _hoisted_5$a, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2760
2760
  : (openBlock(), createElementBlock("span", _hoisted_6$9, "Unexpected Error Occurred")),
@@ -3307,8 +3307,8 @@ script$p.__file = "src/lib/components/form-components/DateInput.vue";
3307
3307
 
3308
3308
  const _hoisted_1$l = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
3309
3309
  const _hoisted_2$d = ["onUpdate:modelValue"];
3310
- const _hoisted_3$b = ["innerHTML"];
3311
- const _hoisted_4$b = {
3310
+ const _hoisted_3$c = ["innerHTML"];
3311
+ const _hoisted_4$c = {
3312
3312
  key: 0,
3313
3313
  class: "text-danger sh-required"
3314
3314
  };
@@ -3595,9 +3595,9 @@ return (_ctx, _cache) => {
3595
3595
  createElementVNode("span", {
3596
3596
  innerHTML: field.label,
3597
3597
  class: "sh-label"
3598
- }, null, 8 /* PROPS */, _hoisted_3$b),
3598
+ }, null, 8 /* PROPS */, _hoisted_3$c),
3599
3599
  (field.required)
3600
- ? (openBlock(), createElementBlock("span", _hoisted_4$b, "*"))
3600
+ ? (openBlock(), createElementBlock("span", _hoisted_4$c, "*"))
3601
3601
  : createCommentVNode("v-if", true)
3602
3602
  ], 2 /* CLASS */))
3603
3603
  : createCommentVNode("v-if", true),
@@ -3662,69 +3662,10 @@ return (_ctx, _cache) => {
3662
3662
 
3663
3663
  script$o.__file = "src/lib/components/ShAutoForm.vue";
3664
3664
 
3665
- const _hoisted_1$k = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3666
- const _hoisted_2$c = { class: "dropdown" };
3667
-
3668
- var script$n = {
3669
- __name: 'ShDropDownForm',
3670
- props: ['action',
3671
- 'classes',
3672
- 'hasTerms',
3673
- 'country_code',
3674
- 'submitBtnClass',
3675
- 'fields',
3676
- 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3677
- 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3678
- 'failedCallback', 'labels', 'editors',
3679
- 'datePickers',
3680
- 'textAreas',
3681
- 'files',
3682
- 'phones',
3683
- 'numbers',
3684
- 'customComponent','modalTitle','class'],
3685
- setup(__props) {
3686
-
3687
- const props = __props;
3688
-
3689
- ref(props);
3690
- let btnClass=props.class;
3691
- const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3692
-
3693
-
3694
- return (_ctx, _cache) => {
3695
- return (openBlock(), createElementBlock(Fragment, null, [
3696
- _hoisted_1$k,
3697
- createElementVNode("div", _hoisted_2$c, [
3698
- createElementVNode("a", {
3699
- class: normalizeClass(unref(btnClass)),
3700
- href: "#",
3701
- role: "button",
3702
- id: dropdownId,
3703
- "data-bs-toggle": "dropdown",
3704
- "data-bs-auto-close": "outside",
3705
- "aria-expanded": "false"
3706
- }, [
3707
- renderSlot(_ctx.$slots, "default")
3708
- ], 2 /* CLASS */),
3709
- createElementVNode("div", {
3710
- class: "dropdown-menu px-2 py-1",
3711
- "aria-labelledby": dropdownId
3712
- }, [
3713
- createVNode(script$w, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3714
- ])
3715
- ])
3716
- ], 64 /* STABLE_FRAGMENT */))
3717
- }
3718
- }
3719
-
3720
- };
3721
-
3722
- script$n.__file = "src/lib/components/ShDropDownForm.vue";
3723
-
3724
- const _hoisted_1$j = ["id", "data-bs-backdrop"];
3725
- const _hoisted_2$b = { class: "modal-content" };
3726
- const _hoisted_3$a = { class: "modal-header" };
3727
- const _hoisted_4$a = { class: "modal-title flex-fill" };
3665
+ const _hoisted_1$k = ["id", "data-bs-backdrop"];
3666
+ const _hoisted_2$c = { class: "modal-content" };
3667
+ const _hoisted_3$b = { class: "modal-header" };
3668
+ const _hoisted_4$b = { class: "modal-title flex-fill" };
3728
3669
  const _hoisted_5$8 = /*#__PURE__*/createElementVNode("button", {
3729
3670
  class: "btn btn-danger btn-sm",
3730
3671
  "data-bs-dismiss": "modal",
@@ -3734,7 +3675,7 @@ const _hoisted_6$7 = { class: "modal-body" };
3734
3675
  const _hoisted_7$6 = { class: "section" };
3735
3676
 
3736
3677
 
3737
- var script$m = {
3678
+ var script$n = {
3738
3679
  __name: 'ShModal',
3739
3680
  props: {
3740
3681
  modalId: {
@@ -3792,9 +3733,9 @@ return (_ctx, _cache) => {
3792
3733
  createElementVNode("div", {
3793
3734
  class: normalizeClass(["modal-dialog", modalClasses.value])
3794
3735
  }, [
3795
- createElementVNode("div", _hoisted_2$b, [
3796
- createElementVNode("div", _hoisted_3$a, [
3797
- createElementVNode("h3", _hoisted_4$a, toDisplayString(__props.modalTitle), 1 /* TEXT */),
3736
+ createElementVNode("div", _hoisted_2$c, [
3737
+ createElementVNode("div", _hoisted_3$b, [
3738
+ createElementVNode("h3", _hoisted_4$b, toDisplayString(__props.modalTitle), 1 /* TEXT */),
3798
3739
  _hoisted_5$8
3799
3740
  ]),
3800
3741
  createElementVNode("div", _hoisted_6$7, [
@@ -3804,13 +3745,100 @@ return (_ctx, _cache) => {
3804
3745
  ])
3805
3746
  ])
3806
3747
  ], 2 /* CLASS */)
3807
- ], 8 /* PROPS */, _hoisted_1$j))
3748
+ ], 8 /* PROPS */, _hoisted_1$k))
3749
+ }
3750
+ }
3751
+
3752
+ };
3753
+
3754
+ script$n.__file = "src/lib/components/ShModal.vue";
3755
+
3756
+ const _hoisted_1$j = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3757
+ const _hoisted_2$b = { class: "dropdown" };
3758
+ const _hoisted_3$a = ["id"];
3759
+ const _hoisted_4$a = ["aria-labelledby"];
3760
+
3761
+ var script$m = {
3762
+ __name: 'ShDropDownForm',
3763
+ props: ['action',
3764
+ 'classes',
3765
+ 'method',
3766
+ 'hasTerms',
3767
+ 'country_code',
3768
+ 'submitBtnClass',
3769
+ 'fields',
3770
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3771
+ 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3772
+ 'failedCallback', 'labels', 'editors',
3773
+ 'datePickers',
3774
+ 'required',
3775
+ 'textAreas',
3776
+ 'files',
3777
+ 'phones',
3778
+ 'numbers',
3779
+ 'customComponent','modalTitle','class','successMessage', 'modalId'],
3780
+ emits: ['success','fieldChanged','formSubmitted','formError','modalId'],
3781
+ setup(__props, { emit: __emit }) {
3782
+
3783
+ const props = __props;
3784
+ const emit = __emit;
3785
+ ref(props);
3786
+ let btnClass=props.class;
3787
+ const realModalId = props.modalId ?? 'rand' + (Math.random() + 1).toString(36).substring(2);
3788
+ const success = (res)=>{
3789
+ emit('success',res);
3790
+ };
3791
+ onMounted(()=>{
3792
+ emit('modalId',realModalId);
3793
+ });
3794
+
3795
+ const fieldChanged = (field, value)=>{
3796
+ emit('fieldChanged',field, value);
3797
+ };
3798
+
3799
+ const formSubmitted = (res)=>{
3800
+ emit('formSubmitted',res);
3801
+ };
3802
+
3803
+ const formError = (res)=>{
3804
+ emit('formError',res);
3805
+ };
3806
+
3807
+ return (_ctx, _cache) => {
3808
+ return (openBlock(), createElementBlock(Fragment, null, [
3809
+ _hoisted_1$j,
3810
+ createElementVNode("div", _hoisted_2$b, [
3811
+ createElementVNode("a", {
3812
+ class: normalizeClass(unref(btnClass)),
3813
+ href: "#",
3814
+ role: "button",
3815
+ id: _ctx.dropdownId,
3816
+ "data-bs-toggle": "dropdown",
3817
+ "data-bs-auto-close": "outside",
3818
+ "aria-expanded": "false"
3819
+ }, [
3820
+ renderSlot(_ctx.$slots, "default")
3821
+ ], 10 /* CLASS, PROPS */, _hoisted_3$a),
3822
+ createElementVNode("div", {
3823
+ class: "dropdown-menu px-2 py-1",
3824
+ "aria-labelledby": _ctx.dropdownId
3825
+ }, [
3826
+ (openBlock(), createBlock(script$o, mergeProps({
3827
+ onSuccess: success,
3828
+ onFieldChanged: fieldChanged,
3829
+ onFormSubmitted: formSubmitted,
3830
+ onFormError: formError,
3831
+ key: JSON.stringify(__props.currentData ?? {})
3832
+ }, props), null, 16 /* FULL_PROPS */))
3833
+ ], 8 /* PROPS */, _hoisted_4$a)
3834
+ ])
3835
+ ], 64 /* STABLE_FRAGMENT */))
3808
3836
  }
3809
3837
  }
3810
3838
 
3811
3839
  };
3812
3840
 
3813
- script$m.__file = "src/lib/components/ShModal.vue";
3841
+ script$m.__file = "src/lib/components/ShDropDownForm.vue";
3814
3842
 
3815
3843
  const _hoisted_1$i = ["href"];
3816
3844
 
@@ -3860,16 +3888,21 @@ const formError = (res)=>{
3860
3888
  emit('formError',res);
3861
3889
  };
3862
3890
 
3891
+ const emitClick = ()=>{
3892
+ emit('click');
3893
+ };
3894
+
3863
3895
  return (_ctx, _cache) => {
3864
3896
  return (openBlock(), createElementBlock(Fragment, null, [
3865
3897
  createElementVNode("a", {
3866
3898
  class: normalizeClass(unref(btnClass)),
3867
3899
  href: '#' + unref(realModalId),
3868
- "data-bs-toggle": "modal"
3900
+ "data-bs-toggle": "modal",
3901
+ onClick: emitClick
3869
3902
  }, [
3870
3903
  renderSlot(_ctx.$slots, "default")
3871
3904
  ], 10 /* CLASS, PROPS */, _hoisted_1$i),
3872
- createVNode(script$m, {
3905
+ createVNode(script$n, {
3873
3906
  "modal-id": unref(realModalId),
3874
3907
  "modal-title": __props.modalTitle
3875
3908
  }, {
@@ -3933,7 +3966,7 @@ return (_ctx, _cache) => {
3933
3966
  }, [
3934
3967
  renderSlot(_ctx.$slots, "default")
3935
3968
  ], 10 /* CLASS, PROPS */, _hoisted_1$h),
3936
- createVNode(script$m, {
3969
+ createVNode(script$n, {
3937
3970
  "modal-id": modalId,
3938
3971
  "modal-title": __props.modalTitle
3939
3972
  }, {
@@ -6314,7 +6347,7 @@ return (_ctx, _cache) => {
6314
6347
  class: "d-none"
6315
6348
  }, "Open Modal", 8 /* PROPS */, _hoisted_1$5),
6316
6349
  (popUp.value === 'modal')
6317
- ? (openBlock(), createBlock(script$m, {
6350
+ ? (openBlock(), createBlock(script$n, {
6318
6351
  key: 0,
6319
6352
  "modal-title": title.value,
6320
6353
  "modal-id": unref(modalId),
@@ -6463,7 +6496,7 @@ const goBack = () => {
6463
6496
  return (_ctx, _cache) => {
6464
6497
  return (openBlock(), createElementBlock(Fragment, null, [
6465
6498
  (popUp.value === 'modal')
6466
- ? (openBlock(), createBlock(script$m, {
6499
+ ? (openBlock(), createBlock(script$n, {
6467
6500
  key: 0,
6468
6501
  "modal-title": title.value,
6469
6502
  "data-bs-backdrop": "static",
@@ -6741,7 +6774,7 @@ return (_ctx, _cache) => {
6741
6774
  ]
6742
6775
  }
6743
6776
  }, null, 8 /* PROPS */, ["reload", "actions"]),
6744
- createVNode(script$m, {
6777
+ createVNode(script$n, {
6745
6778
  "modal-id": "sh_department_modal",
6746
6779
  "modal-title": "Department Form"
6747
6780
  }, {
@@ -6901,7 +6934,7 @@ return (_ctx, _cache) => {
6901
6934
  headers: ['id',showModule,'created_at'],
6902
6935
  "end-point": 'admin/departments/department/list-modules/' + id.value
6903
6936
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
6904
- createVNode(script$m, {
6937
+ createVNode(script$n, {
6905
6938
  "modal-id": "addModule",
6906
6939
  "modal-title": "Add Module Department"
6907
6940
  }, {
@@ -7291,4 +7324,4 @@ const useShFetch = (url, path, cacheKey) => {
7291
7324
  }
7292
7325
  };
7293
7326
 
7294
- export { countries as Countries, script$8 as ManagePermissions, script$o as ShAutoForm, script$j as ShCanvas, script$9 as ShCanvasBtn, script$4 as ShCardLayout, script$g as ShConfirmAction, script$n as ShDropDownForm, script$b as ShDynamicTabs, script$w as ShForm, ShFrontend, script$m as ShModal, script$a as ShModalBtn, script$l as ShModalForm, script$k as ShModalFormAuto, script$y as ShPhone, script$5 as ShQueryPopups, script$e as ShRange, script$7 as ShRoutePopups, script$f as ShSilentAction, script$x as ShSuggest, script$d as ShTable, script$c as ShTabs, shApis, shGql, shRepo, shStorage, useAppStore, useShFetch, useUserStore };
7327
+ export { countries as Countries, script$8 as ManagePermissions, script$o as ShAutoForm, script$j as ShCanvas, script$9 as ShCanvasBtn, script$4 as ShCardLayout, script$g as ShConfirmAction, script$m as ShDropDownForm, script$b as ShDynamicTabs, script$w as ShForm, ShFrontend, script$n as ShModal, script$a as ShModalBtn, script$l as ShModalForm, script$k as ShModalFormAuto, script$y as ShPhone, script$5 as ShQueryPopups, script$e as ShRange, script$7 as ShRoutePopups, script$f as ShSilentAction, script$x as ShSuggest, script$d as ShTable, script$c as ShTabs, shApis, shGql, shRepo, shStorage, useAppStore, useShFetch, useUserStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "4.6.1",
3
+ "version": "4.6.3",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",