@everymatrix/general-input 1.60.1 → 1.61.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.
Files changed (25) hide show
  1. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +16 -5
  2. package/dist/cjs/general-input.cjs.entry.js +198 -198
  3. package/dist/cjs/general-input.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/components/text-input/text-input.js +22 -5
  6. package/dist/esm/checkbox-group-input_10.entry.js +16 -5
  7. package/dist/esm/general-input.entry.js +198 -198
  8. package/dist/esm/general-input.js +1 -1
  9. package/dist/esm/loader.js +1 -1
  10. package/dist/general-input/general-input.esm.js +1 -1
  11. package/dist/general-input/{p-35d1eebe.entry.js → p-1f89ca5b.entry.js} +1 -1
  12. package/dist/general-input/{p-5bc47cf3.entry.js → p-2820ef34.entry.js} +119 -119
  13. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
  14. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
  15. package/dist/types/components/text-input/text-input.d.ts +1 -0
  16. package/package.json +1 -1
  17. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +0 -2
  18. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +0 -2
  19. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  20. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/storybook/main.d.ts +0 -0
  21. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/storybook/preview.d.ts +0 -0
  22. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/index.d.ts +0 -0
  23. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  24. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  25. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -6517,6 +6517,17 @@ const TextInput = class {
6517
6517
  this.errorMessage = this.setErrorMessage();
6518
6518
  }
6519
6519
  }
6520
+ handleValidationChange(event) {
6521
+ if (event.detail.field !== this.name) {
6522
+ return;
6523
+ }
6524
+ this.validation = event.detail.validation;
6525
+ this.validationPattern = this.setPattern();
6526
+ if (this.touched) {
6527
+ this.isValid = this.setValidity();
6528
+ this.errorMessage = this.setErrorMessage();
6529
+ }
6530
+ }
6520
6531
  connectedCallback() {
6521
6532
  this.validationPattern = this.setPattern();
6522
6533
  }
@@ -6545,7 +6556,7 @@ const TextInput = class {
6545
6556
  return false;
6546
6557
  }
6547
6558
  else {
6548
- return (_a = this.inputReference) === null || _a === void 0 ? void 0 : _a.validity.valid;
6559
+ return ((_a = this.inputReference) === null || _a === void 0 ? void 0 : _a.validity.valid) && this.inputReference.value.match(this.validationPattern) != null;
6549
6560
  }
6550
6561
  }
6551
6562
  setPattern() {
@@ -6556,10 +6567,10 @@ const TextInput = class {
6556
6567
  }
6557
6568
  setErrorMessage() {
6558
6569
  var _a, _b, _c, _d;
6559
- if (this.inputReference.validity.patternMismatch) {
6570
+ if (this.inputReference.value.match(this.validationPattern) == null) {
6560
6571
  const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
6561
6572
  const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
6562
- return locale_utils.translate(`${errorCode}`, this.language) ? locale_utils.translate(`${errorCode}`, this.language) : errorMessage;
6573
+ return locale_utils.translate(`${errorCode}`, this.language) || errorMessage;
6563
6574
  }
6564
6575
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
6565
6576
  return locale_utils.translate('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -6584,8 +6595,8 @@ const TextInput = class {
6584
6595
  if (this.touched) {
6585
6596
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6586
6597
  }
6587
- return index.h("div", { key: 'e297f841a57c6acf854535a786916aa641831556', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '7fd284a58e58d5c61a03caf4cc317b8dd9dbd82f', class: 'text__wrapper--flex' }, index.h("label", { key: 'f80a2003386ec867e5310190a7568105c2912569', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'e8f5197bd370100406d600be5a336f85f4c6934d', class: 'text__wrapper--relative' }, this.tooltip &&
6588
- index.h("img", { key: 'ff8c38fe3495a41a41ac4a1569169ce26a1ec9ce', class: 'text__tooltip-icon', src: tooltipIcon.tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '581106e515810ab43f7d6b6eda504ccf23906b0e', name: this.name, id: `${this.name}__input`, value: this.defaultValue, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: '20620710026982d5fb670a3173bab57a7fa9e7ce', class: 'text__error-message' }, this.errorMessage));
6598
+ return index.h("div", { key: '3050f7be1581f0cd5b5e1ce708a789b5e7a54b03', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '9dcc93fb8c091c599269454ab21c03c2380ffef7', class: 'text__wrapper--flex' }, index.h("label", { key: '0054347b1a4de17ea60b898783de0ef6b42233ee', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'b4655608e397f8d2a8179c01521756bf87746ace', class: 'text__wrapper--relative' }, this.tooltip &&
6599
+ index.h("img", { key: 'c71c1ca1175d11ec352eca5cff216bb244aa7895', class: 'text__tooltip-icon', src: tooltipIcon.tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '2df3c181c5ca725e121c0878a10ca257da7cdd34', name: this.name, id: `${this.name}__input`, value: this.defaultValue, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: '5785eb51774c9159e474fbdbd5be0c1ab2a57899', class: 'text__error-message' }, this.errorMessage));
6589
6600
  }
6590
6601
  static get watchers() { return {
6591
6602
  "clientStyling": ["handleStylingChange"],