@brightspace-ui/core 2.177.0 → 2.177.2

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.
@@ -29,7 +29,7 @@ export function getShiftedEndDate(startValue, endValue, prevStartValue, inclusiv
29
29
 
30
30
  /**
31
31
  * A component consisting of two input-date components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's timezone if applicable and must be in ISO 8601 calendar date format ("YYYY-MM-DD").
32
- * @slot inline-help - Inline help text content.
32
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
33
33
  * @fires change - Dispatched when there is a change to selected start date or selected end date. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 calendar date format (`YYYY-MM-DD`).
34
34
  */
35
35
  class InputDateRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement))))) {
@@ -62,7 +62,7 @@ export function getShiftedEndDateTime(startValue, endValue, prevStartValue, incl
62
62
  * A component consisting of two input-date-time components - one for start of range and one for end of range. The time input only appears once a date is selected.
63
63
  * @slot start - Optional content that would appear below the start input-date-time
64
64
  * @slot end - Optional content that would appear below the end input-date-time
65
- * @slot inline-help - Inline help text content.
65
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
66
66
  * @fires change - Dispatched when there is a change to selected start date-time or selected end date-time. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`).
67
67
  */
68
68
  class InputDateTimeRange extends FocusMixin(SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement))))) {
@@ -39,7 +39,7 @@ function _getFormattedDefaultTime(defaultValue) {
39
39
 
40
40
  /**
41
41
  * A component that consists of a "<d2l-input-date>" and a "<d2l-input-time>" component. The time input only appears once a date is selected. This component displays the "value" if one is specified, and reflects the selected value when one is selected or entered.
42
- * @slot inline-help - Inline help text content.
42
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
43
43
  * @fires change - Dispatched when there is a change to selected date or selected time. `value` corresponds to the selected value and is formatted in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`).
44
44
  */
45
45
  class InputDateTime extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(RtlMixin(LitElement)))))) {
@@ -26,7 +26,7 @@ export function formatISODateInUserCalDescriptor(val) {
26
26
 
27
27
  /**
28
28
  * A component that consists of a text input field for typing a date and an attached calendar (d2l-calendar) dropdown. It displays the "value" if one is specified, or a placeholder if not, and reflects the selected value when one is selected in the calendar or entered in the text input.
29
- * @slot inline-help - Inline help text content.
29
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
30
30
  * @fires change - Dispatched when there is a change to selected date. `value` corresponds to the selected value and is formatted in ISO 8601 calendar date format (`YYYY-MM-DD`).
31
31
  */
32
32
  class InputDate extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement))))) {
@@ -73,7 +73,7 @@ function roundPrecisely(val, maxFractionDigits) {
73
73
  * @slot after - Slot beside the input on the right side. Useful for an "icon" or "button-icon".
74
74
  * @slot left - Slot within the input on the left side. Useful for an "icon" or "button-icon".
75
75
  * @slot right - Slot within the input on the right side. Useful for an "icon" or "button-icon".
76
- * @slot inline-help - Inline help text content.
76
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
77
77
  * @fires change - Dispatched when an alteration to the value is committed (typically after focus is lost) by the user. The `value` attribute reflects a JavaScript Number which is parsed from the formatted input value.
78
78
  */
79
79
  class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement))))) {
@@ -11,7 +11,7 @@ import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
11
11
  /**
12
12
  * This component wraps the "<d2l-input-number>" tag and is intended for inputting percent values.
13
13
  * @slot after - Slot beside the input on the right side. Useful for an "icon" or "button-icon".
14
- * @slot inline-help - Inline help text content.
14
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
15
15
  * @fires change - Dispatched when an alteration to the value is committed (typically after focus is lost) by the user. The `value` attribute reflects a JavaScript Number which is parsed from the formatted input value.
16
16
  */
17
17
  class InputPercent extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(RtlMixin(LitElement)))))) {
@@ -13,7 +13,7 @@ export const SUPPRESS_ENTER_TIMEOUT_MS = 1000;
13
13
 
14
14
  /**
15
15
  * This component wraps the native "<input type="search">"" element and is for text searching.
16
- * @slot inline-help - Inline help text content.
16
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
17
17
  * @fires d2l-input-search-searched - Dispatched when a search is performed. When the input is cleared, this will be fired with an empty value.
18
18
  */
19
19
  class InputSearch extends FocusMixin(LocalizeCoreElement(RtlMixin(LitElement))) {
@@ -36,7 +36,7 @@ function getValidISOTimeAtInterval(val, timeInterval) {
36
36
 
37
37
  /**
38
38
  * A component consisting of two input-time components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's timezone if applicable and must be in ISO 8601 time format ("hh:mm:ss").
39
- * @slot inline-help - Inline help text content.
39
+ * @slot inline-help - Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
40
40
  * @fires change - Dispatched when there is a change to selected start time or selected end time. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 calendar time format (`hh:mm:ss`).
41
41
  */
42
42
 
@@ -19,6 +19,7 @@ class ListDemoNested extends LitElement {
19
19
 
20
20
  static get properties() {
21
21
  return {
22
+ addButton: { type: Boolean, attribute: 'add-button' },
22
23
  demoItemKey: { type: String, attribute: 'demo-item-key' },
23
24
  isDraggable: { attribute: 'is-draggable', type: Boolean },
24
25
  selectable: { type: Boolean },
@@ -169,7 +170,11 @@ class ListDemoNested extends LitElement {
169
170
 
170
171
  _renderList(items, nested, includeControls = false, showLoadMore = false) {
171
172
  return html`
172
- <d2l-list ?grid="${!this.disableListGrid}" drag-multiple slot="${ifDefined(nested ? 'nested' : undefined)}" item-count="${this._items.length}">
173
+ <d2l-list
174
+ ?grid="${!this.disableListGrid}"
175
+ drag-multiple slot="${ifDefined(nested ? 'nested' : undefined)}"
176
+ item-count="${this._items.length}"
177
+ ?add-button="${this.addButton}">
173
178
  ${ includeControls ? this._renderListControls() : nothing }
174
179
  ${repeat(items, item => item.key, item => html`
175
180
  ${this._renderListItem(item)}
@@ -38,6 +38,14 @@
38
38
  </template>
39
39
  </d2l-demo-snippet>
40
40
 
41
+ <h2>Add Button</h2>
42
+
43
+ <d2l-demo-snippet>
44
+ <template>
45
+ <d2l-demo-list-nested add-button demo-item-key="imgPrimaryAndSupporting" is-draggable selectable></d2l-demo-list-nested>
46
+ </template>
47
+ </d2l-demo-snippet>
48
+
41
49
 
42
50
  </d2l-demo-page>
43
51
 
@@ -18,6 +18,7 @@
18
18
  <template>
19
19
  <d2l-demo-list-nested
20
20
  demo-item-key="imgPrimaryAndSupporting"
21
+ add-button
21
22
  is-draggable
22
23
  selectable
23
24
  expandable
@@ -45,6 +46,7 @@
45
46
  <template>
46
47
  <d2l-demo-list-nested
47
48
  demo-item-key="imgPrimaryAndSupporting"
49
+ add-button
48
50
  is-draggable
49
51
  selectable
50
52
  expandable
@@ -131,7 +131,7 @@
131
131
  <div>Earth Sciences (L1)</div>
132
132
  <div slot="supporting-info">Earth science or geoscience includes all fields of natural science related to planet Earth. This is a branch of science dealing with the physical and chemical constitution of Earth and its atmosphere. Earth science can be considered to be a branch of planetary science, but with a much older history.</div>
133
133
  </d2l-list-item-content>
134
- <d2l-list slot="nested" grid separators="all">
134
+ <d2l-list add-button slot="nested" grid separators="all">
135
135
  <d2l-list-item selectable key="L2-1" label="Label for L2-1">
136
136
  <d2l-list-item-content>
137
137
  <div>Introductory Earth Sciences (L2)</div>
@@ -153,8 +153,8 @@ export const ListItemMixin = superclass => class extends composeMixins(
153
153
  :host([_focusing-primary-action]) [slot="control-container"]::after,
154
154
  :host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::before,
155
155
  :host([selected]:not([selection-disabled]):not([skeleton])) [slot="control-container"]::after,
156
- :host([_show-add-button]) [slot="control-container"]::after,
157
156
  :host([_show-add-button]) [slot="control-container"]::before,
157
+ :host([_show-add-button]) [slot="control-container"]::after,
158
158
  :host(:first-of-type[_nested]) [slot="control-container"]::before {
159
159
  border-top-color: transparent;
160
160
  }
@@ -413,7 +413,9 @@ export const ListItemMixin = superclass => class extends composeMixins(
413
413
  margin-top: -11.5px;
414
414
  }
415
415
  :host([draggable][selectable][_hovering]) [slot="add"],
416
- :host([draggable][selectable][_focusing]) [slot="add"] {
416
+ :host([draggable][selectable][_focusing]) [slot="add"],
417
+ :host([draggable][selectable][_hovering]) [slot="add-top"],
418
+ :host([draggable][selectable][_focusing]) [slot="add-top"] {
417
419
  padding-inline-end: 6px;
418
420
  }
419
421
  .dragging [slot="add"] {
@@ -719,7 +721,7 @@ export const ListItemMixin = superclass => class extends composeMixins(
719
721
  class="d2l-list-item-actions-container">
720
722
  <slot name="actions" class="d2l-list-item-actions">${actions}</slot>
721
723
  </div>
722
- ${this._showAddButton && !this._hasNestedListAddButton ? html`
724
+ ${this._showAddButton && (!this._hasNestedListAddButton || (this.expandable && !this.expanded)) ? html`
723
725
  <div slot="add">
724
726
  <d2l-button-add text="${addButtonText}" mode="icon-when-interacted" @click="${this._handleButtonAddClick}"></d2l-button-add>
725
727
  </div>
@@ -5276,7 +5276,7 @@
5276
5276
  "slots": [
5277
5277
  {
5278
5278
  "name": "inline-help",
5279
- "description": "Inline help text content."
5279
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
5280
5280
  }
5281
5281
  ]
5282
5282
  },
@@ -5591,7 +5591,7 @@
5591
5591
  },
5592
5592
  {
5593
5593
  "name": "inline-help",
5594
- "description": "Inline help text content."
5594
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
5595
5595
  }
5596
5596
  ]
5597
5597
  },
@@ -5776,7 +5776,7 @@
5776
5776
  "slots": [
5777
5777
  {
5778
5778
  "name": "inline-help",
5779
- "description": "Inline help text content."
5779
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
5780
5780
  }
5781
5781
  ]
5782
5782
  },
@@ -5950,7 +5950,7 @@
5950
5950
  "slots": [
5951
5951
  {
5952
5952
  "name": "inline-help",
5953
- "description": "Inline help text content."
5953
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
5954
5954
  }
5955
5955
  ]
5956
5956
  },
@@ -6313,7 +6313,7 @@
6313
6313
  },
6314
6314
  {
6315
6315
  "name": "inline-help",
6316
- "description": "Inline help text content."
6316
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
6317
6317
  }
6318
6318
  ]
6319
6319
  },
@@ -6490,7 +6490,7 @@
6490
6490
  },
6491
6491
  {
6492
6492
  "name": "inline-help",
6493
- "description": "Inline help text content."
6493
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
6494
6494
  }
6495
6495
  ]
6496
6496
  },
@@ -6626,7 +6626,7 @@
6626
6626
  "slots": [
6627
6627
  {
6628
6628
  "name": "inline-help",
6629
- "description": "Inline help text content."
6629
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
6630
6630
  }
6631
6631
  ]
6632
6632
  },
@@ -7471,7 +7471,7 @@
7471
7471
  "slots": [
7472
7472
  {
7473
7473
  "name": "inline-help",
7474
- "description": "Inline help text content."
7474
+ "description": "Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label."
7475
7475
  }
7476
7476
  ]
7477
7477
  },
@@ -7785,6 +7785,10 @@
7785
7785
  "name": "d2l-demo-list-nested",
7786
7786
  "path": "./components/list/demo/demo-list-nested.js",
7787
7787
  "attributes": [
7788
+ {
7789
+ "name": "add-button",
7790
+ "type": "boolean"
7791
+ },
7788
7792
  {
7789
7793
  "name": "demo-item-key",
7790
7794
  "type": "string"
@@ -7835,6 +7839,11 @@
7835
7839
  }
7836
7840
  ],
7837
7841
  "properties": [
7842
+ {
7843
+ "name": "addButton",
7844
+ "attribute": "add-button",
7845
+ "type": "boolean"
7846
+ },
7838
7847
  {
7839
7848
  "name": "demoItemKey",
7840
7849
  "attribute": "demo-item-key",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.177.0",
3
+ "version": "2.177.2",
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",