@brightspace-ui-labs/facet-filter-sort 6.5.0 → 6.6.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/README.md
CHANGED
|
@@ -126,10 +126,10 @@ Note that for the header and opener text overrides, if the terms are to reflect
|
|
|
126
126
|
|
|
127
127
|
- `d2l-labs-filter-dropdown-close`: Fired when the filter dropdown is closed.
|
|
128
128
|
- `d2l-labs-filter-dropdown-cleared`: Fired when the clear button or the clear filters button is pressed to clear all filters.
|
|
129
|
+
- `d2l-labs-filter-dropdown-category-selected`: Fired when a filter tab is selected.
|
|
129
130
|
|
|
130
131
|
`d2l-labs-filter-dropdown-category`:
|
|
131
132
|
|
|
132
|
-
- `d2l-labs-filter-dropdown-category-selected`: Fired when a filter tab is selected.
|
|
133
133
|
- `d2l-labs-filter-dropdown-category-searched`: Fired when a filter category is searched.
|
|
134
134
|
- `d2l-labs-filter-dropdown-option-change`: Fired when a filter option is selected.
|
|
135
135
|
|
|
@@ -102,10 +102,6 @@ class LabsFilterDropdownCategory extends FilterLocalizeMixin(TabPanelMixin(LitEl
|
|
|
102
102
|
this.selected = !this.selected;
|
|
103
103
|
this.__onSelect(e);
|
|
104
104
|
});
|
|
105
|
-
|
|
106
|
-
this.addEventListener('d2l-tab-panel-selected', () => {
|
|
107
|
-
this._dispatchSelected();
|
|
108
|
-
});
|
|
109
105
|
}
|
|
110
106
|
|
|
111
107
|
render() {
|
|
@@ -123,17 +119,6 @@ class LabsFilterDropdownCategory extends FilterLocalizeMixin(TabPanelMixin(LitEl
|
|
|
123
119
|
`;
|
|
124
120
|
}
|
|
125
121
|
|
|
126
|
-
_dispatchSelected() {
|
|
127
|
-
// Event propagation of d2l-tab-panel-selected stopped in d2l-labs-filter-dropdown
|
|
128
|
-
this.dispatchEvent(new CustomEvent('d2l-labs-filter-dropdown-category-selected', {
|
|
129
|
-
detail: {
|
|
130
|
-
categoryKey: this.key
|
|
131
|
-
},
|
|
132
|
-
bubbles: true,
|
|
133
|
-
composed: true
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
122
|
_handleMenuItemChange(e) {
|
|
138
123
|
e.stopPropagation();
|
|
139
124
|
this.dispatchEvent(new CustomEvent('d2l-labs-filter-dropdown-option-change', {
|
|
@@ -133,7 +133,7 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
133
133
|
</div>
|
|
134
134
|
<d2l-tabs>
|
|
135
135
|
<template is="dom-repeat" items="[[_tabInfos]]" as="tab">
|
|
136
|
-
<d2l-tab id="[[tab.key]]" text="[[tab.text]]" slot="tabs" selected$="[[tab.selected]]"></d2l-tab>
|
|
136
|
+
<d2l-tab id="[[tab.key]]" text="[[tab.text]]" slot="tabs" selected$="[[tab.selected]]" on-d2l-tab-selected="_dispatchSelected"></d2l-tab>
|
|
137
137
|
</template>
|
|
138
138
|
<slot on-slotchange="_handleCategoriesSlotChange" slot="panels"></slot>
|
|
139
139
|
</d2l-tabs>
|
|
@@ -145,7 +145,6 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
145
145
|
|
|
146
146
|
attached() {
|
|
147
147
|
this.addEventListener('d2l-dropdown-close', this._handleDropdownClose);
|
|
148
|
-
this.addEventListener('d2l-tab-panel-selected', this._stopTabPanelSelectedEvent);
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
clearFilters() {
|
|
@@ -166,7 +165,6 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
166
165
|
|
|
167
166
|
detached() {
|
|
168
167
|
this.removeEventListener('d2l-dropdown-close', this._handleDropdownClose);
|
|
169
|
-
this.removeEventListener('d2l-tab-panel-selected', this._stopTabPanelSelectedEvent);
|
|
170
168
|
|
|
171
169
|
const categories = this.querySelectorAll('d2l-labs-filter-dropdown-category');
|
|
172
170
|
categories.forEach(cat => {
|
|
@@ -181,6 +179,16 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
181
179
|
this.shadowRoot.querySelector('d2l-dropdown-button-subtle').focus();
|
|
182
180
|
}
|
|
183
181
|
|
|
182
|
+
_dispatchSelected(e) {
|
|
183
|
+
this.dispatchEvent(new CustomEvent('d2l-labs-filter-dropdown-category-selected', {
|
|
184
|
+
detail: {
|
|
185
|
+
categoryKey: e.target.id
|
|
186
|
+
},
|
|
187
|
+
bubbles: true,
|
|
188
|
+
composed: true
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
|
|
184
192
|
_getFooterSlotValue(hasFooter) {
|
|
185
193
|
return hasFooter ? 'footer' : undefined;
|
|
186
194
|
}
|
|
@@ -251,11 +259,6 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
251
259
|
if (!this.localize || !this.resources) return;
|
|
252
260
|
return altText ? altText : this.localize(...args);
|
|
253
261
|
}
|
|
254
|
-
|
|
255
|
-
// Must be done here (instead of d2l-labs-filter-dropdown-category) as the d2l-dropdown-tabs component needs to receive it
|
|
256
|
-
_stopTabPanelSelectedEvent(e) {
|
|
257
|
-
e.stopPropagation();
|
|
258
|
-
}
|
|
259
262
|
}
|
|
260
263
|
|
|
261
264
|
window.customElements.define(D2LLabsFilterDropdown.is, D2LLabsFilterDropdown);
|
package/custom-elements.json
CHANGED