@everymatrix/general-registration 1.10.4 → 1.10.10

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 (35) hide show
  1. package/dist/cjs/checkbox-input_11.cjs.entry.js +1118 -487
  2. package/dist/cjs/general-registration.cjs.js +2 -2
  3. package/dist/cjs/{index-9a07d1e9.js → index-68f93e1e.js} +9 -5
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/components/general-registration/general-registration.css +40 -14
  6. package/dist/collection/components/general-registration/general-registration.js +153 -300
  7. package/dist/components/checkbox-input2.js +8 -2
  8. package/dist/components/date-input2.js +19 -1441
  9. package/dist/components/email-input2.js +28 -9
  10. package/dist/components/general-input2.js +6 -6
  11. package/dist/components/general-registration.js +112 -274
  12. package/dist/components/input-field-shared-styles.js +13776 -0
  13. package/dist/components/locale.utils.js +1 -1
  14. package/dist/components/number-input2.js +8 -2
  15. package/dist/components/password-input2.js +748 -9
  16. package/dist/components/pattern-mixin.js +84 -0
  17. package/dist/components/radio-input2.js +1 -1
  18. package/dist/components/select-input2.js +8 -4
  19. package/dist/components/tel-input2.js +22 -10
  20. package/dist/components/text-input2.js +27 -18
  21. package/dist/components/vaadin-button.js +1432 -0
  22. package/dist/components/vaadin-combo-box.js +3 -82
  23. package/dist/components/virtual-keyboard-controller.js +2136 -15909
  24. package/dist/esm/checkbox-input_11.entry.js +1118 -487
  25. package/dist/esm/general-registration.js +2 -2
  26. package/dist/esm/{index-0505440f.js → index-16916adb.js} +9 -5
  27. package/dist/esm/loader.js +2 -2
  28. package/dist/general-registration/general-registration.esm.js +1 -1
  29. package/dist/general-registration/p-8f644809.js +1 -0
  30. package/dist/general-registration/{p-6a27a1e0.entry.js → p-fb5bf415.entry.js} +210 -100
  31. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/general-registration/.stencil/packages/general-input/src/utils/types.d.ts +6 -4
  32. package/dist/types/components/general-registration/general-registration.d.ts +20 -284
  33. package/dist/types/components.d.ts +11 -17
  34. package/package.json +3 -2
  35. package/dist/general-registration/p-1a88a312.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { t as translate } from './locale.utils.js';
3
3
 
4
- const emailInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.email__wrapper{position:relative;display:flex;flex-direction:column-reverse;padding-top:10px}.email__label{color:#474747;font-size:16px;position:absolute;bottom:15px;left:5px;transform:translateY(-25px);transition:all 0.3s cubic-bezier(0.5, 0, 0.5, 1)}.email__label--required::after{content:\"*\";margin-left:5px;color:#666666}.email__input{width:inherit;padding:15px 6px;position:relative;border:none;border-bottom:3px solid #666666;background-color:transparent;color:#666666;font-size:16px;font-family:inherit}.email__input:focus{outline:none;box-shadow:0 5px 5px rgba(16, 15, 15, 0.1)}.email__input::placeholder{color:#666666}.email__input--invalid{border-bottom:3px solid #cc0000}.email__input:placeholder-shown+.email__label{opacity:0;visibility:hidden;transform:translateY(0)}.email__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000}";
4
+ const emailInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}.email{font-family:\"Roboto\";font-style:normal}.email__wrapper{position:relative;width:100%;padding-top:26px}.email__label{font-family:inherit;font-style:normal;font-weight:500;font-size:16px;line-height:20px;color:#1F1F1F;position:absolute;top:0;left:0}.email__label--required::after{content:\"*\";font-family:inherit;color:#1F1F1F;margin-left:2px}.email__input{border-radius:4px;background-color:transparent;font-family:inherit;font-style:normal;font-weight:300;font-size:16px;line-height:19px;color:#2A2E3F;padding:8px 20px;width:inherit;position:relative;border:2px solid #DEE1EE}.email__input:focus{outline-color:#3E3E3E}.email__input--invalid{border:2px solid #cc0000b3}.email__error-message{position:absolute;top:calc(100% + 5px);left:0;color:#cc0000b3}";
5
5
 
6
6
  const EmailInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
@@ -18,20 +18,33 @@ const EmailInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
18
18
  this.valueHandler({ name: this.name, value: this.value });
19
19
  }
20
20
  }
21
- validityStateHandler(inputStateEvent) {
22
- this.sendValidityState.emit(inputStateEvent);
23
- }
24
21
  emitValueHandler(newValue) {
25
22
  if (newValue == true && this.isValid) {
26
23
  this.valueHandler({ name: this.name, value: this.value });
27
24
  }
28
25
  }
26
+ validityStateHandler(inputStateEvent) {
27
+ this.sendValidityState.emit(inputStateEvent);
28
+ }
29
29
  valueHandler(inputValueEvent) {
30
30
  this.sendInputValue.emit(inputValueEvent);
31
31
  }
32
+ valueChangedHandler(event) {
33
+ if (this.isDuplicateInput) {
34
+ if (this.name === event.detail.name + 'Duplicate') {
35
+ this.duplicateInputValue = event.detail.value;
36
+ }
37
+ }
38
+ }
32
39
  connectedCallback() {
33
40
  this.validationPattern = this.setPattern();
34
41
  }
42
+ componentDidLoad() {
43
+ if (this.defaultValue) {
44
+ this.value = this.defaultValue;
45
+ this.valueHandler({ name: this.name, value: this.value });
46
+ }
47
+ }
35
48
  handleInput(event) {
36
49
  this.value = event.target.value;
37
50
  this.errorMessage = this.setErrorMessage();
@@ -43,14 +56,15 @@ const EmailInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
43
56
  return this.inputReference.validity.valid;
44
57
  }
45
58
  setPattern() {
46
- var _a;
59
+ var _a, _b;
47
60
  if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
48
- return this.validation.custom.find(customValidation => customValidation.rule === 'regex').pattern;
61
+ return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
49
62
  }
50
63
  }
51
64
  setErrorMessage() {
65
+ var _a;
52
66
  if (this.inputReference.validity.patternMismatch) {
53
- return this.validation.custom.find(customValidation => customValidation.rule === 'regex').errorMessage;
67
+ return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
54
68
  }
55
69
  if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
56
70
  return translate('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
@@ -58,9 +72,13 @@ const EmailInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
58
72
  if (this.inputReference.validity.valueMissing) {
59
73
  return translate('requiredError', this.language);
60
74
  }
75
+ if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
76
+ return this.validation.custom.find(customRule => customRule.rule === 'duplicate-input').errorMessage;
77
+ }
61
78
  }
62
79
  render() {
63
- return h("div", { class: 'email__wrapper' }, h("input", { id: `${this.name}__input`, type: 'email', class: `email__input`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.displayName} ${this.validation.mandatory ? '*' : ''}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onBlur: (e) => this.handleInput(e) }), h("label", { class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("small", { class: 'email__error-message' }, this.errorMessage));
80
+ const invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'email__input--invalid';
81
+ return h("div", { class: 'email__wrapper' }, h("input", { id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.displayName} ${this.validation.mandatory ? '*' : ''}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onBlur: (e) => this.handleInput(e) }), h("label", { class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("small", { class: 'email__error-message' }, this.errorMessage));
64
82
  }
65
83
  static get watchers() { return {
66
84
  "isValid": ["validityChanged"],
@@ -75,9 +93,10 @@ const EmailInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
75
93
  "autofilled": [4],
76
94
  "language": [1],
77
95
  "emitValue": [4, "emit-value"],
96
+ "isDuplicateInput": [4, "is-duplicate-input"],
78
97
  "errorMessage": [32],
79
98
  "isValid": [32]
80
- }]);
99
+ }, [[16, "sendInputValue", "valueChangedHandler"]]]);
81
100
  function defineCustomElement() {
82
101
  if (typeof customElements === "undefined") {
83
102
  return;
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import './virtual-keyboard-controller.js';
2
+ import './input-field-shared-styles.js';
3
3
  import { d as defineCustomElement$8 } from './date-input2.js';
4
4
  import { d as defineCustomElement$9 } from './checkbox-input2.js';
5
5
  import { d as defineCustomElement$7 } from './email-input2.js';
@@ -25,9 +25,9 @@ const GeneralInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
25
25
  render() {
26
26
  switch (this.type.toLowerCase()) {
27
27
  case 'text':
28
- return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language });
28
+ return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput });
29
29
  case 'email':
30
- return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language });
30
+ return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput });
31
31
  case 'number':
32
32
  return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language });
33
33
  case 'checkbox':
@@ -35,7 +35,7 @@ const GeneralInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
35
35
  case 'datetime':
36
36
  return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language });
37
37
  case 'password':
38
- return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language });
38
+ return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput });
39
39
  case 'radio':
40
40
  return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language });
41
41
  case 'tel':
@@ -43,7 +43,6 @@ const GeneralInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
43
43
  case 'dropdown':
44
44
  return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language });
45
45
  default:
46
- // Nothing here
47
46
  return h("p", null, "The ", this.type, " input type is not valid");
48
47
  }
49
48
  }
@@ -58,7 +57,8 @@ const GeneralInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
58
57
  "language": [1],
59
58
  "autofilled": [4],
60
59
  "defaultValue": [8, "default-value"],
61
- "emitValue": [4, "emit-value"]
60
+ "emitValue": [4, "emit-value"],
61
+ "isDuplicateInput": [4, "is-duplicate-input"]
62
62
  }]);
63
63
  function defineCustomElement() {
64
64
  if (typeof customElements === "undefined") {