@ptcwebops/ptcw-design 4.1.1 → 4.1.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.
@@ -4195,7 +4195,7 @@ const PtcTextfield = class {
4195
4195
  }
4196
4196
  //this.customInput.reportValidity();
4197
4197
  }
4198
- this.setHelperText();
4198
+ //this.setHelperText();
4199
4199
  }
4200
4200
  handleFocus(event) {
4201
4201
  const target = event.target;
@@ -4262,8 +4262,6 @@ const PtcTextfield = class {
4262
4262
  }
4263
4263
  }
4264
4264
  getValidationMessage(type) {
4265
- // console.log("lang: " + this.language);
4266
- // console.log("type: " + type);
4267
4265
  return validationMessages.ValidationMessages[this.language][type];
4268
4266
  }
4269
4267
  getPhoneValidation() {
@@ -4322,9 +4320,9 @@ const PtcTextfield = class {
4322
4320
  }
4323
4321
  getValidationPattern() {
4324
4322
  let validationPattern = '';
4325
- // if (this.type === 'email' && this.name === 'email') {
4326
- // validationPattern = '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}';
4327
- // }
4323
+ if (this.type === 'email' && this.fieldName === 'email') {
4324
+ validationPattern = "[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.(?!.*\\..*\\.)[a-z]{2,7}$";
4325
+ }
4328
4326
  if (this.fieldName === 'firstname' || this.fieldName === 'lastname') {
4329
4327
  validationPattern = '^[^!*@&$¥£€>#^~+=<>%]+$';
4330
4328
  }
@@ -4337,9 +4335,12 @@ const PtcTextfield = class {
4337
4335
  if (this.customInput.validity.valueMissing) {
4338
4336
  this.helpertext = this.getValidationMessage('email');
4339
4337
  }
4340
- else if (this.customInput.validity.typeMismatch) {
4338
+ else if (!this.customInput.validity.valid) {
4341
4339
  this.helpertext = this.getValidationMessage('validemail');
4342
4340
  }
4341
+ else if (this.customInput.validity.valid) {
4342
+ this.helpertext = '';
4343
+ }
4343
4344
  }
4344
4345
  else if (this.fieldName === 'firstname') {
4345
4346
  if (this.customInput.validity.valueMissing) {
@@ -41,7 +41,7 @@ export class PtcTextfield {
41
41
  }
42
42
  //this.customInput.reportValidity();
43
43
  }
44
- this.setHelperText();
44
+ //this.setHelperText();
45
45
  }
46
46
  handleFocus(event) {
47
47
  const target = event.target;
@@ -108,8 +108,6 @@ export class PtcTextfield {
108
108
  }
109
109
  }
110
110
  getValidationMessage(type) {
111
- // console.log("lang: " + this.language);
112
- // console.log("type: " + type);
113
111
  return ValidationMessages[this.language][type];
114
112
  }
115
113
  getPhoneValidation() {
@@ -168,9 +166,9 @@ export class PtcTextfield {
168
166
  }
169
167
  getValidationPattern() {
170
168
  let validationPattern = '';
171
- // if (this.type === 'email' && this.name === 'email') {
172
- // validationPattern = '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}';
173
- // }
169
+ if (this.type === 'email' && this.fieldName === 'email') {
170
+ validationPattern = "[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.(?!.*\\..*\\.)[a-z]{2,7}$";
171
+ }
174
172
  if (this.fieldName === 'firstname' || this.fieldName === 'lastname') {
175
173
  validationPattern = '^[^!*@&$¥£€>#^~+=<>%]+$';
176
174
  }
@@ -183,9 +181,12 @@ export class PtcTextfield {
183
181
  if (this.customInput.validity.valueMissing) {
184
182
  this.helpertext = this.getValidationMessage('email');
185
183
  }
186
- else if (this.customInput.validity.typeMismatch) {
184
+ else if (!this.customInput.validity.valid) {
187
185
  this.helpertext = this.getValidationMessage('validemail');
188
186
  }
187
+ else if (this.customInput.validity.valid) {
188
+ this.helpertext = '';
189
+ }
189
190
  }
190
191
  else if (this.fieldName === 'firstname') {
191
192
  if (this.customInput.validity.valueMissing) {
@@ -26392,7 +26392,7 @@ const PtcTextfield$1 = class extends HTMLElement$1 {
26392
26392
  }
26393
26393
  //this.customInput.reportValidity();
26394
26394
  }
26395
- this.setHelperText();
26395
+ //this.setHelperText();
26396
26396
  }
26397
26397
  handleFocus(event) {
26398
26398
  const target = event.target;
@@ -26459,8 +26459,6 @@ const PtcTextfield$1 = class extends HTMLElement$1 {
26459
26459
  }
26460
26460
  }
26461
26461
  getValidationMessage(type) {
26462
- // console.log("lang: " + this.language);
26463
- // console.log("type: " + type);
26464
26462
  return ValidationMessages[this.language][type];
26465
26463
  }
26466
26464
  getPhoneValidation() {
@@ -26519,9 +26517,9 @@ const PtcTextfield$1 = class extends HTMLElement$1 {
26519
26517
  }
26520
26518
  getValidationPattern() {
26521
26519
  let validationPattern = '';
26522
- // if (this.type === 'email' && this.name === 'email') {
26523
- // validationPattern = '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}';
26524
- // }
26520
+ if (this.type === 'email' && this.fieldName === 'email') {
26521
+ validationPattern = "[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.(?!.*\\..*\\.)[a-z]{2,7}$";
26522
+ }
26525
26523
  if (this.fieldName === 'firstname' || this.fieldName === 'lastname') {
26526
26524
  validationPattern = '^[^!*@&$¥£€>#^~+=<>%]+$';
26527
26525
  }
@@ -26534,9 +26532,12 @@ const PtcTextfield$1 = class extends HTMLElement$1 {
26534
26532
  if (this.customInput.validity.valueMissing) {
26535
26533
  this.helpertext = this.getValidationMessage('email');
26536
26534
  }
26537
- else if (this.customInput.validity.typeMismatch) {
26535
+ else if (!this.customInput.validity.valid) {
26538
26536
  this.helpertext = this.getValidationMessage('validemail');
26539
26537
  }
26538
+ else if (this.customInput.validity.valid) {
26539
+ this.helpertext = '';
26540
+ }
26540
26541
  }
26541
26542
  else if (this.fieldName === 'firstname') {
26542
26543
  if (this.customInput.validity.valueMissing) {
@@ -4191,7 +4191,7 @@ const PtcTextfield = class {
4191
4191
  }
4192
4192
  //this.customInput.reportValidity();
4193
4193
  }
4194
- this.setHelperText();
4194
+ //this.setHelperText();
4195
4195
  }
4196
4196
  handleFocus(event) {
4197
4197
  const target = event.target;
@@ -4258,8 +4258,6 @@ const PtcTextfield = class {
4258
4258
  }
4259
4259
  }
4260
4260
  getValidationMessage(type) {
4261
- // console.log("lang: " + this.language);
4262
- // console.log("type: " + type);
4263
4261
  return ValidationMessages[this.language][type];
4264
4262
  }
4265
4263
  getPhoneValidation() {
@@ -4318,9 +4316,9 @@ const PtcTextfield = class {
4318
4316
  }
4319
4317
  getValidationPattern() {
4320
4318
  let validationPattern = '';
4321
- // if (this.type === 'email' && this.name === 'email') {
4322
- // validationPattern = '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}';
4323
- // }
4319
+ if (this.type === 'email' && this.fieldName === 'email') {
4320
+ validationPattern = "[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.(?!.*\\..*\\.)[a-z]{2,7}$";
4321
+ }
4324
4322
  if (this.fieldName === 'firstname' || this.fieldName === 'lastname') {
4325
4323
  validationPattern = '^[^!*@&$¥£€>#^~+=<>%]+$';
4326
4324
  }
@@ -4333,9 +4331,12 @@ const PtcTextfield = class {
4333
4331
  if (this.customInput.validity.valueMissing) {
4334
4332
  this.helpertext = this.getValidationMessage('email');
4335
4333
  }
4336
- else if (this.customInput.validity.typeMismatch) {
4334
+ else if (!this.customInput.validity.valid) {
4337
4335
  this.helpertext = this.getValidationMessage('validemail');
4338
4336
  }
4337
+ else if (this.customInput.validity.valid) {
4338
+ this.helpertext = '';
4339
+ }
4339
4340
  }
4340
4341
  else if (this.fieldName === 'firstname') {
4341
4342
  if (this.customInput.validity.valueMissing) {