@everymatrix/general-input 1.44.0 → 1.45.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.
Files changed (139) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +3873 -1756
  3. package/dist/cjs/general-input.cjs.entry.js +65 -63
  4. package/dist/cjs/general-input.cjs.js +17 -11
  5. package/dist/cjs/index-8cb018cb.js +1316 -0
  6. package/dist/cjs/index.cjs.js +13 -13
  7. package/dist/cjs/loader.cjs.js +7 -13
  8. package/dist/cjs/locale.utils-76c75c40.js +147 -0
  9. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +77 -78
  10. package/dist/collection/collection-manifest.json +14 -14
  11. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +368 -353
  12. package/dist/collection/components/checkbox-input/checkbox-input.js +325 -315
  13. package/dist/collection/components/date-input/date-input.css +2 -2
  14. package/dist/collection/components/date-input/date-input.js +397 -376
  15. package/dist/collection/components/email-input/email-input.css +7 -11
  16. package/dist/collection/components/email-input/email-input.js +404 -385
  17. package/dist/collection/components/general-input/general-input.js +373 -368
  18. package/dist/collection/components/general-input/index.js +1 -0
  19. package/dist/collection/components/number-input/number-input.js +370 -352
  20. package/dist/collection/components/password-input/password-input.css +2 -4
  21. package/dist/collection/components/password-input/password-input.js +513 -540
  22. package/dist/collection/components/radio-input/radio-input.js +301 -286
  23. package/dist/collection/components/select-input/select-input.css +8 -9
  24. package/dist/collection/components/select-input/select-input.js +427 -414
  25. package/dist/collection/components/tel-input/tel-input.css +1 -1
  26. package/dist/collection/components/tel-input/tel-input.js +440 -422
  27. package/dist/collection/components/text-input/text-input.css +0 -1
  28. package/dist/collection/components/text-input/text-input.js +444 -429
  29. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +327 -340
  30. package/dist/collection/index.js +13 -13
  31. package/dist/collection/utils/locale.utils.js +133 -133
  32. package/dist/collection/utils/utils.js +3 -3
  33. package/dist/esm/app-globals-0f993ce5.js +3 -0
  34. package/dist/esm/checkbox-group-input_10.entry.js +3873 -1756
  35. package/dist/esm/general-input.entry.js +65 -63
  36. package/dist/esm/general-input.js +14 -11
  37. package/dist/esm/index-514fda47.js +1287 -0
  38. package/dist/esm/index.js +13 -13
  39. package/dist/esm/loader.js +7 -13
  40. package/dist/esm/locale.utils-ca41bf95.js +144 -0
  41. package/dist/esm/toggle-checkbox-input.entry.js +77 -78
  42. package/dist/general-input/general-input.esm.js +1 -1
  43. package/dist/general-input/p-03e81c11.js +2 -0
  44. package/dist/general-input/p-aec71434.js +1 -0
  45. package/dist/general-input/p-e1255160.js +1 -0
  46. package/dist/general-input/p-eb454344.entry.js +1 -0
  47. package/dist/general-input/p-ecdc294b.entry.js +5430 -0
  48. package/dist/general-input/p-f92ab852.entry.js +1 -0
  49. package/dist/stencil.config.dev.js +17 -0
  50. package/dist/stencil.config.js +14 -19
  51. 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
  52. 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
  53. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +68 -68
  54. package/dist/types/components/checkbox-input/checkbox-input.d.ts +61 -62
  55. package/dist/types/components/date-input/date-input.d.ts +78 -78
  56. package/dist/types/components/email-input/email-input.d.ts +77 -77
  57. package/dist/types/components/general-input/general-input.d.ts +72 -72
  58. package/dist/types/components/general-input/index.d.ts +1 -0
  59. package/dist/types/components/number-input/number-input.d.ts +71 -71
  60. package/dist/types/components/password-input/password-input.d.ts +87 -92
  61. package/dist/types/components/radio-input/radio-input.d.ts +55 -55
  62. package/dist/types/components/select-input/select-input.d.ts +79 -79
  63. package/dist/types/components/tel-input/tel-input.d.ts +85 -85
  64. package/dist/types/components/text-input/text-input.d.ts +81 -81
  65. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +63 -68
  66. package/dist/types/components.d.ts +201 -39
  67. package/dist/types/stencil-public-runtime.d.ts +142 -33
  68. package/dist/types/utils/locale.utils.d.ts +8 -8
  69. package/dist/types/utils/types.d.ts +54 -54
  70. package/loader/cdn.js +1 -3
  71. package/loader/index.cjs.js +1 -3
  72. package/loader/index.d.ts +13 -1
  73. package/loader/index.es2017.js +1 -3
  74. package/loader/index.js +1 -3
  75. package/loader/package.json +1 -0
  76. package/package.json +8 -1
  77. package/dist/cjs/index-132a0774.js +0 -1327
  78. package/dist/cjs/locale.utils-2fa6f747.js +0 -147
  79. package/dist/components/active-mixin.js +0 -975
  80. package/dist/components/checkbox-group-input.d.ts +0 -11
  81. package/dist/components/checkbox-group-input.js +0 -6
  82. package/dist/components/checkbox-group-input2.js +0 -1078
  83. package/dist/components/checkbox-input.d.ts +0 -11
  84. package/dist/components/checkbox-input.js +0 -6
  85. package/dist/components/checkbox-input2.js +0 -132
  86. package/dist/components/date-input.d.ts +0 -11
  87. package/dist/components/date-input.js +0 -6
  88. package/dist/components/date-input2.js +0 -11556
  89. package/dist/components/email-input.d.ts +0 -11
  90. package/dist/components/email-input.js +0 -6
  91. package/dist/components/email-input2.js +0 -171
  92. package/dist/components/field-mixin.js +0 -12426
  93. package/dist/components/general-input.d.ts +0 -11
  94. package/dist/components/general-input.js +0 -6
  95. package/dist/components/general-input2.js +0 -350
  96. package/dist/components/index.d.ts +0 -26
  97. package/dist/components/index.js +0 -18
  98. package/dist/components/input-field-shared-styles.js +0 -1211
  99. package/dist/components/number-input.d.ts +0 -11
  100. package/dist/components/number-input.js +0 -6
  101. package/dist/components/number-input2.js +0 -158
  102. package/dist/components/password-input.d.ts +0 -11
  103. package/dist/components/password-input.js +0 -6
  104. package/dist/components/password-input2.js +0 -1059
  105. package/dist/components/radio-input.d.ts +0 -11
  106. package/dist/components/radio-input.js +0 -6
  107. package/dist/components/radio-input2.js +0 -114
  108. package/dist/components/select-input.d.ts +0 -11
  109. package/dist/components/select-input.js +0 -6
  110. package/dist/components/select-input2.js +0 -183
  111. package/dist/components/tel-input.d.ts +0 -11
  112. package/dist/components/tel-input.js +0 -6
  113. package/dist/components/tel-input2.js +0 -197
  114. package/dist/components/text-input.d.ts +0 -11
  115. package/dist/components/text-input.js +0 -6
  116. package/dist/components/text-input2.js +0 -199
  117. package/dist/components/toggle-checkbox-input.d.ts +0 -11
  118. package/dist/components/toggle-checkbox-input.js +0 -6
  119. package/dist/components/tooltipIcon.js +0 -146
  120. package/dist/components/vaadin-button.js +0 -490
  121. package/dist/components/vaadin-combo-box.js +0 -4512
  122. package/dist/components/virtual-keyboard-controller.js +0 -2001
  123. package/dist/esm/index-db76d5b5.js +0 -1299
  124. package/dist/esm/locale.utils-30fb5289.js +0 -144
  125. package/dist/esm/polyfills/core-js.js +0 -11
  126. package/dist/esm/polyfills/css-shim.js +0 -1
  127. package/dist/esm/polyfills/dom.js +0 -79
  128. package/dist/esm/polyfills/es5-html-element.js +0 -1
  129. package/dist/esm/polyfills/index.js +0 -34
  130. package/dist/esm/polyfills/system.js +0 -6
  131. package/dist/general-input/p-04d4b145.js +0 -1
  132. package/dist/general-input/p-a8221ce9.entry.js +0 -1
  133. package/dist/general-input/p-b408093e.js +0 -1
  134. package/dist/general-input/p-b64caafa.entry.js +0 -3646
  135. package/dist/general-input/p-c85c0e4d.entry.js +0 -1
  136. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -2
  137. /package/dist/cjs/{tooltipIcon-092a795f.js → tooltipIcon-7e9ee226.js} +0 -0
  138. /package/dist/esm/{tooltipIcon-99c1c7b7.js → tooltipIcon-0a5a06a2.js} +0 -0
  139. /package/dist/general-input/{p-f4f4ccda.js → p-2dccd0bf.js} +0 -0
@@ -1,448 +1,463 @@
1
- import { Component, h, Prop, State, Watch, Event, Listen } from '@stencil/core';
2
- import { translate } from '../../utils/locale.utils';
3
- import tooltipIcon from '../../utils/tooltipIcon.svg';
1
+ import { h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import tooltipIcon from "../../utils/tooltipIcon.svg";
4
4
  export class TextInput {
5
- constructor() {
6
- /**
7
- * Default value for the input.
8
- */
9
- this.defaultValue = '';
10
- /**
11
- * Client custom styling via inline style
12
- */
13
- this.clientStyling = '';
14
- this.errorMessage = '';
15
- this.limitStylingAppends = false;
16
- this.showTooltip = false;
17
- this.value = '';
18
- this.validationPattern = '';
19
- this.duplicateInputValue = null;
20
- this.touched = false;
21
- this.handleInput = (event) => {
22
- this.value = event.target.value;
23
- this.touched = true;
24
- if (this.debounceTime) {
25
- clearTimeout(this.debounceTime);
26
- }
27
- this.debounceTime = setTimeout(() => {
28
- this.isValid = this.setValidity();
29
- this.errorMessage = this.setErrorMessage();
5
+ constructor() {
6
+ this.value = '';
7
+ this.validationPattern = '';
8
+ this.duplicateInputValue = null;
9
+ this.touched = false;
10
+ this.handleInput = (event) => {
11
+ this.value = event.target.value;
12
+ this.touched = true;
13
+ if (this.debounceTime) {
14
+ clearTimeout(this.debounceTime);
15
+ }
16
+ this.debounceTime = setTimeout(() => {
17
+ this.isValid = this.setValidity();
18
+ this.errorMessage = this.setErrorMessage();
19
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
20
+ this.emitValueHandler(true);
21
+ }, 500);
22
+ };
23
+ this.handleBlur = (event) => {
24
+ this.value = event.target.value;
25
+ this.touched = true;
26
+ this.isValid = this.setValidity();
27
+ this.errorMessage = this.setErrorMessage();
28
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
29
+ };
30
+ this.setClientStyling = () => {
31
+ let sheet = document.createElement('style');
32
+ sheet.innerHTML = this.clientStyling;
33
+ this.stylingContainer.prepend(sheet);
34
+ };
35
+ this.name = undefined;
36
+ this.displayName = undefined;
37
+ this.placeholder = undefined;
38
+ this.validation = undefined;
39
+ this.defaultValue = '';
40
+ this.autofilled = undefined;
41
+ this.tooltip = undefined;
42
+ this.language = undefined;
43
+ this.checkValidity = undefined;
44
+ this.emitValue = undefined;
45
+ this.isDuplicateInput = undefined;
46
+ this.clientStyling = '';
47
+ this.isValid = undefined;
48
+ this.errorMessage = '';
49
+ this.limitStylingAppends = false;
50
+ this.showTooltip = false;
51
+ }
52
+ validityChanged() {
30
53
  this.validityStateHandler({ valid: this.isValid, name: this.name });
31
- this.emitValueHandler(true);
32
- }, 500);
33
- };
34
- this.handleBlur = (event) => {
35
- this.value = event.target.value;
36
- this.touched = true;
37
- this.isValid = this.setValidity();
38
- this.errorMessage = this.setErrorMessage();
39
- this.validityStateHandler({ valid: this.isValid, name: this.name });
40
- };
41
- this.setClientStyling = () => {
42
- let sheet = document.createElement('style');
43
- sheet.innerHTML = this.clientStyling;
44
- this.stylingContainer.prepend(sheet);
45
- };
46
- }
47
- validityChanged() {
48
- this.validityStateHandler({ valid: this.isValid, name: this.name });
49
- if (this.emitValue == true) {
50
- this.valueHandler({ name: this.name, value: this.value });
54
+ if (this.emitValue == true) {
55
+ this.valueHandler({ name: this.name, value: this.value });
56
+ }
51
57
  }
52
- }
53
- emitValueHandler(newValue) {
54
- if (newValue == true && this.isValid) {
55
- this.valueHandler({ name: this.name, value: this.value });
58
+ emitValueHandler(newValue) {
59
+ if (newValue == true && this.isValid) {
60
+ this.valueHandler({ name: this.name, value: this.value });
61
+ }
56
62
  }
57
- }
58
- validityStateHandler(inputStateEvent) {
59
- this.sendValidityState.emit(inputStateEvent);
60
- }
61
- valueHandler(inputValueEvent) {
62
- this.sendInputValue.emit(inputValueEvent);
63
- }
64
- handleClickOutside(event) {
65
- if (event.composedPath()[0] === this.tooltipIconReference)
66
- return;
67
- if (event.composedPath()[0] !== this.tooltipReference)
68
- this.showTooltip = false;
69
- }
70
- valueChangedHandler(event) {
71
- if (this.isDuplicateInput && this.name === event.detail.name + 'Duplicate') {
72
- this.duplicateInputValue = event.detail.value;
73
- if (this.touched) {
74
- this.isValid = this.setValidity();
75
- this.errorMessage = this.setErrorMessage();
76
- }
63
+ validityStateHandler(inputStateEvent) {
64
+ this.sendValidityState.emit(inputStateEvent);
77
65
  }
78
- if (this.name === event.detail.name + 'Duplicate'
79
- && this.name.replace('Duplicate', '') === event.detail.name
80
- && this.touched === true) {
81
- this.isValid = this.setValidity();
82
- this.errorMessage = this.setErrorMessage();
66
+ valueHandler(inputValueEvent) {
67
+ this.sendInputValue.emit(inputValueEvent);
83
68
  }
84
- }
85
- connectedCallback() {
86
- this.validationPattern = this.setPattern();
87
- }
88
- componentDidRender() {
89
- // start custom styling area
90
- if (!this.limitStylingAppends && this.stylingContainer) {
91
- if (this.clientStyling)
92
- this.setClientStyling();
93
- this.limitStylingAppends = true;
69
+ handleClickOutside(event) {
70
+ if (event.composedPath()[0] === this.tooltipIconReference)
71
+ return;
72
+ if (event.composedPath()[0] !== this.tooltipReference)
73
+ this.showTooltip = false;
94
74
  }
95
- // end custom styling area
96
- }
97
- componentDidLoad() {
98
- if (this.defaultValue) {
99
- this.value = this.defaultValue;
100
- this.valueHandler({ name: this.name, value: this.value });
101
- if (this.isDuplicateInput) {
102
- this.touched = true;
103
- }
75
+ valueChangedHandler(event) {
76
+ if (this.isDuplicateInput && this.name === event.detail.name + 'Duplicate') {
77
+ this.duplicateInputValue = event.detail.value;
78
+ if (this.touched) {
79
+ this.isValid = this.setValidity();
80
+ this.errorMessage = this.setErrorMessage();
81
+ }
82
+ }
83
+ if (this.name === event.detail.name + 'Duplicate'
84
+ && this.name.replace('Duplicate', '') === event.detail.name
85
+ && this.touched === true) {
86
+ this.isValid = this.setValidity();
87
+ this.errorMessage = this.setErrorMessage();
88
+ }
104
89
  }
105
- this.isValid = this.setValidity();
106
- }
107
- setValidity() {
108
- var _a;
109
- if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
110
- return false;
90
+ connectedCallback() {
91
+ this.validationPattern = this.setPattern();
111
92
  }
112
- else {
113
- return (_a = this.inputReference) === null || _a === void 0 ? void 0 : _a.validity.valid;
93
+ componentDidRender() {
94
+ // start custom styling area
95
+ if (!this.limitStylingAppends && this.stylingContainer) {
96
+ if (this.clientStyling)
97
+ this.setClientStyling();
98
+ this.limitStylingAppends = true;
99
+ }
100
+ // end custom styling area
114
101
  }
115
- }
116
- setPattern() {
117
- var _a, _b;
118
- if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
119
- return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
102
+ componentDidLoad() {
103
+ if (this.defaultValue) {
104
+ this.value = this.defaultValue;
105
+ this.valueHandler({ name: this.name, value: this.value });
106
+ if (this.isDuplicateInput) {
107
+ this.touched = true;
108
+ }
109
+ }
110
+ this.isValid = this.setValidity();
120
111
  }
121
- }
122
- setErrorMessage() {
123
- var _a, _b, _c, _d;
124
- if (this.inputReference.validity.patternMismatch) {
125
- const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
126
- const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
127
- return translate(`${errorCode}`, this.language) ? translate(`${errorCode}`, this.language) : errorMessage;
112
+ setValidity() {
113
+ var _a;
114
+ if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
115
+ return false;
116
+ }
117
+ else {
118
+ return (_a = this.inputReference) === null || _a === void 0 ? void 0 : _a.validity.valid;
119
+ }
128
120
  }
129
- if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
130
- return translate('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
121
+ setPattern() {
122
+ var _a, _b;
123
+ if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
124
+ return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
125
+ }
131
126
  }
132
- if (this.inputReference.validity.valueMissing) {
133
- return translate('requiredError', this.language);
127
+ setErrorMessage() {
128
+ var _a, _b, _c, _d;
129
+ if (this.inputReference.validity.patternMismatch) {
130
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
131
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
132
+ return translate(`${errorCode}`, this.language) ? translate(`${errorCode}`, this.language) : errorMessage;
133
+ }
134
+ if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
135
+ return translate('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
136
+ }
137
+ if (this.inputReference.validity.valueMissing) {
138
+ return translate('requiredError', this.language);
139
+ }
140
+ if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
141
+ const errorCode = (_c = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _c === void 0 ? void 0 : _c.errorKey;
142
+ const errorMessage = (_d = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _d === void 0 ? void 0 : _d.errorMessage;
143
+ return translate(`${errorCode}`, this.language) ? translate(`${errorCode}`, this.language) : errorMessage;
144
+ }
134
145
  }
135
- if (this.isDuplicateInput && this.duplicateInputValue !== this.value) {
136
- const errorCode = (_c = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _c === void 0 ? void 0 : _c.errorKey;
137
- const errorMessage = (_d = this.validation.custom.find(customRule => customRule.rule === 'duplicate-input')) === null || _d === void 0 ? void 0 : _d.errorMessage;
138
- return translate(`${errorCode}`, this.language) ? translate(`${errorCode}`, this.language) : errorMessage;
146
+ renderTooltip() {
147
+ if (this.showTooltip) {
148
+ return (h("div", { class: `text__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
149
+ }
150
+ return null;
139
151
  }
140
- }
141
- renderTooltip() {
142
- if (this.showTooltip) {
143
- return (h("div", { class: `text__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
152
+ render() {
153
+ let invalidClass = '';
154
+ if (this.touched) {
155
+ invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
156
+ }
157
+ return h("div", { key: 'bfb803110a70b89dd484e993c204b572f0115a17', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '6e9f8f5aada98821d5dc78ccb8b1431ba23b81ab', class: 'text__wrapper--flex' }, h("label", { key: '05cf07855121a79641475a5b020774cf8120d1ed', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'f8c48a999f6827a61ec392ce99858c19559c77d2', class: 'text__wrapper--relative' }, this.tooltip &&
158
+ h("img", { key: 'e866f1df104ce57c29164e73b4ad4d017c7201cd', class: 'text__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'd761c265b1487fe73af54568b6da7fed82656b8d', 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 }), h("small", { key: '5c8df34dd47959eb1668cdf389524d145c69fa84', class: 'text__error-message' }, this.errorMessage));
144
159
  }
145
- return null;
146
- }
147
- render() {
148
- let invalidClass = '';
149
- if (this.touched) {
150
- invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
160
+ static get is() { return "text-input"; }
161
+ static get encapsulation() { return "shadow"; }
162
+ static get originalStyleUrls() {
163
+ return {
164
+ "$": ["text-input.scss"]
165
+ };
151
166
  }
152
- return h("div", { class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el },
153
- h("div", { class: 'text__wrapper--flex' },
154
- h("label", { class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName),
155
- h("div", { class: 'text__wrapper--relative' },
156
- this.tooltip &&
157
- h("img", { class: 'text__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
158
- this.renderTooltip())),
159
- h("input", { 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 }),
160
- h("small", { class: 'text__error-message' }, this.errorMessage));
161
- }
162
- static get is() { return "text-input"; }
163
- static get encapsulation() { return "shadow"; }
164
- static get originalStyleUrls() { return {
165
- "$": ["text-input.scss"]
166
- }; }
167
- static get styleUrls() { return {
168
- "$": ["text-input.css"]
169
- }; }
170
- static get properties() { return {
171
- "name": {
172
- "type": "string",
173
- "mutable": false,
174
- "complexType": {
175
- "original": "string",
176
- "resolved": "string",
177
- "references": {}
178
- },
179
- "required": false,
180
- "optional": false,
181
- "docs": {
182
- "tags": [],
183
- "text": "Name of the input."
184
- },
185
- "attribute": "name",
186
- "reflect": true
187
- },
188
- "displayName": {
189
- "type": "string",
190
- "mutable": false,
191
- "complexType": {
192
- "original": "string",
193
- "resolved": "string",
194
- "references": {}
195
- },
196
- "required": false,
197
- "optional": false,
198
- "docs": {
199
- "tags": [],
200
- "text": "Name of input to be shown to the user."
201
- },
202
- "attribute": "display-name",
203
- "reflect": true
204
- },
205
- "placeholder": {
206
- "type": "string",
207
- "mutable": false,
208
- "complexType": {
209
- "original": "string",
210
- "resolved": "string",
211
- "references": {}
212
- },
213
- "required": false,
214
- "optional": false,
215
- "docs": {
216
- "tags": [],
217
- "text": "Placeholder text to be shown."
218
- },
219
- "attribute": "placeholder",
220
- "reflect": true
221
- },
222
- "validation": {
223
- "type": "unknown",
224
- "mutable": false,
225
- "complexType": {
226
- "original": "ValidationSchema",
227
- "resolved": "ValidationSchema",
228
- "references": {
229
- "ValidationSchema": {
230
- "location": "import",
231
- "path": "../../utils/types"
232
- }
233
- }
234
- },
235
- "required": false,
236
- "optional": false,
237
- "docs": {
238
- "tags": [],
239
- "text": "Object of validation rules for the input."
240
- }
241
- },
242
- "defaultValue": {
243
- "type": "string",
244
- "mutable": false,
245
- "complexType": {
246
- "original": "string",
247
- "resolved": "string",
248
- "references": {}
249
- },
250
- "required": false,
251
- "optional": false,
252
- "docs": {
253
- "tags": [],
254
- "text": "Default value for the input."
255
- },
256
- "attribute": "default-value",
257
- "reflect": true,
258
- "defaultValue": "''"
259
- },
260
- "autofilled": {
261
- "type": "boolean",
262
- "mutable": false,
263
- "complexType": {
264
- "original": "boolean",
265
- "resolved": "boolean",
266
- "references": {}
267
- },
268
- "required": false,
269
- "optional": false,
270
- "docs": {
271
- "tags": [],
272
- "text": "Boolean. Determines if input should be readonly."
273
- },
274
- "attribute": "autofilled",
275
- "reflect": true
276
- },
277
- "tooltip": {
278
- "type": "string",
279
- "mutable": false,
280
- "complexType": {
281
- "original": "string",
282
- "resolved": "string",
283
- "references": {}
284
- },
285
- "required": false,
286
- "optional": false,
287
- "docs": {
288
- "tags": [],
289
- "text": "Tooltip text."
290
- },
291
- "attribute": "tooltip",
292
- "reflect": true
293
- },
294
- "language": {
295
- "type": "string",
296
- "mutable": false,
297
- "complexType": {
298
- "original": "string",
299
- "resolved": "string",
300
- "references": {}
301
- },
302
- "required": false,
303
- "optional": false,
304
- "docs": {
305
- "tags": [],
306
- "text": "Currently selected language."
307
- },
308
- "attribute": "language",
309
- "reflect": true
310
- },
311
- "checkValidity": {
312
- "type": "boolean",
313
- "mutable": false,
314
- "complexType": {
315
- "original": "boolean",
316
- "resolved": "boolean",
317
- "references": {}
318
- },
319
- "required": false,
320
- "optional": false,
321
- "docs": {
322
- "tags": [],
323
- "text": "State passed down from the parent element. Will trigger the input to check for validity."
324
- },
325
- "attribute": "check-validity",
326
- "reflect": true
327
- },
328
- "emitValue": {
329
- "type": "boolean",
330
- "mutable": false,
331
- "complexType": {
332
- "original": "boolean",
333
- "resolved": "boolean",
334
- "references": {}
335
- },
336
- "required": false,
337
- "optional": false,
338
- "docs": {
339
- "tags": [],
340
- "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
341
- },
342
- "attribute": "emit-value",
343
- "reflect": true
344
- },
345
- "isDuplicateInput": {
346
- "type": "boolean",
347
- "mutable": false,
348
- "complexType": {
349
- "original": "boolean",
350
- "resolved": "boolean",
351
- "references": {}
352
- },
353
- "required": false,
354
- "optional": false,
355
- "docs": {
356
- "tags": [],
357
- "text": "Boolean that triggers certain validation rules, for duplicated inputs."
358
- },
359
- "attribute": "is-duplicate-input",
360
- "reflect": true
361
- },
362
- "clientStyling": {
363
- "type": "string",
364
- "mutable": false,
365
- "complexType": {
366
- "original": "string",
367
- "resolved": "string",
368
- "references": {}
369
- },
370
- "required": false,
371
- "optional": false,
372
- "docs": {
373
- "tags": [],
374
- "text": "Client custom styling via inline style"
375
- },
376
- "attribute": "client-styling",
377
- "reflect": true,
378
- "defaultValue": "''"
167
+ static get styleUrls() {
168
+ return {
169
+ "$": ["text-input.css"]
170
+ };
171
+ }
172
+ static get properties() {
173
+ return {
174
+ "name": {
175
+ "type": "string",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "string",
179
+ "resolved": "string",
180
+ "references": {}
181
+ },
182
+ "required": false,
183
+ "optional": false,
184
+ "docs": {
185
+ "tags": [],
186
+ "text": "Name of the input."
187
+ },
188
+ "attribute": "name",
189
+ "reflect": true
190
+ },
191
+ "displayName": {
192
+ "type": "string",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "string",
196
+ "resolved": "string",
197
+ "references": {}
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": "Name of input to be shown to the user."
204
+ },
205
+ "attribute": "display-name",
206
+ "reflect": true
207
+ },
208
+ "placeholder": {
209
+ "type": "string",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "string",
213
+ "resolved": "string",
214
+ "references": {}
215
+ },
216
+ "required": false,
217
+ "optional": false,
218
+ "docs": {
219
+ "tags": [],
220
+ "text": "Placeholder text to be shown."
221
+ },
222
+ "attribute": "placeholder",
223
+ "reflect": true
224
+ },
225
+ "validation": {
226
+ "type": "unknown",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "ValidationSchema",
230
+ "resolved": "ValidationSchema",
231
+ "references": {
232
+ "ValidationSchema": {
233
+ "location": "import",
234
+ "path": "../../utils/types",
235
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::ValidationSchema"
236
+ }
237
+ }
238
+ },
239
+ "required": false,
240
+ "optional": false,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": "Object of validation rules for the input."
244
+ }
245
+ },
246
+ "defaultValue": {
247
+ "type": "string",
248
+ "mutable": false,
249
+ "complexType": {
250
+ "original": "string",
251
+ "resolved": "string",
252
+ "references": {}
253
+ },
254
+ "required": false,
255
+ "optional": false,
256
+ "docs": {
257
+ "tags": [],
258
+ "text": "Default value for the input."
259
+ },
260
+ "attribute": "default-value",
261
+ "reflect": true,
262
+ "defaultValue": "''"
263
+ },
264
+ "autofilled": {
265
+ "type": "boolean",
266
+ "mutable": false,
267
+ "complexType": {
268
+ "original": "boolean",
269
+ "resolved": "boolean",
270
+ "references": {}
271
+ },
272
+ "required": false,
273
+ "optional": false,
274
+ "docs": {
275
+ "tags": [],
276
+ "text": "Boolean. Determines if input should be readonly."
277
+ },
278
+ "attribute": "autofilled",
279
+ "reflect": true
280
+ },
281
+ "tooltip": {
282
+ "type": "string",
283
+ "mutable": false,
284
+ "complexType": {
285
+ "original": "string",
286
+ "resolved": "string",
287
+ "references": {}
288
+ },
289
+ "required": false,
290
+ "optional": false,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "Tooltip text."
294
+ },
295
+ "attribute": "tooltip",
296
+ "reflect": true
297
+ },
298
+ "language": {
299
+ "type": "string",
300
+ "mutable": false,
301
+ "complexType": {
302
+ "original": "string",
303
+ "resolved": "string",
304
+ "references": {}
305
+ },
306
+ "required": false,
307
+ "optional": false,
308
+ "docs": {
309
+ "tags": [],
310
+ "text": "Currently selected language."
311
+ },
312
+ "attribute": "language",
313
+ "reflect": true
314
+ },
315
+ "checkValidity": {
316
+ "type": "boolean",
317
+ "mutable": false,
318
+ "complexType": {
319
+ "original": "boolean",
320
+ "resolved": "boolean",
321
+ "references": {}
322
+ },
323
+ "required": false,
324
+ "optional": false,
325
+ "docs": {
326
+ "tags": [],
327
+ "text": "State passed down from the parent element. Will trigger the input to check for validity."
328
+ },
329
+ "attribute": "check-validity",
330
+ "reflect": true
331
+ },
332
+ "emitValue": {
333
+ "type": "boolean",
334
+ "mutable": false,
335
+ "complexType": {
336
+ "original": "boolean",
337
+ "resolved": "boolean",
338
+ "references": {}
339
+ },
340
+ "required": false,
341
+ "optional": false,
342
+ "docs": {
343
+ "tags": [],
344
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
345
+ },
346
+ "attribute": "emit-value",
347
+ "reflect": true
348
+ },
349
+ "isDuplicateInput": {
350
+ "type": "boolean",
351
+ "mutable": false,
352
+ "complexType": {
353
+ "original": "boolean",
354
+ "resolved": "boolean",
355
+ "references": {}
356
+ },
357
+ "required": false,
358
+ "optional": false,
359
+ "docs": {
360
+ "tags": [],
361
+ "text": "Boolean that triggers certain validation rules, for duplicated inputs."
362
+ },
363
+ "attribute": "is-duplicate-input",
364
+ "reflect": true
365
+ },
366
+ "clientStyling": {
367
+ "type": "string",
368
+ "mutable": false,
369
+ "complexType": {
370
+ "original": "string",
371
+ "resolved": "string",
372
+ "references": {}
373
+ },
374
+ "required": false,
375
+ "optional": false,
376
+ "docs": {
377
+ "tags": [],
378
+ "text": "Client custom styling via inline style"
379
+ },
380
+ "attribute": "client-styling",
381
+ "reflect": true,
382
+ "defaultValue": "''"
383
+ }
384
+ };
385
+ }
386
+ static get states() {
387
+ return {
388
+ "isValid": {},
389
+ "errorMessage": {},
390
+ "limitStylingAppends": {},
391
+ "showTooltip": {}
392
+ };
393
+ }
394
+ static get events() {
395
+ return [{
396
+ "method": "sendValidityState",
397
+ "name": "sendValidityState",
398
+ "bubbles": true,
399
+ "cancelable": true,
400
+ "composed": true,
401
+ "docs": {
402
+ "tags": [],
403
+ "text": ""
404
+ },
405
+ "complexType": {
406
+ "original": "InputStateEvent",
407
+ "resolved": "InputStateEvent",
408
+ "references": {
409
+ "InputStateEvent": {
410
+ "location": "import",
411
+ "path": "../../utils/types",
412
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputStateEvent"
413
+ }
414
+ }
415
+ }
416
+ }, {
417
+ "method": "sendInputValue",
418
+ "name": "sendInputValue",
419
+ "bubbles": true,
420
+ "cancelable": true,
421
+ "composed": true,
422
+ "docs": {
423
+ "tags": [],
424
+ "text": ""
425
+ },
426
+ "complexType": {
427
+ "original": "InputValueEvent",
428
+ "resolved": "InputValueEvent",
429
+ "references": {
430
+ "InputValueEvent": {
431
+ "location": "import",
432
+ "path": "../../utils/types",
433
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputValueEvent"
434
+ }
435
+ }
436
+ }
437
+ }];
438
+ }
439
+ static get watchers() {
440
+ return [{
441
+ "propName": "isValid",
442
+ "methodName": "validityChanged"
443
+ }, {
444
+ "propName": "emitValue",
445
+ "methodName": "emitValueHandler"
446
+ }];
447
+ }
448
+ static get listeners() {
449
+ return [{
450
+ "name": "click",
451
+ "method": "handleClickOutside",
452
+ "target": "document",
453
+ "capture": false,
454
+ "passive": false
455
+ }, {
456
+ "name": "sendInputValue",
457
+ "method": "valueChangedHandler",
458
+ "target": "body",
459
+ "capture": false,
460
+ "passive": false
461
+ }];
379
462
  }
380
- }; }
381
- static get states() { return {
382
- "isValid": {},
383
- "errorMessage": {},
384
- "limitStylingAppends": {},
385
- "showTooltip": {}
386
- }; }
387
- static get events() { return [{
388
- "method": "sendValidityState",
389
- "name": "sendValidityState",
390
- "bubbles": true,
391
- "cancelable": true,
392
- "composed": true,
393
- "docs": {
394
- "tags": [],
395
- "text": ""
396
- },
397
- "complexType": {
398
- "original": "InputStateEvent",
399
- "resolved": "InputStateEvent",
400
- "references": {
401
- "InputStateEvent": {
402
- "location": "import",
403
- "path": "../../utils/types"
404
- }
405
- }
406
- }
407
- }, {
408
- "method": "sendInputValue",
409
- "name": "sendInputValue",
410
- "bubbles": true,
411
- "cancelable": true,
412
- "composed": true,
413
- "docs": {
414
- "tags": [],
415
- "text": ""
416
- },
417
- "complexType": {
418
- "original": "InputValueEvent",
419
- "resolved": "InputValueEvent",
420
- "references": {
421
- "InputValueEvent": {
422
- "location": "import",
423
- "path": "../../utils/types"
424
- }
425
- }
426
- }
427
- }]; }
428
- static get watchers() { return [{
429
- "propName": "isValid",
430
- "methodName": "validityChanged"
431
- }, {
432
- "propName": "emitValue",
433
- "methodName": "emitValueHandler"
434
- }]; }
435
- static get listeners() { return [{
436
- "name": "click",
437
- "method": "handleClickOutside",
438
- "target": "document",
439
- "capture": false,
440
- "passive": false
441
- }, {
442
- "name": "sendInputValue",
443
- "method": "valueChangedHandler",
444
- "target": "body",
445
- "capture": false,
446
- "passive": false
447
- }]; }
448
463
  }