@brightspace-ui/core 1.231.1 → 1.233.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/components/dialog/README.md +1 -1
- package/components/dialog/demo/dialog-confirm.html +20 -0
- package/components/dialog/dialog-confirm.js +14 -2
- package/components/inputs/docs/input-search.md +1 -1
- package/components/list/README.md +1 -0
- package/components/list/list-header.js +20 -12
- package/components/list/list-item-mixin.js +16 -1
- package/components/selection/selection-action-dropdown.js +1 -0
- package/components/table/README.md +9 -9
- package/custom-elements.json +18 -4
- package/package.json +2 -2
|
@@ -184,7 +184,7 @@ The `d2l-dialog-confirm` element is a simple confirmation dialog for prompting t
|
|
|
184
184
|
|
|
185
185
|
| Property | Type | Description |
|
|
186
186
|
|--|--|--|
|
|
187
|
-
| `text` | String, required | The
|
|
187
|
+
| `text` | String, required | The text content for the confirmation dialog. Newline characters (` ` in HTML or `\n` in JavaScript) will render as multiple paragraphs. |
|
|
188
188
|
| `opened` | Boolean | Whether or not the dialog is open |
|
|
189
189
|
| `title-text` | String | The optional title for the confirmation dialog |
|
|
190
190
|
|
|
@@ -37,6 +37,26 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
</d2l-demo-snippet>
|
|
39
39
|
|
|
40
|
+
<h2>Confirm Dialog (Multi Paragraph)</h2>
|
|
41
|
+
|
|
42
|
+
<d2l-demo-snippet>
|
|
43
|
+
<template>
|
|
44
|
+
<d2l-button id="openConfirmMultiParagraph">Show Confirm</d2l-button>
|
|
45
|
+
<d2l-dialog-confirm id="confirmMultiParagraph" title-text="Confirm Title" text="Are you sure you want more cookies? Are you sure you want more donuts?">
|
|
46
|
+
<d2l-button slot="footer" primary data-dialog-action="ok">Yes</d2l-button>
|
|
47
|
+
<d2l-button slot="footer" data-dialog-action>No</d2l-button>
|
|
48
|
+
</d2l-dialog-confirm>
|
|
49
|
+
<script>
|
|
50
|
+
document.querySelector('#openConfirmMultiParagraph').addEventListener('click', () => {
|
|
51
|
+
document.querySelector('#confirmMultiParagraph').opened = true;
|
|
52
|
+
});
|
|
53
|
+
document.querySelector('#confirmMultiParagraph').addEventListener('d2l-dialog-close', (e) => {
|
|
54
|
+
console.log('confirm action:', e.detail.action);
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
</template>
|
|
58
|
+
</d2l-demo-snippet>
|
|
59
|
+
|
|
40
60
|
<h2>Confirm Dialog (No Title)</h2>
|
|
41
61
|
|
|
42
62
|
<d2l-demo-snippet>
|
|
@@ -14,7 +14,7 @@ class DialogConfirm extends DialogMixin(LitElement) {
|
|
|
14
14
|
static get properties() {
|
|
15
15
|
return {
|
|
16
16
|
/**
|
|
17
|
-
* REQUIRED: The text content for the confirmation dialog
|
|
17
|
+
* REQUIRED: The text content for the confirmation dialog. Newline characters (` ` in HTML or `\n` in JavaScript) will render as multiple paragraphs.
|
|
18
18
|
* @type {string}
|
|
19
19
|
*/
|
|
20
20
|
text: { type: String }
|
|
@@ -36,6 +36,18 @@ class DialogConfirm extends DialogMixin(LitElement) {
|
|
|
36
36
|
padding-top: 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.d2l-dialog-content p {
|
|
40
|
+
margin: 1rem 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.d2l-dialog-content p:first-child {
|
|
44
|
+
margin-top: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.d2l-dialog-content p:last-child {
|
|
48
|
+
margin-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
@media (max-width: 615px), (max-height: 420px) and (max-width: 900px) {
|
|
40
52
|
|
|
41
53
|
dialog.d2l-dialog-outer,
|
|
@@ -65,7 +77,7 @@ class DialogConfirm extends DialogMixin(LitElement) {
|
|
|
65
77
|
<div><h2 id="${this._titleId}" class="d2l-heading-3">${this.titleText}</h2></div>
|
|
66
78
|
</div>` : null}
|
|
67
79
|
<div id="${this._textId}" class="d2l-dialog-content">
|
|
68
|
-
<div>${this.text}</div>
|
|
80
|
+
<div>${this.text ? this.text.split('\n').map(line => html`<p>${line}</p>`) : null}</div>
|
|
69
81
|
</div>
|
|
70
82
|
<div class="d2l-dialog-footer">
|
|
71
83
|
<slot name="footer" class="d2l-dialog-footer-slot"></slot>
|
|
@@ -80,7 +80,7 @@ search.addEventListener('d2l-input-search-searched', (e) => {
|
|
|
80
80
|
When the input is cleared, the same event will be fired with an empty value.
|
|
81
81
|
<!-- docs: end hidden content -->
|
|
82
82
|
|
|
83
|
-
### Accessibility
|
|
83
|
+
### Accessibility Properties
|
|
84
84
|
|
|
85
85
|
To make your usage of `d2l-input-search` accessible, use the following property when applicable:
|
|
86
86
|
|
|
@@ -311,6 +311,7 @@ The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot
|
|
|
311
311
|
|
|
312
312
|
| Property | Type | Description |
|
|
313
313
|
|---|---|---|
|
|
314
|
+
| `no-selection` | Boolean | Whether to render select-all and selection summary |
|
|
314
315
|
| `padding-type` | String | Header whitespace (`normal` (default), `slim`) |
|
|
315
316
|
| `select-all-pages-allowed` | Boolean | Whether all pages can be selected |
|
|
316
317
|
<!-- docs: end hidden content -->
|
|
@@ -15,12 +15,10 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
|
|
|
15
15
|
static get properties() {
|
|
16
16
|
return {
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Whether to render a header with reduced whitespace
|
|
20
|
-
* TODO: Remove
|
|
18
|
+
* Whether to render select-all and selection summary
|
|
21
19
|
* @type {boolean}
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
noSelection: { type: Boolean, attribute: 'no-selection' },
|
|
24
22
|
/**
|
|
25
23
|
* How much padding to render list items with
|
|
26
24
|
* @type {'normal'|'slim'}
|
|
@@ -31,6 +29,13 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
|
|
|
31
29
|
* @type {boolean}
|
|
32
30
|
*/
|
|
33
31
|
selectAllPagesAllowed: { type: Boolean, attribute: 'select-all-pages-allowed' },
|
|
32
|
+
/**
|
|
33
|
+
* @ignore
|
|
34
|
+
* Whether to render a header with reduced whitespace
|
|
35
|
+
* TODO: Remove
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
*/
|
|
38
|
+
slim: { reflect: true, type: Boolean }
|
|
34
39
|
};
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -87,21 +92,24 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
|
|
|
87
92
|
|
|
88
93
|
constructor() {
|
|
89
94
|
super();
|
|
90
|
-
this.
|
|
95
|
+
this.noSelection = false;
|
|
91
96
|
this.paddingType = 'normal';
|
|
92
97
|
this.selectAllPagesAllowed = false;
|
|
98
|
+
this.slim = false;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
render() {
|
|
96
102
|
return html`
|
|
97
103
|
<div class="d2l-list-header-container">
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
${this.noSelection ? null : html`
|
|
105
|
+
<d2l-selection-select-all></d2l-selection-select-all>
|
|
106
|
+
<d2l-selection-summary
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
class="d2l-list-header-summary"
|
|
109
|
+
no-selection-text="${this.localize('components.selection.select-all')}">
|
|
110
|
+
</d2l-selection-summary>
|
|
111
|
+
${this.selectAllPagesAllowed ? html`<d2l-selection-select-all-pages></d2l-selection-select-all-pages>` : null}
|
|
112
|
+
`}
|
|
105
113
|
<div class="d2l-list-header-actions">
|
|
106
114
|
<d2l-overflow-group opener-type="icon"><slot></slot></d2l-overflow-group>
|
|
107
115
|
</div>
|
|
@@ -73,6 +73,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
73
73
|
_breakpoint: { type: Number },
|
|
74
74
|
_displayKeyboardTooltip: { type: Boolean },
|
|
75
75
|
_dropdownOpen: { type: Boolean, attribute: '_dropdown-open', reflect: true },
|
|
76
|
+
_fullscreenWithin: { type: Boolean, attribute: '_fullscreen-within', reflect: true },
|
|
76
77
|
_hoveringPrimaryAction: { type: Boolean },
|
|
77
78
|
_focusing: { type: Boolean },
|
|
78
79
|
_focusingPrimaryAction: { type: Boolean },
|
|
@@ -92,7 +93,8 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
92
93
|
display: none;
|
|
93
94
|
}
|
|
94
95
|
:host([_tooltip-showing]),
|
|
95
|
-
:host([_dropdown-open])
|
|
96
|
+
:host([_dropdown-open]),
|
|
97
|
+
:host([_fullscreen-within]) {
|
|
96
98
|
z-index: 10;
|
|
97
99
|
}
|
|
98
100
|
:host(:first-child) d2l-list-item-generic-layout[data-separators="between"] {
|
|
@@ -275,6 +277,10 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
275
277
|
width: 100%;
|
|
276
278
|
z-index: 5;
|
|
277
279
|
}
|
|
280
|
+
:host([_fullscreen-within]) .d2l-list-item-active-border,
|
|
281
|
+
:host([_fullscreen-within]) d2l-list-item-generic-layout.d2l-focusing + .d2l-list-item-active-border {
|
|
282
|
+
display: none;
|
|
283
|
+
}
|
|
278
284
|
d2l-tooltip > div {
|
|
279
285
|
font-weight: 700;
|
|
280
286
|
}
|
|
@@ -298,6 +304,8 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
298
304
|
this._breakpoint = 0;
|
|
299
305
|
this._contentId = getUniqueId();
|
|
300
306
|
this._displayKeyboardTooltip = false;
|
|
307
|
+
this._fullscreenWithin = false;
|
|
308
|
+
this._fullscreenWithinCount = 0;
|
|
301
309
|
}
|
|
302
310
|
|
|
303
311
|
get breakpoints() {
|
|
@@ -421,6 +429,12 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
421
429
|
this._focusingPrimaryAction = false;
|
|
422
430
|
}
|
|
423
431
|
|
|
432
|
+
_onFullscreenWithin(e) {
|
|
433
|
+
if (e.detail.state) this._fullscreenWithinCount += 1;
|
|
434
|
+
else this._fullscreenWithinCount -= 1;
|
|
435
|
+
this._fullscreenWithin = (this._fullscreenWithinCount > 0);
|
|
436
|
+
}
|
|
437
|
+
|
|
424
438
|
_onMouseEnter() {
|
|
425
439
|
this._hovering = true;
|
|
426
440
|
}
|
|
@@ -460,6 +474,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
|
|
|
460
474
|
<d2l-list-item-generic-layout
|
|
461
475
|
@focusin="${this._onFocusIn}"
|
|
462
476
|
@focusout="${this._onFocusOut}"
|
|
477
|
+
@d2l-fullscreen-within="${this._onFullscreenWithin}"
|
|
463
478
|
class="${classMap(classes)}"
|
|
464
479
|
data-breakpoint="${this._breakpoint}"
|
|
465
480
|
data-separators="${ifDefined(this._separators)}"
|
|
@@ -9,6 +9,7 @@ import { SelectionActionMixin } from './selection-action-mixin.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* A dropdown opener associated with a selection component.
|
|
11
11
|
* @slot - Dropdown content (e.g., "d2l-dropdown-content", "d2l-dropdown-menu" or "d2l-dropdown-tabs")
|
|
12
|
+
* @fires d2l-selection-observer-subscribe - Internal event
|
|
12
13
|
*/
|
|
13
14
|
class ActionDropdown extends LocalizeCoreElement(SelectionActionMixin(DropdownOpenerMixin(LitElement))) {
|
|
14
15
|
|
|
@@ -114,11 +114,11 @@ The `d2l-table-wrapper` element can be combined with table styles to apply defau
|
|
|
114
114
|
<!-- docs: start hidden content -->
|
|
115
115
|
### Properties
|
|
116
116
|
|
|
117
|
-
| Property | Type | Description |
|
|
118
|
-
|
|
119
|
-
| `no-column-border` |
|
|
120
|
-
| `sticky-headers` |
|
|
121
|
-
| `type` |
|
|
117
|
+
| Property | Type | Description | Default Value |
|
|
118
|
+
|---|---|---|---|
|
|
119
|
+
| `no-column-border` | boolean | Hides the column borders on "default" table type | false |
|
|
120
|
+
| `sticky-headers` | boolean | Whether to make the header row sticky | false |
|
|
121
|
+
| `type` | string | Type of the table style. Can be one of `default`, `light`. | 'default' |
|
|
122
122
|
|
|
123
123
|
## Light Type
|
|
124
124
|
|
|
@@ -241,10 +241,10 @@ When tabular data can be sorted, the `<d2l-table-col-sort-button>` can be used t
|
|
|
241
241
|
|
|
242
242
|
### Properties
|
|
243
243
|
|
|
244
|
-
| Property | Type | Description |
|
|
245
|
-
|
|
246
|
-
| `desc` |
|
|
247
|
-
| `nosort` |
|
|
244
|
+
| Property | Type | Description | Default Value |
|
|
245
|
+
|---|---|---|---|
|
|
246
|
+
| `desc` | boolean | Whether sort direction is descending | false |
|
|
247
|
+
| `nosort` | boolean | Column is not currently sorted. Hides the ascending/descending sort icon. | false |
|
|
248
248
|
|
|
249
249
|
## Selection
|
|
250
250
|
|
package/custom-elements.json
CHANGED
|
@@ -1460,7 +1460,7 @@
|
|
|
1460
1460
|
"attributes": [
|
|
1461
1461
|
{
|
|
1462
1462
|
"name": "text",
|
|
1463
|
-
"description": "REQUIRED: The text content for the confirmation dialog",
|
|
1463
|
+
"description": "REQUIRED: The text content for the confirmation dialog. Newline characters (` ` in HTML or `\\n` in JavaScript) will render as multiple paragraphs.",
|
|
1464
1464
|
"type": "string"
|
|
1465
1465
|
},
|
|
1466
1466
|
{
|
|
@@ -1479,7 +1479,7 @@
|
|
|
1479
1479
|
{
|
|
1480
1480
|
"name": "text",
|
|
1481
1481
|
"attribute": "text",
|
|
1482
|
-
"description": "REQUIRED: The text content for the confirmation dialog",
|
|
1482
|
+
"description": "REQUIRED: The text content for the confirmation dialog. Newline characters (` ` in HTML or `\\n` in JavaScript) will render as multiple paragraphs.",
|
|
1483
1483
|
"type": "string"
|
|
1484
1484
|
},
|
|
1485
1485
|
{
|
|
@@ -6673,6 +6673,12 @@
|
|
|
6673
6673
|
"path": "./components/list/list-header.js",
|
|
6674
6674
|
"description": "A header for list components containing select-all, etc.",
|
|
6675
6675
|
"attributes": [
|
|
6676
|
+
{
|
|
6677
|
+
"name": "no-selection",
|
|
6678
|
+
"description": "Whether to render select-all and selection summary",
|
|
6679
|
+
"type": "boolean",
|
|
6680
|
+
"default": "false"
|
|
6681
|
+
},
|
|
6676
6682
|
{
|
|
6677
6683
|
"name": "padding-type",
|
|
6678
6684
|
"description": "How much padding to render list items with",
|
|
@@ -6688,7 +6694,9 @@
|
|
|
6688
6694
|
],
|
|
6689
6695
|
"properties": [
|
|
6690
6696
|
{
|
|
6691
|
-
"name": "
|
|
6697
|
+
"name": "noSelection",
|
|
6698
|
+
"attribute": "no-selection",
|
|
6699
|
+
"description": "Whether to render select-all and selection summary",
|
|
6692
6700
|
"type": "boolean",
|
|
6693
6701
|
"default": "false"
|
|
6694
6702
|
},
|
|
@@ -6705,6 +6713,11 @@
|
|
|
6705
6713
|
"description": "Whether all pages can be selected",
|
|
6706
6714
|
"type": "boolean",
|
|
6707
6715
|
"default": "false"
|
|
6716
|
+
},
|
|
6717
|
+
{
|
|
6718
|
+
"name": "slim",
|
|
6719
|
+
"type": "boolean",
|
|
6720
|
+
"default": "false"
|
|
6708
6721
|
}
|
|
6709
6722
|
],
|
|
6710
6723
|
"slots": [
|
|
@@ -8538,7 +8551,8 @@
|
|
|
8538
8551
|
],
|
|
8539
8552
|
"events": [
|
|
8540
8553
|
{
|
|
8541
|
-
"name": "d2l-selection-observer-subscribe"
|
|
8554
|
+
"name": "d2l-selection-observer-subscribe",
|
|
8555
|
+
"description": "Internal event"
|
|
8542
8556
|
}
|
|
8543
8557
|
],
|
|
8544
8558
|
"slots": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.233.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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/eslint-parser": "^7",
|
|
47
|
-
"@brightspace-ui/stylelint-config": "^0.
|
|
47
|
+
"@brightspace-ui/stylelint-config": "^0.4",
|
|
48
48
|
"@open-wc/testing": "^2",
|
|
49
49
|
"@web/dev-server": "^0.1",
|
|
50
50
|
"@web/test-runner": "^0.13",
|