@brightspace-ui/core 3.267.3 → 3.268.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/components/collapsible-panel/README.md +11 -15
- package/components/demo/code-view.js +6 -10
- package/components/demo/demo-page-settings.js +25 -29
- package/components/demo/demo-page.js +32 -36
- package/components/demo/demo-snippet.js +95 -99
- package/components/description-list/README.md +25 -33
- package/components/description-list/demo/description-list-test.js +36 -39
- package/components/dialog/README.md +3 -5
- package/components/form/docs/form-element-mixin.md +11 -14
- package/components/form/docs/form-element-nesting.md +4 -6
- package/components/form/docs/form-element-wrapping.md +1 -3
- package/components/hierarchical-view/README.md +8 -11
- package/components/inputs/docs/input-select-styles.md +4 -9
- package/components/inputs/docs/styling-native-inputs.md +11 -25
- package/components/inputs/input-select-styles.js +30 -25
- package/components/link/README.md +1 -1
- package/components/list/README.md +8 -16
- package/components/menu/menu-item-checkbox.js +1 -3
- package/components/menu/menu-item-link.js +27 -33
- package/components/menu/menu-item-mixin.js +52 -54
- package/components/menu/menu-item-radio.js +1 -3
- package/components/menu/menu-item-return.js +18 -22
- package/components/menu/menu-item-selectable-mixin.js +12 -14
- package/components/menu/menu-item-separator.js +9 -11
- package/components/menu/menu-item.js +11 -15
- package/components/menu/menu.js +50 -54
- package/components/meter/meter-circle.js +3 -4
- package/components/meter/meter-linear.js +86 -88
- package/components/meter/meter-mixin.js +34 -36
- package/components/meter/meter-radial.js +3 -4
- package/components/more-less/more-less.js +57 -61
- package/components/object-property-list/object-property-list-item-link.js +18 -19
- package/components/object-property-list/object-property-list-item-tooltip-help.js +8 -9
- package/components/object-property-list/object-property-list-item.js +52 -55
- package/components/object-property-list/object-property-list.js +24 -27
- package/components/offscreen/README.md +1 -1
- package/components/offscreen/offscreen.js +13 -15
- package/components/offscreen/screen-reader-pause.js +1 -3
- package/components/overflow-group/README.md +1 -3
- package/components/overflow-group/overflow-group-mixin.js +55 -59
- package/components/overflow-group/overflow-group.js +38 -42
- package/components/page/page-header-button.js +41 -45
- package/components/page/page-header-custom.js +108 -112
- package/components/page/page-header-immersive.js +65 -69
- package/components/page/page-header-separator.js +12 -14
- package/components/paging/pageable-mixin.js +3 -5
- package/components/paging/pageable-subscriber-mixin.js +8 -10
- package/components/paging/pager-load-more.js +47 -51
- package/components/popover/popover-mixin.js +186 -190
- package/components/progress/progress.js +160 -164
- package/components/scroll-wrapper/scroll-wrapper.js +109 -113
- package/components/selection/README.md +5 -7
- package/components/selection/demo/demo-selection.js +5 -7
- package/components/selection/selection-action-dropdown.js +9 -13
- package/components/selection/selection-action-menu-item.js +11 -15
- package/components/selection/selection-action.js +20 -24
- package/components/selection/selection-controls.js +92 -96
- package/components/selection/selection-input.js +40 -44
- package/components/selection/selection-mixin.js +11 -13
- package/components/selection/selection-observer-mixin.js +14 -16
- package/components/selection/selection-select-all-pages.js +8 -10
- package/components/selection/selection-select-all.js +16 -20
- package/components/selection/selection-summary.js +18 -22
- package/components/skeleton/README.md +2 -6
- package/components/skeleton/skeleton-group-mixin.js +3 -5
- package/components/skeleton/skeleton-mixin.js +7 -9
- package/components/skip-nav/skip-nav-custom.js +33 -37
- package/components/sorting/sort.js +11 -13
- package/components/status-indicator/status-indicator.js +75 -79
- package/components/switch/switch-mixin.js +145 -149
- package/components/switch/switch-visibility.js +11 -15
- package/components/switch/switch.js +5 -7
- package/components/table/README.md +19 -37
- package/components/table/demo/table-test.js +27 -31
- package/components/table/table-col-sort-button-item.js +1 -3
- package/components/table/table-col-sort-button.js +105 -109
- package/components/table/table-controls.js +18 -21
- package/components/table/table-wrapper.js +124 -128
- package/components/tabs/tab-internal.js +72 -76
- package/components/tabs/tab-mixin.js +22 -24
- package/components/tabs/tab-panel-mixin.js +47 -51
- package/components/tabs/tab.js +7 -9
- package/components/tabs/tabs.js +171 -175
- package/components/tag-list/tag-list-item-mixin.js +103 -107
- package/components/tag-list/tag-list-item.js +13 -15
- package/components/tag-list/tag-list.js +54 -58
- package/components/tooltip/tooltip-help.js +67 -71
- package/components/tooltip/tooltip.js +103 -107
- package/components/typography/README.md +5 -7
- package/components/validation/validation-custom-mixin.js +4 -6
- package/components/view-switcher/view-switcher-button.js +42 -46
- package/components/view-switcher/view-switcher.js +26 -29
- package/controllers/subscriber/README.md +7 -11
- package/custom-elements.json +1026 -3850
- package/helpers/focus.js +5 -1
- package/mixins/arrow-keys/arrow-keys-mixin.js +10 -12
- package/mixins/async-container/async-container-mixin.js +10 -12
- package/mixins/collection/collection-mixin.js +7 -9
- package/mixins/interactive/interactive-mixin.js +10 -14
- package/mixins/labelled/README.md +3 -5
- package/mixins/labelled/labelled-mixin.js +26 -30
- package/mixins/provider/README.md +5 -7
- package/mixins/rtl/README.md +5 -7
- package/mixins/rtl/rtl-mixin.js +7 -9
- package/mixins/theme/theme-mixin.js +6 -8
- package/mixins/visible-on-ancestor/README.md +1 -3
- package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +11 -13
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +373 -377
|
@@ -268,136 +268,132 @@ const SELECTORS = {
|
|
|
268
268
|
*/
|
|
269
269
|
export class TableWrapper extends PropertyRequiredMixin(PageableMixin(SelectionMixin(LitElement))) {
|
|
270
270
|
|
|
271
|
-
static
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
271
|
+
static properties = {
|
|
272
|
+
/**
|
|
273
|
+
* Hides the column borders on "default" table type
|
|
274
|
+
* @type {boolean}
|
|
275
|
+
*/
|
|
276
|
+
noColumnBorder: {
|
|
277
|
+
attribute: 'no-column-border',
|
|
278
|
+
reflect: true,
|
|
279
|
+
type: Boolean
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* Whether the header row is sticky. Useful for long tables to "stick" the header row in place as the user scrolls.
|
|
283
|
+
* @type {boolean}
|
|
284
|
+
*/
|
|
285
|
+
stickyHeaders: {
|
|
286
|
+
attribute: 'sticky-headers',
|
|
287
|
+
reflect: true,
|
|
288
|
+
type: Boolean
|
|
289
|
+
},
|
|
290
|
+
/**
|
|
291
|
+
* When used in combo with `sticky-headers`, whether to additionally wrap the table in a scroll-wrapper. Requires sticky headers to be in a separate thead.
|
|
292
|
+
* @type {boolean}
|
|
293
|
+
*/
|
|
294
|
+
stickyHeadersScrollWrapper: {
|
|
295
|
+
attribute: 'sticky-headers-scroll-wrapper',
|
|
296
|
+
reflect: true,
|
|
297
|
+
type: Boolean
|
|
298
|
+
},
|
|
299
|
+
_stickyWidth: { state: true },
|
|
300
|
+
/**
|
|
301
|
+
* Type of table style to apply. The "light" style has fewer borders and tighter padding.
|
|
302
|
+
* @type {'default'|'light'}
|
|
303
|
+
*/
|
|
304
|
+
type: {
|
|
305
|
+
reflect: true,
|
|
306
|
+
type: String
|
|
307
|
+
},
|
|
308
|
+
_controlsScrolled: { state: true },
|
|
309
|
+
_noScrollWidth: {
|
|
310
|
+
attribute: '_no-scroll-width',
|
|
311
|
+
reflect: true,
|
|
312
|
+
type: Boolean,
|
|
313
|
+
},
|
|
314
|
+
/**
|
|
315
|
+
* The state of data in the table. Set to 'clean' when the data represents the user's latest selections, 'dirty' when the data does not represent the user's latest selections, and 'loading' if the data is being actively refreshed
|
|
316
|
+
* @type {'clean'|'dirty'|'loading'}
|
|
317
|
+
*/
|
|
318
|
+
dataState: {
|
|
319
|
+
reflect: true,
|
|
320
|
+
type: String
|
|
321
|
+
},
|
|
322
|
+
/**
|
|
323
|
+
* The text displayed on the dirty state overlay when the 'dirty' dataState is set.
|
|
324
|
+
* @type {string}
|
|
325
|
+
*/
|
|
326
|
+
dirtyText: {
|
|
327
|
+
reflect: true,
|
|
328
|
+
attribute: 'dirty-text',
|
|
329
|
+
required: {
|
|
330
|
+
dependentProps: ['dataState'],
|
|
331
|
+
validator: (_value, elem, hasValue) => hasValue || elem.dataState !== 'dirty'
|
|
281
332
|
},
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
333
|
+
type: String
|
|
334
|
+
},
|
|
335
|
+
/**
|
|
336
|
+
* The text displayed on the button dirty state overlay when the 'dirty' dataState is set.
|
|
337
|
+
* @type {string}
|
|
338
|
+
*/
|
|
339
|
+
dirtyButtonText: {
|
|
340
|
+
reflect: true,
|
|
341
|
+
attribute: 'dirty-button-text',
|
|
342
|
+
required: {
|
|
343
|
+
dependentProps: ['dataState'],
|
|
344
|
+
validator: (_value, elem, hasValue) => hasValue || elem.dataState !== 'dirty'
|
|
290
345
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
attribute: 'dirty-button-text',
|
|
343
|
-
required: {
|
|
344
|
-
dependentProps: ['dataState'],
|
|
345
|
-
validator: (_value, elem, hasValue) => hasValue || elem.dataState !== 'dirty'
|
|
346
|
-
},
|
|
347
|
-
type: String
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
static get styles() {
|
|
353
|
-
return css`
|
|
354
|
-
:host {
|
|
355
|
-
--d2l-table-border: 1px solid var(--d2l-table-border-color);
|
|
356
|
-
--d2l-table-border-color: var(--d2l-color-mica);
|
|
357
|
-
--d2l-table-border-radius: 0.3rem;
|
|
358
|
-
--d2l-table-border-radius-sticky-offset: calc(1px - var(--d2l-table-border-radius));
|
|
359
|
-
--d2l-table-cell-overall-height: 46px;
|
|
360
|
-
--d2l-table-cell-height: calc(var(--d2l-table-cell-overall-height) - 2 * var(--d2l-table-cell-padding));
|
|
361
|
-
--d2l-table-cell-padding: 0.7rem;
|
|
362
|
-
--d2l-table-cell-padding-alt: calc(0.7rem - 1px) 0.7rem 0.7rem 0.7rem;
|
|
363
|
-
--d2l-table-cell-col-sort-button-size-offset: 4px;
|
|
364
|
-
--d2l-table-header-background-color: var(--d2l-color-regolith);
|
|
365
|
-
--d2l-table-row-border-color-selected: var(--d2l-color-celestine);
|
|
366
|
-
--d2l-table-row-background-color-selected: var(--d2l-color-celestine-plus-2);
|
|
367
|
-
display: block;
|
|
368
|
-
width: 100%;
|
|
369
|
-
}
|
|
370
|
-
:host([hidden]) {
|
|
371
|
-
display: none;
|
|
372
|
-
}
|
|
373
|
-
:host([type="light"]) {
|
|
374
|
-
--d2l-table-border-radius: 0rem; /* stylelint-disable-line length-zero-no-unit */
|
|
375
|
-
--d2l-table-border-radius-sticky-offset: 0rem; /* stylelint-disable-line length-zero-no-unit */
|
|
376
|
-
--d2l-table-border-color: var(--d2l-color-gypsum);
|
|
377
|
-
--d2l-table-header-background-color: #ffffff;
|
|
378
|
-
}
|
|
379
|
-
:host([sticky-headers]) {
|
|
380
|
-
--d2l-table-controls-shadow-display: none;
|
|
381
|
-
}
|
|
382
|
-
.d2l-sticky-headers-backdrop {
|
|
383
|
-
position: sticky;
|
|
384
|
-
top: calc(var(--d2l-table-sticky-top, 0px) + var(--d2l-table-border-radius));
|
|
385
|
-
width: 100%;
|
|
386
|
-
z-index: 2; /* Must sit under d2l-table sticky-headers but over sticky columns and regular cells */
|
|
387
|
-
}
|
|
388
|
-
.d2l-sticky-headers-backdrop::after {
|
|
389
|
-
background-color: var(--d2l-table-controls-background-color, white);
|
|
390
|
-
bottom: 0;
|
|
391
|
-
content: "";
|
|
392
|
-
position: absolute;
|
|
393
|
-
top: calc(-7px - var(--d2l-table-border-radius)); /* 6px for the d2l-table-controls margin-bottom, 1px overlap to fix zoom issues */
|
|
394
|
-
width: 100%;
|
|
395
|
-
}
|
|
396
|
-
slot[name="pager"]::slotted(*) {
|
|
397
|
-
margin-top: 12px;
|
|
398
|
-
}
|
|
399
|
-
`;
|
|
400
|
-
}
|
|
346
|
+
type: String
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
static styles = css`
|
|
351
|
+
:host {
|
|
352
|
+
--d2l-table-border: 1px solid var(--d2l-table-border-color);
|
|
353
|
+
--d2l-table-border-color: var(--d2l-color-mica);
|
|
354
|
+
--d2l-table-border-radius: 0.3rem;
|
|
355
|
+
--d2l-table-border-radius-sticky-offset: calc(1px - var(--d2l-table-border-radius));
|
|
356
|
+
--d2l-table-cell-overall-height: 46px;
|
|
357
|
+
--d2l-table-cell-height: calc(var(--d2l-table-cell-overall-height) - 2 * var(--d2l-table-cell-padding));
|
|
358
|
+
--d2l-table-cell-padding: 0.7rem;
|
|
359
|
+
--d2l-table-cell-padding-alt: calc(0.7rem - 1px) 0.7rem 0.7rem 0.7rem;
|
|
360
|
+
--d2l-table-cell-col-sort-button-size-offset: 4px;
|
|
361
|
+
--d2l-table-header-background-color: var(--d2l-color-regolith);
|
|
362
|
+
--d2l-table-row-border-color-selected: var(--d2l-color-celestine);
|
|
363
|
+
--d2l-table-row-background-color-selected: var(--d2l-color-celestine-plus-2);
|
|
364
|
+
display: block;
|
|
365
|
+
width: 100%;
|
|
366
|
+
}
|
|
367
|
+
:host([hidden]) {
|
|
368
|
+
display: none;
|
|
369
|
+
}
|
|
370
|
+
:host([type="light"]) {
|
|
371
|
+
--d2l-table-border-radius: 0rem; /* stylelint-disable-line length-zero-no-unit */
|
|
372
|
+
--d2l-table-border-radius-sticky-offset: 0rem; /* stylelint-disable-line length-zero-no-unit */
|
|
373
|
+
--d2l-table-border-color: var(--d2l-color-gypsum);
|
|
374
|
+
--d2l-table-header-background-color: #ffffff;
|
|
375
|
+
}
|
|
376
|
+
:host([sticky-headers]) {
|
|
377
|
+
--d2l-table-controls-shadow-display: none;
|
|
378
|
+
}
|
|
379
|
+
.d2l-sticky-headers-backdrop {
|
|
380
|
+
position: sticky;
|
|
381
|
+
top: calc(var(--d2l-table-sticky-top, 0px) + var(--d2l-table-border-radius));
|
|
382
|
+
width: 100%;
|
|
383
|
+
z-index: 2; /* Must sit under d2l-table sticky-headers but over sticky columns and regular cells */
|
|
384
|
+
}
|
|
385
|
+
.d2l-sticky-headers-backdrop::after {
|
|
386
|
+
background-color: var(--d2l-table-controls-background-color, white);
|
|
387
|
+
bottom: 0;
|
|
388
|
+
content: "";
|
|
389
|
+
position: absolute;
|
|
390
|
+
top: calc(-7px - var(--d2l-table-border-radius)); /* 6px for the d2l-table-controls margin-bottom, 1px overlap to fix zoom issues */
|
|
391
|
+
width: 100%;
|
|
392
|
+
}
|
|
393
|
+
slot[name="pager"]::slotted(*) {
|
|
394
|
+
margin-top: 12px;
|
|
395
|
+
}
|
|
396
|
+
`;
|
|
401
397
|
|
|
402
398
|
constructor() {
|
|
403
399
|
super();
|
|
@@ -13,85 +13,81 @@ const keyCodes = {
|
|
|
13
13
|
// remove file with GAUD-8299-core-tabs-use-new-structure flag clean up
|
|
14
14
|
class Tab extends SkeletonMixin(LitElement) {
|
|
15
15
|
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
}
|
|
16
|
+
static properties = {
|
|
17
|
+
ariaSelected: { type: String, reflect: true, attribute: 'aria-selected' },
|
|
18
|
+
controlsPanel: { type: String, reflect: true, attribute: 'controls-panel' },
|
|
19
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
20
|
+
role: { type: String, reflect: true },
|
|
21
|
+
text: { type: String }
|
|
22
|
+
};
|
|
25
23
|
|
|
26
|
-
static
|
|
27
|
-
|
|
28
|
-
:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
:
|
|
84
|
-
|
|
85
|
-
}
|
|
24
|
+
static styles = [super.styles, css`
|
|
25
|
+
:host {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
display: inline-block;
|
|
28
|
+
max-width: 200px;
|
|
29
|
+
outline: none;
|
|
30
|
+
position: relative;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
}
|
|
33
|
+
.d2l-tab-text {
|
|
34
|
+
--d2l-focus-ring-offset: 0;
|
|
35
|
+
margin: 0.5rem;
|
|
36
|
+
padding: 0.1rem;
|
|
37
|
+
${overflowEllipsisDeclarations}
|
|
38
|
+
}
|
|
39
|
+
:host([skeleton]) .d2l-tab-text.d2l-skeletize::before {
|
|
40
|
+
bottom: 0.15rem;
|
|
41
|
+
top: 0.15rem;
|
|
42
|
+
}
|
|
43
|
+
:host(:first-child) .d2l-tab-text {
|
|
44
|
+
margin-inline-start: 0;
|
|
45
|
+
}
|
|
46
|
+
.d2l-tab-selected-indicator {
|
|
47
|
+
border-top: 4px solid var(--d2l-theme-brand-color-primary-default);
|
|
48
|
+
border-top-left-radius: 4px;
|
|
49
|
+
border-top-right-radius: 4px;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
display: none;
|
|
52
|
+
margin: 1px 0.6rem 0 0.6rem;
|
|
53
|
+
position: absolute;
|
|
54
|
+
-webkit-transition: box-shadow 0.2s;
|
|
55
|
+
transition: box-shadow 0.2s;
|
|
56
|
+
width: calc(100% - 1.2rem);
|
|
57
|
+
}
|
|
58
|
+
:host([skeleton]) .d2l-tab-selected-indicator {
|
|
59
|
+
position: absolute; /* make sure skeleton styles do not override this */
|
|
60
|
+
}
|
|
61
|
+
.d2l-tab-text-skeletize-override {
|
|
62
|
+
min-width: 50px;
|
|
63
|
+
}
|
|
64
|
+
:host(:first-child) .d2l-tab-selected-indicator {
|
|
65
|
+
margin-inline-start: 0;
|
|
66
|
+
width: calc(100% - 0.6rem);
|
|
67
|
+
}
|
|
68
|
+
${getFocusRingStyles(pseudoClass => `:host(:${pseudoClass}) > .d2l-tab-text`, { extraStyles: css`border-radius: 0.3rem; color: var(--d2l-theme-text-color-interactive-default);` })}
|
|
69
|
+
:host([aria-selected="true"]:focus) {
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
}
|
|
72
|
+
:host(:hover) {
|
|
73
|
+
color: var(--d2l-theme-text-color-interactive-default);
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
:host([aria-selected="true"]:hover) {
|
|
77
|
+
color: inherit;
|
|
78
|
+
cursor: default;
|
|
79
|
+
}
|
|
80
|
+
:host([aria-selected="true"]) .d2l-tab-selected-indicator {
|
|
81
|
+
display: block;
|
|
82
|
+
}
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
84
|
+
@media (prefers-reduced-motion: reduce) {
|
|
85
|
+
.d2l-tab-selected-indicator {
|
|
86
|
+
-webkit-transition: none;
|
|
87
|
+
transition: none;
|
|
92
88
|
}
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
}
|
|
90
|
+
`];
|
|
95
91
|
|
|
96
92
|
constructor() {
|
|
97
93
|
super();
|
|
@@ -10,30 +10,28 @@ const keyCodes = {
|
|
|
10
10
|
|
|
11
11
|
export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
}
|
|
13
|
+
static properties = {
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
18
|
+
hidden: { type: Boolean, reflect: true },
|
|
19
|
+
/**
|
|
20
|
+
* Use to select the tab. Only one tab can be selected at a time.
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
*/
|
|
23
|
+
selected: { type: Boolean, reflect: true },
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
28
|
+
role: { type: String, reflect: true },
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
tabIndex: { type: Number, reflect: true, attribute: 'tabindex' },
|
|
33
|
+
_clicked: { type: Boolean, reflect: true },
|
|
34
|
+
};
|
|
37
35
|
|
|
38
36
|
static get styles() {
|
|
39
37
|
const styles = [ css`
|
|
@@ -4,58 +4,54 @@ import { getUseNewTabsStructureFlag } from './tabs.js';
|
|
|
4
4
|
|
|
5
5
|
export const TabPanelMixin = superclass => class extends superclass {
|
|
6
6
|
|
|
7
|
-
static
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
}
|
|
7
|
+
static properties = {
|
|
8
|
+
/**
|
|
9
|
+
* REQUIRED: Id of the tab that labels this panel
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
labelledBy: { type: String, attribute: 'labelled-by', reflect: true },
|
|
13
|
+
/**
|
|
14
|
+
* Opt out of default padding/whitespace around the panel
|
|
15
|
+
* @type {boolean}
|
|
16
|
+
*/
|
|
17
|
+
noPadding: { type: Boolean, attribute: 'no-padding', reflect: true },
|
|
18
|
+
/**
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
22
|
+
role: { type: String, reflect: true },
|
|
23
|
+
/**
|
|
24
|
+
* DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.
|
|
25
|
+
* Remove with GAUD-8299-core-tabs-use-new-structure flag clean up.
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
selected: { type: Boolean, reflect: true },
|
|
29
|
+
/**
|
|
30
|
+
* DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.
|
|
31
|
+
* Remove with GAUD-8299-core-tabs-use-new-structure flag clean up.
|
|
32
|
+
* @type {string}
|
|
33
|
+
*/
|
|
34
|
+
text: { type: String },
|
|
35
|
+
_selected: { type: Boolean, attribute: '_selected', reflect: true }
|
|
36
|
+
};
|
|
39
37
|
|
|
40
|
-
static
|
|
41
|
-
|
|
42
|
-
:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
38
|
+
static styles = css`
|
|
39
|
+
:host {
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
display: none;
|
|
42
|
+
margin: 1.2rem 0 0 0;
|
|
43
|
+
}
|
|
44
|
+
:host([no-padding]) {
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
47
|
+
/* clean up with GAUD-8299-core-tabs-use-new-structure flag clean up */
|
|
48
|
+
:host([selected]) {
|
|
49
|
+
display: block;
|
|
50
|
+
}
|
|
51
|
+
:host([_selected]) {
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
59
55
|
|
|
60
56
|
constructor() {
|
|
61
57
|
super();
|
package/components/tabs/tab.js
CHANGED
|
@@ -18,15 +18,13 @@ const focusRingStyles = getFocusRingStyles(
|
|
|
18
18
|
*/
|
|
19
19
|
class Tab extends TabMixin(LitElement) {
|
|
20
20
|
|
|
21
|
-
static
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
}
|
|
21
|
+
static properties = {
|
|
22
|
+
/**
|
|
23
|
+
* ACCESSIBILITY: REQUIRED: The text used for the tab and for labelling the corresponding panel
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
text: { type: String }
|
|
27
|
+
};
|
|
30
28
|
|
|
31
29
|
static get styles() {
|
|
32
30
|
const styles = [ css`
|