@everymatrix/general-input 0.0.1 → 1.0.69

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 (141) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +20007 -16663
  3. package/dist/cjs/general-input.cjs.entry.js +67 -40
  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 +16 -0
  7. package/dist/cjs/loader.cjs.js +7 -13
  8. package/dist/cjs/locale.utils-7a3dfe2f.js +128 -0
  9. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +91 -0
  10. package/dist/cjs/tooltipIcon-7e9ee226.js +5 -0
  11. package/dist/collection/collection-manifest.json +14 -13
  12. package/dist/collection/components/checkbox-group-input/checkbox-group-input.css +26 -6
  13. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +372 -335
  14. package/dist/collection/components/checkbox-input/checkbox-input.css +16 -10
  15. package/dist/collection/components/checkbox-input/checkbox-input.js +325 -310
  16. package/dist/collection/components/date-input/date-input.css +35 -19
  17. package/dist/collection/components/date-input/date-input.js +401 -328
  18. package/dist/collection/components/email-input/email-input.css +30 -18
  19. package/dist/collection/components/email-input/email-input.js +405 -365
  20. package/dist/collection/components/general-input/general-input.css +1 -0
  21. package/dist/collection/components/general-input/general-input.js +374 -291
  22. package/dist/collection/components/general-input/index.js +1 -0
  23. package/dist/collection/components/number-input/number-input.css +28 -16
  24. package/dist/collection/components/number-input/number-input.js +371 -334
  25. package/dist/collection/components/password-input/password-input.css +105 -11
  26. package/dist/collection/components/password-input/password-input.js +518 -378
  27. package/dist/collection/components/radio-input/radio-input.css +4 -4
  28. package/dist/collection/components/radio-input/radio-input.js +301 -287
  29. package/dist/collection/components/select-input/select-input.css +47 -19
  30. package/dist/collection/components/select-input/select-input.js +428 -398
  31. package/dist/collection/components/tel-input/tel-input.css +52 -23
  32. package/dist/collection/components/tel-input/tel-input.js +441 -404
  33. package/dist/collection/components/text-input/text-input.css +33 -18
  34. package/dist/collection/components/text-input/text-input.js +446 -389
  35. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.css +82 -0
  36. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +336 -0
  37. package/dist/collection/index.js +16 -0
  38. package/dist/collection/utils/locale.utils.js +118 -21
  39. package/dist/collection/utils/tooltipIcon.svg +4 -4
  40. package/dist/collection/utils/utils.js +3 -3
  41. package/dist/esm/app-globals-0f993ce5.js +3 -0
  42. package/dist/esm/checkbox-group-input_10.entry.js +20007 -16663
  43. package/dist/esm/general-input.entry.js +67 -40
  44. package/dist/esm/general-input.js +14 -11
  45. package/dist/esm/index-514fda47.js +1287 -0
  46. package/dist/esm/index.js +16 -1
  47. package/dist/esm/loader.js +7 -13
  48. package/dist/esm/locale.utils-21605050.js +125 -0
  49. package/dist/esm/toggle-checkbox-input.entry.js +87 -0
  50. package/dist/esm/tooltipIcon-0a5a06a2.js +3 -0
  51. package/dist/general-input/general-input.esm.js +1 -1
  52. package/dist/general-input/index.esm.js +1 -0
  53. package/dist/general-input/p-03e81c11.js +2 -0
  54. package/dist/general-input/p-2dccd0bf.js +1 -0
  55. package/dist/general-input/p-34939f14.entry.js +1 -0
  56. package/dist/general-input/p-b32f19c2.entry.js +5430 -0
  57. package/dist/general-input/p-c43bb82e.entry.js +1 -0
  58. package/dist/general-input/p-cfe9eb31.js +1 -0
  59. package/dist/general-input/p-e1255160.js +1 -0
  60. package/dist/stencil.config.dev.js +17 -0
  61. package/dist/stencil.config.js +14 -19
  62. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
  63. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
  64. package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +69 -67
  65. package/dist/types/components/checkbox-input/checkbox-input.d.ts +61 -60
  66. package/dist/types/components/date-input/date-input.d.ts +79 -65
  67. package/dist/types/components/email-input/email-input.d.ts +76 -73
  68. package/dist/types/components/general-input/general-input.d.ts +72 -57
  69. package/dist/types/components/general-input/index.d.ts +1 -0
  70. package/dist/types/components/number-input/number-input.d.ts +70 -66
  71. package/dist/types/components/password-input/password-input.d.ts +87 -75
  72. package/dist/types/components/radio-input/radio-input.d.ts +55 -55
  73. package/dist/types/components/select-input/select-input.d.ts +78 -77
  74. package/dist/types/components/tel-input/tel-input.d.ts +84 -80
  75. package/dist/types/components/text-input/text-input.d.ts +81 -78
  76. package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +67 -0
  77. package/dist/types/components.d.ts +331 -25
  78. package/dist/types/stencil-public-runtime.d.ts +142 -33
  79. package/dist/types/utils/locale.utils.d.ts +13 -1
  80. package/dist/types/utils/types.d.ts +58 -47
  81. package/loader/cdn.js +1 -3
  82. package/loader/index.cjs.js +1 -3
  83. package/loader/index.d.ts +13 -1
  84. package/loader/index.es2017.js +1 -3
  85. package/loader/index.js +1 -3
  86. package/loader/package.json +1 -0
  87. package/package.json +9 -9
  88. package/dist/cjs/index-1768513d.js +0 -1286
  89. package/dist/components/active-mixin.js +0 -975
  90. package/dist/components/checkbox-group-input.d.ts +0 -11
  91. package/dist/components/checkbox-group-input.js +0 -6
  92. package/dist/components/checkbox-group-input2.js +0 -5793
  93. package/dist/components/checkbox-input.d.ts +0 -11
  94. package/dist/components/checkbox-input.js +0 -6
  95. package/dist/components/checkbox-input2.js +0 -127
  96. package/dist/components/date-input.d.ts +0 -11
  97. package/dist/components/date-input.js +0 -6
  98. package/dist/components/date-input2.js +0 -5182
  99. package/dist/components/email-input.d.ts +0 -11
  100. package/dist/components/email-input.js +0 -6
  101. package/dist/components/email-input2.js +0 -150
  102. package/dist/components/field-mixin.js +0 -12712
  103. package/dist/components/general-input.d.ts +0 -11
  104. package/dist/components/general-input.js +0 -140
  105. package/dist/components/index.d.ts +0 -26
  106. package/dist/components/index.js +0 -1
  107. package/dist/components/input-field-shared-styles.js +0 -1067
  108. package/dist/components/number-input.d.ts +0 -11
  109. package/dist/components/number-input.js +0 -6
  110. package/dist/components/number-input2.js +0 -139
  111. package/dist/components/password-input.d.ts +0 -11
  112. package/dist/components/password-input.js +0 -6
  113. package/dist/components/password-input2.js +0 -879
  114. package/dist/components/pattern-mixin.js +0 -85
  115. package/dist/components/radio-input.d.ts +0 -11
  116. package/dist/components/radio-input.js +0 -6
  117. package/dist/components/radio-input2.js +0 -115
  118. package/dist/components/select-input.d.ts +0 -11
  119. package/dist/components/select-input.js +0 -6
  120. package/dist/components/select-input2.js +0 -166
  121. package/dist/components/tel-input.d.ts +0 -11
  122. package/dist/components/tel-input.js +0 -6
  123. package/dist/components/tel-input2.js +0 -178
  124. package/dist/components/text-input.d.ts +0 -11
  125. package/dist/components/text-input.js +0 -6
  126. package/dist/components/text-input2.js +0 -157
  127. package/dist/components/tooltipIcon.js +0 -30
  128. package/dist/components/vaadin-button.js +0 -461
  129. package/dist/components/vaadin-combo-box.js +0 -4329
  130. package/dist/components/virtual-keyboard-controller.js +0 -2693
  131. package/dist/esm/index-7e24a6f1.js +0 -1259
  132. package/dist/esm/polyfills/core-js.js +0 -11
  133. package/dist/esm/polyfills/css-shim.js +0 -1
  134. package/dist/esm/polyfills/dom.js +0 -79
  135. package/dist/esm/polyfills/es5-html-element.js +0 -1
  136. package/dist/esm/polyfills/index.js +0 -34
  137. package/dist/esm/polyfills/system.js +0 -6
  138. package/dist/general-input/p-61d76ec3.entry.js +0 -1
  139. package/dist/general-input/p-a79eb0a3.entry.js +0 -4413
  140. package/dist/general-input/p-fb647820.js +0 -1
  141. package/dist/types/Users/adrian.pripon/Documents/Work/stencil/widgets-stencil/packages/general-input/.stencil/packages/general-input/stencil.config.d.ts +0 -2
@@ -1,349 +1,386 @@
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 NumberInput {
5
- constructor() {
6
- /**
7
- * Client custom styling via inline style
8
- */
9
- this.clientStyling = '';
10
- this.limitStylingAppends = false;
11
- this.showTooltip = false;
12
- this.validationPattern = '';
13
- this.setClientStyling = () => {
14
- let sheet = document.createElement('style');
15
- sheet.innerHTML = this.clientStyling;
16
- this.stylingContainer.prepend(sheet);
17
- };
18
- }
19
- validityChanged() {
20
- this.validityStateHandler({ valid: this.isValid, name: this.name });
21
- if (this.emitValue == true) {
22
- this.valueHandler({ name: this.name, value: this.value });
5
+ constructor() {
6
+ this.validationPattern = '';
7
+ this.touched = false;
8
+ this.handleInput = (event) => {
9
+ this.value = event.target.value;
10
+ this.touched = true;
11
+ if (this.debounceTime) {
12
+ clearTimeout(this.debounceTime);
13
+ }
14
+ this.debounceTime = setTimeout(() => {
15
+ this.isValid = this.setValidity();
16
+ this.errorMessage = this.setErrorMessage();
17
+ this.emitValueHandler(true);
18
+ }, 500);
19
+ };
20
+ this.handleBlur = () => {
21
+ this.isValid = this.setValidity();
22
+ this.errorMessage = this.setErrorMessage();
23
+ this.touched = true;
24
+ };
25
+ this.setClientStyling = () => {
26
+ let sheet = document.createElement('style');
27
+ sheet.innerHTML = this.clientStyling;
28
+ this.stylingContainer.prepend(sheet);
29
+ };
30
+ this.name = undefined;
31
+ this.displayName = undefined;
32
+ this.placeholder = undefined;
33
+ this.validation = undefined;
34
+ this.defaultValue = undefined;
35
+ this.autofilled = undefined;
36
+ this.tooltip = undefined;
37
+ this.language = undefined;
38
+ this.emitValue = undefined;
39
+ this.clientStyling = '';
40
+ this.errorMessage = undefined;
41
+ this.isValid = undefined;
42
+ this.limitStylingAppends = false;
43
+ this.showTooltip = false;
23
44
  }
24
- }
25
- validityStateHandler(inputStateEvent) {
26
- this.sendValidityState.emit(inputStateEvent);
27
- }
28
- emitValueHandler(newValue) {
29
- if (newValue == true && this.isValid) {
30
- this.valueHandler({ name: this.name, value: this.value });
45
+ validityChanged() {
46
+ this.validityStateHandler({ valid: this.isValid, name: this.name });
47
+ if (this.emitValue == true) {
48
+ this.valueHandler({ name: this.name, value: this.value });
49
+ }
31
50
  }
32
- }
33
- valueHandler(inputValueEvent) {
34
- this.sendInputValue.emit(inputValueEvent);
35
- }
36
- handleClickOutside(event) {
37
- if (event.composedPath()[0] === this.tooltipIconReference)
38
- return;
39
- if (event.composedPath()[0] !== this.tooltipReference)
40
- this.showTooltip = false;
41
- }
42
- connectedCallback() {
43
- this.validationPattern = this.setPattern();
44
- }
45
- componentDidRender() {
46
- // start custom styling area
47
- if (!this.limitStylingAppends && this.stylingContainer) {
48
- if (this.clientStyling)
49
- this.setClientStyling();
50
- this.limitStylingAppends = true;
51
+ validityStateHandler(inputStateEvent) {
52
+ this.sendValidityState.emit(inputStateEvent);
51
53
  }
52
- // end custom styling area
53
- if (this.defaultValue) {
54
- this.value = this.defaultValue;
55
- this.valueHandler({ name: this.name, value: this.value });
54
+ emitValueHandler(newValue) {
55
+ if (newValue == true && this.isValid) {
56
+ this.valueHandler({ name: this.name, value: this.value });
57
+ }
56
58
  }
57
- }
58
- handleInput(event) {
59
- this.value = event.target.value;
60
- this.errorMessage = this.setErrorMessage();
61
- this.isValid = this.setValidity();
62
- this.validityStateHandler({ valid: this.isValid, name: this.name });
63
- this.emitValueHandler(true);
64
- }
65
- setValidity() {
66
- return this.inputReference.validity.valid;
67
- }
68
- setPattern() {
69
- var _a, _b;
70
- if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
71
- return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
59
+ valueHandler(inputValueEvent) {
60
+ this.sendInputValue.emit(inputValueEvent);
72
61
  }
73
- }
74
- setErrorMessage() {
75
- var _a;
76
- if (this.inputReference.validity.patternMismatch) {
77
- return (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorMessage;
62
+ handleClickOutside(event) {
63
+ if (event.composedPath()[0] === this.tooltipIconReference)
64
+ return;
65
+ if (event.composedPath()[0] !== this.tooltipReference)
66
+ this.showTooltip = false;
78
67
  }
79
- if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
80
- return translate('numberLengthError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
68
+ connectedCallback() {
69
+ this.validationPattern = this.setPattern();
81
70
  }
82
- if (this.inputReference.validity.valueMissing) {
83
- return translate('requiredError', this.language);
71
+ componentDidRender() {
72
+ // start custom styling area
73
+ if (!this.limitStylingAppends && this.stylingContainer) {
74
+ if (this.clientStyling)
75
+ this.setClientStyling();
76
+ this.limitStylingAppends = true;
77
+ }
78
+ // end custom styling area
79
+ }
80
+ componentDidLoad() {
81
+ this.isValid = this.setValidity();
82
+ if (this.defaultValue) {
83
+ this.value = this.defaultValue;
84
+ this.valueHandler({ name: this.name, value: this.value });
85
+ }
84
86
  }
85
- }
86
- renderTooltip() {
87
- if (this.showTooltip) {
88
- return (h("div", { class: `number__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
87
+ setValidity() {
88
+ return this.inputReference.validity.valid;
89
89
  }
90
- return null;
91
- }
92
- render() {
93
- const invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'number__input--invalid';
94
- return h("div", { class: 'number__wrapper', ref: el => this.stylingContainer = el },
95
- h("div", { class: 'number__wrapper--flex' },
96
- h("label", { class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName),
97
- h("div", { class: 'number__wrapper--relative' },
98
- this.tooltip &&
99
- h("img", { class: 'number__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }),
100
- this.renderTooltip())),
101
- h("input", { ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder} ${this.placeholder && this.validation.mandatory ? '*' : ''}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onBlur: (e) => this.handleInput(e) }),
102
- h("small", { class: 'number__error-message' }, this.errorMessage));
103
- }
104
- static get is() { return "number-input"; }
105
- static get encapsulation() { return "shadow"; }
106
- static get originalStyleUrls() { return {
107
- "$": ["number-input.scss"]
108
- }; }
109
- static get styleUrls() { return {
110
- "$": ["number-input.css"]
111
- }; }
112
- static get properties() { return {
113
- "name": {
114
- "type": "string",
115
- "mutable": false,
116
- "complexType": {
117
- "original": "string",
118
- "resolved": "string",
119
- "references": {}
120
- },
121
- "required": false,
122
- "optional": false,
123
- "docs": {
124
- "tags": [],
125
- "text": "Name of the input."
126
- },
127
- "attribute": "name",
128
- "reflect": true
129
- },
130
- "displayName": {
131
- "type": "string",
132
- "mutable": false,
133
- "complexType": {
134
- "original": "string",
135
- "resolved": "string",
136
- "references": {}
137
- },
138
- "required": false,
139
- "optional": false,
140
- "docs": {
141
- "tags": [],
142
- "text": "Name of input to be shown to the user."
143
- },
144
- "attribute": "display-name",
145
- "reflect": true
146
- },
147
- "placeholder": {
148
- "type": "string",
149
- "mutable": false,
150
- "complexType": {
151
- "original": "string",
152
- "resolved": "string",
153
- "references": {}
154
- },
155
- "required": false,
156
- "optional": false,
157
- "docs": {
158
- "tags": [],
159
- "text": "Placeholder text to be shown."
160
- },
161
- "attribute": "placeholder",
162
- "reflect": true
163
- },
164
- "validation": {
165
- "type": "unknown",
166
- "mutable": false,
167
- "complexType": {
168
- "original": "ValidationSchema",
169
- "resolved": "ValidationSchema",
170
- "references": {
171
- "ValidationSchema": {
172
- "location": "import",
173
- "path": "../../utils/types"
174
- }
90
+ setPattern() {
91
+ var _a, _b;
92
+ if (((_a = this.validation.custom) === null || _a === void 0 ? void 0 : _a.length) > 0) {
93
+ return (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.pattern;
94
+ }
95
+ }
96
+ setErrorMessage() {
97
+ var _a, _b;
98
+ if (this.inputReference.validity.patternMismatch) {
99
+ const errorCode = (_a = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _a === void 0 ? void 0 : _a.errorKey;
100
+ const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
101
+ return translate(`${errorCode}`, this.language) ? translate(`${errorCode}`, this.language) : errorMessage;
102
+ }
103
+ if (this.inputReference.validity.rangeUnderflow || this.inputReference.validity.rangeOverflow) {
104
+ return translate('numberLengthError', this.language, { values: { min: this.validation.min, max: this.validation.max } });
105
+ }
106
+ if (this.inputReference.validity.valueMissing) {
107
+ return translate('requiredError', this.language);
175
108
  }
176
- },
177
- "required": false,
178
- "optional": false,
179
- "docs": {
180
- "tags": [],
181
- "text": "Object of validation rules for the input."
182
- }
183
- },
184
- "defaultValue": {
185
- "type": "string",
186
- "mutable": false,
187
- "complexType": {
188
- "original": "string",
189
- "resolved": "string",
190
- "references": {}
191
- },
192
- "required": false,
193
- "optional": false,
194
- "docs": {
195
- "tags": [],
196
- "text": "Default value for the input."
197
- },
198
- "attribute": "default-value",
199
- "reflect": true
200
- },
201
- "autofilled": {
202
- "type": "boolean",
203
- "mutable": false,
204
- "complexType": {
205
- "original": "boolean",
206
- "resolved": "boolean",
207
- "references": {}
208
- },
209
- "required": false,
210
- "optional": false,
211
- "docs": {
212
- "tags": [],
213
- "text": "Boolean. Determines if input should be readonly."
214
- },
215
- "attribute": "autofilled",
216
- "reflect": true
217
- },
218
- "tooltip": {
219
- "type": "string",
220
- "mutable": false,
221
- "complexType": {
222
- "original": "string",
223
- "resolved": "string",
224
- "references": {}
225
- },
226
- "required": false,
227
- "optional": false,
228
- "docs": {
229
- "tags": [],
230
- "text": "Tooltip text."
231
- },
232
- "attribute": "tooltip",
233
- "reflect": true
234
- },
235
- "language": {
236
- "type": "string",
237
- "mutable": false,
238
- "complexType": {
239
- "original": "string",
240
- "resolved": "string",
241
- "references": {}
242
- },
243
- "required": false,
244
- "optional": false,
245
- "docs": {
246
- "tags": [],
247
- "text": "Currently selected language."
248
- },
249
- "attribute": "language",
250
- "reflect": true
251
- },
252
- "emitValue": {
253
- "type": "boolean",
254
- "mutable": false,
255
- "complexType": {
256
- "original": "boolean",
257
- "resolved": "boolean",
258
- "references": {}
259
- },
260
- "required": false,
261
- "optional": false,
262
- "docs": {
263
- "tags": [],
264
- "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
265
- },
266
- "attribute": "emit-value",
267
- "reflect": true
268
- },
269
- "clientStyling": {
270
- "type": "string",
271
- "mutable": false,
272
- "complexType": {
273
- "original": "string",
274
- "resolved": "string",
275
- "references": {}
276
- },
277
- "required": false,
278
- "optional": false,
279
- "docs": {
280
- "tags": [],
281
- "text": "Client custom styling via inline style"
282
- },
283
- "attribute": "client-styling",
284
- "reflect": true,
285
- "defaultValue": "''"
286
109
  }
287
- }; }
288
- static get states() { return {
289
- "errorMessage": {},
290
- "isValid": {},
291
- "limitStylingAppends": {},
292
- "showTooltip": {}
293
- }; }
294
- static get events() { return [{
295
- "method": "sendValidityState",
296
- "name": "sendValidityState",
297
- "bubbles": true,
298
- "cancelable": true,
299
- "composed": true,
300
- "docs": {
301
- "tags": [],
302
- "text": ""
303
- },
304
- "complexType": {
305
- "original": "InputStateEvent",
306
- "resolved": "InputStateEvent",
307
- "references": {
308
- "InputStateEvent": {
309
- "location": "import",
310
- "path": "../../utils/types"
311
- }
110
+ renderTooltip() {
111
+ if (this.showTooltip) {
112
+ return (h("div", { class: `number__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
312
113
  }
313
- }
314
- }, {
315
- "method": "sendInputValue",
316
- "name": "sendInputValue",
317
- "bubbles": true,
318
- "cancelable": true,
319
- "composed": true,
320
- "docs": {
321
- "tags": [],
322
- "text": ""
323
- },
324
- "complexType": {
325
- "original": "InputValueEvent",
326
- "resolved": "InputValueEvent",
327
- "references": {
328
- "InputValueEvent": {
329
- "location": "import",
330
- "path": "../../utils/types"
331
- }
114
+ return null;
115
+ }
116
+ render() {
117
+ let invalidClass = '';
118
+ if (this.touched) {
119
+ invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
332
120
  }
333
- }
334
- }]; }
335
- static get watchers() { return [{
336
- "propName": "isValid",
337
- "methodName": "validityChanged"
338
- }, {
339
- "propName": "emitValue",
340
- "methodName": "emitValueHandler"
341
- }]; }
342
- static get listeners() { return [{
343
- "name": "click",
344
- "method": "handleClickOutside",
345
- "target": "document",
346
- "capture": false,
347
- "passive": false
348
- }]; }
121
+ return h("div", { key: '2032f77ca52b330ae2e8f484d7a0aba60ee7b9d5', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '0786901cd928bba86597180f058bff43fba522b6', class: 'number__wrapper--flex' }, h("label", { key: 'ff7f39306cef7aeba3e0e4508df03c5a945e748b', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'dced91223621551472fee374d56f1ad7476f4191', class: 'number__wrapper--relative' }, this.tooltip &&
122
+ h("img", { key: 'a804a983e342e4d117126720a32c4c34a2b267dc', class: 'number__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'fd59afaedf7d9f761684b057a1809474d735cc26', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: 'ca11558b5704b69311626736ab84a298449b98d7', class: 'number__error-message' }, this.errorMessage));
123
+ }
124
+ static get is() { return "number-input"; }
125
+ static get encapsulation() { return "shadow"; }
126
+ static get originalStyleUrls() {
127
+ return {
128
+ "$": ["number-input.scss"]
129
+ };
130
+ }
131
+ static get styleUrls() {
132
+ return {
133
+ "$": ["number-input.css"]
134
+ };
135
+ }
136
+ static get properties() {
137
+ return {
138
+ "name": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string",
143
+ "resolved": "string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": "Name of the input."
151
+ },
152
+ "attribute": "name",
153
+ "reflect": true
154
+ },
155
+ "displayName": {
156
+ "type": "string",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "string",
160
+ "resolved": "string",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": "Name of input to be shown to the user."
168
+ },
169
+ "attribute": "display-name",
170
+ "reflect": true
171
+ },
172
+ "placeholder": {
173
+ "type": "string",
174
+ "mutable": false,
175
+ "complexType": {
176
+ "original": "string",
177
+ "resolved": "string",
178
+ "references": {}
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": "Placeholder text to be shown."
185
+ },
186
+ "attribute": "placeholder",
187
+ "reflect": true
188
+ },
189
+ "validation": {
190
+ "type": "unknown",
191
+ "mutable": false,
192
+ "complexType": {
193
+ "original": "ValidationSchema",
194
+ "resolved": "ValidationSchema",
195
+ "references": {
196
+ "ValidationSchema": {
197
+ "location": "import",
198
+ "path": "../../utils/types",
199
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::ValidationSchema"
200
+ }
201
+ }
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": "Object of validation rules for the input."
208
+ }
209
+ },
210
+ "defaultValue": {
211
+ "type": "string",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "string",
215
+ "resolved": "string",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [],
222
+ "text": "Default value for the input."
223
+ },
224
+ "attribute": "default-value",
225
+ "reflect": true
226
+ },
227
+ "autofilled": {
228
+ "type": "boolean",
229
+ "mutable": false,
230
+ "complexType": {
231
+ "original": "boolean",
232
+ "resolved": "boolean",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": false,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": "Boolean. Determines if input should be readonly."
240
+ },
241
+ "attribute": "autofilled",
242
+ "reflect": true
243
+ },
244
+ "tooltip": {
245
+ "type": "string",
246
+ "mutable": false,
247
+ "complexType": {
248
+ "original": "string",
249
+ "resolved": "string",
250
+ "references": {}
251
+ },
252
+ "required": false,
253
+ "optional": false,
254
+ "docs": {
255
+ "tags": [],
256
+ "text": "Tooltip text."
257
+ },
258
+ "attribute": "tooltip",
259
+ "reflect": true
260
+ },
261
+ "language": {
262
+ "type": "string",
263
+ "mutable": false,
264
+ "complexType": {
265
+ "original": "string",
266
+ "resolved": "string",
267
+ "references": {}
268
+ },
269
+ "required": false,
270
+ "optional": false,
271
+ "docs": {
272
+ "tags": [],
273
+ "text": "Currently selected language."
274
+ },
275
+ "attribute": "language",
276
+ "reflect": true
277
+ },
278
+ "emitValue": {
279
+ "type": "boolean",
280
+ "mutable": false,
281
+ "complexType": {
282
+ "original": "boolean",
283
+ "resolved": "boolean",
284
+ "references": {}
285
+ },
286
+ "required": false,
287
+ "optional": false,
288
+ "docs": {
289
+ "tags": [],
290
+ "text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
291
+ },
292
+ "attribute": "emit-value",
293
+ "reflect": true
294
+ },
295
+ "clientStyling": {
296
+ "type": "string",
297
+ "mutable": false,
298
+ "complexType": {
299
+ "original": "string",
300
+ "resolved": "string",
301
+ "references": {}
302
+ },
303
+ "required": false,
304
+ "optional": false,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": "Client custom styling via inline style"
308
+ },
309
+ "attribute": "client-styling",
310
+ "reflect": true,
311
+ "defaultValue": "''"
312
+ }
313
+ };
314
+ }
315
+ static get states() {
316
+ return {
317
+ "errorMessage": {},
318
+ "isValid": {},
319
+ "limitStylingAppends": {},
320
+ "showTooltip": {}
321
+ };
322
+ }
323
+ static get events() {
324
+ return [{
325
+ "method": "sendValidityState",
326
+ "name": "sendValidityState",
327
+ "bubbles": true,
328
+ "cancelable": true,
329
+ "composed": true,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": ""
333
+ },
334
+ "complexType": {
335
+ "original": "InputStateEvent",
336
+ "resolved": "InputStateEvent",
337
+ "references": {
338
+ "InputStateEvent": {
339
+ "location": "import",
340
+ "path": "../../utils/types",
341
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputStateEvent"
342
+ }
343
+ }
344
+ }
345
+ }, {
346
+ "method": "sendInputValue",
347
+ "name": "sendInputValue",
348
+ "bubbles": true,
349
+ "cancelable": true,
350
+ "composed": true,
351
+ "docs": {
352
+ "tags": [],
353
+ "text": ""
354
+ },
355
+ "complexType": {
356
+ "original": "InputValueEvent",
357
+ "resolved": "InputValueEvent",
358
+ "references": {
359
+ "InputValueEvent": {
360
+ "location": "import",
361
+ "path": "../../utils/types",
362
+ "id": "../../../../packages/stencil/general-input/src/utils/types.ts::InputValueEvent"
363
+ }
364
+ }
365
+ }
366
+ }];
367
+ }
368
+ static get watchers() {
369
+ return [{
370
+ "propName": "isValid",
371
+ "methodName": "validityChanged"
372
+ }, {
373
+ "propName": "emitValue",
374
+ "methodName": "emitValueHandler"
375
+ }];
376
+ }
377
+ static get listeners() {
378
+ return [{
379
+ "name": "click",
380
+ "method": "handleClickOutside",
381
+ "target": "document",
382
+ "capture": false,
383
+ "passive": false
384
+ }];
385
+ }
349
386
  }