@iankibetsh/shframework 4.4.0 → 4.4.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.
@@ -1,34 +1,34 @@
1
1
 
2
- .colored-toast.swal2-icon-success {
3
- background-color: #a5dc86 !important;
4
- }
5
-
6
- .colored-toast.swal2-icon-error {
7
- background-color: #f27474 !important;
8
- }
9
-
10
- .colored-toast.swal2-icon-warning {
11
- background-color: #f8bb86 !important;
12
- }
13
-
14
- .colored-toast.swal2-icon-info {
15
- background-color: #3fc3ee !important;
2
+ .sh-phone{
3
+ display: flex;
4
+ width: 100%;
5
+ align-items: center;
6
+ padding: 0 0.25rem;
16
7
  }
17
-
18
- .colored-toast.swal2-icon-question {
19
- background-color: #87adbd !important;
8
+ .phone-country{
9
+ width: 2rem;
10
+ border: none;
11
+ align-self: center;
12
+ outline: none !important;
13
+ padding: 0.4rem;
14
+ border-right: 1px solid #0003;
20
15
  }
21
-
22
- .colored-toast .swal2-title {
23
- color: white;
16
+ .phone-number{
17
+ width: calc(100% - 2.2rem);
18
+ border: none;
19
+ align-self: center;
20
+ outline: none;
21
+ margin-bottom: 0;
22
+ padding: 0.4rem;
24
23
  }
25
-
26
- .colored-toast .swal2-close {
27
- color: white;
24
+ .sh-phone img{
25
+ padding: 0.125rem;
26
+ width: 2rem;
27
+ height: 2rem;
28
28
  }
29
-
30
- .colored-toast .swal2-html-container {
31
- color: white;
29
+ .phone-number::placeholder{
30
+ font-weight: 300;
31
+ opacity: 0.5;
32
32
  }
33
33
 
34
34
  .permissions-main {
@@ -63,36 +63,36 @@
63
63
  flex-grow: 1;
64
64
  }
65
65
 
66
- .sh-phone{
67
- display: flex;
68
- width: 100%;
69
- align-items: center;
70
- padding: 0 0.25rem;
66
+ .colored-toast.swal2-icon-success {
67
+ background-color: #a5dc86 !important;
71
68
  }
72
- .phone-country{
73
- width: 2rem;
74
- border: none;
75
- align-self: center;
76
- outline: none !important;
77
- padding: 0.4rem;
78
- border-right: 1px solid #0003;
69
+
70
+ .colored-toast.swal2-icon-error {
71
+ background-color: #f27474 !important;
79
72
  }
80
- .phone-number{
81
- width: calc(100% - 2.2rem);
82
- border: none;
83
- align-self: center;
84
- outline: none;
85
- margin-bottom: 0;
86
- padding: 0.4rem;
73
+
74
+ .colored-toast.swal2-icon-warning {
75
+ background-color: #f8bb86 !important;
87
76
  }
88
- .sh-phone img{
89
- padding: 0.125rem;
90
- width: 2rem;
91
- height: 2rem;
77
+
78
+ .colored-toast.swal2-icon-info {
79
+ background-color: #3fc3ee !important;
92
80
  }
93
- .phone-number::placeholder{
94
- font-weight: 300;
95
- opacity: 0.5;
81
+
82
+ .colored-toast.swal2-icon-question {
83
+ background-color: #87adbd !important;
84
+ }
85
+
86
+ .colored-toast .swal2-title {
87
+ color: white;
88
+ }
89
+
90
+ .colored-toast .swal2-close {
91
+ color: white;
92
+ }
93
+
94
+ .colored-toast .swal2-html-container {
95
+ color: white;
96
96
  }
97
97
 
98
98
  .sh-selected-item{
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'],
@@ -2266,15 +2266,15 @@ return (_ctx, _cache) => {
2266
2266
 
2267
2267
  };
2268
2268
 
2269
- script$u.__scopeId = "data-v-71cc9569";
2270
- script$u.__file = "src/lib/components/form-components/ShSuggest.vue";
2269
+ script$v.__scopeId = "data-v-71cc9569";
2270
+ script$v.__file = "src/lib/components/form-components/ShSuggest.vue";
2271
2271
 
2272
- var script$t = {
2272
+ var script$u = {
2273
2273
  name: 'ShForm',
2274
2274
  components: {
2275
- PhoneInput: script$v,
2276
- ShSuggest: script$u,
2277
- ShPhone: script$v
2275
+ PhoneInput: script$w,
2276
+ ShSuggest: script$v,
2277
+ ShPhone: script$w
2278
2278
  },
2279
2279
  props: [
2280
2280
  'action',
@@ -2867,10 +2867,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2867
2867
  ], 64 /* STABLE_FRAGMENT */))
2868
2868
  }
2869
2869
 
2870
- script$t.render = render$2;
2871
- script$t.__file = "src/lib/components/ShForm.vue";
2870
+ script$u.render = render$2;
2871
+ script$u.__file = "src/lib/components/ShForm.vue";
2872
2872
 
2873
- var script$s = {
2873
+ var script$t = {
2874
2874
  __name: 'EmailInput',
2875
2875
  props: ['modelValue','label'],
2876
2876
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2908,12 +2908,12 @@ return (_ctx, _cache) => {
2908
2908
 
2909
2909
  };
2910
2910
 
2911
- script$s.__file = "src/lib/components/form-components/EmailInput.vue";
2911
+ script$t.__file = "src/lib/components/form-components/EmailInput.vue";
2912
2912
 
2913
2913
  const _hoisted_1$l = ["min", "max"];
2914
2914
 
2915
2915
 
2916
- var script$r = {
2916
+ var script$s = {
2917
2917
  __name: 'NumberInput',
2918
2918
  props: ['modelValue','label','min','max'],
2919
2919
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2953,9 +2953,9 @@ return (_ctx, _cache) => {
2953
2953
 
2954
2954
  };
2955
2955
 
2956
- script$r.__file = "src/lib/components/form-components/NumberInput.vue";
2956
+ script$s.__file = "src/lib/components/form-components/NumberInput.vue";
2957
2957
 
2958
- var script$q = {
2958
+ var script$r = {
2959
2959
  __name: 'TextInput',
2960
2960
  props: ['modelValue','label','isInvalid'],
2961
2961
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2995,9 +2995,9 @@ return (_ctx, _cache) => {
2995
2995
 
2996
2996
  };
2997
2997
 
2998
- script$q.__file = "src/lib/components/form-components/TextInput.vue";
2998
+ script$r.__file = "src/lib/components/form-components/TextInput.vue";
2999
2999
 
3000
- var script$p = {
3000
+ var script$q = {
3001
3001
  __name: 'TextAreaInput',
3002
3002
  props: ['modelValue','label'],
3003
3003
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3035,12 +3035,12 @@ return (_ctx, _cache) => {
3035
3035
 
3036
3036
  };
3037
3037
 
3038
- script$p.__file = "src/lib/components/form-components/TextAreaInput.vue";
3038
+ script$q.__file = "src/lib/components/form-components/TextAreaInput.vue";
3039
3039
 
3040
3040
  const _hoisted_1$k = ["value"];
3041
3041
 
3042
3042
 
3043
- var script$o = {
3043
+ var script$p = {
3044
3044
  __name: 'SelectInput',
3045
3045
  props: ['modelValue','label','url','required','options','dataUrl','data'],
3046
3046
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3105,9 +3105,9 @@ return (_ctx, _cache) => {
3105
3105
 
3106
3106
  };
3107
3107
 
3108
- script$o.__file = "src/lib/components/form-components/SelectInput.vue";
3108
+ script$p.__file = "src/lib/components/form-components/SelectInput.vue";
3109
3109
 
3110
- var script$n = {
3110
+ var script$o = {
3111
3111
  __name: 'PasswordInput',
3112
3112
  props: ['modelValue','label'],
3113
3113
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3141,7 +3141,49 @@ return (_ctx, _cache) => {
3141
3141
 
3142
3142
  };
3143
3143
 
3144
- script$n.__file = "src/lib/components/form-components/PasswordInput.vue";
3144
+ script$o.__file = "src/lib/components/form-components/PasswordInput.vue";
3145
+
3146
+ var script$n = {
3147
+ __name: 'DateInput',
3148
+ props: ['modelValue','label','isInvalid'],
3149
+ emits: ['update:modelValue','clearValidationErrors'],
3150
+ setup(__props, { emit: __emit }) {
3151
+
3152
+ const props = __props;
3153
+ const emit = __emit;
3154
+ const inputModel = vue.ref(null);
3155
+
3156
+ const modelValueUpdated = (e) => {
3157
+ emit('clearValidationErrors');
3158
+ emit('update:modelValue',inputModel);
3159
+ };
3160
+ vue.onMounted(()=>{
3161
+ props.modelValue && (inputModel.value = props.modelValue);
3162
+ });
3163
+
3164
+ vue.watch(()=>props.modelValue, (newValue)=>{
3165
+ if(newValue) {
3166
+ inputModel.value = newValue;
3167
+ }
3168
+ });
3169
+
3170
+
3171
+ return (_ctx, _cache) => {
3172
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3173
+ type: "datetime-local",
3174
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
3175
+ onChange: modelValueUpdated,
3176
+ onKeydown: modelValueUpdated,
3177
+ onUpdated: modelValueUpdated
3178
+ }, null, 544 /* NEED_HYDRATION, NEED_PATCH */)), [
3179
+ [vue.vModelText, inputModel.value]
3180
+ ])
3181
+ }
3182
+ }
3183
+
3184
+ };
3185
+
3186
+ script$n.__file = "src/lib/components/form-components/DateInput.vue";
3145
3187
 
3146
3188
  const _hoisted_1$j = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
3147
3189
  const _hoisted_2$b = ["onUpdate:modelValue"];
@@ -3203,17 +3245,18 @@ const getFieldComponent = (fieldObj) => {
3203
3245
  const field = fieldObj.field ?? fieldObj.name;
3204
3246
  const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
3205
3247
  const defaultNumbers = ['age'];
3248
+ const defaultDates = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
3206
3249
  const passwords = ['password', 'password_confirmation', 'pin'];
3207
3250
  const defaultPhones = ['phone'];
3208
3251
  const defaultEmails = ['email'];
3209
3252
  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;
3253
+ const TextComponent = formComponents.text ?? script$r;
3254
+ const TextAreaComponent = formComponents.textArea ?? script$q;
3255
+ const EmailComponent = formComponents.email ?? script$t;
3256
+ const PhoneComponent = formComponents.phone ?? script$w;
3257
+ const NumberComponent = formComponents.number ?? script$s;
3258
+ const SelectComponent = formComponents.select ?? script$p;
3259
+ const PasswordComponent = formComponents.password ?? script$o;
3217
3260
  if (props.customComponents && props.customComponents[field]) {
3218
3261
  return props.customComponents[field]
3219
3262
  }
@@ -3231,28 +3274,28 @@ const getFieldComponent = (fieldObj) => {
3231
3274
 
3232
3275
  if (fieldObj.type) {
3233
3276
  if (fieldObj.type === 'suggest' || fieldObj.type === 'suggests') {
3234
- return script$u
3277
+ return script$v
3235
3278
  }
3236
3279
  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
3280
  } else if (passwords.includes(field)) {
3238
3281
  return PasswordComponent
3239
3282
  } else if ((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)) {
3240
- return formComponents.textArea ?? script$p
3283
+ return formComponents.textArea ?? script$q
3241
3284
  } else if ((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)) {
3242
- return formComponents.email ?? script$s
3285
+ return formComponents.email ?? script$t
3243
3286
  } else if ((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)) {
3244
- return formComponents.phone ?? script$v
3287
+ return formComponents.phone ?? script$w
3245
3288
  } else if ((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)) {
3246
- return formComponents.number ?? script$r
3289
+ return formComponents.number ?? script$s
3247
3290
  }
3248
3291
  // else
3249
3292
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
3250
3293
  // return formComponents.select ?? SelectInput
3251
3294
  // } else
3252
- // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3253
- // return formComponents.date ?? DateInput
3254
- // }
3255
- return formComponents.text ?? script$q
3295
+ if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3296
+ return formComponents.date ?? script$n
3297
+ }
3298
+ return formComponents.text ?? script$r
3256
3299
  };
3257
3300
  const shFormElementClasses = vue.ref(null);
3258
3301
  shFormElementClasses.value = vue.inject('shFormElementClasses');
@@ -3544,7 +3587,7 @@ return (_ctx, _cache) => {
3544
3587
  class: "dropdown-menu px-2 py-1",
3545
3588
  "aria-labelledby": dropdownId
3546
3589
  }, [
3547
- vue.createVNode(script$t, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3590
+ vue.createVNode(script$u, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3548
3591
  ])
3549
3592
  ])
3550
3593
  ], 64 /* STABLE_FRAGMENT */))
@@ -3645,6 +3688,7 @@ var script$j = {
3645
3688
  'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3646
3689
  'failedCallback', 'labels', 'editors',
3647
3690
  'datePickers',
3691
+ 'required',
3648
3692
  'textAreas',
3649
3693
  'files',
3650
3694
  'phones',
@@ -6358,7 +6402,7 @@ return (_ctx, _cache) => {
6358
6402
  "modal-title": "Department Form"
6359
6403
  }, {
6360
6404
  default: vue.withCtx(() => [
6361
- vue.createVNode(script$t, {
6405
+ vue.createVNode(script$u, {
6362
6406
  "success-callback": "departmentAdded",
6363
6407
  "current-data": department.value,
6364
6408
  onDepartmentAdded: departmentAdded,
@@ -6518,7 +6562,7 @@ return (_ctx, _cache) => {
6518
6562
  "modal-title": "Add Module Department"
6519
6563
  }, {
6520
6564
  default: vue.withCtx(() => [
6521
- vue.createVNode(script$t, {
6565
+ vue.createVNode(script$u, {
6522
6566
  "reload-select-items": vue.unref(reload),
6523
6567
  "success-callback": moduleAdded,
6524
6568
  "fill-selects": {
@@ -6655,7 +6699,7 @@ return (_ctx, _cache) => {
6655
6699
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
6656
6700
  (section.value === 'login')
6657
6701
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
6658
- vue.createVNode(script$t, {
6702
+ vue.createVNode(script$u, {
6659
6703
  class: "sh-login-form",
6660
6704
  fields: ['email','password'],
6661
6705
  "action-label": "Login",
@@ -6680,7 +6724,7 @@ return (_ctx, _cache) => {
6680
6724
  (vue.unref(registerSubTitle))
6681
6725
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, vue.toDisplayString(vue.unref(registerSubTitle)), 1 /* TEXT */))
6682
6726
  : vue.createCommentVNode("v-if", true),
6683
- vue.createVNode(script$t, {
6727
+ vue.createVNode(script$u, {
6684
6728
  class: "sh-login-form",
6685
6729
  fields: vue.unref(registrationFields),
6686
6730
  "action-label": "Sign Up",
@@ -6727,7 +6771,7 @@ const ShFrontend = {
6727
6771
  const registerTitle = options.registerTitle ?? 'Create a new account';
6728
6772
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
6729
6773
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
6730
- options.formTextInput ?? script$q;
6774
+ options.formTextInput ?? script$r;
6731
6775
  const loginUrl = options.loginUrl ?? `/login`;
6732
6776
  const redirectLogin = options.redirectLogin ?? `/`;
6733
6777
  const redirectRegister = options.redirectRegister ?? `/`;
@@ -6795,18 +6839,18 @@ exports.ShCanvasBtn = script$7;
6795
6839
  exports.ShConfirmAction = script$e;
6796
6840
  exports.ShDropDownForm = script$l;
6797
6841
  exports.ShDynamicTabs = script$9;
6798
- exports.ShForm = script$t;
6842
+ exports.ShForm = script$u;
6799
6843
  exports.ShFrontend = ShFrontend;
6800
6844
  exports.ShModal = script$k;
6801
6845
  exports.ShModalBtn = script$8;
6802
6846
  exports.ShModalForm = script$j;
6803
6847
  exports.ShModalFormAuto = script$i;
6804
- exports.ShPhone = script$v;
6848
+ exports.ShPhone = script$w;
6805
6849
  exports.ShQueryPopups = script$3;
6806
6850
  exports.ShRange = script$c;
6807
6851
  exports.ShRoutePopups = script$5;
6808
6852
  exports.ShSilentAction = script$d;
6809
- exports.ShSuggest = script$u;
6853
+ exports.ShSuggest = script$v;
6810
6854
  exports.ShTable = script$b;
6811
6855
  exports.ShTabs = script$a;
6812
6856
  exports.shApis = shApis;
package/dist/library.mjs CHANGED
@@ -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'],
@@ -2254,15 +2254,15 @@ return (_ctx, _cache) => {
2254
2254
 
2255
2255
  };
2256
2256
 
2257
- script$u.__scopeId = "data-v-71cc9569";
2258
- script$u.__file = "src/lib/components/form-components/ShSuggest.vue";
2257
+ script$v.__scopeId = "data-v-71cc9569";
2258
+ script$v.__file = "src/lib/components/form-components/ShSuggest.vue";
2259
2259
 
2260
- var script$t = {
2260
+ var script$u = {
2261
2261
  name: 'ShForm',
2262
2262
  components: {
2263
- PhoneInput: script$v,
2264
- ShSuggest: script$u,
2265
- ShPhone: script$v
2263
+ PhoneInput: script$w,
2264
+ ShSuggest: script$v,
2265
+ ShPhone: script$w
2266
2266
  },
2267
2267
  props: [
2268
2268
  'action',
@@ -2855,10 +2855,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2855
2855
  ], 64 /* STABLE_FRAGMENT */))
2856
2856
  }
2857
2857
 
2858
- script$t.render = render$2;
2859
- script$t.__file = "src/lib/components/ShForm.vue";
2858
+ script$u.render = render$2;
2859
+ script$u.__file = "src/lib/components/ShForm.vue";
2860
2860
 
2861
- var script$s = {
2861
+ var script$t = {
2862
2862
  __name: 'EmailInput',
2863
2863
  props: ['modelValue','label'],
2864
2864
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2896,12 +2896,12 @@ return (_ctx, _cache) => {
2896
2896
 
2897
2897
  };
2898
2898
 
2899
- script$s.__file = "src/lib/components/form-components/EmailInput.vue";
2899
+ script$t.__file = "src/lib/components/form-components/EmailInput.vue";
2900
2900
 
2901
2901
  const _hoisted_1$l = ["min", "max"];
2902
2902
 
2903
2903
 
2904
- var script$r = {
2904
+ var script$s = {
2905
2905
  __name: 'NumberInput',
2906
2906
  props: ['modelValue','label','min','max'],
2907
2907
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2941,9 +2941,9 @@ return (_ctx, _cache) => {
2941
2941
 
2942
2942
  };
2943
2943
 
2944
- script$r.__file = "src/lib/components/form-components/NumberInput.vue";
2944
+ script$s.__file = "src/lib/components/form-components/NumberInput.vue";
2945
2945
 
2946
- var script$q = {
2946
+ var script$r = {
2947
2947
  __name: 'TextInput',
2948
2948
  props: ['modelValue','label','isInvalid'],
2949
2949
  emits: ['update:modelValue','clearValidationErrors'],
@@ -2983,9 +2983,9 @@ return (_ctx, _cache) => {
2983
2983
 
2984
2984
  };
2985
2985
 
2986
- script$q.__file = "src/lib/components/form-components/TextInput.vue";
2986
+ script$r.__file = "src/lib/components/form-components/TextInput.vue";
2987
2987
 
2988
- var script$p = {
2988
+ var script$q = {
2989
2989
  __name: 'TextAreaInput',
2990
2990
  props: ['modelValue','label'],
2991
2991
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3023,12 +3023,12 @@ return (_ctx, _cache) => {
3023
3023
 
3024
3024
  };
3025
3025
 
3026
- script$p.__file = "src/lib/components/form-components/TextAreaInput.vue";
3026
+ script$q.__file = "src/lib/components/form-components/TextAreaInput.vue";
3027
3027
 
3028
3028
  const _hoisted_1$k = ["value"];
3029
3029
 
3030
3030
 
3031
- var script$o = {
3031
+ var script$p = {
3032
3032
  __name: 'SelectInput',
3033
3033
  props: ['modelValue','label','url','required','options','dataUrl','data'],
3034
3034
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3093,9 +3093,9 @@ return (_ctx, _cache) => {
3093
3093
 
3094
3094
  };
3095
3095
 
3096
- script$o.__file = "src/lib/components/form-components/SelectInput.vue";
3096
+ script$p.__file = "src/lib/components/form-components/SelectInput.vue";
3097
3097
 
3098
- var script$n = {
3098
+ var script$o = {
3099
3099
  __name: 'PasswordInput',
3100
3100
  props: ['modelValue','label'],
3101
3101
  emits: ['update:modelValue','clearValidationErrors'],
@@ -3129,7 +3129,49 @@ return (_ctx, _cache) => {
3129
3129
 
3130
3130
  };
3131
3131
 
3132
- script$n.__file = "src/lib/components/form-components/PasswordInput.vue";
3132
+ script$o.__file = "src/lib/components/form-components/PasswordInput.vue";
3133
+
3134
+ var script$n = {
3135
+ __name: 'DateInput',
3136
+ props: ['modelValue','label','isInvalid'],
3137
+ emits: ['update:modelValue','clearValidationErrors'],
3138
+ setup(__props, { emit: __emit }) {
3139
+
3140
+ const props = __props;
3141
+ const emit = __emit;
3142
+ const inputModel = ref(null);
3143
+
3144
+ const modelValueUpdated = (e) => {
3145
+ emit('clearValidationErrors');
3146
+ emit('update:modelValue',inputModel);
3147
+ };
3148
+ onMounted(()=>{
3149
+ props.modelValue && (inputModel.value = props.modelValue);
3150
+ });
3151
+
3152
+ watch(()=>props.modelValue, (newValue)=>{
3153
+ if(newValue) {
3154
+ inputModel.value = newValue;
3155
+ }
3156
+ });
3157
+
3158
+
3159
+ return (_ctx, _cache) => {
3160
+ return withDirectives((openBlock(), createElementBlock("input", {
3161
+ type: "datetime-local",
3162
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
3163
+ onChange: modelValueUpdated,
3164
+ onKeydown: modelValueUpdated,
3165
+ onUpdated: modelValueUpdated
3166
+ }, null, 544 /* NEED_HYDRATION, NEED_PATCH */)), [
3167
+ [vModelText, inputModel.value]
3168
+ ])
3169
+ }
3170
+ }
3171
+
3172
+ };
3173
+
3174
+ script$n.__file = "src/lib/components/form-components/DateInput.vue";
3133
3175
 
3134
3176
  const _hoisted_1$j = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
3135
3177
  const _hoisted_2$b = ["onUpdate:modelValue"];
@@ -3191,17 +3233,18 @@ const getFieldComponent = (fieldObj) => {
3191
3233
  const field = fieldObj.field ?? fieldObj.name;
3192
3234
  const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
3193
3235
  const defaultNumbers = ['age'];
3236
+ const defaultDates = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
3194
3237
  const passwords = ['password', 'password_confirmation', 'pin'];
3195
3238
  const defaultPhones = ['phone'];
3196
3239
  const defaultEmails = ['email'];
3197
3240
  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;
3241
+ const TextComponent = formComponents.text ?? script$r;
3242
+ const TextAreaComponent = formComponents.textArea ?? script$q;
3243
+ const EmailComponent = formComponents.email ?? script$t;
3244
+ const PhoneComponent = formComponents.phone ?? script$w;
3245
+ const NumberComponent = formComponents.number ?? script$s;
3246
+ const SelectComponent = formComponents.select ?? script$p;
3247
+ const PasswordComponent = formComponents.password ?? script$o;
3205
3248
  if (props.customComponents && props.customComponents[field]) {
3206
3249
  return props.customComponents[field]
3207
3250
  }
@@ -3219,28 +3262,28 @@ const getFieldComponent = (fieldObj) => {
3219
3262
 
3220
3263
  if (fieldObj.type) {
3221
3264
  if (fieldObj.type === 'suggest' || fieldObj.type === 'suggests') {
3222
- return script$u
3265
+ return script$v
3223
3266
  }
3224
3267
  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
3268
  } else if (passwords.includes(field)) {
3226
3269
  return PasswordComponent
3227
3270
  } else if ((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)) {
3228
- return formComponents.textArea ?? script$p
3271
+ return formComponents.textArea ?? script$q
3229
3272
  } else if ((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)) {
3230
- return formComponents.email ?? script$s
3273
+ return formComponents.email ?? script$t
3231
3274
  } else if ((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)) {
3232
- return formComponents.phone ?? script$v
3275
+ return formComponents.phone ?? script$w
3233
3276
  } else if ((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)) {
3234
- return formComponents.number ?? script$r
3277
+ return formComponents.number ?? script$s
3235
3278
  }
3236
3279
  // else
3237
3280
  // if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
3238
3281
  // return formComponents.select ?? SelectInput
3239
3282
  // } else
3240
- // if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3241
- // return formComponents.date ?? DateInput
3242
- // }
3243
- return formComponents.text ?? script$q
3283
+ if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
3284
+ return formComponents.date ?? script$n
3285
+ }
3286
+ return formComponents.text ?? script$r
3244
3287
  };
3245
3288
  const shFormElementClasses = ref(null);
3246
3289
  shFormElementClasses.value = inject('shFormElementClasses');
@@ -3532,7 +3575,7 @@ return (_ctx, _cache) => {
3532
3575
  class: "dropdown-menu px-2 py-1",
3533
3576
  "aria-labelledby": dropdownId
3534
3577
  }, [
3535
- createVNode(script$t, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3578
+ createVNode(script$u, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
3536
3579
  ])
3537
3580
  ])
3538
3581
  ], 64 /* STABLE_FRAGMENT */))
@@ -3633,6 +3676,7 @@ var script$j = {
3633
3676
  'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3634
3677
  'failedCallback', 'labels', 'editors',
3635
3678
  'datePickers',
3679
+ 'required',
3636
3680
  'textAreas',
3637
3681
  'files',
3638
3682
  'phones',
@@ -6346,7 +6390,7 @@ return (_ctx, _cache) => {
6346
6390
  "modal-title": "Department Form"
6347
6391
  }, {
6348
6392
  default: withCtx(() => [
6349
- createVNode(script$t, {
6393
+ createVNode(script$u, {
6350
6394
  "success-callback": "departmentAdded",
6351
6395
  "current-data": department.value,
6352
6396
  onDepartmentAdded: departmentAdded,
@@ -6506,7 +6550,7 @@ return (_ctx, _cache) => {
6506
6550
  "modal-title": "Add Module Department"
6507
6551
  }, {
6508
6552
  default: withCtx(() => [
6509
- createVNode(script$t, {
6553
+ createVNode(script$u, {
6510
6554
  "reload-select-items": unref(reload),
6511
6555
  "success-callback": moduleAdded,
6512
6556
  "fill-selects": {
@@ -6643,7 +6687,7 @@ return (_ctx, _cache) => {
6643
6687
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
6644
6688
  (section.value === 'login')
6645
6689
  ? (openBlock(), createElementBlock("div", _hoisted_2, [
6646
- createVNode(script$t, {
6690
+ createVNode(script$u, {
6647
6691
  class: "sh-login-form",
6648
6692
  fields: ['email','password'],
6649
6693
  "action-label": "Login",
@@ -6668,7 +6712,7 @@ return (_ctx, _cache) => {
6668
6712
  (unref(registerSubTitle))
6669
6713
  ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
6670
6714
  : createCommentVNode("v-if", true),
6671
- createVNode(script$t, {
6715
+ createVNode(script$u, {
6672
6716
  class: "sh-login-form",
6673
6717
  fields: unref(registrationFields),
6674
6718
  "action-label": "Sign Up",
@@ -6715,7 +6759,7 @@ const ShFrontend = {
6715
6759
  const registerTitle = options.registerTitle ?? 'Create a new account';
6716
6760
  const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
6717
6761
  const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
6718
- options.formTextInput ?? script$q;
6762
+ options.formTextInput ?? script$r;
6719
6763
  const loginUrl = options.loginUrl ?? `/login`;
6720
6764
  const redirectLogin = options.redirectLogin ?? `/`;
6721
6765
  const redirectRegister = options.redirectRegister ?? `/`;
@@ -6775,4 +6819,4 @@ var shGql = {
6775
6819
  mutate
6776
6820
  };
6777
6821
 
6778
- 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 };
6822
+ 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.0",
3
+ "version": "4.4.2",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",