@brightspace-ui-labs/facet-filter-sort 6.4.0 → 6.5.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.
|
@@ -5,12 +5,9 @@ import '@brightspace-ui/core/components/dropdown/dropdown-tabs.js';
|
|
|
5
5
|
import '@brightspace-ui/core/components/tabs/tabs.js';
|
|
6
6
|
import '@brightspace-ui/core/components/tabs/tab.js';
|
|
7
7
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
8
|
-
import { getFlag } from '@brightspace-ui/core/helpers/flags.js';
|
|
9
8
|
import { LocalizeBehavior } from '../localize-behavior.js';
|
|
10
9
|
import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
|
|
11
10
|
|
|
12
|
-
const useTabsNewStructure = getFlag('GAUD-7146-tabs-new-structure', true);
|
|
13
|
-
|
|
14
11
|
/**
|
|
15
12
|
* A component containing filter options and emitting selection events
|
|
16
13
|
* @slot - Contents of the dropdown, including filter categories and options
|
|
@@ -92,10 +89,6 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
92
89
|
type: Boolean,
|
|
93
90
|
value: false
|
|
94
91
|
},
|
|
95
|
-
_useNewStructure: {
|
|
96
|
-
type: Boolean,
|
|
97
|
-
value: useTabsNewStructure
|
|
98
|
-
},
|
|
99
92
|
_tabInfos: {
|
|
100
93
|
type: Array,
|
|
101
94
|
value: () => []
|
|
@@ -139,15 +132,10 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
139
132
|
<d2l-button-subtle text="[[localize('clear')]]" hidden$="[[!totalSelectedOptionCount]]" on-click="clearFilters"></d2l-button-subtle>
|
|
140
133
|
</div>
|
|
141
134
|
<d2l-tabs>
|
|
142
|
-
<template is="dom-
|
|
143
|
-
<slot></
|
|
144
|
-
</template>
|
|
145
|
-
<template is="dom-if" if="[[_useNewStructure]]">
|
|
146
|
-
<template is="dom-repeat" items="[[_tabInfos]]" as="tab">
|
|
147
|
-
<d2l-tab id="[[tab.key]]" text="[[tab.text]]" slot="tabs" selected$="[[tab.selected]]"></d2l-tab>
|
|
148
|
-
</template>
|
|
149
|
-
<slot on-slotchange="_handleCategoriesSlotChange" slot="panels"></slot>
|
|
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>
|
|
150
137
|
</template>
|
|
138
|
+
<slot on-slotchange="_handleCategoriesSlotChange" slot="panels"></slot>
|
|
151
139
|
</d2l-tabs>
|
|
152
140
|
<slot name="footer" slot="[[_getFooterSlotValue(_hasFooter)]]" on-slotchange="_handleFooterSlotChange"></slot>
|
|
153
141
|
</d2l-dropdown-tabs>
|
|
@@ -180,15 +168,13 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
180
168
|
this.removeEventListener('d2l-dropdown-close', this._handleDropdownClose);
|
|
181
169
|
this.removeEventListener('d2l-tab-panel-selected', this._stopTabPanelSelectedEvent);
|
|
182
170
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
});
|
|
191
|
-
}
|
|
171
|
+
const categories = this.querySelectorAll('d2l-labs-filter-dropdown-category');
|
|
172
|
+
categories.forEach(cat => {
|
|
173
|
+
if (cat.__tabInfoObserver) {
|
|
174
|
+
cat.__tabInfoObserver.disconnect();
|
|
175
|
+
delete cat.__tabInfoObserver;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
192
178
|
}
|
|
193
179
|
|
|
194
180
|
focus() {
|
|
@@ -212,8 +198,6 @@ class D2LLabsFilterDropdown extends mixinBehaviors([LocalizeBehavior], PolymerEl
|
|
|
212
198
|
}
|
|
213
199
|
|
|
214
200
|
async _handleCategoriesSlotChange() {
|
|
215
|
-
if (!this._useNewStructure) return;
|
|
216
|
-
|
|
217
201
|
const tabsContainer = this.shadowRoot.querySelector('d2l-tabs');
|
|
218
202
|
const categories = this.querySelectorAll('d2l-labs-filter-dropdown-category');
|
|
219
203
|
|