@brightspace-ui-labs/facet-filter-sort 6.7.5 → 6.8.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.
@@ -37,7 +37,8 @@ class LabsFilterDropdownCategory extends FilterLocalizeMixin(TabPanelMixin(LitEl
37
37
  /**
38
38
  * The number of selected filter options for that filter category. When options are selected and de-selected, the consumer is responsible for updating this number after updating its own data store.
39
39
  */
40
- selectedOptionCount: { type: Number, attribute: 'selected-option-count' }
40
+ selectedOptionCount: { type: Number, attribute: 'selected-option-count' },
41
+ _text: { type: String, attribute: '_text', reflect: true }
41
42
  };
42
43
  }
43
44
 
@@ -96,14 +97,6 @@ class LabsFilterDropdownCategory extends FilterLocalizeMixin(TabPanelMixin(LitEl
96
97
  }
97
98
  }
98
99
 
99
- firstUpdated(changedProperties) {
100
- super.firstUpdated(changedProperties);
101
- this.addEventListener('d2l-menu-item-select', (e) => {
102
- this.selected = !this.selected;
103
- this.__onSelect(e);
104
- });
105
- }
106
-
107
100
  render() {
108
101
  return html`
109
102
  <div class="d2l-labs-filter-dropdown-page-search" ?hidden="${this.disableSearch}">
@@ -113,7 +106,7 @@ class LabsFilterDropdownCategory extends FilterLocalizeMixin(TabPanelMixin(LitEl
113
106
  value="${ifDefined(this.searchValue)}">
114
107
  </d2l-input-search>
115
108
  </div>
116
- <d2l-menu @d2l-menu-item-change="${this._handleMenuItemChange}" label="${this.getAttribute('text')}">
109
+ <d2l-menu @d2l-menu-item-change="${this._handleMenuItemChange}" label="${this._text}">
117
110
  <slot @slotchange="${this._onSlotChange}"></slot>
118
111
  </d2l-menu>
119
112
  `;
@@ -152,11 +145,10 @@ class LabsFilterDropdownCategory extends FilterLocalizeMixin(TabPanelMixin(LitEl
152
145
 
153
146
  _updateTabText(categoryText, selectedOptionCount) {
154
147
  if (selectedOptionCount === 0) {
155
- this.setAttribute('text', categoryText);
148
+ this._text = categoryText;
156
149
  } else {
157
- this.setAttribute('text', this.localize('categoryTitleMultiple', 'title', categoryText, 'numSelected', selectedOptionCount));
150
+ this._text = this.localize('categoryTitleMultiple', 'title', categoryText, 'numSelected', selectedOptionCount);
158
151
  }
159
- this.requestUpdate();
160
152
  }
161
153
 
162
154
  }
@@ -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]]" on-d2l-tab-selected="_dispatchSelected"></d2l-tab>
136
+ <d2l-tab id="[[tab.key]]" text="[[tab.text]]" slot="tabs" on-d2l-tab-selected="_dispatchSelected"></d2l-tab>
137
137
  </template>
138
138
  <slot on-slotchange="_handleCategoriesSlotChange" slot="panels"></slot>
139
139
  </d2l-tabs>
@@ -215,24 +215,22 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
215
215
  const tabInfos = [];
216
216
  categories.forEach((category, index) => {
217
217
  const key = category.getAttribute('key') || `category-${index}`;
218
- const text = category.getAttribute('text');
219
- const isSelected = category._selected;
218
+ const text = category._text;
220
219
 
221
220
  category.setAttribute('labelled-by', key);
222
- tabInfos.push({ key, text, selected: isSelected });
221
+ tabInfos.push({ key, text });
223
222
 
224
223
  if (!category.__tabInfoObserver) {
225
224
  category.__tabInfoObserver = new MutationObserver(() => {
226
- const newText = category.getAttribute('text');
227
- const newSelected = category._selected;
225
+ const newText = category._text;
228
226
 
229
227
  this._tabInfos = this._tabInfos.map(info => {
230
228
  return info.key === key
231
- ? { ...info, text: newText, selected: newSelected }
229
+ ? { ...info, text: newText }
232
230
  : info;
233
231
  });
234
232
  });
235
- category.__tabInfoObserver.observe(category, { attributes: true, attributeFilter: ['text', 'selected'] });
233
+ category.__tabInfoObserver.observe(category, { attributes: true, attributeFilter: ['_text'] });
236
234
  }
237
235
  });
238
236
 
package/lang/fr-on.js ADDED
@@ -0,0 +1,16 @@
1
+ /* eslint quotes: 0 */
2
+
3
+ export default {
4
+ "appliedFilters": "Applied Filters:",
5
+ "noActiveFilters": "No active filters",
6
+ "clearFilters": "Clear filters",
7
+ "categoryTitleMultiple": "{title} ({numSelected})",
8
+ "searchBy": "Search by {category}",
9
+ "clear": "Effacer",
10
+ "filter": "Filtrer",
11
+ "filterBy": "Filter By",
12
+ "filterMultiple": "Filter: {numOptions} Filters",
13
+ "filterSingle": "Filter: 1 Filter",
14
+ "sort": "Trier",
15
+ "sortWithOption": "Sort: {option}"
16
+ };
package/lang/ga.js ADDED
@@ -0,0 +1,16 @@
1
+ /* eslint quotes: 0 */
2
+
3
+ export default {
4
+ "appliedFilters": "Applied Filters:",
5
+ "noActiveFilters": "No active filters",
6
+ "clearFilters": "Clear filters",
7
+ "categoryTitleMultiple": "{title} ({numSelected})",
8
+ "searchBy": "Search by {category}",
9
+ "clear": "Clear",
10
+ "filter": "Filter",
11
+ "filterBy": "Filter By",
12
+ "filterMultiple": "Filter: {numOptions} Filters",
13
+ "filterSingle": "Filter: 1 Filter",
14
+ "sort": "Sort",
15
+ "sortWithOption": "Sort: {option}"
16
+ };
package/lang/ur.js ADDED
@@ -0,0 +1,16 @@
1
+ /* eslint quotes: 0 */
2
+
3
+ export default {
4
+ "appliedFilters": "اطلاق شدہ فلٹرز:",
5
+ "noActiveFilters": "کوئی فعال فلٹر نہیں",
6
+ "clearFilters": "فلٹرز صاف کریں",
7
+ "categoryTitleMultiple": "{title} ({numSelected})",
8
+ "searchBy": "{category} کے ذریعے تلاش کریں",
9
+ "clear": "صاف کریں",
10
+ "filter": "فلٹر",
11
+ "filterBy": "فلٹر بلحاظ",
12
+ "filterMultiple": "فلٹر: {numOptions} فلٹرز",
13
+ "filterSingle": "فلٹر: 1 فلٹر",
14
+ "sort": "سورٹ کریں",
15
+ "sortWithOption": "سورٹ کریں: {option}"
16
+ };
package/package.json CHANGED
@@ -35,7 +35,7 @@
35
35
  "eslint-config-brightspace": "^0.25",
36
36
  "stylelint": "^15"
37
37
  },
38
- "version": "6.7.5",
38
+ "version": "6.8.1",
39
39
  "dependencies": {
40
40
  "@brightspace-ui/core": "^3",
41
41
  "@brightspace-ui/localize-behavior": "^2",