@brightspace-ui/core 3.164.6 → 3.165.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.
@@ -75,6 +75,14 @@
|
|
75
75
|
</template>
|
76
76
|
</d2l-demo-snippet>
|
77
77
|
|
78
|
+
<h2>Custom Width</h2>
|
79
|
+
<d2l-demo-snippet>
|
80
|
+
<template>
|
81
|
+
<d2l-input-textarea label="Label" value="text" skeleton></d2l-input-textarea>
|
82
|
+
<d2l-input-textarea label="Name" input-width="400px"></d2l-input-textarea>
|
83
|
+
</template>
|
84
|
+
</d2l-demo-snippet>
|
85
|
+
|
78
86
|
<h3>Inline Help</h3>
|
79
87
|
<d2l-demo-snippet>
|
80
88
|
<template>
|
@@ -39,6 +39,11 @@ class InputTextArea extends InputInlineHelpMixin(FocusMixin(LabelledMixin(FormEl
|
|
39
39
|
* @type {boolean}
|
40
40
|
*/
|
41
41
|
disabled: { type: Boolean, reflect: true },
|
42
|
+
/**
|
43
|
+
* Restricts the maximum width of the input box without impacting the width of the label.
|
44
|
+
* @type {string}
|
45
|
+
*/
|
46
|
+
inputWidth: { attribute: 'input-width', type: String },
|
42
47
|
/**
|
43
48
|
* Hides the label visually (moves it to the input's "aria-label" attribute)
|
44
49
|
* @type {boolean}
|
@@ -225,9 +230,12 @@ class InputTextArea extends InputInlineHelpMixin(FocusMixin(LabelledMixin(FormEl
|
|
225
230
|
'd2l-input': true,
|
226
231
|
'd2l-input-focus': !this.disabled && this._hovered
|
227
232
|
};
|
233
|
+
const inputContainerStyles = {
|
234
|
+
maxWidth: this.inputWidth
|
235
|
+
};
|
228
236
|
|
229
237
|
const textarea = html`
|
230
|
-
<div class="d2l-input-textarea-container d2l-skeletize">
|
238
|
+
<div class="d2l-input-textarea-container d2l-skeletize" style="${styleMap(inputContainerStyles)}">
|
231
239
|
<div class="d2l-input d2l-input-textarea-mirror" style="${styleMap(mirrorStyles)}" aria-invalid="${ifDefined(ariaInvalid)}">
|
232
240
|
${lines.map(line => html`${line}<br />`)}
|
233
241
|
</div>
|
package/custom-elements.json
CHANGED
@@ -7732,6 +7732,11 @@
|
|
7732
7732
|
"description": "Additional information communicated in the aria-describedby on the input",
|
7733
7733
|
"type": "string"
|
7734
7734
|
},
|
7735
|
+
{
|
7736
|
+
"name": "input-width",
|
7737
|
+
"description": "Restricts the maximum width of the input box without impacting the width of the label.",
|
7738
|
+
"type": "string"
|
7739
|
+
},
|
7735
7740
|
{
|
7736
7741
|
"name": "maxlength",
|
7737
7742
|
"description": "Imposes an upper character limit",
|
@@ -7822,6 +7827,12 @@
|
|
7822
7827
|
"description": "Additional information communicated in the aria-describedby on the input",
|
7823
7828
|
"type": "string"
|
7824
7829
|
},
|
7830
|
+
{
|
7831
|
+
"name": "inputWidth",
|
7832
|
+
"attribute": "input-width",
|
7833
|
+
"description": "Restricts the maximum width of the input box without impacting the width of the label.",
|
7834
|
+
"type": "string"
|
7835
|
+
},
|
7825
7836
|
{
|
7826
7837
|
"name": "maxlength",
|
7827
7838
|
"attribute": "maxlength",
|
package/lang/th.js
CHANGED
@@ -155,6 +155,8 @@ export default {
|
|
155
155
|
"components.pager-load-more.action": "โหลดเพิ่มเติม",
|
156
156
|
"components.pager-load-more.action-with-page-size": "โหลดเพิ่ม {count} รายการ",
|
157
157
|
"components.pager-load-more.status-loading": "กำลังโหลดรายการเพิ่มเติม",
|
158
|
+
"components.scroll-wrapper.scroll-left": "Scroll left",
|
159
|
+
"components.scroll-wrapper.scroll-right": "Scroll right",
|
158
160
|
"components.selection.action-max-hint":
|
159
161
|
`{count, plural,
|
160
162
|
other {ปิดใช้งานเมื่อเลือกมากกว่า {countFormatted} รายการ}
|
package/lang/vi.js
CHANGED
@@ -155,6 +155,8 @@ export default {
|
|
155
155
|
"components.pager-load-more.action": "Tải thêm",
|
156
156
|
"components.pager-load-more.action-with-page-size": "Tải thêm {count} mục",
|
157
157
|
"components.pager-load-more.status-loading": "Đang tải thêm các mục",
|
158
|
+
"components.scroll-wrapper.scroll-left": "Scroll left",
|
159
|
+
"components.scroll-wrapper.scroll-right": "Scroll right",
|
158
160
|
"components.selection.action-max-hint":
|
159
161
|
`{count, plural,
|
160
162
|
other {Vô hiệu hóa khi chọn nhiều hơn {countFormatted} mục}
|
@@ -4,7 +4,7 @@ The `LocalizeMixin` allows text in components to be displayed in the user's pref
|
|
4
4
|
|
5
5
|
## Language Resources
|
6
6
|
|
7
|
-
Resources are stored as
|
7
|
+
Resources are stored as JavaScript objects.
|
8
8
|
|
9
9
|
### Keys
|
10
10
|
|
@@ -14,28 +14,28 @@ For large projects, terms may be grouped using the `:` character. For example: `
|
|
14
14
|
|
15
15
|
### Values
|
16
16
|
|
17
|
-
Term values must
|
17
|
+
Term values must contain a "message" that conforms to [ICU Message Syntax](https://formatjs.github.io/docs/core-concepts/icu-syntax/). The syntax supports features such as [simple arguments](https://formatjs.github.io/docs/core-concepts/icu-syntax/#simple-argument), [selection](https://formatjs.github.io/docs/core-concepts/icu-syntax/#select-format), and [pluralization](https://formatjs.github.io/docs/core-concepts/icu-syntax/#plural-format).
|
18
18
|
|
19
|
-
> **Note:** Avoid using
|
19
|
+
> **Note:** Avoid using ICU Message Syntax number and date/time formatting functionality. Brightspace allows customization of how these are localized, which is supported by [@brightspace-ui/intl](https://github.com/BrightspaceUI/intl)'s `formatNumber`, `formatDate` and `formatTime` functions.
|
20
20
|
|
21
21
|
### Files
|
22
22
|
|
23
|
-
Store
|
23
|
+
Store resource files in their own directory (i.e. with nothing else in it). There should be one JavaScript file for each supported locale.
|
24
24
|
|
25
25
|
```javascript
|
26
|
-
// en.js
|
26
|
+
// lang/en.js
|
27
27
|
export default {
|
28
28
|
"hello": "Hello {firstName}!"
|
29
29
|
};
|
30
30
|
```
|
31
31
|
```javascript
|
32
|
-
// fr.js
|
32
|
+
// lang/fr.js
|
33
33
|
export default {
|
34
34
|
"hello": "Bonjour {firstName}!"
|
35
35
|
};
|
36
36
|
```
|
37
37
|
|
38
|
-
|
38
|
+
For every supported language, there should be a base file (e.g. `en.js`, `fr.js`, `pt.js`). That way, if the user prefers a regional language (e.g. `en-au`) that isn't recognized, it can fall back to the base file (`en.js`). You do _not_ need to duplicate a locale. For instance, if you support en-US and en-GB, your English language files would likely be `en.js` and `en-gb.js`.
|
39
39
|
|
40
40
|
## Using `LocalizeMixin`
|
41
41
|
|
@@ -71,7 +71,7 @@ Two common patterns for using `localize()` are within `render()` to modify the c
|
|
71
71
|
|
72
72
|
The `localize()` method is used to localize a piece of text.
|
73
73
|
|
74
|
-
If the
|
74
|
+
If the message contains arguments, supply a replacements object as the second parameter:
|
75
75
|
|
76
76
|
```javascript
|
77
77
|
render() {
|
@@ -82,7 +82,7 @@ render() {
|
|
82
82
|
|
83
83
|
### `localizeHTML()`
|
84
84
|
|
85
|
-
Rich formatting can be included in
|
85
|
+
Rich formatting can be included in messages and safely converted to HTML with the `localizeHTML()` method.
|
86
86
|
|
87
87
|
#### Basic Formatting
|
88
88
|
|
@@ -113,7 +113,7 @@ this.localizeHTML('myTerm');
|
|
113
113
|
|
114
114
|
#### Links
|
115
115
|
|
116
|
-
To wrap text in [a link](../../components/link/),
|
116
|
+
To wrap text in [a link](../../components/link/), surround it with a unique tag in the message:
|
117
117
|
|
118
118
|
```json
|
119
119
|
{
|
@@ -133,7 +133,7 @@ this.localizeHTML('myTerm', {
|
|
133
133
|
|
134
134
|
#### Help Tooltips
|
135
135
|
|
136
|
-
To use a [help tooltip](../../components/tooltip/),
|
136
|
+
To use a [help tooltip](../../components/tooltip/), surround the tooltip's target text with a unique tag in the message:
|
137
137
|
|
138
138
|
```json
|
139
139
|
{
|
@@ -154,7 +154,7 @@ this.localizeHTML('octopus', {
|
|
154
154
|
|
155
155
|
### Common Resources
|
156
156
|
|
157
|
-
Some
|
157
|
+
Some resources are common and shared across D2L applications. To use these, set the `loadCommon` option:
|
158
158
|
|
159
159
|
```javascript
|
160
160
|
static get localizeConfig() {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.165.1",
|
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",
|