@jack-henry/jh-elements 2.0.0-beta.12 → 2.0.0-beta.14

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.
@@ -174,8 +174,8 @@ export class JhTable extends LitElement {
174
174
  :host([scrollable]) .table-wrapper {
175
175
  position: relative;
176
176
  overflow-x: hidden;
177
- flex: 1 1 auto;
178
- /* display grid makes sticky work and shadows go till bottom. */
177
+ flex: 1 1 auto;
178
+ /* display grid makes sticky work and shows horizontal scrollbar on top. */
179
179
  display: grid;
180
180
  }
181
181
 
@@ -187,7 +187,7 @@ export class JhTable extends LitElement {
187
187
  /* removes bouncy scroll behavior in Safari and FF */
188
188
  /* overscroll-behavior: none; */
189
189
  }
190
- :host([scrollable]) .scrollable {
190
+ :host([scrollable]) .table {
191
191
  width: auto;
192
192
  position: relative;
193
193
  }
@@ -199,7 +199,7 @@ export class JhTable extends LitElement {
199
199
  outline-width: var(--jh-border-focus-width);
200
200
  outline-style: var(--jh-border-focus-style);
201
201
  }
202
- .table-wrapper:focus-visible {
202
+ .table-container:focus-visible, :host([scrollable]) .table-wrapper:focus-visible {
203
203
  outline: none;
204
204
  }
205
205
  `;
@@ -294,29 +294,28 @@ export class JhTable extends LitElement {
294
294
  this.#id = id++;
295
295
  }
296
296
 
297
+ disconnectedCallback() {
298
+ super.disconnectedCallback();
299
+ if (this.observer) {
300
+ this.observer.disconnect();
301
+ }
302
+ }
303
+
297
304
  async firstUpdated() {
298
305
  if (!this.scrollable) return;
299
306
 
300
- let scrollTable = this.shadowRoot.querySelector('.table');
301
- await scrollTable.updateComplete;
302
- let originalTableWidth = scrollTable.getBoundingClientRect().width;
303
-
304
307
  this.observer = new ResizeObserver((entries) => {
305
308
  entries.forEach((entry) => {
306
309
  let table = entry.target.shadowRoot.querySelector('.table');
307
310
  let tableContainer =
308
311
  entry.target.shadowRoot.querySelector('.table-container');
312
+ if (!table || !tableContainer) return;
309
313
  if (table.scrollWidth > tableContainer.clientWidth) {
310
- table.classList.add('scrollable');
311
- } else {
312
- if (table.scrollWidth >= originalTableWidth) {
313
- table.classList.remove('scrollable');
314
+ tableContainer.setAttribute('tabindex', '0');
315
+ }
316
+ else {
314
317
  tableContainer.removeAttribute('tabindex');
315
- } else {
316
- table.classList.add('scrollable');
317
- tableContainer.setAttribute('tabindex', '0');
318
318
  }
319
- }
320
319
  });
321
320
  });
322
321
 
@@ -354,7 +353,7 @@ export class JhTable extends LitElement {
354
353
  <slot name="jh-table-toolbar" @slotchange=${this.#handleSlot}></slot>
355
354
  <div class="table-wrapper">
356
355
  <div class="table-container" tabindex="${ifDefined(this.scrollable ? '0' : null)}">
357
- <div class="table ${this.scrollable ? 'scrollable' : ''}" role="table"
356
+ <div class="table" role="table"
358
357
  aria-labelledby="table-caption-${this.#id}" aria-label=${ifDefined(this.accessibleLabel === '' ? null : this.accessibleLabel)}>
359
358
  <slot name="jh-table-header" class="header" role="rowgroup"></slot>
360
359
  <slot class="body" role="rowgroup"></slot>
@@ -62,7 +62,8 @@ export class JhTableDataCell extends LitElement {
62
62
  font-size: var(--footer-font-size, var(--jh-font-body-regular-1-font-size));
63
63
  font-family: var(--footer-font-family, var(--jh-font-body-regular-1-font-family));
64
64
  display: table-cell;
65
- width: 100%;
65
+ width: auto;
66
+ box-sizing: border-box;
66
67
  }
67
68
  :host([horizontal-align="left"]) {
68
69
  text-align: left;
@@ -99,7 +99,7 @@ export class JhTableHeaderCell extends LitElement {
99
99
  vertical-align: var(--vertical-align, top);
100
100
  display: table-cell;
101
101
  box-sizing: border-box;
102
- width: 100%;
102
+ width: auto;
103
103
  }
104
104
  :host([sortable]:hover) {
105
105
  border-bottom-color: var(--jh-table-header-cell-color-border-bottom-hover, var(--jh-border-decorative-color));
@@ -376,19 +376,22 @@ export class JhTag extends LitElement {
376
376
  if (this.dismissible) {
377
377
  dismissBtn = html`
378
378
  <jh-button
379
- size="medium"
379
+ size="x-small"
380
380
  appearance="secondary"
381
381
  accessible-label=${this.dismissButtonAccessibleLabel}
382
382
  @click=${this.#handleDismissal}>
383
- <slot name="jh-tag-dismiss-icon" slot="jh-button-icon">
384
- <jh-icon-xmark slot="jh-button-icon"></jh-icon-xmark>
383
+ <slot name="jh-tag-dismiss-icon" slot="jh-button-icon-left">
384
+ <jh-icon-xmark slot="jh-button-icon-left"></jh-icon-xmark>
385
385
  </slot>
386
386
  </jh-button>
387
387
  `;
388
388
  }
389
389
 
390
390
  if (this.dismissible && this.tooltipLabel) {
391
- dismissBtn = html`<jh-tooltip label=${this.tooltipLabel}>${dismissBtn}</jh-tooltip>`;
391
+ dismissBtn = html`<jh-tooltip>
392
+ ${dismissBtn}
393
+ <div slot="jh-tooltip-content">${this.tooltipLabel}</div>
394
+ </jh-tooltip>`;
392
395
  }
393
396
  return dismissBtn;
394
397
  }
@@ -74,8 +74,6 @@ export class JhToast extends LitElement {
74
74
 
75
75
  static get properties() {
76
76
  return {
77
- /** Sets the background color of the toast to convey message connotation. */
78
- appearance: { type: String, reflect: true },
79
77
  /** Adds an aria-label to the dismiss button to assist screen readers. */
80
78
  dismissButtonAccessibleLabel: {
81
79
  type: String,
@@ -94,8 +92,6 @@ export class JhToast extends LitElement {
94
92
  super();
95
93
  /** @type {number} */
96
94
  this.timeout = 5000;
97
- /** @type {'positive'|'neutral'|'negative'} */
98
- this.appearance = 'neutral';
99
95
  /** @type {string} */
100
96
  this.dismissButtonAccessibleLabel = null;
101
97
  /** @type {boolean} */
@@ -151,7 +147,7 @@ export class JhToast extends LitElement {
151
147
  render() {
152
148
  return html`
153
149
  <jh-notification
154
- appearance=${this.appearance}
150
+ appearance="neutral"
155
151
  dismiss-button-accessible-label=${this.dismissButtonAccessibleLabel}
156
152
  ?hide-dismiss-button=${this.hideDismissButton}
157
153
  ?stacked=${this.stacked}>