@brightspace-ui/core 3.268.0 → 3.268.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.
- 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/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/flags.js +7 -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
|
@@ -65,9 +65,7 @@ The `d2l-table-wrapper` element can be combined with table styles to apply defau
|
|
|
65
65
|
|
|
66
66
|
class SampleTable extends LitElement {
|
|
67
67
|
|
|
68
|
-
static
|
|
69
|
-
return tableStyles;
|
|
70
|
-
}
|
|
68
|
+
static styles = tableStyles;
|
|
71
69
|
|
|
72
70
|
render() {
|
|
73
71
|
const type = this.type === 'light' ? 'light' : 'default';
|
|
@@ -147,15 +145,11 @@ For the example below:
|
|
|
147
145
|
|
|
148
146
|
class MySortableTableElem extends LitElement {
|
|
149
147
|
|
|
150
|
-
static
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
};
|
|
154
|
-
}
|
|
148
|
+
static properties = {
|
|
149
|
+
_sortDesc: { attribute: false, type: Boolean }
|
|
150
|
+
};
|
|
155
151
|
|
|
156
|
-
static
|
|
157
|
-
return tableStyles;
|
|
158
|
-
}
|
|
152
|
+
static styles = tableStyles;
|
|
159
153
|
|
|
160
154
|
constructor() {
|
|
161
155
|
super();
|
|
@@ -290,15 +284,11 @@ When a single column is responsible for sorting in multiple facets (e.g., first
|
|
|
290
284
|
{ firstname: 'Christopher', lastname: 'Martinez', grade: 83 }
|
|
291
285
|
];
|
|
292
286
|
class MyComplexSortableTableElem extends LitElement {
|
|
293
|
-
static
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
static get styles() {
|
|
300
|
-
return tableStyles;
|
|
301
|
-
}
|
|
287
|
+
static properties = {
|
|
288
|
+
_desc: { state: true },
|
|
289
|
+
_field: { state: true }
|
|
290
|
+
};
|
|
291
|
+
static styles = tableStyles;
|
|
302
292
|
constructor() {
|
|
303
293
|
super();
|
|
304
294
|
this._data = data();
|
|
@@ -382,16 +372,12 @@ To enable selection, add `d2l-selection-input` components in the selection colum
|
|
|
382
372
|
|
|
383
373
|
class SampleTableWithSelectionInputs extends LitElement {
|
|
384
374
|
|
|
385
|
-
static
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
}
|
|
375
|
+
static properties = {
|
|
376
|
+
selectionSingle: { type: Boolean, attribute: 'selection-single' },
|
|
377
|
+
_data: { state: true }
|
|
378
|
+
};
|
|
391
379
|
|
|
392
|
-
static
|
|
393
|
-
return tableStyles;
|
|
394
|
-
}
|
|
380
|
+
static styles = tableStyles;
|
|
395
381
|
|
|
396
382
|
constructor() {
|
|
397
383
|
super();
|
|
@@ -494,15 +480,11 @@ The `d2l-table-controls` component can be placed in the `d2l-table-wrapper`'s `c
|
|
|
494
480
|
|
|
495
481
|
class SampleTableWithControls extends LitElement {
|
|
496
482
|
|
|
497
|
-
static
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
}
|
|
483
|
+
static properties = {
|
|
484
|
+
_data: { state: true }
|
|
485
|
+
};
|
|
502
486
|
|
|
503
|
-
static
|
|
504
|
-
return tableStyles;
|
|
505
|
-
}
|
|
487
|
+
static styles = tableStyles;
|
|
506
488
|
|
|
507
489
|
constructor() {
|
|
508
490
|
super();
|
|
@@ -39,38 +39,34 @@ const formatter = new Intl.NumberFormat('en-US');
|
|
|
39
39
|
|
|
40
40
|
class TestTable extends DemoPassthroughMixin(TableWrapper, 'd2l-table-wrapper') {
|
|
41
41
|
|
|
42
|
-
static
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
}
|
|
42
|
+
static properties = {
|
|
43
|
+
paging: { type: Boolean, reflect: true },
|
|
44
|
+
multiLine: { type: Boolean, attribute: 'multi-line' },
|
|
45
|
+
resetOnSort: { type: Boolean, attribute: 'reset-on-sort' },
|
|
46
|
+
showButtons: { type: Boolean, attribute: 'show-buttons' },
|
|
47
|
+
stickyControls: { attribute: 'sticky-controls', type: Boolean, reflect: true },
|
|
48
|
+
visibleBackground: { attribute: 'visible-background', type: Boolean, reflect: true },
|
|
49
|
+
_data: { state: true },
|
|
50
|
+
_sortField: { state: true },
|
|
51
|
+
_sortDesc: { state: true }
|
|
52
|
+
};
|
|
55
53
|
|
|
56
|
-
static
|
|
57
|
-
|
|
58
|
-
:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
`];
|
|
73
|
-
}
|
|
54
|
+
static styles = [tableStyles, css`
|
|
55
|
+
:host {
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
:host([visible-background]) {
|
|
59
|
+
--d2l-table-controls-background-color: #dddddd;
|
|
60
|
+
}
|
|
61
|
+
.d2l-table > * > tr > :has(d2l-button-icon),
|
|
62
|
+
.d2l-table > * > tr > :has(d2l-dropdown-context-menu) {
|
|
63
|
+
padding-block: 0;
|
|
64
|
+
}
|
|
65
|
+
.d2l-table > * > tr > :has(d2l-table-col-sort-button) d2l-button-icon,
|
|
66
|
+
.d2l-table > * > tr > :has(d2l-table-col-sort-button) d2l-dropdown-context-menu {
|
|
67
|
+
vertical-align: top;
|
|
68
|
+
}
|
|
69
|
+
`];
|
|
74
70
|
|
|
75
71
|
constructor() {
|
|
76
72
|
super();
|
|
@@ -11,9 +11,7 @@ import { menuItemSelectableStyles } from '../menu/menu-item-selectable-styles.js
|
|
|
11
11
|
*/
|
|
12
12
|
class TableColSortButtonItem extends MenuItemRadioMixin(LitElement) {
|
|
13
13
|
|
|
14
|
-
static
|
|
15
|
-
return menuItemSelectableStyles;
|
|
16
|
-
}
|
|
14
|
+
static styles = menuItemSelectableStyles;
|
|
17
15
|
|
|
18
16
|
firstUpdated() {
|
|
19
17
|
super.firstUpdated();
|
|
@@ -19,115 +19,111 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
|
19
19
|
*/
|
|
20
20
|
export class TableColSortButton extends LocalizeCoreElement(FocusMixin(LitElement)) {
|
|
21
21
|
|
|
22
|
-
static
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
display: flex;
|
|
128
|
-
}
|
|
129
|
-
`;
|
|
130
|
-
}
|
|
22
|
+
static properties = {
|
|
23
|
+
/**
|
|
24
|
+
* Whether sort direction is descending
|
|
25
|
+
* @type {boolean}
|
|
26
|
+
*/
|
|
27
|
+
desc: {
|
|
28
|
+
reflect: true,
|
|
29
|
+
type: Boolean
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Column is not currently sorted. Hides the ascending/descending sort icon.
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
35
|
+
nosort: {
|
|
36
|
+
reflect: true,
|
|
37
|
+
type: Boolean
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Position of the button content
|
|
41
|
+
* @type {'start'|'center'|'end'}
|
|
42
|
+
*/
|
|
43
|
+
position: {
|
|
44
|
+
reflect: true,
|
|
45
|
+
type: String
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* ACCESSIBILITY: The type of data in the column (e.g., 'words'). Used to set the title.
|
|
49
|
+
* @type {'words'|'numbers'|'dates'|'unknown'}
|
|
50
|
+
*/
|
|
51
|
+
sourceType: {
|
|
52
|
+
attribute: 'source-type',
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
_hasDropdownItems: { state: true },
|
|
56
|
+
_selectedMenuItemText: { state: true },
|
|
57
|
+
_label: { state: true },
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
static styles = css`
|
|
61
|
+
:host {
|
|
62
|
+
--d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
|
|
63
|
+
--d2l-table-col-sort-button-additional-padding-inline-start: 0px; /* stylelint-disable-line length-zero-no-unit */
|
|
64
|
+
--d2l-table-col-sort-button-width: calc(100% - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
|
|
65
|
+
}
|
|
66
|
+
:host([nosort]) {
|
|
67
|
+
--d2l-table-col-sort-button-additional-padding-inline-end: calc(0.6rem + 18px);
|
|
68
|
+
}
|
|
69
|
+
:host > :first-child {
|
|
70
|
+
width: var(--d2l-table-col-sort-button-width);
|
|
71
|
+
}
|
|
72
|
+
:host([nosort][position="center"]) {
|
|
73
|
+
--d2l-table-col-sort-button-additional-padding-inline-end: calc(0.5 * (0.6rem + 18px) + var(--d2l-table-cell-col-sort-button-size-offset, 4px));
|
|
74
|
+
--d2l-table-col-sort-button-additional-padding-inline-start: calc(0.5 * (0.6rem + 18px) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
|
|
75
|
+
}
|
|
76
|
+
:host([nosort][position="end"]) {
|
|
77
|
+
--d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
|
|
78
|
+
--d2l-table-col-sort-button-additional-padding-inline-start: calc(0.6rem + 18px);
|
|
79
|
+
}
|
|
80
|
+
:host([position="center"]) button {
|
|
81
|
+
justify-content: center;
|
|
82
|
+
}
|
|
83
|
+
:host([position="end"]) button {
|
|
84
|
+
justify-content: end;
|
|
85
|
+
}
|
|
86
|
+
button {
|
|
87
|
+
align-items: center;
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
border: none;
|
|
90
|
+
border-radius: 4px;
|
|
91
|
+
color: inherit;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
font-family: inherit;
|
|
95
|
+
font-size: inherit;
|
|
96
|
+
letter-spacing: inherit;
|
|
97
|
+
line-height: 0.9rem;
|
|
98
|
+
margin-block: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
|
|
99
|
+
margin-inline: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
|
|
100
|
+
padding: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
|
|
101
|
+
padding-inline-end: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px) + var(--d2l-table-col-sort-button-additional-padding-inline-end));
|
|
102
|
+
padding-inline-start: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px) + var(--d2l-table-col-sort-button-additional-padding-inline-start));
|
|
103
|
+
text-align: start;
|
|
104
|
+
text-decoration: none;
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
button::-moz-focus-inner {
|
|
108
|
+
border: 0;
|
|
109
|
+
}
|
|
110
|
+
button:disabled {
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
}
|
|
113
|
+
button:hover {
|
|
114
|
+
background-color: var(--d2l-color-gypsum);
|
|
115
|
+
}
|
|
116
|
+
${getFocusRingStyles('button', { extraStyles: css`box-shadow: 0 0 0 2px #ffffff;` })}
|
|
117
|
+
d2l-icon {
|
|
118
|
+
margin-inline-start: 0.6rem;
|
|
119
|
+
}
|
|
120
|
+
::slotted(*[slot="items"]) {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
::slotted(d2l-table-col-sort-button-item[slot="items"]) {
|
|
124
|
+
display: flex;
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
131
127
|
|
|
132
128
|
constructor() {
|
|
133
129
|
super();
|
|
@@ -5,28 +5,25 @@ import { SelectionControls } from '../selection/selection-controls.js';
|
|
|
5
5
|
* Controls for table components containing a selection summary and selection actions.
|
|
6
6
|
*/
|
|
7
7
|
class TableControls extends SelectionControls {
|
|
8
|
-
static get properties() {
|
|
9
|
-
return {
|
|
10
|
-
/**
|
|
11
|
-
* Whether to render the selection summary
|
|
12
|
-
* @type {boolean}
|
|
13
|
-
*/
|
|
14
|
-
noSelection: { type: Boolean, attribute: 'no-selection' }
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
8
|
|
|
18
|
-
static
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
static properties = {
|
|
10
|
+
/**
|
|
11
|
+
* Whether to render the selection summary
|
|
12
|
+
* @type {boolean}
|
|
13
|
+
*/
|
|
14
|
+
noSelection: { type: Boolean, attribute: 'no-selection' }
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
static styles = [super.styles, css`
|
|
18
|
+
:host {
|
|
19
|
+
--d2l-selection-controls-background-color: var(--d2l-table-controls-background-color);
|
|
20
|
+
--d2l-selection-controls-shadow-display: var(--d2l-table-controls-shadow-display);
|
|
21
|
+
z-index: 6; /* Must be greater than d2l-table-wrapper and d2l-scroll-wrapper */
|
|
22
|
+
}
|
|
23
|
+
:host([no-sticky]) {
|
|
24
|
+
z-index: auto;
|
|
25
|
+
}
|
|
26
|
+
`];
|
|
30
27
|
|
|
31
28
|
constructor() {
|
|
32
29
|
super();
|