@brightspace-ui/core 1.241.0 → 1.242.2

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.
@@ -66,8 +66,6 @@ export const ButtonMixin = superclass => class extends FocusMixin(FocusVisiblePo
66
66
  };
67
67
  }
68
68
 
69
- static focusElementSelector = 'button';
70
-
71
69
  constructor() {
72
70
  super();
73
71
  this.disabled = false;
@@ -100,6 +98,10 @@ export const ButtonMixin = superclass => class extends FocusMixin(FocusVisiblePo
100
98
  this.requestUpdate('disabledTooltip', oldValue);
101
99
  }
102
100
 
101
+ static get focusElementSelector() {
102
+ return 'button';
103
+ }
104
+
103
105
  connectedCallback() {
104
106
  super.connectedCallback();
105
107
  this.addEventListener('click', this._handleClick, true);
@@ -235,8 +235,6 @@ class Card extends FocusMixin(RtlMixin(LitElement)) {
235
235
  `];
236
236
  }
237
237
 
238
- static focusElementSelector = 'a';
239
-
240
238
  constructor() {
241
239
  super();
242
240
  this.alignCenter = false;
@@ -251,6 +249,10 @@ class Card extends FocusMixin(RtlMixin(LitElement)) {
251
249
  this._onFooterResize = this._onFooterResize.bind(this);
252
250
  }
253
251
 
252
+ static get focusElementSelector() {
253
+ return 'a';
254
+ }
255
+
254
256
  firstUpdated(changedProperties) {
255
257
  super.firstUpdated(changedProperties);
256
258
  const badgeObserver = new ResizeObserver(this._onBadgeResize);
@@ -137,8 +137,6 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
137
137
  `];
138
138
  }
139
139
 
140
- static focusElementSelector = 'd2l-dropdown-button-subtle';
141
-
142
140
  constructor() {
143
141
  super();
144
142
  this.disabled = false;
@@ -155,6 +153,10 @@ class Filter extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
155
153
  );
156
154
  }
157
155
 
156
+ static get focusElementSelector() {
157
+ return 'd2l-dropdown-button-subtle';
158
+ }
159
+
158
160
  connectedCallback() {
159
161
  super.connectedCallback();
160
162
  this._activeFiltersSubscribers.hostConnected();
@@ -31,14 +31,16 @@ class FocusTrap extends FocusMixin(LitElement) {
31
31
  `;
32
32
  }
33
33
 
34
- static focusElementSelector = '.d2l-focus-trap-start';
35
-
36
34
  constructor() {
37
35
  super();
38
36
  this.trap = false;
39
37
  this._handleBodyFocus = this._handleBodyFocus.bind(this);
40
38
  }
41
39
 
40
+ static get focusElementSelector() {
41
+ return '.d2l-focus-trap-start';
42
+ }
43
+
42
44
  connectedCallback() {
43
45
  super.connectedCallback();
44
46
  document.body.addEventListener('focus', this._handleBodyFocus, true);
@@ -164,8 +164,6 @@ class InputCheckbox extends FocusMixin(SkeletonMixin(RtlMixin(LitElement))) {
164
164
  ];
165
165
  }
166
166
 
167
- static focusElementSelector = 'input.d2l-input-checkbox';
168
-
169
167
  constructor() {
170
168
  super();
171
169
  this.checked = false;
@@ -177,6 +175,10 @@ class InputCheckbox extends FocusMixin(SkeletonMixin(RtlMixin(LitElement))) {
177
175
  this._descriptionId = getUniqueId();
178
176
  }
179
177
 
178
+ static get focusElementSelector() {
179
+ return 'input.d2l-input-checkbox';
180
+ }
181
+
180
182
  render() {
181
183
  const tabindex = this.notTabbable ? -1 : undefined;
182
184
  const textClasses = {
@@ -129,8 +129,6 @@ class InputDateRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(
129
129
  `];
130
130
  }
131
131
 
132
- static focusElementSelector = 'd2l-input-date';
133
-
134
132
  constructor() {
135
133
  super();
136
134
 
@@ -147,6 +145,10 @@ class InputDateRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(
147
145
  this._endInputId = getUniqueId();
148
146
  }
149
147
 
148
+ static get focusElementSelector() {
149
+ return 'd2l-input-date';
150
+ }
151
+
150
152
  /** @ignore */
151
153
  get validationMessage() {
152
154
  if (this.validity.badInput) {
@@ -172,8 +172,6 @@ class InputDateTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMi
172
172
  `];
173
173
  }
174
174
 
175
- static focusElementSelector = 'd2l-input-date-time';
176
-
177
175
  constructor() {
178
176
  super();
179
177
 
@@ -193,6 +191,10 @@ class InputDateTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMi
193
191
  this._slotOccupied = false;
194
192
  }
195
193
 
194
+ static get focusElementSelector() {
195
+ return 'd2l-input-date-time';
196
+ }
197
+
196
198
  /** @ignore */
197
199
  get validationMessage() {
198
200
  if (this.validity.badInput) {
@@ -113,8 +113,6 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
113
113
  `];
114
114
  }
115
115
 
116
- static focusElementSelector = 'd2l-input-date';
117
-
118
116
  constructor() {
119
117
  super();
120
118
  this.disabled = false;
@@ -179,6 +177,10 @@ class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMi
179
177
  this.requestUpdate('value', oldValue);
180
178
  }
181
179
 
180
+ static get focusElementSelector() {
181
+ return 'd2l-input-date';
182
+ }
183
+
182
184
  /** @ignore */
183
185
  get validationMessage() {
184
186
  if (this.validity.rangeOverflow || this.validity.rangeUnderflow) {
@@ -138,8 +138,6 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
138
138
  `];
139
139
  }
140
140
 
141
- static focusElementSelector = 'd2l-input-text';
142
-
143
141
  constructor() {
144
142
  super();
145
143
 
@@ -170,6 +168,10 @@ class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
170
168
  this._dateTimeDescriptor = getDateTimeDescriptorShared();
171
169
  }
172
170
 
171
+ static get focusElementSelector() {
172
+ return 'd2l-input-text';
173
+ }
174
+
173
175
  /** @ignore */
174
176
  get validationMessage() {
175
177
  if (this.validity.rangeOverflow || this.validity.rangeUnderflow) {
@@ -17,6 +17,12 @@ const HINT_TYPES = {
17
17
  INTEGER: 4
18
18
  };
19
19
 
20
+ // US137000 - prevent Lit default converter from converting undefined to 0
21
+ const numberConverter = {
22
+ fromAttribute: (attr) => { return !attr ? undefined : Number(attr); },
23
+ toAttribute: (prop) => { return String(prop); }
24
+ };
25
+
20
26
  function formatValue(value, options, numDecimalDigits) {
21
27
  if (value === undefined) return '';
22
28
  if (numDecimalDigits > 0) {
@@ -161,7 +167,7 @@ class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixi
161
167
  * Value of the input
162
168
  * @type {number}
163
169
  */
164
- value: { type: Number },
170
+ value: { type: Number, converter: numberConverter },
165
171
  /**
166
172
  * @ignore
167
173
  */
@@ -186,8 +192,6 @@ class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixi
186
192
  ];
187
193
  }
188
194
 
189
- static focusElementSelector = 'd2l-input-text';
190
-
191
195
  constructor() {
192
196
  super();
193
197
  this.autofocus = false;
@@ -282,6 +286,10 @@ class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixi
282
286
  this._updateFormattedValue();
283
287
  }
284
288
 
289
+ static get focusElementSelector() {
290
+ return 'd2l-input-text';
291
+ }
292
+
285
293
  /** @ignore */
286
294
  get validationMessage() {
287
295
  if (this.validity.rangeOverflow || this.validity.rangeUnderflow) {
@@ -86,8 +86,6 @@ class InputPercent extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMix
86
86
  ];
87
87
  }
88
88
 
89
- static focusElementSelector = 'd2l-input-number';
90
-
91
89
  constructor() {
92
90
  super();
93
91
  this.autofocus = false;
@@ -105,6 +103,10 @@ class InputPercent extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMix
105
103
  this.requestUpdate('value', oldValue);
106
104
  }
107
105
 
106
+ static get focusElementSelector() {
107
+ return 'd2l-input-number';
108
+ }
109
+
108
110
  render() {
109
111
  return html`
110
112
  <d2l-input-number
@@ -74,8 +74,6 @@ class InputSearch extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement)))
74
74
  ];
75
75
  }
76
76
 
77
- static focusElementSelector = 'd2l-input-text';
78
-
79
77
  constructor() {
80
78
  super();
81
79
  this._lastSearchValue = '';
@@ -88,6 +86,10 @@ class InputSearch extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement)))
88
86
  get lastSearchValue() { return this._lastSearchValue; }
89
87
  set lastSearchValue(val) {}
90
88
 
89
+ static get focusElementSelector() {
90
+ return 'd2l-input-text';
91
+ }
92
+
91
93
  connectedCallback() {
92
94
  super.connectedCallback();
93
95
  if (this.value !== undefined && this.value !== null) {
@@ -235,8 +235,6 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
235
235
  ];
236
236
  }
237
237
 
238
- static focusElementSelector = '.d2l-input';
239
-
240
238
  constructor() {
241
239
  super();
242
240
  this.autofocus = false;
@@ -272,6 +270,10 @@ class InputText extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(
272
270
  this._setValue(val, true);
273
271
  }
274
272
 
273
+ static get focusElementSelector() {
274
+ return '.d2l-input';
275
+ }
276
+
275
277
  /** @ignore */
276
278
  get selectionEnd() {
277
279
  const elem = this.shadowRoot && this.shadowRoot.querySelector('.d2l-input');
@@ -150,8 +150,6 @@ class InputTextArea extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMi
150
150
  `];
151
151
  }
152
152
 
153
- static focusElementSelector = 'textarea';
154
-
155
153
  constructor() {
156
154
  super();
157
155
  this.disabled = false;
@@ -165,6 +163,10 @@ class InputTextArea extends FocusMixin(LabelledMixin(FormElementMixin(SkeletonMi
165
163
  this._textareaId = getUniqueId();
166
164
  }
167
165
 
166
+ static get focusElementSelector() {
167
+ return 'textarea';
168
+ }
169
+
168
170
  /** @ignore */
169
171
  get textarea() {
170
172
  // temporary until consumers are updated
@@ -137,8 +137,6 @@ class InputTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(
137
137
  `];
138
138
  }
139
139
 
140
- static focusElementSelector = 'd2l-input-time';
141
-
142
140
  constructor() {
143
141
  super();
144
142
 
@@ -178,6 +176,10 @@ class InputTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(
178
176
  this.requestUpdate('startValue', oldValue);
179
177
  }
180
178
 
179
+ static get focusElementSelector() {
180
+ return 'd2l-input-time';
181
+ }
182
+
181
183
  /** @ignore */
182
184
  get validationMessage() {
183
185
  if (this.validity.badInput) {
@@ -215,8 +215,6 @@ class InputTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
215
215
  ];
216
216
  }
217
217
 
218
- static focusElementSelector = '.d2l-input';
219
-
220
218
  constructor() {
221
219
  super();
222
220
  this.disabled = false;
@@ -254,6 +252,10 @@ class InputTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(
254
252
  this.requestUpdate('value', oldValue);
255
253
  }
256
254
 
255
+ static get focusElementSelector() {
256
+ return '.d2l-input';
257
+ }
258
+
257
259
  disconnectedCallback() {
258
260
  super.disconnectedCallback();
259
261
  if (this._hiddenContentResizeObserver) this._hiddenContentResizeObserver.disconnect();
@@ -97,8 +97,6 @@ class Link extends FocusMixin(LitElement) {
97
97
  ];
98
98
  }
99
99
 
100
- static focusElementSelector = '.d2l-link';
101
-
102
100
  constructor() {
103
101
  super();
104
102
  this.download = false;
@@ -106,6 +104,10 @@ class Link extends FocusMixin(LitElement) {
106
104
  this.small = false;
107
105
  }
108
106
 
107
+ static get focusElementSelector() {
108
+ return '.d2l-link';
109
+ }
110
+
109
111
  render() {
110
112
  const linkClasses = {
111
113
  'd2l-link': true,
@@ -679,8 +679,13 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
679
679
  const invalidDropTarget = dragState.dragTargets.find(dragTarget => {
680
680
  return isComposedAncestor(dragTarget, this);
681
681
  });
682
+
682
683
  if (invalidDropTarget) return;
683
684
 
685
+ // assert that both the source and target are from the same list - may allow this in the future
686
+ const targetRoot = dragState.dragTargets[0] && dragState.dragTargets[0]._getRootList();
687
+ if (this._getRootList() !== targetRoot) return;
688
+
684
689
  dragState.addDropTarget(this);
685
690
  this._draggingOver = true;
686
691
  e.dataTransfer.dropEffect = 'move';
@@ -28,7 +28,9 @@ class ActionDropdown extends FocusMixin(LocalizeCoreElement(SelectionActionMixin
28
28
  return dropdownOpenerStyles;
29
29
  }
30
30
 
31
- static focusElementSelector = 'd2l-button-subtle';
31
+ static get focusElementSelector() {
32
+ return 'd2l-button-subtle';
33
+ }
32
34
 
33
35
  render() {
34
36
  return html`
@@ -40,7 +40,9 @@ class Action extends FocusMixin(LocalizeCoreElement(SelectionActionMixin(ButtonM
40
40
  `;
41
41
  }
42
42
 
43
- static focusElementSelector = 'd2l-button-subtle';
43
+ static get focusElementSelector() {
44
+ return 'd2l-button-subtle';
45
+ }
44
46
 
45
47
  connectedCallback() {
46
48
  super.connectedCallback();
@@ -22,7 +22,9 @@ class SelectAllPages extends FocusMixin(LocalizeCoreElement(SelectionObserverMix
22
22
  `;
23
23
  }
24
24
 
25
- static focusElementSelector = 'd2l-button-subtle';
25
+ static get focusElementSelector() {
26
+ return 'd2l-button-subtle';
27
+ }
26
28
 
27
29
  render() {
28
30
  if (!this._provider) return;
@@ -34,13 +34,15 @@ class SelectAll extends FocusMixin(LocalizeCoreElement(SelectionObserverMixin(Li
34
34
  `;
35
35
  }
36
36
 
37
- static focusElementSelector = 'd2l-input-checkbox';
38
-
39
37
  constructor() {
40
38
  super();
41
39
  this.disabled = false;
42
40
  }
43
41
 
42
+ static get focusElementSelector() {
43
+ return 'd2l-input-checkbox';
44
+ }
45
+
44
46
  render() {
45
47
  if (this._provider && this._provider.selectionSingle) return;
46
48
 
@@ -166,8 +166,6 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
166
166
  `;
167
167
  }
168
168
 
169
- static focusElementSelector = '.d2l-switch-container';
170
-
171
169
  constructor() {
172
170
  super();
173
171
  this.disabled = false;
@@ -178,6 +176,10 @@ export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(Focus
178
176
  this._textId = getUniqueId();
179
177
  }
180
178
 
179
+ static get focusElementSelector() {
180
+ return '.d2l-switch-container';
181
+ }
182
+
181
183
  firstUpdated(changedProperties) {
182
184
  super.firstUpdated(changedProperties);
183
185
  if (!this.text || this.text.length === 0) {
@@ -58,14 +58,16 @@ export class TableColSortButton extends FocusMixin(LitElement) {
58
58
  `;
59
59
  }
60
60
 
61
- static focusElementSelector = 'button';
62
-
63
61
  constructor() {
64
62
  super();
65
63
  this.nosort = false;
66
64
  this.desc = false;
67
65
  }
68
66
 
67
+ static get focusElementSelector() {
68
+ return 'button';
69
+ }
70
+
69
71
  render() {
70
72
  const iconView = !this.nosort ?
71
73
  html`<d2l-icon icon="${this.desc ? 'tier1:arrow-toggle-down' : 'tier1:arrow-toggle-up'}"></d2l-icon>` :
@@ -419,11 +419,6 @@
419
419
  "type": "boolean",
420
420
  "default": "false"
421
421
  },
422
- {
423
- "name": "focusElementSelector",
424
- "type": "string",
425
- "default": "\"button\""
426
- },
427
422
  {
428
423
  "name": "visibleOnAncestor",
429
424
  "type": "boolean",
@@ -518,11 +513,6 @@
518
513
  "description": "Disables the button",
519
514
  "type": "boolean",
520
515
  "default": "false"
521
- },
522
- {
523
- "name": "focusElementSelector",
524
- "type": "string",
525
- "default": "\"button\""
526
516
  }
527
517
  ],
528
518
  "slots": [
@@ -586,11 +576,6 @@
586
576
  "description": "Disables the button",
587
577
  "type": "boolean",
588
578
  "default": "false"
589
- },
590
- {
591
- "name": "focusElementSelector",
592
- "type": "string",
593
- "default": "\"button\""
594
579
  }
595
580
  ],
596
581
  "slots": [
@@ -1005,11 +990,6 @@
1005
990
  "description": "Subtle aesthetic on non-white backgrounds",
1006
991
  "type": "boolean",
1007
992
  "default": "false"
1008
- },
1009
- {
1010
- "name": "focusElementSelector",
1011
- "type": "string",
1012
- "default": "\"a\""
1013
993
  }
1014
994
  ],
1015
995
  "slots": [
@@ -3168,11 +3148,6 @@
3168
3148
  "description": "Indicates if the filter is open",
3169
3149
  "type": "boolean",
3170
3150
  "default": "false"
3171
- },
3172
- {
3173
- "name": "focusElementSelector",
3174
- "type": "string",
3175
- "default": "\"d2l-dropdown-button-subtle\""
3176
3151
  }
3177
3152
  ],
3178
3153
  "events": [
@@ -3215,11 +3190,6 @@
3215
3190
  "description": "Whether the component should trap user focus.",
3216
3191
  "type": "boolean",
3217
3192
  "default": "false"
3218
- },
3219
- {
3220
- "name": "focusElementSelector",
3221
- "type": "string",
3222
- "default": "\".d2l-focus-trap-start\""
3223
3193
  }
3224
3194
  ],
3225
3195
  "events": [
@@ -3800,11 +3770,6 @@
3800
3770
  "type": "string",
3801
3771
  "default": "\"on\""
3802
3772
  },
3803
- {
3804
- "name": "focusElementSelector",
3805
- "type": "string",
3806
- "default": "\"input.d2l-input-checkbox\""
3807
- },
3808
3773
  {
3809
3774
  "name": "skeleton",
3810
3775
  "attribute": "skeleton",
@@ -4029,11 +3994,6 @@
4029
3994
  "type": "boolean",
4030
3995
  "default": "false"
4031
3996
  },
4032
- {
4033
- "name": "focusElementSelector",
4034
- "type": "string",
4035
- "default": "\"d2l-input-date\""
4036
- },
4037
3997
  {
4038
3998
  "name": "skeleton",
4039
3999
  "attribute": "skeleton",
@@ -4331,11 +4291,6 @@
4331
4291
  "type": "boolean",
4332
4292
  "default": "false"
4333
4293
  },
4334
- {
4335
- "name": "focusElementSelector",
4336
- "type": "string",
4337
- "default": "\"d2l-input-date-time\""
4338
- },
4339
4294
  {
4340
4295
  "name": "skeleton",
4341
4296
  "attribute": "skeleton",
@@ -4506,11 +4461,6 @@
4506
4461
  "type": "string",
4507
4462
  "default": "\"startOfDay\""
4508
4463
  },
4509
- {
4510
- "name": "focusElementSelector",
4511
- "type": "string",
4512
- "default": "\"d2l-input-date\""
4513
- },
4514
4464
  {
4515
4465
  "name": "labelledBy",
4516
4466
  "attribute": "labelled-by",
@@ -4677,11 +4627,6 @@
4677
4627
  "type": "string",
4678
4628
  "default": "\"\""
4679
4629
  },
4680
- {
4681
- "name": "focusElementSelector",
4682
- "type": "string",
4683
- "default": "\"d2l-input-text\""
4684
- },
4685
4630
  {
4686
4631
  "name": "labelledBy",
4687
4632
  "attribute": "labelled-by",
@@ -5021,11 +4966,6 @@
5021
4966
  "type": "boolean",
5022
4967
  "default": "false"
5023
4968
  },
5024
- {
5025
- "name": "focusElementSelector",
5026
- "type": "string",
5027
- "default": "\"d2l-input-text\""
5028
- },
5029
4969
  {
5030
4970
  "name": "labelledBy",
5031
4971
  "attribute": "labelled-by",
@@ -5224,11 +5164,6 @@
5224
5164
  "type": "boolean",
5225
5165
  "default": "false"
5226
5166
  },
5227
- {
5228
- "name": "focusElementSelector",
5229
- "type": "string",
5230
- "default": "\"d2l-input-number\""
5231
- },
5232
5167
  {
5233
5168
  "name": "labelledBy",
5234
5169
  "attribute": "labelled-by",
@@ -5366,11 +5301,6 @@
5366
5301
  "description": "Value of the input",
5367
5302
  "type": "string",
5368
5303
  "default": "\"\""
5369
- },
5370
- {
5371
- "name": "focusElementSelector",
5372
- "type": "string",
5373
- "default": "\"d2l-input-text\""
5374
5304
  }
5375
5305
  ],
5376
5306
  "events": [
@@ -5710,11 +5640,6 @@
5710
5640
  "type": "'text'|'email'|'number'|'password'|'search'|'tel'|'url'",
5711
5641
  "default": "\"text\""
5712
5642
  },
5713
- {
5714
- "name": "focusElementSelector",
5715
- "type": "string",
5716
- "default": "\".d2l-input\""
5717
- },
5718
5643
  {
5719
5644
  "name": "labelledBy",
5720
5645
  "attribute": "labelled-by",
@@ -5954,11 +5879,6 @@
5954
5879
  "type": "string",
5955
5880
  "default": "\"\""
5956
5881
  },
5957
- {
5958
- "name": "focusElementSelector",
5959
- "type": "string",
5960
- "default": "\"textarea\""
5961
- },
5962
5882
  {
5963
5883
  "name": "labelledBy",
5964
5884
  "attribute": "labelled-by",
@@ -6208,11 +6128,6 @@
6208
6128
  "type": "'five'|'ten'|'fifteen'|'twenty'|'thirty'|'sixty'",
6209
6129
  "default": "\"thirty\""
6210
6130
  },
6211
- {
6212
- "name": "focusElementSelector",
6213
- "type": "string",
6214
- "default": "\"d2l-input-time\""
6215
- },
6216
6131
  {
6217
6132
  "name": "skeleton",
6218
6133
  "attribute": "skeleton",
@@ -6373,11 +6288,6 @@
6373
6288
  "type": "'five'|'ten'|'fifteen'|'twenty'|'thirty'|'sixty'",
6374
6289
  "default": "\"thirty\""
6375
6290
  },
6376
- {
6377
- "name": "focusElementSelector",
6378
- "type": "string",
6379
- "default": "\".d2l-input\""
6380
- },
6381
6291
  {
6382
6292
  "name": "labelledBy",
6383
6293
  "attribute": "labelled-by",
@@ -6494,11 +6404,6 @@
6494
6404
  "description": "Whether to apply the \"small\" link style",
6495
6405
  "type": "boolean",
6496
6406
  "default": "false"
6497
- },
6498
- {
6499
- "name": "focusElementSelector",
6500
- "type": "string",
6501
- "default": "\".d2l-link\""
6502
6407
  }
6503
6408
  ],
6504
6409
  "slots": [
@@ -8624,11 +8529,6 @@
8624
8529
  "description": "REQUIRED: Text for the dropdown opener button",
8625
8530
  "type": "string"
8626
8531
  },
8627
- {
8628
- "name": "focusElementSelector",
8629
- "type": "string",
8630
- "default": "\"d2l-button-subtle\""
8631
- },
8632
8532
  {
8633
8533
  "name": "requiresSelection",
8634
8534
  "attribute": "requires-selection",
@@ -8862,11 +8762,6 @@
8862
8762
  "description": "Disables the button",
8863
8763
  "type": "boolean",
8864
8764
  "default": "false"
8865
- },
8866
- {
8867
- "name": "focusElementSelector",
8868
- "type": "string",
8869
- "default": "\"d2l-button-subtle\""
8870
8765
  }
8871
8766
  ],
8872
8767
  "events": [
@@ -8986,11 +8881,6 @@
8986
8881
  }
8987
8882
  ],
8988
8883
  "properties": [
8989
- {
8990
- "name": "focusElementSelector",
8991
- "type": "string",
8992
- "default": "\"d2l-button-subtle\""
8993
- },
8994
8884
  {
8995
8885
  "name": "selectionFor",
8996
8886
  "attribute": "selection-for",
@@ -9033,11 +8923,6 @@
9033
8923
  "type": "boolean",
9034
8924
  "default": "false"
9035
8925
  },
9036
- {
9037
- "name": "focusElementSelector",
9038
- "type": "string",
9039
- "default": "\"d2l-input-checkbox\""
9040
- },
9041
8926
  {
9042
8927
  "name": "selectionFor",
9043
8928
  "attribute": "selection-for",
@@ -9460,11 +9345,6 @@
9460
9345
  "description": "Determines where text should be positioned relative to the switch.",
9461
9346
  "type": "'start'|'end'|'hidden'",
9462
9347
  "default": "\"end\""
9463
- },
9464
- {
9465
- "name": "focusElementSelector",
9466
- "type": "string",
9467
- "default": "\".d2l-switch-container\""
9468
9348
  }
9469
9349
  ],
9470
9350
  "events": [
@@ -9554,11 +9434,6 @@
9554
9434
  "description": "Determines where text should be positioned relative to the switch.",
9555
9435
  "type": "'start'|'end'|'hidden'",
9556
9436
  "default": "\"end\""
9557
- },
9558
- {
9559
- "name": "focusElementSelector",
9560
- "type": "string",
9561
- "default": "\".d2l-switch-container\""
9562
9437
  }
9563
9438
  ],
9564
9439
  "events": [
@@ -9652,11 +9527,6 @@
9652
9527
  "description": "Whether sort direction is descending",
9653
9528
  "type": "boolean",
9654
9529
  "default": "false"
9655
- },
9656
- {
9657
- "name": "focusElementSelector",
9658
- "type": "string",
9659
- "default": "\"button\""
9660
9530
  }
9661
9531
  ],
9662
9532
  "slots": [
@@ -2,13 +2,15 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
2
2
 
3
3
  export const FocusMixin = dedupeMixin(superclass => class extends superclass {
4
4
 
5
- static focusElementSelector = null;
6
-
7
5
  constructor() {
8
6
  super();
9
7
  this._focusOnFirstRender = false;
10
8
  }
11
9
 
10
+ static get focusElementSelector() {
11
+ return null;
12
+ }
13
+
12
14
  firstUpdated(changedProperties) {
13
15
  super.firstUpdated(changedProperties);
14
16
  if (this._focusOnFirstRender) {
@@ -14,7 +14,8 @@ import { FocusMixin } from '@brightspace-ui/core/mixins/focus-mixin.js';
14
14
  class MyComponent extends FocusMixin(LitElement) {
15
15
 
16
16
  // delegate focus to the underlying input
17
- static focusElementSelector = 'input';
17
+ static get focusElementSelector() {
18
+ return 'input';
18
19
 
19
20
  render() {
20
21
  return html`<input type="text">`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.241.0",
3
+ "version": "1.242.2",
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",