@iankibetsh/shframework 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.js CHANGED
@@ -1874,7 +1874,7 @@ const countries = [
1874
1874
  }
1875
1875
  ];
1876
1876
 
1877
- var script$o = {
1877
+ var script$p = {
1878
1878
  name: 'PhoneInput',
1879
1879
  props: ['modelValue', 'country_code'],
1880
1880
  data () {
@@ -1936,7 +1936,7 @@ var script$o = {
1936
1936
  }
1937
1937
  };
1938
1938
 
1939
- const _hoisted_1$j = { class: "sh-phone mb-3" };
1939
+ const _hoisted_1$k = { class: "sh-phone mb-3" };
1940
1940
  const _hoisted_2$d = {
1941
1941
  key: 0,
1942
1942
  style: {"display":"contents"}
@@ -1945,7 +1945,7 @@ const _hoisted_3$c = ["src"];
1945
1945
  const _hoisted_4$c = ["value"];
1946
1946
 
1947
1947
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1948
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
1948
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
1949
1949
  ($data.selectedCountry)
1950
1950
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$d, [
1951
1951
  vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$c),
@@ -1979,10 +1979,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1979
1979
  ]))
1980
1980
  }
1981
1981
 
1982
- script$o.render = render$7;
1983
- script$o.__file = "src/lib/components/form-components/PhoneInput.vue";
1982
+ script$p.render = render$7;
1983
+ script$p.__file = "src/lib/components/form-components/PhoneInput.vue";
1984
1984
 
1985
- var script$n = {
1985
+ var script$o = {
1986
1986
  name: 'ShEditor',
1987
1987
  props: ['modelValue'],
1988
1988
  components: {
@@ -2021,7 +2021,7 @@ var script$n = {
2021
2021
  }
2022
2022
  };
2023
2023
 
2024
- const _hoisted_1$i = /*#__PURE__*/vue.createElementVNode("textarea", {
2024
+ const _hoisted_1$j = /*#__PURE__*/vue.createElementVNode("textarea", {
2025
2025
  id: "tiny",
2026
2026
  style: {"display":"none"},
2027
2027
  "data-cy": "tinymce_editor"
@@ -2031,7 +2031,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
2031
2031
  const _component_editor = vue.resolveComponent("editor");
2032
2032
 
2033
2033
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2034
- _hoisted_1$i,
2034
+ _hoisted_1$j,
2035
2035
  vue.createElementVNode("div", {
2036
2036
  onFocusin: _cache[1] || (_cache[1] = vue.withModifiers(() => {}, ["stop"])),
2037
2037
  class: "sh-editor w-100"
@@ -2056,10 +2056,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
2056
2056
  ], 64 /* STABLE_FRAGMENT */))
2057
2057
  }
2058
2058
 
2059
- script$n.render = render$6;
2060
- script$n.__file = "src/lib/components/form-components/ShEditor.vue";
2059
+ script$o.render = render$6;
2060
+ script$o.__file = "src/lib/components/form-components/ShEditor.vue";
2061
2061
 
2062
- const _hoisted_1$h = {
2062
+ const _hoisted_1$i = {
2063
2063
  key: 0,
2064
2064
  class: "dropdown sh-suggest"
2065
2065
  };
@@ -2080,7 +2080,7 @@ const _hoisted_10$4 = {
2080
2080
  };
2081
2081
 
2082
2082
 
2083
- var script$m = {
2083
+ var script$n = {
2084
2084
  __name: 'ShSuggest',
2085
2085
  props: ['fillSelects','modelValue'],
2086
2086
  emits: ['update:modelValue'],
@@ -2161,7 +2161,7 @@ function filterData(e){
2161
2161
 
2162
2162
  return (_ctx, _cache) => {
2163
2163
  return (vue.unref(id))
2164
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
2164
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
2165
2165
  vue.createElementVNode("div", {
2166
2166
  id: vue.unref(id),
2167
2167
  "data-bs-toggle": "dropdown",
@@ -2221,16 +2221,16 @@ return (_ctx, _cache) => {
2221
2221
 
2222
2222
  };
2223
2223
 
2224
- script$m.__scopeId = "data-v-71cc9569";
2225
- script$m.__file = "src/lib/components/form-components/ShSuggest.vue";
2224
+ script$n.__scopeId = "data-v-71cc9569";
2225
+ script$n.__file = "src/lib/components/form-components/ShSuggest.vue";
2226
2226
 
2227
- var script$l = {
2227
+ var script$m = {
2228
2228
  name: 'ShForm',
2229
2229
  components: {
2230
- PhoneInput: script$o,
2231
- ShSuggest: script$m,
2232
- ShEditor: script$n,
2233
- ShPhone: script$o
2230
+ PhoneInput: script$p,
2231
+ ShSuggest: script$n,
2232
+ ShEditor: script$o,
2233
+ ShPhone: script$p
2234
2234
  },
2235
2235
  props: [
2236
2236
  'action',
@@ -2291,6 +2291,9 @@ var script$l = {
2291
2291
  }
2292
2292
  },
2293
2293
  getFieldType: function (field) {
2294
+ if(this.fillSelects && this.fillSelects[field]){
2295
+ return 'select';
2296
+ }
2294
2297
  if(this.customComponent && this.customComponent[field]){
2295
2298
  return 'component'
2296
2299
  }
@@ -2509,14 +2512,10 @@ var script$l = {
2509
2512
  }
2510
2513
  this.suggests.push(key);
2511
2514
  } else if (this.fillSelects[key].data) {
2512
- selectData[key] = this.fillSelects[key].data;
2513
- this.selectData = selectData;
2514
- console.log(this.selectData);
2515
+ this.selectData[key] = this.fillSelects[key].data;
2515
2516
  } else {
2516
2517
  shApis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
2517
- // selectData[key] = res.data
2518
- // console.log(res)
2519
- this.selectData[key] = res.data.data;
2518
+ this.selectData[key] = res.data;
2520
2519
  }).catch(res => {
2521
2520
  console.log(res);
2522
2521
  });
@@ -2542,7 +2541,7 @@ var script$l = {
2542
2541
  }
2543
2542
  };
2544
2543
 
2545
- const _hoisted_1$g = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2544
+ const _hoisted_1$h = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2546
2545
  const _hoisted_2$b = {
2547
2546
  ref: "ShAutoForm",
2548
2547
  class: "sh-form"
@@ -2604,7 +2603,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2604
2603
  const _component_ShEditor = vue.resolveComponent("ShEditor");
2605
2604
 
2606
2605
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2607
- _hoisted_1$g,
2606
+ _hoisted_1$h,
2608
2607
  vue.createElementVNode("form", _hoisted_2$b, [
2609
2608
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2610
2609
  vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
@@ -2772,7 +2771,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2772
2771
  [vue.vModelText, _ctx.form_elements[field]]
2773
2772
  ])
2774
2773
  : vue.createCommentVNode("v-if", true),
2775
- ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2774
+ ($options.getFieldType(field) === 'select')
2776
2775
  ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
2777
2776
  key: 11,
2778
2777
  name: field,
@@ -2821,10 +2820,10 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2821
2820
  ], 64 /* STABLE_FRAGMENT */))
2822
2821
  }
2823
2822
 
2824
- script$l.render = render$5;
2825
- script$l.__file = "src/lib/components/ShForm.vue";
2823
+ script$m.render = render$5;
2824
+ script$m.__file = "src/lib/components/ShForm.vue";
2826
2825
 
2827
- var script$k = {
2826
+ var script$l = {
2828
2827
  __name: 'EmailInput',
2829
2828
  props: ['modelValue','label'],
2830
2829
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2860,12 +2859,12 @@ return (_ctx, _cache) => {
2860
2859
 
2861
2860
  };
2862
2861
 
2863
- script$k.__file = "src/lib/components/form-components/EmailInput.vue";
2862
+ script$l.__file = "src/lib/components/form-components/EmailInput.vue";
2864
2863
 
2865
- const _hoisted_1$f = ["min", "max"];
2864
+ const _hoisted_1$g = ["min", "max"];
2866
2865
 
2867
2866
 
2868
- var script$j = {
2867
+ var script$k = {
2869
2868
  __name: 'NumberInput',
2870
2869
  props: ['modelValue','label','min','max'],
2871
2870
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2895,7 +2894,7 @@ return (_ctx, _cache) => {
2895
2894
  onChange: modelValueUpdated,
2896
2895
  onKeydown: modelValueUpdated,
2897
2896
  onUpdated: modelValueUpdated
2898
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$f)), [
2897
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$g)), [
2899
2898
  [vue.vModelText, inputModel.value]
2900
2899
  ])
2901
2900
  }
@@ -2903,9 +2902,9 @@ return (_ctx, _cache) => {
2903
2902
 
2904
2903
  };
2905
2904
 
2906
- script$j.__file = "src/lib/components/form-components/NumberInput.vue";
2905
+ script$k.__file = "src/lib/components/form-components/NumberInput.vue";
2907
2906
 
2908
- var script$i = {
2907
+ var script$j = {
2909
2908
  __name: 'TextInput',
2910
2909
  props: ['modelValue','label','isInvalid'],
2911
2910
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2941,9 +2940,9 @@ return (_ctx, _cache) => {
2941
2940
 
2942
2941
  };
2943
2942
 
2944
- script$i.__file = "src/lib/components/form-components/TextInput.vue";
2943
+ script$j.__file = "src/lib/components/form-components/TextInput.vue";
2945
2944
 
2946
- var script$h = {
2945
+ var script$i = {
2947
2946
  __name: 'TextAreaInput',
2948
2947
  props: ['modelValue','label'],
2949
2948
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2979,12 +2978,12 @@ return (_ctx, _cache) => {
2979
2978
 
2980
2979
  };
2981
2980
 
2982
- script$h.__file = "src/lib/components/form-components/TextAreaInput.vue";
2981
+ script$i.__file = "src/lib/components/form-components/TextAreaInput.vue";
2983
2982
 
2984
- const _hoisted_1$e = ["value"];
2983
+ const _hoisted_1$f = ["value"];
2985
2984
 
2986
2985
 
2987
- var script$g = {
2986
+ var script$h = {
2988
2987
  __name: 'SelectInput',
2989
2988
  props: ['modelValue','label','data','dataUrl'],
2990
2989
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3035,7 +3034,7 @@ return (_ctx, _cache) => {
3035
3034
  return (vue.openBlock(), vue.createElementBlock("option", {
3036
3035
  key: option.id,
3037
3036
  value: option.id
3038
- }, vue.toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$e))
3037
+ }, vue.toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$f))
3039
3038
  }), 128 /* KEYED_FRAGMENT */))
3040
3039
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
3041
3040
  [vue.vModelSelect, inputModel.value]
@@ -3045,9 +3044,9 @@ return (_ctx, _cache) => {
3045
3044
 
3046
3045
  };
3047
3046
 
3048
- script$g.__file = "src/lib/components/form-components/SelectInput.vue";
3047
+ script$h.__file = "src/lib/components/form-components/SelectInput.vue";
3049
3048
 
3050
- var script$f = {
3049
+ var script$g = {
3051
3050
  __name: 'PasswordInput',
3052
3051
  props: ['modelValue','label'],
3053
3052
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3083,9 +3082,9 @@ return (_ctx, _cache) => {
3083
3082
 
3084
3083
  };
3085
3084
 
3086
- script$f.__file = "src/lib/components/form-components/PasswordInput.vue";
3085
+ script$g.__file = "src/lib/components/form-components/PasswordInput.vue";
3087
3086
 
3088
- const _hoisted_1$d = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3087
+ const _hoisted_1$e = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3089
3088
  const _hoisted_2$a = ["innerHTML"];
3090
3089
  const _hoisted_3$9 = ["innerHTML"];
3091
3090
  const _hoisted_4$9 = ["innerHTML"];
@@ -3099,7 +3098,7 @@ const _hoisted_6$6 = {
3099
3098
  const _hoisted_7$4 = { key: 1 };
3100
3099
 
3101
3100
 
3102
- var script$e = {
3101
+ var script$f = {
3103
3102
  __name: 'ShAutoForm',
3104
3103
  props: [
3105
3104
  'action','successCallback','retainDataAfterSubmission',
@@ -3131,13 +3130,13 @@ const getFieldComponent = (fieldObj)=>{
3131
3130
  const defaultPhones = ['phone'];
3132
3131
  const defaultEmails = ['email'];
3133
3132
  const formComponents = vue.inject('formComponents');
3134
- const TextComponent = formComponents.text ?? script$i;
3135
- const TextAreaComponent = formComponents.textArea ?? script$h;
3136
- const EmailComponent = formComponents.email ?? script$k;
3137
- const PhoneComponent = formComponents.phone ?? script$o;
3138
- const NumberComponent = formComponents.number ?? script$j;
3139
- const SelectComponent = formComponents.select ?? script$g;
3140
- const PasswordComponent = formComponents.password ?? script$f;
3133
+ const TextComponent = formComponents.text ?? script$j;
3134
+ const TextAreaComponent = formComponents.textArea ?? script$i;
3135
+ const EmailComponent = formComponents.email ?? script$l;
3136
+ const PhoneComponent = formComponents.phone ?? script$p;
3137
+ const NumberComponent = formComponents.number ?? script$k;
3138
+ const SelectComponent = formComponents.select ?? script$h;
3139
+ const PasswordComponent = formComponents.password ?? script$g;
3141
3140
  if(props.customComponents && props.customComponents[field]) {
3142
3141
  return props.customComponents[field]
3143
3142
  }
@@ -3149,16 +3148,16 @@ const getFieldComponent = (fieldObj)=>{
3149
3148
  }
3150
3149
  else
3151
3150
  if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
3152
- return formComponents.textArea ?? script$h
3151
+ return formComponents.textArea ?? script$i
3153
3152
  } else
3154
3153
  if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
3155
- return formComponents.email ?? script$k
3154
+ return formComponents.email ?? script$l
3156
3155
  } else
3157
3156
  if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
3158
- return formComponents.phone ?? script$o
3157
+ return formComponents.phone ?? script$p
3159
3158
  } else
3160
3159
  if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
3161
- return formComponents.number ?? script$j
3160
+ return formComponents.number ?? script$k
3162
3161
  }
3163
3162
  // else
3164
3163
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
@@ -3167,14 +3166,14 @@ const getFieldComponent = (fieldObj)=>{
3167
3166
  // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3168
3167
  // return formComponents.date ?? DateInput
3169
3168
  // }
3170
- return formComponents.text ?? script$i
3169
+ return formComponents.text ?? script$j
3171
3170
  };
3172
3171
  const shFormElementClasses = vue.ref(null);
3173
3172
  shFormElementClasses.value = vue.inject('shFormElementClasses');
3174
3173
  const shAutoForm = vue.ref(null);
3175
3174
  const closeModal = e => {
3176
3175
  setTimeout(() => {
3177
- const modal = script$e.value.closest('.modal-dialog');
3176
+ const modal = script$f.value.closest('.modal-dialog');
3178
3177
  if(modal){
3179
3178
  const closeBtn = modal.querySelector('[data-bs-dismiss="modal"]');
3180
3179
  closeBtn && closeBtn.click();
@@ -3270,7 +3269,7 @@ vue.onMounted((ev)=>{
3270
3269
 
3271
3270
  return (_ctx, _cache) => {
3272
3271
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3273
- _hoisted_1$d,
3272
+ _hoisted_1$e,
3274
3273
  vue.createElementVNode("form", {
3275
3274
  ref_key: "shAutoForm",
3276
3275
  ref: shAutoForm,
@@ -3345,12 +3344,12 @@ return (_ctx, _cache) => {
3345
3344
 
3346
3345
  };
3347
3346
 
3348
- script$e.__file = "src/lib/components/ShAutoForm.vue";
3347
+ script$f.__file = "src/lib/components/ShAutoForm.vue";
3349
3348
 
3350
- const _hoisted_1$c = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3349
+ const _hoisted_1$d = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3351
3350
  const _hoisted_2$9 = { class: "dropdown" };
3352
3351
 
3353
- var script$d = {
3352
+ var script$e = {
3354
3353
  __name: 'ShDropDownForm',
3355
3354
  props: ['action',
3356
3355
  'classes',
@@ -3380,7 +3379,7 @@ const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3380
3379
 
3381
3380
  return (_ctx, _cache) => {
3382
3381
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3383
- _hoisted_1$c,
3382
+ _hoisted_1$d,
3384
3383
  vue.createElementVNode("div", _hoisted_2$9, [
3385
3384
  vue.createElementVNode("a", {
3386
3385
  class: vue.normalizeClass(vue.unref(btnClass)),
@@ -3397,7 +3396,7 @@ return (_ctx, _cache) => {
3397
3396
  class: "dropdown-menu px-2 py-1",
3398
3397
  "aria-labelledby": dropdownId
3399
3398
  }, [
3400
- vue.createVNode(script$l, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3399
+ vue.createVNode(script$m, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3401
3400
  ])
3402
3401
  ])
3403
3402
  ], 64 /* STABLE_FRAGMENT */))
@@ -3406,16 +3405,16 @@ return (_ctx, _cache) => {
3406
3405
 
3407
3406
  };
3408
3407
 
3409
- script$d.__file = "src/lib/components/ShDropDownForm.vue";
3408
+ script$e.__file = "src/lib/components/ShDropDownForm.vue";
3410
3409
 
3411
- var script$c = {
3410
+ var script$d = {
3412
3411
  name: 'ShModal',
3413
3412
  props: ['modalTitle', 'modalId', 'modalSize'],
3414
3413
  components: {
3415
3414
  }
3416
3415
  };
3417
3416
 
3418
- const _hoisted_1$b = ["id"];
3417
+ const _hoisted_1$c = ["id"];
3419
3418
  const _hoisted_2$8 = { class: "modal-content" };
3420
3419
  const _hoisted_3$8 = { class: "modal-header" };
3421
3420
  const _hoisted_4$8 = { class: "modal-title" };
@@ -3448,15 +3447,15 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
3448
3447
  ])
3449
3448
  ])
3450
3449
  ], 2 /* CLASS */)
3451
- ], 8 /* PROPS */, _hoisted_1$b))
3450
+ ], 8 /* PROPS */, _hoisted_1$c))
3452
3451
  }
3453
3452
 
3454
- script$c.render = render$4;
3455
- script$c.__file = "src/lib/components/ShModal.vue";
3453
+ script$d.render = render$4;
3454
+ script$d.__file = "src/lib/components/ShModal.vue";
3456
3455
 
3457
- const _hoisted_1$a = ["href"];
3456
+ const _hoisted_1$b = ["href"];
3458
3457
 
3459
- var script$b = {
3458
+ var script$c = {
3460
3459
  __name: 'ShModalForm',
3461
3460
  props: ['action',
3462
3461
  'classes',
@@ -3487,6 +3486,66 @@ const success = (res)=>{
3487
3486
  emit('success',res);
3488
3487
  };
3489
3488
 
3489
+ return (_ctx, _cache) => {
3490
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3491
+ vue.createElementVNode("a", {
3492
+ class: vue.normalizeClass(vue.unref(btnClass)),
3493
+ href: '#' + modalId,
3494
+ "data-bs-toggle": "modal"
3495
+ }, [
3496
+ vue.renderSlot(_ctx.$slots, "default")
3497
+ ], 10 /* CLASS, PROPS */, _hoisted_1$b),
3498
+ vue.createVNode(script$d, {
3499
+ "modal-id": modalId,
3500
+ "modal-title": __props.modalTitle
3501
+ }, {
3502
+ default: vue.withCtx(() => [
3503
+ vue.createVNode(script$m, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3504
+ ]),
3505
+ _: 1 /* STABLE */
3506
+ }, 8 /* PROPS */, ["modal-title"])
3507
+ ], 64 /* STABLE_FRAGMENT */))
3508
+ }
3509
+ }
3510
+
3511
+ };
3512
+
3513
+ script$c.__file = "src/lib/components/ShModalForm.vue";
3514
+
3515
+ const _hoisted_1$a = ["href"];
3516
+
3517
+ var script$b = {
3518
+ __name: 'ShModalFormAuto',
3519
+ props: ['action',
3520
+ 'classes',
3521
+ 'hasTerms',
3522
+ 'country_code',
3523
+ 'submitBtnClass',
3524
+ 'fields',
3525
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3526
+ 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3527
+ 'failedCallback', 'labels', 'editors',
3528
+ 'datePickers',
3529
+ 'textAreas',
3530
+ 'files',
3531
+ 'phones',
3532
+ 'numbers',
3533
+ 'customComponent','modalTitle','class','successMessage'],
3534
+ emits: ['success'],
3535
+ setup(__props, { emit }) {
3536
+
3537
+ const props = __props;
3538
+
3539
+
3540
+
3541
+ const formProps = vue.ref(props);
3542
+ let btnClass=props.class;
3543
+ const modalId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3544
+ const success = (res)=>{
3545
+ emit('success',res);
3546
+ };
3547
+ delete formProps.class;
3548
+
3490
3549
  return (_ctx, _cache) => {
3491
3550
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3492
3551
  vue.createElementVNode("a", {
@@ -3496,12 +3555,12 @@ return (_ctx, _cache) => {
3496
3555
  }, [
3497
3556
  vue.renderSlot(_ctx.$slots, "default")
3498
3557
  ], 10 /* CLASS, PROPS */, _hoisted_1$a),
3499
- vue.createVNode(script$c, {
3558
+ vue.createVNode(script$d, {
3500
3559
  "modal-id": modalId,
3501
3560
  "modal-title": __props.modalTitle
3502
3561
  }, {
3503
3562
  default: vue.withCtx(() => [
3504
- vue.createVNode(script$l, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3563
+ vue.createVNode(script$f, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3505
3564
  ]),
3506
3565
  _: 1 /* STABLE */
3507
3566
  }, 8 /* PROPS */, ["modal-title"])
@@ -3511,7 +3570,7 @@ return (_ctx, _cache) => {
3511
3570
 
3512
3571
  };
3513
3572
 
3514
- script$b.__file = "src/lib/components/ShModalForm.vue";
3573
+ script$b.__file = "src/lib/components/ShModalFormAuto.vue";
3515
3574
 
3516
3575
  var script$a = {
3517
3576
  name: 'ShCanvas',
@@ -5405,12 +5464,12 @@ return (_ctx, _cache) => {
5405
5464
  ]
5406
5465
  }
5407
5466
  }),
5408
- vue.createVNode(script$c, {
5467
+ vue.createVNode(script$d, {
5409
5468
  "modal-id": "sh-department_modal",
5410
5469
  "modal-title": "Department Form"
5411
5470
  }, {
5412
5471
  default: vue.withCtx(() => [
5413
- vue.createVNode(script$l, {
5472
+ vue.createVNode(script$m, {
5414
5473
  "success-callback": "departmentAdded",
5415
5474
  onDepartmentAdded: departmentAdded,
5416
5475
  action: "admin/departments/store",
@@ -5564,12 +5623,12 @@ return (_ctx, _cache) => {
5564
5623
  headers: ['id',showModule,'created_at'],
5565
5624
  "end-point": 'admin/departments/department/list-modules/' + id.value
5566
5625
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
5567
- vue.createVNode(script$c, {
5626
+ vue.createVNode(script$d, {
5568
5627
  "modal-id": "addModule",
5569
5628
  "modal-title": "Add Module Department"
5570
5629
  }, {
5571
5630
  default: vue.withCtx(() => [
5572
- vue.createVNode(script$l, {
5631
+ vue.createVNode(script$m, {
5573
5632
  "reload-select-items": vue.unref(reload),
5574
5633
  "success-callback": moduleAdded,
5575
5634
  "fill-selects": {
@@ -5706,7 +5765,7 @@ return (_ctx, _cache) => {
5706
5765
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
5707
5766
  (section.value === 'login')
5708
5767
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
5709
- vue.createVNode(script$l, {
5768
+ vue.createVNode(script$m, {
5710
5769
  class: "sh-login-form",
5711
5770
  fields: ['email','password'],
5712
5771
  "action-label": "Login",
@@ -5731,7 +5790,7 @@ return (_ctx, _cache) => {
5731
5790
  (vue.unref(registerSubTitle))
5732
5791
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, vue.toDisplayString(vue.unref(registerSubTitle)), 1 /* TEXT */))
5733
5792
  : vue.createCommentVNode("v-if", true),
5734
- vue.createVNode(script$l, {
5793
+ vue.createVNode(script$m, {
5735
5794
  class: "sh-login-form",
5736
5795
  fields: vue.unref(registrationFields),
5737
5796
  "action-label": "Sign Up",
@@ -5778,7 +5837,7 @@ const ShFrontend = {
5778
5837
  const registerTitle = options.registerTitle ?? 'Create a new account';
5779
5838
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
5780
5839
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
5781
- options.formTextInput ?? script$i;
5840
+ options.formTextInput ?? script$j;
5782
5841
  const loginUrl = options.loginUrl ?? `/login`;
5783
5842
  const redirectLogin = options.redirectLogin ?? `/`;
5784
5843
  const redirectRegister = options.redirectRegister ?? `/`;
@@ -5825,16 +5884,17 @@ const ShFrontend = {
5825
5884
 
5826
5885
  exports.Countries = countries;
5827
5886
  exports.ManagePermissions = script$3;
5828
- exports.ShAutoForm = script$e;
5887
+ exports.ShAutoForm = script$f;
5829
5888
  exports.ShCanvas = script$a;
5830
5889
  exports.ShConfirmAction = script$8;
5831
- exports.ShDropDownForm = script$d;
5890
+ exports.ShDropDownForm = script$e;
5832
5891
  exports.ShDynamicTabs = script$4;
5833
- exports.ShForm = script$l;
5892
+ exports.ShForm = script$m;
5834
5893
  exports.ShFrontend = ShFrontend;
5835
- exports.ShModal = script$c;
5836
- exports.ShModalForm = script$b;
5837
- exports.ShPhone = script$o;
5894
+ exports.ShModal = script$d;
5895
+ exports.ShModalForm = script$c;
5896
+ exports.ShModalFormAuto = script$b;
5897
+ exports.ShPhone = script$p;
5838
5898
  exports.ShSilentAction = script$7;
5839
5899
  exports.ShTable = script$6;
5840
5900
  exports.ShTabs = script$5;
package/dist/library.mjs CHANGED
@@ -1861,7 +1861,7 @@ const countries = [
1861
1861
  }
1862
1862
  ];
1863
1863
 
1864
- var script$o = {
1864
+ var script$p = {
1865
1865
  name: 'PhoneInput',
1866
1866
  props: ['modelValue', 'country_code'],
1867
1867
  data () {
@@ -1923,7 +1923,7 @@ var script$o = {
1923
1923
  }
1924
1924
  };
1925
1925
 
1926
- const _hoisted_1$j = { class: "sh-phone mb-3" };
1926
+ const _hoisted_1$k = { class: "sh-phone mb-3" };
1927
1927
  const _hoisted_2$d = {
1928
1928
  key: 0,
1929
1929
  style: {"display":"contents"}
@@ -1932,7 +1932,7 @@ const _hoisted_3$c = ["src"];
1932
1932
  const _hoisted_4$c = ["value"];
1933
1933
 
1934
1934
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1935
- return (openBlock(), createElementBlock("div", _hoisted_1$j, [
1935
+ return (openBlock(), createElementBlock("div", _hoisted_1$k, [
1936
1936
  ($data.selectedCountry)
1937
1937
  ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
1938
1938
  createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$c),
@@ -1966,10 +1966,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
1966
1966
  ]))
1967
1967
  }
1968
1968
 
1969
- script$o.render = render$7;
1970
- script$o.__file = "src/lib/components/form-components/PhoneInput.vue";
1969
+ script$p.render = render$7;
1970
+ script$p.__file = "src/lib/components/form-components/PhoneInput.vue";
1971
1971
 
1972
- var script$n = {
1972
+ var script$o = {
1973
1973
  name: 'ShEditor',
1974
1974
  props: ['modelValue'],
1975
1975
  components: {
@@ -2008,7 +2008,7 @@ var script$n = {
2008
2008
  }
2009
2009
  };
2010
2010
 
2011
- const _hoisted_1$i = /*#__PURE__*/createElementVNode("textarea", {
2011
+ const _hoisted_1$j = /*#__PURE__*/createElementVNode("textarea", {
2012
2012
  id: "tiny",
2013
2013
  style: {"display":"none"},
2014
2014
  "data-cy": "tinymce_editor"
@@ -2018,7 +2018,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
2018
2018
  const _component_editor = resolveComponent("editor");
2019
2019
 
2020
2020
  return (openBlock(), createElementBlock(Fragment, null, [
2021
- _hoisted_1$i,
2021
+ _hoisted_1$j,
2022
2022
  createElementVNode("div", {
2023
2023
  onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
2024
2024
  class: "sh-editor w-100"
@@ -2043,10 +2043,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
2043
2043
  ], 64 /* STABLE_FRAGMENT */))
2044
2044
  }
2045
2045
 
2046
- script$n.render = render$6;
2047
- script$n.__file = "src/lib/components/form-components/ShEditor.vue";
2046
+ script$o.render = render$6;
2047
+ script$o.__file = "src/lib/components/form-components/ShEditor.vue";
2048
2048
 
2049
- const _hoisted_1$h = {
2049
+ const _hoisted_1$i = {
2050
2050
  key: 0,
2051
2051
  class: "dropdown sh-suggest"
2052
2052
  };
@@ -2067,7 +2067,7 @@ const _hoisted_10$4 = {
2067
2067
  };
2068
2068
 
2069
2069
 
2070
- var script$m = {
2070
+ var script$n = {
2071
2071
  __name: 'ShSuggest',
2072
2072
  props: ['fillSelects','modelValue'],
2073
2073
  emits: ['update:modelValue'],
@@ -2148,7 +2148,7 @@ function filterData(e){
2148
2148
 
2149
2149
  return (_ctx, _cache) => {
2150
2150
  return (unref(id))
2151
- ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
2151
+ ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
2152
2152
  createElementVNode("div", {
2153
2153
  id: unref(id),
2154
2154
  "data-bs-toggle": "dropdown",
@@ -2208,16 +2208,16 @@ return (_ctx, _cache) => {
2208
2208
 
2209
2209
  };
2210
2210
 
2211
- script$m.__scopeId = "data-v-71cc9569";
2212
- script$m.__file = "src/lib/components/form-components/ShSuggest.vue";
2211
+ script$n.__scopeId = "data-v-71cc9569";
2212
+ script$n.__file = "src/lib/components/form-components/ShSuggest.vue";
2213
2213
 
2214
- var script$l = {
2214
+ var script$m = {
2215
2215
  name: 'ShForm',
2216
2216
  components: {
2217
- PhoneInput: script$o,
2218
- ShSuggest: script$m,
2219
- ShEditor: script$n,
2220
- ShPhone: script$o
2217
+ PhoneInput: script$p,
2218
+ ShSuggest: script$n,
2219
+ ShEditor: script$o,
2220
+ ShPhone: script$p
2221
2221
  },
2222
2222
  props: [
2223
2223
  'action',
@@ -2278,6 +2278,9 @@ var script$l = {
2278
2278
  }
2279
2279
  },
2280
2280
  getFieldType: function (field) {
2281
+ if(this.fillSelects && this.fillSelects[field]){
2282
+ return 'select';
2283
+ }
2281
2284
  if(this.customComponent && this.customComponent[field]){
2282
2285
  return 'component'
2283
2286
  }
@@ -2496,14 +2499,10 @@ var script$l = {
2496
2499
  }
2497
2500
  this.suggests.push(key);
2498
2501
  } else if (this.fillSelects[key].data) {
2499
- selectData[key] = this.fillSelects[key].data;
2500
- this.selectData = selectData;
2501
- console.log(this.selectData);
2502
+ this.selectData[key] = this.fillSelects[key].data;
2502
2503
  } else {
2503
2504
  shApis.doGet(this.fillSelects[key].url, { all: 1 }).then(res => {
2504
- // selectData[key] = res.data
2505
- // console.log(res)
2506
- this.selectData[key] = res.data.data;
2505
+ this.selectData[key] = res.data;
2507
2506
  }).catch(res => {
2508
2507
  console.log(res);
2509
2508
  });
@@ -2529,7 +2528,7 @@ var script$l = {
2529
2528
  }
2530
2529
  };
2531
2530
 
2532
- const _hoisted_1$g = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2531
+ const _hoisted_1$h = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2533
2532
  const _hoisted_2$b = {
2534
2533
  ref: "ShAutoForm",
2535
2534
  class: "sh-form"
@@ -2591,7 +2590,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2591
2590
  const _component_ShEditor = resolveComponent("ShEditor");
2592
2591
 
2593
2592
  return (openBlock(), createElementBlock(Fragment, null, [
2594
- _hoisted_1$g,
2593
+ _hoisted_1$h,
2595
2594
  createElementVNode("form", _hoisted_2$b, [
2596
2595
  createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2597
2596
  createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
@@ -2759,7 +2758,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2759
2758
  [vModelText, _ctx.form_elements[field]]
2760
2759
  ])
2761
2760
  : createCommentVNode("v-if", true),
2762
- ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2761
+ ($options.getFieldType(field) === 'select')
2763
2762
  ? withDirectives((openBlock(), createElementBlock("select", {
2764
2763
  key: 11,
2765
2764
  name: field,
@@ -2808,10 +2807,10 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2808
2807
  ], 64 /* STABLE_FRAGMENT */))
2809
2808
  }
2810
2809
 
2811
- script$l.render = render$5;
2812
- script$l.__file = "src/lib/components/ShForm.vue";
2810
+ script$m.render = render$5;
2811
+ script$m.__file = "src/lib/components/ShForm.vue";
2813
2812
 
2814
- var script$k = {
2813
+ var script$l = {
2815
2814
  __name: 'EmailInput',
2816
2815
  props: ['modelValue','label'],
2817
2816
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2847,12 +2846,12 @@ return (_ctx, _cache) => {
2847
2846
 
2848
2847
  };
2849
2848
 
2850
- script$k.__file = "src/lib/components/form-components/EmailInput.vue";
2849
+ script$l.__file = "src/lib/components/form-components/EmailInput.vue";
2851
2850
 
2852
- const _hoisted_1$f = ["min", "max"];
2851
+ const _hoisted_1$g = ["min", "max"];
2853
2852
 
2854
2853
 
2855
- var script$j = {
2854
+ var script$k = {
2856
2855
  __name: 'NumberInput',
2857
2856
  props: ['modelValue','label','min','max'],
2858
2857
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2882,7 +2881,7 @@ return (_ctx, _cache) => {
2882
2881
  onChange: modelValueUpdated,
2883
2882
  onKeydown: modelValueUpdated,
2884
2883
  onUpdated: modelValueUpdated
2885
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$f)), [
2884
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$g)), [
2886
2885
  [vModelText, inputModel.value]
2887
2886
  ])
2888
2887
  }
@@ -2890,9 +2889,9 @@ return (_ctx, _cache) => {
2890
2889
 
2891
2890
  };
2892
2891
 
2893
- script$j.__file = "src/lib/components/form-components/NumberInput.vue";
2892
+ script$k.__file = "src/lib/components/form-components/NumberInput.vue";
2894
2893
 
2895
- var script$i = {
2894
+ var script$j = {
2896
2895
  __name: 'TextInput',
2897
2896
  props: ['modelValue','label','isInvalid'],
2898
2897
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2928,9 +2927,9 @@ return (_ctx, _cache) => {
2928
2927
 
2929
2928
  };
2930
2929
 
2931
- script$i.__file = "src/lib/components/form-components/TextInput.vue";
2930
+ script$j.__file = "src/lib/components/form-components/TextInput.vue";
2932
2931
 
2933
- var script$h = {
2932
+ var script$i = {
2934
2933
  __name: 'TextAreaInput',
2935
2934
  props: ['modelValue','label'],
2936
2935
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2966,12 +2965,12 @@ return (_ctx, _cache) => {
2966
2965
 
2967
2966
  };
2968
2967
 
2969
- script$h.__file = "src/lib/components/form-components/TextAreaInput.vue";
2968
+ script$i.__file = "src/lib/components/form-components/TextAreaInput.vue";
2970
2969
 
2971
- const _hoisted_1$e = ["value"];
2970
+ const _hoisted_1$f = ["value"];
2972
2971
 
2973
2972
 
2974
- var script$g = {
2973
+ var script$h = {
2975
2974
  __name: 'SelectInput',
2976
2975
  props: ['modelValue','label','data','dataUrl'],
2977
2976
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3022,7 +3021,7 @@ return (_ctx, _cache) => {
3022
3021
  return (openBlock(), createElementBlock("option", {
3023
3022
  key: option.id,
3024
3023
  value: option.id
3025
- }, toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$e))
3024
+ }, toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$f))
3026
3025
  }), 128 /* KEYED_FRAGMENT */))
3027
3026
  ], 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
3028
3027
  [vModelSelect, inputModel.value]
@@ -3032,9 +3031,9 @@ return (_ctx, _cache) => {
3032
3031
 
3033
3032
  };
3034
3033
 
3035
- script$g.__file = "src/lib/components/form-components/SelectInput.vue";
3034
+ script$h.__file = "src/lib/components/form-components/SelectInput.vue";
3036
3035
 
3037
- var script$f = {
3036
+ var script$g = {
3038
3037
  __name: 'PasswordInput',
3039
3038
  props: ['modelValue','label'],
3040
3039
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3070,9 +3069,9 @@ return (_ctx, _cache) => {
3070
3069
 
3071
3070
  };
3072
3071
 
3073
- script$f.__file = "src/lib/components/form-components/PasswordInput.vue";
3072
+ script$g.__file = "src/lib/components/form-components/PasswordInput.vue";
3074
3073
 
3075
- const _hoisted_1$d = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
3074
+ const _hoisted_1$e = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
3076
3075
  const _hoisted_2$a = ["innerHTML"];
3077
3076
  const _hoisted_3$9 = ["innerHTML"];
3078
3077
  const _hoisted_4$9 = ["innerHTML"];
@@ -3086,7 +3085,7 @@ const _hoisted_6$6 = {
3086
3085
  const _hoisted_7$4 = { key: 1 };
3087
3086
 
3088
3087
 
3089
- var script$e = {
3088
+ var script$f = {
3090
3089
  __name: 'ShAutoForm',
3091
3090
  props: [
3092
3091
  'action','successCallback','retainDataAfterSubmission',
@@ -3118,13 +3117,13 @@ const getFieldComponent = (fieldObj)=>{
3118
3117
  const defaultPhones = ['phone'];
3119
3118
  const defaultEmails = ['email'];
3120
3119
  const formComponents = inject('formComponents');
3121
- const TextComponent = formComponents.text ?? script$i;
3122
- const TextAreaComponent = formComponents.textArea ?? script$h;
3123
- const EmailComponent = formComponents.email ?? script$k;
3124
- const PhoneComponent = formComponents.phone ?? script$o;
3125
- const NumberComponent = formComponents.number ?? script$j;
3126
- const SelectComponent = formComponents.select ?? script$g;
3127
- const PasswordComponent = formComponents.password ?? script$f;
3120
+ const TextComponent = formComponents.text ?? script$j;
3121
+ const TextAreaComponent = formComponents.textArea ?? script$i;
3122
+ const EmailComponent = formComponents.email ?? script$l;
3123
+ const PhoneComponent = formComponents.phone ?? script$p;
3124
+ const NumberComponent = formComponents.number ?? script$k;
3125
+ const SelectComponent = formComponents.select ?? script$h;
3126
+ const PasswordComponent = formComponents.password ?? script$g;
3128
3127
  if(props.customComponents && props.customComponents[field]) {
3129
3128
  return props.customComponents[field]
3130
3129
  }
@@ -3136,16 +3135,16 @@ const getFieldComponent = (fieldObj)=>{
3136
3135
  }
3137
3136
  else
3138
3137
  if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
3139
- return formComponents.textArea ?? script$h
3138
+ return formComponents.textArea ?? script$i
3140
3139
  } else
3141
3140
  if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
3142
- return formComponents.email ?? script$k
3141
+ return formComponents.email ?? script$l
3143
3142
  } else
3144
3143
  if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
3145
- return formComponents.phone ?? script$o
3144
+ return formComponents.phone ?? script$p
3146
3145
  } else
3147
3146
  if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
3148
- return formComponents.number ?? script$j
3147
+ return formComponents.number ?? script$k
3149
3148
  }
3150
3149
  // else
3151
3150
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
@@ -3154,14 +3153,14 @@ const getFieldComponent = (fieldObj)=>{
3154
3153
  // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3155
3154
  // return formComponents.date ?? DateInput
3156
3155
  // }
3157
- return formComponents.text ?? script$i
3156
+ return formComponents.text ?? script$j
3158
3157
  };
3159
3158
  const shFormElementClasses = ref(null);
3160
3159
  shFormElementClasses.value = inject('shFormElementClasses');
3161
3160
  const shAutoForm = ref(null);
3162
3161
  const closeModal = e => {
3163
3162
  setTimeout(() => {
3164
- const modal = script$e.value.closest('.modal-dialog');
3163
+ const modal = script$f.value.closest('.modal-dialog');
3165
3164
  if(modal){
3166
3165
  const closeBtn = modal.querySelector('[data-bs-dismiss="modal"]');
3167
3166
  closeBtn && closeBtn.click();
@@ -3257,7 +3256,7 @@ onMounted((ev)=>{
3257
3256
 
3258
3257
  return (_ctx, _cache) => {
3259
3258
  return (openBlock(), createElementBlock(Fragment, null, [
3260
- _hoisted_1$d,
3259
+ _hoisted_1$e,
3261
3260
  createElementVNode("form", {
3262
3261
  ref_key: "shAutoForm",
3263
3262
  ref: shAutoForm,
@@ -3332,12 +3331,12 @@ return (_ctx, _cache) => {
3332
3331
 
3333
3332
  };
3334
3333
 
3335
- script$e.__file = "src/lib/components/ShAutoForm.vue";
3334
+ script$f.__file = "src/lib/components/ShAutoForm.vue";
3336
3335
 
3337
- const _hoisted_1$c = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3336
+ const _hoisted_1$d = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
3338
3337
  const _hoisted_2$9 = { class: "dropdown" };
3339
3338
 
3340
- var script$d = {
3339
+ var script$e = {
3341
3340
  __name: 'ShDropDownForm',
3342
3341
  props: ['action',
3343
3342
  'classes',
@@ -3367,7 +3366,7 @@ const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3367
3366
 
3368
3367
  return (_ctx, _cache) => {
3369
3368
  return (openBlock(), createElementBlock(Fragment, null, [
3370
- _hoisted_1$c,
3369
+ _hoisted_1$d,
3371
3370
  createElementVNode("div", _hoisted_2$9, [
3372
3371
  createElementVNode("a", {
3373
3372
  class: normalizeClass(unref(btnClass)),
@@ -3384,7 +3383,7 @@ return (_ctx, _cache) => {
3384
3383
  class: "dropdown-menu px-2 py-1",
3385
3384
  "aria-labelledby": dropdownId
3386
3385
  }, [
3387
- createVNode(script$l, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3386
+ createVNode(script$m, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3388
3387
  ])
3389
3388
  ])
3390
3389
  ], 64 /* STABLE_FRAGMENT */))
@@ -3393,16 +3392,16 @@ return (_ctx, _cache) => {
3393
3392
 
3394
3393
  };
3395
3394
 
3396
- script$d.__file = "src/lib/components/ShDropDownForm.vue";
3395
+ script$e.__file = "src/lib/components/ShDropDownForm.vue";
3397
3396
 
3398
- var script$c = {
3397
+ var script$d = {
3399
3398
  name: 'ShModal',
3400
3399
  props: ['modalTitle', 'modalId', 'modalSize'],
3401
3400
  components: {
3402
3401
  }
3403
3402
  };
3404
3403
 
3405
- const _hoisted_1$b = ["id"];
3404
+ const _hoisted_1$c = ["id"];
3406
3405
  const _hoisted_2$8 = { class: "modal-content" };
3407
3406
  const _hoisted_3$8 = { class: "modal-header" };
3408
3407
  const _hoisted_4$8 = { class: "modal-title" };
@@ -3435,15 +3434,15 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
3435
3434
  ])
3436
3435
  ])
3437
3436
  ], 2 /* CLASS */)
3438
- ], 8 /* PROPS */, _hoisted_1$b))
3437
+ ], 8 /* PROPS */, _hoisted_1$c))
3439
3438
  }
3440
3439
 
3441
- script$c.render = render$4;
3442
- script$c.__file = "src/lib/components/ShModal.vue";
3440
+ script$d.render = render$4;
3441
+ script$d.__file = "src/lib/components/ShModal.vue";
3443
3442
 
3444
- const _hoisted_1$a = ["href"];
3443
+ const _hoisted_1$b = ["href"];
3445
3444
 
3446
- var script$b = {
3445
+ var script$c = {
3447
3446
  __name: 'ShModalForm',
3448
3447
  props: ['action',
3449
3448
  'classes',
@@ -3474,6 +3473,66 @@ const success = (res)=>{
3474
3473
  emit('success',res);
3475
3474
  };
3476
3475
 
3476
+ return (_ctx, _cache) => {
3477
+ return (openBlock(), createElementBlock(Fragment, null, [
3478
+ createElementVNode("a", {
3479
+ class: normalizeClass(unref(btnClass)),
3480
+ href: '#' + modalId,
3481
+ "data-bs-toggle": "modal"
3482
+ }, [
3483
+ renderSlot(_ctx.$slots, "default")
3484
+ ], 10 /* CLASS, PROPS */, _hoisted_1$b),
3485
+ createVNode(script$d, {
3486
+ "modal-id": modalId,
3487
+ "modal-title": __props.modalTitle
3488
+ }, {
3489
+ default: withCtx(() => [
3490
+ createVNode(script$m, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3491
+ ]),
3492
+ _: 1 /* STABLE */
3493
+ }, 8 /* PROPS */, ["modal-title"])
3494
+ ], 64 /* STABLE_FRAGMENT */))
3495
+ }
3496
+ }
3497
+
3498
+ };
3499
+
3500
+ script$c.__file = "src/lib/components/ShModalForm.vue";
3501
+
3502
+ const _hoisted_1$a = ["href"];
3503
+
3504
+ var script$b = {
3505
+ __name: 'ShModalFormAuto',
3506
+ props: ['action',
3507
+ 'classes',
3508
+ 'hasTerms',
3509
+ 'country_code',
3510
+ 'submitBtnClass',
3511
+ 'fields',
3512
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3513
+ 'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3514
+ 'failedCallback', 'labels', 'editors',
3515
+ 'datePickers',
3516
+ 'textAreas',
3517
+ 'files',
3518
+ 'phones',
3519
+ 'numbers',
3520
+ 'customComponent','modalTitle','class','successMessage'],
3521
+ emits: ['success'],
3522
+ setup(__props, { emit }) {
3523
+
3524
+ const props = __props;
3525
+
3526
+
3527
+
3528
+ const formProps = ref(props);
3529
+ let btnClass=props.class;
3530
+ const modalId = 'rand' + (Math.random() + 1).toString(36).substring(2);
3531
+ const success = (res)=>{
3532
+ emit('success',res);
3533
+ };
3534
+ delete formProps.class;
3535
+
3477
3536
  return (_ctx, _cache) => {
3478
3537
  return (openBlock(), createElementBlock(Fragment, null, [
3479
3538
  createElementVNode("a", {
@@ -3483,12 +3542,12 @@ return (_ctx, _cache) => {
3483
3542
  }, [
3484
3543
  renderSlot(_ctx.$slots, "default")
3485
3544
  ], 10 /* CLASS, PROPS */, _hoisted_1$a),
3486
- createVNode(script$c, {
3545
+ createVNode(script$d, {
3487
3546
  "modal-id": modalId,
3488
3547
  "modal-title": __props.modalTitle
3489
3548
  }, {
3490
3549
  default: withCtx(() => [
3491
- createVNode(script$l, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3550
+ createVNode(script$f, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
3492
3551
  ]),
3493
3552
  _: 1 /* STABLE */
3494
3553
  }, 8 /* PROPS */, ["modal-title"])
@@ -3498,7 +3557,7 @@ return (_ctx, _cache) => {
3498
3557
 
3499
3558
  };
3500
3559
 
3501
- script$b.__file = "src/lib/components/ShModalForm.vue";
3560
+ script$b.__file = "src/lib/components/ShModalFormAuto.vue";
3502
3561
 
3503
3562
  var script$a = {
3504
3563
  name: 'ShCanvas',
@@ -5392,12 +5451,12 @@ return (_ctx, _cache) => {
5392
5451
  ]
5393
5452
  }
5394
5453
  }),
5395
- createVNode(script$c, {
5454
+ createVNode(script$d, {
5396
5455
  "modal-id": "sh-department_modal",
5397
5456
  "modal-title": "Department Form"
5398
5457
  }, {
5399
5458
  default: withCtx(() => [
5400
- createVNode(script$l, {
5459
+ createVNode(script$m, {
5401
5460
  "success-callback": "departmentAdded",
5402
5461
  onDepartmentAdded: departmentAdded,
5403
5462
  action: "admin/departments/store",
@@ -5551,12 +5610,12 @@ return (_ctx, _cache) => {
5551
5610
  headers: ['id',showModule,'created_at'],
5552
5611
  "end-point": 'admin/departments/department/list-modules/' + id.value
5553
5612
  }, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
5554
- createVNode(script$c, {
5613
+ createVNode(script$d, {
5555
5614
  "modal-id": "addModule",
5556
5615
  "modal-title": "Add Module Department"
5557
5616
  }, {
5558
5617
  default: withCtx(() => [
5559
- createVNode(script$l, {
5618
+ createVNode(script$m, {
5560
5619
  "reload-select-items": unref(reload),
5561
5620
  "success-callback": moduleAdded,
5562
5621
  "fill-selects": {
@@ -5693,7 +5752,7 @@ return (_ctx, _cache) => {
5693
5752
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
5694
5753
  (section.value === 'login')
5695
5754
  ? (openBlock(), createElementBlock("div", _hoisted_2, [
5696
- createVNode(script$l, {
5755
+ createVNode(script$m, {
5697
5756
  class: "sh-login-form",
5698
5757
  fields: ['email','password'],
5699
5758
  "action-label": "Login",
@@ -5718,7 +5777,7 @@ return (_ctx, _cache) => {
5718
5777
  (unref(registerSubTitle))
5719
5778
  ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
5720
5779
  : createCommentVNode("v-if", true),
5721
- createVNode(script$l, {
5780
+ createVNode(script$m, {
5722
5781
  class: "sh-login-form",
5723
5782
  fields: unref(registrationFields),
5724
5783
  "action-label": "Sign Up",
@@ -5765,7 +5824,7 @@ const ShFrontend = {
5765
5824
  const registerTitle = options.registerTitle ?? 'Create a new account';
5766
5825
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
5767
5826
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
5768
- options.formTextInput ?? script$i;
5827
+ options.formTextInput ?? script$j;
5769
5828
  const loginUrl = options.loginUrl ?? `/login`;
5770
5829
  const redirectLogin = options.redirectLogin ?? `/`;
5771
5830
  const redirectRegister = options.redirectRegister ?? `/`;
@@ -5810,4 +5869,4 @@ const ShFrontend = {
5810
5869
  }
5811
5870
  };
5812
5871
 
5813
- export { countries as Countries, script$3 as ManagePermissions, script$e as ShAutoForm, script$a as ShCanvas, script$8 as ShConfirmAction, script$d as ShDropDownForm, script$4 as ShDynamicTabs, script$l as ShForm, ShFrontend, script$c as ShModal, script$b as ShModalForm, script$o as ShPhone, script$7 as ShSilentAction, script$6 as ShTable, script$5 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
5872
+ export { countries as Countries, script$3 as ManagePermissions, script$f as ShAutoForm, script$a as ShCanvas, script$8 as ShConfirmAction, script$e as ShDropDownForm, script$4 as ShDynamicTabs, script$m as ShForm, ShFrontend, script$d as ShModal, script$c as ShModalForm, script$b as ShModalFormAuto, script$p as ShPhone, script$7 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.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",