@iankibetsh/shframework 4.4.1 → 4.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.js CHANGED
@@ -1928,7 +1928,7 @@ const countries = [
1928
1928
  }
1929
1929
  ];
1930
1930
 
1931
- var script$v = {
1931
+ var script$w = {
1932
1932
  name: 'PhoneInput',
1933
1933
  props: ['modelValue', 'country_code'],
1934
1934
  data () {
@@ -2041,8 +2041,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2041
2041
  ]))
2042
2042
  }
2043
2043
 
2044
- script$v.render = render$3;
2045
- script$v.__file = "src/lib/components/form-components/PhoneInput.vue";
2044
+ script$w.render = render$3;
2045
+ script$w.__file = "src/lib/components/form-components/PhoneInput.vue";
2046
2046
 
2047
2047
  const _hoisted_1$n = {
2048
2048
  key: 0,
@@ -2065,7 +2065,7 @@ const _hoisted_10$6 = {
2065
2065
  };
2066
2066
 
2067
2067
 
2068
- var script$u = {
2068
+ var script$v = {
2069
2069
  __name: 'ShSuggest',
2070
2070
  props: ['data','allowMultiple','url','modelValue','optionTemplate'],
2071
2071
  emits: ['update:modelValue'],
@@ -2151,7 +2151,7 @@ const fetchRemoteData = ()=>{
2151
2151
  };
2152
2152
  shApis.doGet(props.url, data).then(res => {
2153
2153
  suggestions.value = res.data.data ?? res.data;
2154
- initializeExisting();
2154
+ initializeExisting(props.modelValue);
2155
2155
  }).catch(res => {
2156
2156
  console.log(res);
2157
2157
  });
@@ -2170,12 +2170,11 @@ const hideDropDown = ()=>{
2170
2170
  }
2171
2171
  };
2172
2172
 
2173
- const initializeExisting = ()=>{
2174
- console.log(props);
2175
- if(props.modelValue && suggestions.value){
2173
+ const initializeExisting = (currentValue)=>{
2174
+ if(currentValue && suggestions.value){
2176
2175
  if(props.allowMultiple){
2177
2176
  let selected = [];
2178
- props.modelValue.forEach(id=>{
2177
+ currentValue.forEach(id=>{
2179
2178
  let found = suggestions.value.find(sgt=>{
2180
2179
  return sgt.id === id
2181
2180
  });
@@ -2186,7 +2185,7 @@ const initializeExisting = ()=>{
2186
2185
  selectedSuggestions.value = selected;
2187
2186
  } else {
2188
2187
  let found = suggestions.value.find(sgt=>{
2189
- return sgt.id === props.modelValue
2188
+ return sgt.id === currentValue
2190
2189
  });
2191
2190
  if(found){
2192
2191
  selectedSuggestions.value = [found];
@@ -2194,6 +2193,11 @@ const initializeExisting = ()=>{
2194
2193
  }
2195
2194
  }
2196
2195
  };
2196
+ vue.watch(()=>props.modelValue, (newValue)=>{
2197
+ if(newValue) {
2198
+ initializeExisting(newValue);
2199
+ }
2200
+ });
2197
2201
 
2198
2202
  return (_ctx, _cache) => {
2199
2203
  return (vue.unref(id))
@@ -2266,15 +2270,15 @@ return (_ctx, _cache) => {
2266
2270
 
2267
2271
  };
2268
2272
 
2269
- script$u.__scopeId = "data-v-71cc9569";
2270
- script$u.__file = "src/lib/components/form-components/ShSuggest.vue";
2273
+ script$v.__scopeId = "data-v-71cc9569";
2274
+ script$v.__file = "src/lib/components/form-components/ShSuggest.vue";
2271
2275
 
2272
- var script$t = {
2276
+ var script$u = {
2273
2277
  name: 'ShForm',
2274
2278
  components: {
2275
- PhoneInput: script$v,
2276
- ShSuggest: script$u,
2277
- ShPhone: script$v
2279
+ PhoneInput: script$w,
2280
+ ShSuggest: script$v,
2281
+ ShPhone: script$w
2278
2282
  },
2279
2283
  props: [
2280
2284
  'action',
@@ -2867,10 +2871,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2867
2871
  ], 64 /* STABLE_FRAGMENT */))
2868
2872
  }
2869
2873
 
2870
- script$t.render = render$2;
2871
- script$t.__file = "src/lib/components/ShForm.vue";
2874
+ script$u.render = render$2;
2875
+ script$u.__file = "src/lib/components/ShForm.vue";
2872
2876
 
2873
- var script$s = {
2877
+ var script$t = {
2874
2878
  __name: 'EmailInput',
2875
2879
  props: ['modelValue','label'],
2876
2880
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2908,12 +2912,12 @@ return (_ctx, _cache) => {
2908
2912
 
2909
2913
  };
2910
2914
 
2911
- script$s.__file = "src/lib/components/form-components/EmailInput.vue";
2915
+ script$t.__file = "src/lib/components/form-components/EmailInput.vue";
2912
2916
 
2913
2917
  const _hoisted_1$l = ["min", "max"];
2914
2918
 
2915
2919
 
2916
- var script$r = {
2920
+ var script$s = {
2917
2921
  __name: 'NumberInput',
2918
2922
  props: ['modelValue','label','min','max'],
2919
2923
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2953,9 +2957,9 @@ return (_ctx, _cache) => {
2953
2957
 
2954
2958
  };
2955
2959
 
2956
- script$r.__file = "src/lib/components/form-components/NumberInput.vue";
2960
+ script$s.__file = "src/lib/components/form-components/NumberInput.vue";
2957
2961
 
2958
- var script$q = {
2962
+ var script$r = {
2959
2963
  __name: 'TextInput',
2960
2964
  props: ['modelValue','label','isInvalid'],
2961
2965
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2995,9 +2999,9 @@ return (_ctx, _cache) => {
2995
2999
 
2996
3000
  };
2997
3001
 
2998
- script$q.__file = "src/lib/components/form-components/TextInput.vue";
3002
+ script$r.__file = "src/lib/components/form-components/TextInput.vue";
2999
3003
 
3000
- var script$p = {
3004
+ var script$q = {
3001
3005
  __name: 'TextAreaInput',
3002
3006
  props: ['modelValue','label'],
3003
3007
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3035,12 +3039,12 @@ return (_ctx, _cache) => {
3035
3039
 
3036
3040
  };
3037
3041
 
3038
- script$p.__file = "src/lib/components/form-components/TextAreaInput.vue";
3042
+ script$q.__file = "src/lib/components/form-components/TextAreaInput.vue";
3039
3043
 
3040
3044
  const _hoisted_1$k = ["value"];
3041
3045
 
3042
3046
 
3043
- var script$o = {
3047
+ var script$p = {
3044
3048
  __name: 'SelectInput',
3045
3049
  props: ['modelValue','label','url','required','options','dataUrl','data'],
3046
3050
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3105,9 +3109,9 @@ return (_ctx, _cache) => {
3105
3109
 
3106
3110
  };
3107
3111
 
3108
- script$o.__file = "src/lib/components/form-components/SelectInput.vue";
3112
+ script$p.__file = "src/lib/components/form-components/SelectInput.vue";
3109
3113
 
3110
- var script$n = {
3114
+ var script$o = {
3111
3115
  __name: 'PasswordInput',
3112
3116
  props: ['modelValue','label'],
3113
3117
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3141,7 +3145,49 @@ return (_ctx, _cache) => {
3141
3145
 
3142
3146
  };
3143
3147
 
3144
- script$n.__file = "src/lib/components/form-components/PasswordInput.vue";
3148
+ script$o.__file = "src/lib/components/form-components/PasswordInput.vue";
3149
+
3150
+ var script$n = {
3151
+ __name: 'DateInput',
3152
+ props: ['modelValue','label','isInvalid'],
3153
+ emits: ['update:modelValue','clearValidationErrors'],
3154
+ setup(__props, { emit: __emit }) {
3155
+
3156
+ const props = __props;
3157
+ const emit = __emit;
3158
+ const inputModel = vue.ref(null);
3159
+
3160
+ const modelValueUpdated = (e) => {
3161
+ emit('clearValidationErrors');
3162
+ emit('update:modelValue',inputModel);
3163
+ };
3164
+ vue.onMounted(()=>{
3165
+ props.modelValue && (inputModel.value = props.modelValue);
3166
+ });
3167
+
3168
+ vue.watch(()=>props.modelValue, (newValue)=>{
3169
+ if(newValue) {
3170
+ inputModel.value = newValue;
3171
+ }
3172
+ });
3173
+
3174
+
3175
+ return (_ctx, _cache) => {
3176
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3177
+ type: "datetime-local",
3178
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
3179
+ onChange: modelValueUpdated,
3180
+ onKeydown: modelValueUpdated,
3181
+ onUpdated: modelValueUpdated
3182
+ }, null, 544 /* NEED_HYDRATION, NEED_PATCH */)), [
3183
+ [vue.vModelText, inputModel.value]
3184
+ ])
3185
+ }
3186
+ }
3187
+
3188
+ };
3189
+
3190
+ script$n.__file = "src/lib/components/form-components/DateInput.vue";
3145
3191
 
3146
3192
  const _hoisted_1$j = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3147
3193
  const _hoisted_2$b = ["onUpdate:modelValue"];
@@ -3203,17 +3249,18 @@ const getFieldComponent = (fieldObj) => {
3203
3249
  const field = fieldObj.field ?? fieldObj.name;
3204
3250
  const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
3205
3251
  const defaultNumbers = ['age'];
3252
+ const defaultDates = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
3206
3253
  const passwords = ['password', 'password_confirmation', 'pin'];
3207
3254
  const defaultPhones = ['phone'];
3208
3255
  const defaultEmails = ['email'];
3209
3256
  const formComponents = vue.inject('formComponents');
3210
- const TextComponent = formComponents.text ?? script$q;
3211
- const TextAreaComponent = formComponents.textArea ?? script$p;
3212
- const EmailComponent = formComponents.email ?? script$s;
3213
- const PhoneComponent = formComponents.phone ?? script$v;
3214
- const NumberComponent = formComponents.number ?? script$r;
3215
- const SelectComponent = formComponents.select ?? script$o;
3216
- const PasswordComponent = formComponents.password ?? script$n;
3257
+ const TextComponent = formComponents.text ?? script$r;
3258
+ const TextAreaComponent = formComponents.textArea ?? script$q;
3259
+ const EmailComponent = formComponents.email ?? script$t;
3260
+ const PhoneComponent = formComponents.phone ?? script$w;
3261
+ const NumberComponent = formComponents.number ?? script$s;
3262
+ const SelectComponent = formComponents.select ?? script$p;
3263
+ const PasswordComponent = formComponents.password ?? script$o;
3217
3264
  if (props.customComponents && props.customComponents[field]) {
3218
3265
  return props.customComponents[field]
3219
3266
  }
@@ -3231,28 +3278,28 @@ const getFieldComponent = (fieldObj) => {
3231
3278
 
3232
3279
  if (fieldObj.type) {
3233
3280
  if (fieldObj.type === 'suggest' || fieldObj.type === 'suggests') {
3234
- return script$u
3281
+ return script$v
3235
3282
  }
3236
3283
  return fieldObj.type === 'number' ? NumberComponent : fieldObj.type === 'textarea' ? TextAreaComponent : fieldObj.type === 'email' ? EmailComponent : fieldObj.type === 'phone' ? PhoneComponent : fieldObj.type === 'password' ? PasswordComponent : fieldObj.type === 'select' ? SelectComponent : TextComponent
3237
3284
  } else if (passwords.includes(field)) {
3238
3285
  return PasswordComponent
3239
3286
  } else if ((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)) {
3240
- return formComponents.textArea ?? script$p
3287
+ return formComponents.textArea ?? script$q
3241
3288
  } else if ((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)) {
3242
- return formComponents.email ?? script$s
3289
+ return formComponents.email ?? script$t
3243
3290
  } else if ((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)) {
3244
- return formComponents.phone ?? script$v
3291
+ return formComponents.phone ?? script$w
3245
3292
  } else if ((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)) {
3246
- return formComponents.number ?? script$r
3293
+ return formComponents.number ?? script$s
3247
3294
  }
3248
3295
  // else
3249
3296
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
3250
3297
  // return formComponents.select ?? SelectInput
3251
3298
  // } else
3252
- // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3253
- // return formComponents.date ?? DateInput
3254
- // }
3255
- return formComponents.text ?? script$q
3299
+ if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3300
+ return formComponents.date ?? script$n
3301
+ }
3302
+ return formComponents.text ?? script$r
3256
3303
  };
3257
3304
  const shFormElementClasses = vue.ref(null);
3258
3305
  shFormElementClasses.value = vue.inject('shFormElementClasses');
@@ -3544,7 +3591,7 @@ return (_ctx, _cache) => {
3544
3591
  class: "dropdown-menu px-2 py-1",
3545
3592
  "aria-labelledby": dropdownId
3546
3593
  }, [
3547
- vue.createVNode(script$t, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3594
+ vue.createVNode(script$u, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3548
3595
  ])
3549
3596
  ])
3550
3597
  ], 64 /* STABLE_FRAGMENT */))
@@ -6359,7 +6406,7 @@ return (_ctx, _cache) => {
6359
6406
  "modal-title": "Department Form"
6360
6407
  }, {
6361
6408
  default: vue.withCtx(() => [
6362
- vue.createVNode(script$t, {
6409
+ vue.createVNode(script$u, {
6363
6410
  "success-callback": "departmentAdded",
6364
6411
  "current-data": department.value,
6365
6412
  onDepartmentAdded: departmentAdded,
@@ -6519,7 +6566,7 @@ return (_ctx, _cache) => {
6519
6566
  "modal-title": "Add Module Department"
6520
6567
  }, {
6521
6568
  default: vue.withCtx(() => [
6522
- vue.createVNode(script$t, {
6569
+ vue.createVNode(script$u, {
6523
6570
  "reload-select-items": vue.unref(reload),
6524
6571
  "success-callback": moduleAdded,
6525
6572
  "fill-selects": {
@@ -6656,7 +6703,7 @@ return (_ctx, _cache) => {
6656
6703
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
6657
6704
  (section.value === 'login')
6658
6705
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
6659
- vue.createVNode(script$t, {
6706
+ vue.createVNode(script$u, {
6660
6707
  class: "sh-login-form",
6661
6708
  fields: ['email','password'],
6662
6709
  "action-label": "Login",
@@ -6681,7 +6728,7 @@ return (_ctx, _cache) => {
6681
6728
  (vue.unref(registerSubTitle))
6682
6729
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, vue.toDisplayString(vue.unref(registerSubTitle)), 1 /* TEXT */))
6683
6730
  : vue.createCommentVNode("v-if", true),
6684
- vue.createVNode(script$t, {
6731
+ vue.createVNode(script$u, {
6685
6732
  class: "sh-login-form",
6686
6733
  fields: vue.unref(registrationFields),
6687
6734
  "action-label": "Sign Up",
@@ -6728,7 +6775,7 @@ const ShFrontend = {
6728
6775
  const registerTitle = options.registerTitle ?? 'Create a new account';
6729
6776
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
6730
6777
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
6731
- options.formTextInput ?? script$q;
6778
+ options.formTextInput ?? script$r;
6732
6779
  const loginUrl = options.loginUrl ?? `/login`;
6733
6780
  const redirectLogin = options.redirectLogin ?? `/`;
6734
6781
  const redirectRegister = options.redirectRegister ?? `/`;
@@ -6796,18 +6843,18 @@ exports.ShCanvasBtn = script$7;
6796
6843
  exports.ShConfirmAction = script$e;
6797
6844
  exports.ShDropDownForm = script$l;
6798
6845
  exports.ShDynamicTabs = script$9;
6799
- exports.ShForm = script$t;
6846
+ exports.ShForm = script$u;
6800
6847
  exports.ShFrontend = ShFrontend;
6801
6848
  exports.ShModal = script$k;
6802
6849
  exports.ShModalBtn = script$8;
6803
6850
  exports.ShModalForm = script$j;
6804
6851
  exports.ShModalFormAuto = script$i;
6805
- exports.ShPhone = script$v;
6852
+ exports.ShPhone = script$w;
6806
6853
  exports.ShQueryPopups = script$3;
6807
6854
  exports.ShRange = script$c;
6808
6855
  exports.ShRoutePopups = script$5;
6809
6856
  exports.ShSilentAction = script$d;
6810
- exports.ShSuggest = script$u;
6857
+ exports.ShSuggest = script$v;
6811
6858
  exports.ShTable = script$b;
6812
6859
  exports.ShTabs = script$a;
6813
6860
  exports.shApis = shApis;
package/dist/library.mjs CHANGED
@@ -3,7 +3,7 @@ import moment from 'moment';
3
3
  import Swal from 'sweetalert2';
4
4
  import { Modal, Offcanvas } from 'bootstrap';
5
5
  import NProgress from 'nprogress';
6
- import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, unref, createBlock, resolveDynamicComponent, normalizeClass, resolveComponent, watch, inject, mergeProps, normalizeStyle, renderSlot, createVNode, normalizeProps, guardReactiveProps, withCtx, vModelCheckbox, shallowRef, pushScopeId, popScopeId, markRaw, computed, isRef } from 'vue';
6
+ import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, watch, unref, createBlock, resolveDynamicComponent, normalizeClass, resolveComponent, inject, mergeProps, normalizeStyle, renderSlot, createVNode, normalizeProps, guardReactiveProps, withCtx, vModelCheckbox, shallowRef, pushScopeId, popScopeId, markRaw, computed, isRef } from 'vue';
7
7
  import _ from 'lodash';
8
8
  import { defineStore, storeToRefs } from 'pinia';
9
9
  import { useRoute, useRouter } from 'vue-router';
@@ -1916,7 +1916,7 @@ const countries = [
1916
1916
  }
1917
1917
  ];
1918
1918
 
1919
- var script$v = {
1919
+ var script$w = {
1920
1920
  name: 'PhoneInput',
1921
1921
  props: ['modelValue', 'country_code'],
1922
1922
  data () {
@@ -2029,8 +2029,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2029
2029
  ]))
2030
2030
  }
2031
2031
 
2032
- script$v.render = render$3;
2033
- script$v.__file = "src/lib/components/form-components/PhoneInput.vue";
2032
+ script$w.render = render$3;
2033
+ script$w.__file = "src/lib/components/form-components/PhoneInput.vue";
2034
2034
 
2035
2035
  const _hoisted_1$n = {
2036
2036
  key: 0,
@@ -2053,7 +2053,7 @@ const _hoisted_10$6 = {
2053
2053
  };
2054
2054
 
2055
2055
 
2056
- var script$u = {
2056
+ var script$v = {
2057
2057
  __name: 'ShSuggest',
2058
2058
  props: ['data','allowMultiple','url','modelValue','optionTemplate'],
2059
2059
  emits: ['update:modelValue'],
@@ -2139,7 +2139,7 @@ const fetchRemoteData = ()=>{
2139
2139
  };
2140
2140
  shApis.doGet(props.url, data).then(res => {
2141
2141
  suggestions.value = res.data.data ?? res.data;
2142
- initializeExisting();
2142
+ initializeExisting(props.modelValue);
2143
2143
  }).catch(res => {
2144
2144
  console.log(res);
2145
2145
  });
@@ -2158,12 +2158,11 @@ const hideDropDown = ()=>{
2158
2158
  }
2159
2159
  };
2160
2160
 
2161
- const initializeExisting = ()=>{
2162
- console.log(props);
2163
- if(props.modelValue && suggestions.value){
2161
+ const initializeExisting = (currentValue)=>{
2162
+ if(currentValue && suggestions.value){
2164
2163
  if(props.allowMultiple){
2165
2164
  let selected = [];
2166
- props.modelValue.forEach(id=>{
2165
+ currentValue.forEach(id=>{
2167
2166
  let found = suggestions.value.find(sgt=>{
2168
2167
  return sgt.id === id
2169
2168
  });
@@ -2174,7 +2173,7 @@ const initializeExisting = ()=>{
2174
2173
  selectedSuggestions.value = selected;
2175
2174
  } else {
2176
2175
  let found = suggestions.value.find(sgt=>{
2177
- return sgt.id === props.modelValue
2176
+ return sgt.id === currentValue
2178
2177
  });
2179
2178
  if(found){
2180
2179
  selectedSuggestions.value = [found];
@@ -2182,6 +2181,11 @@ const initializeExisting = ()=>{
2182
2181
  }
2183
2182
  }
2184
2183
  };
2184
+ watch(()=>props.modelValue, (newValue)=>{
2185
+ if(newValue) {
2186
+ initializeExisting(newValue);
2187
+ }
2188
+ });
2185
2189
 
2186
2190
  return (_ctx, _cache) => {
2187
2191
  return (unref(id))
@@ -2254,15 +2258,15 @@ return (_ctx, _cache) => {
2254
2258
 
2255
2259
  };
2256
2260
 
2257
- script$u.__scopeId = "data-v-71cc9569";
2258
- script$u.__file = "src/lib/components/form-components/ShSuggest.vue";
2261
+ script$v.__scopeId = "data-v-71cc9569";
2262
+ script$v.__file = "src/lib/components/form-components/ShSuggest.vue";
2259
2263
 
2260
- var script$t = {
2264
+ var script$u = {
2261
2265
  name: 'ShForm',
2262
2266
  components: {
2263
- PhoneInput: script$v,
2264
- ShSuggest: script$u,
2265
- ShPhone: script$v
2267
+ PhoneInput: script$w,
2268
+ ShSuggest: script$v,
2269
+ ShPhone: script$w
2266
2270
  },
2267
2271
  props: [
2268
2272
  'action',
@@ -2855,10 +2859,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2855
2859
  ], 64 /* STABLE_FRAGMENT */))
2856
2860
  }
2857
2861
 
2858
- script$t.render = render$2;
2859
- script$t.__file = "src/lib/components/ShForm.vue";
2862
+ script$u.render = render$2;
2863
+ script$u.__file = "src/lib/components/ShForm.vue";
2860
2864
 
2861
- var script$s = {
2865
+ var script$t = {
2862
2866
  __name: 'EmailInput',
2863
2867
  props: ['modelValue','label'],
2864
2868
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2896,12 +2900,12 @@ return (_ctx, _cache) => {
2896
2900
 
2897
2901
  };
2898
2902
 
2899
- script$s.__file = "src/lib/components/form-components/EmailInput.vue";
2903
+ script$t.__file = "src/lib/components/form-components/EmailInput.vue";
2900
2904
 
2901
2905
  const _hoisted_1$l = ["min", "max"];
2902
2906
 
2903
2907
 
2904
- var script$r = {
2908
+ var script$s = {
2905
2909
  __name: 'NumberInput',
2906
2910
  props: ['modelValue','label','min','max'],
2907
2911
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2941,9 +2945,9 @@ return (_ctx, _cache) => {
2941
2945
 
2942
2946
  };
2943
2947
 
2944
- script$r.__file = "src/lib/components/form-components/NumberInput.vue";
2948
+ script$s.__file = "src/lib/components/form-components/NumberInput.vue";
2945
2949
 
2946
- var script$q = {
2950
+ var script$r = {
2947
2951
  __name: 'TextInput',
2948
2952
  props: ['modelValue','label','isInvalid'],
2949
2953
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2983,9 +2987,9 @@ return (_ctx, _cache) => {
2983
2987
 
2984
2988
  };
2985
2989
 
2986
- script$q.__file = "src/lib/components/form-components/TextInput.vue";
2990
+ script$r.__file = "src/lib/components/form-components/TextInput.vue";
2987
2991
 
2988
- var script$p = {
2992
+ var script$q = {
2989
2993
  __name: 'TextAreaInput',
2990
2994
  props: ['modelValue','label'],
2991
2995
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3023,12 +3027,12 @@ return (_ctx, _cache) => {
3023
3027
 
3024
3028
  };
3025
3029
 
3026
- script$p.__file = "src/lib/components/form-components/TextAreaInput.vue";
3030
+ script$q.__file = "src/lib/components/form-components/TextAreaInput.vue";
3027
3031
 
3028
3032
  const _hoisted_1$k = ["value"];
3029
3033
 
3030
3034
 
3031
- var script$o = {
3035
+ var script$p = {
3032
3036
  __name: 'SelectInput',
3033
3037
  props: ['modelValue','label','url','required','options','dataUrl','data'],
3034
3038
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3093,9 +3097,9 @@ return (_ctx, _cache) => {
3093
3097
 
3094
3098
  };
3095
3099
 
3096
- script$o.__file = "src/lib/components/form-components/SelectInput.vue";
3100
+ script$p.__file = "src/lib/components/form-components/SelectInput.vue";
3097
3101
 
3098
- var script$n = {
3102
+ var script$o = {
3099
3103
  __name: 'PasswordInput',
3100
3104
  props: ['modelValue','label'],
3101
3105
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3129,7 +3133,49 @@ return (_ctx, _cache) => {
3129
3133
 
3130
3134
  };
3131
3135
 
3132
- script$n.__file = "src/lib/components/form-components/PasswordInput.vue";
3136
+ script$o.__file = "src/lib/components/form-components/PasswordInput.vue";
3137
+
3138
+ var script$n = {
3139
+ __name: 'DateInput',
3140
+ props: ['modelValue','label','isInvalid'],
3141
+ emits: ['update:modelValue','clearValidationErrors'],
3142
+ setup(__props, { emit: __emit }) {
3143
+
3144
+ const props = __props;
3145
+ const emit = __emit;
3146
+ const inputModel = ref(null);
3147
+
3148
+ const modelValueUpdated = (e) => {
3149
+ emit('clearValidationErrors');
3150
+ emit('update:modelValue',inputModel);
3151
+ };
3152
+ onMounted(()=>{
3153
+ props.modelValue && (inputModel.value = props.modelValue);
3154
+ });
3155
+
3156
+ watch(()=>props.modelValue, (newValue)=>{
3157
+ if(newValue) {
3158
+ inputModel.value = newValue;
3159
+ }
3160
+ });
3161
+
3162
+
3163
+ return (_ctx, _cache) => {
3164
+ return withDirectives((openBlock(), createElementBlock("input", {
3165
+ type: "datetime-local",
3166
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
3167
+ onChange: modelValueUpdated,
3168
+ onKeydown: modelValueUpdated,
3169
+ onUpdated: modelValueUpdated
3170
+ }, null, 544 /* NEED_HYDRATION, NEED_PATCH */)), [
3171
+ [vModelText, inputModel.value]
3172
+ ])
3173
+ }
3174
+ }
3175
+
3176
+ };
3177
+
3178
+ script$n.__file = "src/lib/components/form-components/DateInput.vue";
3133
3179
 
3134
3180
  const _hoisted_1$j = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
3135
3181
  const _hoisted_2$b = ["onUpdate:modelValue"];
@@ -3191,17 +3237,18 @@ const getFieldComponent = (fieldObj) => {
3191
3237
  const field = fieldObj.field ?? fieldObj.name;
3192
3238
  const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
3193
3239
  const defaultNumbers = ['age'];
3240
+ const defaultDates = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
3194
3241
  const passwords = ['password', 'password_confirmation', 'pin'];
3195
3242
  const defaultPhones = ['phone'];
3196
3243
  const defaultEmails = ['email'];
3197
3244
  const formComponents = inject('formComponents');
3198
- const TextComponent = formComponents.text ?? script$q;
3199
- const TextAreaComponent = formComponents.textArea ?? script$p;
3200
- const EmailComponent = formComponents.email ?? script$s;
3201
- const PhoneComponent = formComponents.phone ?? script$v;
3202
- const NumberComponent = formComponents.number ?? script$r;
3203
- const SelectComponent = formComponents.select ?? script$o;
3204
- const PasswordComponent = formComponents.password ?? script$n;
3245
+ const TextComponent = formComponents.text ?? script$r;
3246
+ const TextAreaComponent = formComponents.textArea ?? script$q;
3247
+ const EmailComponent = formComponents.email ?? script$t;
3248
+ const PhoneComponent = formComponents.phone ?? script$w;
3249
+ const NumberComponent = formComponents.number ?? script$s;
3250
+ const SelectComponent = formComponents.select ?? script$p;
3251
+ const PasswordComponent = formComponents.password ?? script$o;
3205
3252
  if (props.customComponents && props.customComponents[field]) {
3206
3253
  return props.customComponents[field]
3207
3254
  }
@@ -3219,28 +3266,28 @@ const getFieldComponent = (fieldObj) => {
3219
3266
 
3220
3267
  if (fieldObj.type) {
3221
3268
  if (fieldObj.type === 'suggest' || fieldObj.type === 'suggests') {
3222
- return script$u
3269
+ return script$v
3223
3270
  }
3224
3271
  return fieldObj.type === 'number' ? NumberComponent : fieldObj.type === 'textarea' ? TextAreaComponent : fieldObj.type === 'email' ? EmailComponent : fieldObj.type === 'phone' ? PhoneComponent : fieldObj.type === 'password' ? PasswordComponent : fieldObj.type === 'select' ? SelectComponent : TextComponent
3225
3272
  } else if (passwords.includes(field)) {
3226
3273
  return PasswordComponent
3227
3274
  } else if ((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)) {
3228
- return formComponents.textArea ?? script$p
3275
+ return formComponents.textArea ?? script$q
3229
3276
  } else if ((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)) {
3230
- return formComponents.email ?? script$s
3277
+ return formComponents.email ?? script$t
3231
3278
  } else if ((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)) {
3232
- return formComponents.phone ?? script$v
3279
+ return formComponents.phone ?? script$w
3233
3280
  } else if ((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)) {
3234
- return formComponents.number ?? script$r
3281
+ return formComponents.number ?? script$s
3235
3282
  }
3236
3283
  // else
3237
3284
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
3238
3285
  // return formComponents.select ?? SelectInput
3239
3286
  // } else
3240
- // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3241
- // return formComponents.date ?? DateInput
3242
- // }
3243
- return formComponents.text ?? script$q
3287
+ if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3288
+ return formComponents.date ?? script$n
3289
+ }
3290
+ return formComponents.text ?? script$r
3244
3291
  };
3245
3292
  const shFormElementClasses = ref(null);
3246
3293
  shFormElementClasses.value = inject('shFormElementClasses');
@@ -3532,7 +3579,7 @@ return (_ctx, _cache) => {
3532
3579
  class: "dropdown-menu px-2 py-1",
3533
3580
  "aria-labelledby": dropdownId
3534
3581
  }, [
3535
- createVNode(script$t, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3582
+ createVNode(script$u, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3536
3583
  ])
3537
3584
  ])
3538
3585
  ], 64 /* STABLE_FRAGMENT */))
@@ -6347,7 +6394,7 @@ return (_ctx, _cache) => {
6347
6394
  "modal-title": "Department Form"
6348
6395
  }, {
6349
6396
  default: withCtx(() => [
6350
- createVNode(script$t, {
6397
+ createVNode(script$u, {
6351
6398
  "success-callback": "departmentAdded",
6352
6399
  "current-data": department.value,
6353
6400
  onDepartmentAdded: departmentAdded,
@@ -6507,7 +6554,7 @@ return (_ctx, _cache) => {
6507
6554
  "modal-title": "Add Module Department"
6508
6555
  }, {
6509
6556
  default: withCtx(() => [
6510
- createVNode(script$t, {
6557
+ createVNode(script$u, {
6511
6558
  "reload-select-items": unref(reload),
6512
6559
  "success-callback": moduleAdded,
6513
6560
  "fill-selects": {
@@ -6644,7 +6691,7 @@ return (_ctx, _cache) => {
6644
6691
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
6645
6692
  (section.value === 'login')
6646
6693
  ? (openBlock(), createElementBlock("div", _hoisted_2, [
6647
- createVNode(script$t, {
6694
+ createVNode(script$u, {
6648
6695
  class: "sh-login-form",
6649
6696
  fields: ['email','password'],
6650
6697
  "action-label": "Login",
@@ -6669,7 +6716,7 @@ return (_ctx, _cache) => {
6669
6716
  (unref(registerSubTitle))
6670
6717
  ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
6671
6718
  : createCommentVNode("v-if", true),
6672
- createVNode(script$t, {
6719
+ createVNode(script$u, {
6673
6720
  class: "sh-login-form",
6674
6721
  fields: unref(registrationFields),
6675
6722
  "action-label": "Sign Up",
@@ -6716,7 +6763,7 @@ const ShFrontend = {
6716
6763
  const registerTitle = options.registerTitle ?? 'Create a new account';
6717
6764
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
6718
6765
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
6719
- options.formTextInput ?? script$q;
6766
+ options.formTextInput ?? script$r;
6720
6767
  const loginUrl = options.loginUrl ?? `/login`;
6721
6768
  const redirectLogin = options.redirectLogin ?? `/`;
6722
6769
  const redirectRegister = options.redirectRegister ?? `/`;
@@ -6776,4 +6823,4 @@ var shGql = {
6776
6823
  mutate
6777
6824
  };
6778
6825
 
6779
- export { countries as Countries, script$6 as ManagePermissions, script$m as ShAutoForm, script$h as ShCanvas, script$7 as ShCanvasBtn, script$e as ShConfirmAction, script$l as ShDropDownForm, script$9 as ShDynamicTabs, script$t as ShForm, ShFrontend, script$k as ShModal, script$8 as ShModalBtn, script$j as ShModalForm, script$i as ShModalFormAuto, script$v as ShPhone, script$3 as ShQueryPopups, script$c as ShRange, script$5 as ShRoutePopups, script$d as ShSilentAction, script$u as ShSuggest, script$b as ShTable, script$a as ShTabs, shApis, shGql, shRepo, ShStorage as shStorage, useAppStore, useUserStore };
6826
+ export { countries as Countries, script$6 as ManagePermissions, script$m as ShAutoForm, script$h as ShCanvas, script$7 as ShCanvasBtn, script$e as ShConfirmAction, script$l as ShDropDownForm, script$9 as ShDynamicTabs, script$u as ShForm, ShFrontend, script$k as ShModal, script$8 as ShModalBtn, script$j as ShModalForm, script$i as ShModalFormAuto, script$w as ShPhone, script$3 as ShQueryPopups, script$c as ShRange, script$5 as ShRoutePopups, script$d as ShSilentAction, script$v as ShSuggest, script$b as ShTable, script$a as ShTabs, shApis, shGql, shRepo, ShStorage as shStorage, useAppStore, useUserStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "4.4.1",
3
+ "version": "4.4.3",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",