@brightspace-ui/core 2.14.6 → 2.14.9

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.
@@ -14,7 +14,8 @@ import { tryGetIfrauBackdropService } from '../../helpers/ifrauBackdropService.j
14
14
  window.D2L = window.D2L || {};
15
15
  window.D2L.DialogMixin = window.D2L.DialogMixin || {};
16
16
 
17
- window.D2L.DialogMixin.hasNative = (window.HTMLDialogElement !== undefined);
17
+ window.D2L.DialogMixin.hasNative = (window.HTMLDialogElement !== undefined)
18
+ && (navigator.vendor && navigator.vendor.toLowerCase().indexOf('apple') === -1);
18
19
  if (window.D2L.DialogMixin.preferNative === undefined) {
19
20
  window.D2L.DialogMixin.preferNative = true;
20
21
  }
@@ -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.6",
3
+ "version": "2.14.9",
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",