@everymatrix/general-input 1.56.0 → 1.56.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.
- package/dist/cjs/checkbox-group-input_10.cjs.entry.js +419 -380
- package/dist/cjs/general-input.cjs.entry.js +18 -17
- package/dist/cjs/general-input.cjs.js +3 -3
- package/dist/cjs/{index-a91d7bcb.js → index-bce82d29.js} +76 -211
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/toggle-checkbox-input.cjs.entry.js +25 -14
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +26 -35
- package/dist/collection/components/checkbox-input/checkbox-input.js +23 -31
- package/dist/collection/components/date-input/date-input.js +26 -37
- package/dist/collection/components/email-input/email-input.js +25 -31
- package/dist/collection/components/general-input/general-input.js +18 -51
- package/dist/collection/components/number-input/number-input.js +24 -29
- package/dist/collection/components/password-input/password-input.js +28 -36
- package/dist/collection/components/radio-input/radio-input.js +23 -26
- package/dist/collection/components/select-input/select-input.js +26 -41
- package/dist/collection/components/tel-input/tel-input.js +26 -33
- package/dist/collection/components/text-input/text-input.js +26 -38
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +29 -35
- package/dist/esm/checkbox-group-input_10.entry.js +419 -380
- package/dist/esm/general-input.entry.js +18 -17
- package/dist/esm/general-input.js +4 -4
- package/dist/esm/{index-3bab966c.js → index-34f25346.js} +76 -211
- package/dist/esm/loader.js +3 -3
- package/dist/esm/toggle-checkbox-input.entry.js +25 -14
- package/dist/general-input/general-input.esm.js +1 -1
- package/dist/general-input/{p-a708ec0e.entry.js → p-063fdb7d.entry.js} +186 -188
- package/dist/general-input/p-261db8d1.entry.js +1 -0
- package/dist/general-input/p-8b2b0da7.js +2 -0
- package/dist/general-input/p-e2eb81ed.entry.js +1 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +1 -0
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +1 -0
- package/dist/types/components/date-input/date-input.d.ts +1 -0
- package/dist/types/components/email-input/email-input.d.ts +1 -0
- package/dist/types/components/number-input/number-input.d.ts +1 -0
- package/dist/types/components/password-input/password-input.d.ts +1 -0
- package/dist/types/components/radio-input/radio-input.d.ts +1 -0
- package/dist/types/components/select-input/select-input.d.ts +1 -0
- package/dist/types/components/tel-input/tel-input.d.ts +1 -0
- package/dist/types/components/text-input/text-input.d.ts +1 -0
- package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -6
- package/package.json +1 -1
- package/dist/general-input/p-5ab8d194.js +0 -2
- package/dist/general-input/p-8ce07665.entry.js +0 -1
- package/dist/general-input/p-9ad71153.entry.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -3,17 +3,27 @@ import { translate } from "../../utils/locale.utils";
|
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
4
|
export class RadioInput {
|
|
5
5
|
constructor() {
|
|
6
|
-
/**
|
|
7
|
-
* Client custom styling via inline style
|
|
8
|
-
*/
|
|
9
|
-
this.clientStyling = '';
|
|
10
|
-
this.limitStylingAppends = false;
|
|
11
|
-
this.showTooltip = false;
|
|
12
6
|
this.setClientStyling = () => {
|
|
13
7
|
let sheet = document.createElement('style');
|
|
14
8
|
sheet.innerHTML = this.clientStyling;
|
|
15
9
|
this.stylingContainer.prepend(sheet);
|
|
16
10
|
};
|
|
11
|
+
this.name = undefined;
|
|
12
|
+
this.displayName = undefined;
|
|
13
|
+
this.optionsGroup = undefined;
|
|
14
|
+
this.validation = undefined;
|
|
15
|
+
this.tooltip = undefined;
|
|
16
|
+
this.language = undefined;
|
|
17
|
+
this.emitValue = undefined;
|
|
18
|
+
this.clientStyling = '';
|
|
19
|
+
this.errorMessage = undefined;
|
|
20
|
+
this.isValid = undefined;
|
|
21
|
+
this.limitStylingAppends = false;
|
|
22
|
+
this.showTooltip = false;
|
|
23
|
+
}
|
|
24
|
+
handleStylingChange(newValue, oldValue) {
|
|
25
|
+
if (newValue !== oldValue)
|
|
26
|
+
this.setClientStyling();
|
|
17
27
|
}
|
|
18
28
|
validityChanged() {
|
|
19
29
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -68,8 +78,8 @@ export class RadioInput {
|
|
|
68
78
|
return null;
|
|
69
79
|
}
|
|
70
80
|
render() {
|
|
71
|
-
return h("fieldset", { key: '
|
|
72
|
-
h("img", { key: '
|
|
81
|
+
return h("fieldset", { key: '29ff8fcc910622397750532629ac0c202c9726ba', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: 'cdab5b331863f3d31aab50c1d95b5a8845d53329', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: 'bd6cd89510e7ace1348b391f3ce9ba334a03e695', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
|
|
82
|
+
h("img", { key: '27036c51c89612dbb87e5248355d3a5466c49705', class: 'radio__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
73
83
|
}
|
|
74
84
|
static get is() { return "radio-input"; }
|
|
75
85
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,8 +109,6 @@ export class RadioInput {
|
|
|
99
109
|
"tags": [],
|
|
100
110
|
"text": "Name of the input."
|
|
101
111
|
},
|
|
102
|
-
"getter": false,
|
|
103
|
-
"setter": false,
|
|
104
112
|
"attribute": "name",
|
|
105
113
|
"reflect": true
|
|
106
114
|
},
|
|
@@ -118,8 +126,6 @@ export class RadioInput {
|
|
|
118
126
|
"tags": [],
|
|
119
127
|
"text": "Name of input to be shown to the user."
|
|
120
128
|
},
|
|
121
|
-
"getter": false,
|
|
122
|
-
"setter": false,
|
|
123
129
|
"attribute": "display-name",
|
|
124
130
|
"reflect": true
|
|
125
131
|
},
|
|
@@ -142,9 +148,7 @@ export class RadioInput {
|
|
|
142
148
|
"docs": {
|
|
143
149
|
"tags": [],
|
|
144
150
|
"text": "Options of the input."
|
|
145
|
-
}
|
|
146
|
-
"getter": false,
|
|
147
|
-
"setter": false
|
|
151
|
+
}
|
|
148
152
|
},
|
|
149
153
|
"validation": {
|
|
150
154
|
"type": "unknown",
|
|
@@ -165,9 +169,7 @@ export class RadioInput {
|
|
|
165
169
|
"docs": {
|
|
166
170
|
"tags": [],
|
|
167
171
|
"text": "Object of validation rules for the input."
|
|
168
|
-
}
|
|
169
|
-
"getter": false,
|
|
170
|
-
"setter": false
|
|
172
|
+
}
|
|
171
173
|
},
|
|
172
174
|
"tooltip": {
|
|
173
175
|
"type": "string",
|
|
@@ -183,8 +185,6 @@ export class RadioInput {
|
|
|
183
185
|
"tags": [],
|
|
184
186
|
"text": "Tooltip text."
|
|
185
187
|
},
|
|
186
|
-
"getter": false,
|
|
187
|
-
"setter": false,
|
|
188
188
|
"attribute": "tooltip",
|
|
189
189
|
"reflect": true
|
|
190
190
|
},
|
|
@@ -202,8 +202,6 @@ export class RadioInput {
|
|
|
202
202
|
"tags": [],
|
|
203
203
|
"text": "Currently selected language."
|
|
204
204
|
},
|
|
205
|
-
"getter": false,
|
|
206
|
-
"setter": false,
|
|
207
205
|
"attribute": "language",
|
|
208
206
|
"reflect": true
|
|
209
207
|
},
|
|
@@ -221,8 +219,6 @@ export class RadioInput {
|
|
|
221
219
|
"tags": [],
|
|
222
220
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
223
221
|
},
|
|
224
|
-
"getter": false,
|
|
225
|
-
"setter": false,
|
|
226
222
|
"attribute": "emit-value",
|
|
227
223
|
"reflect": true
|
|
228
224
|
},
|
|
@@ -240,8 +236,6 @@ export class RadioInput {
|
|
|
240
236
|
"tags": [],
|
|
241
237
|
"text": "Client custom styling via inline style"
|
|
242
238
|
},
|
|
243
|
-
"getter": false,
|
|
244
|
-
"setter": false,
|
|
245
239
|
"attribute": "client-styling",
|
|
246
240
|
"reflect": true,
|
|
247
241
|
"defaultValue": "''"
|
|
@@ -303,6 +297,9 @@ export class RadioInput {
|
|
|
303
297
|
}
|
|
304
298
|
static get watchers() {
|
|
305
299
|
return [{
|
|
300
|
+
"propName": "clientStyling",
|
|
301
|
+
"methodName": "handleStylingChange"
|
|
302
|
+
}, {
|
|
306
303
|
"propName": "isValid",
|
|
307
304
|
"methodName": "validityChanged"
|
|
308
305
|
}, {
|
|
@@ -4,20 +4,6 @@ import "@vaadin/combo-box";
|
|
|
4
4
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
5
5
|
export class SelectInput {
|
|
6
6
|
constructor() {
|
|
7
|
-
/**
|
|
8
|
-
* Default value for the input.
|
|
9
|
-
*/
|
|
10
|
-
this.defaultValue = '';
|
|
11
|
-
/**
|
|
12
|
-
* Options of the input.
|
|
13
|
-
*/
|
|
14
|
-
this.options = [];
|
|
15
|
-
/**
|
|
16
|
-
* Client custom styling via inline style
|
|
17
|
-
*/
|
|
18
|
-
this.clientStyling = '';
|
|
19
|
-
this.limitStylingAppends = false;
|
|
20
|
-
this.showTooltip = false;
|
|
21
7
|
this.touched = false;
|
|
22
8
|
this.handleChange = (event) => {
|
|
23
9
|
this.touched = true;
|
|
@@ -46,6 +32,26 @@ export class SelectInput {
|
|
|
46
32
|
sheet.innerHTML = this.clientStyling;
|
|
47
33
|
this.stylingContainer.prepend(sheet);
|
|
48
34
|
};
|
|
35
|
+
this.name = undefined;
|
|
36
|
+
this.displayName = undefined;
|
|
37
|
+
this.placeholder = undefined;
|
|
38
|
+
this.action = undefined;
|
|
39
|
+
this.defaultValue = '';
|
|
40
|
+
this.autofilled = undefined;
|
|
41
|
+
this.tooltip = undefined;
|
|
42
|
+
this.options = [];
|
|
43
|
+
this.validation = undefined;
|
|
44
|
+
this.language = undefined;
|
|
45
|
+
this.emitValue = undefined;
|
|
46
|
+
this.clientStyling = '';
|
|
47
|
+
this.errorMessage = undefined;
|
|
48
|
+
this.isValid = undefined;
|
|
49
|
+
this.limitStylingAppends = false;
|
|
50
|
+
this.showTooltip = false;
|
|
51
|
+
}
|
|
52
|
+
handleStylingChange(newValue, oldValue) {
|
|
53
|
+
if (newValue !== oldValue)
|
|
54
|
+
this.setClientStyling();
|
|
49
55
|
}
|
|
50
56
|
validityChanged() {
|
|
51
57
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -138,8 +144,8 @@ export class SelectInput {
|
|
|
138
144
|
if (this.touched) {
|
|
139
145
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
140
146
|
}
|
|
141
|
-
return h("div", { key: '
|
|
142
|
-
h("img", { key: '
|
|
147
|
+
return h("div", { key: 'f02c73635c87a1937f4718c9de8df3aae8397815', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '26bf79a073dd4c84570e380b1f36bfe848fec568', class: 'select__wrapper--flex' }, h("label", { key: '6eaafabe58a2dd4e1604ac2e3d55d001e2c4bc7c', class: 'select__label', htmlFor: `${this.name}__input` }, `${this.displayName} ${this.validation.mandatory ? '*' : ''}`), h("div", { key: 'a1de9c4bd3dd4158b26004c6df9dca5915f73978', class: 'select__wrapper--relative' }, this.tooltip &&
|
|
148
|
+
h("img", { key: '5cb869c82f53a463c91cd060fad5520d2fbc3d0d', class: 'select__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-combo-box", { key: '2e94c1faa107657034a98d70b1e98d5c5ab5caa5', name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", readOnly: this.autofilled, required: this.validation.mandatory, value: this.defaultValue, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleChange, onBlur: this.handleBlur }), h("small", { key: '2c8162576d30265ea49cdc6d99071f614d833d7e', class: 'select__error-message' }, this.errorMessage));
|
|
143
149
|
}
|
|
144
150
|
static get is() { return "select-input"; }
|
|
145
151
|
static get encapsulation() { return "shadow"; }
|
|
@@ -169,8 +175,6 @@ export class SelectInput {
|
|
|
169
175
|
"tags": [],
|
|
170
176
|
"text": "Name of the input."
|
|
171
177
|
},
|
|
172
|
-
"getter": false,
|
|
173
|
-
"setter": false,
|
|
174
178
|
"attribute": "name",
|
|
175
179
|
"reflect": true
|
|
176
180
|
},
|
|
@@ -188,8 +192,6 @@ export class SelectInput {
|
|
|
188
192
|
"tags": [],
|
|
189
193
|
"text": "Name of input to be shown to the user."
|
|
190
194
|
},
|
|
191
|
-
"getter": false,
|
|
192
|
-
"setter": false,
|
|
193
195
|
"attribute": "display-name",
|
|
194
196
|
"reflect": true
|
|
195
197
|
},
|
|
@@ -207,8 +209,6 @@ export class SelectInput {
|
|
|
207
209
|
"tags": [],
|
|
208
210
|
"text": "Placeholder text to be shown."
|
|
209
211
|
},
|
|
210
|
-
"getter": false,
|
|
211
|
-
"setter": false,
|
|
212
212
|
"attribute": "placeholder",
|
|
213
213
|
"reflect": true
|
|
214
214
|
},
|
|
@@ -226,8 +226,6 @@ export class SelectInput {
|
|
|
226
226
|
"tags": [],
|
|
227
227
|
"text": "Special behaviour an input should have. Can be fetching for data."
|
|
228
228
|
},
|
|
229
|
-
"getter": false,
|
|
230
|
-
"setter": false,
|
|
231
229
|
"attribute": "action",
|
|
232
230
|
"reflect": true
|
|
233
231
|
},
|
|
@@ -245,8 +243,6 @@ export class SelectInput {
|
|
|
245
243
|
"tags": [],
|
|
246
244
|
"text": "Default value for the input."
|
|
247
245
|
},
|
|
248
|
-
"getter": false,
|
|
249
|
-
"setter": false,
|
|
250
246
|
"attribute": "default-value",
|
|
251
247
|
"reflect": true,
|
|
252
248
|
"defaultValue": "''"
|
|
@@ -265,8 +261,6 @@ export class SelectInput {
|
|
|
265
261
|
"tags": [],
|
|
266
262
|
"text": "Boolean. Determines if input should be readonly."
|
|
267
263
|
},
|
|
268
|
-
"getter": false,
|
|
269
|
-
"setter": false,
|
|
270
264
|
"attribute": "autofilled",
|
|
271
265
|
"reflect": true
|
|
272
266
|
},
|
|
@@ -284,8 +278,6 @@ export class SelectInput {
|
|
|
284
278
|
"tags": [],
|
|
285
279
|
"text": "Tooltip text."
|
|
286
280
|
},
|
|
287
|
-
"getter": false,
|
|
288
|
-
"setter": false,
|
|
289
281
|
"attribute": "tooltip",
|
|
290
282
|
"reflect": true
|
|
291
283
|
},
|
|
@@ -309,8 +301,6 @@ export class SelectInput {
|
|
|
309
301
|
"tags": [],
|
|
310
302
|
"text": "Options of the input."
|
|
311
303
|
},
|
|
312
|
-
"getter": false,
|
|
313
|
-
"setter": false,
|
|
314
304
|
"defaultValue": "[]"
|
|
315
305
|
},
|
|
316
306
|
"validation": {
|
|
@@ -332,9 +322,7 @@ export class SelectInput {
|
|
|
332
322
|
"docs": {
|
|
333
323
|
"tags": [],
|
|
334
324
|
"text": "Object of validation rules for the input."
|
|
335
|
-
}
|
|
336
|
-
"getter": false,
|
|
337
|
-
"setter": false
|
|
325
|
+
}
|
|
338
326
|
},
|
|
339
327
|
"language": {
|
|
340
328
|
"type": "string",
|
|
@@ -350,8 +338,6 @@ export class SelectInput {
|
|
|
350
338
|
"tags": [],
|
|
351
339
|
"text": "Currently selected language."
|
|
352
340
|
},
|
|
353
|
-
"getter": false,
|
|
354
|
-
"setter": false,
|
|
355
341
|
"attribute": "language",
|
|
356
342
|
"reflect": true
|
|
357
343
|
},
|
|
@@ -369,8 +355,6 @@ export class SelectInput {
|
|
|
369
355
|
"tags": [],
|
|
370
356
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
371
357
|
},
|
|
372
|
-
"getter": false,
|
|
373
|
-
"setter": false,
|
|
374
358
|
"attribute": "emit-value",
|
|
375
359
|
"reflect": true
|
|
376
360
|
},
|
|
@@ -388,8 +372,6 @@ export class SelectInput {
|
|
|
388
372
|
"tags": [],
|
|
389
373
|
"text": "Client custom styling via inline style"
|
|
390
374
|
},
|
|
391
|
-
"getter": false,
|
|
392
|
-
"setter": false,
|
|
393
375
|
"attribute": "client-styling",
|
|
394
376
|
"reflect": true,
|
|
395
377
|
"defaultValue": "''"
|
|
@@ -452,6 +434,9 @@ export class SelectInput {
|
|
|
452
434
|
static get elementRef() { return "element"; }
|
|
453
435
|
static get watchers() {
|
|
454
436
|
return [{
|
|
437
|
+
"propName": "clientStyling",
|
|
438
|
+
"methodName": "handleStylingChange"
|
|
439
|
+
}, {
|
|
455
440
|
"propName": "isValid",
|
|
456
441
|
"methodName": "validityChanged"
|
|
457
442
|
}, {
|
|
@@ -4,12 +4,6 @@ import "@vaadin/combo-box";
|
|
|
4
4
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
5
5
|
export class TelInput {
|
|
6
6
|
constructor() {
|
|
7
|
-
/**
|
|
8
|
-
* Client custom styling via inline style
|
|
9
|
-
*/
|
|
10
|
-
this.clientStyling = '';
|
|
11
|
-
this.limitStylingAppends = false;
|
|
12
|
-
this.showTooltip = false;
|
|
13
7
|
this.validationPattern = '';
|
|
14
8
|
this.touched = false;
|
|
15
9
|
this.handleInput = (event) => {
|
|
@@ -35,6 +29,26 @@ export class TelInput {
|
|
|
35
29
|
sheet.innerHTML = this.clientStyling;
|
|
36
30
|
this.stylingContainer.prepend(sheet);
|
|
37
31
|
};
|
|
32
|
+
this.name = undefined;
|
|
33
|
+
this.displayName = undefined;
|
|
34
|
+
this.placeholder = undefined;
|
|
35
|
+
this.showLabels = undefined;
|
|
36
|
+
this.action = undefined;
|
|
37
|
+
this.validation = undefined;
|
|
38
|
+
this.defaultValue = undefined;
|
|
39
|
+
this.autofilled = undefined;
|
|
40
|
+
this.tooltip = undefined;
|
|
41
|
+
this.language = undefined;
|
|
42
|
+
this.emitValue = undefined;
|
|
43
|
+
this.clientStyling = '';
|
|
44
|
+
this.isValid = undefined;
|
|
45
|
+
this.errorMessage = undefined;
|
|
46
|
+
this.limitStylingAppends = false;
|
|
47
|
+
this.showTooltip = false;
|
|
48
|
+
}
|
|
49
|
+
handleStylingChange(newValue, oldValue) {
|
|
50
|
+
if (newValue !== oldValue)
|
|
51
|
+
this.setClientStyling();
|
|
38
52
|
}
|
|
39
53
|
validityChanged() {
|
|
40
54
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -146,8 +160,8 @@ export class TelInput {
|
|
|
146
160
|
if (this.touched) {
|
|
147
161
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
148
162
|
}
|
|
149
|
-
return h("div", { key: '
|
|
150
|
-
h("img", { key: '
|
|
163
|
+
return h("div", { key: 'f0f70d8568ba083ee19f9e73e5921104f599e15f', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '8da9e1c2a6b3ca19caff07540f0218266de22bb2', class: 'tel__wrapper--flex-label' }, h("label", { key: 'd0d90bc96e3ea853f401bae9be3f033d4cfd9b17', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'fdf7929f51edcbea8568b35804b0d9e9a93a7249', class: 'tel__wrapper--relative' }, this.tooltip &&
|
|
164
|
+
h("img", { key: '0fbc9b5e8c5feef727caa71ef07d4ae80007e04a', class: 'tel__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: 'b4a11808a7ae5e5cddce47b51a51003bce3a84f8', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '2d81ff4c11e559f302a8446816f4aca0de2cfcef', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.autofilled, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: 'ab52185589bf4d52205bad4cecc9c7ecb54cd409', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: this.phoneValue, placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: '6d219de32297bc2fab31995b5a33b14f2eea21d9', class: 'tel__error-message' }, this.errorMessage));
|
|
151
165
|
}
|
|
152
166
|
static get is() { return "tel-input"; }
|
|
153
167
|
static get encapsulation() { return "shadow"; }
|
|
@@ -177,8 +191,6 @@ export class TelInput {
|
|
|
177
191
|
"tags": [],
|
|
178
192
|
"text": "Name of the input."
|
|
179
193
|
},
|
|
180
|
-
"getter": false,
|
|
181
|
-
"setter": false,
|
|
182
194
|
"attribute": "name",
|
|
183
195
|
"reflect": true
|
|
184
196
|
},
|
|
@@ -196,8 +208,6 @@ export class TelInput {
|
|
|
196
208
|
"tags": [],
|
|
197
209
|
"text": "Name of input to be shown to the user."
|
|
198
210
|
},
|
|
199
|
-
"getter": false,
|
|
200
|
-
"setter": false,
|
|
201
211
|
"attribute": "display-name",
|
|
202
212
|
"reflect": true
|
|
203
213
|
},
|
|
@@ -215,8 +225,6 @@ export class TelInput {
|
|
|
215
225
|
"tags": [],
|
|
216
226
|
"text": "Placeholder text to be shown."
|
|
217
227
|
},
|
|
218
|
-
"getter": false,
|
|
219
|
-
"setter": false,
|
|
220
228
|
"attribute": "placeholder",
|
|
221
229
|
"reflect": true
|
|
222
230
|
},
|
|
@@ -234,8 +242,6 @@ export class TelInput {
|
|
|
234
242
|
"tags": [],
|
|
235
243
|
"text": "Boolean that defines if the widget show labels or placeholders."
|
|
236
244
|
},
|
|
237
|
-
"getter": false,
|
|
238
|
-
"setter": false,
|
|
239
245
|
"attribute": "show-labels",
|
|
240
246
|
"reflect": true
|
|
241
247
|
},
|
|
@@ -253,8 +259,6 @@ export class TelInput {
|
|
|
253
259
|
"tags": [],
|
|
254
260
|
"text": "Special behaviour an input should have. Can be fetching for data."
|
|
255
261
|
},
|
|
256
|
-
"getter": false,
|
|
257
|
-
"setter": false,
|
|
258
262
|
"attribute": "action",
|
|
259
263
|
"reflect": true
|
|
260
264
|
},
|
|
@@ -277,9 +281,7 @@ export class TelInput {
|
|
|
277
281
|
"docs": {
|
|
278
282
|
"tags": [],
|
|
279
283
|
"text": "Object of validation rules for the input."
|
|
280
|
-
}
|
|
281
|
-
"getter": false,
|
|
282
|
-
"setter": false
|
|
284
|
+
}
|
|
283
285
|
},
|
|
284
286
|
"defaultValue": {
|
|
285
287
|
"type": "any",
|
|
@@ -295,8 +297,6 @@ export class TelInput {
|
|
|
295
297
|
"tags": [],
|
|
296
298
|
"text": "Default value for the input."
|
|
297
299
|
},
|
|
298
|
-
"getter": false,
|
|
299
|
-
"setter": false,
|
|
300
300
|
"attribute": "default-value",
|
|
301
301
|
"reflect": true
|
|
302
302
|
},
|
|
@@ -314,8 +314,6 @@ export class TelInput {
|
|
|
314
314
|
"tags": [],
|
|
315
315
|
"text": "Boolean. Determines if input should be readonly."
|
|
316
316
|
},
|
|
317
|
-
"getter": false,
|
|
318
|
-
"setter": false,
|
|
319
317
|
"attribute": "autofilled",
|
|
320
318
|
"reflect": true
|
|
321
319
|
},
|
|
@@ -333,8 +331,6 @@ export class TelInput {
|
|
|
333
331
|
"tags": [],
|
|
334
332
|
"text": "Tooltip text."
|
|
335
333
|
},
|
|
336
|
-
"getter": false,
|
|
337
|
-
"setter": false,
|
|
338
334
|
"attribute": "tooltip",
|
|
339
335
|
"reflect": true
|
|
340
336
|
},
|
|
@@ -352,8 +348,6 @@ export class TelInput {
|
|
|
352
348
|
"tags": [],
|
|
353
349
|
"text": "Currently selected language."
|
|
354
350
|
},
|
|
355
|
-
"getter": false,
|
|
356
|
-
"setter": false,
|
|
357
351
|
"attribute": "language",
|
|
358
352
|
"reflect": true
|
|
359
353
|
},
|
|
@@ -371,8 +365,6 @@ export class TelInput {
|
|
|
371
365
|
"tags": [],
|
|
372
366
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
373
367
|
},
|
|
374
|
-
"getter": false,
|
|
375
|
-
"setter": false,
|
|
376
368
|
"attribute": "emit-value",
|
|
377
369
|
"reflect": true
|
|
378
370
|
},
|
|
@@ -390,8 +382,6 @@ export class TelInput {
|
|
|
390
382
|
"tags": [],
|
|
391
383
|
"text": "Client custom styling via inline style"
|
|
392
384
|
},
|
|
393
|
-
"getter": false,
|
|
394
|
-
"setter": false,
|
|
395
385
|
"attribute": "client-styling",
|
|
396
386
|
"reflect": true,
|
|
397
387
|
"defaultValue": "''"
|
|
@@ -453,6 +443,9 @@ export class TelInput {
|
|
|
453
443
|
}
|
|
454
444
|
static get watchers() {
|
|
455
445
|
return [{
|
|
446
|
+
"propName": "clientStyling",
|
|
447
|
+
"methodName": "handleStylingChange"
|
|
448
|
+
}, {
|
|
456
449
|
"propName": "isValid",
|
|
457
450
|
"methodName": "validityChanged"
|
|
458
451
|
}, {
|
|
@@ -3,17 +3,6 @@ import { translate } from "../../utils/locale.utils";
|
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
4
|
export class TextInput {
|
|
5
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
6
|
this.value = '';
|
|
18
7
|
this.validationPattern = '';
|
|
19
8
|
this.duplicateInputValue = null;
|
|
@@ -43,6 +32,26 @@ export class TextInput {
|
|
|
43
32
|
sheet.innerHTML = this.clientStyling;
|
|
44
33
|
this.stylingContainer.prepend(sheet);
|
|
45
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
|
+
handleStylingChange(newValue, oldValue) {
|
|
53
|
+
if (newValue !== oldValue)
|
|
54
|
+
this.setClientStyling();
|
|
46
55
|
}
|
|
47
56
|
validityChanged() {
|
|
48
57
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -149,8 +158,8 @@ export class TextInput {
|
|
|
149
158
|
if (this.touched) {
|
|
150
159
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
151
160
|
}
|
|
152
|
-
return h("div", { key: '
|
|
153
|
-
h("img", { key: '
|
|
161
|
+
return h("div", { key: 'e297f841a57c6acf854535a786916aa641831556', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '7fd284a58e58d5c61a03caf4cc317b8dd9dbd82f', class: 'text__wrapper--flex' }, h("label", { key: 'f80a2003386ec867e5310190a7568105c2912569', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e8f5197bd370100406d600be5a336f85f4c6934d', class: 'text__wrapper--relative' }, this.tooltip &&
|
|
162
|
+
h("img", { key: 'ff8c38fe3495a41a41ac4a1569169ce26a1ec9ce', class: 'text__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '581106e515810ab43f7d6b6eda504ccf23906b0e', name: this.name, id: `${this.name}__input`, value: this.defaultValue, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '20620710026982d5fb670a3173bab57a7fa9e7ce', class: 'text__error-message' }, this.errorMessage));
|
|
154
163
|
}
|
|
155
164
|
static get is() { return "text-input"; }
|
|
156
165
|
static get encapsulation() { return "shadow"; }
|
|
@@ -180,8 +189,6 @@ export class TextInput {
|
|
|
180
189
|
"tags": [],
|
|
181
190
|
"text": "Name of the input."
|
|
182
191
|
},
|
|
183
|
-
"getter": false,
|
|
184
|
-
"setter": false,
|
|
185
192
|
"attribute": "name",
|
|
186
193
|
"reflect": true
|
|
187
194
|
},
|
|
@@ -199,8 +206,6 @@ export class TextInput {
|
|
|
199
206
|
"tags": [],
|
|
200
207
|
"text": "Name of input to be shown to the user."
|
|
201
208
|
},
|
|
202
|
-
"getter": false,
|
|
203
|
-
"setter": false,
|
|
204
209
|
"attribute": "display-name",
|
|
205
210
|
"reflect": true
|
|
206
211
|
},
|
|
@@ -218,8 +223,6 @@ export class TextInput {
|
|
|
218
223
|
"tags": [],
|
|
219
224
|
"text": "Placeholder text to be shown."
|
|
220
225
|
},
|
|
221
|
-
"getter": false,
|
|
222
|
-
"setter": false,
|
|
223
226
|
"attribute": "placeholder",
|
|
224
227
|
"reflect": true
|
|
225
228
|
},
|
|
@@ -242,9 +245,7 @@ export class TextInput {
|
|
|
242
245
|
"docs": {
|
|
243
246
|
"tags": [],
|
|
244
247
|
"text": "Object of validation rules for the input."
|
|
245
|
-
}
|
|
246
|
-
"getter": false,
|
|
247
|
-
"setter": false
|
|
248
|
+
}
|
|
248
249
|
},
|
|
249
250
|
"defaultValue": {
|
|
250
251
|
"type": "string",
|
|
@@ -260,8 +261,6 @@ export class TextInput {
|
|
|
260
261
|
"tags": [],
|
|
261
262
|
"text": "Default value for the input."
|
|
262
263
|
},
|
|
263
|
-
"getter": false,
|
|
264
|
-
"setter": false,
|
|
265
264
|
"attribute": "default-value",
|
|
266
265
|
"reflect": true,
|
|
267
266
|
"defaultValue": "''"
|
|
@@ -280,8 +279,6 @@ export class TextInput {
|
|
|
280
279
|
"tags": [],
|
|
281
280
|
"text": "Boolean. Determines if input should be readonly."
|
|
282
281
|
},
|
|
283
|
-
"getter": false,
|
|
284
|
-
"setter": false,
|
|
285
282
|
"attribute": "autofilled",
|
|
286
283
|
"reflect": true
|
|
287
284
|
},
|
|
@@ -299,8 +296,6 @@ export class TextInput {
|
|
|
299
296
|
"tags": [],
|
|
300
297
|
"text": "Tooltip text."
|
|
301
298
|
},
|
|
302
|
-
"getter": false,
|
|
303
|
-
"setter": false,
|
|
304
299
|
"attribute": "tooltip",
|
|
305
300
|
"reflect": true
|
|
306
301
|
},
|
|
@@ -318,8 +313,6 @@ export class TextInput {
|
|
|
318
313
|
"tags": [],
|
|
319
314
|
"text": "Currently selected language."
|
|
320
315
|
},
|
|
321
|
-
"getter": false,
|
|
322
|
-
"setter": false,
|
|
323
316
|
"attribute": "language",
|
|
324
317
|
"reflect": true
|
|
325
318
|
},
|
|
@@ -337,8 +330,6 @@ export class TextInput {
|
|
|
337
330
|
"tags": [],
|
|
338
331
|
"text": "State passed down from the parent element. Will trigger the input to check for validity."
|
|
339
332
|
},
|
|
340
|
-
"getter": false,
|
|
341
|
-
"setter": false,
|
|
342
333
|
"attribute": "check-validity",
|
|
343
334
|
"reflect": true
|
|
344
335
|
},
|
|
@@ -356,8 +347,6 @@ export class TextInput {
|
|
|
356
347
|
"tags": [],
|
|
357
348
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
358
349
|
},
|
|
359
|
-
"getter": false,
|
|
360
|
-
"setter": false,
|
|
361
350
|
"attribute": "emit-value",
|
|
362
351
|
"reflect": true
|
|
363
352
|
},
|
|
@@ -375,8 +364,6 @@ export class TextInput {
|
|
|
375
364
|
"tags": [],
|
|
376
365
|
"text": "Boolean that triggers certain validation rules, for duplicated inputs."
|
|
377
366
|
},
|
|
378
|
-
"getter": false,
|
|
379
|
-
"setter": false,
|
|
380
367
|
"attribute": "is-duplicate-input",
|
|
381
368
|
"reflect": true
|
|
382
369
|
},
|
|
@@ -394,8 +381,6 @@ export class TextInput {
|
|
|
394
381
|
"tags": [],
|
|
395
382
|
"text": "Client custom styling via inline style"
|
|
396
383
|
},
|
|
397
|
-
"getter": false,
|
|
398
|
-
"setter": false,
|
|
399
384
|
"attribute": "client-styling",
|
|
400
385
|
"reflect": true,
|
|
401
386
|
"defaultValue": "''"
|
|
@@ -457,6 +442,9 @@ export class TextInput {
|
|
|
457
442
|
}
|
|
458
443
|
static get watchers() {
|
|
459
444
|
return [{
|
|
445
|
+
"propName": "clientStyling",
|
|
446
|
+
"methodName": "handleStylingChange"
|
|
447
|
+
}, {
|
|
460
448
|
"propName": "isValid",
|
|
461
449
|
"methodName": "validityChanged"
|
|
462
450
|
}, {
|