@iankibetsh/shframework 1.2.8 → 1.3.1

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
@@ -2,8 +2,9 @@ import Axios from 'axios';
2
2
  import moment from 'moment';
3
3
  import Swal from 'sweetalert2';
4
4
  import NProgress from 'nprogress';
5
- import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, resolveDynamicComponent, renderSlot, normalizeProps, guardReactiveProps, withCtx, mergeProps, createStaticVNode, shallowRef, computed, isRef, vModelCheckbox, inject, watch, pushScopeId, popScopeId } from 'vue';
5
+ import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, resolveDynamicComponent, inject, mergeProps, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, withCtx, createStaticVNode, shallowRef, computed, isRef, vModelCheckbox, watch, pushScopeId, popScopeId } from 'vue';
6
6
  import Editor from '@tinymce/tinymce-vue';
7
+ import _ from 'lodash';
7
8
  import { defineStore, storeToRefs } from 'pinia';
8
9
  import { useRoute, useRouter } from 'vue-router';
9
10
 
@@ -1860,7 +1861,7 @@ const countries = [
1860
1861
  }
1861
1862
  ];
1862
1863
 
1863
- var script$h = {
1864
+ var script$l = {
1864
1865
  name: 'ShPhone',
1865
1866
  props: ['modelValue', 'country_code'],
1866
1867
  data () {
@@ -1922,19 +1923,19 @@ var script$h = {
1922
1923
  }
1923
1924
  };
1924
1925
 
1925
- const _hoisted_1$f = { class: "sh-phone mb-3" };
1926
- const _hoisted_2$b = {
1926
+ const _hoisted_1$g = { class: "sh-phone mb-3" };
1927
+ const _hoisted_2$c = {
1927
1928
  key: 0,
1928
1929
  style: {"display":"contents"}
1929
1930
  };
1930
- const _hoisted_3$a = ["src"];
1931
- const _hoisted_4$a = ["value"];
1931
+ const _hoisted_3$b = ["src"];
1932
+ const _hoisted_4$b = ["value"];
1932
1933
 
1933
1934
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1934
- return (openBlock(), createElementBlock("div", _hoisted_1$f, [
1935
+ return (openBlock(), createElementBlock("div", _hoisted_1$g, [
1935
1936
  ($data.selectedCountry)
1936
- ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
1937
- createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$a),
1937
+ ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
1938
+ createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$b),
1938
1939
  createTextVNode(" " + toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
1939
1940
  ]))
1940
1941
  : createCommentVNode("v-if", true),
@@ -1947,7 +1948,7 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1947
1948
  return (openBlock(), createElementBlock("option", {
1948
1949
  value: country,
1949
1950
  key: country.dialCode
1950
- }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$a))
1951
+ }, toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$b))
1951
1952
  }), 128 /* KEYED_FRAGMENT */))
1952
1953
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
1953
1954
  [vModelSelect, $data.selectedCountry]
@@ -1965,10 +1966,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1965
1966
  ]))
1966
1967
  }
1967
1968
 
1968
- script$h.render = render$7;
1969
- script$h.__file = "src/lib/components/form-components/ShPhone.vue";
1969
+ script$l.render = render$7;
1970
+ script$l.__file = "src/lib/components/form-components/ShPhone.vue";
1970
1971
 
1971
- var script$g = {
1972
+ var script$k = {
1972
1973
  name: 'ShEditor',
1973
1974
  props: ['modelValue'],
1974
1975
  components: {
@@ -2007,7 +2008,7 @@ var script$g = {
2007
2008
  }
2008
2009
  };
2009
2010
 
2010
- const _hoisted_1$e = /*#__PURE__*/createElementVNode("textarea", {
2011
+ const _hoisted_1$f = /*#__PURE__*/createElementVNode("textarea", {
2011
2012
  id: "tiny",
2012
2013
  style: {"display":"none"},
2013
2014
  "data-cy": "tinymce_editor"
@@ -2017,7 +2018,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
2017
2018
  const _component_editor = resolveComponent("editor");
2018
2019
 
2019
2020
  return (openBlock(), createElementBlock(Fragment, null, [
2020
- _hoisted_1$e,
2021
+ _hoisted_1$f,
2021
2022
  createElementVNode("div", {
2022
2023
  onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
2023
2024
  class: "sh-editor w-100"
@@ -2042,19 +2043,19 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
2042
2043
  ], 64 /* STABLE_FRAGMENT */))
2043
2044
  }
2044
2045
 
2045
- script$g.render = render$6;
2046
- script$g.__file = "src/lib/components/form-components/ShEditor.vue";
2046
+ script$k.render = render$6;
2047
+ script$k.__file = "src/lib/components/form-components/ShEditor.vue";
2047
2048
 
2048
- const _hoisted_1$d = {
2049
+ const _hoisted_1$e = {
2049
2050
  key: 0,
2050
2051
  class: "dropdown sh-suggest"
2051
2052
  };
2052
- const _hoisted_2$a = ["id"];
2053
- const _hoisted_3$9 = { class: "badge bg-secondary m-1 sh-selected-item" };
2054
- const _hoisted_4$9 = ["onClick"];
2055
- const _hoisted_5$7 = ["id"];
2056
- const _hoisted_6$6 = ["id", "aria-labelledby"];
2057
- const _hoisted_7$4 = { key: 0 };
2053
+ const _hoisted_2$b = ["id"];
2054
+ const _hoisted_3$a = { class: "badge bg-secondary m-1 sh-selected-item" };
2055
+ const _hoisted_4$a = ["onClick"];
2056
+ const _hoisted_5$8 = ["id"];
2057
+ const _hoisted_6$7 = ["id", "aria-labelledby"];
2058
+ const _hoisted_7$5 = { key: 0 };
2058
2059
  const _hoisted_8$3 = ["onClick"];
2059
2060
  const _hoisted_9$4 = {
2060
2061
  key: 1,
@@ -2066,7 +2067,7 @@ const _hoisted_10$3 = {
2066
2067
  };
2067
2068
 
2068
2069
 
2069
- var script$f = {
2070
+ var script$j = {
2070
2071
  __name: 'ShSuggest',
2071
2072
  props: ['fillSelects','modelValue'],
2072
2073
  emits: ['update:modelValue'],
@@ -2147,7 +2148,7 @@ function filterData(e){
2147
2148
 
2148
2149
  return (_ctx, _cache) => {
2149
2150
  return (unref(id))
2150
- ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
2151
+ ? (openBlock(), createElementBlock("div", _hoisted_1$e, [
2151
2152
  createElementVNode("div", {
2152
2153
  id: unref(id),
2153
2154
  "data-bs-toggle": "dropdown",
@@ -2156,14 +2157,14 @@ return (_ctx, _cache) => {
2156
2157
  }, [
2157
2158
  createElementVNode("div", null, [
2158
2159
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(selectedSuggestions), (sgt) => {
2159
- return (openBlock(), createElementBlock("h5", _hoisted_3$9, [
2160
+ return (openBlock(), createElementBlock("h5", _hoisted_3$a, [
2160
2161
  createTextVNode(toDisplayString(sgt.name) + " ", 1 /* TEXT */),
2161
2162
  createElementVNode("button", {
2162
2163
  onClick: $event => (removeSuggestion(sgt.id)),
2163
2164
  type: "button",
2164
2165
  class: "btn-close border-start border-1 ms-1",
2165
2166
  "aria-label": "Close"
2166
- }, null, 8 /* PROPS */, _hoisted_4$9)
2167
+ }, null, 8 /* PROPS */, _hoisted_4$a)
2167
2168
  ]))
2168
2169
  }), 256 /* UNKEYED_FRAGMENT */))
2169
2170
  ]),
@@ -2173,8 +2174,8 @@ return (_ctx, _cache) => {
2173
2174
  onClick: filterData,
2174
2175
  onInput: filterData,
2175
2176
  class: "flex-fill h-100 sh-suggestion-input"
2176
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_5$7)
2177
- ], 8 /* PROPS */, _hoisted_2$a),
2177
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_5$8)
2178
+ ], 8 /* PROPS */, _hoisted_2$b),
2178
2179
  createElementVNode("ul", {
2179
2180
  class: "dropdown-menu w-100",
2180
2181
  id: 'dropwdown_section' + unref(id),
@@ -2186,7 +2187,7 @@ return (_ctx, _cache) => {
2186
2187
  key: suggestion.id
2187
2188
  }, [
2188
2189
  (suggestion.name)
2189
- ? (openBlock(), createElementBlock("li", _hoisted_7$4, [
2190
+ ? (openBlock(), createElementBlock("li", _hoisted_7$5, [
2190
2191
  createElementVNode("a", {
2191
2192
  onClick: $event => (addSuggestion(suggestion)),
2192
2193
  class: normalizeClass(["dropdown-item", unref(selectedSuggestions).includes(suggestion) ? 'active':'']),
@@ -2199,7 +2200,7 @@ return (_ctx, _cache) => {
2199
2200
  : (unref(searchText))
2200
2201
  ? (openBlock(), createElementBlock("li", _hoisted_9$4, " No results found "))
2201
2202
  : (openBlock(), createElementBlock("li", _hoisted_10$3, " Type to search... "))
2202
- ], 8 /* PROPS */, _hoisted_6$6)
2203
+ ], 8 /* PROPS */, _hoisted_6$7)
2203
2204
  ]))
2204
2205
  : createCommentVNode("v-if", true)
2205
2206
  }
@@ -2207,15 +2208,15 @@ return (_ctx, _cache) => {
2207
2208
 
2208
2209
  };
2209
2210
 
2210
- script$f.__scopeId = "data-v-71cc9569";
2211
- script$f.__file = "src/lib/components/form-components/ShSuggest.vue";
2211
+ script$j.__scopeId = "data-v-71cc9569";
2212
+ script$j.__file = "src/lib/components/form-components/ShSuggest.vue";
2212
2213
 
2213
- var script$e = {
2214
+ var script$i = {
2214
2215
  name: 'ShForm',
2215
2216
  components: {
2216
- ShSuggest: script$f,
2217
- ShEditor: script$g,
2218
- ShPhone: script$h
2217
+ ShSuggest: script$j,
2218
+ ShEditor: script$k,
2219
+ ShPhone: script$l
2219
2220
  },
2220
2221
  props: [
2221
2222
  'action',
@@ -2533,20 +2534,20 @@ var script$e = {
2533
2534
  }
2534
2535
  };
2535
2536
 
2536
- const _hoisted_1$c = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2537
- const _hoisted_2$9 = {
2537
+ const _hoisted_1$d = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2538
+ const _hoisted_2$a = {
2538
2539
  ref: "ShAutoForm",
2539
2540
  class: "sh-form"
2540
2541
  };
2541
- const _hoisted_3$8 = {
2542
+ const _hoisted_3$9 = {
2542
2543
  key: 0,
2543
2544
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2544
2545
  role: "alert"
2545
2546
  };
2546
- const _hoisted_4$8 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2547
- const _hoisted_5$6 = { key: 0 };
2548
- const _hoisted_6$5 = { key: 1 };
2549
- const _hoisted_7$3 = { class: "row" };
2547
+ const _hoisted_4$9 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2548
+ const _hoisted_5$7 = { key: 0 };
2549
+ const _hoisted_6$6 = { key: 1 };
2550
+ const _hoisted_7$4 = { class: "row" };
2550
2551
  const _hoisted_8$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2551
2552
  const _hoisted_9$3 = { class: "col-md-12" };
2552
2553
  const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
@@ -2595,16 +2596,16 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2595
2596
  const _component_ShEditor = resolveComponent("ShEditor");
2596
2597
 
2597
2598
  return (openBlock(), createElementBlock(Fragment, null, [
2598
- _hoisted_1$c,
2599
- createElementVNode("form", _hoisted_2$9, [
2599
+ _hoisted_1$d,
2600
+ createElementVNode("form", _hoisted_2$a, [
2600
2601
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2601
2602
  createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2602
2603
  (_ctx.form_status == 3)
2603
- ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
2604
- _hoisted_4$8,
2604
+ ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
2605
+ _hoisted_4$9,
2605
2606
  (_ctx.errorText)
2606
- ? (openBlock(), createElementBlock("span", _hoisted_5$6, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2607
- : (openBlock(), createElementBlock("span", _hoisted_6$5, "Unexpected Error Occurred")),
2607
+ ? (openBlock(), createElementBlock("span", _hoisted_5$7, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2608
+ : (openBlock(), createElementBlock("span", _hoisted_6$6, "Unexpected Error Occurred")),
2608
2609
  createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2609
2610
  ]))
2610
2611
  : createCommentVNode("v-if", true),
@@ -2614,7 +2615,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2614
2615
  }, null, 512 /* NEED_PATCH */), [
2615
2616
  [vModelText, _ctx.form_elements['id']]
2616
2617
  ]),
2617
- createElementVNode("div", _hoisted_7$3, [
2618
+ createElementVNode("div", _hoisted_7$4, [
2618
2619
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.fields, (field) => {
2619
2620
  return (openBlock(), createElementBlock("div", {
2620
2621
  class: normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
@@ -2812,13 +2813,389 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2812
2813
  ], 64 /* STABLE_FRAGMENT */))
2813
2814
  }
2814
2815
 
2815
- script$e.render = render$5;
2816
- script$e.__file = "src/lib/components/ShForm.vue";
2816
+ script$i.render = render$5;
2817
+ script$i.__file = "src/lib/components/ShForm.vue";
2818
+
2819
+ var script$h = {
2820
+ __name: 'EmailInput',
2821
+ props: ['modelValue','label'],
2822
+ emits: ['update:modelValue','clearValidationErrors'],
2823
+ setup(__props, { emit }) {
2824
+
2825
+ const props = __props;
2826
+
2827
+
2828
+
2829
+ const inputModel = ref(null);
2830
+
2831
+ const modelValueUpdated = (e) => {
2832
+ emit('clearValidationErrors');
2833
+ emit('update:modelValue',inputModel);
2834
+ };
2835
+ onMounted(()=>{
2836
+ props.modelValue && (inputModel.value = props.modelValue);
2837
+ });
2838
+
2839
+
2840
+ return (_ctx, _cache) => {
2841
+ return withDirectives((openBlock(), createElementBlock("input", {
2842
+ type: "email",
2843
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
2844
+ onChange: modelValueUpdated,
2845
+ onKeydown: modelValueUpdated,
2846
+ onUpdated: modelValueUpdated
2847
+ }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
2848
+ [vModelText, inputModel.value]
2849
+ ])
2850
+ }
2851
+ }
2852
+
2853
+ };
2854
+
2855
+ script$h.__file = "src/lib/components/form-components/EmailInput.vue";
2856
+
2857
+ var script$g = {
2858
+ __name: 'NumberInput',
2859
+ props: ['modelValue','label'],
2860
+ emits: ['update:modelValue','clearValidationErrors'],
2861
+ setup(__props, { emit }) {
2862
+
2863
+ const props = __props;
2864
+
2865
+
2866
+
2867
+ const inputModel = ref(null);
2868
+
2869
+ const modelValueUpdated = (e) => {
2870
+ emit('clearValidationErrors');
2871
+ emit('update:modelValue',inputModel);
2872
+ };
2873
+ onMounted(()=>{
2874
+ props.modelValue && (inputModel.value = props.modelValue);
2875
+ });
2876
+
2877
+
2878
+ return (_ctx, _cache) => {
2879
+ return withDirectives((openBlock(), createElementBlock("input", {
2880
+ type: "number",
2881
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
2882
+ onChange: modelValueUpdated,
2883
+ onKeydown: modelValueUpdated,
2884
+ onUpdated: modelValueUpdated
2885
+ }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
2886
+ [vModelText, inputModel.value]
2887
+ ])
2888
+ }
2889
+ }
2890
+
2891
+ };
2892
+
2893
+ script$g.__file = "src/lib/components/form-components/NumberInput.vue";
2894
+
2895
+ var script$f = {
2896
+ __name: 'TextInput',
2897
+ props: ['modelValue','label'],
2898
+ emits: ['update:modelValue','clearValidationErrors'],
2899
+ setup(__props, { emit }) {
2900
+
2901
+ const props = __props;
2902
+
2903
+
2904
+
2905
+ const inputModel = ref(null);
2906
+
2907
+ const modelValueUpdated = (e) => {
2908
+ emit('clearValidationErrors');
2909
+ emit('update:modelValue',inputModel);
2910
+ };
2911
+ onMounted(()=>{
2912
+ props.modelValue && (inputModel.value = props.modelValue);
2913
+ });
2914
+
2915
+
2916
+ return (_ctx, _cache) => {
2917
+ return withDirectives((openBlock(), createElementBlock("input", {
2918
+ type: "text",
2919
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
2920
+ onChange: modelValueUpdated,
2921
+ onKeydown: modelValueUpdated,
2922
+ onUpdated: modelValueUpdated
2923
+ }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
2924
+ [vModelText, inputModel.value]
2925
+ ])
2926
+ }
2927
+ }
2928
+
2929
+ };
2930
+
2931
+ script$f.__file = "src/lib/components/form-components/TextInput.vue";
2932
+
2933
+ var script$e = {
2934
+ __name: 'TextAreaInput',
2935
+ props: ['modelValue','label'],
2936
+ emits: ['update:modelValue','clearValidationErrors'],
2937
+ setup(__props, { emit }) {
2938
+
2939
+ const props = __props;
2940
+
2941
+
2942
+
2943
+ const inputModel = ref(null);
2944
+
2945
+ const modelValueUpdated = (e) => {
2946
+ emit('clearValidationErrors');
2947
+ emit('update:modelValue',inputModel);
2948
+ };
2949
+ onMounted(()=>{
2950
+ props.modelValue && (inputModel.value = props.modelValue);
2951
+ });
2952
+
2953
+
2954
+ return (_ctx, _cache) => {
2955
+ return withDirectives((openBlock(), createElementBlock("textarea", {
2956
+ type: "text",
2957
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
2958
+ onChange: modelValueUpdated,
2959
+ onKeydown: modelValueUpdated,
2960
+ onUpdated: modelValueUpdated
2961
+ }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
2962
+ [vModelText, inputModel.value]
2963
+ ])
2964
+ }
2965
+ }
2966
+
2967
+ };
2968
+
2969
+ script$e.__file = "src/lib/components/form-components/TextAreaInput.vue";
2970
+
2971
+ const _hoisted_1$c = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
2972
+ const _hoisted_2$9 = ["innerHTML"];
2973
+ const _hoisted_3$8 = ["innerHTML"];
2974
+ const _hoisted_4$8 = ["innerHTML"];
2975
+ const _hoisted_5$6 = ["disabled"];
2976
+ const _hoisted_6$5 = {
2977
+ key: 0,
2978
+ class: "spinner-border spinner-border-sm",
2979
+ role: "status",
2980
+ "aria-hidden": "true"
2981
+ };
2982
+ const _hoisted_7$3 = { key: 1 };
2983
+
2984
+
2985
+ var script$d = {
2986
+ __name: 'ShAutoForm',
2987
+ props: [
2988
+ 'action','successCallback','retainDataAfterSubmission',
2989
+ 'successMessage','fields','customComponents','placeHolders',
2990
+ 'formClasses',
2991
+ 'helperTexts','labels','data',
2992
+ 'actionLabel',
2993
+ 'textAreas',
2994
+ 'emails',
2995
+ 'phones','numbers','selects','dates'
2996
+ ],
2997
+ emits: ['success'],
2998
+ setup(__props, { emit }) {
2999
+
3000
+ const props = __props;
3001
+
3002
+
3003
+
3004
+ const formFields = ref([]);
3005
+ const getFieldComponent = (field)=>{
3006
+ const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
3007
+ const defaultSelects = ['gender', 'payment_method', 'allow_view_mode', 'reasons_name', 'has_free_tier', 'payment_period', 'role', 'register_as', 'account_type'];
3008
+ const defaultNumbers = ['age'];
3009
+ const defaultDates = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
3010
+ const defaultPhones = ['phone'];
3011
+ const defaultEmails = ['phone'];
3012
+ const formComponents = inject('formComponents');
3013
+ if(props.customComponents && props.customComponents[field]) {
3014
+ return props.customComponents[field]
3015
+ } else
3016
+ if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
3017
+ return formComponents.textArea ?? script$e
3018
+ } else
3019
+ if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
3020
+ return formComponents.email ?? script$h
3021
+ } else
3022
+ if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
3023
+ return formComponents.phone ?? script$l
3024
+ } else
3025
+ if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
3026
+ return formComponents.number ?? script$g
3027
+ } else
3028
+ if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
3029
+ return formComponents.select ?? SelectInput
3030
+ } else
3031
+ if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3032
+ return formComponents.date ?? DateInput
3033
+ }
3034
+ return formComponents.text ?? script$f
3035
+ };
3036
+ const shFormElementClasses = ref(null);
3037
+ shFormElementClasses.value = inject('shFormElementClasses');
3038
+ const shAutoForm = ref(null);
3039
+ const closeModal = e => {
3040
+ setTimeout(()=>{
3041
+ const closeBtn = shAutoForm.value.closest('.modal-dialog').querySelector('[data-bs-dismiss="modal"]');
3042
+ closeBtn && closeBtn.click();
3043
+ },1000);
3044
+ };
3045
+ const getLabel = field => (props.labels && (props.labels[field] !== undefined)) ? props.labels[field]:_.startCase(_.camelCase(field));
3046
+ const getComponentClass = field => validationErrors.value[field] ? getElementClass('formControl') + ' is-invalid':getElementClass('formControl');
3047
+ const getHelperText = field => (props.helperTexts && props.helperTexts[field]) ? props.helperTexts[field]:false;
3048
+ const getElementClass = section => (props.formClasses && props.formClasses[section]) ? props.formClasses[section]:shFormElementClasses.value[section] ?? _.snakeCase(section).replace(/_/gi,'-');
3049
+ const getPlaceholder = field => (props.placeHolders && props.placeHolders[field]) && props.placeHolders[field];
3050
+ const removeValidationError = field => delete validationErrors.value[field];
3051
+ const getComponentProps = field => {
3052
+ const newField = {...field};
3053
+ delete newField.component;
3054
+ delete newField.value;
3055
+ return newField
3056
+ };
3057
+ const isFloating = getElementClass('formGroup').includes('form-floating');
3058
+ const loading = ref(false);
3059
+ const submitBtn = ref(false);
3060
+ const validationErrors = ref({});
3061
+ const formError = ref(null);
3062
+ const submitForm = e => {
3063
+ console.log(formFields.value);
3064
+ submitBtnWidth.value = submitBtn.value.getBoundingClientRect().width + 'px !important';
3065
+ validationErrors.value = {};
3066
+ e.preventDefault();
3067
+ loading.value = true;
3068
+ const data = {};
3069
+ formFields.value.map(field=>data[field.field] = field.value);
3070
+ shApis.doPost(props.action,data).then(res=>{
3071
+ loading.value = false;
3072
+ emit('formSubmitted',res.data);
3073
+ emit('success',res.data);
3074
+ props.successMessage && shRepo.showToast(props.successMessage);
3075
+ props.successCallback && props.successCallback(res.data);
3076
+ !props.retainDataAfterSubmission && formFields.value.map(field=>field.value = null);
3077
+ closeModal();
3078
+ }).catch(reason=>{
3079
+ console.log(reason);
3080
+ loading.value = false;
3081
+ const httpStatus = reason.response ? reason.response.status:0;
3082
+ formError.value = httpStatus === 422 ? formError.value = null:reason.message ?? null;
3083
+ let httpErrors = {};
3084
+ httpStatus === 422 && typeof reason.response.data.errors === 'object' && (httpErrors = reason.response.data.errors);
3085
+ if(httpErrors && reason.response){
3086
+ Object.keys(httpErrors).map(key=>validationErrors.value[key] = typeof httpErrors[key] === 'string' ? httpErrors[key]:httpErrors[key][0]);
3087
+ }
3088
+ (httpStatus !== 422 && formError.value) && shRepo.showToast(formError.value,'error');
3089
+ validationErrors.value;
3090
+ });
3091
+ return false
3092
+ };
3093
+ const submitBtnWidth = ref(null);
3094
+ onMounted((ev)=>{
3095
+ props.fields && props.fields.map(field=>{
3096
+ if(typeof field === 'object') {
3097
+ const fieldObj = {...field};
3098
+ fieldObj.label && getLabel(fieldObj.field);
3099
+ !fieldObj.helper && fieldObj.helperText ? fieldObj.helper = fieldObj.helperText : fieldObj.helper = getHelperText(fieldObj.field);
3100
+ fieldObj.helperText === undefined && (fieldObj.label = getLabel(fieldObj.field));
3101
+ fieldObj.component && getfieldObjComponent(fieldObj.field);
3102
+ fieldObj.placeholder && fieldObj.placeHolder && getPlaceholder(fieldObj.field);
3103
+ fieldObj.value = null;
3104
+ formFields.value.push(fieldObj);
3105
+ } else {
3106
+ formFields.value.push({
3107
+ field:field,label: getLabel(field),
3108
+ helper: getHelperText(field),
3109
+ component: getFieldComponent(field),
3110
+ placeholder: getPlaceholder(field),
3111
+ value: null
3112
+ });
3113
+ }
3114
+ });
3115
+ });
3116
+
3117
+
3118
+ return (_ctx, _cache) => {
3119
+ return (openBlock(), createElementBlock(Fragment, null, [
3120
+ _hoisted_1$c,
3121
+ createElementVNode("form", {
3122
+ ref_key: "shAutoForm",
3123
+ ref: shAutoForm,
3124
+ class: "sh-form",
3125
+ onSubmit: _cache[0] || (_cache[0] = e => submitForm(e))
3126
+ }, [
3127
+ (openBlock(true), createElementBlock(Fragment, null, renderList(formFields.value, (field, index) => {
3128
+ return (openBlock(), createElementBlock("div", {
3129
+ key: field,
3130
+ class: normalizeClass(getElementClass('formGroup'))
3131
+ }, [
3132
+ (!unref(isFloating) && field.label)
3133
+ ? (openBlock(), createElementBlock("label", {
3134
+ key: 0,
3135
+ class: normalizeClass(getElementClass('formLabel')),
3136
+ innerHTML: field.label
3137
+ }, null, 10 /* CLASS, PROPS */, _hoisted_2$9))
3138
+ : createCommentVNode("v-if", true),
3139
+ (openBlock(), createBlock(resolveDynamicComponent(getFieldComponent(field.field)), mergeProps(getComponentProps(field), {
3140
+ onClick: $event => (removeValidationError(field.field)),
3141
+ "onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
3142
+ modelValue: formFields.value[index].value,
3143
+ placeholder: unref(isFloating) ? field.label:field.placeholder,
3144
+ class: getComponentClass(field.field)
3145
+ }), null, 16 /* FULL_PROPS */, ["onClick", "onUpdate:modelValue", "modelValue", "placeholder", "class"])),
3146
+ (unref(isFloating) && field.label)
3147
+ ? (openBlock(), createElementBlock("label", {
3148
+ key: 1,
3149
+ class: normalizeClass(getElementClass('formLabel')),
3150
+ innerHTML: field.label
3151
+ }, null, 10 /* CLASS, PROPS */, _hoisted_3$8))
3152
+ : createCommentVNode("v-if", true),
3153
+ (field.helper)
3154
+ ? (openBlock(), createElementBlock("div", {
3155
+ key: 2,
3156
+ class: normalizeClass(getElementClass('helperText')),
3157
+ innerHTML: field.helper
3158
+ }, null, 10 /* CLASS, PROPS */, _hoisted_4$8))
3159
+ : createCommentVNode("v-if", true),
3160
+ (validationErrors.value[field.field])
3161
+ ? (openBlock(), createElementBlock("div", {
3162
+ key: 3,
3163
+ class: normalizeClass(getElementClass('invalidFeedback'))
3164
+ }, toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
3165
+ : createCommentVNode("v-if", true)
3166
+ ], 2 /* CLASS */))
3167
+ }), 128 /* KEYED_FRAGMENT */)),
3168
+ createElementVNode("div", {
3169
+ class: normalizeClass(getElementClass('formGroup'))
3170
+ }, [
3171
+ createElementVNode("button", {
3172
+ style: normalizeStyle({width: submitBtnWidth.value}),
3173
+ ref_key: "submitBtn",
3174
+ ref: submitBtn,
3175
+ disabled: loading.value,
3176
+ class: normalizeClass(getElementClass('actionBtn'))
3177
+ }, [
3178
+ (loading.value)
3179
+ ? (openBlock(), createElementBlock("span", _hoisted_6$5))
3180
+ : createCommentVNode("v-if", true),
3181
+ (!loading.value)
3182
+ ? (openBlock(), createElementBlock("span", _hoisted_7$3, "Submit"))
3183
+ : createCommentVNode("v-if", true)
3184
+ ], 14 /* CLASS, STYLE, PROPS */, _hoisted_5$6)
3185
+ ], 2 /* CLASS */)
3186
+ ], 544 /* HYDRATE_EVENTS, NEED_PATCH */)
3187
+ ], 64 /* STABLE_FRAGMENT */))
3188
+ }
3189
+ }
3190
+
3191
+ };
3192
+
3193
+ script$d.__file = "src/lib/components/ShAutoForm.vue";
2817
3194
 
2818
3195
  const _hoisted_1$b = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
2819
3196
  const _hoisted_2$8 = { class: "dropdown" };
2820
3197
 
2821
- var script$d = {
3198
+ var script$c = {
2822
3199
  __name: 'ShDropDownForm',
2823
3200
  props: ['action',
2824
3201
  'classes',
@@ -2865,7 +3242,7 @@ return (_ctx, _cache) => {
2865
3242
  class: "dropdown-menu px-2 py-1",
2866
3243
  "aria-labelledby": dropdownId
2867
3244
  }, [
2868
- createVNode(script$e, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3245
+ createVNode(script$i, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
2869
3246
  ])
2870
3247
  ])
2871
3248
  ], 64 /* STABLE_FRAGMENT */))
@@ -2874,9 +3251,9 @@ return (_ctx, _cache) => {
2874
3251
 
2875
3252
  };
2876
3253
 
2877
- script$d.__file = "src/lib/components/ShDropDownForm.vue";
3254
+ script$c.__file = "src/lib/components/ShDropDownForm.vue";
2878
3255
 
2879
- var script$c = {
3256
+ var script$b = {
2880
3257
  name: 'ShModal',
2881
3258
  props: ['modalTitle', 'modalId', 'modalSize'],
2882
3259
  components: {
@@ -2919,12 +3296,12 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2919
3296
  ], 8 /* PROPS */, _hoisted_1$a))
2920
3297
  }
2921
3298
 
2922
- script$c.render = render$4;
2923
- script$c.__file = "src/lib/components/ShModal.vue";
3299
+ script$b.render = render$4;
3300
+ script$b.__file = "src/lib/components/ShModal.vue";
2924
3301
 
2925
3302
  const _hoisted_1$9 = ["href"];
2926
3303
 
2927
- var script$b = {
3304
+ var script$a = {
2928
3305
  __name: 'ShModalForm',
2929
3306
  props: ['action',
2930
3307
  'classes',
@@ -2964,12 +3341,12 @@ return (_ctx, _cache) => {
2964
3341
  }, [
2965
3342
  renderSlot(_ctx.$slots, "default")
2966
3343
  ], 10 /* CLASS, PROPS */, _hoisted_1$9),
2967
- createVNode(script$c, {
3344
+ createVNode(script$b, {
2968
3345
  "modal-id": modalId,
2969
3346
  "modal-title": __props.modalTitle
2970
3347
  }, {
2971
3348
  default: withCtx(() => [
2972
- createVNode(script$e, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3349
+ createVNode(script$i, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
2973
3350
  ]),
2974
3351
  _: 1 /* STABLE */
2975
3352
  }, 8 /* PROPS */, ["modal-title"])
@@ -2979,9 +3356,9 @@ return (_ctx, _cache) => {
2979
3356
 
2980
3357
  };
2981
3358
 
2982
- script$b.__file = "src/lib/components/ShModalForm.vue";
3359
+ script$a.__file = "src/lib/components/ShModalForm.vue";
2983
3360
 
2984
- var script$a = {
3361
+ var script$9 = {
2985
3362
  name: 'ShCanvas',
2986
3363
  props: ['canvasTitle', 'canvasId', 'position','canvasSize'],
2987
3364
  components: {
@@ -3031,10 +3408,10 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3031
3408
  ], 10 /* CLASS, PROPS */, _hoisted_1$8))
3032
3409
  }
3033
3410
 
3034
- script$a.render = render$3;
3035
- script$a.__file = "src/lib/components/ShCanvas.vue";
3411
+ script$9.render = render$3;
3412
+ script$9.__file = "src/lib/components/ShCanvas.vue";
3036
3413
 
3037
- var script$9 = {
3414
+ var script$8 = {
3038
3415
  name: 'Pagination',
3039
3416
  props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore'],
3040
3417
  data () {
@@ -3223,8 +3600,8 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3223
3600
  ]))
3224
3601
  }
3225
3602
 
3226
- script$9.render = render$2;
3227
- script$9.__file = "src/lib/components/list_templates/Pagination.vue";
3603
+ script$8.render = render$2;
3604
+ script$8.__file = "src/lib/components/list_templates/Pagination.vue";
3228
3605
 
3229
3606
  const _hoisted_1$6 = /*#__PURE__*/createElementVNode("span", {
3230
3607
  class: "spinner-border spinner-border-sm me-1",
@@ -3233,7 +3610,7 @@ const _hoisted_1$6 = /*#__PURE__*/createElementVNode("span", {
3233
3610
  }, null, -1 /* HOISTED */);
3234
3611
 
3235
3612
 
3236
- var script$8 = {
3613
+ var script$7 = {
3237
3614
  __name: 'ShConfirmAction',
3238
3615
  props: {
3239
3616
  data: Object,
@@ -3319,7 +3696,7 @@ return (_ctx, _cache) => {
3319
3696
 
3320
3697
  };
3321
3698
 
3322
- script$8.__file = "src/lib/components/ShConfirmAction.vue";
3699
+ script$7.__file = "src/lib/components/ShConfirmAction.vue";
3323
3700
 
3324
3701
  const _hoisted_1$5 = /*#__PURE__*/createElementVNode("span", {
3325
3702
  class: "spinner-border spinner-border-sm me-1",
@@ -3327,7 +3704,7 @@ const _hoisted_1$5 = /*#__PURE__*/createElementVNode("span", {
3327
3704
  "aria-hidden": "true"
3328
3705
  }, null, -1 /* HOISTED */);
3329
3706
 
3330
- var script$7 = {
3707
+ var script$6 = {
3331
3708
  __name: 'ShSilentAction',
3332
3709
  props: {
3333
3710
  data: Object,
@@ -3415,9 +3792,9 @@ return (_ctx, _cache) => {
3415
3792
 
3416
3793
  };
3417
3794
 
3418
- script$7.__file = "src/lib/components/ShSilentAction.vue";
3795
+ script$6.__file = "src/lib/components/ShSilentAction.vue";
3419
3796
 
3420
- var script$6 = {
3797
+ var script$5 = {
3421
3798
  name: 'sh-table',
3422
3799
  props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds'],
3423
3800
  inject: ['channel'],
@@ -3649,10 +4026,10 @@ var script$6 = {
3649
4026
  this.reloadData();
3650
4027
  },
3651
4028
  components: {
3652
- ShSilentAction: script$7,
3653
- ShConfirmAction: script$8,
3654
- ShCanvas: script$a,
3655
- pagination: script$9
4029
+ ShSilentAction: script$6,
4030
+ ShConfirmAction: script$7,
4031
+ ShCanvas: script$9,
4032
+ pagination: script$8
3656
4033
  },
3657
4034
  computed: {
3658
4035
  windowWidth: function () {
@@ -4282,10 +4659,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4282
4659
  ]))
4283
4660
  }
4284
4661
 
4285
- script$6.render = render$1;
4286
- script$6.__file = "src/lib/components/ShTable.vue";
4662
+ script$5.render = render$1;
4663
+ script$5.__file = "src/lib/components/ShTable.vue";
4287
4664
 
4288
- var script$5 = {
4665
+ var script$4 = {
4289
4666
  name: 'ShTabs',
4290
4667
  props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive','classOne','classTwo','classes'],
4291
4668
  data () {
@@ -4406,8 +4783,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4406
4783
  ], 64 /* STABLE_FRAGMENT */))
4407
4784
  }
4408
4785
 
4409
- script$5.render = render;
4410
- script$5.__file = "src/lib/components/ShTabs.vue";
4786
+ script$4.render = render;
4787
+ script$4.__file = "src/lib/components/ShTabs.vue";
4411
4788
 
4412
4789
  const _hoisted_1$3 = {
4413
4790
  class: "nav nav-tabs",
@@ -4422,7 +4799,7 @@ const _hoisted_4$3 = /*#__PURE__*/createElementVNode("i", { class: "d-none" }, n
4422
4799
  const _hoisted_5$3 = { class: "sh_tab_count" };
4423
4800
  const _hoisted_6$2 = { class: "tab-content" };
4424
4801
 
4425
- var script$4 = {
4802
+ var script$3 = {
4426
4803
  __name: 'ShDynamicTabs',
4427
4804
  props: ['tabs','data'],
4428
4805
  setup(__props) {
@@ -4476,7 +4853,7 @@ return (_ctx, _cache) => {
4476
4853
 
4477
4854
  };
4478
4855
 
4479
- script$4.__file = "src/lib/components/ShDynamicTabs.vue";
4856
+ script$3.__file = "src/lib/components/ShDynamicTabs.vue";
4480
4857
 
4481
4858
  const useUserStore = defineStore('user-store', {
4482
4859
  state: () => ({
@@ -4586,7 +4963,7 @@ const _hoisted_4$2 = {
4586
4963
  const _hoisted_5$2 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* HOISTED */);
4587
4964
 
4588
4965
 
4589
- var script$3 = {
4966
+ var script$2 = {
4590
4967
  __name: 'Departments',
4591
4968
  setup(__props) {
4592
4969
 
@@ -4616,7 +4993,7 @@ return (_ctx, _cache) => {
4616
4993
  _hoisted_5$2,
4617
4994
  createTextVNode(" ADD DEPARTMENT")
4618
4995
  ], 512 /* NEED_PATCH */),
4619
- createVNode(script$6, {
4996
+ createVNode(script$5, {
4620
4997
  headers: ['id','name','description', 'created_at'],
4621
4998
  "end-point": "admin/departments/list",
4622
4999
  actions: {
@@ -4630,12 +5007,12 @@ return (_ctx, _cache) => {
4630
5007
  ]
4631
5008
  }
4632
5009
  }),
4633
- createVNode(script$c, {
5010
+ createVNode(script$b, {
4634
5011
  "modal-id": "sh-department_modal",
4635
5012
  "modal-title": "Department Form"
4636
5013
  }, {
4637
5014
  default: withCtx(() => [
4638
- createVNode(script$e, {
5015
+ createVNode(script$i, {
4639
5016
  "success-callback": "departmentAdded",
4640
5017
  onDepartmentAdded: departmentAdded,
4641
5018
  action: "admin/departments/store",
@@ -4652,7 +5029,7 @@ return (_ctx, _cache) => {
4652
5029
 
4653
5030
  };
4654
5031
 
4655
- script$3.__file = "src/lib/components/core/Departments/Departments.vue";
5032
+ script$2.__file = "src/lib/components/core/Departments/Departments.vue";
4656
5033
 
4657
5034
  const _hoisted_1$1 = {
4658
5035
  key: 0,
@@ -4671,7 +5048,7 @@ const _hoisted_4$1 = { class: "text-primary text-capitalize" };
4671
5048
  const _hoisted_5$1 = ["value"];
4672
5049
  const _hoisted_6$1 = /*#__PURE__*/createElementVNode("i", { class: "fa fa-save" }, null, -1 /* HOISTED */);
4673
5050
 
4674
- var script$2 = {
5051
+ var script$1 = {
4675
5052
  __name: 'Department',
4676
5053
  setup(__props) {
4677
5054
 
@@ -4769,7 +5146,7 @@ return (_ctx, _cache) => {
4769
5146
  createElementVNode("div", _hoisted_2$1, [
4770
5147
  _hoisted_3$1,
4771
5148
  createElementVNode("h5", null, "Department #" + toDisplayString(unref(department).id) + " - " + toDisplayString(unref(department).name) + " Allowed Modules", 1 /* TEXT */),
4772
- createVNode(script$6, {
5149
+ createVNode(script$5, {
4773
5150
  actions: {
4774
5151
  label: 'Actions',
4775
5152
  actions: [
@@ -4789,12 +5166,12 @@ return (_ctx, _cache) => {
4789
5166
  headers: ['id',showModule,'created_at'],
4790
5167
  "end-point": 'admin/departments/department/list-modules/' + id.value
4791
5168
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
4792
- createVNode(script$c, {
5169
+ createVNode(script$b, {
4793
5170
  "modal-id": "addModule",
4794
5171
  "modal-title": "Add Module Department"
4795
5172
  }, {
4796
5173
  default: withCtx(() => [
4797
- createVNode(script$e, {
5174
+ createVNode(script$i, {
4798
5175
  "reload-select-items": unref(reload),
4799
5176
  "success-callback": moduleAdded,
4800
5177
  "fill-selects": {
@@ -4816,7 +5193,7 @@ return (_ctx, _cache) => {
4816
5193
  ref: permissionCanvasBtn,
4817
5194
  "data-bs-toggle": "offcanvas"
4818
5195
  }, null, 512 /* NEED_PATCH */),
4819
- createVNode(script$a, {
5196
+ createVNode(script$9, {
4820
5197
  "canvas-id": "permissionsCanvas",
4821
5198
  position: "end enlarged",
4822
5199
  "canvas-title": "Module Permissions"
@@ -4864,7 +5241,7 @@ return (_ctx, _cache) => {
4864
5241
 
4865
5242
  };
4866
5243
 
4867
- script$2.__file = "src/lib/components/core/Departments/department/Department.vue";
5244
+ script$1.__file = "src/lib/components/core/Departments/department/Department.vue";
4868
5245
 
4869
5246
  const _withScopeId = n => (pushScopeId("data-v-2911509a"),n=n(),popScopeId(),n);
4870
5247
  const _hoisted_1 = {
@@ -4892,7 +5269,7 @@ const _hoisted_8 = {
4892
5269
  };
4893
5270
  const _hoisted_9 = { class: "sh-auth-footer" };
4894
5271
 
4895
- var script$1 = {
5272
+ var script = {
4896
5273
  __name: 'ShAuth',
4897
5274
  setup(__props) {
4898
5275
 
@@ -4931,7 +5308,7 @@ return (_ctx, _cache) => {
4931
5308
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
4932
5309
  (section.value === 'login')
4933
5310
  ? (openBlock(), createElementBlock("div", _hoisted_2, [
4934
- createVNode(script$e, {
5311
+ createVNode(script$i, {
4935
5312
  class: "sh-login-form",
4936
5313
  fields: ['email','password'],
4937
5314
  "action-label": "Login",
@@ -4956,7 +5333,7 @@ return (_ctx, _cache) => {
4956
5333
  (unref(registerSubTitle))
4957
5334
  ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
4958
5335
  : createCommentVNode("v-if", true),
4959
- createVNode(script$e, {
5336
+ createVNode(script$i, {
4960
5337
  class: "sh-login-form",
4961
5338
  fields: unref(registrationFields),
4962
5339
  "action-label": "Sign Up",
@@ -4977,46 +5354,8 @@ return (_ctx, _cache) => {
4977
5354
 
4978
5355
  };
4979
5356
 
4980
- script$1.__scopeId = "data-v-2911509a";
4981
- script$1.__file = "src/lib/components/core/auth/ShAuth.vue";
4982
-
4983
- var script = {
4984
- __name: 'TextInput',
4985
- props: ['modelValue','label'],
4986
- emits: ['update:modelValue','clearValidationErrors'],
4987
- setup(__props, { emit }) {
4988
-
4989
- const props = __props;
4990
-
4991
-
4992
-
4993
- const inputModel = ref(null);
4994
-
4995
- const modelValueUpdated = (e) => {
4996
- emit('clearValidationErrors');
4997
- emit('update:modelValue',inputModel);
4998
- };
4999
- onMounted(()=>{
5000
- props.modelValue && (inputModel.value = props.modelValue);
5001
- });
5002
-
5003
-
5004
- return (_ctx, _cache) => {
5005
- return withDirectives((openBlock(), createElementBlock("input", {
5006
- type: "text",
5007
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
5008
- onChange: modelValueUpdated,
5009
- onKeydown: modelValueUpdated,
5010
- onUpdated: modelValueUpdated
5011
- }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
5012
- [vModelText, inputModel.value]
5013
- ])
5014
- }
5015
- }
5016
-
5017
- };
5018
-
5019
- script.__file = "src/lib/components/form-components/TextInput.vue";
5357
+ script.__scopeId = "data-v-2911509a";
5358
+ script.__file = "src/lib/components/core/auth/ShAuth.vue";
5020
5359
 
5021
5360
  const ShFrontend = {
5022
5361
  install: (app, options) => {
@@ -5040,12 +5379,12 @@ const ShFrontend = {
5040
5379
  const registerTitle = options.registerTitle ?? 'Create a new account';
5041
5380
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
5042
5381
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
5043
- options.formTextInput ?? script;
5382
+ options.formTextInput ?? script$f;
5044
5383
  const loginUrl = options.loginUrl ?? `/login`;
5045
5384
  const redirectLogin = options.redirectLogin ?? `/`;
5046
5385
  const redirectRegister = options.redirectRegister ?? `/`;
5047
5386
  const registrationFields = options.registrationFields ?? ['name','email','phone','password','password_confirmation'];
5048
- const AuthComponent = options.authComponent ?? script$1;
5387
+ const AuthComponent = options.authComponent ?? script;
5049
5388
  app.provide('loginEndpoint',loginEndpoint);
5050
5389
  app.provide('registerEndpoint', registerEndpoint);
5051
5390
  app.provide('registrationFields', registrationFields);
@@ -5065,11 +5404,11 @@ const ShFrontend = {
5065
5404
  });
5066
5405
  options.router.addRoute({
5067
5406
  path: '/sh-departments',
5068
- component: script$3
5407
+ component: script$2
5069
5408
  });
5070
5409
  options.router.addRoute({
5071
5410
  path: '/sh-departments/permissions/:id',
5072
- component: script$2
5411
+ component: script$1
5073
5412
  });
5074
5413
  }
5075
5414
  //filter unwanted config items from options to be put in local storage
@@ -5081,4 +5420,4 @@ const ShFrontend = {
5081
5420
  }
5082
5421
  };
5083
5422
 
5084
- export { script$a as ShCanvas, script$8 as ShConfirmAction, script$d as ShDropDownForm, script$4 as ShDynamicTabs, script$e as ShForm, ShFrontend, script$c as ShModal, script$b as ShModalForm, script$h as ShPhone, script$7 as ShSilentAction, script$6 as ShTable, script$5 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
5423
+ export { script$d as ShAutoForm, script$9 as ShCanvas, script$7 as ShConfirmAction, script$c as ShDropDownForm, script$3 as ShDynamicTabs, script$i as ShForm, ShFrontend, script$b as ShModal, script$a as ShModalForm, script$l as ShPhone, script$6 as ShSilentAction, script$5 as ShTable, script$4 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };