@brightspace-ui/core 3.164.5 → 3.165.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.
@@ -75,6 +75,14 @@
75
75
  </template>
76
76
  </d2l-demo-snippet>
77
77
 
78
+ <h2>Custom Width</h2>
79
+ <d2l-demo-snippet>
80
+ <template>
81
+ <d2l-input-textarea label="Label" value="text" skeleton></d2l-input-textarea>
82
+ <d2l-input-textarea label="Name" input-width="400px"></d2l-input-textarea>
83
+ </template>
84
+ </d2l-demo-snippet>
85
+
78
86
  <h3>Inline Help</h3>
79
87
  <d2l-demo-snippet>
80
88
  <template>
@@ -39,6 +39,11 @@ class InputTextArea extends InputInlineHelpMixin(FocusMixin(LabelledMixin(FormEl
39
39
  * @type {boolean}
40
40
  */
41
41
  disabled: { type: Boolean, reflect: true },
42
+ /**
43
+ * Restricts the maximum width of the input box without impacting the width of the label.
44
+ * @type {string}
45
+ */
46
+ inputWidth: { attribute: 'input-width', type: String },
42
47
  /**
43
48
  * Hides the label visually (moves it to the input's "aria-label" attribute)
44
49
  * @type {boolean}
@@ -225,9 +230,12 @@ class InputTextArea extends InputInlineHelpMixin(FocusMixin(LabelledMixin(FormEl
225
230
  'd2l-input': true,
226
231
  'd2l-input-focus': !this.disabled && this._hovered
227
232
  };
233
+ const inputContainerStyles = {
234
+ maxWidth: this.inputWidth
235
+ };
228
236
 
229
237
  const textarea = html`
230
- <div class="d2l-input-textarea-container d2l-skeletize">
238
+ <div class="d2l-input-textarea-container d2l-skeletize" style="${styleMap(inputContainerStyles)}">
231
239
  <div class="d2l-input d2l-input-textarea-mirror" style="${styleMap(mirrorStyles)}" aria-invalid="${ifDefined(ariaInvalid)}">
232
240
  ${lines.map(line => html`${line}<br />`)}
233
241
  </div>
@@ -482,6 +482,9 @@
482
482
  document.addEventListener('d2l-tab-panel-selected', (e) => {
483
483
  console.log('tab panel selected', e);
484
484
  });
485
+ document.addEventListener('d2l-tab-selected', (e) => {
486
+ console.log('tab selected', e);
487
+ });
485
488
  document.addEventListener('d2l-tab-panel-text-changed', (e) => {
486
489
  console.log('tab panel text changed', e);
487
490
  });
@@ -1,5 +1,6 @@
1
1
  import '../colors/colors.js';
2
2
  import { css, html } from 'lit';
3
+ import { getFlag } from '../../helpers/flags.js';
3
4
  import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
4
5
 
5
6
  const keyCodes = {
@@ -94,6 +95,7 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
94
95
  this.tabIndex = -1;
95
96
 
96
97
  this._clicked = false;
98
+ this._noInitialSelectedEvent = getFlag('GAUD-8605-tab-no-initial-selected-event', false);
97
99
  }
98
100
 
99
101
  firstUpdated(changedProperties) {
@@ -102,6 +104,8 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
102
104
  this.addEventListener('click', this.#handleClick);
103
105
  this.addEventListener('keydown', this.#handleKeydown);
104
106
  this.addEventListener('keyup', this.#handleKeyup);
107
+
108
+ this.#hasInitialized = true;
105
109
  }
106
110
 
107
111
  render() {
@@ -116,6 +120,8 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
116
120
 
117
121
  if (changedProperties.has('selected')) {
118
122
  this.ariaSelected = `${this.selected}`;
123
+ if (!this.#hasInitialized && this._noInitialSelectedEvent) return; // Only fire events if selected changes after initial render
124
+
119
125
  if (this.selected) {
120
126
  /** Dispatched when a tab is selected */
121
127
  this.dispatchEvent(new CustomEvent(
@@ -145,6 +151,8 @@ export const TabMixin = superclass => class extends SkeletonMixin(superclass) {
145
151
  return html`<div>Default Tab Content</div>`;
146
152
  }
147
153
 
154
+ #hasInitialized = false;
155
+
148
156
  #handleClick() {
149
157
  if (this.selected) return;
150
158
 
@@ -7732,6 +7732,11 @@
7732
7732
  "description": "Additional information communicated in the aria-describedby on the input",
7733
7733
  "type": "string"
7734
7734
  },
7735
+ {
7736
+ "name": "input-width",
7737
+ "description": "Restricts the maximum width of the input box without impacting the width of the label.",
7738
+ "type": "string"
7739
+ },
7735
7740
  {
7736
7741
  "name": "maxlength",
7737
7742
  "description": "Imposes an upper character limit",
@@ -7822,6 +7827,12 @@
7822
7827
  "description": "Additional information communicated in the aria-describedby on the input",
7823
7828
  "type": "string"
7824
7829
  },
7830
+ {
7831
+ "name": "inputWidth",
7832
+ "attribute": "input-width",
7833
+ "description": "Restricts the maximum width of the input box without impacting the width of the label.",
7834
+ "type": "string"
7835
+ },
7825
7836
  {
7826
7837
  "name": "maxlength",
7827
7838
  "attribute": "maxlength",
package/lang/th.js CHANGED
@@ -155,6 +155,8 @@ export default {
155
155
  "components.pager-load-more.action": "โหลดเพิ่มเติม",
156
156
  "components.pager-load-more.action-with-page-size": "โหลดเพิ่ม {count} รายการ",
157
157
  "components.pager-load-more.status-loading": "กำลังโหลดรายการเพิ่มเติม",
158
+ "components.scroll-wrapper.scroll-left": "Scroll left",
159
+ "components.scroll-wrapper.scroll-right": "Scroll right",
158
160
  "components.selection.action-max-hint":
159
161
  `{count, plural,
160
162
  other {ปิดใช้งานเมื่อเลือกมากกว่า {countFormatted} รายการ}
package/lang/vi.js CHANGED
@@ -155,6 +155,8 @@ export default {
155
155
  "components.pager-load-more.action": "Tải thêm",
156
156
  "components.pager-load-more.action-with-page-size": "Tải thêm {count} mục",
157
157
  "components.pager-load-more.status-loading": "Đang tải thêm các mục",
158
+ "components.scroll-wrapper.scroll-left": "Scroll left",
159
+ "components.scroll-wrapper.scroll-right": "Scroll right",
158
160
  "components.selection.action-max-hint":
159
161
  `{count, plural,
160
162
  other {Vô hiệu hóa khi chọn nhiều hơn {countFormatted} mục}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.164.5",
3
+ "version": "3.165.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",