@brightspace-ui/core 2.15.4 → 2.16.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.
@@ -159,7 +159,8 @@ The filter will announce changes to filter selections, search results, and when
159
159
  | Property | Type | Description |
160
160
  |---|---|---|
161
161
  | `disabled` | Boolean, default: `false` | Disables the dropdown opener for the filter |
162
- | `opened` | Boolean, default: `false` | Whether or not the filter is open |
162
+ | `opened` | Boolean, default: `false` | Whether or not the filter is open |
163
+ | `text` | String | Optional override for the button text used for a multi-dimensional filter |
163
164
 
164
165
  ### Events
165
166
  * `d2l-filter-change`: dispatched when any filter value has changed (may contain info about multiple dimensions and multiple changes in each)
@@ -92,7 +92,7 @@
92
92
  <d2l-filter>
93
93
  <d2l-filter-dimension-set key="course" text="Course" loading select-all>
94
94
  <d2l-filter-dimension-set-value key="art" text="Art"></d2l-filter-dimension-set-value>
95
- <d2l-filter-dimension-set-value key="astronomy" text="Astronomy" selected></d2l-filter-dimension-set-value>
95
+ <d2l-filter-dimension-set-value key="astronomy" text="Astronomy"></d2l-filter-dimension-set-value>
96
96
  <d2l-filter-dimension-set-value key="biology" text="Biology"></d2l-filter-dimension-set-value>
97
97
  <d2l-filter-dimension-set-value key="chemistry" text="Chemistry"></d2l-filter-dimension-set-value>
98
98
  <d2l-filter-dimension-set-value key="drama" text="Drama"></d2l-filter-dimension-set-value>
@@ -105,9 +105,13 @@
105
105
  </d2l-filter-dimension-set>
106
106
 
107
107
  </d2l-filter>
108
- <d2l-filter>
108
+ <d2l-filter text="More Filters">
109
109
  <d2l-filter-dimension-set key="course" text="Course" loading select-all></d2l-filter-dimension-set>
110
- <d2l-filter-dimension-set key="role" text="Role" loading></d2l-filter-dimension-set>
110
+ <d2l-filter-dimension-set key="role" text="Role" loading>
111
+ <d2l-filter-dimension-set-value key="admin" text="Admin"></d2l-filter-dimension-set-value>
112
+ <d2l-filter-dimension-set-value key="instructor" text="Instructor"></d2l-filter-dimension-set-value>
113
+ <d2l-filter-dimension-set-value key="student" text="Student"></d2l-filter-dimension-set-value>
114
+ </d2l-filter-dimension-set>
111
115
  <d2l-filter-dimension-set key="semester" text="Semester" loading selection-single></d2l-filter-dimension-set>
112
116
  </d2l-filter>
113
117
  <d2l-button id="finish-loading">Finish loading (in 5 seconds)</d2l-button>
@@ -52,6 +52,11 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
52
52
  * @type {boolean}
53
53
  */
54
54
  opened: { type: Boolean, reflect: true },
55
+ /**
56
+ * Optional override for the button text used for a multi-dimensional filter
57
+ * @type {string}
58
+ */
59
+ text: { type: String },
55
60
  _activeDimensionKey: { type: String, attribute: false },
56
61
  _dimensions: { type: Array, attribute: false },
57
62
  _totalAppliedCount: { type: Number, attribute: false }
@@ -175,7 +180,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
175
180
  const dimensions = this._buildDimensions(singleDimension);
176
181
 
177
182
  const filterCount = this._formatFilterCount(this._totalAppliedCount);
178
- let buttonText = singleDimension ? this._dimensions[0].text : this.localize('components.filter.filters');
183
+ let buttonText = singleDimension ? this._dimensions[0].text : (this.text || this.localize('components.filter.filters'));
179
184
  if (filterCount) buttonText = `${buttonText} (${filterCount})`;
180
185
 
181
186
  let description = singleDimension ? this.localize('components.filter.singleDimensionDescription', { filterName: this._dimensions[0].text }) : this.localize('components.filter.filters');
@@ -3146,6 +3146,11 @@
3146
3146
  "path": "./components/filter/filter.js",
3147
3147
  "description": "A filter component that contains one or more dimensions a user can filter by.\nThis component is in charge of all rendering.",
3148
3148
  "attributes": [
3149
+ {
3150
+ "name": "text",
3151
+ "description": "Optional override for the button text used for a multi-dimensional filter",
3152
+ "type": "string"
3153
+ },
3149
3154
  {
3150
3155
  "name": "disabled",
3151
3156
  "description": "Disables the dropdown opener for the filter",
@@ -3160,6 +3165,12 @@
3160
3165
  }
3161
3166
  ],
3162
3167
  "properties": [
3168
+ {
3169
+ "name": "text",
3170
+ "attribute": "text",
3171
+ "description": "Optional override for the button text used for a multi-dimensional filter",
3172
+ "type": "string"
3173
+ },
3163
3174
  {
3164
3175
  "name": "disabled",
3165
3176
  "attribute": "disabled",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.15.4",
3
+ "version": "2.16.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",