@jack-henry/jh-elements 2.0.0-beta.13 → 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.
- package/components/button/button.js +98 -39
- package/components/input/input.js +9 -10
- package/components/input-password/input-password.js +7 -7
- package/components/input-search/input-search.js +1 -1
- package/components/notification/notification.js +14 -6
- package/components/table/table.js +16 -17
- package/components/table-data-cell/table-data-cell.js +2 -1
- package/components/table-header-cell/table-header-cell.js +1 -1
- package/components/tag/tag.js +7 -4
- package/custom-elements.json +44 -21
- package/jsconfig.json +1 -1
- package/package.json +10 -14
|
@@ -102,9 +102,10 @@ import '../progress/progress.js';
|
|
|
102
102
|
* @cssprop --jh-button-border-radius - The button container border-radius. Defaults to `--jh-border-radius-100`.
|
|
103
103
|
* @cssprop --jh-button-opacity-disabled - The button container opacity when disabled. Defaults to `--jh-opacity-disabled`.
|
|
104
104
|
* @cssprop --jh-button-color-focus - The button container outline when it receives keyboard focus. Defaults to `--jh-border-focus-color`.
|
|
105
|
-
* @cssprop --jh-button-size - The button width
|
|
105
|
+
* @cssprop --jh-button-size - The button width of single icon buttons, and the button height. Button width and height defaults to `--jh-dimension-600` when `size="x-small"`,`--jh-dimension-800` when `size="small"`, `--jh-dimension-1000` when `size="medium"`, and `--jh-dimension-1200` when `size="large"`.
|
|
106
106
|
*
|
|
107
|
-
* @slot jh-button-icon - Use to insert an icon.
|
|
107
|
+
* @slot jh-button-icon-left - Use to insert an icon on the left side of the button and for single icon buttons.
|
|
108
|
+
* @slot jh-button-icon-right - Use to insert an icon on the right side of the button and for single icon buttons.
|
|
108
109
|
* @customElement jh-button
|
|
109
110
|
*/
|
|
110
111
|
export class JhButton extends LitElement {
|
|
@@ -156,6 +157,7 @@ export class JhButton extends LitElement {
|
|
|
156
157
|
display: flex;
|
|
157
158
|
justify-content: center;
|
|
158
159
|
align-items: center;
|
|
160
|
+
gap: var(--jh-dimension-200);
|
|
159
161
|
}
|
|
160
162
|
button:focus,
|
|
161
163
|
a:focus {
|
|
@@ -179,17 +181,21 @@ export class JhButton extends LitElement {
|
|
|
179
181
|
pointer-events: none;
|
|
180
182
|
}
|
|
181
183
|
/* Size styling ('medium' is default) */
|
|
184
|
+
:host([size='x-small']) button,
|
|
185
|
+
:host([size='x-small']) a {
|
|
186
|
+
height: var(--jh-button-size, var(--jh-dimension-600));
|
|
187
|
+
}
|
|
182
188
|
:host([size='small']) button,
|
|
183
189
|
:host([size='small']) a {
|
|
184
|
-
height: var(--jh-button-size, var(--jh-dimension-
|
|
190
|
+
height: var(--jh-button-size, var(--jh-dimension-800));
|
|
185
191
|
}
|
|
186
192
|
:host([size='medium']) button,
|
|
187
193
|
:host([size='medium']) a {
|
|
188
|
-
height: var(--jh-button-size, var(--jh-dimension-
|
|
194
|
+
height: var(--jh-button-size, var(--jh-dimension-1000));
|
|
189
195
|
}
|
|
190
196
|
:host([size='large']) button,
|
|
191
197
|
:host([size='large']) a {
|
|
192
|
-
height: var(--jh-button-size, var(--jh-dimension-
|
|
198
|
+
height: var(--jh-button-size, var(--jh-dimension-1200));
|
|
193
199
|
}
|
|
194
200
|
/* appearance='primary' ('secondary' is default) */
|
|
195
201
|
:host([appearance='primary']) button,
|
|
@@ -687,33 +693,28 @@ export class JhButton extends LitElement {
|
|
|
687
693
|
var(--jh-color-content-on-negative-enabled)
|
|
688
694
|
);
|
|
689
695
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
696
|
+
|
|
697
|
+
/* Single icon styling */
|
|
698
|
+
:host button.single-icon,
|
|
699
|
+
:host a.single-icon {
|
|
700
|
+
padding: 0;
|
|
693
701
|
}
|
|
694
|
-
:host([
|
|
695
|
-
|
|
702
|
+
:host([size='x-small']) button.single-icon,
|
|
703
|
+
:host([size='x-small']) a.single-icon {
|
|
704
|
+
width: var(--jh-button-size, var(--jh-dimension-600));
|
|
696
705
|
}
|
|
697
|
-
:host([
|
|
698
|
-
|
|
706
|
+
:host([size='small']) button.single-icon,
|
|
707
|
+
:host([size='small']) a.single-icon {
|
|
708
|
+
width: var(--jh-button-size, var(--jh-dimension-800));
|
|
699
709
|
}
|
|
700
|
-
|
|
701
|
-
:host(
|
|
702
|
-
:host(:not([label])[size='small']) a {
|
|
710
|
+
:host([size='medium']) button.single-icon,
|
|
711
|
+
:host([size='medium']) a.single-icon {
|
|
703
712
|
width: var(--jh-button-size, var(--jh-dimension-1000));
|
|
704
713
|
}
|
|
705
|
-
:host(
|
|
706
|
-
:host(
|
|
714
|
+
:host([size='large']) button.single-icon,
|
|
715
|
+
:host([size='large']) a.single-icon {
|
|
707
716
|
width: var(--jh-button-size, var(--jh-dimension-1200));
|
|
708
717
|
}
|
|
709
|
-
:host(:not([label])[size='large']) button,
|
|
710
|
-
:host(:not([label])[size='large']) a {
|
|
711
|
-
width: var(--jh-button-size, var(--jh-dimension-1400));
|
|
712
|
-
}
|
|
713
|
-
:host(:not([label])) button,
|
|
714
|
-
:host(:not([label])) a {
|
|
715
|
-
padding: 0;
|
|
716
|
-
}
|
|
717
718
|
/* Block styling */
|
|
718
719
|
:host([block]) {
|
|
719
720
|
display: block;
|
|
@@ -721,6 +722,8 @@ export class JhButton extends LitElement {
|
|
|
721
722
|
}
|
|
722
723
|
:host(:not([label])[block]) button,
|
|
723
724
|
:host(:not([label])[block]) a,
|
|
725
|
+
:host([block]) button.single-icon,
|
|
726
|
+
:host([block]) a.single-icon,
|
|
724
727
|
:host([block]) button,
|
|
725
728
|
:host([block]) a {
|
|
726
729
|
width: 100%;
|
|
@@ -759,12 +762,6 @@ export class JhButton extends LitElement {
|
|
|
759
762
|
href: {
|
|
760
763
|
type: String,
|
|
761
764
|
},
|
|
762
|
-
/** Sets location of icon in relation to the label. */
|
|
763
|
-
iconPosition: {
|
|
764
|
-
type: String,
|
|
765
|
-
attribute: 'icon-position',
|
|
766
|
-
reflect: true,
|
|
767
|
-
},
|
|
768
765
|
/** Displays a progress indicator. */
|
|
769
766
|
pending: {
|
|
770
767
|
type: Boolean,
|
|
@@ -795,6 +792,14 @@ export class JhButton extends LitElement {
|
|
|
795
792
|
value: {
|
|
796
793
|
type: String,
|
|
797
794
|
},
|
|
795
|
+
_hasLeftSlotContent: {
|
|
796
|
+
type: Boolean,
|
|
797
|
+
state: true,
|
|
798
|
+
},
|
|
799
|
+
_hasRightSlotContent: {
|
|
800
|
+
type: Boolean,
|
|
801
|
+
state: true,
|
|
802
|
+
},
|
|
798
803
|
};
|
|
799
804
|
}
|
|
800
805
|
|
|
@@ -816,15 +821,13 @@ export class JhButton extends LitElement {
|
|
|
816
821
|
this.disabled = false;
|
|
817
822
|
/** @type {?string} */
|
|
818
823
|
this.href = null;
|
|
819
|
-
/** @type {'before'|'after'} */
|
|
820
|
-
this.iconPosition = 'before';
|
|
821
824
|
/** @type {?boolean} */
|
|
822
825
|
this.pending = false;
|
|
823
826
|
/** @type {?string} */
|
|
824
827
|
this.label = null;
|
|
825
828
|
/** @type {?string} */
|
|
826
829
|
this.name = null;
|
|
827
|
-
/** @type {'small'|'medium'|'large'} */
|
|
830
|
+
/** @type {'x-small'|'small'|'medium'|'large'} */
|
|
828
831
|
this.size = 'medium';
|
|
829
832
|
/** @type {?boolean} */
|
|
830
833
|
this.submit = false;
|
|
@@ -832,6 +835,10 @@ export class JhButton extends LitElement {
|
|
|
832
835
|
this.target = null;
|
|
833
836
|
/** @type {?string} */
|
|
834
837
|
this.value = null;
|
|
838
|
+
/** @type {boolean} */
|
|
839
|
+
this._hasLeftSlotContent = false;
|
|
840
|
+
/** @type {boolean} */
|
|
841
|
+
this._hasRightSlotContent = false;
|
|
835
842
|
|
|
836
843
|
this.addEventListener('click', this.#onClick);
|
|
837
844
|
this.addEventListener('keydown', this.#handleKeydown);
|
|
@@ -856,6 +863,19 @@ export class JhButton extends LitElement {
|
|
|
856
863
|
new ResizeObserver(this.#cacheButtonDimensions.bind(this)).observe(this);
|
|
857
864
|
}
|
|
858
865
|
|
|
866
|
+
//if button size changes, adjust the size of the icons accordingly.
|
|
867
|
+
updated(changedProperties) {
|
|
868
|
+
if (changedProperties.has('size')) {
|
|
869
|
+
const iconSize = this.size === 'x-small' ? 'x-small' : 'medium';
|
|
870
|
+
const slots = this.shadowRoot.querySelectorAll('slot');
|
|
871
|
+
slots.forEach(slot => {
|
|
872
|
+
const icon = slot?.assignedElements({flatten: true})[0];
|
|
873
|
+
if (icon) {
|
|
874
|
+
icon.setAttribute('size', iconSize);
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
}
|
|
859
879
|
#cacheButtonDimensions() {
|
|
860
880
|
const { width } = this.getBoundingClientRect();
|
|
861
881
|
|
|
@@ -883,11 +903,43 @@ export class JhButton extends LitElement {
|
|
|
883
903
|
}
|
|
884
904
|
}
|
|
885
905
|
|
|
886
|
-
#handleSlotChange() {
|
|
887
|
-
|
|
888
|
-
|
|
906
|
+
#handleSlotChange(e) {
|
|
907
|
+
|
|
908
|
+
let newSlottedElement = e.target.assignedElements()[0];
|
|
909
|
+
let slot = e.target;
|
|
910
|
+
|
|
911
|
+
if (slot.name !== 'jh-button-icon-left' && slot.name !== 'jh-button-icon-right') {
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// Set icon size
|
|
916
|
+
if (newSlottedElement?.tagName.startsWith('JH-ICON')) {
|
|
917
|
+
newSlottedElement.setAttribute('aria-hidden', 'true');
|
|
918
|
+
|
|
919
|
+
if (this.size === 'x-small') {
|
|
920
|
+
newSlottedElement.setAttribute('size', 'x-small');
|
|
921
|
+
} else {
|
|
922
|
+
newSlottedElement.setAttribute('size', 'medium');
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
if (slot.name === 'jh-button-icon-left') {
|
|
927
|
+
this._hasLeftSlotContent = this.#checkSlotContent(slot);
|
|
928
|
+
}
|
|
929
|
+
if (slot.name === 'jh-button-icon-right') {
|
|
930
|
+
this._hasRightSlotContent = this.#checkSlotContent(slot);
|
|
931
|
+
}
|
|
889
932
|
}
|
|
890
933
|
|
|
934
|
+
#checkSlotContent(slot) {
|
|
935
|
+
// Slotted and fallback elements
|
|
936
|
+
const slottedElements = slot.assignedElements({ flatten: true });
|
|
937
|
+
if (slottedElements.length > 0) {
|
|
938
|
+
return true;
|
|
939
|
+
}
|
|
940
|
+
return false;
|
|
941
|
+
}
|
|
942
|
+
|
|
891
943
|
#renderButtonContent(pending, label) {
|
|
892
944
|
let buttonContent;
|
|
893
945
|
let buttonLabel;
|
|
@@ -898,15 +950,19 @@ export class JhButton extends LitElement {
|
|
|
898
950
|
|
|
899
951
|
if (pending && !this.disabled) {
|
|
900
952
|
buttonContent = html`
|
|
901
|
-
<jh-progress type="circular" indeterminate></jh-progress>
|
|
953
|
+
<jh-progress type="circular" indeterminate size=${this.size === 'x-small' ? 'small' : 'medium'}></jh-progress>
|
|
902
954
|
`;
|
|
903
955
|
} else {
|
|
904
956
|
buttonContent = html`
|
|
905
957
|
<slot
|
|
906
|
-
name="jh-button-icon"
|
|
958
|
+
name="jh-button-icon-left"
|
|
907
959
|
@slotchange=${this.#handleSlotChange}
|
|
908
960
|
></slot>
|
|
909
961
|
${buttonLabel}
|
|
962
|
+
<slot
|
|
963
|
+
name="jh-button-icon-right"
|
|
964
|
+
@slotchange=${this.#handleSlotChange}
|
|
965
|
+
></slot>
|
|
910
966
|
`;
|
|
911
967
|
}
|
|
912
968
|
|
|
@@ -916,6 +972,7 @@ export class JhButton extends LitElement {
|
|
|
916
972
|
render() {
|
|
917
973
|
const buttonContent = this.#renderButtonContent(this.pending, this.label);
|
|
918
974
|
let ariaDisabled;
|
|
975
|
+
let singleIconClass = !this.label && (this._hasLeftSlotContent !== this._hasRightSlotContent) ? 'single-icon' : null;
|
|
919
976
|
|
|
920
977
|
if (this.accessibleDisabled !== 'false') {
|
|
921
978
|
ariaDisabled = this.accessibleDisabled;
|
|
@@ -924,6 +981,7 @@ export class JhButton extends LitElement {
|
|
|
924
981
|
if (this.href) {
|
|
925
982
|
return html`
|
|
926
983
|
<a
|
|
984
|
+
class=${ifDefined(singleIconClass)}
|
|
927
985
|
tabindex="0"
|
|
928
986
|
aria-disabled=${ifDefined(ariaDisabled)}
|
|
929
987
|
aria-label=${ifDefined(this.accessibleLabel)}
|
|
@@ -937,6 +995,7 @@ export class JhButton extends LitElement {
|
|
|
937
995
|
} else {
|
|
938
996
|
return html`
|
|
939
997
|
<button
|
|
998
|
+
class=${ifDefined(singleIconClass)}
|
|
940
999
|
tabindex="0"
|
|
941
1000
|
aria-disabled=${ifDefined(ariaDisabled)}
|
|
942
1001
|
aria-label=${ifDefined(this.accessibleLabel)}
|
|
@@ -117,7 +117,6 @@ export class JhInput extends LitElement {
|
|
|
117
117
|
line-height: var(--input-helper-regular-line-height);
|
|
118
118
|
display: inline-block;
|
|
119
119
|
width: 100%;
|
|
120
|
-
--jh-button-size: var(--jh-dimension-800);
|
|
121
120
|
--input-value-color-text: var(
|
|
122
121
|
--jh-input-value-color-text,
|
|
123
122
|
var(--jh-color-content-primary-enabled)
|
|
@@ -178,13 +177,13 @@ export class JhInput extends LitElement {
|
|
|
178
177
|
|
|
179
178
|
/* Sizes on input wrapper */
|
|
180
179
|
:host([size='small']) .input-wrapper {
|
|
181
|
-
height: var(--jh-dimension-
|
|
180
|
+
height: var(--jh-dimension-800);
|
|
182
181
|
}
|
|
183
182
|
:host([size='medium']) .input-wrapper {
|
|
184
|
-
height: var(--jh-dimension-
|
|
183
|
+
height: var(--jh-dimension-1000);
|
|
185
184
|
}
|
|
186
185
|
:host([size='large']) .input-wrapper {
|
|
187
|
-
height: var(--jh-dimension-
|
|
186
|
+
height: var(--jh-dimension-1200);
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
/* Input element — no border, grows to fill */
|
|
@@ -1144,9 +1143,9 @@ export class JhInput extends LitElement {
|
|
|
1144
1143
|
let hasContent = this.#checkSlotContent(slot);
|
|
1145
1144
|
slot.classList.toggle('display-slot', hasContent);
|
|
1146
1145
|
|
|
1147
|
-
// Set icon size if applicable
|
|
1148
|
-
if (newSlottedElement?.tagName.startsWith('JH-ICON')) {
|
|
1149
|
-
newSlottedElement.setAttribute('size', '
|
|
1146
|
+
// Set jh-icon or jh-button size if applicable
|
|
1147
|
+
if (newSlottedElement?.tagName.startsWith('JH-ICON')||newSlottedElement?.tagName === 'JH-BUTTON') {
|
|
1148
|
+
newSlottedElement.setAttribute('size', 'x-small');
|
|
1150
1149
|
}
|
|
1151
1150
|
}
|
|
1152
1151
|
|
|
@@ -1168,11 +1167,11 @@ export class JhInput extends LitElement {
|
|
|
1168
1167
|
if (!this.showClearButton || !this.value || this.disabled) return null;
|
|
1169
1168
|
return html`
|
|
1170
1169
|
<jh-button
|
|
1171
|
-
size="small" appearance="tertiary" class="clear-button"
|
|
1170
|
+
size="x-small" appearance="tertiary" class="clear-button"
|
|
1172
1171
|
accessible-label=${ifDefined(this.accessibleLabelClearButton)}
|
|
1173
1172
|
@click=${this._handleClearButtonClick}>
|
|
1174
|
-
<slot name="jh-input-clear-button" slot="jh-button-icon">
|
|
1175
|
-
<jh-icon-circle-xmark slot="jh-button-icon
|
|
1173
|
+
<slot name="jh-input-clear-button" slot="jh-button-icon-left">
|
|
1174
|
+
<jh-icon-circle-xmark slot="jh-button-icon-left"></jh-icon-circle-xmark>
|
|
1176
1175
|
</slot>
|
|
1177
1176
|
</jh-button>
|
|
1178
1177
|
`;
|
|
@@ -120,7 +120,7 @@ renderInput() {
|
|
|
120
120
|
let passwordBtn = html`
|
|
121
121
|
<jh-button
|
|
122
122
|
class="password-toggle-btn"
|
|
123
|
-
size="small"
|
|
123
|
+
size="x-small"
|
|
124
124
|
appearance="tertiary"
|
|
125
125
|
?disabled=${this.disabled}
|
|
126
126
|
accessible-label=${accessibleLabel}
|
|
@@ -130,24 +130,24 @@ renderInput() {
|
|
|
130
130
|
? html`
|
|
131
131
|
<slot
|
|
132
132
|
name="jh-input-password-visible"
|
|
133
|
-
slot="jh-button-icon"
|
|
133
|
+
slot="jh-button-icon-left"
|
|
134
134
|
>
|
|
135
135
|
<jh-icon-eye-slash
|
|
136
|
-
slot="jh-button-icon"
|
|
136
|
+
slot="jh-button-icon-left"
|
|
137
137
|
aria-hidden="true"
|
|
138
|
-
size="
|
|
138
|
+
size="x-small"
|
|
139
139
|
></jh-icon-eye-slash>
|
|
140
140
|
</slot>
|
|
141
141
|
`
|
|
142
142
|
: html`
|
|
143
143
|
<slot
|
|
144
144
|
name="jh-input-password-hidden"
|
|
145
|
-
slot="jh-button-icon"
|
|
145
|
+
slot="jh-button-icon-left"
|
|
146
146
|
>
|
|
147
147
|
<jh-icon-eye
|
|
148
|
-
slot="jh-button-icon"
|
|
148
|
+
slot="jh-button-icon-left"
|
|
149
149
|
aria-hidden="true"
|
|
150
|
-
size="
|
|
150
|
+
size="x-small"
|
|
151
151
|
></jh-icon-eye>
|
|
152
152
|
</slot>
|
|
153
153
|
`}
|
|
@@ -36,7 +36,7 @@ export class JhInputSearch extends JhInput {
|
|
|
36
36
|
|
|
37
37
|
return html`
|
|
38
38
|
<slot name="jh-input-left" @slotchange=${this._handleSlotChange}>
|
|
39
|
-
<jh-icon-magnifying-glass aria-hidden="true"></jh-icon-magnifying-glass>
|
|
39
|
+
<jh-icon-magnifying-glass aria-hidden="true" size="x-small"></jh-icon-magnifying-glass>
|
|
40
40
|
</slot>
|
|
41
41
|
`;
|
|
42
42
|
}
|
|
@@ -136,7 +136,7 @@ export class JhNotification extends LitElement {
|
|
|
136
136
|
}
|
|
137
137
|
/* Default slot styling */
|
|
138
138
|
.display-default-slot {
|
|
139
|
-
padding: var(--jh-dimension-
|
|
139
|
+
padding: var(--jh-dimension-100) 0;
|
|
140
140
|
margin: var(--jh-dimension-50) 0;
|
|
141
141
|
font: var(--jh-font-body-regular-1);
|
|
142
142
|
display: flex;
|
|
@@ -149,7 +149,7 @@ export class JhNotification extends LitElement {
|
|
|
149
149
|
}
|
|
150
150
|
slot[name="jh-notification-icon"]::slotted(*) {
|
|
151
151
|
margin-right: var(--jh-dimension-400);
|
|
152
|
-
padding: var(--jh-dimension-
|
|
152
|
+
padding: var(--jh-dimension-100) 0;
|
|
153
153
|
}
|
|
154
154
|
:host([appearance='neutral']) slot[name="jh-notification-icon"] {
|
|
155
155
|
--jh-icon-color-fill: var(--jh-notification-icon-color-fill-neutral, var(--jh-color-content-on-primary-enabled));
|
|
@@ -204,7 +204,8 @@ export class JhNotification extends LitElement {
|
|
|
204
204
|
.stacked-container,
|
|
205
205
|
.inline-container {
|
|
206
206
|
display: flex;
|
|
207
|
-
align-items:
|
|
207
|
+
align-items: center;
|
|
208
|
+
line-height: 0;
|
|
208
209
|
}
|
|
209
210
|
`;
|
|
210
211
|
}
|
|
@@ -295,6 +296,13 @@ export class JhNotification extends LitElement {
|
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
|
|
299
|
+
#handleIconSlotChange(e) {
|
|
300
|
+
let newSlottedElement = e.target.assignedElements()[0];
|
|
301
|
+
if (newSlottedElement?.tagName.startsWith('JH-ICON')) {
|
|
302
|
+
newSlottedElement.setAttribute('size', 'medium');
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
298
306
|
render() {
|
|
299
307
|
let dismissBtn;
|
|
300
308
|
|
|
@@ -305,8 +313,8 @@ export class JhNotification extends LitElement {
|
|
|
305
313
|
appearance="secondary"
|
|
306
314
|
accessible-label=${this.dismissButtonAccessibleLabel}
|
|
307
315
|
@click=${this.#handleDismissal}
|
|
308
|
-
><slot name="jh-notification-dismiss-icon" slot="jh-button-icon">
|
|
309
|
-
<jh-icon-xmark slot="jh-button-icon"></jh-icon-xmark>
|
|
316
|
+
><slot name="jh-notification-dismiss-icon" slot="jh-button-icon-left">
|
|
317
|
+
<jh-icon-xmark slot="jh-button-icon-left"></jh-icon-xmark>
|
|
310
318
|
</slot>
|
|
311
319
|
</jh-button>
|
|
312
320
|
`;
|
|
@@ -314,7 +322,7 @@ export class JhNotification extends LitElement {
|
|
|
314
322
|
|
|
315
323
|
return html`
|
|
316
324
|
<div class=${this.stacked ? 'stacked-container' : 'inline-container'}>
|
|
317
|
-
<slot aria-hidden="true" name="jh-notification-icon"></slot>
|
|
325
|
+
<slot aria-hidden="true" name="jh-notification-icon" @slotchange=${this.#handleIconSlotChange}></slot>
|
|
318
326
|
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
319
327
|
${this.stacked ? null : this.#getActionButtons()}
|
|
320
328
|
${dismissBtn}
|
|
@@ -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
|
|
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]) .
|
|
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
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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));
|
package/components/tag/tag.js
CHANGED
|
@@ -376,19 +376,22 @@ export class JhTag extends LitElement {
|
|
|
376
376
|
if (this.dismissible) {
|
|
377
377
|
dismissBtn = html`
|
|
378
378
|
<jh-button
|
|
379
|
-
size="
|
|
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
|
|
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
|
}
|
package/custom-elements.json
CHANGED
|
@@ -84,12 +84,6 @@
|
|
|
84
84
|
"description": "Sets the link's destination.",
|
|
85
85
|
"type": "?string"
|
|
86
86
|
},
|
|
87
|
-
{
|
|
88
|
-
"name": "icon-position",
|
|
89
|
-
"description": "Sets location of icon in relation to the label.",
|
|
90
|
-
"type": "'before'|'after'",
|
|
91
|
-
"default": "\"before\""
|
|
92
|
-
},
|
|
93
87
|
{
|
|
94
88
|
"name": "pending",
|
|
95
89
|
"description": "Displays a progress indicator.",
|
|
@@ -109,7 +103,7 @@
|
|
|
109
103
|
{
|
|
110
104
|
"name": "size",
|
|
111
105
|
"description": "Sets the size of the button.",
|
|
112
|
-
"type": "'small'|'medium'|'large'",
|
|
106
|
+
"type": "'x-small'|'small'|'medium'|'large'",
|
|
113
107
|
"default": "\"medium\""
|
|
114
108
|
},
|
|
115
109
|
{
|
|
@@ -169,13 +163,6 @@
|
|
|
169
163
|
"description": "Sets the link's destination.",
|
|
170
164
|
"type": "?string"
|
|
171
165
|
},
|
|
172
|
-
{
|
|
173
|
-
"name": "iconPosition",
|
|
174
|
-
"attribute": "icon-position",
|
|
175
|
-
"description": "Sets location of icon in relation to the label.",
|
|
176
|
-
"type": "'before'|'after'",
|
|
177
|
-
"default": "\"before\""
|
|
178
|
-
},
|
|
179
166
|
{
|
|
180
167
|
"name": "pending",
|
|
181
168
|
"attribute": "pending",
|
|
@@ -199,7 +186,7 @@
|
|
|
199
186
|
"name": "size",
|
|
200
187
|
"attribute": "size",
|
|
201
188
|
"description": "Sets the size of the button.",
|
|
202
|
-
"type": "'small'|'medium'|'large'",
|
|
189
|
+
"type": "'x-small'|'small'|'medium'|'large'",
|
|
203
190
|
"default": "\"medium\""
|
|
204
191
|
},
|
|
205
192
|
{
|
|
@@ -224,8 +211,12 @@
|
|
|
224
211
|
],
|
|
225
212
|
"slots": [
|
|
226
213
|
{
|
|
227
|
-
"name": "jh-button-icon",
|
|
228
|
-
"description": "Use to insert an icon."
|
|
214
|
+
"name": "jh-button-icon-left",
|
|
215
|
+
"description": "Use to insert an icon on the left side of the button and for single icon buttons."
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "jh-button-icon-right",
|
|
219
|
+
"description": "Use to insert an icon on the right side of the button and for single icon buttons."
|
|
229
220
|
}
|
|
230
221
|
],
|
|
231
222
|
"cssProperties": [
|
|
@@ -611,7 +602,7 @@
|
|
|
611
602
|
},
|
|
612
603
|
{
|
|
613
604
|
"name": "--jh-button-size",
|
|
614
|
-
"description": "The button width
|
|
605
|
+
"description": "The button width of single icon buttons, and the button height. Button width and height defaults to `--jh-dimension-600` when `size=\"x-small\"`,`--jh-dimension-800` when `size=\"small\"`, `--jh-dimension-1000` when `size=\"medium\"`, and `--jh-dimension-1200` when `size=\"large\"`."
|
|
615
606
|
}
|
|
616
607
|
]
|
|
617
608
|
},
|
|
@@ -1458,6 +1449,10 @@
|
|
|
1458
1449
|
}
|
|
1459
1450
|
],
|
|
1460
1451
|
"properties": [
|
|
1452
|
+
{
|
|
1453
|
+
"name": "uniqueId",
|
|
1454
|
+
"type": "number | null"
|
|
1455
|
+
},
|
|
1461
1456
|
{
|
|
1462
1457
|
"name": "accessibleLabel",
|
|
1463
1458
|
"attribute": "accessible-label",
|
|
@@ -1837,7 +1832,7 @@
|
|
|
1837
1832
|
"name": "hide-right-slot",
|
|
1838
1833
|
"description": "Hides the right slot from input.",
|
|
1839
1834
|
"type": "boolean",
|
|
1840
|
-
"default": "
|
|
1835
|
+
"default": "false"
|
|
1841
1836
|
},
|
|
1842
1837
|
{
|
|
1843
1838
|
"name": "input-mask",
|
|
@@ -1937,6 +1932,10 @@
|
|
|
1937
1932
|
"type": "boolean",
|
|
1938
1933
|
"default": "false"
|
|
1939
1934
|
},
|
|
1935
|
+
{
|
|
1936
|
+
"name": "uniqueId",
|
|
1937
|
+
"type": "number | null"
|
|
1938
|
+
},
|
|
1940
1939
|
{
|
|
1941
1940
|
"name": "accessibleLabel",
|
|
1942
1941
|
"attribute": "accessible-label",
|
|
@@ -1992,7 +1991,7 @@
|
|
|
1992
1991
|
"attribute": "hide-right-slot",
|
|
1993
1992
|
"description": "Hides the right slot from input.",
|
|
1994
1993
|
"type": "boolean",
|
|
1995
|
-
"default": "
|
|
1994
|
+
"default": "false"
|
|
1996
1995
|
},
|
|
1997
1996
|
{
|
|
1998
1997
|
"name": "inputMask",
|
|
@@ -2389,6 +2388,10 @@
|
|
|
2389
2388
|
}
|
|
2390
2389
|
],
|
|
2391
2390
|
"properties": [
|
|
2391
|
+
{
|
|
2392
|
+
"name": "uniqueId",
|
|
2393
|
+
"type": "number | null"
|
|
2394
|
+
},
|
|
2392
2395
|
{
|
|
2393
2396
|
"name": "accessibleLabel",
|
|
2394
2397
|
"attribute": "accessible-label",
|
|
@@ -2833,6 +2836,10 @@
|
|
|
2833
2836
|
}
|
|
2834
2837
|
],
|
|
2835
2838
|
"properties": [
|
|
2839
|
+
{
|
|
2840
|
+
"name": "uniqueId",
|
|
2841
|
+
"type": "number | null"
|
|
2842
|
+
},
|
|
2836
2843
|
{
|
|
2837
2844
|
"name": "accessibleLabel",
|
|
2838
2845
|
"attribute": "accessible-label",
|
|
@@ -3335,6 +3342,10 @@
|
|
|
3335
3342
|
"description": "Specifies how text should be wrapped when submitted in a form. The `cols` property must be set for `wrap='hard'` to take effect.",
|
|
3336
3343
|
"type": "'hard'|'soft'"
|
|
3337
3344
|
},
|
|
3345
|
+
{
|
|
3346
|
+
"name": "uniqueId",
|
|
3347
|
+
"type": "number | null"
|
|
3348
|
+
},
|
|
3338
3349
|
{
|
|
3339
3350
|
"name": "accessibleLabel",
|
|
3340
3351
|
"attribute": "accessible-label",
|
|
@@ -3783,6 +3794,10 @@
|
|
|
3783
3794
|
}
|
|
3784
3795
|
],
|
|
3785
3796
|
"properties": [
|
|
3797
|
+
{
|
|
3798
|
+
"name": "uniqueId",
|
|
3799
|
+
"type": "number | null"
|
|
3800
|
+
},
|
|
3786
3801
|
{
|
|
3787
3802
|
"name": "accessibleLabel",
|
|
3788
3803
|
"attribute": "accessible-label",
|
|
@@ -4226,6 +4241,10 @@
|
|
|
4226
4241
|
}
|
|
4227
4242
|
],
|
|
4228
4243
|
"properties": [
|
|
4244
|
+
{
|
|
4245
|
+
"name": "uniqueId",
|
|
4246
|
+
"type": "number | null"
|
|
4247
|
+
},
|
|
4229
4248
|
{
|
|
4230
4249
|
"name": "accessibleLabel",
|
|
4231
4250
|
"attribute": "accessible-label",
|
|
@@ -5793,6 +5812,10 @@
|
|
|
5793
5812
|
"type": "boolean",
|
|
5794
5813
|
"default": "false"
|
|
5795
5814
|
},
|
|
5815
|
+
{
|
|
5816
|
+
"name": "uniqueId",
|
|
5817
|
+
"type": "number | null"
|
|
5818
|
+
},
|
|
5796
5819
|
{
|
|
5797
5820
|
"name": "accessibleLabel",
|
|
5798
5821
|
"attribute": "accessible-label",
|
|
@@ -6145,7 +6168,7 @@
|
|
|
6145
6168
|
},
|
|
6146
6169
|
{
|
|
6147
6170
|
"name": "--jh-input-field-color-background",
|
|
6148
|
-
"description": "The input field background-color. Defaults to `--jh-color-container-primary-enabled`."
|
|
6171
|
+
"description": "The input field background-color when in an editable state. This property does not apply when the component is set to `readonly`. Defaults to `--jh-color-container-primary-enabled`."
|
|
6149
6172
|
},
|
|
6150
6173
|
{
|
|
6151
6174
|
"name": "--jh-input-field-color-border-enabled",
|
package/jsconfig.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jack-henry/jh-elements",
|
|
3
3
|
"description": "Jack Henry's design system web components.",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.14",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Banno/jack-henry-design-system.git"
|
|
@@ -23,25 +23,21 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@jack-henry/jh-tokens": "2.0.0-beta.9",
|
|
26
|
-
"@jack-henry/jh-icons": "2.0.0-beta.
|
|
26
|
+
"@jack-henry/jh-icons": "2.0.0-beta.8",
|
|
27
27
|
"lit": "3.3.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@storybook/addon-
|
|
32
|
-
"@storybook/
|
|
33
|
-
"@storybook/blocks": "8.6.17",
|
|
34
|
-
"@storybook/manager-api": "8.6.17",
|
|
35
|
-
"@storybook/theming": "8.6.17",
|
|
36
|
-
"@storybook/web-components": "8.6.17",
|
|
37
|
-
"@storybook/web-components-vite": "8.6.17",
|
|
30
|
+
"@jack-henry/jh-datasets": "2.0.0-beta.1",
|
|
31
|
+
"@storybook/addon-a11y": "10.4.0",
|
|
32
|
+
"@storybook/web-components-vite": "10.4.0",
|
|
38
33
|
"chromatic": "5.8.3",
|
|
39
34
|
"hygen": "6.2.11",
|
|
40
|
-
"storybook": "
|
|
41
|
-
"storybook-addon-tag-badges": "
|
|
42
|
-
"storybook-dark-mode": "4.0.1",
|
|
35
|
+
"storybook": "10.4.0",
|
|
36
|
+
"storybook-addon-tag-badges": "3.1.0",
|
|
43
37
|
"web-component-analyzer": "1.1.6",
|
|
44
|
-
"vite": "5.4.12"
|
|
38
|
+
"vite": "5.4.12",
|
|
39
|
+
"@storybook/addon-docs": "10.4.0",
|
|
40
|
+
"storybook-dark-mode": "5.0.0"
|
|
45
41
|
},
|
|
46
42
|
"scripts": {
|
|
47
43
|
"generate": "hygen component new",
|