@everymatrix/general-input 1.32.4 → 1.33.1

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