@brightspace-ui/core 3.2.1 → 3.3.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.
@@ -231,12 +231,19 @@ class HtmlBlock extends LitElement {
231
231
  'd2l-html-block-compact': this.compact
232
232
  };
233
233
 
234
- return html`
235
- <div class="${classMap(renderContainerClasses)}">
236
- ${(this._embedsFeatureEnabled() && !this.noDeferredRendering) ? until(this._processEmbeds(), nothing) : nothing}
237
- </div>
238
- ${this.noDeferredRendering ? html`<slot @slotchange="${this._handleSlotChange}"></slot>` : ''}
239
- `;
234
+ if (this._embedsFeatureEnabled()) {
235
+ return html`
236
+ <div class="${classMap(renderContainerClasses)}">
237
+ ${!this.noDeferredRendering ? until(this._processEmbeds(), nothing) : nothing}
238
+ </div>
239
+ ${this.noDeferredRendering ? html`<slot @slotchange="${this._handleSlotChange}"></slot>` : ''}
240
+ `;
241
+ } else {
242
+ return html`
243
+ <div class="${classMap(renderContainerClasses)}"></div>
244
+ ${this.noDeferredRendering ? html`<slot @slotchange="${this._handleSlotChange}"></slot>` : ''}
245
+ `;
246
+ }
240
247
  }
241
248
 
242
249
  async updated(changedProperties) {
@@ -227,6 +227,7 @@ When tabular data can be sorted, the `<d2l-table-col-sort-button>` can be used t
227
227
  |---|---|---|---|
228
228
  | `desc` | boolean | Whether sort direction is descending | false |
229
229
  | `nosort` | boolean | Column is not currently sorted. Hides the ascending/descending sort icon. | false |
230
+ | `position` | string | Position of the button content. Accepted values are 'start', 'center', and 'end'. | 'start' |
230
231
  | `source-type` | string | The type of data in the column. Used to set the title. Accepted values are 'words', 'numbers', and 'dates'. | 'unknown' |
231
232
 
232
233
  ## Selection
@@ -31,6 +31,14 @@ export class TableColSortButton extends LocalizeCoreElement(FocusMixin(LitElemen
31
31
  reflect: true,
32
32
  type: Boolean
33
33
  },
34
+ /**
35
+ * Position of the button content
36
+ * @type {'start'|'center'|'end'}
37
+ */
38
+ position: {
39
+ reflect: true,
40
+ type: String
41
+ },
34
42
  /**
35
43
  * The type of data in the column. Used to set the title.
36
44
  * @type {'words'|'numbers'|'dates'|'unknown'}
@@ -46,11 +54,26 @@ export class TableColSortButton extends LocalizeCoreElement(FocusMixin(LitElemen
46
54
  return css`
47
55
  :host {
48
56
  --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
57
+ --d2l-table-col-sort-button-additional-padding-inline-start: 0px; /* stylelint-disable-line length-zero-no-unit */
49
58
  --d2l-table-col-sort-button-width: calc(100% - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
50
59
  }
51
60
  :host([nosort]) {
52
61
  --d2l-table-col-sort-button-additional-padding-inline-end: calc(0.6rem + 18px);
53
62
  }
63
+ :host([nosort][position="center"]) {
64
+ --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));
65
+ --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));
66
+ }
67
+ :host([nosort][position="end"]) {
68
+ --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
69
+ --d2l-table-col-sort-button-additional-padding-inline-start: calc(0.6rem + 18px);
70
+ }
71
+ :host([position="center"]) button {
72
+ justify-content: center;
73
+ }
74
+ :host([position="end"]) button {
75
+ justify-content: end;
76
+ }
54
77
  button {
55
78
  align-items: center;
56
79
  background-color: transparent;
@@ -67,6 +90,7 @@ export class TableColSortButton extends LocalizeCoreElement(FocusMixin(LitElemen
67
90
  margin-inline: 0 var(--d2l-table-cell-col-sort-button-size-offset, 4px);
68
91
  padding: calc(var(--d2l-table-cell-padding) - var(--d2l-table-cell-col-sort-button-size-offset, 4px));
69
92
  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));
93
+ 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));
70
94
  text-decoration: none;
71
95
  width: var(--d2l-table-col-sort-button-width);
72
96
  }
@@ -94,6 +118,7 @@ export class TableColSortButton extends LocalizeCoreElement(FocusMixin(LitElemen
94
118
  super();
95
119
  this.desc = false;
96
120
  this.nosort = false;
121
+ this.position = 'start';
97
122
  this.sourceType = 'unknown';
98
123
 
99
124
  this._describedById = getUniqueId();
@@ -94,6 +94,7 @@ export const tableStyles = css`
94
94
  }
95
95
  d2l-table-col-sort-button:not(:only-child) {
96
96
  --d2l-table-col-sort-button-additional-padding-inline-end: 0px; /* stylelint-disable-line length-zero-no-unit */
97
+ --d2l-table-col-sort-button-additional-padding-inline-start: 0px; /* stylelint-disable-line length-zero-no-unit */
97
98
  }
98
99
 
99
100
  /* TODO: once we only support browsers that support :has the section below can be removed up until @supports */
@@ -12037,6 +12037,12 @@
12037
12037
  "type": "boolean",
12038
12038
  "default": "false"
12039
12039
  },
12040
+ {
12041
+ "name": "position",
12042
+ "description": "Position of the button content",
12043
+ "type": "'start'|'center'|'end'",
12044
+ "default": "\"start\""
12045
+ },
12040
12046
  {
12041
12047
  "name": "source-type",
12042
12048
  "description": "The type of data in the column. Used to set the title.",
@@ -12059,6 +12065,13 @@
12059
12065
  "type": "boolean",
12060
12066
  "default": "false"
12061
12067
  },
12068
+ {
12069
+ "name": "position",
12070
+ "attribute": "position",
12071
+ "description": "Position of the button content",
12072
+ "type": "'start'|'center'|'end'",
12073
+ "default": "\"start\""
12074
+ },
12062
12075
  {
12063
12076
  "name": "sourceType",
12064
12077
  "attribute": "source-type",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.2.1",
3
+ "version": "3.3.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",