@brightspace-ui/core 3.329.1 → 3.330.0
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.
|
@@ -57,9 +57,7 @@ The `<d2l-input-text>` element is a simple wrapper around the native `<input typ
|
|
|
57
57
|
| `instructions` | String | Additional information relating to how to use the component |
|
|
58
58
|
| `label-hidden` | Boolean | Hides the label visually (moves it to the input's `aria-label` attribute) |
|
|
59
59
|
| `labelled-by` | String | HTML id of an element in the same shadow root which acts as the input's label |
|
|
60
|
-
| `max` | String | For number inputs, maximum value |
|
|
61
60
|
| `maxlength` | Number | Imposes an upper character limit |
|
|
62
|
-
| `min` | String | For number inputs, minimum value |
|
|
63
61
|
| `minlength` | Number | Imposes a lower character limit |
|
|
64
62
|
| `name` | String | Name of the form control. Submitted with the form as part of a name/value pair. |
|
|
65
63
|
| `novalidate` | Boolean | Disables the built-in validation |
|
|
@@ -70,7 +68,7 @@ The `<d2l-input-text>` element is a simple wrapper around the native `<input typ
|
|
|
70
68
|
| `required` | Boolean | Indicates that a value is required |
|
|
71
69
|
| `size` | Number | Size of the input |
|
|
72
70
|
| `step` | String | For number inputs, sets the step size |
|
|
73
|
-
| `type` | String, default: `text` | Can be one of `text`, `email`, `password`, `tel`, `url
|
|
71
|
+
| `type` | String, default: `text` | Can be one of `text`, `email`, `password`, `tel`, `url` |
|
|
74
72
|
| `unit` | String | Unit associated with the input value, displayed next to input and announced as part of the label |
|
|
75
73
|
| `value` | String, default: `''` | Value of the input |
|
|
76
74
|
|
|
@@ -85,21 +85,11 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
|
|
|
85
85
|
* @type {boolean}
|
|
86
86
|
*/
|
|
87
87
|
labelHidden: { type: Boolean, attribute: 'label-hidden' },
|
|
88
|
-
/**
|
|
89
|
-
* For number inputs, maximum value
|
|
90
|
-
* @type {string}
|
|
91
|
-
*/
|
|
92
|
-
max: { type: String },
|
|
93
88
|
/**
|
|
94
89
|
* Imposes an upper character limit
|
|
95
90
|
* @type {number}
|
|
96
91
|
*/
|
|
97
92
|
maxlength: { type: Number },
|
|
98
|
-
/**
|
|
99
|
-
* For number inputs, minimum value
|
|
100
|
-
* @type {string}
|
|
101
|
-
*/
|
|
102
|
-
min: { type: String },
|
|
103
93
|
/**
|
|
104
94
|
* Imposes a lower character limit
|
|
105
95
|
* @type {number}
|
|
@@ -150,7 +140,7 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
|
|
|
150
140
|
title: { type: String },
|
|
151
141
|
/**
|
|
152
142
|
* The type of the text input
|
|
153
|
-
* @type {'text'|'email'|'
|
|
143
|
+
* @type {'text'|'email'|'password'|'search'|'tel'|'url'}
|
|
154
144
|
*/
|
|
155
145
|
type: { type: String },
|
|
156
146
|
/**
|
|
@@ -328,11 +318,7 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
|
|
|
328
318
|
|
|
329
319
|
/** @ignore */
|
|
330
320
|
get validationMessage() {
|
|
331
|
-
if (this.validity.
|
|
332
|
-
return this.localize('components.form-element.input.number.rangeOverflow', { max: formatNumber(parseFloat(this.max)), maxExclusive: false });
|
|
333
|
-
} else if (this.validity.rangeUnderflow) {
|
|
334
|
-
return this.localize('components.form-element.input.number.rangeUnderflow', { min: formatNumber(parseFloat(this.min)), minExclusive: false });
|
|
335
|
-
} else if (this.validity.tooShort) {
|
|
321
|
+
if (this.validity.tooShort) {
|
|
336
322
|
return this.localize('components.form-element.input.text.tooShort', { label: this.label, minlength: formatNumber(this.minlength) });
|
|
337
323
|
} else if (this.validity.typeMismatch) {
|
|
338
324
|
if (this.type === 'email') {
|
|
@@ -469,9 +455,7 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
|
|
|
469
455
|
@input="${this._handleInput}"
|
|
470
456
|
@invalid="${this._handleInvalid}"
|
|
471
457
|
@keypress="${this._handleKeypress}"
|
|
472
|
-
max="${ifDefined(this.max)}"
|
|
473
458
|
maxlength="${ifDefined(this.maxlength)}"
|
|
474
|
-
min="${ifDefined(this.min)}"
|
|
475
459
|
minlength="${ifDefined(this.minlength)}"
|
|
476
460
|
name="${ifDefined(this.name)}"
|
|
477
461
|
pattern="${ifDefined(this.pattern)}"
|
|
@@ -532,6 +516,14 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
|
|
|
532
516
|
});
|
|
533
517
|
}
|
|
534
518
|
|
|
519
|
+
willUpdate(changedProperties) {
|
|
520
|
+
super.willUpdate(changedProperties);
|
|
521
|
+
if (changedProperties.has('type') && this.type === 'number') {
|
|
522
|
+
this.type = 'text';
|
|
523
|
+
console.warn('d2l-input-text: "number" type is not supported, use d2l-input-number instead. Defaulting to "text"');
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
535
527
|
#handleBlur = async(e) => {
|
|
536
528
|
this._focused = false;
|
|
537
529
|
this.requestValidate(true);
|
|
@@ -564,7 +556,7 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
|
|
|
564
556
|
}
|
|
565
557
|
|
|
566
558
|
_getType() {
|
|
567
|
-
if (this.type === 'email' || this.type === '
|
|
559
|
+
if (this.type === 'email' || this.type === 'password' || this.type === 'tel' || this.type === 'text' || this.type === 'search' || this.type === 'url') {
|
|
568
560
|
return this.type;
|
|
569
561
|
}
|
|
570
562
|
return 'text';
|
package/custom-elements.json
CHANGED
|
@@ -8296,21 +8296,11 @@
|
|
|
8296
8296
|
"description": "ADVANCED: Additional information relating to how to use the component",
|
|
8297
8297
|
"type": "string"
|
|
8298
8298
|
},
|
|
8299
|
-
{
|
|
8300
|
-
"name": "max",
|
|
8301
|
-
"description": "For number inputs, maximum value",
|
|
8302
|
-
"type": "string"
|
|
8303
|
-
},
|
|
8304
8299
|
{
|
|
8305
8300
|
"name": "maxlength",
|
|
8306
8301
|
"description": "Imposes an upper character limit",
|
|
8307
8302
|
"type": "number"
|
|
8308
8303
|
},
|
|
8309
|
-
{
|
|
8310
|
-
"name": "min",
|
|
8311
|
-
"description": "For number inputs, minimum value",
|
|
8312
|
-
"type": "string"
|
|
8313
|
-
},
|
|
8314
8304
|
{
|
|
8315
8305
|
"name": "minlength",
|
|
8316
8306
|
"description": "Imposes a lower character limit",
|
|
@@ -8396,7 +8386,7 @@
|
|
|
8396
8386
|
{
|
|
8397
8387
|
"name": "type",
|
|
8398
8388
|
"description": "The type of the text input",
|
|
8399
|
-
"type": "'text'|'email'|'
|
|
8389
|
+
"type": "'text'|'email'|'password'|'search'|'tel'|'url'",
|
|
8400
8390
|
"default": "\"text\""
|
|
8401
8391
|
},
|
|
8402
8392
|
{
|
|
@@ -8463,24 +8453,12 @@
|
|
|
8463
8453
|
"description": "ADVANCED: Additional information relating to how to use the component",
|
|
8464
8454
|
"type": "string"
|
|
8465
8455
|
},
|
|
8466
|
-
{
|
|
8467
|
-
"name": "max",
|
|
8468
|
-
"attribute": "max",
|
|
8469
|
-
"description": "For number inputs, maximum value",
|
|
8470
|
-
"type": "string"
|
|
8471
|
-
},
|
|
8472
8456
|
{
|
|
8473
8457
|
"name": "maxlength",
|
|
8474
8458
|
"attribute": "maxlength",
|
|
8475
8459
|
"description": "Imposes an upper character limit",
|
|
8476
8460
|
"type": "number"
|
|
8477
8461
|
},
|
|
8478
|
-
{
|
|
8479
|
-
"name": "min",
|
|
8480
|
-
"attribute": "min",
|
|
8481
|
-
"description": "For number inputs, minimum value",
|
|
8482
|
-
"type": "string"
|
|
8483
|
-
},
|
|
8484
8462
|
{
|
|
8485
8463
|
"name": "minlength",
|
|
8486
8464
|
"attribute": "minlength",
|
|
@@ -8592,7 +8570,7 @@
|
|
|
8592
8570
|
"name": "type",
|
|
8593
8571
|
"attribute": "type",
|
|
8594
8572
|
"description": "The type of the text input",
|
|
8595
|
-
"type": "'text'|'email'|'
|
|
8573
|
+
"type": "'text'|'email'|'password'|'search'|'tel'|'url'",
|
|
8596
8574
|
"default": "\"text\""
|
|
8597
8575
|
},
|
|
8598
8576
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.330.0",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|