@brightspace-ui-labs/facet-filter-sort 6.0.0 → 6.0.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/README.md CHANGED
@@ -135,7 +135,7 @@ Note that for the header and opener text overrides, if the terms are to reflect
135
135
 
136
136
  ### d2l-labs-applied-filters
137
137
 
138
- A multi-select-list allowing the user to see (and remove) the currently applied filters. Works with the `d2l-labs-filter-dropdown` above.
138
+ A tag-list allowing the user to see (and remove) the currently applied filters. Works with the `d2l-labs-filter-dropdown` above.
139
139
 
140
140
  NOTE: This component uses the `slotchange` event and so will not work if you require IE support
141
141
 
@@ -1,22 +1,17 @@
1
- import '@brightspace-ui/core/components/button/button-subtle.js';
2
- import '@brightspace-ui-labs/multi-select/multi-select-list.js';
3
- import '@brightspace-ui-labs/multi-select/multi-select-list-item.js';
4
- import { css, html, LitElement } from 'lit';
5
- import { announce } from '@brightspace-ui/core/helpers/announce.js';
1
+ import '@brightspace-ui/core/components/tag-list/tag-list.js';
2
+ import '@brightspace-ui/core/components/tag-list/tag-list-item.js';
3
+ import { css, html, LitElement, nothing } from 'lit';
6
4
  import { bodyCompactStyles } from '@brightspace-ui/core/components/typography/styles.js';
7
- import { FilterLocalizeMixin } from '../localize-mixin.js';
8
5
  import { getComposedChildren } from '@brightspace-ui/core/helpers/dom.js';
9
- import { RtlMixin } from '@brightspace-ui/core/mixins/rtl-mixin.js';
10
6
 
11
7
  const DROPDOWN_NAME = 'D2L-LABS-FILTER-DROPDOWN';
12
8
  const DROPDOWN_CATEGORY_NAME = 'D2L-LABS-FILTER-DROPDOWN-CATEGORY';
13
9
  const DROPDOWN_OPTION_NAME = 'D2L-LABS-FILTER-DROPDOWN-OPTION';
14
- const CLEAR_FILTERS_THRESHOLD = 4;
15
10
 
16
11
  /**
17
- * A multi-select-list allowing the user to see (and remove) the currently applied filters.
12
+ * A tag-list allowing the user to see (and remove) the currently applied filters.
18
13
  */
19
- class D2lLabsAppliedFilters extends RtlMixin(FilterLocalizeMixin(LitElement)) {
14
+ class D2lLabsAppliedFilters extends LitElement {
20
15
  static get properties() {
21
16
  return {
22
17
  /**
@@ -39,42 +34,6 @@ class D2lLabsAppliedFilters extends RtlMixin(FilterLocalizeMixin(LitElement)) {
39
34
  display: block;
40
35
  }
41
36
 
42
- d2l-labs-multi-select-list {
43
- flex: 1;
44
- }
45
-
46
- .d2l-labs-applied-filters-wrapper {
47
- display: flex;
48
- }
49
-
50
- .d2l-labs-applied-filters-label {
51
- display: inline-block;
52
- font-weight: bold;
53
- margin-right: 0.25rem;
54
- padding-top: 0.3rem;
55
- }
56
-
57
- :host([dir="rtl"]) .d2l-labs-applied-filters-label {
58
- margin-left: 0.25rem;
59
- margin-right: 0;
60
- }
61
-
62
- .d2l-labs-applied-filters-none-label {
63
- color: var(--d2l-color-corundum);
64
- display: inline-block;
65
- font-style: italic;
66
- padding-top: 0.3rem;
67
- }
68
-
69
- #d2l-clear-filters-button {
70
- margin-left: 3px;
71
- margin-right: 3px;
72
- }
73
-
74
- #d2l-list-holder {
75
- flex: 1;
76
- }
77
-
78
37
  :host([hidden]) {
79
38
  display: none;
80
39
  }
@@ -102,31 +61,21 @@ class D2lLabsAppliedFilters extends RtlMixin(FilterLocalizeMixin(LitElement)) {
102
61
  }
103
62
 
104
63
  render() {
105
- const filters = this._selectedEntries && this._selectedEntries.length > 0 ?
106
- html`<d2l-labs-multi-select-list
107
- collapsable
108
- aria-labelledby="d2l-labs-applied-filters-label"
109
- >
110
- ${(this._selectedEntries || []).map((x, index) => html`
111
- <d2l-labs-multi-select-list-item
112
- text="${x.text}"
113
- deletable
114
- index="${index}"
115
- @d2l-labs-multi-select-list-item-deleted="${this._multiSelectItemDeleted}"
116
- >
117
- </d2l-labs-multi-select-list-item>
118
- `)}
119
- </d2l-labs-multi-select-list>`
120
- : null;
121
-
122
- return html`
123
- <div class="d2l-labs-applied-filters-wrapper">
124
- <div id="d2l-list-holder">
125
- ${filters}
126
- <d2l-button-subtle id="d2l-clear-filters-button" text="${this.localize('clearFilters')}" ?hidden="${this._selectedEntries.length < CLEAR_FILTERS_THRESHOLD}" @click="${this._clearFiltersClicked}"></d2l-button-subtle>
127
- </div>
128
- </div>
129
- `;
64
+ if (!(this._selectedEntries.length)) return nothing;
65
+
66
+ return html`<d2l-tag-list
67
+ clearable
68
+ description="${this.labelText}"
69
+ @d2l-tag-list-clear="${this._clearFiltersClicked}">
70
+ ${(this._selectedEntries || []).map((x, index) => html`
71
+ <d2l-tag-list-item
72
+ text="${x.text}"
73
+ key="${index}"
74
+ @d2l-tag-list-item-clear="${this._multiSelectItemDeleted}"
75
+ >
76
+ </d2l-tag-list-item>
77
+ `)}
78
+ </d2l-tag-list>`;
130
79
  }
131
80
 
132
81
  updated(changedProperties) {
@@ -140,8 +89,6 @@ class D2lLabsAppliedFilters extends RtlMixin(FilterLocalizeMixin(LitElement)) {
140
89
  if (!dropdown) { return; }
141
90
  dropdown.clearFilters();
142
91
  dropdown.focus();
143
-
144
- announce(this.localize('allFiltersRemoved'));
145
92
  }
146
93
 
147
94
  _clearSelected() {
@@ -192,8 +139,7 @@ class D2lLabsAppliedFilters extends RtlMixin(FilterLocalizeMixin(LitElement)) {
192
139
  }
193
140
 
194
141
  _multiSelectItemDeleted(e) {
195
- announce(this.localize('filterRemoved', 'filterText', e.target.text));
196
- this._selectedEntries[e.target.getAttribute('index')].deselect();
142
+ this._selectedEntries[e.target.getAttribute('key')].deselect();
197
143
  }
198
144
 
199
145
  _setFilter() {
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "name": "d2l-labs-applied-filters",
6
6
  "path": "./components/applied-filters/applied-filters.js",
7
- "description": "A multi-select-list allowing the user to see (and remove) the currently applied filters.",
7
+ "description": "A tag-list allowing the user to see (and remove) the currently applied filters.",
8
8
  "attributes": [
9
9
  {
10
10
  "name": "for",
@@ -31,10 +31,6 @@
31
31
  "description": "Optional: The text displayed in this component's label. Default: \"Applied Filters:\"",
32
32
  "type": "string",
33
33
  "default": "\"\""
34
- },
35
- {
36
- "name": "documentLocaleSettings",
37
- "default": "\"getDocumentLocaleSettings()\""
38
34
  }
39
35
  ]
40
36
  },
@@ -74,7 +70,7 @@
74
70
  },
75
71
  {
76
72
  "name": "text",
77
- "description": "REQUIRED: The text used for the tab, as well as labelling the panel",
73
+ "description": "ACCESSIBILITY: REQUIRED: The text used for the tab, as well as labelling the panel",
78
74
  "type": "string"
79
75
  },
80
76
  {
@@ -125,14 +121,10 @@
125
121
  "type": "number",
126
122
  "default": "0"
127
123
  },
128
- {
129
- "name": "documentLocaleSettings",
130
- "default": "\"getDocumentLocaleSettings()\""
131
- },
132
124
  {
133
125
  "name": "text",
134
126
  "attribute": "text",
135
- "description": "REQUIRED: The text used for the tab, as well as labelling the panel",
127
+ "description": "ACCESSIBILITY: REQUIRED: The text used for the tab, as well as labelling the panel",
136
128
  "type": "string"
137
129
  },
138
130
  {
@@ -206,7 +198,7 @@
206
198
  },
207
199
  {
208
200
  "name": "description",
209
- "description": "Provide a description for the menu item that will be used by screen readers",
201
+ "description": "ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context",
210
202
  "type": "string"
211
203
  },
212
204
  {
@@ -244,7 +236,7 @@
244
236
  {
245
237
  "name": "description",
246
238
  "attribute": "description",
247
- "description": "Provide a description for the menu item that will be used by screen readers",
239
+ "description": "ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context",
248
240
  "type": "string"
249
241
  },
250
242
  {
@@ -469,7 +461,7 @@
469
461
  },
470
462
  {
471
463
  "name": "description",
472
- "description": "Provide a description for the menu item that will be used by screen readers",
464
+ "description": "ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context",
473
465
  "type": "string"
474
466
  },
475
467
  {
@@ -502,7 +494,7 @@
502
494
  {
503
495
  "name": "description",
504
496
  "attribute": "description",
505
- "description": "Provide a description for the menu item that will be used by screen readers",
497
+ "description": "ACCESSIBILITY: A description of the menu item that will be used by screen readers for additional context",
506
498
  "type": "string"
507
499
  },
508
500
  {
package/lang/ar.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "عوامل التصفية المطبقة:",
5
5
  "noActiveFilters": "لا توجد عوامل تصفية نشطة",
6
- "filterRemoved": "تمت إزالة عامل التصفية {filterText}",
7
6
  "clearFilters": "مسح عوامل التصفية",
8
- "allFiltersRemoved": "تمت إزالة كل عوامل التصفية",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "بحث حسب {category}",
11
9
  "clear": "مسح",
package/lang/cy.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Hidlyddion wedi’u Gosod:",
5
5
  "noActiveFilters": "Dim hidlwyr gweithredol",
6
- "filterRemoved": "Tynnwyd hidlydd {filterText}",
7
6
  "clearFilters": "Clirio hidlwyr",
8
- "allFiltersRemoved": "Tynnwyd yr holl hidlyddion",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Chwilio yn ôl {category}",
11
9
  "clear": "Clirio",
package/lang/da.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Anvende filtre:",
5
5
  "noActiveFilters": "Ingen aktive filtre",
6
- "filterRemoved": "Filter {filterText} fjernet",
7
6
  "clearFilters": "Ryd filtre",
8
- "allFiltersRemoved": "Alle filtre fjernet",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Søg efter {category}",
11
9
  "clear": "Ryd",
package/lang/de.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Angewendete Filter:",
5
5
  "noActiveFilters": "Keine Filter aktiv",
6
- "filterRemoved": "Filter {filterText} entfernt",
7
6
  "clearFilters": "Filter löschen",
8
- "allFiltersRemoved": "Alle Filter wurden entfernt",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Nach {category} suchen",
11
9
  "clear": "Löschen",
package/lang/en-gb.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Applied Filters:",
5
5
  "noActiveFilters": "No active filters",
6
- "filterRemoved": "Filter {filterText} removed",
7
6
  "clearFilters": "Clear filters",
8
- "allFiltersRemoved": "All filters removed",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Search by {category}",
11
9
  "clear": "Clear",
package/lang/en.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Applied Filters:",
5
5
  "noActiveFilters": "No active filters",
6
- "filterRemoved": "Filter {filterText} removed",
7
6
  "clearFilters": "Clear filters",
8
- "allFiltersRemoved": "All filters removed",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Search by {category}",
11
9
  "clear": "Clear",
package/lang/es-es.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Filtros aplicados:",
5
5
  "noActiveFilters": "No hay filtros activos",
6
- "filterRemoved": "Filtro {filterText} eliminado",
7
6
  "clearFilters": "Borrar filtros",
8
- "allFiltersRemoved": "Se han eliminado todos los filtros",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Buscar por {category}",
11
9
  "clear": "Borrar",
package/lang/es.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Filtros aplicados:",
5
5
  "noActiveFilters": "No hay filtros activos",
6
- "filterRemoved": "Filtro {filterText} eliminado",
7
6
  "clearFilters": "Borrar filtros",
8
- "allFiltersRemoved": "Todos los filtros eliminados",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Buscar por {category}",
11
9
  "clear": "Borrar",
package/lang/fr-fr.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Filtres appliqués :",
5
5
  "noActiveFilters": "Aucun filtre actif",
6
- "filterRemoved": "Filtre {filterText} supprimé",
7
6
  "clearFilters": "Supprimer les filtres",
8
- "allFiltersRemoved": "Tous les filtres ont été supprimés",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Rechercher par {category}",
11
9
  "clear": "Effacer",
package/lang/fr.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Filtres appliqués :",
5
5
  "noActiveFilters": "Aucun filtre actif",
6
- "filterRemoved": "Filtre {filterText} retiré",
7
6
  "clearFilters": "Effacer les filtres",
8
- "allFiltersRemoved": "Tous les filtres sont retirés",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Rechercher par {category}",
11
9
  "clear": "Effacer",
package/lang/hi.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "लगाए गए फ़िल्टर:",
5
5
  "noActiveFilters": "कोई सक्रिय फ़िल्टर नहीं हैं",
6
- "filterRemoved": "फ़िल्टर {filterText} निकाला गया",
7
6
  "clearFilters": "फ़िल्टर साफ़ करें",
8
- "allFiltersRemoved": "सभी फ़िल्टर निकाले गए",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "{category} के अनुसार खोजें",
11
9
  "clear": "साफ़ करें",
package/lang/ja.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "適用されるフィルタ:",
5
5
  "noActiveFilters": "アクティブフィルタなし",
6
- "filterRemoved": "フィルタ {filterText} が削除されました",
7
6
  "clearFilters": "フィルタのクリア",
8
- "allFiltersRemoved": "削除されたすべてのフィルタ",
9
7
  "categoryTitleMultiple": "{title}({numSelected})",
10
8
  "searchBy": "{category} で検索",
11
9
  "clear": "クリア",
package/lang/ko.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "적용된 필터:",
5
5
  "noActiveFilters": "활성 필터가 없음",
6
- "filterRemoved": "필터 {filterText} 제거됨",
7
6
  "clearFilters": "필터 지우기",
8
- "allFiltersRemoved": "모든 필터가 제거되었습니다.",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "{category}별 검색",
11
9
  "clear": "지우기",
package/lang/nl.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Toegepaste filters:",
5
5
  "noActiveFilters": "Geen actieve filters",
6
- "filterRemoved": "Filter {filterText} verwijderd",
7
6
  "clearFilters": "Filters wissen",
8
- "allFiltersRemoved": "Alle filters verwijderd",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Zoeken op {category}",
11
9
  "clear": "Wissen",
package/lang/pt.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Filtros aplicados:",
5
5
  "noActiveFilters": "Nenhum filtro ativo",
6
- "filterRemoved": "Filtro {filterText} removido",
7
6
  "clearFilters": "Limpar filtros",
8
- "allFiltersRemoved": "Todos os filtros foram removidos",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Pesquisar por {category}",
11
9
  "clear": "Limpar",
package/lang/sv.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Tillämpade filter:",
5
5
  "noActiveFilters": "Inga aktiva filter",
6
- "filterRemoved": "Filtret {filterText} har tagits bort",
7
6
  "clearFilters": "Rensa filter",
8
- "allFiltersRemoved": "Alla filter har tagits bort",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "Sök efter {category}",
11
9
  "clear": "Rensa",
package/lang/tr.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "Uygulanan Filtreler:",
5
5
  "noActiveFilters": "Etkin filtre yok",
6
- "filterRemoved": "{filterText} filtresi kaldırıldı",
7
6
  "clearFilters": "Filtreleri temizle",
8
- "allFiltersRemoved": "Tüm filtreler kaldırıldı",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "{category} kategorisine göre ara",
11
9
  "clear": "Temizle",
package/lang/zh-cn.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "已应用筛选器:",
5
5
  "noActiveFilters": "没有活动的筛选器",
6
- "filterRemoved": "已移除筛选条件 {filterText}",
7
6
  "clearFilters": "清除筛选",
8
- "allFiltersRemoved": "所有筛选器均已移除",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "按 {category} 搜索",
11
9
  "clear": "清除",
package/lang/zh-tw.js CHANGED
@@ -3,9 +3,7 @@
3
3
  export default {
4
4
  "appliedFilters": "套用篩選器:",
5
5
  "noActiveFilters": "沒有啟用中的篩選器",
6
- "filterRemoved": "已移除篩選器 {filterText}",
7
6
  "clearFilters": "清除篩選器",
8
- "allFiltersRemoved": "已移除所有篩選器",
9
7
  "categoryTitleMultiple": "{title} ({numSelected})",
10
8
  "searchBy": "依 {category} 搜尋",
11
9
  "clear": "清除",
package/package.json CHANGED
@@ -37,9 +37,8 @@
37
37
  "lit-analyzer": "^1",
38
38
  "stylelint": "^15"
39
39
  },
40
- "version": "6.0.0",
40
+ "version": "6.0.1",
41
41
  "dependencies": {
42
- "@brightspace-ui-labs/multi-select": "^7",
43
42
  "@brightspace-ui/core": "^3",
44
43
  "@brightspace-ui/localize-behavior": "^2",
45
44
  "@polymer/polymer": "^3",