muba-input-text 4.0.0 → 4.1.0

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/InputText.js CHANGED
@@ -35,6 +35,7 @@ export default class InputText extends React.Component {
35
35
  minValueError: false,
36
36
  maxValueError: false,
37
37
  emailBadFormat: false,
38
+ urlAllowingError: false,
38
39
  customizedError: false,
39
40
  customizedErrorMessage: undefined,
40
41
  inputFont: props.inputFont,
@@ -64,18 +65,30 @@ export default class InputText extends React.Component {
64
65
  onlyNumbersError: false,
65
66
  minValueError: false,
66
67
  maxValueError: false,
67
- emailBadFormat: false
68
+ emailBadFormat: false,
69
+ urlAllowingError: false
68
70
  });
69
71
 
72
+ let result = true;
70
73
  if (this.props.required && (this.props.value == null || this.props.value.toString().trim() === '')) {
71
74
  if (this.props.scroll) {
72
75
  this.props.scroll(this.inputTextView);
73
76
  }
74
77
 
75
78
  this.setState({ fieldError: true, requiredError: true });
76
- return false;
79
+ result = false;
80
+ } else {
81
+ if (this.props.notUrl) {
82
+ result = this.isValidUrl(this.props.value);
83
+
84
+ this.showError();
85
+ this.setState({ urlAllowingError: true });
86
+ }
87
+
88
+ result = this.validateType() && result;
77
89
  }
78
- return this.validateType();
90
+
91
+ return result;
79
92
  }
80
93
 
81
94
  showError() {
@@ -162,6 +175,7 @@ export default class InputText extends React.Component {
162
175
  minValueError: false,
163
176
  maxValueError: false,
164
177
  emailBadFormat: false,
178
+ urlAllowingError: false,
165
179
  customizedError: false,
166
180
  customizedErrorMessage: undefined
167
181
  });
@@ -208,6 +222,7 @@ export default class InputText extends React.Component {
208
222
  {this.state.maxValueError && (this.props.showErrorText == null || this.props.showErrorText) ? <OutputText style={[inputTextStyles.subNote, inputTextStyles.redText]}> {strings('maxValueError', { maxValue: this.props.maxValue })}</OutputText> : null}
209
223
  {this.state.minValueError && (this.props.showErrorText == null || this.props.showErrorText) ? <OutputText style={[inputTextStyles.subNote, inputTextStyles.redText]}> {strings('minValueError', { minValue: this.props.minValue })}</OutputText> : null}
210
224
  {this.state.emailBadFormat && (this.props.showErrorText == null || this.props.showErrorText) ? <OutputText style={[inputTextStyles.subNote, inputTextStyles.redText]}> {strings('emailBadFormat')}</OutputText> : null}
225
+ {this.state.urlAllowingError && (this.props.showErrorText == null || this.props.showErrorText) ? <OutputText style={[inputTextStyles.subNote, inputTextStyles.redText]}> {strings('urlAllowingError')}</OutputText> : null}
211
226
  {this.state.maxCharacters && (this.props.showErrorText == null || this.props.showErrorText) ? <OutputText style={[inputTextStyles.subNote, inputTextStyles.redText]}> {strings('maxCharacters', { maxCharacters: this.props.maxCharacters })}</OutputText> : null}
212
227
  {this.state.customizedError && (this.props.showErrorText == null || this.props.showErrorText) ? <OutputText style={[inputTextStyles.subNote, inputTextStyles.redText]}> {this.state.customizedErrorMessage}</OutputText> : null}
213
228
  </View>
package/locales/ar.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "minValueError": "الحد الأدنى للقيمة المسموح بها هو {{minValue}}",
5
5
  "maxValueError": "الحد الأقصى للقيمة المسموح بها هو {{maxValue}}",
6
6
  "emailBadFormat": "رجاء قم بإدخال بريد إكتروني صحيح",
7
- "maxCharacters": "الحد الأقصى للحروف {{maxCharacters}}"
7
+ "maxCharacters": "الحد الأقصى للحروف {{maxCharacters}}",
8
+ "urlAllowingError": "غير مسموح بإدخال عناوين URL"
8
9
  }
package/locales/en.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "minValueError": "The minimum value allowed is {{minValue}}",
5
5
  "maxValueError": "The maximum value allowed is {{maxValue}}",
6
6
  "emailBadFormat": "Please enter a valid email address",
7
- "maxCharacters": "{{maxCharacters}} characters max."
7
+ "maxCharacters": "{{maxCharacters}} characters max.",
8
+ "urlAllowingError": "It is not allowed to enter URL's"
8
9
  }
package/locales/es.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "minValueError": "El valor mínimo permitido es {{minValue}}",
5
5
  "maxValueError": "El valor máximo permitido es {{maxValue}}",
6
6
  "emailBadFormat": "Por favor, introduce una dirección de correo electrónico válida",
7
- "maxCharacters": "{{maxCharacters}} caracteres máx."
7
+ "maxCharacters": "{{maxCharacters}} caracteres máx.",
8
+ "urlAllowingError": "No está permitido introducir URL's"
8
9
  }
package/locales/fr.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "minValueError": "La valeur minimale autorisée est {{minValue}}",
5
5
  "maxValueError": "La valeur maximale autorisée est {{maxValue}}",
6
6
  "emailBadFormat": "S'il vous plaît, mettez une adresse email valide",
7
- "maxCharacters": "{{maxCharacters}} caractères max."
7
+ "maxCharacters": "{{maxCharacters}} caractères max.",
8
+ "urlAllowingError": "Il n'est pas permis d'entrer des URL"
8
9
  }
package/locales/it.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "minValueError": "Il valore minimo permesso è {{minValue}}",
5
5
  "maxValueError": "Il valore massimo permesso è {{maxValue}}",
6
6
  "emailBadFormat": "Inserisci un indirizzo e-mail valido",
7
- "maxCharacters": "{{maxCharacters}} caratteri massimi"
7
+ "maxCharacters": "{{maxCharacters}} caratteri massimi",
8
+ "urlAllowingError": "Non è permesso inserire URL"
8
9
  }
package/locales/nl.json CHANGED
@@ -4,5 +4,6 @@
4
4
  "minValueError": "De minimale toegestane waarde is {minValue}}",
5
5
  "maxValueError": "De maximale toegestane waarde is {maxValue}}",
6
6
  "emailBadFormat": "Voer een geldig e-mailadres in",
7
- "maxCharacters": "Maximaal {{maxCharacters} tekens"
7
+ "maxCharacters": "Maximaal {{maxCharacters} tekens",
8
+ "urlAllowingError": "Het is niet toegestaan URL's in te voeren"
8
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-input-text",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Input text",
5
5
  "main": "InputText.js",
6
6
  "scripts": {