@brightspace-ui/core 1.226.0 → 1.227.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.
@@ -311,7 +311,7 @@ The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot
311
311
 
312
312
  | Property | Type | Description |
313
313
  |---|---|---|
314
- | `slim` | Boolean | Whether to render a header with reduced whitespace |
314
+ | `padding-type` | String | Header whitespace (`normal` (default), `slim`)|
315
315
  <!-- docs: end hidden content -->
316
316
 
317
317
  ## List Item [d2l-list-item]
@@ -354,16 +354,17 @@ The `d2l-list-item` provides the appropriate `listitem` semantics for children w
354
354
  | `disabled` | Boolean | Disables the input |
355
355
  | `draggable` | Boolean | Whether the item is draggable |
356
356
  | `drag-handle-text` | String | The drag-handle label for assistive technology. If implementing drag & drop, you should change this to dynamically announce what the drag-handle is moving for assistive technology in keyboard mode. |
357
+ | `drag-target-handle-only` | Boolean | Make the drag target the drag handle only. |
357
358
  | `drop-nested` | Boolean | Whether nested items can be dropped on this item |
358
359
  | `drop-text` | String | Text to drag and drop |
359
360
  | `href` | String | Address of item link if navigable |
360
361
  | `key` | String | Value to identify item if selectable or draggable |
361
362
  | `label` | String | Explicitly defined label for the element |
362
363
  | `labelled-by` | String | The id of element that provides the label for this element |
364
+ | `padding-type` | String | List item whitespace (`normal` (default), `slim`, `none`)|
363
365
  | `selectable` | Boolean | Indicates an input should be rendered for selecting the item |
364
366
  | `selected` | Boolean | Whether the item is selected |
365
367
  | `skeleton` | Boolean | Renders the input as a skeleton loader |
366
- | `slim` | Boolean | Whether to render the list-item with reduced whitespace|
367
368
 
368
369
  ### Events
369
370
 
@@ -15,9 +15,16 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
15
15
  return {
16
16
  /**
17
17
  * Whether to render a header with reduced whitespace
18
+ * TODO: Remove
18
19
  * @type {boolean}
19
20
  */
20
- slim: { reflect: true, type: Boolean }
21
+ slim: { reflect: true, type: Boolean },
22
+ /**
23
+ * How much padding to render list items with
24
+ * One of 'normal'|'slim', defaults to 'normal'
25
+ * @type {string}
26
+ */
27
+ paddingType: { type: String, attribute: 'padding-type' },
21
28
  };
22
29
  }
23
30
 
@@ -36,7 +43,10 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
36
43
  margin-top: 6px;
37
44
  min-height: 58px;
38
45
  }
39
- :host([slim]) .d2l-list-header-container {
46
+ :host([slim]) .d2l-list-header-container { /* TODO: Remove */
47
+ min-height: 36px;
48
+ }
49
+ :host([padding-type="slim"]) .d2l-list-header-container {
40
50
  min-height: 36px;
41
51
  }
42
52
  d2l-selection-select-all {
@@ -64,6 +74,7 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
64
74
  constructor() {
65
75
  super();
66
76
  this.slim = false;
77
+ this.paddingType = 'normal';
67
78
  }
68
79
 
69
80
  render() {
@@ -53,8 +53,20 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
53
53
  * @type {array}
54
54
  */
55
55
  breakpoints: { type: Array },
56
+ /**
57
+ * Whether to allow the drag target to be the handle only rather than the entire cell
58
+ * @type {boolean}
59
+ */
60
+ dragTargetHandleOnly: { type: Boolean, attribute: 'drag-target-handle-only' },
61
+ /**
62
+ * How much padding to render list items with
63
+ * One of 'normal'|'slim'|'none', defaults to 'normal'
64
+ * @type {string}
65
+ */
66
+ paddingType: { type: String, attribute: 'padding-type' },
56
67
  /**
57
68
  * Whether to render the list-item with reduced whitespace.
69
+ * TODO: Remove in favor of padding-type="slim"
58
70
  * @type {boolean}
59
71
  */
60
72
  slim: { type: Boolean },
@@ -106,6 +118,10 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
106
118
  border-bottom: 1px solid var(--d2l-color-mica);
107
119
  border-top: 1px solid var(--d2l-color-mica);
108
120
  }
121
+ :host([padding-type="none"]) d2l-list-item-generic-layout {
122
+ border-bottom: 0;
123
+ border-top: 0;
124
+ }
109
125
  d2l-list-item-generic-layout[data-separators="none"] {
110
126
  border-bottom: 1px solid transparent;
111
127
  border-top: 1px solid transparent;
@@ -143,10 +159,18 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
143
159
  justify-content: stretch;
144
160
  padding: 0.55rem 0;
145
161
  }
146
- :host([slim]) [slot="content"] {
162
+ :host([slim]) [slot="content"] { /* TODO, remove */
147
163
  padding-bottom: 0.35rem;
148
164
  padding-top: 0.4rem;
149
165
  }
166
+ :host([padding-type="slim"]) [slot="content"] {
167
+ padding-bottom: 0.35rem;
168
+ padding-top: 0.4rem;
169
+ }
170
+ :host([padding-type="none"]) [slot="content"] {
171
+ padding-bottom: 0;
172
+ padding-top: 0;
173
+ }
150
174
  [slot="content"] ::slotted([slot="illustration"]),
151
175
  [slot="content"] .d2l-list-item-illustration * {
152
176
  border-radius: 6px;
@@ -219,7 +243,11 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
219
243
  .d2l-list-item-content-extend-separators d2l-selection-input {
220
244
  margin-left: 0.9rem;
221
245
  }
222
- :host([slim]) d2l-selection-input {
246
+ :host([slim]) d2l-selection-input { /* TODO, remove */
247
+ margin-bottom: 0.55rem;
248
+ margin-top: 0.55rem;
249
+ }
250
+ :host([padding-type="slim"]) d2l-selection-input {
223
251
  margin-bottom: 0.55rem;
224
252
  margin-top: 0.55rem;
225
253
  }
@@ -276,6 +304,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
276
304
  super();
277
305
  this.breakpoints = defaultBreakpoints;
278
306
  this.slim = false;
307
+ this.paddingType = 'normal';
279
308
  this._breakpoint = 0;
280
309
  this._contentId = getUniqueId();
281
310
  this._displayKeyboardTooltip = false;
@@ -449,7 +478,7 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
449
478
  ?grid-active="${this.role === 'rowgroup'}">
450
479
  ${this._renderDropTarget()}
451
480
  ${this._renderDragHandle(this._renderOutsideControl)}
452
- ${this._renderDragTarget(this._renderOutsideControlAction)}
481
+ ${this._renderDragTarget(this.dragTargetHandleOnly ? this._renderOutsideControlHandleOnly : this._renderOutsideControlAction)}
453
482
  ${this.selectable ? html`
454
483
  <div slot="control">${this._renderCheckbox()}</div>
455
484
  <div slot="control-action"
@@ -497,6 +526,10 @@ export const ListItemMixin = superclass => class extends LocalizeCoreElement(Lis
497
526
  return html`<div slot="outside-control-action" @mouseenter="${this._onMouseEnter}" @mouseleave="${this._onMouseLeave}">${dragTarget}</div>`;
498
527
  }
499
528
 
529
+ _renderOutsideControlHandleOnly(dragHandle) {
530
+ return html`<div slot="outside-control" @mouseenter="${this._onMouseEnter}" @mouseleave="${this._onMouseLeave}">${dragHandle}</div>`;
531
+ }
532
+
500
533
  _renderTooltipContent() {
501
534
  return html`
502
535
  <div>${this.localize('components.list-item-tooltip.title')}</div>
@@ -6471,6 +6471,11 @@
6471
6471
  "name": "d2l-demo-list-item-custom",
6472
6472
  "path": "./components/list/demo/list-item-custom.js",
6473
6473
  "attributes": [
6474
+ {
6475
+ "name": "drag-target-handle-only",
6476
+ "description": "Whether to allow the drag target to be the handle only rather than the entire cell",
6477
+ "type": "boolean"
6478
+ },
6474
6479
  {
6475
6480
  "name": "breakpoints",
6476
6481
  "description": "Breakpoints for responsiveness in pixels. There are four different breakpoints and only the four largest breakpoints will be used.",
@@ -6479,10 +6484,16 @@
6479
6484
  },
6480
6485
  {
6481
6486
  "name": "slim",
6482
- "description": "Whether to render the list-item with reduced whitespace.",
6487
+ "description": "Whether to render the list-item with reduced whitespace.\nTODO: Remove in favor of padding-type=\"slim\"",
6483
6488
  "type": "boolean",
6484
6489
  "default": "false"
6485
6490
  },
6491
+ {
6492
+ "name": "padding-type",
6493
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim'|'none', defaults to 'normal'",
6494
+ "type": "string",
6495
+ "default": "\"normal\""
6496
+ },
6486
6497
  {
6487
6498
  "name": "drag-handle-text",
6488
6499
  "description": "**Drag & drop:** The drag-handle label for assistive technology. If implementing drag & drop, you should change this to dynamically announce what the drag-handle is moving for assistive technology in keyboard mode.",
@@ -6546,6 +6557,12 @@
6546
6557
  }
6547
6558
  ],
6548
6559
  "properties": [
6560
+ {
6561
+ "name": "dragTargetHandleOnly",
6562
+ "attribute": "drag-target-handle-only",
6563
+ "description": "Whether to allow the drag target to be the handle only rather than the entire cell",
6564
+ "type": "boolean"
6565
+ },
6549
6566
  {
6550
6567
  "name": "breakpoints",
6551
6568
  "attribute": "breakpoints",
@@ -6556,10 +6573,17 @@
6556
6573
  {
6557
6574
  "name": "slim",
6558
6575
  "attribute": "slim",
6559
- "description": "Whether to render the list-item with reduced whitespace.",
6576
+ "description": "Whether to render the list-item with reduced whitespace.\nTODO: Remove in favor of padding-type=\"slim\"",
6560
6577
  "type": "boolean",
6561
6578
  "default": "false"
6562
6579
  },
6580
+ {
6581
+ "name": "paddingType",
6582
+ "attribute": "padding-type",
6583
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim'|'none', defaults to 'normal'",
6584
+ "type": "string",
6585
+ "default": "\"normal\""
6586
+ },
6563
6587
  {
6564
6588
  "name": "dragHandleText",
6565
6589
  "attribute": "drag-handle-text",
@@ -6659,18 +6683,31 @@
6659
6683
  "attributes": [
6660
6684
  {
6661
6685
  "name": "slim",
6662
- "description": "Whether to render a header with reduced whitespace",
6686
+ "description": "Whether to render a header with reduced whitespace\nTODO: Remove",
6663
6687
  "type": "boolean",
6664
6688
  "default": "false"
6689
+ },
6690
+ {
6691
+ "name": "padding-type",
6692
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim', defaults to 'normal'",
6693
+ "type": "string",
6694
+ "default": "\"normal\""
6665
6695
  }
6666
6696
  ],
6667
6697
  "properties": [
6668
6698
  {
6669
6699
  "name": "slim",
6670
6700
  "attribute": "slim",
6671
- "description": "Whether to render a header with reduced whitespace",
6701
+ "description": "Whether to render a header with reduced whitespace\nTODO: Remove",
6672
6702
  "type": "boolean",
6673
6703
  "default": "false"
6704
+ },
6705
+ {
6706
+ "name": "paddingType",
6707
+ "attribute": "padding-type",
6708
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim', defaults to 'normal'",
6709
+ "type": "string",
6710
+ "default": "\"normal\""
6674
6711
  }
6675
6712
  ],
6676
6713
  "slots": [
@@ -6685,6 +6722,11 @@
6685
6722
  "path": "./components/list/list-item-button.js",
6686
6723
  "description": "A component for a \"listitem\" child within a list. It provides semantics, basic layout, breakpoints for responsiveness, a link for navigation, and selection.",
6687
6724
  "attributes": [
6725
+ {
6726
+ "name": "drag-target-handle-only",
6727
+ "description": "Whether to allow the drag target to be the handle only rather than the entire cell",
6728
+ "type": "boolean"
6729
+ },
6688
6730
  {
6689
6731
  "name": "breakpoints",
6690
6732
  "description": "Breakpoints for responsiveness in pixels. There are four different breakpoints and only the four largest breakpoints will be used.",
@@ -6693,10 +6735,16 @@
6693
6735
  },
6694
6736
  {
6695
6737
  "name": "slim",
6696
- "description": "Whether to render the list-item with reduced whitespace.",
6738
+ "description": "Whether to render the list-item with reduced whitespace.\nTODO: Remove in favor of padding-type=\"slim\"",
6697
6739
  "type": "boolean",
6698
6740
  "default": "false"
6699
6741
  },
6742
+ {
6743
+ "name": "padding-type",
6744
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim'|'none', defaults to 'normal'",
6745
+ "type": "string",
6746
+ "default": "\"normal\""
6747
+ },
6700
6748
  {
6701
6749
  "name": "drag-handle-text",
6702
6750
  "description": "**Drag & drop:** The drag-handle label for assistive technology. If implementing drag & drop, you should change this to dynamically announce what the drag-handle is moving for assistive technology in keyboard mode.",
@@ -6760,6 +6808,12 @@
6760
6808
  }
6761
6809
  ],
6762
6810
  "properties": [
6811
+ {
6812
+ "name": "dragTargetHandleOnly",
6813
+ "attribute": "drag-target-handle-only",
6814
+ "description": "Whether to allow the drag target to be the handle only rather than the entire cell",
6815
+ "type": "boolean"
6816
+ },
6763
6817
  {
6764
6818
  "name": "breakpoints",
6765
6819
  "attribute": "breakpoints",
@@ -6770,10 +6824,17 @@
6770
6824
  {
6771
6825
  "name": "slim",
6772
6826
  "attribute": "slim",
6773
- "description": "Whether to render the list-item with reduced whitespace.",
6827
+ "description": "Whether to render the list-item with reduced whitespace.\nTODO: Remove in favor of padding-type=\"slim\"",
6774
6828
  "type": "boolean",
6775
6829
  "default": "false"
6776
6830
  },
6831
+ {
6832
+ "name": "paddingType",
6833
+ "attribute": "padding-type",
6834
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim'|'none', defaults to 'normal'",
6835
+ "type": "string",
6836
+ "default": "\"normal\""
6837
+ },
6777
6838
  {
6778
6839
  "name": "dragHandleText",
6779
6840
  "attribute": "drag-handle-text",
@@ -7055,6 +7116,11 @@
7055
7116
  "description": "Address of item link if navigable",
7056
7117
  "type": "string"
7057
7118
  },
7119
+ {
7120
+ "name": "drag-target-handle-only",
7121
+ "description": "Whether to allow the drag target to be the handle only rather than the entire cell",
7122
+ "type": "boolean"
7123
+ },
7058
7124
  {
7059
7125
  "name": "breakpoints",
7060
7126
  "description": "Breakpoints for responsiveness in pixels. There are four different breakpoints and only the four largest breakpoints will be used.",
@@ -7063,10 +7129,16 @@
7063
7129
  },
7064
7130
  {
7065
7131
  "name": "slim",
7066
- "description": "Whether to render the list-item with reduced whitespace.",
7132
+ "description": "Whether to render the list-item with reduced whitespace.\nTODO: Remove in favor of padding-type=\"slim\"",
7067
7133
  "type": "boolean",
7068
7134
  "default": "false"
7069
7135
  },
7136
+ {
7137
+ "name": "padding-type",
7138
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim'|'none', defaults to 'normal'",
7139
+ "type": "string",
7140
+ "default": "\"normal\""
7141
+ },
7070
7142
  {
7071
7143
  "name": "drag-handle-text",
7072
7144
  "description": "**Drag & drop:** The drag-handle label for assistive technology. If implementing drag & drop, you should change this to dynamically announce what the drag-handle is moving for assistive technology in keyboard mode.",
@@ -7142,6 +7214,12 @@
7142
7214
  "description": "Address of item link if navigable",
7143
7215
  "type": "string"
7144
7216
  },
7217
+ {
7218
+ "name": "dragTargetHandleOnly",
7219
+ "attribute": "drag-target-handle-only",
7220
+ "description": "Whether to allow the drag target to be the handle only rather than the entire cell",
7221
+ "type": "boolean"
7222
+ },
7145
7223
  {
7146
7224
  "name": "breakpoints",
7147
7225
  "attribute": "breakpoints",
@@ -7152,10 +7230,17 @@
7152
7230
  {
7153
7231
  "name": "slim",
7154
7232
  "attribute": "slim",
7155
- "description": "Whether to render the list-item with reduced whitespace.",
7233
+ "description": "Whether to render the list-item with reduced whitespace.\nTODO: Remove in favor of padding-type=\"slim\"",
7156
7234
  "type": "boolean",
7157
7235
  "default": "false"
7158
7236
  },
7237
+ {
7238
+ "name": "paddingType",
7239
+ "attribute": "padding-type",
7240
+ "description": "How much padding to render list items with\nOne of 'normal'|'slim'|'none', defaults to 'normal'",
7241
+ "type": "string",
7242
+ "default": "\"normal\""
7243
+ },
7159
7244
  {
7160
7245
  "name": "dragHandleText",
7161
7246
  "attribute": "drag-handle-text",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "1.226.0",
3
+ "version": "1.227.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",