@brightspace-ui/core 2.14.5 → 2.14.8

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.
@@ -111,9 +111,6 @@ export const htmlBlockContentStyles = css`
111
111
  mjx-assistive-mml math {
112
112
  position: absolute;
113
113
  }
114
- :host([dir="rtl"]) {
115
- text-align: right;
116
- }
117
114
  `;
118
115
 
119
116
  let renderers;
@@ -164,6 +161,9 @@ class HtmlBlock extends RtlMixin(LitElement) {
164
161
  :host([no-deferred-rendering]) div.d2l-html-block-rendered {
165
162
  display: none;
166
163
  }
164
+ :host([dir="rtl"]) {
165
+ text-align: right;
166
+ }
167
167
  `];
168
168
  }
169
169
 
@@ -31,6 +31,7 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
31
31
  * @type {boolean}
32
32
  */
33
33
  selectAllPagesAllowed: { type: Boolean, attribute: 'select-all-pages-allowed' },
34
+ _hasActions: { state: true },
34
35
  _scrolled: { type: Boolean, reflect: true }
35
36
  };
36
37
  }
@@ -60,6 +61,7 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
60
61
  height: 40px;
61
62
  position: absolute;
62
63
  width: 100%;
64
+ z-index: -1;
63
65
  }
64
66
  :host([hidden]) {
65
67
  display: none;
@@ -69,6 +71,9 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
69
71
  display: flex;
70
72
  margin-bottom: 6px;
71
73
  margin-top: 6px;
74
+ min-height: 54px;
75
+ }
76
+ .d2l-list-header-container-slim {
72
77
  min-height: 36px;
73
78
  }
74
79
  .d2l-list-header-extend-separator {
@@ -124,6 +129,7 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
124
129
  render() {
125
130
  const classes = {
126
131
  'd2l-list-header-container': true,
132
+ 'd2l-list-header-container-slim': (!this._hasActions && !this.selectAllPagesAllowed),
127
133
  'd2l-list-header-extend-separator': this._extendSeparator
128
134
  };
129
135
  return html`
@@ -138,13 +144,17 @@ class ListHeader extends RtlMixin(LocalizeCoreElement(LitElement)) {
138
144
  ${this.selectAllPagesAllowed ? html`<d2l-selection-select-all-pages></d2l-selection-select-all-pages>` : null}
139
145
  `}
140
146
  <div class="d2l-list-header-actions">
141
- <d2l-overflow-group opener-type="icon"><slot></slot></d2l-overflow-group>
147
+ <d2l-overflow-group opener-type="icon"><slot @slotchange="${this._handleSlotChange}"></slot></d2l-overflow-group>
142
148
  </div>
143
149
  </div>
144
150
  ${!this.noSticky ? html`<div class="d2l-list-header-shadow"></div>` : null}
145
151
  `;
146
152
  }
147
153
 
154
+ _handleSlotChange(e) {
155
+ this._hasActions = (e.target.assignedNodes({ flatten: true }).filter(node => node.nodeType === Node.ELEMENT_NODE).length > 0);
156
+ }
157
+
148
158
  }
149
159
 
150
160
  customElements.define('d2l-list-header', ListHeader);
@@ -94,6 +94,7 @@ class TagList extends LocalizeCoreElement(InteractiveMixin(ArrowKeysMixin(LitEle
94
94
  this._contentReady = false;
95
95
  this._hasResized = false;
96
96
  this._itemHeight = 0;
97
+ this._listContainerObserver = null;
97
98
  this._resizeObserver = null;
98
99
  this._showHiddenTags = false;
99
100
  }
@@ -101,6 +102,7 @@ class TagList extends LocalizeCoreElement(InteractiveMixin(ArrowKeysMixin(LitEle
101
102
  disconnectedCallback() {
102
103
  super.disconnectedCallback();
103
104
  if (this._clearButtonResizeObserver) this._clearButtonResizeObserver.disconnect();
105
+ if (this._listContainerObserver) this._listContainerObserver.disconnect();
104
106
  if (this._resizeObserver) this._resizeObserver.disconnect();
105
107
  if (this._subtleButtonResizeObserver) this._subtleButtonResizeObserver.disconnect();
106
108
  }
@@ -114,16 +116,20 @@ class TagList extends LocalizeCoreElement(InteractiveMixin(ArrowKeysMixin(LitEle
114
116
  });
115
117
  this._subtleButtonResizeObserver.observe(subtleButton);
116
118
 
117
- const container = this.shadowRoot.querySelector('.tag-list-outer-container');
118
- this._resizeObserver = new ResizeObserver((e) => requestAnimationFrame(() => this._handleResize(e)));
119
- this._resizeObserver.observe(container);
120
-
121
119
  const clearButton = this.shadowRoot.querySelector('d2l-button-subtle.d2l-tag-list-clear-button');
122
120
  this._clearButtonResizeObserver = new ResizeObserver(() => {
123
121
  this._clearButtonWidth = Math.ceil(parseFloat(getComputedStyle(clearButton).getPropertyValue('width')));
124
122
  this._clearButtonHeight = Math.ceil(parseFloat(getComputedStyle(clearButton).getPropertyValue('height')));
125
123
  });
126
124
  this._clearButtonResizeObserver.observe(clearButton);
125
+
126
+ const container = this.shadowRoot.querySelector('.tag-list-outer-container');
127
+ this._resizeObserver = new ResizeObserver((e) => requestAnimationFrame(() => this._handleResize(e)));
128
+ this._resizeObserver.observe(container);
129
+
130
+ const listContainer = this.shadowRoot.querySelector('.tag-list-container');
131
+ this._listContainerObserver = new ResizeObserver(() => requestAnimationFrame(() => this._handleSlotChange()));
132
+ this._listContainerObserver.observe(listContainer);
127
133
  }
128
134
 
129
135
  render() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.14.5",
3
+ "version": "2.14.8",
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",