@brightspace-ui/core 3.209.1 → 3.210.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.
@@ -60,6 +60,7 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
60
60
  attribute: 'opener-type'
61
61
  },
62
62
  _chompIndex: { state: true },
63
+ _itemGap: { state: true },
63
64
  _mini: { state: true },
64
65
  _wrapping: { state: true }
65
66
  };
@@ -74,6 +75,7 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
74
75
  display: none;
75
76
  }
76
77
  .d2l-overflow-group-container {
78
+ align-items: var(--d2l-overflow-group-align-items, normal);
77
79
  display: flex;
78
80
  justify-content: var(--d2l-overflow-group-justify-content, normal);
79
81
  }
@@ -106,6 +108,7 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
106
108
 
107
109
  this._firstChompCompleteResolve = undefined;
108
110
  this._firstChompCompletePromise = new Promise(resolve => this._firstChompCompleteResolve = resolve);
111
+ this._itemGap = 0;
109
112
  }
110
113
 
111
114
  disconnectedCallback() {
@@ -132,6 +135,7 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
132
135
  });
133
136
 
134
137
  const containerStyles = {
138
+ columnGap: this._itemGap > 0 ? `${this._itemGap}px` : undefined,
135
139
  flexWrap: this._wrapping ? 'wrap' : 'nowrap',
136
140
  minHeight: this.autoShow ? 'auto' : (this._itemHeight ? `${this._itemHeight}px` : 'auto'),
137
141
  maxHeight: this.autoShow ? 'none' : (this._itemHeight ? `${this._itemHeight}px` : 'auto')
@@ -213,9 +217,9 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
213
217
  this._overflowContainer = this.shadowRoot.querySelector(`.${OVERFLOW_CLASS}`);
214
218
  this._overflowContainerMini = this.shadowRoot.querySelector(`.${OVERFLOW_MINI_CLASS}`);
215
219
  if (this.openerType === OPENER_TYPE.ICON && this._overflowContainerMini) {
216
- this._overflowContainerWidth = this._overflowContainerMini.offsetWidth;
220
+ this._overflowContainerWidth = this._overflowContainerMini.offsetWidth + this._itemGap;
217
221
  } else if (this._overflowContainer) {
218
- this._overflowContainerWidth = this._overflowContainer.offsetWidth;
222
+ this._overflowContainerWidth = this._overflowContainer.offsetWidth + this._itemGap;
219
223
  }
220
224
 
221
225
  const showing = {
@@ -223,13 +227,15 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
223
227
  width: 0
224
228
  };
225
229
 
226
- let isSoftOverflowing, isForcedOverflowing;
230
+ let isSoftOverflowing = false;
231
+ let isForcedOverflowing = false;
227
232
  for (let i = 0; i < this._itemLayouts.length; i++) {
228
233
  const itemLayout = this._itemLayouts[i];
234
+ const gap = showing.count > 0 ? this._itemGap : 0;
229
235
 
230
236
  // handle minimum items to show
231
237
  if (showing.count < this.minToShow) {
232
- showing.width += itemLayout.width;
238
+ showing.width += itemLayout.width + gap;
233
239
  showing.count += 1;
234
240
  itemLayout.trigger = 'force-show';
235
241
  itemLayout.isChomped = false;
@@ -245,8 +251,8 @@ export const OverflowGroupMixin = superclass => class extends LocalizeCoreElemen
245
251
  }
246
252
 
247
253
  // chomp or unchomp based on space available, and we've already handled min/max above
248
- if (!isSoftOverflowing && showing.width + itemLayout.width < this._availableWidth) {
249
- showing.width += itemLayout.width;
254
+ if (!isSoftOverflowing && showing.width + itemLayout.width + gap < this._availableWidth) {
255
+ showing.width += itemLayout.width + gap;
250
256
  showing.count += 1;
251
257
  itemLayout.isChomped = false;
252
258
  itemLayout.trigger = 'soft-show';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.209.1",
3
+ "version": "3.210.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",