@brightspace-ui/core 3.144.2 → 3.145.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.
- package/components/list/demo/demo-list-nav.js +2 -0
- package/components/list/demo/list-demo-scenarios.js +15 -7
- package/components/list/demo/list-nav.html +8 -0
- package/components/list/list-item-generic-layout.js +18 -1
- package/components/list/list-item-mixin.js +6 -0
- package/custom-elements.json +64 -0
- package/package.json +1 -1
@@ -14,6 +14,7 @@ class ListDemoNav extends LitElement {
|
|
14
14
|
static get properties() {
|
15
15
|
return {
|
16
16
|
addButton: { type: Boolean, attribute: 'add-button' },
|
17
|
+
indentation: { type: Boolean },
|
17
18
|
_currentItem: { state: true }
|
18
19
|
};
|
19
20
|
}
|
@@ -143,6 +144,7 @@ class ListDemoNav extends LitElement {
|
|
143
144
|
color="${ifDefined(item.color)}"
|
144
145
|
?expandable="${hasSubList}"
|
145
146
|
?expanded="${hasSubList}"
|
147
|
+
indentation="${ifDefined(this.indentation ? '41' : undefined)}"
|
146
148
|
drop-nested
|
147
149
|
label="${item.primaryText}"
|
148
150
|
prevent-navigation>
|
@@ -328,7 +328,6 @@ export const listDemos = {
|
|
328
328
|
primaryText: 'Glaciation',
|
329
329
|
dropNested: true,
|
330
330
|
items: [],
|
331
|
-
color: '#29a6ff',
|
332
331
|
tooltipText: 'Starts: 2023-09-01, Ends: 2023-12-01',
|
333
332
|
tooltipOpenerText: 'Due: 2023-10-10',
|
334
333
|
hasIcon: true
|
@@ -337,7 +336,6 @@ export const listDemos = {
|
|
337
336
|
primaryText: 'Weathering',
|
338
337
|
dropNested: true,
|
339
338
|
items: [],
|
340
|
-
color: '#29a6ff',
|
341
339
|
tooltipText: 'Starts: 2023-10-01, Ends: 2023-12-01',
|
342
340
|
tooltipOpenerText: 'Due: 2023-11-10',
|
343
341
|
hasIcon: true
|
@@ -346,26 +344,36 @@ export const listDemos = {
|
|
346
344
|
primaryText: 'Volcanism',
|
347
345
|
dropNested: true,
|
348
346
|
items: [],
|
349
|
-
color: '#29a6ff',
|
350
347
|
hasIcon: true
|
351
348
|
}]
|
352
349
|
}, {
|
353
350
|
key: '2',
|
354
351
|
primaryText: 'Applied Wetland Science',
|
355
|
-
color: '#
|
352
|
+
color: '#990006',
|
356
353
|
items: [{
|
357
354
|
key: '2-1',
|
358
355
|
primaryText: 'Carbon & Nitrogen Cycling',
|
359
356
|
dropNested: true,
|
360
357
|
items: [],
|
361
|
-
color: '#ff575a',
|
362
358
|
hasIcon: true
|
363
359
|
}, {
|
364
360
|
key: '2-2',
|
365
361
|
primaryText: 'Wetland Engineering',
|
366
362
|
dropNested: true,
|
367
|
-
|
368
|
-
|
363
|
+
color: '#cd2026',
|
364
|
+
items: [{
|
365
|
+
key: '2-2-1',
|
366
|
+
primaryText: 'Wetland Engineering #1',
|
367
|
+
dropNested: true,
|
368
|
+
items: [],
|
369
|
+
hasIcon: true
|
370
|
+
}, {
|
371
|
+
key: '2-2-2',
|
372
|
+
primaryText: 'Wetland Engineering #2',
|
373
|
+
dropNested: true,
|
374
|
+
items: [],
|
375
|
+
hasIcon: true
|
376
|
+
}],
|
369
377
|
hasIcon: true
|
370
378
|
}]
|
371
379
|
}],
|
@@ -96,6 +96,14 @@
|
|
96
96
|
</template>
|
97
97
|
</d2l-demo-snippet>
|
98
98
|
|
99
|
+
<h2>Side nav list (draggable, indentation)</h2>
|
100
|
+
|
101
|
+
<d2l-demo-snippet>
|
102
|
+
<template>
|
103
|
+
<d2l-demo-list-nav indentation></d2l-demo-list-nav>
|
104
|
+
</template>
|
105
|
+
</d2l-demo-snippet>
|
106
|
+
|
99
107
|
</d2l-demo-page>
|
100
108
|
|
101
109
|
</body>
|
@@ -53,7 +53,12 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
53
53
|
* Specifies whether the grid is active or not
|
54
54
|
* @type {boolean}
|
55
55
|
*/
|
56
|
-
gridActive: { type: Boolean, attribute: 'grid-active' }
|
56
|
+
gridActive: { type: Boolean, attribute: 'grid-active' },
|
57
|
+
/**
|
58
|
+
* Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.
|
59
|
+
* @type {number}
|
60
|
+
*/
|
61
|
+
indentation: { type: Number, reflect: true }
|
57
62
|
};
|
58
63
|
}
|
59
64
|
|
@@ -185,6 +190,11 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
185
190
|
grid-row: nested;
|
186
191
|
}
|
187
192
|
|
193
|
+
:host([indentation]) ::slotted([slot="nested"]) {
|
194
|
+
grid-column-start: start;
|
195
|
+
padding-inline-start: var(--d2l-list-item-generic-layout-nested-indentation);
|
196
|
+
}
|
197
|
+
|
188
198
|
::slotted([slot="add"]) {
|
189
199
|
grid-row: add;
|
190
200
|
}
|
@@ -248,6 +258,13 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
|
|
248
258
|
`;
|
249
259
|
}
|
250
260
|
|
261
|
+
willUpdate(changedProperties) {
|
262
|
+
super.willUpdate(changedProperties);
|
263
|
+
if (changedProperties.has('indentation')) {
|
264
|
+
this.style.setProperty('--d2l-list-item-generic-layout-nested-indentation', `${this.indentation}px`);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
251
268
|
_focusCellItem(focusInfo) {
|
252
269
|
const cell = this.shadowRoot?.querySelector(`[data-cell-num="${focusInfo.cellNum}"]`);
|
253
270
|
if (!cell) return;
|
@@ -85,6 +85,11 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
85
85
|
* @type {boolean}
|
86
86
|
*/
|
87
87
|
dragTargetHandleOnly: { type: Boolean, attribute: 'drag-target-handle-only' },
|
88
|
+
/**
|
89
|
+
* Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.
|
90
|
+
* @type {number}
|
91
|
+
*/
|
92
|
+
indentation: { type: Number, reflect: true },
|
88
93
|
/**
|
89
94
|
* @ignore
|
90
95
|
*/
|
@@ -777,6 +782,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
|
|
777
782
|
@focusout="${this._onFocusOut}"
|
778
783
|
class="${classMap(classes)}"
|
779
784
|
data-separators="${ifDefined(this._separators)}"
|
785
|
+
indentation="${ifDefined(this.indentation)}"
|
780
786
|
?grid-active="${this.role === 'row'}"
|
781
787
|
?no-primary-action="${this.noPrimaryAction}">
|
782
788
|
${this._showAddButton && this.first ? html`
|
package/custom-elements.json
CHANGED
@@ -8393,6 +8393,10 @@
|
|
8393
8393
|
"name": "d2l-demo-list-nav",
|
8394
8394
|
"path": "./components/list/demo/demo-list-nav.js",
|
8395
8395
|
"attributes": [
|
8396
|
+
{
|
8397
|
+
"name": "indentation",
|
8398
|
+
"type": "boolean"
|
8399
|
+
},
|
8396
8400
|
{
|
8397
8401
|
"name": "add-button",
|
8398
8402
|
"type": "boolean",
|
@@ -8400,6 +8404,11 @@
|
|
8400
8404
|
}
|
8401
8405
|
],
|
8402
8406
|
"properties": [
|
8407
|
+
{
|
8408
|
+
"name": "indentation",
|
8409
|
+
"attribute": "indentation",
|
8410
|
+
"type": "boolean"
|
8411
|
+
},
|
8403
8412
|
{
|
8404
8413
|
"name": "addButton",
|
8405
8414
|
"attribute": "add-button",
|
@@ -8660,6 +8669,11 @@
|
|
8660
8669
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
8661
8670
|
"type": "boolean"
|
8662
8671
|
},
|
8672
|
+
{
|
8673
|
+
"name": "indentation",
|
8674
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
8675
|
+
"type": "number"
|
8676
|
+
},
|
8663
8677
|
{
|
8664
8678
|
"name": "color",
|
8665
8679
|
"description": "A color indicator to appear at the beginning of a list item. Expected value is a valid 3, 4, 6, or 8 character CSS color hex code (e.g., #006fbf).",
|
@@ -8755,6 +8769,12 @@
|
|
8755
8769
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
8756
8770
|
"type": "boolean"
|
8757
8771
|
},
|
8772
|
+
{
|
8773
|
+
"name": "indentation",
|
8774
|
+
"attribute": "indentation",
|
8775
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
8776
|
+
"type": "number"
|
8777
|
+
},
|
8758
8778
|
{
|
8759
8779
|
"name": "color",
|
8760
8780
|
"attribute": "color",
|
@@ -8999,6 +9019,11 @@
|
|
8999
9019
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
9000
9020
|
"type": "boolean"
|
9001
9021
|
},
|
9022
|
+
{
|
9023
|
+
"name": "indentation",
|
9024
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9025
|
+
"type": "number"
|
9026
|
+
},
|
9002
9027
|
{
|
9003
9028
|
"name": "color",
|
9004
9029
|
"description": "A color indicator to appear at the beginning of a list item. Expected value is a valid 3, 4, 6, or 8 character CSS color hex code (e.g., #006fbf).",
|
@@ -9101,6 +9126,12 @@
|
|
9101
9126
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
9102
9127
|
"type": "boolean"
|
9103
9128
|
},
|
9129
|
+
{
|
9130
|
+
"name": "indentation",
|
9131
|
+
"attribute": "indentation",
|
9132
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9133
|
+
"type": "number"
|
9134
|
+
},
|
9104
9135
|
{
|
9105
9136
|
"name": "color",
|
9106
9137
|
"attribute": "color",
|
@@ -9368,6 +9399,11 @@
|
|
9368
9399
|
"description": "Specifies whether the grid is active or not",
|
9369
9400
|
"type": "boolean"
|
9370
9401
|
},
|
9402
|
+
{
|
9403
|
+
"name": "indentation",
|
9404
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9405
|
+
"type": "number"
|
9406
|
+
},
|
9371
9407
|
{
|
9372
9408
|
"name": "align-nested",
|
9373
9409
|
"description": "How to align content in the nested slot",
|
@@ -9388,6 +9424,12 @@
|
|
9388
9424
|
"description": "Specifies whether the grid is active or not",
|
9389
9425
|
"type": "boolean"
|
9390
9426
|
},
|
9427
|
+
{
|
9428
|
+
"name": "indentation",
|
9429
|
+
"attribute": "indentation",
|
9430
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9431
|
+
"type": "number"
|
9432
|
+
},
|
9391
9433
|
{
|
9392
9434
|
"name": "alignNested",
|
9393
9435
|
"attribute": "align-nested",
|
@@ -9464,6 +9506,11 @@
|
|
9464
9506
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
9465
9507
|
"type": "boolean"
|
9466
9508
|
},
|
9509
|
+
{
|
9510
|
+
"name": "indentation",
|
9511
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9512
|
+
"type": "number"
|
9513
|
+
},
|
9467
9514
|
{
|
9468
9515
|
"name": "color",
|
9469
9516
|
"description": "A color indicator to appear at the beginning of a list item. Expected value is a valid 3, 4, 6, or 8 character CSS color hex code (e.g., #006fbf).",
|
@@ -9578,6 +9625,12 @@
|
|
9578
9625
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
9579
9626
|
"type": "boolean"
|
9580
9627
|
},
|
9628
|
+
{
|
9629
|
+
"name": "indentation",
|
9630
|
+
"attribute": "indentation",
|
9631
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9632
|
+
"type": "number"
|
9633
|
+
},
|
9581
9634
|
{
|
9582
9635
|
"name": "color",
|
9583
9636
|
"attribute": "color",
|
@@ -9756,6 +9809,11 @@
|
|
9756
9809
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
9757
9810
|
"type": "boolean"
|
9758
9811
|
},
|
9812
|
+
{
|
9813
|
+
"name": "indentation",
|
9814
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9815
|
+
"type": "number"
|
9816
|
+
},
|
9759
9817
|
{
|
9760
9818
|
"name": "color",
|
9761
9819
|
"description": "A color indicator to appear at the beginning of a list item. Expected value is a valid 3, 4, 6, or 8 character CSS color hex code (e.g., #006fbf).",
|
@@ -9863,6 +9921,12 @@
|
|
9863
9921
|
"description": "Whether to allow the drag target to be the handle only rather than the entire cell",
|
9864
9922
|
"type": "boolean"
|
9865
9923
|
},
|
9924
|
+
{
|
9925
|
+
"name": "indentation",
|
9926
|
+
"attribute": "indentation",
|
9927
|
+
"description": "Inline start padding (in px) to apply to list item(s) in the nested slot. When used, nested list items will not use the grid start calcuations and will only use this number to determine indentation.",
|
9928
|
+
"type": "number"
|
9929
|
+
},
|
9866
9930
|
{
|
9867
9931
|
"name": "color",
|
9868
9932
|
"attribute": "color",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.145.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",
|