@brightspace-ui/core 2.36.0 → 2.37.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/empty-state/README.md +68 -28
- package/components/empty-state/demo/empty-state.html +34 -12
- package/components/empty-state/empty-state-action-button.js +100 -0
- package/components/empty-state/empty-state-action-link.js +73 -0
- package/components/empty-state/{empty-state-illustrated-mixin.js → empty-state-illustrated.js} +43 -16
- package/components/empty-state/{empty-state-simple-button.js → empty-state-simple.js} +7 -28
- package/components/empty-state/empty-state-styles.js +19 -18
- package/components/html-block/demo/html-block.html +12 -0
- package/components/html-block/html-block.js +4 -4
- package/components/paging/pager-load-more.js +3 -2
- package/components/typography/styles.js +60 -33
- package/custom-elements.json +56 -132
- package/lang/ar.js +1 -1
- package/lang/cy.js +1 -1
- package/lang/da.js +1 -1
- package/lang/de.js +1 -1
- package/lang/en.js +1 -1
- package/lang/es-es.js +1 -1
- package/lang/es.js +1 -1
- package/lang/fr-fr.js +1 -1
- package/lang/fr.js +1 -1
- package/lang/hi.js +1 -1
- package/lang/ja.js +1 -1
- package/lang/ko.js +1 -1
- package/lang/nl.js +1 -1
- package/lang/pt.js +1 -1
- package/lang/sv.js +1 -1
- package/lang/tr.js +1 -1
- package/lang/zh-cn.js +1 -1
- package/lang/zh-tw.js +1 -1
- package/package.json +1 -1
- package/components/empty-state/empty-state-illustrated-button.js +0 -71
- package/components/empty-state/empty-state-illustrated-link.js +0 -57
- package/components/empty-state/empty-state-simple-link.js +0 -74
package/lang/sv.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "mer",
|
|
93
93
|
"components.overflow-group.moreActions": "Fler åtgärder",
|
|
94
94
|
"components.pager-load-more.action": "Läs in {count} till",
|
|
95
|
-
"components.pager-load-more.info": "{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} of {totalCountFormatted} item} other {{showingCount} of {totalCountFormatted} items}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Läser in fler objekt",
|
|
97
97
|
"components.selection.action-hint": "Välj ett objekt för att utföra åtgärden.",
|
|
98
98
|
"components.selection.select-all": "Välj alla",
|
package/lang/tr.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "daha fazla",
|
|
93
93
|
"components.overflow-group.moreActions": "Daha Fazla Eylem",
|
|
94
94
|
"components.pager-load-more.action": "{count} Tane Daha Yükle",
|
|
95
|
-
"components.pager-load-more.info": "{totalCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, one {{showingCount} of {totalCountFormatted} item} other {{showingCount} of {totalCountFormatted} items}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "Daha fazla öğe yükleniyor",
|
|
97
97
|
"components.selection.action-hint": "Bu eylemi gerçekleştirebilmek için bir öğe seçin.",
|
|
98
98
|
"components.selection.select-all": "Tümünü Seç",
|
package/lang/zh-cn.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "更多",
|
|
93
93
|
"components.overflow-group.moreActions": "更多操作",
|
|
94
94
|
"components.pager-load-more.action": "再加载 {count} 个",
|
|
95
|
-
"components.pager-load-more.info": "{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount} of {totalCountFormatted} items}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "加载更多项目",
|
|
97
97
|
"components.selection.action-hint": "选择一个项目后才能执行此操作。",
|
|
98
98
|
"components.selection.select-all": "全选",
|
package/lang/zh-tw.js
CHANGED
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
"components.more-less.more": "較多",
|
|
93
93
|
"components.overflow-group.moreActions": "其他動作",
|
|
94
94
|
"components.pager-load-more.action": "再載入 {count} 個",
|
|
95
|
-
"components.pager-load-more.info": "{showingCount}
|
|
95
|
+
"components.pager-load-more.info": "{totalCount, plural, other {{showingCount} of {totalCountFormatted} items}}",
|
|
96
96
|
"components.pager-load-more.status-loading": "正在載入更多項目",
|
|
97
97
|
"components.selection.action-hint": "選取項目以執行此動作。",
|
|
98
98
|
"components.selection.select-all": "全選",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.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",
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import '../button/button.js';
|
|
2
|
-
import '../button/button-subtle.js';
|
|
3
|
-
import { html, LitElement, nothing } from 'lit';
|
|
4
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import { EmptyStateIllustratedMixin } from './empty-state-illustrated-mixin.js';
|
|
6
|
-
import { runAsync } from '../../directives/run-async/run-async.js';
|
|
7
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The `d2l-empty-state-illustrated-button` component is an empty state component that displays an illustration and action button. The illustration property can be set to use one of the preset illustrations or a custom SVG illustration can be added in the default slot.
|
|
11
|
-
* @fires d2l-empty-state-action - Dispatched when the action button is clicked
|
|
12
|
-
* @slot - Custom SVG content if `illustration-name` property is not set
|
|
13
|
-
*/
|
|
14
|
-
class EmptyStateIllustratedButton extends EmptyStateIllustratedMixin(LitElement) {
|
|
15
|
-
|
|
16
|
-
static get properties() {
|
|
17
|
-
return {
|
|
18
|
-
/**
|
|
19
|
-
* This will change the action button to use a primary button instead of the default subtle button
|
|
20
|
-
* @type {boolean}
|
|
21
|
-
*/
|
|
22
|
-
primary: { type: Boolean },
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
constructor() {
|
|
27
|
-
super();
|
|
28
|
-
this._illustratedComponentType = 'button';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
const illustrationContainerStyle = this.getIllustrationContainerStyle();
|
|
33
|
-
const titleClass = this.getTitleClass();
|
|
34
|
-
|
|
35
|
-
let actionButton = nothing;
|
|
36
|
-
if (this.actionText) {
|
|
37
|
-
actionButton = this.primary
|
|
38
|
-
? html`<d2l-button
|
|
39
|
-
class="d2l-empty-state-action"
|
|
40
|
-
@click=${this._handleActionClick}
|
|
41
|
-
primary>${this.actionText}
|
|
42
|
-
</d2l-button>`
|
|
43
|
-
: html`<d2l-button-subtle
|
|
44
|
-
class="d2l-empty-state-action"
|
|
45
|
-
@click=${this._handleActionClick}
|
|
46
|
-
text=${this.actionText}>
|
|
47
|
-
</d2l-button-subtle>`;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return html`
|
|
51
|
-
${this.illustrationName
|
|
52
|
-
? html`
|
|
53
|
-
<div style="${styleMap(illustrationContainerStyle)}">
|
|
54
|
-
${runAsync(this.illustrationName, () => this.getIllustration(this.illustrationName), { success: (illustration) => illustration }, { pendingState: false })}
|
|
55
|
-
</div>`
|
|
56
|
-
: html`<slot></slot>`}
|
|
57
|
-
|
|
58
|
-
<p class="${classMap(titleClass)}">${this.titleText}</p>
|
|
59
|
-
<p class="d2l-body-compact d2l-empty-state-description">${this.description}</p>
|
|
60
|
-
${actionButton}
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
_handleActionClick(e) {
|
|
65
|
-
e.stopPropagation();
|
|
66
|
-
this.dispatchEvent(new CustomEvent('d2l-empty-state-action'));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
customElements.define('d2l-empty-state-illustrated-button', EmptyStateIllustratedButton);
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { html, LitElement, nothing } from 'lit';
|
|
2
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
-
import { EmptyStateIllustratedMixin } from './empty-state-illustrated-mixin.js';
|
|
4
|
-
import { linkStyles } from '../link/link.js';
|
|
5
|
-
import { runAsync } from '../../directives/run-async/run-async.js';
|
|
6
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The `d2l-empty-state-illustrated-link` component is an empty state component that displays an illustration and action link. The illustration property can be set to use one of the preset illustrations or a custom SVG illustration can be added in the default slot.
|
|
10
|
-
* @slot - Custom SVG content if `illustration-name` property is not set
|
|
11
|
-
*/
|
|
12
|
-
class EmptyStateIllustratedLink extends EmptyStateIllustratedMixin(LitElement) {
|
|
13
|
-
|
|
14
|
-
static get properties() {
|
|
15
|
-
return {
|
|
16
|
-
/**
|
|
17
|
-
* The action URL or URL fragment of the link
|
|
18
|
-
* @type {string}
|
|
19
|
-
*/
|
|
20
|
-
actionHref: { type: String, attribute: 'action-href' },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static get styles() {
|
|
25
|
-
return [super.styles, linkStyles];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this._illustratedComponentType = 'link';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
render() {
|
|
34
|
-
const illustrationContainerStyle = this.getIllustrationContainerStyle();
|
|
35
|
-
const titleClass = this.getTitleClass();
|
|
36
|
-
|
|
37
|
-
const actionLink = this.actionText && this.actionHref
|
|
38
|
-
? html`<a class="d2l-body-compact d2l-empty-state-action d2l-link" href=${this.actionHref}>${this.actionText}</a>`
|
|
39
|
-
: nothing;
|
|
40
|
-
|
|
41
|
-
return html`
|
|
42
|
-
${this.illustrationName
|
|
43
|
-
? html`
|
|
44
|
-
<div style="${styleMap(illustrationContainerStyle)}">
|
|
45
|
-
${runAsync(this.illustrationName, () => this.getIllustration(this.illustrationName), { success: (illustration) => illustration }, { pendingState: false })}
|
|
46
|
-
</div>`
|
|
47
|
-
: html`<slot></slot>`}
|
|
48
|
-
|
|
49
|
-
<p class="${classMap(titleClass)}">${this.titleText}</p>
|
|
50
|
-
<p class="d2l-body-compact d2l-empty-state-description">${this.description}</p>
|
|
51
|
-
${actionLink}
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
customElements.define('d2l-empty-state-illustrated-link', EmptyStateIllustratedLink);
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { emptyStateSimpleStyles, emptyStateStyles } from './empty-state-styles.js';
|
|
2
|
-
import { html, LitElement, nothing } from 'lit';
|
|
3
|
-
import { bodyCompactStyles } from '../typography/styles.js';
|
|
4
|
-
import { linkStyles } from '../link/link.js';
|
|
5
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The `d2l-empty-state-simple-link` component is an empty state component that displays a description and action link.
|
|
9
|
-
*/
|
|
10
|
-
class EmptyStateSimpleLink extends RtlMixin(LitElement) {
|
|
11
|
-
|
|
12
|
-
static get properties() {
|
|
13
|
-
return {
|
|
14
|
-
/**
|
|
15
|
-
* The action URL or URL fragment of the link
|
|
16
|
-
* @type {string}
|
|
17
|
-
*/
|
|
18
|
-
actionHref: { type: String, attribute: 'action-href' },
|
|
19
|
-
/**
|
|
20
|
-
* The action text to be used in the link
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
actionText: { type: String, attribute: 'action-text' },
|
|
24
|
-
/**
|
|
25
|
-
* REQUIRED: A description giving details about the empty state
|
|
26
|
-
* @type {string}
|
|
27
|
-
*/
|
|
28
|
-
description: { type: String }
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static get styles() {
|
|
33
|
-
return [bodyCompactStyles, emptyStateStyles, emptyStateSimpleStyles, linkStyles];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
constructor() {
|
|
37
|
-
super();
|
|
38
|
-
this._missingDescriptionErrorHasBeenThrown = false;
|
|
39
|
-
this._validatingDescriptionTimeout = null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
firstUpdated(changedProperties) {
|
|
43
|
-
super.firstUpdated(changedProperties);
|
|
44
|
-
this._validateDescription();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
render() {
|
|
48
|
-
const actionLink = this.actionText && this.actionHref
|
|
49
|
-
? html`<a class="d2l-body-compact d2l-link" href=${this.actionHref}>${this.actionText}</a>`
|
|
50
|
-
: nothing;
|
|
51
|
-
|
|
52
|
-
return html`
|
|
53
|
-
<p class="d2l-body-compact d2l-empty-state-description">${this.description}</p>
|
|
54
|
-
${actionLink}
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
_validateDescription() {
|
|
59
|
-
clearTimeout(this._validatingDescriptionTimeout);
|
|
60
|
-
// don't error immediately in case it doesn't get set immediately
|
|
61
|
-
this._validatingDescriptionTimeout = setTimeout(() => {
|
|
62
|
-
this._validatingDescriptionTimeout = null;
|
|
63
|
-
const hasDescription = (typeof this.description === 'string') && this.description.length > 0;
|
|
64
|
-
|
|
65
|
-
if (!hasDescription && !this._missingDescriptionErrorHasBeenThrown) {
|
|
66
|
-
this._missingDescriptionErrorHasBeenThrown = true;
|
|
67
|
-
setTimeout(() => { throw new Error('<d2l-empty-state-simple-link>: missing required "description" attribute.'); });
|
|
68
|
-
}
|
|
69
|
-
}, 3000);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
customElements.define('d2l-empty-state-simple-link', EmptyStateSimpleLink);
|