@brightspace-ui/core 1.197.0 → 1.197.4

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.
Files changed (73) hide show
  1. package/components/dropdown/README.md +4 -0
  2. package/components/dropdown/demo/dropdown-button.html +30 -0
  3. package/components/dropdown/dropdown-content-styles.js +13 -0
  4. package/components/dropdown/dropdown-opener-mixin.js +235 -24
  5. package/components/filter/README.md +15 -6
  6. package/components/filter/filter-dimension-set-value.js +3 -0
  7. package/components/filter/filter-dimension-set.js +5 -1
  8. package/components/filter/screenshots/filter-mobile.png +0 -0
  9. package/components/filter/screenshots/filter-multi-dim.png +0 -0
  10. package/components/filter/screenshots/filter.png +0 -0
  11. package/components/form/form-mixin.js +1 -0
  12. package/components/form/form-native.js +0 -1
  13. package/components/form/form.js +0 -1
  14. package/components/html-block/html-block.js +8 -0
  15. package/components/inputs/docs/input-date-time.md +7 -7
  16. package/components/inputs/input-date-range.js +9 -1
  17. package/components/inputs/input-date-time-range-to.js +3 -0
  18. package/components/inputs/input-date-time-range.js +10 -1
  19. package/components/inputs/input-date-time.js +7 -1
  20. package/components/inputs/input-date.js +7 -1
  21. package/components/inputs/input-fieldset.js +3 -0
  22. package/components/inputs/input-time-range.js +10 -1
  23. package/components/inputs/input-time.js +6 -1
  24. package/components/link/README.md +1 -1
  25. package/components/list/README.md +10 -10
  26. package/components/list/list-item-button-mixin.js +1 -0
  27. package/components/list/list-item-button.js +0 -3
  28. package/components/list/list-item-checkbox-mixin.js +1 -0
  29. package/components/list/list-item-drag-drop-mixin.js +2 -0
  30. package/components/list/list-item-link-mixin.js +1 -0
  31. package/components/list/list-item.js +0 -3
  32. package/components/list/list.js +2 -0
  33. package/components/menu/menu-item-checkbox.js +0 -4
  34. package/components/menu/menu-item-link.js +0 -2
  35. package/components/menu/menu-item-mixin.js +3 -0
  36. package/components/menu/menu-item-radio.js +0 -3
  37. package/components/menu/menu-item-selectable-mixin.js +2 -0
  38. package/components/menu/menu-item.js +0 -2
  39. package/components/overflow-group/overflow-group.js +4 -3
  40. package/components/scroll-wrapper/scroll-wrapper.js +1 -2
  41. package/components/selection/selection-action.js +4 -0
  42. package/components/selection/selection-input.js +5 -0
  43. package/components/selection/selection-mixin.js +2 -1
  44. package/components/selection/selection-observer-mixin.js +3 -1
  45. package/components/selection/selection-select-all.js +2 -0
  46. package/components/selection/selection-summary.js +3 -1
  47. package/components/skeleton/skeleton-mixin.js +1 -0
  48. package/components/status-indicator/status-indicator.js +2 -0
  49. package/components/switch/switch-visibility.js +3 -0
  50. package/components/switch/switch.js +3 -0
  51. package/components/table/table-col-sort-button.js +0 -2
  52. package/components/table/table-wrapper.js +0 -2
  53. package/components/tabs/tab-panel-mixin.js +2 -0
  54. package/components/tabs/tab-panel.js +0 -2
  55. package/custom-elements.json +118 -48
  56. package/lang/ar.js +7 -7
  57. package/lang/cy.js +7 -7
  58. package/lang/da.js +7 -7
  59. package/lang/de.js +7 -7
  60. package/lang/es-es.js +7 -7
  61. package/lang/es.js +8 -8
  62. package/lang/fr-fr.js +8 -8
  63. package/lang/fr.js +7 -7
  64. package/lang/ja.js +8 -8
  65. package/lang/ko.js +7 -7
  66. package/lang/nl.js +8 -8
  67. package/lang/pt.js +7 -7
  68. package/lang/sv.js +7 -7
  69. package/lang/tr.js +7 -7
  70. package/lang/zh-tw.js +7 -7
  71. package/lang/zh.js +8 -8
  72. package/package.json +1 -1
  73. package/templates/primary-secondary/primary-secondary.js +2 -0
@@ -111,9 +111,7 @@ function convertToDropdownItem(node) {
111
111
  }
112
112
  /**
113
113
  *
114
- * A component that can be used to display a set of buttons, links or menus that will be put into a
115
- * dropdown menu when they no longer fit on the first line of their container
116
- *
114
+ * A component that can be used to display a set of buttons, links or menus that will be put into a dropdown menu when they no longer fit on the first line of their container
117
115
  * @slot - Buttons, dropdown buttons, links or other items to be added to the container
118
116
  * @fires d2l-overflow-group-updated - Dispatched when there is an update performed to the overflow group
119
117
  */
@@ -123,6 +121,7 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
123
121
  return {
124
122
  /**
125
123
  * Use predefined classes on slot elements to set min and max buttons to show
124
+ * @type {boolean}
126
125
  */
127
126
  autoShow: {
128
127
  type: Boolean,
@@ -130,6 +129,7 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
130
129
  },
131
130
  /**
132
131
  * minimum amount of buttons to show
132
+ * @type {number}
133
133
  */
134
134
  minToShow: {
135
135
  type: Number,
@@ -138,6 +138,7 @@ class OverflowGroup extends RtlMixin(LocalizeCoreElement(LitElement)) {
138
138
  },
139
139
  /**
140
140
  * maximum amount of buttons to show
141
+ * @type {number}
141
142
  */
142
143
  maxToShow: {
143
144
  type: Number,
@@ -12,7 +12,6 @@ const SCROLL_AMOUNT = 0.8;
12
12
  /**
13
13
  *
14
14
  * Wraps content which may overflow its horizontal boundaries, providing left/right scroll buttons.
15
- *
16
15
  * @slot - User provided content to wrap
17
16
  */
18
17
  class ScrollWrapper extends FocusVisiblePolyfillMixin(RtlMixin(LitElement)) {
@@ -54,7 +53,7 @@ class ScrollWrapper extends FocusVisiblePolyfillMixin(RtlMixin(LitElement)) {
54
53
  :host([hidden]) {
55
54
  display: none;
56
55
  }
57
-
56
+
58
57
  .d2l-scroll-wrapper-container {
59
58
  box-sizing: border-box;
60
59
  outline: none;
@@ -12,6 +12,7 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
12
12
  /**
13
13
  * An action associated with a selection component.
14
14
  * @fires d2l-selection-action-click - Dispatched when the user clicks the action; provides the selection info
15
+ * @fires d2l-selection-observer-subscribe - Internal event
15
16
  */
16
17
  class Action extends LocalizeCoreElement(SelectionObserverMixin(ButtonMixin(RtlMixin(LitElement)))) {
17
18
 
@@ -19,14 +20,17 @@ class Action extends LocalizeCoreElement(SelectionObserverMixin(ButtonMixin(RtlM
19
20
  return {
20
21
  /**
21
22
  * Preset icon key (e.g. "tier1:gear")
23
+ * @type {string}
22
24
  */
23
25
  icon: { type: String, reflect: true },
24
26
  /**
25
27
  * Whether the action requires one or more selected items
28
+ * @type {boolean}
26
29
  */
27
30
  requiresSelection: { type: Boolean, attribute: 'requires-selection', reflect: true },
28
31
  /**
29
32
  * REQUIRED: The text for the action
33
+ * @type {string}
30
34
  */
31
35
  text: { type: String, reflect: true }
32
36
  };
@@ -13,6 +13,7 @@ const keyCodes = {
13
13
  /**
14
14
  * An input (radio or checkbox) for use in selection components such as lists and tables.
15
15
  * @fires d2l-selection-change - Dispatched when the selected state changes
16
+ * @fires d2l-selection-input-subscribe - Internal event
16
17
  */
17
18
  class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
18
19
 
@@ -20,18 +21,22 @@ class Input extends SkeletonMixin(LabelledMixin(LitElement)) {
20
21
  return {
21
22
  /**
22
23
  * State of the input
24
+ * @type {boolean}
23
25
  */
24
26
  selected: { type: Boolean },
25
27
  /**
26
28
  * Disables the input
29
+ * @type {boolean}
27
30
  */
28
31
  disabled: { type: Boolean },
29
32
  /**
30
33
  * Private. Force hovering state of input
34
+ * @type {boolean}
31
35
  */
32
36
  hovering: { type: Boolean },
33
37
  /**
34
38
  * Key for the selectable
39
+ * @type {string}
35
40
  */
36
41
  key: { type: String },
37
42
  _indeterminate: { type: Boolean },
@@ -39,7 +39,8 @@ export const SelectionMixin = superclass => class extends RtlMixin(superclass) {
39
39
  static get properties() {
40
40
  return {
41
41
  /**
42
- * Whether the selection control is limited to single selection.
42
+ * Whether the selection control is limited to single selection
43
+ * @type {boolean}
43
44
  */
44
45
  selectionSingle: { type: Boolean, attribute: 'selection-single' }
45
46
  };
@@ -7,10 +7,12 @@ export const SelectionObserverMixin = superclass => class extends superclass {
7
7
  return {
8
8
  /**
9
9
  * Id of the SelectionMixin component this component wants to observe (if not located within that component)
10
+ * @type {string}
10
11
  */
11
12
  selectionFor: { type: String, reflect: true, attribute: 'selection-for' },
12
13
  /**
13
- * The selection info (set by the selection component).
14
+ * The selection info (set by the selection component)
15
+ * @type {object}
14
16
  */
15
17
  selectionInfo: { type: Object },
16
18
  _provider: { type: Object, attribute: false }
@@ -7,6 +7,7 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
7
7
 
8
8
  /**
9
9
  * A checkbox that provides select-all behavior for selection components such as tables and lists.
10
+ * @fires d2l-selection-observer-subscribe - Internal event
10
11
  */
11
12
  class SelectAll extends LocalizeCoreElement(SelectionObserverMixin(LitElement)) {
12
13
 
@@ -14,6 +15,7 @@ class SelectAll extends LocalizeCoreElement(SelectionObserverMixin(LitElement))
14
15
  return {
15
16
  /**
16
17
  * Disables the select all checkbox
18
+ * @type {boolean}
17
19
  */
18
20
  disabled: { type: Boolean }
19
21
  };
@@ -6,13 +6,15 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
6
6
 
7
7
  /**
8
8
  * A summary showing the current selected count.
9
+ * @fires d2l-selection-observer-subscribe - Internal event
9
10
  */
10
11
  class Summary extends LocalizeCoreElement(SelectionObserverMixin(LitElement)) {
11
12
 
12
13
  static get properties() {
13
14
  return {
14
15
  /**
15
- * Text to display if no items are selected.
16
+ * Text to display if no items are selected
17
+ * @type {string}
16
18
  */
17
19
  noSelectionText: { type: String, attribute: 'no-selection-text' }
18
20
  };
@@ -148,6 +148,7 @@ export const SkeletonMixin = dedupeMixin(superclass => class extends RtlMixin(su
148
148
  return {
149
149
  /**
150
150
  * Renders the input as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton)
151
+ * @type {boolean}
151
152
  */
152
153
  skeleton: { reflect: true, type: Boolean }
153
154
  };
@@ -18,12 +18,14 @@ class StatusIndicator extends LitElement {
18
18
  },
19
19
  /**
20
20
  * REQUIRED: The text that is displayed within the status indicator
21
+ * @type {string}
21
22
  */
22
23
  text: {
23
24
  type: String
24
25
  },
25
26
  /**
26
27
  * Use when the status is very important and needs to have a lot of prominence
28
+ * @type {boolean}
27
29
  */
28
30
  bold: {
29
31
  type: Boolean,
@@ -3,6 +3,9 @@ import { html, LitElement } from 'lit-element/lit-element.js';
3
3
  import { LocalizeCoreElement } from '../../lang/localize-core-element.js';
4
4
  import { SwitchMixin } from './switch-mixin.js';
5
5
 
6
+ /**
7
+ * A variant of the generic switch configured with special icons and default text for toggling "visibility".
8
+ */
6
9
  class VisibilitySwitch extends LocalizeCoreElement(SwitchMixin(LitElement)) {
7
10
 
8
11
  get text() {
@@ -4,6 +4,9 @@ import '../icons/icon-custom.js';
4
4
  import { html, LitElement } from 'lit-element/lit-element.js';
5
5
  import { SwitchMixin } from './switch-mixin.js';
6
6
 
7
+ /**
8
+ * A generic switch with on/off semantics.
9
+ */
7
10
  class Switch extends SwitchMixin(LitElement) {
8
11
 
9
12
  get offIcon() {
@@ -2,9 +2,7 @@ import '../icons/icon.js';
2
2
  import { css, html, LitElement } from 'lit-element/lit-element.js';
3
3
 
4
4
  /**
5
- *
6
5
  * Button for sorting a table column in ascending/descending order.
7
- *
8
6
  * @slot - Text of the sort button
9
7
  */
10
8
  export class TableColSortButton extends LitElement {
@@ -164,9 +164,7 @@ export const tableStyles = css`
164
164
  `;
165
165
 
166
166
  /**
167
- *
168
167
  * Wraps a native <table> element, providing styling and scroll buttons for overflow.
169
- *
170
168
  * @slot - Content to wrap
171
169
  */
172
170
  export class TableWrapper extends RtlMixin(LitElement) {
@@ -55,6 +55,7 @@ export const TabPanelMixin = superclass => class extends superclass {
55
55
  super.attributeChangedCallback(name, oldval, newval);
56
56
  if (name === 'text') {
57
57
  this.setAttribute('aria-label', this.text);
58
+ /** Dispatched when the text attribute is changed */
58
59
  this.dispatchEvent(new CustomEvent(
59
60
  'd2l-tab-panel-text-changed', { bubbles: true, composed: true, detail: { text: this.text } }
60
61
  ));
@@ -73,6 +74,7 @@ export const TabPanelMixin = superclass => class extends superclass {
73
74
  if (prop === 'selected') {
74
75
  if (this.selected) {
75
76
  requestAnimationFrame(() => {
77
+ /** Dispatched when a tab is selected */
76
78
  this.dispatchEvent(new CustomEvent(
77
79
  'd2l-tab-panel-selected', { bubbles: true, composed: true }
78
80
  ));
@@ -4,8 +4,6 @@ import { TabPanelMixin } from './tab-panel-mixin.js';
4
4
  /**
5
5
  * A component for tab panel content.
6
6
  * @slot - Default content in tab panel
7
- * @fires d2l-tab-panel-text-changed - Dispatched when the text attribute is changed
8
- * @fires d2l-tab-panel-selected - Dispatched when a tab is selected
9
7
  */
10
8
  class TabPanel extends TabPanelMixin(LitElement) {
11
9