@brightspace-ui/core 1.232.0 → 1.233.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.
|
@@ -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>
|
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
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.233.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",
|