@italia/globals 0.0.1-alpha.0 → 0.1.0-alpha.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.
package/custom-elements.json
CHANGED
|
@@ -285,6 +285,12 @@
|
|
|
285
285
|
"text": "string"
|
|
286
286
|
},
|
|
287
287
|
"description": "The form validation status."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "translations",
|
|
291
|
+
"type": {
|
|
292
|
+
"text": "Record<string, string>"
|
|
293
|
+
}
|
|
288
294
|
}
|
|
289
295
|
],
|
|
290
296
|
"return": {
|
|
@@ -294,17 +300,6 @@
|
|
|
294
300
|
},
|
|
295
301
|
"privacy": "protected"
|
|
296
302
|
},
|
|
297
|
-
{
|
|
298
|
-
"kind": "method",
|
|
299
|
-
"name": "_testValidity",
|
|
300
|
-
"return": {
|
|
301
|
-
"type": {
|
|
302
|
-
"text": ""
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
"description": "Checks if the value meets the constraints.",
|
|
306
|
-
"privacy": "protected"
|
|
307
|
-
},
|
|
308
303
|
{
|
|
309
304
|
"kind": "field",
|
|
310
305
|
"name": "invalid",
|
|
@@ -323,37 +318,93 @@
|
|
|
323
318
|
},
|
|
324
319
|
{
|
|
325
320
|
"kind": "field",
|
|
326
|
-
"name": "
|
|
321
|
+
"name": "validityMessage",
|
|
327
322
|
"type": {
|
|
328
323
|
"text": "string"
|
|
329
324
|
},
|
|
330
|
-
"description": "The
|
|
325
|
+
"description": "The validity message."
|
|
331
326
|
},
|
|
332
327
|
{
|
|
333
328
|
"kind": "field",
|
|
334
|
-
"name": "
|
|
329
|
+
"name": "_value",
|
|
335
330
|
"type": {
|
|
336
331
|
"text": "string"
|
|
337
332
|
},
|
|
338
|
-
"description": "The
|
|
333
|
+
"description": "The value."
|
|
339
334
|
},
|
|
340
335
|
{
|
|
341
336
|
"kind": "field",
|
|
342
|
-
"name": "
|
|
337
|
+
"name": "pattern",
|
|
343
338
|
"type": {
|
|
344
|
-
"text": "string"
|
|
339
|
+
"text": "string | undefined"
|
|
345
340
|
},
|
|
346
|
-
"description": "The
|
|
341
|
+
"description": "The pattern to match to be valid."
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"kind": "field",
|
|
345
|
+
"name": "disabled",
|
|
346
|
+
"type": {
|
|
347
|
+
"text": "boolean"
|
|
348
|
+
},
|
|
349
|
+
"description": "`true` if the element is disabled."
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"kind": "field",
|
|
353
|
+
"name": "minlength",
|
|
354
|
+
"type": {
|
|
355
|
+
"text": "number"
|
|
356
|
+
},
|
|
357
|
+
"description": "The minimum length of the value."
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"kind": "field",
|
|
361
|
+
"name": "maxlength",
|
|
362
|
+
"type": {
|
|
363
|
+
"text": "number"
|
|
364
|
+
},
|
|
365
|
+
"description": "The maximum length of the value."
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"kind": "field",
|
|
369
|
+
"name": "customValidation",
|
|
370
|
+
"type": {
|
|
371
|
+
"text": "boolean"
|
|
372
|
+
},
|
|
373
|
+
"description": "External validation."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"kind": "field",
|
|
377
|
+
"name": "_touched",
|
|
378
|
+
"type": {
|
|
379
|
+
"text": "boolean"
|
|
380
|
+
},
|
|
381
|
+
"default": "false",
|
|
382
|
+
"description": "Field is touched"
|
|
347
383
|
},
|
|
348
384
|
{
|
|
349
385
|
"kind": "method",
|
|
350
|
-
"name": "
|
|
351
|
-
"description": "Checks if the value meets the constraints.\nFires cancelable `invalid` event if it doesn't.",
|
|
386
|
+
"name": "_checkValidity",
|
|
352
387
|
"return": {
|
|
353
388
|
"type": {
|
|
354
389
|
"text": ""
|
|
355
390
|
}
|
|
356
|
-
}
|
|
391
|
+
},
|
|
392
|
+
"parameters": [
|
|
393
|
+
{
|
|
394
|
+
"name": "translations",
|
|
395
|
+
"type": {
|
|
396
|
+
"text": "Record<string, string>"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "htmlValidity",
|
|
401
|
+
"default": "true",
|
|
402
|
+
"type": {
|
|
403
|
+
"text": "boolean"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"description": "Checks if the value meets the constraints."
|
|
357
408
|
},
|
|
358
409
|
{
|
|
359
410
|
"kind": "method",
|
|
@@ -368,11 +419,53 @@
|
|
|
368
419
|
}
|
|
369
420
|
],
|
|
370
421
|
"description": "Sets the given custom validity message."
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"kind": "method",
|
|
425
|
+
"name": "_handleBlur"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"kind": "method",
|
|
429
|
+
"name": "_handleFocus"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"kind": "method",
|
|
433
|
+
"name": "_handleClick"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"kind": "method",
|
|
437
|
+
"name": "_handleChange",
|
|
438
|
+
"parameters": [
|
|
439
|
+
{
|
|
440
|
+
"name": "e",
|
|
441
|
+
"type": {
|
|
442
|
+
"text": "Event"
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
]
|
|
371
446
|
}
|
|
372
447
|
],
|
|
373
448
|
"events": [
|
|
374
449
|
{
|
|
375
|
-
"name": "
|
|
450
|
+
"name": "blur",
|
|
451
|
+
"type": {
|
|
452
|
+
"text": "FocusEvent"
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"name": "focus",
|
|
457
|
+
"type": {
|
|
458
|
+
"text": "FocusEvent"
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "click",
|
|
463
|
+
"type": {
|
|
464
|
+
"text": "MouseEvent"
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "change",
|
|
376
469
|
"type": {
|
|
377
470
|
"text": "CustomEvent"
|
|
378
471
|
}
|
|
@@ -15,10 +15,26 @@ export declare enum VALIDATION_STATUS {
|
|
|
15
15
|
* One indicating no validation error.
|
|
16
16
|
*/
|
|
17
17
|
NO_ERROR = "",
|
|
18
|
+
/**
|
|
19
|
+
* One indicating that the value is invalid (generic).
|
|
20
|
+
*/
|
|
21
|
+
INVALID = "invalid",
|
|
18
22
|
/**
|
|
19
23
|
* One indicating missing required value.
|
|
20
24
|
*/
|
|
21
|
-
ERROR_REQUIRED = "required"
|
|
25
|
+
ERROR_REQUIRED = "required",
|
|
26
|
+
/**
|
|
27
|
+
* One indicating that the value does not match the pattern.
|
|
28
|
+
*/
|
|
29
|
+
PATTERN = "pattern",
|
|
30
|
+
/**
|
|
31
|
+
* One indicating that the value is shorter than the minimum length.
|
|
32
|
+
*/
|
|
33
|
+
MINLENGTH = "minlength",
|
|
34
|
+
/**
|
|
35
|
+
* One indicating that the value is less than the maximum length.
|
|
36
|
+
*/
|
|
37
|
+
MAXLENGTH = "maxlength"
|
|
22
38
|
}
|
|
23
39
|
/**
|
|
24
40
|
* @param Base The base class.
|
|
@@ -30,14 +46,7 @@ declare const ValidityMixin: <T extends Constructor<HTMLElement>>(Base: T) => (a
|
|
|
30
46
|
* @returns The form validation error mesasages associated with the given status.
|
|
31
47
|
* @protected
|
|
32
48
|
*/
|
|
33
|
-
_getValidityMessage(state: string): string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Checks if the value meets the constraints.
|
|
36
|
-
*
|
|
37
|
-
* @returns `VALIDATION_STATUS.NO_ERROR` if the value meets the constraints. Some other values otherwise.
|
|
38
|
-
* @protected
|
|
39
|
-
*/
|
|
40
|
-
_testValidity(): string;
|
|
49
|
+
_getValidityMessage(state: string, translations: Record<string, string>): string | undefined;
|
|
41
50
|
/**
|
|
42
51
|
* `true` to show the UI of the invalid state.
|
|
43
52
|
*/
|
|
@@ -46,10 +55,6 @@ declare const ValidityMixin: <T extends Constructor<HTMLElement>>(Base: T) => (a
|
|
|
46
55
|
* `true` if the value is required.
|
|
47
56
|
*/
|
|
48
57
|
required: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* The special validity message for `required`.
|
|
51
|
-
*/
|
|
52
|
-
requiredValidityMessage: string;
|
|
53
58
|
/**
|
|
54
59
|
* The validity message.
|
|
55
60
|
*/
|
|
@@ -57,20 +62,47 @@ declare const ValidityMixin: <T extends Constructor<HTMLElement>>(Base: T) => (a
|
|
|
57
62
|
/**
|
|
58
63
|
* The value.
|
|
59
64
|
*/
|
|
60
|
-
|
|
65
|
+
_value: string;
|
|
66
|
+
/**
|
|
67
|
+
* The pattern to match to be valid.
|
|
68
|
+
*/
|
|
69
|
+
pattern?: string;
|
|
70
|
+
/**
|
|
71
|
+
* `true` if the element is disabled.
|
|
72
|
+
*/
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The minimum length of the value.
|
|
76
|
+
*/
|
|
77
|
+
minlength: number;
|
|
78
|
+
/**
|
|
79
|
+
* The maximum length of the value.
|
|
80
|
+
*/
|
|
81
|
+
maxlength: number;
|
|
82
|
+
/**
|
|
83
|
+
* External validation.
|
|
84
|
+
*/
|
|
85
|
+
customValidation: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Field is touched
|
|
88
|
+
*/
|
|
89
|
+
_touched: boolean;
|
|
61
90
|
/**
|
|
62
91
|
* Checks if the value meets the constraints.
|
|
63
|
-
* Fires cancelable `invalid` event if it doesn't.
|
|
64
92
|
*
|
|
65
93
|
* @returns `true` if the value meets the constraints. `false` otherwise.
|
|
66
94
|
*/
|
|
67
|
-
|
|
95
|
+
_checkValidity(translations: Record<string, string>, htmlValidity?: boolean): boolean | undefined;
|
|
68
96
|
/**
|
|
69
97
|
* Sets the given custom validity message.
|
|
70
98
|
*
|
|
71
99
|
* @param validityMessage The custom validity message
|
|
72
100
|
*/
|
|
73
101
|
setCustomValidity(validityMessage: string): void;
|
|
102
|
+
_handleBlur(): void;
|
|
103
|
+
_handleFocus(): void;
|
|
104
|
+
_handleClick(): void;
|
|
105
|
+
_handleChange(e: Event): void;
|
|
74
106
|
accessKey: string;
|
|
75
107
|
readonly accessKeyLabel: string;
|
|
76
108
|
autocapitalize: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity.d.ts","sourceRoot":"","sources":["../../../src/mixins/validity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C;;;;;;;GAOG;AAEH;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,QAAQ,KAAK;IAEb;;OAEG;IACH,cAAc,aAAa;
|
|
1
|
+
{"version":3,"file":"validity.d.ts","sourceRoot":"","sources":["../../../src/mixins/validity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C;;;;;;;GAOG;AAEH;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,QAAQ,KAAK;IAEb;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,cAAc,aAAa;IAC3B;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,SAAS,cAAc;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAI9D;;;;OAIG;+BACwB,MAAM,gBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAiBvE;;OAEG;aACe,OAAO;IAEzB;;OAEG;cACgB,OAAO;IAE1B;;OAEG;qBACuB,MAAM;IAEhC;;OAEG;YACc,MAAM;IAEvB;;OAEG;cACgB,MAAM;IAEzB;;OAEG;cACgB,OAAO;IAE1B;;OAEG;eACiB,MAAM;IAE1B;;OAEG;eACiB,MAAM;IAE1B;;OAEG;sBACwB,OAAO;IAElC;;OAEG;cACO,OAAO;IAEjB;;;;OAIG;iCAC0B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAgB,OAAO,GAAU,OAAO,GAAG,SAAS;IAyCvG;;;;OAIG;uCACgC,MAAM;;;;qBAkBxB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqCzB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -15,10 +15,26 @@ export var VALIDATION_STATUS;
|
|
|
15
15
|
* One indicating no validation error.
|
|
16
16
|
*/
|
|
17
17
|
VALIDATION_STATUS["NO_ERROR"] = "";
|
|
18
|
+
/**
|
|
19
|
+
* One indicating that the value is invalid (generic).
|
|
20
|
+
*/
|
|
21
|
+
VALIDATION_STATUS["INVALID"] = "invalid";
|
|
18
22
|
/**
|
|
19
23
|
* One indicating missing required value.
|
|
20
24
|
*/
|
|
21
25
|
VALIDATION_STATUS["ERROR_REQUIRED"] = "required";
|
|
26
|
+
/**
|
|
27
|
+
* One indicating that the value does not match the pattern.
|
|
28
|
+
*/
|
|
29
|
+
VALIDATION_STATUS["PATTERN"] = "pattern";
|
|
30
|
+
/**
|
|
31
|
+
* One indicating that the value is shorter than the minimum length.
|
|
32
|
+
*/
|
|
33
|
+
VALIDATION_STATUS["MINLENGTH"] = "minlength";
|
|
34
|
+
/**
|
|
35
|
+
* One indicating that the value is less than the maximum length.
|
|
36
|
+
*/
|
|
37
|
+
VALIDATION_STATUS["MAXLENGTH"] = "maxlength";
|
|
22
38
|
})(VALIDATION_STATUS || (VALIDATION_STATUS = {}));
|
|
23
39
|
/**
|
|
24
40
|
* @param Base The base class.
|
|
@@ -26,6 +42,13 @@ export var VALIDATION_STATUS;
|
|
|
26
42
|
*/
|
|
27
43
|
const ValidityMixin = (Base) => {
|
|
28
44
|
class ValidityMixinImpl extends Base {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
/**
|
|
48
|
+
* Field is touched
|
|
49
|
+
*/
|
|
50
|
+
this._touched = false;
|
|
51
|
+
}
|
|
29
52
|
// Not using TypeScript `protected` due to: microsoft/TypeScript#17744
|
|
30
53
|
// Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8
|
|
31
54
|
/**
|
|
@@ -33,46 +56,58 @@ const ValidityMixin = (Base) => {
|
|
|
33
56
|
* @returns The form validation error mesasages associated with the given status.
|
|
34
57
|
* @protected
|
|
35
58
|
*/
|
|
36
|
-
_getValidityMessage(state) {
|
|
59
|
+
_getValidityMessage(state, translations) {
|
|
37
60
|
return {
|
|
38
61
|
[VALIDATION_STATUS.NO_ERROR]: '',
|
|
39
|
-
[VALIDATION_STATUS.
|
|
62
|
+
[VALIDATION_STATUS.INVALID]: translations[VALIDATION_STATUS.INVALID],
|
|
63
|
+
[VALIDATION_STATUS.ERROR_REQUIRED]: translations[VALIDATION_STATUS.ERROR_REQUIRED],
|
|
64
|
+
[VALIDATION_STATUS.PATTERN]: translations[VALIDATION_STATUS.PATTERN],
|
|
65
|
+
[VALIDATION_STATUS.MINLENGTH]: translations[VALIDATION_STATUS.MINLENGTH].replace('{minlength}', this.minlength.toString()),
|
|
66
|
+
[VALIDATION_STATUS.MAXLENGTH]: translations[VALIDATION_STATUS.MAXLENGTH].replace('{maxlength}', this.maxlength.toString()),
|
|
40
67
|
}[state];
|
|
41
68
|
}
|
|
42
|
-
// Not using TypeScript `protected` due to: microsoft/TypeScript#17744
|
|
43
|
-
// Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8
|
|
44
69
|
/**
|
|
45
70
|
* Checks if the value meets the constraints.
|
|
46
71
|
*
|
|
47
|
-
* @returns `VALIDATION_STATUS.NO_ERROR` if the value meets the constraints. Some other values otherwise.
|
|
48
|
-
* @protected
|
|
49
|
-
*/
|
|
50
|
-
_testValidity() {
|
|
51
|
-
const { required, value } = this;
|
|
52
|
-
return required && !value ? VALIDATION_STATUS.ERROR_REQUIRED : VALIDATION_STATUS.NO_ERROR;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Checks if the value meets the constraints.
|
|
56
|
-
* Fires cancelable `invalid` event if it doesn't.
|
|
57
|
-
*
|
|
58
72
|
* @returns `true` if the value meets the constraints. `false` otherwise.
|
|
59
73
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
_checkValidity(translations, htmlValidity = true) {
|
|
75
|
+
// htmlValidity = this.inputElement.checkValidity(); //check browser validity
|
|
76
|
+
if (this.customValidation) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
let validity = htmlValidity;
|
|
80
|
+
let message = validity
|
|
81
|
+
? this._getValidityMessage(VALIDATION_STATUS.NO_ERROR, translations)
|
|
82
|
+
: this._getValidityMessage(VALIDATION_STATUS.INVALID, translations);
|
|
83
|
+
if (this.required || (this._value && (this.pattern || this.minlength > 0 || this.maxlength > 0))) {
|
|
84
|
+
if (this.pattern) {
|
|
85
|
+
const regex = new RegExp(`^${this.pattern}$`, 'u');
|
|
86
|
+
validity = regex.test(this._value.toString());
|
|
87
|
+
if (!validity) {
|
|
88
|
+
message = this._getValidityMessage(VALIDATION_STATUS.PATTERN, translations);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (typeof this.minlength !== 'undefined' && this.minlength > 0) {
|
|
92
|
+
validity = validity && this._value.toString().length >= this.minlength;
|
|
93
|
+
if (!validity) {
|
|
94
|
+
message = this._getValidityMessage(VALIDATION_STATUS.MINLENGTH, translations);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (typeof this.maxlength !== 'undefined' && this.maxlength > 0) {
|
|
98
|
+
validity = validity && this._value.toString().length <= this.maxlength;
|
|
99
|
+
if (!validity) {
|
|
100
|
+
message = this._getValidityMessage(VALIDATION_STATUS.MAXLENGTH, translations);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (this.required && !this._value) {
|
|
104
|
+
validity = false;
|
|
105
|
+
message = this._getValidityMessage(VALIDATION_STATUS.ERROR_REQUIRED, translations);
|
|
70
106
|
}
|
|
71
|
-
return false;
|
|
72
107
|
}
|
|
73
|
-
this.invalid =
|
|
74
|
-
this.validityMessage =
|
|
75
|
-
return
|
|
108
|
+
this.invalid = !validity;
|
|
109
|
+
this.validityMessage = message;
|
|
110
|
+
return validity;
|
|
76
111
|
}
|
|
77
112
|
/**
|
|
78
113
|
* Sets the given custom validity message.
|
|
@@ -83,6 +118,50 @@ const ValidityMixin = (Base) => {
|
|
|
83
118
|
this.invalid = Boolean(validityMessage);
|
|
84
119
|
this.validityMessage = validityMessage;
|
|
85
120
|
}
|
|
121
|
+
_handleBlur() {
|
|
122
|
+
this._touched = true;
|
|
123
|
+
this.dispatchEvent(new FocusEvent('blur', { bubbles: true, composed: true }));
|
|
124
|
+
}
|
|
125
|
+
_handleFocus() {
|
|
126
|
+
this.dispatchEvent(new FocusEvent('focus', { bubbles: true, composed: true }));
|
|
127
|
+
}
|
|
128
|
+
_handleClick() {
|
|
129
|
+
this.dispatchEvent(new MouseEvent('click', { bubbles: true, composed: true }));
|
|
130
|
+
}
|
|
131
|
+
_handleChange(e) {
|
|
132
|
+
const target = e.target;
|
|
133
|
+
let value;
|
|
134
|
+
if (target instanceof HTMLInputElement) {
|
|
135
|
+
switch (target.type) {
|
|
136
|
+
case 'checkbox':
|
|
137
|
+
case 'radio':
|
|
138
|
+
value = target.checked;
|
|
139
|
+
break;
|
|
140
|
+
case 'file':
|
|
141
|
+
value = target.files; // FileList
|
|
142
|
+
break;
|
|
143
|
+
default:
|
|
144
|
+
value = target.value;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (target instanceof HTMLSelectElement) {
|
|
148
|
+
if (target.multiple) {
|
|
149
|
+
value = Array.from(target.selectedOptions).map((o) => o.value);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
value = target.value;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// textarea o altri input con value
|
|
157
|
+
value = target.value;
|
|
158
|
+
}
|
|
159
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
160
|
+
detail: { value, el: target },
|
|
161
|
+
bubbles: true,
|
|
162
|
+
composed: true,
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
86
165
|
}
|
|
87
166
|
return ValidityMixinImpl;
|
|
88
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity.js","sourceRoot":"","sources":["../../../src/mixins/validity.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,kCAAa,CAAA;IAEb;;OAEG;IACH,gDAA2B,CAAA;AAC7B,CAAC,EAVW,iBAAiB,KAAjB,iBAAiB,QAU5B;AAED;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAqC,IAAO,EAAE,EAAE;IACpE,MAAe,iBAAkB,SAAQ,IAAI;QAC3C,sEAAsE;QACtE,oFAAoF;QACpF;;;;WAIG;QACH,mBAAmB,CAAC,KAAa;YAC/B,OAAO;gBACL,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE;gBAChC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p. 2020, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Form validation status.\n */\nexport enum VALIDATION_STATUS {\n /**\n * One indicating no validation error.\n */\n NO_ERROR = '',\n\n /**\n * One indicating missing required value.\n */\n ERROR_REQUIRED = 'required',\n}\n\n/**\n * @param Base The base class.\n * @returns A mix-in implementing `.setCustomValidity()` method.\n */\nconst ValidityMixin = <T extends Constructor<HTMLElement>>(Base: T) => {\n abstract class ValidityMixinImpl extends Base {\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * @param state The form validation status.\n * @returns The form validation error mesasages associated with the given status.\n * @protected\n */\n _getValidityMessage(state: string) {\n return {\n [VALIDATION_STATUS.NO_ERROR]: '',\n [VALIDATION_STATUS.ERROR_REQUIRED]: this.requiredValidityMessage,\n }[state];\n }\n\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * Checks if the value meets the constraints.\n *\n * @returns `VALIDATION_STATUS.NO_ERROR` if the value meets the constraints. Some other values otherwise.\n * @protected\n */\n _testValidity(): string {\n const { required, value } = this;\n return required && !value ? VALIDATION_STATUS.ERROR_REQUIRED : VALIDATION_STATUS.NO_ERROR;\n }\n\n /**\n * `true` to show the UI of the invalid state.\n */\n abstract invalid: boolean;\n\n /**\n * `true` if the value is required.\n */\n abstract required: boolean;\n\n /**\n * The special validity message for `required`.\n */\n abstract requiredValidityMessage: string;\n\n /**\n * The validity message.\n */\n abstract validityMessage: string;\n\n /**\n * The value.\n */\n abstract value: string;\n\n /**\n * Checks if the value meets the constraints.\n * Fires cancelable `invalid` event if it doesn't.\n *\n * @returns `true` if the value meets the constraints. `false` otherwise.\n */\n checkValidity() {\n const status = this._testValidity();\n if (status !== VALIDATION_STATUS.NO_ERROR) {\n if (\n this.dispatchEvent(\n new CustomEvent('invalid', {\n bubbles: false,\n cancelable: true,\n composed: false,\n }),\n )\n ) {\n this.invalid = true;\n this.validityMessage = this._getValidityMessage(status) as string;\n }\n return false;\n }\n this.invalid = false;\n this.validityMessage = '';\n return true;\n }\n\n /**\n * Sets the given custom validity message.\n *\n * @param validityMessage The custom validity message\n */\n setCustomValidity(validityMessage: string) {\n this.invalid = Boolean(validityMessage);\n this.validityMessage = validityMessage;\n }\n }\n return ValidityMixinImpl;\n};\n\nexport default ValidityMixin;\n"]}
|
|
1
|
+
{"version":3,"file":"validity.js","sourceRoot":"","sources":["../../../src/mixins/validity.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,iBA4BX;AA5BD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,kCAAa,CAAA;IAEb;;OAEG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,gDAA2B,CAAA;IAC3B;;OAEG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,4CAAuB,CAAA;IACvB;;OAEG;IACH,4CAAuB,CAAA;AACzB,CAAC,EA5BW,iBAAiB,KAAjB,iBAAiB,QA4B5B;AAED;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAqC,IAAO,EAAE,EAAE;IACpE,MAAe,iBAAkB,SAAQ,IAAI;QAA7C;;YAsEE;;eAEG;YACH,aAAQ,GAAY,KAAK,CAAC;QA0G5B,CAAC;QAlLC,sEAAsE;QACtE,oFAAoF;QACpF;;;;WAIG;QACH,mBAAmB,CAAC,KAAa,EAAE,YAAoC;YACrE,OAAO;gBACL,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE;gBAChC,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC;gBACpE,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,cAAc,CAAC;gBAClF,CAAC,iBAAiB,CAAC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K,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACjE,CAAC;qBAAM,CAAC;oBACN,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;gBACvB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,mCAAmC;gBACnC,KAAK,GAAI,MAAc,CAAC,KAAK,CAAC;YAChC,CAAC;YAED,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE;gBAC7B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACf,CAAC,CACH,CAAC;QACJ,CAAC;KACF;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { Constructor } from '../index.js';\n/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Form validation status.\n */\nexport enum VALIDATION_STATUS {\n /**\n * One indicating no validation error.\n */\n NO_ERROR = '',\n\n /**\n * One indicating that the value is invalid (generic).\n */\n INVALID = 'invalid',\n\n /**\n * One indicating missing required value.\n */\n ERROR_REQUIRED = 'required',\n /**\n * One indicating that the value does not match the pattern.\n */\n PATTERN = 'pattern',\n\n /**\n * One indicating that the value is shorter than the minimum length.\n */\n MINLENGTH = 'minlength',\n /**\n * One indicating that the value is less than the maximum length.\n */\n MAXLENGTH = 'maxlength',\n}\n\n/**\n * @param Base The base class.\n * @returns A mix-in implementing `.setCustomValidity()` method.\n */\nconst ValidityMixin = <T extends Constructor<HTMLElement>>(Base: T) => {\n abstract class ValidityMixinImpl extends Base {\n // Not using TypeScript `protected` due to: microsoft/TypeScript#17744\n // Using `string` instead of `VALIDATION_STATUS` until we can require TypeScript 3.8\n /**\n * @param state The form validation status.\n * @returns The form validation error mesasages associated with the given status.\n * @protected\n */\n _getValidityMessage(state: string, translations: Record<string, string>) {\n return {\n [VALIDATION_STATUS.NO_ERROR]: '',\n [VALIDATION_STATUS.INVALID]: translations[VALIDATION_STATUS.INVALID],\n [VALIDATION_STATUS.ERROR_REQUIRED]: translations[VALIDATION_STATUS.ERROR_REQUIRED],\n [VALIDATION_STATUS.PATTERN]: translations[VALIDATION_STATUS.PATTERN],\n [VALIDATION_STATUS.MINLENGTH]: translations[VALIDATION_STATUS.MINLENGTH].replace(\n '{minlength}',\n this.minlength.toString(),\n ),\n [VALIDATION_STATUS.MAXLENGTH]: translations[VALIDATION_STATUS.MAXLENGTH].replace(\n '{maxlength}',\n this.maxlength.toString(),\n ),\n }[state];\n }\n\n /**\n * `true` to show the UI of the invalid state.\n */\n abstract invalid: boolean;\n\n /**\n * `true` if the value is required.\n */\n abstract required: boolean;\n\n /**\n * The validity message.\n */\n abstract validityMessage: string;\n\n /**\n * The value.\n */\n abstract _value: string;\n\n /**\n * The pattern to match to be valid.\n */\n abstract pattern?: string;\n\n /**\n * `true` if the element is disabled.\n */\n abstract disabled: boolean;\n\n /**\n * The minimum length of the value.\n */\n abstract minlength: number;\n\n /**\n * The maximum length of the value.\n */\n abstract maxlength: number;\n\n /**\n * External validation.\n */\n abstract customValidation: boolean;\n\n /**\n * Field is touched\n */\n _touched: boolean = false;\n\n /**\n * Checks if the value meets the constraints.\n *\n * @returns `true` if the value meets the constraints. `false` otherwise.\n */\n _checkValidity(translations: Record<string, string>, htmlValidity: boolean = true): boolean | undefined {\n // htmlValidity = this.inputElement.checkValidity(); //check browser validity\n if (this.customValidation) {\n return undefined;\n }\n let validity = htmlValidity;\n let message: string = validity\n ? (this._getValidityMessage(VALIDATION_STATUS.NO_ERROR, translations) as string)\n : (this._getValidityMessage(VALIDATION_STATUS.INVALID, translations) as string);\n\n if (this.required || (this._value && (this.pattern || this.minlength > 0 || this.maxlength > 0))) {\n if (this.pattern) {\n const regex = new RegExp(`^${this.pattern}$`, 'u');\n validity = regex.test(this._value.toString());\n if (!validity) {\n message = this._getValidityMessage(VALIDATION_STATUS.PATTERN, translations) as string;\n }\n }\n if (typeof this.minlength !== 'undefined' && this.minlength > 0) {\n validity = validity && this._value.toString().length >= this.minlength;\n if (!validity) {\n message = this._getValidityMessage(VALIDATION_STATUS.MINLENGTH, translations) as string;\n }\n }\n if (typeof this.maxlength !== 'undefined' && this.maxlength > 0) {\n validity = validity && this._value.toString().length <= this.maxlength;\n if (!validity) {\n message = this._getValidityMessage(VALIDATION_STATUS.MAXLENGTH, translations) as string;\n }\n }\n if (this.required && !this._value) {\n validity = false;\n message = this._getValidityMessage(VALIDATION_STATUS.ERROR_REQUIRED, translations) as string;\n }\n }\n\n this.invalid = !validity;\n this.validityMessage = message;\n return validity;\n }\n\n /**\n * Sets the given custom validity message.\n *\n * @param validityMessage The custom validity message\n */\n setCustomValidity(validityMessage: string) {\n this.invalid = Boolean(validityMessage);\n this.validityMessage = validityMessage;\n }\n\n _handleBlur() {\n this._touched = true;\n this.dispatchEvent(new FocusEvent('blur', { bubbles: true, composed: true }));\n }\n\n _handleFocus() {\n this.dispatchEvent(new FocusEvent('focus', { bubbles: true, composed: true }));\n }\n\n _handleClick() {\n this.dispatchEvent(new MouseEvent('click', { bubbles: true, composed: true }));\n }\n\n _handleChange(e: Event) {\n const target = e.target as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n let value: unknown;\n\n if (target instanceof HTMLInputElement) {\n switch (target.type) {\n case 'checkbox':\n case 'radio':\n value = target.checked;\n break;\n case 'file':\n value = target.files; // FileList\n break;\n default:\n value = target.value;\n }\n } else if (target instanceof HTMLSelectElement) {\n if (target.multiple) {\n value = Array.from(target.selectedOptions).map((o) => o.value);\n } else {\n value = target.value;\n }\n } else {\n // textarea o altri input con value\n value = (target as any).value;\n }\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: { value, el: target },\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n return ValidityMixinImpl;\n};\n\nexport default ValidityMixin;\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@italia/globals",
|
|
3
3
|
"description": "Utilities per i Web components del Design System .italia",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"lit": "^3.3.0",
|
|
36
|
-
"@italia/i18n": "^0.0
|
|
36
|
+
"@italia/i18n": "^0.1.0-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|