@iankibetsh/shframework 0.5.7 → 0.5.9

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
@@ -2013,7 +2013,6 @@ var script$6 = {
2013
2013
  const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
2014
2014
  let realEditors = ['html_content', 'listing_description', 'mail', 'comment'];
2015
2015
  const mapLocations = ['building_location'];
2016
- const files = ['file', 'logo'];
2017
2016
  const phones = ['phone'];
2018
2017
  if (this.selectData[field]) {
2019
2018
  return 'select'
@@ -2024,9 +2023,6 @@ var script$6 = {
2024
2023
  if (field.includes('password')) {
2025
2024
  return 'password'
2026
2025
  }
2027
- if (field.includes('file')) {
2028
- return 'file'
2029
- }
2030
2026
  if (textareas.includes(field)) {
2031
2027
  return 'textarea'
2032
2028
  }
@@ -2049,7 +2045,7 @@ var script$6 = {
2049
2045
  if (selects.includes(field)) {
2050
2046
  return 'select'
2051
2047
  }
2052
- if (files.includes(field)) {
2048
+ if (typeof this.files === 'array' && this.files.includes(field)) {
2053
2049
  return 'file'
2054
2050
  }
2055
2051
  return 'text'
@@ -2153,8 +2149,7 @@ var script$6 = {
2153
2149
  this.form_status = 3;
2154
2150
  if (typeof reason !== 'undefined') {
2155
2151
  if (typeof reason.response !== 'undefined') {
2156
- this.errorText = reason.message;
2157
- this.setErrors(reason.response);
2152
+ this.setErrors(reason.response, reason.message);
2158
2153
  } else {
2159
2154
  console.log('catch error');
2160
2155
  console.log(reason);
@@ -2169,10 +2164,12 @@ var script$6 = {
2169
2164
  this.form_errors[field] = null;
2170
2165
  this.form_status = 0;
2171
2166
  },
2172
- setErrors: function (reason) {
2173
- console.log(reason);
2167
+ setErrors: function (reason, message) {
2168
+ console.log(reason,message);
2174
2169
  if (reason.status === 422) { // change this to 422 validation error response as received from laravel
2175
2170
  this.form_errors = reason.data.errors;
2171
+ } else {
2172
+ this.errorText = message;
2176
2173
  }
2177
2174
  },
2178
2175
  handleFileUpload: function (key) {
package/dist/library.mjs CHANGED
@@ -2001,7 +2001,6 @@ var script$6 = {
2001
2001
  const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
2002
2002
  let realEditors = ['html_content', 'listing_description', 'mail', 'comment'];
2003
2003
  const mapLocations = ['building_location'];
2004
- const files = ['file', 'logo'];
2005
2004
  const phones = ['phone'];
2006
2005
  if (this.selectData[field]) {
2007
2006
  return 'select'
@@ -2012,9 +2011,6 @@ var script$6 = {
2012
2011
  if (field.includes('password')) {
2013
2012
  return 'password'
2014
2013
  }
2015
- if (field.includes('file')) {
2016
- return 'file'
2017
- }
2018
2014
  if (textareas.includes(field)) {
2019
2015
  return 'textarea'
2020
2016
  }
@@ -2037,7 +2033,7 @@ var script$6 = {
2037
2033
  if (selects.includes(field)) {
2038
2034
  return 'select'
2039
2035
  }
2040
- if (files.includes(field)) {
2036
+ if (typeof this.files === 'array' && this.files.includes(field)) {
2041
2037
  return 'file'
2042
2038
  }
2043
2039
  return 'text'
@@ -2141,8 +2137,7 @@ var script$6 = {
2141
2137
  this.form_status = 3;
2142
2138
  if (typeof reason !== 'undefined') {
2143
2139
  if (typeof reason.response !== 'undefined') {
2144
- this.errorText = reason.message;
2145
- this.setErrors(reason.response);
2140
+ this.setErrors(reason.response, reason.message);
2146
2141
  } else {
2147
2142
  console.log('catch error');
2148
2143
  console.log(reason);
@@ -2157,10 +2152,12 @@ var script$6 = {
2157
2152
  this.form_errors[field] = null;
2158
2153
  this.form_status = 0;
2159
2154
  },
2160
- setErrors: function (reason) {
2161
- console.log(reason);
2155
+ setErrors: function (reason, message) {
2156
+ console.log(reason,message);
2162
2157
  if (reason.status === 422) { // change this to 422 validation error response as received from laravel
2163
2158
  this.form_errors = reason.data.errors;
2159
+ } else {
2160
+ this.errorText = message;
2164
2161
  }
2165
2162
  },
2166
2163
  handleFileUpload: function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",