@brightspace-ui-labs/facet-filter-sort 6.5.0 → 6.7.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
|
@@ -73,9 +73,14 @@
|
|
|
73
73
|
"description": "REQUIRED: Id of the tab that labels this panel",
|
|
74
74
|
"type": "string"
|
|
75
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"name": "selected",
|
|
78
|
+
"description": "DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
|
|
79
|
+
"type": "boolean"
|
|
80
|
+
},
|
|
76
81
|
{
|
|
77
82
|
"name": "text",
|
|
78
|
-
"description": "DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.",
|
|
83
|
+
"description": "DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
|
|
79
84
|
"type": "string"
|
|
80
85
|
},
|
|
81
86
|
{
|
|
@@ -83,12 +88,6 @@
|
|
|
83
88
|
"description": "Opt out of default padding/whitespace around the panel",
|
|
84
89
|
"type": "boolean",
|
|
85
90
|
"default": "false"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"name": "selected",
|
|
89
|
-
"description": "DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.",
|
|
90
|
-
"type": "boolean",
|
|
91
|
-
"default": "false"
|
|
92
91
|
}
|
|
93
92
|
],
|
|
94
93
|
"properties": [
|
|
@@ -132,10 +131,16 @@
|
|
|
132
131
|
"description": "REQUIRED: Id of the tab that labels this panel",
|
|
133
132
|
"type": "string"
|
|
134
133
|
},
|
|
134
|
+
{
|
|
135
|
+
"name": "selected",
|
|
136
|
+
"attribute": "selected",
|
|
137
|
+
"description": "DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
|
|
138
|
+
"type": "boolean"
|
|
139
|
+
},
|
|
135
140
|
{
|
|
136
141
|
"name": "text",
|
|
137
142
|
"attribute": "text",
|
|
138
|
-
"description": "DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.",
|
|
143
|
+
"description": "DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
|
|
139
144
|
"type": "string"
|
|
140
145
|
},
|
|
141
146
|
{
|
|
@@ -144,13 +149,6 @@
|
|
|
144
149
|
"description": "Opt out of default padding/whitespace around the panel",
|
|
145
150
|
"type": "boolean",
|
|
146
151
|
"default": "false"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"name": "selected",
|
|
150
|
-
"attribute": "selected",
|
|
151
|
-
"description": "DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.",
|
|
152
|
-
"type": "boolean",
|
|
153
|
-
"default": "false"
|
|
154
152
|
}
|
|
155
153
|
],
|
|
156
154
|
"events": [
|
|
@@ -449,6 +447,9 @@
|
|
|
449
447
|
{
|
|
450
448
|
"name": "d2l-labs-filter-dropdown-close",
|
|
451
449
|
"description": "Dispatched when the filter dropdown is closed"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "d2l-labs-filter-dropdown-category-selected"
|
|
452
453
|
}
|
|
453
454
|
],
|
|
454
455
|
"slots": [
|
package/lang/ca.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint quotes: 0 */
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
"appliedFilters": "Filtres aplicats:",
|
|
5
|
+
"noActiveFilters": "Cap filtre actiu",
|
|
6
|
+
"clearFilters": "Esborrar filtres",
|
|
7
|
+
"categoryTitleMultiple": "{title} ({numSelected})",
|
|
8
|
+
"searchBy": "Cercar per {category}",
|
|
9
|
+
"clear": "Esborrar",
|
|
10
|
+
"filter": "Filtre",
|
|
11
|
+
"filterBy": "Filtrar per",
|
|
12
|
+
"filterMultiple": "Filtrar: {numOptions} filtres",
|
|
13
|
+
"filterSingle": "Filtrar: 1 filtre",
|
|
14
|
+
"sort": "Ordena",
|
|
15
|
+
"sortWithOption": "Ordenar: {option}"
|
|
16
|
+
};
|