@brightspace-ui/core 2.90.0 → 2.91.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.
- package/components/filter/README.md +38 -0
- package/components/filter/demo/filter.html +9 -1
- package/components/filter/filter-dimension-set-empty-state.js +38 -0
- package/components/filter/filter-dimension-set.js +57 -14
- package/components/filter/filter.js +58 -6
- package/custom-elements.json +60 -0
- package/package.json +1 -1
|
@@ -154,6 +154,7 @@ The filter will announce changes to filter selections, search results, and when
|
|
|
154
154
|
|
|
155
155
|
### Events
|
|
156
156
|
* `d2l-filter-change`: dispatched when any filter value has changed (may contain info about multiple dimensions and multiple changes in each)
|
|
157
|
+
* `d2l-filter-dimension-empty-state-action`: dispatched when an empty state action button is clicked
|
|
157
158
|
* `d2l-filter-dimension-first-open`: dispatched when a dimension is opened for the first time (if there is only one dimension, this will be dispatched when the dropdown is first opened)
|
|
158
159
|
* `d2l-filter-dimension-search`: dispatched when a dimension that supports searching and has the "manual" search-type is searched
|
|
159
160
|
|
|
@@ -259,6 +260,43 @@ Note that when using multiple filter dimensions, the counts should be updated wh
|
|
|
259
260
|
</d2l-filter>
|
|
260
261
|
```
|
|
261
262
|
|
|
263
|
+
## Dimension Set Empty State [d2l-filter-dimension-set-empty-state]
|
|
264
|
+
|
|
265
|
+
The `d2l-filter-dimension-set-empty-state` component allows you to customize the empty state components that are rendered in [d2l-filter-dimension-set](#d2l-filter-dimension-set). When placed in the `d2l-filter-dimension-set` empty state slots, it will replace the component's default empty state. This component can be placed in either the `set-empty-state` or the `search-empty-state` slots.
|
|
266
|
+
|
|
267
|
+
<!-- docs: demo live name:d2l-filter-dimension-set-empty-state autoOpen:true autoSize:false size:large -->
|
|
268
|
+
```html
|
|
269
|
+
<script type="module">
|
|
270
|
+
import '@brightspace-ui/core/components/filter/filter.js';
|
|
271
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set.js';
|
|
272
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set-empty-state.js';
|
|
273
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set-value.js';
|
|
274
|
+
</script>
|
|
275
|
+
<d2l-filter>
|
|
276
|
+
<d2l-filter-dimension-set key="course" text="Course" >
|
|
277
|
+
<d2l-filter-dimension-set-value key="art" text="Art" count="1" selected></d2l-filter-dimension-set-value>
|
|
278
|
+
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" count="3" disabled></d2l-filter-dimension-set-value>
|
|
279
|
+
<d2l-filter-dimension-set-value key="biology" text="Biology" count="5"></d2l-filter-dimension-set-value>
|
|
280
|
+
<d2l-filter-dimension-set-empty-state slot="search-empty-state" description="Search returned no results." action-text="Add a course"></d2l-filter-dimension-set-empty-state>
|
|
281
|
+
<d2l-filter-dimension-set-empty-state slot="set-empty-state" description="There are no available items." action-text="Add a course"></d2l-filter-dimension-set-empty-state>
|
|
282
|
+
</d2l-filter-dimension-set>
|
|
283
|
+
</d2l-filter>
|
|
284
|
+
<script>
|
|
285
|
+
document.querySelector('#filter-single').addEventListener('d2l-filter-dimension-empty-state-action', e => {
|
|
286
|
+
console.log(`Filter dimension empty state action clicked:\nkey: ${e.detail.key}\ntype: ${e.detail.type}`);
|
|
287
|
+
});
|
|
288
|
+
</script>
|
|
289
|
+
```
|
|
290
|
+
<!-- docs: start hidden content -->
|
|
291
|
+
### Properties
|
|
292
|
+
|
|
293
|
+
| Property | Type | Description |
|
|
294
|
+
|---|---|---|
|
|
295
|
+
| `action-href` | String | The href that will be used for the empty state action. When set with action-text, d2l-filter will render a link action. |
|
|
296
|
+
| `action-text` | String | The text that will be displayed in the empty state action. When set, d2l-filter renders a button action, or a link if action-href is also defined. |
|
|
297
|
+
| `description` | String, required | The text that is displayed in the empty state description |
|
|
298
|
+
<!-- docs: end hidden content -->
|
|
299
|
+
|
|
262
300
|
## Tags for Applied Filters [d2l-filter-tags]
|
|
263
301
|
|
|
264
302
|
A tag-list allowing the user to see (and remove) the currently applied filters. Works with the `d2l-filter`. It supports hooking up to multiple filters.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import '../../button/button.js';
|
|
9
9
|
import '../../filter/filter.js';
|
|
10
10
|
import '../../filter/filter-dimension-set.js';
|
|
11
|
+
import '../../filter/filter-dimension-set-empty-state.js';
|
|
11
12
|
import '../../filter/filter-dimension-set-value.js';
|
|
12
13
|
import './filter-search-demo.js';
|
|
13
14
|
</script>
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
<h2>Single Set Dimension</h2>
|
|
23
24
|
<d2l-demo-snippet>
|
|
24
25
|
<template>
|
|
25
|
-
<d2l-filter>
|
|
26
|
+
<d2l-filter id="filter-single">
|
|
26
27
|
<d2l-filter-dimension-set key="course" introductory-text="Filter content by courses. Start typing any course name to explore." text="Course" select-all>
|
|
27
28
|
<d2l-filter-dimension-set-value key="art" text="Art" count="12"></d2l-filter-dimension-set-value>
|
|
28
29
|
<d2l-filter-dimension-set-value key="astronomy" text="Astronomy" count="2" selected></d2l-filter-dimension-set-value>
|
|
@@ -35,6 +36,8 @@
|
|
|
35
36
|
<d2l-filter-dimension-set-value key="physics" text="Physics" count="23"></d2l-filter-dimension-set-value>
|
|
36
37
|
<d2l-filter-dimension-set-value key="stats" text="Statistics" count="333"></d2l-filter-dimension-set-value>
|
|
37
38
|
<d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft" count="2211"></d2l-filter-dimension-set-value>
|
|
39
|
+
<d2l-filter-dimension-set-empty-state slot="search-empty-state" description="Search returned no results." action-text="Do something"></d2l-filter-dimension-set-empty-state>
|
|
40
|
+
<d2l-filter-dimension-set-empty-state slot="set-empty-state" description="There are no available items." action-text="Add an item"></d2l-filter-dimension-set-empty-state>
|
|
38
41
|
</d2l-filter-dimension-set>
|
|
39
42
|
</d2l-filter>
|
|
40
43
|
</template>
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
<d2l-filter-dimension-set-value key="physics" text="Physics" count="1012"></d2l-filter-dimension-set-value>
|
|
71
74
|
<d2l-filter-dimension-set-value key="stats" text="Statistics" count="2"></d2l-filter-dimension-set-value>
|
|
72
75
|
<d2l-filter-dimension-set-value key="writerscraft" text="Writer's Craft"></d2l-filter-dimension-set-value>
|
|
76
|
+
<d2l-filter-dimension-set-empty-state slot="search-empty-state" description="Search returned no results." action-text="Do something" action-href="https://d2l.com/"></d2l-filter-dimension-set-empty-state>
|
|
73
77
|
</d2l-filter-dimension-set>
|
|
74
78
|
<d2l-filter-dimension-set key="role" text="Role">
|
|
75
79
|
<d2l-filter-dimension-set-value key="admin" text="Admin" count="0"></d2l-filter-dimension-set-value>
|
|
@@ -144,6 +148,10 @@
|
|
|
144
148
|
console.log(`Filter dimension opened for the first time: ${e.detail.key}`);
|
|
145
149
|
});
|
|
146
150
|
|
|
151
|
+
document.querySelector('#filter-single').addEventListener('d2l-filter-dimension-empty-state-action', e => {
|
|
152
|
+
console.log(`Filter dimension empty state action clicked:\nkey: ${e.detail.key}\ntype: ${e.detail.type}`);
|
|
153
|
+
});
|
|
154
|
+
|
|
147
155
|
requestAnimationFrame(() => {
|
|
148
156
|
document.getElementById('finish-loading').addEventListener('click', e => {
|
|
149
157
|
e.target.disabled = true;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A component to customize the empty state parameters for a particular filter-dimension-set.
|
|
5
|
+
* This component does not render anything, but instead gathers data needed for the d2l-filter.
|
|
6
|
+
*/
|
|
7
|
+
class FilterDimensionSetEmptyState extends LitElement {
|
|
8
|
+
|
|
9
|
+
static get properties() {
|
|
10
|
+
return {
|
|
11
|
+
/**
|
|
12
|
+
* The href that will be used for the empty state action. When set with action-text, d2l-filter will render a link action.
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
actionHref: { type: String, attribute: 'action-href' },
|
|
16
|
+
/**
|
|
17
|
+
* The text that will be displayed in the empty state action. When set, d2l-filter renders a button action, or a link if action-href is also defined.
|
|
18
|
+
* @type {string}
|
|
19
|
+
*/
|
|
20
|
+
actionText: { type: String, attribute: 'action-text' },
|
|
21
|
+
/**
|
|
22
|
+
* REQUIRED: The text that is displayed in the empty state description
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
description: { type: String }
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.actionHref = '';
|
|
32
|
+
this.actionText = '';
|
|
33
|
+
this.description = '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
customElements.define('d2l-filter-dimension-set-empty-state', FilterDimensionSetEmptyState);
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { html, LitElement } from 'lit';
|
|
2
2
|
|
|
3
|
+
export const EmptyStateType = {
|
|
4
|
+
Search: 'search',
|
|
5
|
+
Set: 'set'
|
|
6
|
+
};
|
|
7
|
+
|
|
3
8
|
/**
|
|
4
9
|
* A component to represent the main filter dimension type - a set of possible values that can be selected.
|
|
5
10
|
* This component does not render anything, but instead gathers data needed for the d2l-filter.
|
|
6
11
|
* @slot - For d2l-filter-dimension-set-value components
|
|
12
|
+
* @slot search-empty-state - The empty state that is displayed when the search returns no results
|
|
13
|
+
* @slot set-empty-state - The empty state that is displayed when the dimension-set has no values
|
|
7
14
|
*/
|
|
8
15
|
class FilterDimensionSet extends LitElement {
|
|
9
16
|
|
|
@@ -61,6 +68,8 @@ class FilterDimensionSet extends LitElement {
|
|
|
61
68
|
this.selectionSingle = false;
|
|
62
69
|
this.text = '';
|
|
63
70
|
this.valueOnlyActiveFilterText = false;
|
|
71
|
+
this._searchEmptyStatesSlot = null;
|
|
72
|
+
this._setEmptyStatesSlot = null;
|
|
64
73
|
this._slot = null;
|
|
65
74
|
}
|
|
66
75
|
|
|
@@ -70,7 +79,11 @@ class FilterDimensionSet extends LitElement {
|
|
|
70
79
|
}
|
|
71
80
|
|
|
72
81
|
render() {
|
|
73
|
-
return html
|
|
82
|
+
return html`
|
|
83
|
+
<slot @slotchange="${this._handleSlotChange}"></slot>
|
|
84
|
+
<slot name="search-empty-state" @slotchange="${this._handleSearchEmptyStateSlotChange}"></slot>
|
|
85
|
+
<slot name="set-empty-state" @slotchange="${this._handleSetEmptyStateSlotChange}"></slot>
|
|
86
|
+
`;
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
updated(changedProperties) {
|
|
@@ -90,22 +103,15 @@ class FilterDimensionSet extends LitElement {
|
|
|
90
103
|
}
|
|
91
104
|
}
|
|
92
105
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.dispatchEvent(new CustomEvent('d2l-filter-dimension-data-change', {
|
|
96
|
-
detail: eventDetail,
|
|
97
|
-
bubbles: true,
|
|
98
|
-
composed: false
|
|
99
|
-
}));
|
|
106
|
+
getSearchEmptyState() {
|
|
107
|
+
return this._getEmptyState(this._searchEmptyStateSlot);
|
|
100
108
|
}
|
|
101
109
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const nodes = this._slot.assignedNodes({ flatten: true });
|
|
105
|
-
return nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'd2l-filter-dimension-set-value');
|
|
110
|
+
getSetEmptyState() {
|
|
111
|
+
return this._getEmptyState(this._setEmptyStateSlot);
|
|
106
112
|
}
|
|
107
113
|
|
|
108
|
-
|
|
114
|
+
getValues() {
|
|
109
115
|
const valueNodes = this._getSlottedNodes();
|
|
110
116
|
const values = valueNodes.map(value => {
|
|
111
117
|
return {
|
|
@@ -119,14 +125,51 @@ class FilterDimensionSet extends LitElement {
|
|
|
119
125
|
return values;
|
|
120
126
|
}
|
|
121
127
|
|
|
128
|
+
_dispatchDataChangeEvent(eventDetail) {
|
|
129
|
+
/** @ignore */
|
|
130
|
+
this.dispatchEvent(new CustomEvent('d2l-filter-dimension-data-change', {
|
|
131
|
+
detail: eventDetail,
|
|
132
|
+
bubbles: true,
|
|
133
|
+
composed: false
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
_getEmptyState(emptyStateSlot) {
|
|
138
|
+
if (!emptyStateSlot) return null;
|
|
139
|
+
const nodes = emptyStateSlot.assignedNodes({ flatten: true });
|
|
140
|
+
const emptyState = nodes.find((node) => node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'd2l-filter-dimension-set-empty-state');
|
|
141
|
+
if (!emptyState) return null;
|
|
142
|
+
return {
|
|
143
|
+
actionHref: emptyState.actionHref,
|
|
144
|
+
actionText: emptyState.actionText,
|
|
145
|
+
description: emptyState.description
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
_getSlottedNodes() {
|
|
150
|
+
if (!this._slot) return [];
|
|
151
|
+
const nodes = this._slot.assignedNodes({ flatten: true });
|
|
152
|
+
return nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'd2l-filter-dimension-set-value');
|
|
153
|
+
}
|
|
154
|
+
|
|
122
155
|
_handleDimensionSetValueDataChange(e) {
|
|
123
156
|
e.stopPropagation();
|
|
124
157
|
this._dispatchDataChangeEvent({ dimensionKey: this.key, valueKey: e.detail.valueKey, changes: e.detail.changes });
|
|
125
158
|
}
|
|
126
159
|
|
|
160
|
+
_handleSearchEmptyStateSlotChange(e) {
|
|
161
|
+
if (!this._searchEmptyStateSlot) this._searchEmptyStateSlot = e.target;
|
|
162
|
+
this._dispatchDataChangeEvent({ dimensionKey: this.key, changes: new Map([['searchEmptyState', this.getSearchEmptyState()]]) });
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
_handleSetEmptyStateSlotChange(e) {
|
|
166
|
+
if (!this._setEmptyStateSlot) this._setEmptyStateSlot = e.target;
|
|
167
|
+
this._dispatchDataChangeEvent({ dimensionKey: this.key, changes: new Map([['setEmptyState', this.getSetEmptyState()]]) });
|
|
168
|
+
}
|
|
169
|
+
|
|
127
170
|
_handleSlotChange(e) {
|
|
128
171
|
if (!this._slot) this._slot = e.target;
|
|
129
|
-
const values = this.
|
|
172
|
+
const values = this.getValues();
|
|
130
173
|
this._dispatchDataChangeEvent({ dimensionKey: this.key, changes: new Map([['values', values]]) });
|
|
131
174
|
}
|
|
132
175
|
|
|
@@ -5,6 +5,8 @@ import '../button/button-subtle.js';
|
|
|
5
5
|
import '../dropdown/dropdown-button-subtle.js';
|
|
6
6
|
import '../dropdown/dropdown-content.js';
|
|
7
7
|
import '../dropdown/dropdown-menu.js';
|
|
8
|
+
import '../empty-state/empty-state-action-button.js';
|
|
9
|
+
import '../empty-state/empty-state-action-link.js';
|
|
8
10
|
import '../empty-state/empty-state-simple.js';
|
|
9
11
|
import '../hierarchical-view/hierarchical-view.js';
|
|
10
12
|
import '../inputs/input-search.js';
|
|
@@ -20,6 +22,7 @@ import { bodyCompactStyles, bodySmallStyles, bodyStandardStyles } from '../typog
|
|
|
20
22
|
import { css, html, LitElement, nothing } from 'lit';
|
|
21
23
|
import { announce } from '../../helpers/announce.js';
|
|
22
24
|
import { classMap } from 'lit/directives/class-map.js';
|
|
25
|
+
import { EmptyStateType } from './filter-dimension-set.js';
|
|
23
26
|
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
24
27
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
25
28
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -37,6 +40,7 @@ const SET_DIMENSION_ID_PREFIX = 'list-';
|
|
|
37
40
|
* This component is in charge of all rendering.
|
|
38
41
|
* @slot - Dimension components used by the filter to construct the different dimensions locally
|
|
39
42
|
* @fires d2l-filter-change - Dispatched when a dimension's value(s) have changed
|
|
43
|
+
* @fires d2l-filter-dimension-empty-state-action - Dispatched when an empty state action button is clicked
|
|
40
44
|
* @fires d2l-filter-dimension-first-open - Dispatched when a dimension is opened for the first time
|
|
41
45
|
* @fires d2l-filter-dimension-search - Dispatched when a dimension that supports searching and has the "manual" search-type is searched
|
|
42
46
|
*/
|
|
@@ -411,6 +415,35 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
411
415
|
`;
|
|
412
416
|
}
|
|
413
417
|
|
|
418
|
+
_createEmptyState(emptyState, dimensionKey, type) {
|
|
419
|
+
let emptyStateAction = nothing;
|
|
420
|
+
if (emptyState.actionText && emptyState.actionHref) {
|
|
421
|
+
emptyStateAction = html`
|
|
422
|
+
<d2l-empty-state-action-link
|
|
423
|
+
href="${emptyState.actionHref}"
|
|
424
|
+
text="${emptyState.actionText}">
|
|
425
|
+
</d2l-empty-state-action-link>
|
|
426
|
+
`;
|
|
427
|
+
}
|
|
428
|
+
else if (emptyState.actionText) {
|
|
429
|
+
emptyStateAction = html`
|
|
430
|
+
<d2l-empty-state-action-button
|
|
431
|
+
@d2l-empty-state-action="${this._handleEmptyStateAction}"
|
|
432
|
+
data-dimension-key="${dimensionKey}"
|
|
433
|
+
data-type="${type}"
|
|
434
|
+
text="${emptyState.actionText}">
|
|
435
|
+
</d2l-empty-state-action-button>
|
|
436
|
+
`;
|
|
437
|
+
}
|
|
438
|
+
return html`
|
|
439
|
+
<d2l-empty-state-simple
|
|
440
|
+
class="d2l-filter-dimension-info-message"
|
|
441
|
+
description="${emptyState.description}">
|
|
442
|
+
${emptyStateAction}
|
|
443
|
+
</d2l-empty-state-simple>
|
|
444
|
+
`;
|
|
445
|
+
}
|
|
446
|
+
|
|
414
447
|
_createSetDimension(dimension) {
|
|
415
448
|
if (dimension.loading) {
|
|
416
449
|
return html`
|
|
@@ -420,12 +453,17 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
420
453
|
}
|
|
421
454
|
|
|
422
455
|
if (this._isDimensionEmpty(dimension)) {
|
|
423
|
-
|
|
424
|
-
|
|
456
|
+
const emptyState = dimension.setEmptyState
|
|
457
|
+
? this._createEmptyState(dimension.setEmptyState, dimension.key, EmptyStateType.Set)
|
|
458
|
+
: html`
|
|
425
459
|
<d2l-empty-state-simple
|
|
426
460
|
class="d2l-filter-dimension-info-message"
|
|
427
461
|
description="${this.localize('components.filter.noFilters')}">
|
|
428
462
|
</d2l-empty-state-simple>
|
|
463
|
+
`;
|
|
464
|
+
return html`
|
|
465
|
+
<div class="d2l-empty-state-container" role="alert">
|
|
466
|
+
${emptyState}
|
|
429
467
|
</div>
|
|
430
468
|
`;
|
|
431
469
|
}
|
|
@@ -437,13 +475,17 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
437
475
|
'd2l-empty-state-container': true,
|
|
438
476
|
'd2l-offscreen': count !== 0
|
|
439
477
|
};
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
478
|
+
const emptyState = dimension.searchEmptyState
|
|
479
|
+
? this._createEmptyState(dimension.searchEmptyState, dimension.key, EmptyStateType.Search)
|
|
480
|
+
: html`
|
|
443
481
|
<d2l-empty-state-simple
|
|
444
482
|
class="d2l-filter-dimension-info-message"
|
|
445
483
|
description="${this.localize('components.filter.searchResults', { number: count })}">
|
|
446
484
|
</d2l-empty-state-simple>
|
|
485
|
+
`;
|
|
486
|
+
searchResults = html`
|
|
487
|
+
<div class="${classMap(classes)}" role="alert">
|
|
488
|
+
${emptyState}
|
|
447
489
|
</div>
|
|
448
490
|
`;
|
|
449
491
|
|
|
@@ -647,6 +689,14 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
647
689
|
this._stopPropagation(e);
|
|
648
690
|
}
|
|
649
691
|
|
|
692
|
+
_handleEmptyStateAction(e) {
|
|
693
|
+
this.dispatchEvent(new CustomEvent(
|
|
694
|
+
'd2l-filter-dimension-empty-state-action', {
|
|
695
|
+
detail: { key: e.target.getAttribute('data-dimension-key'), type: e.target.getAttribute('data-type') }
|
|
696
|
+
}
|
|
697
|
+
));
|
|
698
|
+
}
|
|
699
|
+
|
|
650
700
|
_handleSearch(e) {
|
|
651
701
|
const dimension = this._getActiveDimension();
|
|
652
702
|
const searchValue = e.detail.value.trim();
|
|
@@ -695,8 +745,10 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
|
|
|
695
745
|
info.searchType = dimension.searchType;
|
|
696
746
|
info.selectionSingle = dimension.selectionSingle;
|
|
697
747
|
if (dimension.selectAll && !dimension.selectionSingle) info.selectAllIdPrefix = SET_DIMENSION_ID_PREFIX;
|
|
748
|
+
info.searchEmptyState = dimension.getSearchEmptyState();
|
|
749
|
+
info.setEmptyState = dimension.getSetEmptyState();
|
|
698
750
|
info.valueOnlyActiveFilterText = dimension.valueOnlyActiveFilterText;
|
|
699
|
-
const values = dimension.
|
|
751
|
+
const values = dimension.getValues();
|
|
700
752
|
info.values = values;
|
|
701
753
|
break;
|
|
702
754
|
}
|
package/custom-elements.json
CHANGED
|
@@ -3493,6 +3493,54 @@
|
|
|
3493
3493
|
"name": "d2l-filter-search-demo",
|
|
3494
3494
|
"path": "./components/filter/demo/filter-search-demo.js"
|
|
3495
3495
|
},
|
|
3496
|
+
{
|
|
3497
|
+
"name": "d2l-filter-dimension-set-empty-state",
|
|
3498
|
+
"path": "./components/filter/filter-dimension-set-empty-state.js",
|
|
3499
|
+
"description": "A component to customize the empty state parameters for a particular filter-dimension-set.\nThis component does not render anything, but instead gathers data needed for the d2l-filter.",
|
|
3500
|
+
"attributes": [
|
|
3501
|
+
{
|
|
3502
|
+
"name": "action-href",
|
|
3503
|
+
"description": "The href that will be used for the empty state action. When set with action-text, d2l-filter will render a link action.",
|
|
3504
|
+
"type": "string",
|
|
3505
|
+
"default": "\"\""
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
"name": "action-text",
|
|
3509
|
+
"description": "The text that will be displayed in the empty state action. When set, d2l-filter renders a button action, or a link if action-href is also defined.",
|
|
3510
|
+
"type": "string",
|
|
3511
|
+
"default": "\"\""
|
|
3512
|
+
},
|
|
3513
|
+
{
|
|
3514
|
+
"name": "description",
|
|
3515
|
+
"description": "REQUIRED: The text that is displayed in the empty state description",
|
|
3516
|
+
"type": "string",
|
|
3517
|
+
"default": "\"\""
|
|
3518
|
+
}
|
|
3519
|
+
],
|
|
3520
|
+
"properties": [
|
|
3521
|
+
{
|
|
3522
|
+
"name": "actionHref",
|
|
3523
|
+
"attribute": "action-href",
|
|
3524
|
+
"description": "The href that will be used for the empty state action. When set with action-text, d2l-filter will render a link action.",
|
|
3525
|
+
"type": "string",
|
|
3526
|
+
"default": "\"\""
|
|
3527
|
+
},
|
|
3528
|
+
{
|
|
3529
|
+
"name": "actionText",
|
|
3530
|
+
"attribute": "action-text",
|
|
3531
|
+
"description": "The text that will be displayed in the empty state action. When set, d2l-filter renders a button action, or a link if action-href is also defined.",
|
|
3532
|
+
"type": "string",
|
|
3533
|
+
"default": "\"\""
|
|
3534
|
+
},
|
|
3535
|
+
{
|
|
3536
|
+
"name": "description",
|
|
3537
|
+
"attribute": "description",
|
|
3538
|
+
"description": "REQUIRED: The text that is displayed in the empty state description",
|
|
3539
|
+
"type": "string",
|
|
3540
|
+
"default": "\"\""
|
|
3541
|
+
}
|
|
3542
|
+
]
|
|
3543
|
+
},
|
|
3496
3544
|
{
|
|
3497
3545
|
"name": "d2l-filter-dimension-set-value",
|
|
3498
3546
|
"path": "./components/filter/filter-dimension-set-value.js",
|
|
@@ -3677,6 +3725,14 @@
|
|
|
3677
3725
|
{
|
|
3678
3726
|
"name": "",
|
|
3679
3727
|
"description": "For d2l-filter-dimension-set-value components"
|
|
3728
|
+
},
|
|
3729
|
+
{
|
|
3730
|
+
"name": "search-empty-state",
|
|
3731
|
+
"description": "The empty state that is displayed when the search returns no results"
|
|
3732
|
+
},
|
|
3733
|
+
{
|
|
3734
|
+
"name": "set-empty-state",
|
|
3735
|
+
"description": "The empty state that is displayed when the dimension-set has no values"
|
|
3680
3736
|
}
|
|
3681
3737
|
]
|
|
3682
3738
|
},
|
|
@@ -3829,6 +3885,10 @@
|
|
|
3829
3885
|
"name": "d2l-filter-change",
|
|
3830
3886
|
"description": "Dispatched when a dimension's value(s) have changed"
|
|
3831
3887
|
},
|
|
3888
|
+
{
|
|
3889
|
+
"name": "d2l-filter-dimension-empty-state-action",
|
|
3890
|
+
"description": "Dispatched when an empty state action button is clicked"
|
|
3891
|
+
},
|
|
3832
3892
|
{
|
|
3833
3893
|
"name": "d2l-filter-dimension-first-open",
|
|
3834
3894
|
"description": "Dispatched when a dimension is opened for the first time"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.91.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",
|