@brightspace-ui/core 3.95.0 → 3.96.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.
@@ -76,7 +76,7 @@ The `d2l-button-subtle` element can be used just like the native `button`, but f
76
76
  | `description` | String | A description to be added to the `button` for accessibility for additional context |
77
77
  | `disabled` | Boolean | Disables the button |
78
78
  | `disabledTooltip` | String | Tooltip text when disabled |
79
- | `h-align` | String | Possible values are undefined (default) or `text`. If `text`, aligns the button content to the leading edge of text. |
79
+ | `h-align` | String | Possible values are undefined (default), `text` or `text-end`. If `text` or `text-end`, aligns the button content to the leading (or trailing) edge of text. |
80
80
  | `icon` | String | [Preset icon key](../../components/icons#preset-icons) (e.g. `tier1:gear`) |
81
81
  | `icon-right` | Boolean | Render the icon on the right of the button |
82
82
  <!-- docs: end hidden content -->
@@ -121,7 +121,7 @@ The `d2l-button-icon` element can be used just like the native `button`, for ins
121
121
  | `text` | String, required | Accessible text for the button |
122
122
  | `disabled` | Boolean | Disables the button |
123
123
  | `disabledTooltip` | String | Tooltip text when disabled |
124
- | `h-align` | String | Possible values are undefined (default) or `text`. If `text`, aligns the button content to the leading edge of text. |
124
+ | `h-align` | String | Possible values are undefined (default), `text` or `text-end`. If `text` or `text-end`, aligns the button content to the leading (or trailing) edge of text. |
125
125
  | `translucent` | Boolean | Indicates to display translucent (ex. on rich backgrounds) |
126
126
  <!-- docs: end hidden content -->
127
127
 
@@ -9,14 +9,13 @@ import { getFocusPseudoClass } from '../../helpers/focus.js';
9
9
  import { getUniqueId } from '../../helpers/uniqueId.js';
10
10
  import { ifDefined } from 'lit/directives/if-defined.js';
11
11
  import { PropertyRequiredMixin } from '../../mixins/property-required/property-required-mixin.js';
12
- import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
13
12
  import { ThemeMixin } from '../../mixins/theme/theme-mixin.js';
14
13
 
15
14
  /**
16
15
  * A button component that can be used just like the native button for instances where only an icon is displayed.
17
16
  * @slot icon - Optional slot for a custom icon
18
17
  */
19
- class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(RtlMixin(LitElement))))) {
18
+ class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnAncestorMixin(LitElement)))) {
20
19
 
21
20
  static get properties() {
22
21
  return {
@@ -27,8 +26,8 @@ class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnA
27
26
  description: { type: String },
28
27
 
29
28
  /**
30
- * Aligns the leading edge of text if value is set to "text"
31
- * @type {'text'|''}
29
+ * Aligns the leading edge of text if value is set to "text" for left-aligned layouts, the trailing edge of text if value is set to "text-end" for right-aligned layouts
30
+ * @type {'text'|'text-end'|''}
32
31
  */
33
32
  hAlign: { type: String, reflect: true, attribute: 'h-align' },
34
33
 
@@ -103,11 +102,10 @@ class ButtonIcon extends PropertyRequiredMixin(ThemeMixin(ButtonMixin(VisibleOnA
103
102
  }
104
103
 
105
104
  :host([h-align="text"]) button {
106
- left: var(--d2l-button-icon-h-align);
105
+ inset-inline-start: var(--d2l-button-icon-h-align);
107
106
  }
108
- :host([dir="rtl"][h-align="text"]) button {
109
- left: 0;
110
- right: var(--d2l-button-icon-h-align);
107
+ :host([h-align="text-end"]) button {
108
+ inset-inline-end: var(--d2l-button-icon-h-align);
111
109
  }
112
110
 
113
111
  /* Firefox includes a hidden border which messes up button dimensions */
@@ -24,8 +24,8 @@ class ButtonSubtle extends ButtonMixin(LitElement) {
24
24
  description: { type: String },
25
25
 
26
26
  /**
27
- * Aligns the leading edge of text if value is set to "text"
28
- * @type {'text'|''}
27
+ * Aligns the leading edge of text if value is set to "text" for left-aligned layouts, the trailing edge of text if value is set to "text-end" for right-aligned layouts
28
+ * @type {'text'|'text-end'|''}
29
29
  */
30
30
  hAlign: { type: String, reflect: true, attribute: 'h-align' },
31
31
 
@@ -101,6 +101,9 @@ class ButtonSubtle extends ButtonMixin(LitElement) {
101
101
  :host([h-align="text"]) button {
102
102
  inset-inline-start: calc(var(--d2l-button-subtle-padding-inline-start) * -1);
103
103
  }
104
+ :host([h-align="text-end"]) button {
105
+ inset-inline-end: calc(var(--d2l-button-subtle-padding-inline-end) * -1);
106
+ }
104
107
 
105
108
  /* Firefox includes a hidden border which messes up button dimensions */
106
109
  button::-moz-focus-inner {
@@ -102,9 +102,16 @@
102
102
 
103
103
  <d2l-demo-snippet>
104
104
  <template>
105
- <d2l-button-icon icon="tier1:gear" text="Button Edge Aligned (default)"></d2l-button-icon>
106
- <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
107
- <d2l-button-icon icon="tier1:gear" text="Button Content Aligned" h-align="text"></d2l-button-icon>
105
+ <div style="border: 1px dashed #999999; text-align: start;">
106
+ <d2l-button-icon icon="tier1:gear" text="Button Edge Aligned (default)"></d2l-button-icon>
107
+ <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
108
+ <d2l-button-icon icon="tier1:gear" text="Button Content Aligned" h-align="text"></d2l-button-icon>
109
+ </div>
110
+ <div style="border: 1px dashed #999999; text-align: end;">
111
+ <d2l-button-icon icon="tier1:gear" text="Button Edge Aligned (default)"></d2l-button-icon>
112
+ <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
113
+ <d2l-button-icon icon="tier1:gear" text="Button Content Aligned" h-align="text-end"></d2l-button-icon>
114
+ </div>
108
115
  </template>
109
116
  </d2l-demo-snippet>
110
117
 
@@ -62,15 +62,28 @@
62
62
 
63
63
  <d2l-demo-snippet>
64
64
  <template>
65
- <d2l-button-subtle icon="tier1:gear" text="Button Edge Aligned (default)"></d2l-button-subtle>
66
- <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
67
- <d2l-button-subtle icon="tier1:gear" text="Button Content Aligned" h-align="text"></d2l-button-subtle>
68
- <br>
69
- <d2l-button-subtle slim icon="tier1:gear" text="Slim Button Content Aligned" h-align="text"></d2l-button-subtle>
70
- <br>
71
- <d2l-button-subtle icon="tier1:chevron-down" text="Subtle Button" icon-right h-align="text"></d2l-button-subtle>
72
- <br>
73
- <d2l-button-subtle slim icon="tier1:chevron-down" text="Slim Subtle Button" icon-right h-align="text"></d2l-button-subtle>
65
+ <div style="border: 1px dashed #999999; text-align: start;">
66
+ <d2l-button-subtle icon="tier1:gear" text="Button Edge Aligned (default)"></d2l-button-subtle>
67
+ <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
68
+ <d2l-button-subtle icon="tier1:gear" text="Button Content Aligned" h-align="text"></d2l-button-subtle>
69
+ <br>
70
+ <d2l-button-subtle slim icon="tier1:gear" text="Slim Button Content Aligned" h-align="text"></d2l-button-subtle>
71
+ <br>
72
+ <d2l-button-subtle icon="tier1:chevron-down" text="Subtle Button" icon-right h-align="text"></d2l-button-subtle>
73
+ <br>
74
+ <d2l-button-subtle slim icon="tier1:chevron-down" text="Slim Subtle Button" icon-right h-align="text"></d2l-button-subtle>
75
+ </div>
76
+ <div style="border: 1px dashed #999999; text-align: end;">
77
+ <d2l-button-subtle icon="tier1:gear" text="Button Edge Aligned (default)"></d2l-button-subtle>
78
+ <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
79
+ <d2l-button-subtle icon="tier1:gear" text="Button Content Aligned" h-align="text-end"></d2l-button-subtle>
80
+ <br>
81
+ <d2l-button-subtle slim icon="tier1:gear" text="Slim Button Content Aligned" h-align="text-end"></d2l-button-subtle>
82
+ <br>
83
+ <d2l-button-subtle icon="tier1:chevron-down" text="Subtle Button" icon-right h-align="text-end"></d2l-button-subtle>
84
+ <br>
85
+ <d2l-button-subtle slim icon="tier1:chevron-down" text="Slim Subtle Button" icon-right h-align="text-end"></d2l-button-subtle>
86
+ </div>
74
87
  </template>
75
88
  </d2l-demo-snippet>
76
89
 
@@ -109,7 +109,7 @@ If the dropdown is initially empty when it's opened, the dropdown pointer will n
109
109
  | `disabled` | Boolean, default: `false` | Disables the dropdown opener |
110
110
  | `no-auto-open` | Boolean, default: `false` | Prevents the dropdown from automatically on click or on key press |
111
111
  | `open-on-hover` | Boolean, default: `false` | Optionally open dropdown on click or hover action |
112
- | `h-align` | String | Possible values are undefined (default) or text. If text, aligns the button content to the leading edge of text |
112
+ | `h-align` | String | Possible values are undefined (default), `text` or `text-end`. If `text` or `text-end`, aligns the button content to the leading (or trailing) edge of text |
113
113
  <!-- docs: end hidden content -->
114
114
 
115
115
  ### Accessibility Properties
@@ -19,8 +19,8 @@ class DropdownButtonSubtle extends DropdownOpenerMixin(LitElement) {
19
19
  description: { type: String },
20
20
 
21
21
  /**
22
- * Aligns the leading edge of text if value is set to "text"
23
- * @type {'text'|''}
22
+ * Aligns the leading edge of text if value is set to "text" for left-aligned layouts, the trailing edge of text if value is set to "text-end" for right-aligned layouts
23
+ * @type {'text'|'text-end'|''}
24
24
  */
25
25
  hAlign: { type: String, reflect: true, attribute: 'h-align' },
26
26
 
@@ -21,7 +21,7 @@ The `d2l-more-less` element can be used to minimize the display of long content,
21
21
  | Property | Type | Description |
22
22
  |---|---|---|
23
23
  | `expanded` | Boolean | Specifies the expanded/collapsed state of the content |
24
- | `h-align` | String | A value of `text` aligns the leading edge of text |
24
+ | `h-align` | String | Possible values are undefined (default), `text` or `text-end`. If `text` or `text-end`, aligns the button content to the leading (or trailing) edge of text. |
25
25
  | `height` | String, default: `'4em'` | Maximum height of the content when in "less" mode. The `d2l-more-less` element itself will take up additional vertical space for the fading effect as well as the more/less button itself. |
26
26
  | `inactive` | Boolean | Whether the component is active or inactive |
27
27
  <!-- docs: end hidden content -->
@@ -27,8 +27,8 @@ class MoreLess extends LocalizeCoreElement(LitElement) {
27
27
  expanded: { type: Boolean, reflect: true },
28
28
 
29
29
  /**
30
- * The h-align property of the more-less button
31
- * @type {'text'|''}
30
+ * Aligns the leading edge of more/less button text if value is set to "text" for left-aligned layouts, the trailing edge of text if value is set to "text-end" for right-aligned layouts
31
+ * @type {'text'|'text-end'|''}
32
32
  */
33
33
  hAlign: { type: String, attribute: 'h-align' },
34
34
 
@@ -13,7 +13,6 @@ import '../menu/menu-item-link.js';
13
13
  import { css, html, LitElement } from 'lit';
14
14
  import { OVERFLOW_CLASS, OVERFLOW_MINI_CLASS, OverflowGroupMixin } from './overflow-group-mixin.js';
15
15
  import { ifDefined } from 'lit/directives/if-defined.js';
16
- import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
17
16
 
18
17
  const OPENER_STYLE = {
19
18
  DEFAULT: 'default',
@@ -58,7 +57,7 @@ function createMenuItemSeparator() {
58
57
  * @attr {'default'|'icon'} [opener-type="default"] - Set the opener type to 'icon' for a `...` menu icon instead of `More actions` text
59
58
  * @attr {boolean} auto-show - Use predefined classes on slot elements to set min and max buttons to show
60
59
  */
61
- class OverflowGroup extends OverflowGroupMixin(RtlMixin(LitElement)) {
60
+ class OverflowGroup extends OverflowGroupMixin(LitElement) {
62
61
 
63
62
  static get properties() {
64
63
  return {
@@ -87,15 +86,7 @@ class OverflowGroup extends OverflowGroupMixin(RtlMixin(LitElement)) {
87
86
  ::slotted(span),
88
87
  ::slotted(d2l-dropdown:not(.d2l-overflow-dropdown)),
89
88
  ::slotted(d2l-dropdown-button) {
90
- margin-right: 0.6rem;
91
- }
92
- :host([dir="rtl"]) ::slotted(d2l-button),
93
- :host([dir="rtl"]) ::slotted(d2l-link),
94
- :host([dir="rtl"]) ::slotted(span),
95
- :host([dir="rtl"]) ::slotted(d2l-dropdown:not(.d2l-overflow-dropdown)),
96
- :host([dir="rtl"]) ::slotted(d2l-dropdown-button) {
97
- margin-left: 0.6rem;
98
- margin-right: 0;
89
+ margin-inline-end: 0.6rem;
99
90
  }
100
91
  ::slotted(d2l-button-subtle),
101
92
  ::slotted(d2l-button-icon),
@@ -104,17 +95,7 @@ class OverflowGroup extends OverflowGroupMixin(RtlMixin(LitElement)) {
104
95
  ::slotted(d2l-dropdown-context-menu),
105
96
  ::slotted(d2l-selection-action),
106
97
  ::slotted(d2l-selection-action-dropdown) {
107
- margin-right: 0.2rem;
108
- }
109
- :host([dir="rtl"]) ::slotted(d2l-button-subtle),
110
- :host([dir="rtl"]) ::slotted(d2l-button-icon),
111
- :host([dir="rtl"]) ::slotted(d2l-dropdown-button-subtle),
112
- :host([dir="rtl"]) ::slotted(d2l-dropdown-more),
113
- :host([dir="rtl"]) ::slotted(d2l-dropdown-context-menu),
114
- :host([dir="rtl"]) ::slotted(d2l-selection-action),
115
- :host([dir="rtl"]) ::slotted(d2l-selection-action-dropdown) {
116
- margin-left: 0.2rem;
117
- margin-right: 0;
98
+ margin-inline-end: 0.2rem;
118
99
  }
119
100
  `];
120
101
  }
@@ -8,7 +8,6 @@ import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
8
8
  import { ifDefined } from 'lit/directives/if-defined.js';
9
9
  import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
10
10
  import { PageableSubscriberMixin } from '../paging/pageable-subscriber-mixin.js';
11
- import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
12
11
  import { SelectionObserverMixin } from './selection-observer-mixin.js';
13
12
 
14
13
  /**
@@ -16,7 +15,7 @@ import { SelectionObserverMixin } from './selection-observer-mixin.js';
16
15
  * @slot - Responsive container using `d2l-overflow-group` for `d2l-selection-action` elements
17
16
  * @fires d2l-selection-observer-subscribe - Internal event
18
17
  */
19
- export class SelectionControls extends PageableSubscriberMixin(SelectionObserverMixin(RtlMixin(LocalizeCoreElement(LitElement)))) {
18
+ export class SelectionControls extends PageableSubscriberMixin(SelectionObserverMixin(LocalizeCoreElement(LitElement))) {
20
19
 
21
20
  static get properties() {
22
21
  return {
@@ -95,27 +94,16 @@ export class SelectionControls extends PageableSubscriberMixin(SelectionObserver
95
94
  flex: none;
96
95
  }
97
96
  d2l-selection-select-all + d2l-selection-summary {
98
- margin-left: 0.9rem;
99
- }
100
- :host([dir="rtl"]) d2l-selection-select-all + d2l-selection-summary {
101
- margin-left: 0;
102
- margin-right: 0.9rem;
97
+ margin-inline-start: 0.9rem;
103
98
  }
104
99
  d2l-selection-select-all-pages {
105
100
  flex: none;
106
- margin-left: 0.45rem;
107
- }
108
- :host([dir="rtl"]) d2l-selection-select-all-pages {
109
- margin-left: 0;
110
- margin-right: 0.45rem;
101
+ margin-inline-start: 0.45rem;
111
102
  }
112
103
  .d2l-selection-controls-actions {
113
104
  --d2l-overflow-group-justify-content: flex-end;
114
105
  flex: auto;
115
- text-align: right;
116
- }
117
- :host([dir="rtl"]) .d2l-selection-controls-actions {
118
- text-align: left;
106
+ text-align: end;
119
107
  }
120
108
  .d2l-sticky-edge {
121
109
  left: 0;
@@ -162,9 +162,11 @@ class TestTable extends RtlMixin(DemoPassthroughMixin(TableWrapper, 'd2l-table-w
162
162
  `;
163
163
  }
164
164
 
165
- _handlePagerLoadMore(e) {
165
+ async _handlePagerLoadMore(e) {
166
+ const pageSize = e.target.pageSize;
167
+ await new Promise(resolve => setTimeout(resolve, 1000));
166
168
  const startIndex = this._data.length + 1;
167
- for (let i = 0; i < e.target.pageSize; i++) {
169
+ for (let i = 0; i < pageSize; i++) {
168
170
  this._data.push({ name: `City ${startIndex + i}, Country ${startIndex + i}`, data: { 'city': `City ${startIndex + i}`, 'country': `Country ${startIndex + i}`, 'population': 26320000, 'size': 6340, 'elevation': 4, 'latitude': 3, 'longitude': 3 }, selected: false });
169
171
  }
170
172
  this.requestUpdate();
@@ -407,8 +407,8 @@
407
407
  },
408
408
  {
409
409
  "name": "h-align",
410
- "description": "Aligns the leading edge of text if value is set to \"text\"",
411
- "type": "'text'|''"
410
+ "description": "Aligns the leading edge of text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
411
+ "type": "'text'|'text-end'|''"
412
412
  },
413
413
  {
414
414
  "name": "icon",
@@ -448,8 +448,8 @@
448
448
  {
449
449
  "name": "hAlign",
450
450
  "attribute": "h-align",
451
- "description": "Aligns the leading edge of text if value is set to \"text\"",
452
- "type": "'text'|''"
451
+ "description": "Aligns the leading edge of text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
452
+ "type": "'text'|'text-end'|''"
453
453
  },
454
454
  {
455
455
  "name": "icon",
@@ -616,8 +616,8 @@
616
616
  },
617
617
  {
618
618
  "name": "h-align",
619
- "description": "Aligns the leading edge of text if value is set to \"text\"",
620
- "type": "'text'|''"
619
+ "description": "Aligns the leading edge of text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
620
+ "type": "'text'|'text-end'|''"
621
621
  },
622
622
  {
623
623
  "name": "icon",
@@ -663,8 +663,8 @@
663
663
  {
664
664
  "name": "hAlign",
665
665
  "attribute": "h-align",
666
- "description": "Aligns the leading edge of text if value is set to \"text\"",
667
- "type": "'text'|''"
666
+ "description": "Aligns the leading edge of text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
667
+ "type": "'text'|'text-end'|''"
668
668
  },
669
669
  {
670
670
  "name": "icon",
@@ -2366,8 +2366,8 @@
2366
2366
  },
2367
2367
  {
2368
2368
  "name": "h-align",
2369
- "description": "Aligns the leading edge of text if value is set to \"text\"",
2370
- "type": "'text'|''"
2369
+ "description": "Aligns the leading edge of text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
2370
+ "type": "'text'|'text-end'|''"
2371
2371
  },
2372
2372
  {
2373
2373
  "name": "text",
@@ -2403,8 +2403,8 @@
2403
2403
  {
2404
2404
  "name": "hAlign",
2405
2405
  "attribute": "h-align",
2406
- "description": "Aligns the leading edge of text if value is set to \"text\"",
2407
- "type": "'text'|''"
2406
+ "description": "Aligns the leading edge of text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
2407
+ "type": "'text'|'text-end'|''"
2408
2408
  },
2409
2409
  {
2410
2410
  "name": "text",
@@ -10210,8 +10210,8 @@
10210
10210
  "attributes": [
10211
10211
  {
10212
10212
  "name": "h-align",
10213
- "description": "The h-align property of the more-less button",
10214
- "type": "'text'|''"
10213
+ "description": "Aligns the leading edge of more/less button text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
10214
+ "type": "'text'|'text-end'|''"
10215
10215
  },
10216
10216
  {
10217
10217
  "name": "expanded",
@@ -10236,8 +10236,8 @@
10236
10236
  {
10237
10237
  "name": "hAlign",
10238
10238
  "attribute": "h-align",
10239
- "description": "The h-align property of the more-less button",
10240
- "type": "'text'|''"
10239
+ "description": "Aligns the leading edge of more/less button text if value is set to \"text\" for left-aligned layouts, the trailing edge of text if value is set to \"text-end\" for right-aligned layouts",
10240
+ "type": "'text'|'text-end'|''"
10241
10241
  },
10242
10242
  {
10243
10243
  "name": "expanded",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.95.0",
3
+ "version": "3.96.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",