@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,12 +3,6 @@ import { translate } from "../../utils/locale.utils";
|
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
4
|
export class EmailInput {
|
|
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.validationPattern = '';
|
|
13
7
|
this.touched = false;
|
|
14
8
|
this.handleInput = (event) => {
|
|
@@ -33,6 +27,25 @@ export class EmailInput {
|
|
|
33
27
|
sheet.innerHTML = this.clientStyling;
|
|
34
28
|
this.stylingContainer.prepend(sheet);
|
|
35
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.isDuplicateInput = undefined;
|
|
40
|
+
this.clientStyling = '';
|
|
41
|
+
this.errorMessage = undefined;
|
|
42
|
+
this.isValid = undefined;
|
|
43
|
+
this.limitStylingAppends = false;
|
|
44
|
+
this.showTooltip = false;
|
|
45
|
+
}
|
|
46
|
+
handleStylingChange(newValue, oldValue) {
|
|
47
|
+
if (newValue !== oldValue)
|
|
48
|
+
this.setClientStyling();
|
|
36
49
|
}
|
|
37
50
|
validityChanged() {
|
|
38
51
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -122,8 +135,8 @@ export class EmailInput {
|
|
|
122
135
|
if (this.touched) {
|
|
123
136
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
124
137
|
}
|
|
125
|
-
return h("div", { key: '
|
|
126
|
-
h("img", { key: '
|
|
138
|
+
return h("div", { key: 'a46093cfafc840d2fd563ee9676ccd2f16fb1620', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '2eab4a96efc36cdb94e9f92b2a161e208f0ebcd4', class: 'email__wrapper--flex' }, h("label", { key: 'f5ed857f61ea6763c5fe88590732258b4dedac1b', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '58cadc7857cd91dec968852be71e0108f55fbda7', class: 'email__wrapper--relative' }, this.tooltip &&
|
|
139
|
+
h("img", { key: '03009d036fde1c36b9348ac45cefa3389194260c', class: 'email__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'b2a9fd96ed301df5f1d7cf6f5a2a5b52f96ab189', 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 }), h("small", { key: 'edb17f53141a3406bfc657f80098b914044a8894', class: 'email__error-message' }, this.errorMessage));
|
|
127
140
|
}
|
|
128
141
|
static get is() { return "email-input"; }
|
|
129
142
|
static get encapsulation() { return "shadow"; }
|
|
@@ -153,8 +166,6 @@ export class EmailInput {
|
|
|
153
166
|
"tags": [],
|
|
154
167
|
"text": "Name of the input."
|
|
155
168
|
},
|
|
156
|
-
"getter": false,
|
|
157
|
-
"setter": false,
|
|
158
169
|
"attribute": "name",
|
|
159
170
|
"reflect": true
|
|
160
171
|
},
|
|
@@ -172,8 +183,6 @@ export class EmailInput {
|
|
|
172
183
|
"tags": [],
|
|
173
184
|
"text": "Name of input to be shown to the user."
|
|
174
185
|
},
|
|
175
|
-
"getter": false,
|
|
176
|
-
"setter": false,
|
|
177
186
|
"attribute": "display-name",
|
|
178
187
|
"reflect": true
|
|
179
188
|
},
|
|
@@ -191,8 +200,6 @@ export class EmailInput {
|
|
|
191
200
|
"tags": [],
|
|
192
201
|
"text": "Placeholder text to be shown."
|
|
193
202
|
},
|
|
194
|
-
"getter": false,
|
|
195
|
-
"setter": false,
|
|
196
203
|
"attribute": "placeholder",
|
|
197
204
|
"reflect": true
|
|
198
205
|
},
|
|
@@ -215,9 +222,7 @@ export class EmailInput {
|
|
|
215
222
|
"docs": {
|
|
216
223
|
"tags": [],
|
|
217
224
|
"text": "Object of validation rules for the input."
|
|
218
|
-
}
|
|
219
|
-
"getter": false,
|
|
220
|
-
"setter": false
|
|
225
|
+
}
|
|
221
226
|
},
|
|
222
227
|
"defaultValue": {
|
|
223
228
|
"type": "string",
|
|
@@ -233,8 +238,6 @@ export class EmailInput {
|
|
|
233
238
|
"tags": [],
|
|
234
239
|
"text": "Default value for the input."
|
|
235
240
|
},
|
|
236
|
-
"getter": false,
|
|
237
|
-
"setter": false,
|
|
238
241
|
"attribute": "default-value",
|
|
239
242
|
"reflect": true
|
|
240
243
|
},
|
|
@@ -252,8 +255,6 @@ export class EmailInput {
|
|
|
252
255
|
"tags": [],
|
|
253
256
|
"text": "Boolean. Determines if input should be readonly."
|
|
254
257
|
},
|
|
255
|
-
"getter": false,
|
|
256
|
-
"setter": false,
|
|
257
258
|
"attribute": "autofilled",
|
|
258
259
|
"reflect": true
|
|
259
260
|
},
|
|
@@ -271,8 +272,6 @@ export class EmailInput {
|
|
|
271
272
|
"tags": [],
|
|
272
273
|
"text": "Tooltip text."
|
|
273
274
|
},
|
|
274
|
-
"getter": false,
|
|
275
|
-
"setter": false,
|
|
276
275
|
"attribute": "tooltip",
|
|
277
276
|
"reflect": true
|
|
278
277
|
},
|
|
@@ -290,8 +289,6 @@ export class EmailInput {
|
|
|
290
289
|
"tags": [],
|
|
291
290
|
"text": "Currently selected language."
|
|
292
291
|
},
|
|
293
|
-
"getter": false,
|
|
294
|
-
"setter": false,
|
|
295
292
|
"attribute": "language",
|
|
296
293
|
"reflect": true
|
|
297
294
|
},
|
|
@@ -309,8 +306,6 @@ export class EmailInput {
|
|
|
309
306
|
"tags": [],
|
|
310
307
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
311
308
|
},
|
|
312
|
-
"getter": false,
|
|
313
|
-
"setter": false,
|
|
314
309
|
"attribute": "emit-value",
|
|
315
310
|
"reflect": true
|
|
316
311
|
},
|
|
@@ -328,8 +323,6 @@ export class EmailInput {
|
|
|
328
323
|
"tags": [],
|
|
329
324
|
"text": "Flag for duplicate inputs, it sets up the input for certain validation rules."
|
|
330
325
|
},
|
|
331
|
-
"getter": false,
|
|
332
|
-
"setter": false,
|
|
333
326
|
"attribute": "is-duplicate-input",
|
|
334
327
|
"reflect": true
|
|
335
328
|
},
|
|
@@ -347,8 +340,6 @@ export class EmailInput {
|
|
|
347
340
|
"tags": [],
|
|
348
341
|
"text": "Client custom styling via inline style"
|
|
349
342
|
},
|
|
350
|
-
"getter": false,
|
|
351
|
-
"setter": false,
|
|
352
343
|
"attribute": "client-styling",
|
|
353
344
|
"reflect": true,
|
|
354
345
|
"defaultValue": "''"
|
|
@@ -410,6 +401,9 @@ export class EmailInput {
|
|
|
410
401
|
}
|
|
411
402
|
static get watchers() {
|
|
412
403
|
return [{
|
|
404
|
+
"propName": "clientStyling",
|
|
405
|
+
"methodName": "handleStylingChange"
|
|
406
|
+
}, {
|
|
413
407
|
"propName": "isValid",
|
|
414
408
|
"methodName": "validityChanged"
|
|
415
409
|
}, {
|
|
@@ -2,28 +2,29 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import { getTranslations } from "../../utils/locale.utils";
|
|
3
3
|
export class GeneralInput {
|
|
4
4
|
constructor() {
|
|
5
|
-
/**
|
|
6
|
-
* Type the general-input should take. Can take the default HTML input values.
|
|
7
|
-
*/
|
|
8
|
-
this.type = 'text';
|
|
9
|
-
/**
|
|
10
|
-
* Client custom styling via inline style
|
|
11
|
-
*/
|
|
12
|
-
this.clientStyling = '';
|
|
13
|
-
/**
|
|
14
|
-
* Translations via URL
|
|
15
|
-
*/
|
|
16
|
-
this.translationUrl = '';
|
|
17
|
-
/**
|
|
18
|
-
* Emit event on click
|
|
19
|
-
*/
|
|
20
|
-
this.emitOnClick = false;
|
|
21
5
|
this.handleClick = (event) => {
|
|
22
6
|
if (this.emitOnClick) {
|
|
23
7
|
event.stopPropagation();
|
|
24
8
|
window.postMessage({ type: `registration${this.name}Clicked` }, window.location.href);
|
|
25
9
|
}
|
|
26
10
|
};
|
|
11
|
+
this.type = 'text';
|
|
12
|
+
this.name = undefined;
|
|
13
|
+
this.displayName = undefined;
|
|
14
|
+
this.placeholder = undefined;
|
|
15
|
+
this.action = undefined;
|
|
16
|
+
this.validation = undefined;
|
|
17
|
+
this.options = undefined;
|
|
18
|
+
this.language = undefined;
|
|
19
|
+
this.autofilled = undefined;
|
|
20
|
+
this.tooltip = undefined;
|
|
21
|
+
this.defaultValue = undefined;
|
|
22
|
+
this.emitValue = undefined;
|
|
23
|
+
this.isDuplicateInput = undefined;
|
|
24
|
+
this.clientStyling = '';
|
|
25
|
+
this.dateFormat = undefined;
|
|
26
|
+
this.translationUrl = '';
|
|
27
|
+
this.emitOnClick = false;
|
|
27
28
|
}
|
|
28
29
|
connectedCallback() {
|
|
29
30
|
if (this.translationUrl) {
|
|
@@ -90,8 +91,6 @@ export class GeneralInput {
|
|
|
90
91
|
"tags": [],
|
|
91
92
|
"text": "Type the general-input should take. Can take the default HTML input values."
|
|
92
93
|
},
|
|
93
|
-
"getter": false,
|
|
94
|
-
"setter": false,
|
|
95
94
|
"attribute": "type",
|
|
96
95
|
"reflect": true,
|
|
97
96
|
"defaultValue": "'text'"
|
|
@@ -110,8 +109,6 @@ export class GeneralInput {
|
|
|
110
109
|
"tags": [],
|
|
111
110
|
"text": "Name of the input."
|
|
112
111
|
},
|
|
113
|
-
"getter": false,
|
|
114
|
-
"setter": false,
|
|
115
112
|
"attribute": "name",
|
|
116
113
|
"reflect": true
|
|
117
114
|
},
|
|
@@ -129,8 +126,6 @@ export class GeneralInput {
|
|
|
129
126
|
"tags": [],
|
|
130
127
|
"text": "Name of input to be shown to the user."
|
|
131
128
|
},
|
|
132
|
-
"getter": false,
|
|
133
|
-
"setter": false,
|
|
134
129
|
"attribute": "display-name",
|
|
135
130
|
"reflect": true
|
|
136
131
|
},
|
|
@@ -148,8 +143,6 @@ export class GeneralInput {
|
|
|
148
143
|
"tags": [],
|
|
149
144
|
"text": "Placeholder text to be shown."
|
|
150
145
|
},
|
|
151
|
-
"getter": false,
|
|
152
|
-
"setter": false,
|
|
153
146
|
"attribute": "placeholder",
|
|
154
147
|
"reflect": true
|
|
155
148
|
},
|
|
@@ -167,8 +160,6 @@ export class GeneralInput {
|
|
|
167
160
|
"tags": [],
|
|
168
161
|
"text": "Special behaviour an input should have. Can be fetching for data."
|
|
169
162
|
},
|
|
170
|
-
"getter": false,
|
|
171
|
-
"setter": false,
|
|
172
163
|
"attribute": "action",
|
|
173
164
|
"reflect": true
|
|
174
165
|
},
|
|
@@ -191,9 +182,7 @@ export class GeneralInput {
|
|
|
191
182
|
"docs": {
|
|
192
183
|
"tags": [],
|
|
193
184
|
"text": "Object of validation rules for the input."
|
|
194
|
-
}
|
|
195
|
-
"getter": false,
|
|
196
|
-
"setter": false
|
|
185
|
+
}
|
|
197
186
|
},
|
|
198
187
|
"options": {
|
|
199
188
|
"type": "any",
|
|
@@ -209,8 +198,6 @@ export class GeneralInput {
|
|
|
209
198
|
"tags": [],
|
|
210
199
|
"text": "For input elements that have multiple options or choises."
|
|
211
200
|
},
|
|
212
|
-
"getter": false,
|
|
213
|
-
"setter": false,
|
|
214
201
|
"attribute": "options",
|
|
215
202
|
"reflect": true
|
|
216
203
|
},
|
|
@@ -228,8 +215,6 @@ export class GeneralInput {
|
|
|
228
215
|
"tags": [],
|
|
229
216
|
"text": "Currently selected language."
|
|
230
217
|
},
|
|
231
|
-
"getter": false,
|
|
232
|
-
"setter": false,
|
|
233
218
|
"attribute": "language",
|
|
234
219
|
"reflect": true
|
|
235
220
|
},
|
|
@@ -247,8 +232,6 @@ export class GeneralInput {
|
|
|
247
232
|
"tags": [],
|
|
248
233
|
"text": "Boolean. Determines if input should be readonly."
|
|
249
234
|
},
|
|
250
|
-
"getter": false,
|
|
251
|
-
"setter": false,
|
|
252
235
|
"attribute": "autofilled",
|
|
253
236
|
"reflect": true
|
|
254
237
|
},
|
|
@@ -266,8 +249,6 @@ export class GeneralInput {
|
|
|
266
249
|
"tags": [],
|
|
267
250
|
"text": "Tooltip text."
|
|
268
251
|
},
|
|
269
|
-
"getter": false,
|
|
270
|
-
"setter": false,
|
|
271
252
|
"attribute": "tooltip",
|
|
272
253
|
"reflect": true
|
|
273
254
|
},
|
|
@@ -285,8 +266,6 @@ export class GeneralInput {
|
|
|
285
266
|
"tags": [],
|
|
286
267
|
"text": "Default value for the input."
|
|
287
268
|
},
|
|
288
|
-
"getter": false,
|
|
289
|
-
"setter": false,
|
|
290
269
|
"attribute": "default-value",
|
|
291
270
|
"reflect": true
|
|
292
271
|
},
|
|
@@ -304,8 +283,6 @@ export class GeneralInput {
|
|
|
304
283
|
"tags": [],
|
|
305
284
|
"text": "State passed down from the parent element. Will trigger the child specialised input to send it's value through an event."
|
|
306
285
|
},
|
|
307
|
-
"getter": false,
|
|
308
|
-
"setter": false,
|
|
309
286
|
"attribute": "emit-value",
|
|
310
287
|
"reflect": true
|
|
311
288
|
},
|
|
@@ -323,8 +300,6 @@ export class GeneralInput {
|
|
|
323
300
|
"tags": [],
|
|
324
301
|
"text": "Boolean that triggers certain validation rules, for duplicated inputs."
|
|
325
302
|
},
|
|
326
|
-
"getter": false,
|
|
327
|
-
"setter": false,
|
|
328
303
|
"attribute": "is-duplicate-input",
|
|
329
304
|
"reflect": true
|
|
330
305
|
},
|
|
@@ -342,8 +317,6 @@ export class GeneralInput {
|
|
|
342
317
|
"tags": [],
|
|
343
318
|
"text": "Client custom styling via inline style"
|
|
344
319
|
},
|
|
345
|
-
"getter": false,
|
|
346
|
-
"setter": false,
|
|
347
320
|
"attribute": "client-styling",
|
|
348
321
|
"reflect": true,
|
|
349
322
|
"defaultValue": "''"
|
|
@@ -362,8 +335,6 @@ export class GeneralInput {
|
|
|
362
335
|
"tags": [],
|
|
363
336
|
"text": "Date format for date picker."
|
|
364
337
|
},
|
|
365
|
-
"getter": false,
|
|
366
|
-
"setter": false,
|
|
367
338
|
"attribute": "date-format",
|
|
368
339
|
"reflect": true
|
|
369
340
|
},
|
|
@@ -381,8 +352,6 @@ export class GeneralInput {
|
|
|
381
352
|
"tags": [],
|
|
382
353
|
"text": "Translations via URL"
|
|
383
354
|
},
|
|
384
|
-
"getter": false,
|
|
385
|
-
"setter": false,
|
|
386
355
|
"attribute": "translation-url",
|
|
387
356
|
"reflect": true,
|
|
388
357
|
"defaultValue": "''"
|
|
@@ -401,8 +370,6 @@ export class GeneralInput {
|
|
|
401
370
|
"tags": [],
|
|
402
371
|
"text": "Emit event on click"
|
|
403
372
|
},
|
|
404
|
-
"getter": false,
|
|
405
|
-
"setter": false,
|
|
406
373
|
"attribute": "emit-on-click",
|
|
407
374
|
"reflect": true,
|
|
408
375
|
"defaultValue": "false"
|
|
@@ -3,12 +3,6 @@ import { translate } from "../../utils/locale.utils";
|
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
4
|
export class NumberInput {
|
|
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.validationPattern = '';
|
|
13
7
|
this.touched = false;
|
|
14
8
|
this.handleInput = (event) => {
|
|
@@ -33,6 +27,24 @@ export class NumberInput {
|
|
|
33
27
|
sheet.innerHTML = this.clientStyling;
|
|
34
28
|
this.stylingContainer.prepend(sheet);
|
|
35
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;
|
|
44
|
+
}
|
|
45
|
+
handleStylingChange(newValue, oldValue) {
|
|
46
|
+
if (newValue !== oldValue)
|
|
47
|
+
this.setClientStyling();
|
|
36
48
|
}
|
|
37
49
|
validityChanged() {
|
|
38
50
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -110,8 +122,8 @@ export class NumberInput {
|
|
|
110
122
|
if (this.touched) {
|
|
111
123
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
112
124
|
}
|
|
113
|
-
return h("div", { key: '
|
|
114
|
-
h("img", { key: '
|
|
125
|
+
return h("div", { key: '841265bba6b75cc61a0eac1450c3f5aa5f917a2e', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '645c7817cf5a0bdc352de9d8c0698fde235aa6d3', class: 'number__wrapper--flex' }, h("label", { key: '3343cbbb8482b71cd152161a8d422f318f07f3fe', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '1f3341b2127095870610fc0e0b4b5d220c5d2e2c', class: 'number__wrapper--relative' }, this.tooltip &&
|
|
126
|
+
h("img", { key: '8bbe2fe9f62347cbcd37b753d4a1b0718dc39091', class: 'number__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '100401abdc33069f34e27e0807c9f31ddf7e42ec', 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: 'db1e0043bb9b6de2ad8e18f49f96152b9451b93c', class: 'number__error-message' }, this.errorMessage));
|
|
115
127
|
}
|
|
116
128
|
static get is() { return "number-input"; }
|
|
117
129
|
static get encapsulation() { return "shadow"; }
|
|
@@ -141,8 +153,6 @@ export class NumberInput {
|
|
|
141
153
|
"tags": [],
|
|
142
154
|
"text": "Name of the input."
|
|
143
155
|
},
|
|
144
|
-
"getter": false,
|
|
145
|
-
"setter": false,
|
|
146
156
|
"attribute": "name",
|
|
147
157
|
"reflect": true
|
|
148
158
|
},
|
|
@@ -160,8 +170,6 @@ export class NumberInput {
|
|
|
160
170
|
"tags": [],
|
|
161
171
|
"text": "Name of input to be shown to the user."
|
|
162
172
|
},
|
|
163
|
-
"getter": false,
|
|
164
|
-
"setter": false,
|
|
165
173
|
"attribute": "display-name",
|
|
166
174
|
"reflect": true
|
|
167
175
|
},
|
|
@@ -179,8 +187,6 @@ export class NumberInput {
|
|
|
179
187
|
"tags": [],
|
|
180
188
|
"text": "Placeholder text to be shown."
|
|
181
189
|
},
|
|
182
|
-
"getter": false,
|
|
183
|
-
"setter": false,
|
|
184
190
|
"attribute": "placeholder",
|
|
185
191
|
"reflect": true
|
|
186
192
|
},
|
|
@@ -203,9 +209,7 @@ export class NumberInput {
|
|
|
203
209
|
"docs": {
|
|
204
210
|
"tags": [],
|
|
205
211
|
"text": "Object of validation rules for the input."
|
|
206
|
-
}
|
|
207
|
-
"getter": false,
|
|
208
|
-
"setter": false
|
|
212
|
+
}
|
|
209
213
|
},
|
|
210
214
|
"defaultValue": {
|
|
211
215
|
"type": "string",
|
|
@@ -221,8 +225,6 @@ export class NumberInput {
|
|
|
221
225
|
"tags": [],
|
|
222
226
|
"text": "Default value for the input."
|
|
223
227
|
},
|
|
224
|
-
"getter": false,
|
|
225
|
-
"setter": false,
|
|
226
228
|
"attribute": "default-value",
|
|
227
229
|
"reflect": true
|
|
228
230
|
},
|
|
@@ -240,8 +242,6 @@ export class NumberInput {
|
|
|
240
242
|
"tags": [],
|
|
241
243
|
"text": "Boolean. Determines if input should be readonly."
|
|
242
244
|
},
|
|
243
|
-
"getter": false,
|
|
244
|
-
"setter": false,
|
|
245
245
|
"attribute": "autofilled",
|
|
246
246
|
"reflect": true
|
|
247
247
|
},
|
|
@@ -259,8 +259,6 @@ export class NumberInput {
|
|
|
259
259
|
"tags": [],
|
|
260
260
|
"text": "Tooltip text."
|
|
261
261
|
},
|
|
262
|
-
"getter": false,
|
|
263
|
-
"setter": false,
|
|
264
262
|
"attribute": "tooltip",
|
|
265
263
|
"reflect": true
|
|
266
264
|
},
|
|
@@ -278,8 +276,6 @@ export class NumberInput {
|
|
|
278
276
|
"tags": [],
|
|
279
277
|
"text": "Currently selected language."
|
|
280
278
|
},
|
|
281
|
-
"getter": false,
|
|
282
|
-
"setter": false,
|
|
283
279
|
"attribute": "language",
|
|
284
280
|
"reflect": true
|
|
285
281
|
},
|
|
@@ -297,8 +293,6 @@ export class NumberInput {
|
|
|
297
293
|
"tags": [],
|
|
298
294
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
299
295
|
},
|
|
300
|
-
"getter": false,
|
|
301
|
-
"setter": false,
|
|
302
296
|
"attribute": "emit-value",
|
|
303
297
|
"reflect": true
|
|
304
298
|
},
|
|
@@ -316,8 +310,6 @@ export class NumberInput {
|
|
|
316
310
|
"tags": [],
|
|
317
311
|
"text": "Client custom styling via inline style"
|
|
318
312
|
},
|
|
319
|
-
"getter": false,
|
|
320
|
-
"setter": false,
|
|
321
313
|
"attribute": "client-styling",
|
|
322
314
|
"reflect": true,
|
|
323
315
|
"defaultValue": "''"
|
|
@@ -379,6 +371,9 @@ export class NumberInput {
|
|
|
379
371
|
}
|
|
380
372
|
static get watchers() {
|
|
381
373
|
return [{
|
|
374
|
+
"propName": "clientStyling",
|
|
375
|
+
"methodName": "handleStylingChange"
|
|
376
|
+
}, {
|
|
382
377
|
"propName": "isValid",
|
|
383
378
|
"methodName": "validityChanged"
|
|
384
379
|
}, {
|
|
@@ -4,17 +4,6 @@ import "@vaadin/password-field";
|
|
|
4
4
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
5
5
|
export class PasswordInput {
|
|
6
6
|
constructor() {
|
|
7
|
-
/**
|
|
8
|
-
* Default value for the input.
|
|
9
|
-
*/
|
|
10
|
-
this.defaultValue = '';
|
|
11
|
-
/**
|
|
12
|
-
* Client custom styling via inline style
|
|
13
|
-
*/
|
|
14
|
-
this.clientStyling = '';
|
|
15
|
-
this.limitStylingAppends = false;
|
|
16
|
-
this.showTooltip = false;
|
|
17
|
-
this.value = '';
|
|
18
7
|
this.touched = false;
|
|
19
8
|
this.originalValid = false;
|
|
20
9
|
this.validationPattern = '';
|
|
@@ -53,6 +42,28 @@ export class PasswordInput {
|
|
|
53
42
|
sheet.innerHTML = this.clientStyling;
|
|
54
43
|
this.stylingContainer.prepend(sheet);
|
|
55
44
|
};
|
|
45
|
+
this.name = undefined;
|
|
46
|
+
this.displayName = undefined;
|
|
47
|
+
this.placeholder = undefined;
|
|
48
|
+
this.defaultValue = '';
|
|
49
|
+
this.autofilled = undefined;
|
|
50
|
+
this.tooltip = undefined;
|
|
51
|
+
this.validation = undefined;
|
|
52
|
+
this.language = undefined;
|
|
53
|
+
this.emitValue = undefined;
|
|
54
|
+
this.isDuplicateInput = undefined;
|
|
55
|
+
this.clientStyling = '';
|
|
56
|
+
this.isValid = undefined;
|
|
57
|
+
this.errorMessage = undefined;
|
|
58
|
+
this.limitStylingAppends = false;
|
|
59
|
+
this.showTooltip = false;
|
|
60
|
+
this.passwordComplexity = undefined;
|
|
61
|
+
this.showPopup = undefined;
|
|
62
|
+
this.value = '';
|
|
63
|
+
}
|
|
64
|
+
handleStylingChange(newValue, oldValue) {
|
|
65
|
+
if (newValue !== oldValue)
|
|
66
|
+
this.setClientStyling();
|
|
56
67
|
}
|
|
57
68
|
validityChanged() {
|
|
58
69
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -212,8 +223,8 @@ export class PasswordInput {
|
|
|
212
223
|
if (this.touched) {
|
|
213
224
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
214
225
|
}
|
|
215
|
-
return h("div", { key: '
|
|
216
|
-
h("img", { key: '
|
|
226
|
+
return h("div", { key: '36d21c63dcd15b6de2d2de417ce97b520493cd16', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '3de600f4ccbf2ffe7a8a8858e9d5a483701dd4d7', class: 'password__wrapper--flex' }, h("label", { key: '74fee343f4d6adbbb22e88c5d51d3a471979d42e', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'd1f30d776c5612b1a5581859b929bee171105bf5', class: 'password__wrapper--relative' }, this.tooltip &&
|
|
227
|
+
h("img", { key: '932201990b5fa67f448d4ab8ca7f844f757d5e47', class: 'password__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: '83f00cb4452b60fd883efcd742d6eb463a8fc729', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), h("small", { key: '0f6f7ba5e9ec6f492f22a46ac77c7977f7a8e835', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity && this.showPopup && !this.isDuplicateInput && this.renderComplexityPopup());
|
|
217
228
|
}
|
|
218
229
|
static get is() { return "password-input"; }
|
|
219
230
|
static get encapsulation() { return "shadow"; }
|
|
@@ -243,8 +254,6 @@ export class PasswordInput {
|
|
|
243
254
|
"tags": [],
|
|
244
255
|
"text": "Name of the input."
|
|
245
256
|
},
|
|
246
|
-
"getter": false,
|
|
247
|
-
"setter": false,
|
|
248
257
|
"attribute": "name",
|
|
249
258
|
"reflect": true
|
|
250
259
|
},
|
|
@@ -262,8 +271,6 @@ export class PasswordInput {
|
|
|
262
271
|
"tags": [],
|
|
263
272
|
"text": "Name of input to be shown to the user."
|
|
264
273
|
},
|
|
265
|
-
"getter": false,
|
|
266
|
-
"setter": false,
|
|
267
274
|
"attribute": "display-name",
|
|
268
275
|
"reflect": true
|
|
269
276
|
},
|
|
@@ -281,8 +288,6 @@ export class PasswordInput {
|
|
|
281
288
|
"tags": [],
|
|
282
289
|
"text": "Placeholder text to be shown."
|
|
283
290
|
},
|
|
284
|
-
"getter": false,
|
|
285
|
-
"setter": false,
|
|
286
291
|
"attribute": "placeholder",
|
|
287
292
|
"reflect": true
|
|
288
293
|
},
|
|
@@ -300,8 +305,6 @@ export class PasswordInput {
|
|
|
300
305
|
"tags": [],
|
|
301
306
|
"text": "Default value for the input."
|
|
302
307
|
},
|
|
303
|
-
"getter": false,
|
|
304
|
-
"setter": false,
|
|
305
308
|
"attribute": "default-value",
|
|
306
309
|
"reflect": true,
|
|
307
310
|
"defaultValue": "''"
|
|
@@ -320,8 +323,6 @@ export class PasswordInput {
|
|
|
320
323
|
"tags": [],
|
|
321
324
|
"text": "Boolean. Determines if input should be readonly."
|
|
322
325
|
},
|
|
323
|
-
"getter": false,
|
|
324
|
-
"setter": false,
|
|
325
326
|
"attribute": "autofilled",
|
|
326
327
|
"reflect": true
|
|
327
328
|
},
|
|
@@ -339,8 +340,6 @@ export class PasswordInput {
|
|
|
339
340
|
"tags": [],
|
|
340
341
|
"text": "Tooltip text."
|
|
341
342
|
},
|
|
342
|
-
"getter": false,
|
|
343
|
-
"setter": false,
|
|
344
343
|
"attribute": "tooltip",
|
|
345
344
|
"reflect": true
|
|
346
345
|
},
|
|
@@ -363,9 +362,7 @@ export class PasswordInput {
|
|
|
363
362
|
"docs": {
|
|
364
363
|
"tags": [],
|
|
365
364
|
"text": "Object of validation rules for the input."
|
|
366
|
-
}
|
|
367
|
-
"getter": false,
|
|
368
|
-
"setter": false
|
|
365
|
+
}
|
|
369
366
|
},
|
|
370
367
|
"language": {
|
|
371
368
|
"type": "string",
|
|
@@ -381,8 +378,6 @@ export class PasswordInput {
|
|
|
381
378
|
"tags": [],
|
|
382
379
|
"text": "Currently selected language."
|
|
383
380
|
},
|
|
384
|
-
"getter": false,
|
|
385
|
-
"setter": false,
|
|
386
381
|
"attribute": "language",
|
|
387
382
|
"reflect": true
|
|
388
383
|
},
|
|
@@ -400,8 +395,6 @@ export class PasswordInput {
|
|
|
400
395
|
"tags": [],
|
|
401
396
|
"text": "State passed down from the parent element. Will trigger the input to send it's value through an event."
|
|
402
397
|
},
|
|
403
|
-
"getter": false,
|
|
404
|
-
"setter": false,
|
|
405
398
|
"attribute": "emit-value",
|
|
406
399
|
"reflect": true
|
|
407
400
|
},
|
|
@@ -419,8 +412,6 @@ export class PasswordInput {
|
|
|
419
412
|
"tags": [],
|
|
420
413
|
"text": "Flag for duplicate inputs, it sets up the input for certain validation rules."
|
|
421
414
|
},
|
|
422
|
-
"getter": false,
|
|
423
|
-
"setter": false,
|
|
424
415
|
"attribute": "is-duplicate-input",
|
|
425
416
|
"reflect": true
|
|
426
417
|
},
|
|
@@ -438,8 +429,6 @@ export class PasswordInput {
|
|
|
438
429
|
"tags": [],
|
|
439
430
|
"text": "Client custom styling via inline style"
|
|
440
431
|
},
|
|
441
|
-
"getter": false,
|
|
442
|
-
"setter": false,
|
|
443
432
|
"attribute": "client-styling",
|
|
444
433
|
"reflect": true,
|
|
445
434
|
"defaultValue": "''"
|
|
@@ -526,6 +515,9 @@ export class PasswordInput {
|
|
|
526
515
|
static get elementRef() { return "element"; }
|
|
527
516
|
static get watchers() {
|
|
528
517
|
return [{
|
|
518
|
+
"propName": "clientStyling",
|
|
519
|
+
"methodName": "handleStylingChange"
|
|
520
|
+
}, {
|
|
529
521
|
"propName": "isValid",
|
|
530
522
|
"methodName": "validityChanged"
|
|
531
523
|
}, {
|