@jack-henry/jh-elements 2.0.0-beta.10 → 2.0.0-beta.12
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/README.md +1 -1
- package/components/badge/badge.js +11 -10
- package/components/card/card.js +6 -4
- package/components/checkbox/checkbox.js +4 -4
- package/components/checkbox-group/checkbox-group.js +64 -8
- package/components/input/input.js +45 -18
- package/components/input-email/input-email.js +3 -4
- package/components/menu/menu.js +12 -1
- package/components/radio/radio.js +4 -4
- package/components/radio-group/radio-group.js +61 -6
- package/components/switch/switch.js +4 -4
- package/components/table/table.js +5 -2
- package/components/tooltip/tooltip.js +46 -65
- package/custom-elements.json +73 -42
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,4 +10,4 @@ Contains Jack Henry's web component library. To get started, visit our documenta
|
|
|
10
10
|
|
|
11
11
|
* [Jackhenry.design](https://jackhenry.design) focuses on introducing the underlying concepts of the Design System, usage guidelines, and a style guide.
|
|
12
12
|
* [Storybook](https://main--68f8e6a25b256d0ef89b13e6.chromatic.com/?path=/docs/welcome-about-jh--docs) focuses on technical implementations and considerations
|
|
13
|
-
for engineers
|
|
13
|
+
for engineers including author guidance and a playground where you can test drive our components.
|
|
@@ -7,8 +7,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @cssprop --jh-badge-border-radius - The badge border radius. Defaults to `--jh-border-radius-pill`.
|
|
10
|
-
* @cssprop --jh-badge-color-background-enabled - The badge background color. Defaults to `--jh-color-content-
|
|
11
|
-
* @cssprop --jh-badge-color-text-enabled - The badge text color. Defaults to `--jh-color-content-on-
|
|
10
|
+
* @cssprop --jh-badge-color-background-enabled - The badge background color. Defaults to `--jh-color-content-negative-enabled`.
|
|
11
|
+
* @cssprop --jh-badge-color-text-enabled - The badge text color. Defaults to `--jh-color-content-on-negative-enabled`.
|
|
12
12
|
*
|
|
13
13
|
* @customElement jh-badge
|
|
14
14
|
*/
|
|
@@ -19,8 +19,8 @@ export class JhBadge extends LitElement {
|
|
|
19
19
|
display: inline-flex;
|
|
20
20
|
}
|
|
21
21
|
span {
|
|
22
|
-
background: var(--jh-badge-color-background-enabled, var(--jh-color-content-
|
|
23
|
-
color: var(--jh-badge-color-text-enabled, var(--jh-color-content-on-
|
|
22
|
+
background: var(--jh-badge-color-background-enabled, var(--jh-color-content-negative-enabled));
|
|
23
|
+
color: var(--jh-badge-color-text-enabled, var(--jh-color-content-on-negative-enabled));
|
|
24
24
|
border-radius: var(--jh-badge-border-radius, var(--jh-border-radius-pill));
|
|
25
25
|
min-width: var(--jh-dimension-200);
|
|
26
26
|
height: var(--jh-dimension-200);
|
|
@@ -28,10 +28,10 @@ export class JhBadge extends LitElement {
|
|
|
28
28
|
justify-content: center;
|
|
29
29
|
}
|
|
30
30
|
.count-present {
|
|
31
|
-
font-family: var(--jh-font-helper-
|
|
32
|
-
font-weight: var(--jh-font-helper-
|
|
33
|
-
font-size: var(--jh-font-helper-
|
|
34
|
-
line-height: var(--jh-font-helper-
|
|
31
|
+
font-family: var(--jh-font-helper-bold-font-family);
|
|
32
|
+
font-weight: var(--jh-font-helper-bold-font-weight);
|
|
33
|
+
font-size: var(--jh-font-helper-bold-font-size);
|
|
34
|
+
line-height: var(--jh-font-helper-bold-line-height);
|
|
35
35
|
height: var(--jh-dimension-400);
|
|
36
36
|
padding: var(--jh-dimension-0) var(--jh-dimension-100);
|
|
37
37
|
width: auto;
|
|
@@ -44,7 +44,7 @@ export class JhBadge extends LitElement {
|
|
|
44
44
|
/** Number to show within the badge. If no `count` is supplied, Badge will render as a dot.*/
|
|
45
45
|
count: { type: String },
|
|
46
46
|
/** Sets the max count to show. Appends `+` to the `max-count` when value is exceeded. */
|
|
47
|
-
maxCount: { type:
|
|
47
|
+
maxCount: { type: Number, attribute: 'max-count' },
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -53,7 +53,7 @@ export class JhBadge extends LitElement {
|
|
|
53
53
|
/** @type {?string} */
|
|
54
54
|
this.count = null;
|
|
55
55
|
/** @type {?number} */
|
|
56
|
-
this.maxCount =
|
|
56
|
+
this.maxCount = 99;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
render() {
|
|
@@ -71,3 +71,4 @@ export class JhBadge extends LitElement {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
customElements.define('jh-badge', JhBadge);
|
|
74
|
+
|
package/components/card/card.js
CHANGED
|
@@ -8,8 +8,8 @@ import '../divider/divider.js';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @cssprop --jh-card-color-background - The card background-color. Defaults to `--jh-color-container-primary-enabled`.
|
|
11
|
-
* @cssprop --jh-card-border-radius - The card border-radius. Defaults to `--jh-border-radius-
|
|
12
|
-
* @cssprop --jh-card-
|
|
11
|
+
* @cssprop --jh-card-border-radius - The card border-radius. Defaults to `--jh-border-radius-200`.
|
|
12
|
+
* @cssprop --jh-card-color-border - The card border color. Defaults to `--jh-border-decorative-color`.
|
|
13
13
|
* @cssprop --jh-card-media-aspect-ratio - The media slot aspect-ratio. Defaults to `auto`.
|
|
14
14
|
* @cssprop --jh-card-media-space-padding - The media slot padding. Defaults to `0`.
|
|
15
15
|
* @cssprop --jh-card-header-color-text - The header text color. Defaults to `--jh-color-content-primary-enabled`.
|
|
@@ -35,7 +35,7 @@ export class JhCard extends LitElement {
|
|
|
35
35
|
static get styles() {
|
|
36
36
|
return css`
|
|
37
37
|
:host {
|
|
38
|
-
--border-radius: var(--jh-border-radius-
|
|
38
|
+
--border-radius: var(--jh-border-radius-200);
|
|
39
39
|
background-color: var(
|
|
40
40
|
--jh-card-color-background,
|
|
41
41
|
var(--jh-color-container-primary-enabled)
|
|
@@ -44,7 +44,9 @@ export class JhCard extends LitElement {
|
|
|
44
44
|
--jh-card-border-radius,
|
|
45
45
|
var(--border-radius)
|
|
46
46
|
);
|
|
47
|
-
|
|
47
|
+
border-color: var(--jh-card-color-border, var(--jh-border-decorative-color));
|
|
48
|
+
border-width: var(--jh-border-decorative-width);
|
|
49
|
+
border-style: var(--jh-border-decorative-style);
|
|
48
50
|
word-break: break-word;
|
|
49
51
|
display: block;
|
|
50
52
|
}
|
|
@@ -76,10 +76,10 @@ export class JhCheckbox extends LitElement {
|
|
|
76
76
|
static get styles() {
|
|
77
77
|
return css`
|
|
78
78
|
:host {
|
|
79
|
-
font-family: var(--jh-font-body-
|
|
80
|
-
font-weight: var(--jh-font-body-
|
|
81
|
-
font-size: var(--jh-font-body-
|
|
82
|
-
line-height: var(--jh-font-body-
|
|
79
|
+
font-family: var(--jh-font-body-medium-1-font-family);
|
|
80
|
+
font-weight: var(--jh-font-body-medium-1-font-weight);
|
|
81
|
+
font-size: var(--jh-font-body-medium-1-font-size);
|
|
82
|
+
line-height: var(--jh-font-body-medium-1-line-height);
|
|
83
83
|
display: inline-flex;
|
|
84
84
|
position: relative;
|
|
85
85
|
}
|
|
@@ -9,6 +9,7 @@ let id = 0;
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* @cssprop --jh-checkbox-group-label-color-text - The label text color. Defaults to `--jh-color-content-primary-enabled`.
|
|
12
|
+
* @cssprop --jh-checkbox-group-opacity-disabled - The opacity of the checkbox group when disabled. Defaults to `--jh-opacity-disabled`.
|
|
12
13
|
* @cssprop --jh-checkbox-group-required-color-text - The required indicator color.
|
|
13
14
|
* Defaults to `--jh-color-content-negative-enabled`.
|
|
14
15
|
* @cssprop --jh-checkbox-group-required-color-text-optional - The optional indicator text color.
|
|
@@ -29,10 +30,14 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
29
30
|
static get styles() {
|
|
30
31
|
return css`
|
|
31
32
|
:host {
|
|
32
|
-
font-family: var(--jh-font-helper-regular-font-family);
|
|
33
|
-
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
34
|
-
font-size: var(--jh-font-helper-regular-font-size);
|
|
35
|
-
line-height: var(--jh-font-helper-regular-line-height);
|
|
33
|
+
--checkbox-group-helper-regular-font-family: var(--jh-font-helper-regular-font-family);
|
|
34
|
+
--checkbox-group-helper-regular-font-weight: var(--jh-font-helper-regular-font-weight);
|
|
35
|
+
--checkbox-group-helper-regular-font-size: var(--jh-font-helper-regular-font-size);
|
|
36
|
+
--checkbox-group-helper-regular-line-height: var(--jh-font-helper-regular-line-height);
|
|
37
|
+
font-family: var(--checkbox-group-helper-regular-font-family);
|
|
38
|
+
font-weight: var(--checkbox-group-helper-regular-font-weight);
|
|
39
|
+
font-size: var(--checkbox-group-helper-regular-font-size);
|
|
40
|
+
line-height: var(--checkbox-group-helper-regular-line-height);
|
|
36
41
|
display: block;
|
|
37
42
|
}
|
|
38
43
|
/* reset fieldset and legend for styling */
|
|
@@ -41,6 +46,21 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
41
46
|
padding: 0;
|
|
42
47
|
margin: 0;
|
|
43
48
|
}
|
|
49
|
+
:host([disabled]) {
|
|
50
|
+
--group-disabled-opacity: var(
|
|
51
|
+
--jh-checkbox-group-opacity-disabled,
|
|
52
|
+
var(--jh-opacity-disabled)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
:host([disabled]) .label,
|
|
56
|
+
:host([disabled]) .helper-text,
|
|
57
|
+
:host([disabled]) .error-text {
|
|
58
|
+
opacity: var(--group-disabled-opacity);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
:host([disabled]) ::slotted(jh-checkbox) {
|
|
62
|
+
--jh-checkbox-opacity-disabled: var(--group-disabled-opacity);
|
|
63
|
+
}
|
|
44
64
|
:host legend {
|
|
45
65
|
padding: 0;
|
|
46
66
|
}
|
|
@@ -75,6 +95,10 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
75
95
|
--jh-checkbox-group-label-color-text,
|
|
76
96
|
var(--jh-color-content-primary-enabled)
|
|
77
97
|
);
|
|
98
|
+
font-family: var(--jh-font-helper-medium-font-family);
|
|
99
|
+
font-weight: var(--jh-font-helper-medium-font-weight);
|
|
100
|
+
font-size: var(--jh-font-helper-medium-font-size);
|
|
101
|
+
line-height: var(--jh-font-helper-medium-line-height);
|
|
78
102
|
}
|
|
79
103
|
.helper-text {
|
|
80
104
|
color: var(
|
|
@@ -83,7 +107,6 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
83
107
|
);
|
|
84
108
|
margin: 0;
|
|
85
109
|
}
|
|
86
|
-
.label-text,
|
|
87
110
|
.helper-text,
|
|
88
111
|
:host([invalid]) .error-text {
|
|
89
112
|
word-break: break-word;
|
|
@@ -100,6 +123,10 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
100
123
|
--jh-checkbox-group-required-color-text-optional,
|
|
101
124
|
var(--jh-color-content-primary-enabled)
|
|
102
125
|
);
|
|
126
|
+
font-family: var(--checkbox-group-helper-regular-font-family);
|
|
127
|
+
font-weight: var(--checkbox-group-helper-regular-font-weight);
|
|
128
|
+
font-size: var(--checkbox-group-helper-regular-font-size);
|
|
129
|
+
line-height: var(--checkbox-group-helper-regular-line-height);
|
|
103
130
|
}
|
|
104
131
|
:host([show-indicator][required]) .indicator {
|
|
105
132
|
color: var(
|
|
@@ -116,6 +143,11 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
116
143
|
type: String,
|
|
117
144
|
attribute: 'accessible-label',
|
|
118
145
|
},
|
|
146
|
+
/** Disables the checkbox group and prevents all user interactions. May cause the group to be ignored by assistive technologies (AT). */
|
|
147
|
+
disabled: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
reflect: true,
|
|
150
|
+
},
|
|
119
151
|
/** Text to be displayed when checkbox group has failed validation and `invalid` is true. */
|
|
120
152
|
errorText: {
|
|
121
153
|
type: String,
|
|
@@ -159,17 +191,19 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
159
191
|
}
|
|
160
192
|
constructor() {
|
|
161
193
|
super();
|
|
194
|
+
/** @type {boolean} */
|
|
195
|
+
this.disabled = false;
|
|
162
196
|
/** @type {?string} */
|
|
163
197
|
this.accessibleLabel = null;
|
|
164
198
|
/** @type {?string} */
|
|
165
199
|
this.errorText = null;
|
|
166
200
|
/** @type {?string} */
|
|
167
201
|
this.helperText = null;
|
|
168
|
-
/** @type {?
|
|
202
|
+
/** @type {?boolean} */
|
|
169
203
|
this.invalid = false;
|
|
170
204
|
/** @type {?string} */
|
|
171
205
|
this.label = null;
|
|
172
|
-
/** @type {?
|
|
206
|
+
/** @type {?boolean} */
|
|
173
207
|
this.required = false;
|
|
174
208
|
/** @type {'vertical'|'horizontal'} */
|
|
175
209
|
this.orientation = 'vertical';
|
|
@@ -182,6 +216,27 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
182
216
|
this.#id = id++;
|
|
183
217
|
}
|
|
184
218
|
|
|
219
|
+
firstUpdated() {
|
|
220
|
+
const slot = this.renderRoot?.querySelector('slot');
|
|
221
|
+
this.#syncDisabledToChildren();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
updated(changedProperties) {
|
|
225
|
+
if (changedProperties.has('disabled')) {
|
|
226
|
+
this.#syncDisabledToChildren();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
#syncDisabledToChildren() {
|
|
231
|
+
const slot = this.renderRoot?.querySelector('slot');
|
|
232
|
+
if(!slot) return;
|
|
233
|
+
|
|
234
|
+
const checkboxes = slot.assignedElements().filter(el => el.tagName === 'JH-CHECKBOX');
|
|
235
|
+
checkboxes.forEach(checkbox => {
|
|
236
|
+
checkbox.disabled = this.disabled;
|
|
237
|
+
})
|
|
238
|
+
}
|
|
239
|
+
|
|
185
240
|
#getAriaDescribedBy() {
|
|
186
241
|
if (this.errorText && this.invalid && this.helperText && this.label) {
|
|
187
242
|
return `checkbox-group-error-${this.#id} checkbox-group-helper-${
|
|
@@ -230,9 +285,10 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
230
285
|
aria-describedby=${ifDefined(this.#getAriaDescribedBy())}
|
|
231
286
|
?required=${this.required}
|
|
232
287
|
aria-invalid=${ifDefined(this.invalid ? 'true' : null)}
|
|
288
|
+
aria-disabled=${ifDefined(this.disabled ? 'true' : null)}
|
|
233
289
|
aria-label=${ifDefined(this.accessibleLabel)}>
|
|
234
290
|
${label}
|
|
235
|
-
<div class="controls"><slot></slot></div>
|
|
291
|
+
<div class="controls"><slot @slotchange=${() => this.#syncDisabledToChildren()} ></slot></div>
|
|
236
292
|
${errorText}
|
|
237
293
|
</fieldset>
|
|
238
294
|
`;
|
|
@@ -91,14 +91,20 @@ export class JhInput extends LitElement {
|
|
|
91
91
|
// alphanumeric characters -> usernames, product codes, etc.
|
|
92
92
|
'*': /[A-Za-z0-9]/,
|
|
93
93
|
};
|
|
94
|
+
/** @type {Map} */
|
|
95
|
+
#activeSlottedElement = new Map();
|
|
94
96
|
|
|
95
97
|
static get styles() {
|
|
96
98
|
return css`
|
|
97
99
|
:host {
|
|
98
|
-
font-family: var(--jh-font-helper-regular-font-family);
|
|
99
|
-
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
100
|
-
font-size: var(--jh-font-helper-regular-font-size);
|
|
101
|
-
line-height: var(--jh-font-helper-regular-line-height);
|
|
100
|
+
--input-helper-regular-font-family: var(--jh-font-helper-regular-font-family);
|
|
101
|
+
--input-helper-regular-font-weight: var(--jh-font-helper-regular-font-weight);
|
|
102
|
+
--input-helper-regular-font-size: var(--jh-font-helper-regular-font-size);
|
|
103
|
+
--input-helper-regular-line-height: var(--jh-font-helper-regular-line-height);
|
|
104
|
+
font-family: var(--input-helper-regular-font-family);
|
|
105
|
+
font-weight: var(--input-helper-regular-font-weight);
|
|
106
|
+
font-size: var(--input-helper-regular-font-size);
|
|
107
|
+
line-height: var(--input-helper-regular-line-height);
|
|
102
108
|
display: inline-block;
|
|
103
109
|
width: 100%;
|
|
104
110
|
--jh-button-size: var(--jh-dimension-800);
|
|
@@ -119,6 +125,10 @@ export class JhInput extends LitElement {
|
|
|
119
125
|
--jh-input-label-color-text,
|
|
120
126
|
var(--jh-color-content-primary-enabled)
|
|
121
127
|
);
|
|
128
|
+
font-family: var(--jh-font-helper-medium-font-family);
|
|
129
|
+
font-weight: var(--jh-font-helper-medium-font-weight);
|
|
130
|
+
font-size: var(--jh-font-helper-medium-font-size);
|
|
131
|
+
line-height: var(--jh-font-helper-medium-line-height);
|
|
122
132
|
display: block;
|
|
123
133
|
}
|
|
124
134
|
.helper-text {
|
|
@@ -329,6 +339,10 @@ export class JhInput extends LitElement {
|
|
|
329
339
|
--jh-input-optional-color-text,
|
|
330
340
|
var(--jh-color-content-primary-enabled)
|
|
331
341
|
);
|
|
342
|
+
font-family: var(--input-helper-regular-font-family);
|
|
343
|
+
font-weight: var(--input-helper-regular-font-weight);
|
|
344
|
+
font-size: var(--input-helper-regular-font-size);
|
|
345
|
+
line-height: var(--input-helper-regular-line-height);
|
|
332
346
|
}
|
|
333
347
|
:host([show-indicator][required]) span {
|
|
334
348
|
color: var(
|
|
@@ -368,7 +382,7 @@ export class JhInput extends LitElement {
|
|
|
368
382
|
hideLeftSlot: { type: Boolean, attribute: 'hide-left-slot' },
|
|
369
383
|
/** Hides the right slot from input. */
|
|
370
384
|
hideRightSlot: { type: Boolean, attribute: 'hide-right-slot' },
|
|
371
|
-
/** Formats
|
|
385
|
+
/** Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details. */
|
|
372
386
|
inputMask: { type: String, attribute: 'input-mask' },
|
|
373
387
|
/** Indicates expected input value type and allows for browsers to display appropriate virtual keyboard.
|
|
374
388
|
*
|
|
@@ -464,6 +478,7 @@ export class JhInput extends LitElement {
|
|
|
464
478
|
|
|
465
479
|
disconnectedCallback() {
|
|
466
480
|
super.disconnectedCallback();
|
|
481
|
+
this.#resizeObserver.disconnect();
|
|
467
482
|
if (this.inputMask) {
|
|
468
483
|
this.removeEventListener('jh-select', this.#setSelection);
|
|
469
484
|
}
|
|
@@ -1048,27 +1063,39 @@ export class JhInput extends LitElement {
|
|
|
1048
1063
|
);
|
|
1049
1064
|
}
|
|
1050
1065
|
|
|
1051
|
-
|
|
1066
|
+
// capture dimensions of slotted content and set CSS variables to adjust input padding and vertically center slotted content
|
|
1067
|
+
#resizeObserver = new ResizeObserver((entries) => {
|
|
1052
1068
|
let inputEl = this.shadowRoot.querySelector('input');
|
|
1053
|
-
let slottedElement = e.target.assignedElements()[0];
|
|
1054
|
-
let slotName = e.target.name;
|
|
1055
1069
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1070
|
+
for (let entry of entries) {
|
|
1071
|
+
let slottedEl = entry.target;
|
|
1072
|
+
let slottedElWidth = entry.borderBoxSize[0].inlineSize;
|
|
1073
|
+
let slottedElHeight = entry.borderBoxSize[0].blockSize;
|
|
1074
|
+
|
|
1075
|
+
this.style.setProperty(`--${slottedEl.slot}-width`, `${slottedElWidth}px`);
|
|
1076
|
+
|
|
1077
|
+
this.style.setProperty(`--${slottedEl.slot}-top`, `${(inputEl.offsetHeight - slottedElHeight) / 2}px`);
|
|
1058
1078
|
}
|
|
1079
|
+
});
|
|
1059
1080
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1081
|
+
#handleSlotChange(e) {
|
|
1082
|
+
let newSlottedElement = e.target.assignedElements()[0];
|
|
1083
|
+
let slotName = e.target.name;
|
|
1084
|
+
|
|
1085
|
+
// stop observing previous slotted element for each slot
|
|
1086
|
+
if (this.#activeSlottedElement.has(slotName)) {
|
|
1087
|
+
this.#resizeObserver.unobserve(this.#activeSlottedElement.get(slotName));
|
|
1088
|
+
}
|
|
1063
1089
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1090
|
+
if (newSlottedElement) {
|
|
1091
|
+
this.#activeSlottedElement.set(slotName, newSlottedElement);
|
|
1066
1092
|
|
|
1067
|
-
|
|
1068
|
-
|
|
1093
|
+
if (newSlottedElement.tagName.startsWith('JH-ICON')) {
|
|
1094
|
+
newSlottedElement.setAttribute('size', 'medium');
|
|
1069
1095
|
}
|
|
1096
|
+
this.#resizeObserver.observe(newSlottedElement);
|
|
1070
1097
|
}
|
|
1071
|
-
this.#addClass(slotName,
|
|
1098
|
+
this.#addClass(slotName, newSlottedElement);
|
|
1072
1099
|
}
|
|
1073
1100
|
|
|
1074
1101
|
// sets class on input element so padding can accomodate slotted content
|
|
@@ -9,10 +9,9 @@ import { JhInput } from '../input/input.js';
|
|
|
9
9
|
* @customElement jh-input-email
|
|
10
10
|
*/
|
|
11
11
|
export class JhInputEmail extends JhInput {
|
|
12
|
-
|
|
13
|
-
super
|
|
14
|
-
|
|
15
|
-
inputEl.setAttribute('type', 'email');
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.inputmode = 'email';
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
customElements.define('jh-input-email', JhInputEmail);
|
package/components/menu/menu.js
CHANGED
|
@@ -45,6 +45,13 @@ export class JhMenu extends LitElement {
|
|
|
45
45
|
display: flex;
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
position: relative;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
height: 100%;
|
|
50
|
+
}
|
|
51
|
+
.menu-content {
|
|
52
|
+
flex: 1;
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
width: 100%;
|
|
48
55
|
}
|
|
49
56
|
`;
|
|
50
57
|
}
|
|
@@ -54,7 +61,11 @@ export class JhMenu extends LitElement {
|
|
|
54
61
|
this.#internals.role = 'menu';
|
|
55
62
|
}
|
|
56
63
|
render() {
|
|
57
|
-
return html
|
|
64
|
+
return html`
|
|
65
|
+
<div class="menu-content">
|
|
66
|
+
<slot></slot>
|
|
67
|
+
</div>
|
|
68
|
+
`;
|
|
58
69
|
}
|
|
59
70
|
}
|
|
60
71
|
customElements.define('jh-menu', JhMenu);
|
|
@@ -74,10 +74,10 @@ export class JhRadio extends LitElement {
|
|
|
74
74
|
static get styles() {
|
|
75
75
|
return css`
|
|
76
76
|
:host {
|
|
77
|
-
font-family: var(--jh-font-body-
|
|
78
|
-
font-weight: var(--jh-font-body-
|
|
79
|
-
font-size: var(--jh-font-body-
|
|
80
|
-
line-height: var(--jh-font-body-
|
|
77
|
+
font-family: var(--jh-font-body-medium-1-font-family);
|
|
78
|
+
font-weight: var(--jh-font-body-medium-1-font-weight);
|
|
79
|
+
font-size: var(--jh-font-body-medium-1-font-size);
|
|
80
|
+
line-height: var(--jh-font-body-medium-1-line-height);
|
|
81
81
|
display: inline-flex;
|
|
82
82
|
position: relative;
|
|
83
83
|
}
|
|
@@ -17,6 +17,7 @@ let id = 0;
|
|
|
17
17
|
* Defaults to `--jh-color-content-secondary-enabled`.
|
|
18
18
|
* @cssprop --jh-radio-group-error-color-text - The error-text text color.
|
|
19
19
|
* Defaults to `--jh-color-content-negative-enabled`.
|
|
20
|
+
* @cssprop --jh-radio-group-opacity-disabled - The opacity of the radio group when disabled. Defaults to `--jh-opacity-disabled`.
|
|
20
21
|
*
|
|
21
22
|
* @slot default - Use to insert `<jh-radio>` components(s).
|
|
22
23
|
*
|
|
@@ -39,10 +40,14 @@ export class JhRadioGroup extends LitElement {
|
|
|
39
40
|
static get styles() {
|
|
40
41
|
return css`
|
|
41
42
|
:host {
|
|
42
|
-
font-family: var(--jh-font-helper-regular-font-family);
|
|
43
|
-
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
44
|
-
font-size: var(--jh-font-helper-regular-font-size);
|
|
45
|
-
line-height: var(--jh-font-helper-regular-line-height);
|
|
43
|
+
--radio-group-helper-regular-font-family: var(--jh-font-helper-regular-font-family);
|
|
44
|
+
--radio-group-helper-regular-font-weight: var(--jh-font-helper-regular-font-weight);
|
|
45
|
+
--radio-group-helper-regular-font-size: var(--jh-font-helper-regular-font-size);
|
|
46
|
+
--radio-group-helper-regular-line-height: var(--jh-font-helper-regular-line-height);
|
|
47
|
+
font-family: var(--radio-group-helper-regular-font-family);
|
|
48
|
+
font-weight: var(--radio-group-helper-regular-font-weight);
|
|
49
|
+
font-size: var(--radio-group-helper-regular-font-size);
|
|
50
|
+
line-height: var(--radio-group-helper-regular-line-height);
|
|
46
51
|
display: block;
|
|
47
52
|
}
|
|
48
53
|
/* reset styling on fieldset and legend */
|
|
@@ -51,6 +56,18 @@ export class JhRadioGroup extends LitElement {
|
|
|
51
56
|
padding: 0;
|
|
52
57
|
margin: 0;
|
|
53
58
|
}
|
|
59
|
+
:host([disabled]) {
|
|
60
|
+
--group-disabled-opacity: var(--jh-radio-group-opacity-disabled, var(--jh-opacity-disabled));
|
|
61
|
+
}
|
|
62
|
+
:host([disabled]) .label,
|
|
63
|
+
:host([disabled]) .helper-text,
|
|
64
|
+
:host([disabled]) .error-text {
|
|
65
|
+
opacity: var(--group-disabled-opacity);
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
}
|
|
68
|
+
:host([disabled]) ::slotted(jh-radio) {
|
|
69
|
+
--jh-radio-opacity-disabled: var(--group-disabled-opacity);
|
|
70
|
+
}
|
|
54
71
|
:host legend {
|
|
55
72
|
padding: 0;
|
|
56
73
|
}
|
|
@@ -85,6 +102,10 @@ export class JhRadioGroup extends LitElement {
|
|
|
85
102
|
--jh-radio-group-label-color-text,
|
|
86
103
|
var(--jh-color-content-primary-enabled)
|
|
87
104
|
);
|
|
105
|
+
font-family: var(--jh-font-helper-medium-font-family);
|
|
106
|
+
font-weight: var(--jh-font-helper-medium-font-weight);
|
|
107
|
+
font-size: var(--jh-font-helper-medium-font-size);
|
|
108
|
+
line-height: var(--jh-font-helper-medium-line-height);
|
|
88
109
|
}
|
|
89
110
|
.helper-text {
|
|
90
111
|
color: var(
|
|
@@ -110,6 +131,10 @@ export class JhRadioGroup extends LitElement {
|
|
|
110
131
|
--jh-radio-group-required-color-text-optional,
|
|
111
132
|
var(--jh-color-content-primary-enabled)
|
|
112
133
|
);
|
|
134
|
+
font-family: var(--radio-group-helper-regular-font-family);
|
|
135
|
+
font-weight: var(--radio-group-helper-regular-font-weight);
|
|
136
|
+
font-size: var(--radio-group-helper-regular-font-size);
|
|
137
|
+
line-height: var(--radio-group-helper-regular-line-height);
|
|
113
138
|
}
|
|
114
139
|
:host([show-indicator][required]) .indicator {
|
|
115
140
|
color: var(
|
|
@@ -126,6 +151,11 @@ export class JhRadioGroup extends LitElement {
|
|
|
126
151
|
type: String,
|
|
127
152
|
attribute: 'accessible-label',
|
|
128
153
|
},
|
|
154
|
+
/** Disables the radio group and prevents all user interactions. May cause the group to be ignored by assistive technologies (AT). */
|
|
155
|
+
disabled: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
reflect: true
|
|
158
|
+
},
|
|
129
159
|
/** Text to be displayed when radio group has failed validation and `invalid` is true. */
|
|
130
160
|
errorText: {
|
|
131
161
|
type: String,
|
|
@@ -181,17 +211,19 @@ export class JhRadioGroup extends LitElement {
|
|
|
181
211
|
this.#internals = this.attachInternals();
|
|
182
212
|
/** @type {?string} */
|
|
183
213
|
this.accessibleLabel = null;
|
|
214
|
+
/** @type {boolean} */
|
|
215
|
+
this.disabled = false;
|
|
184
216
|
/** @type {?string} */
|
|
185
217
|
this.errorText = null;
|
|
186
218
|
/** @type {?string} */
|
|
187
219
|
this.helperText = null;
|
|
188
|
-
/** @type {?
|
|
220
|
+
/** @type {?boolean} */
|
|
189
221
|
this.invalid = false;
|
|
190
222
|
/** @type {?string} */
|
|
191
223
|
this.label = null;
|
|
192
224
|
/** @type {?string} */
|
|
193
225
|
this.name = null;
|
|
194
|
-
/** @type {?
|
|
226
|
+
/** @type {?boolean} */
|
|
195
227
|
this.required = false;
|
|
196
228
|
/** @type {'vertical'|'horizontal'} */
|
|
197
229
|
this.orientation = 'vertical';
|
|
@@ -210,6 +242,16 @@ export class JhRadioGroup extends LitElement {
|
|
|
210
242
|
this.#id = id++;
|
|
211
243
|
}
|
|
212
244
|
|
|
245
|
+
firstUpdated() {
|
|
246
|
+
this._syncDisabledToChildren();
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
updated(changedProperties) {
|
|
250
|
+
if (changedProperties.has('disabled')) {
|
|
251
|
+
this._syncDisabledToChildren();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
213
255
|
/**
|
|
214
256
|
* Returns the radio group's parent form element.
|
|
215
257
|
* @type {?HTMLFormElement}
|
|
@@ -237,6 +279,16 @@ export class JhRadioGroup extends LitElement {
|
|
|
237
279
|
this.requestUpdate('value', oldValue);
|
|
238
280
|
}
|
|
239
281
|
|
|
282
|
+
_syncDisabledToChildren() {
|
|
283
|
+
const slot = this.renderRoot.querySelector('slot');
|
|
284
|
+
if(!slot) return;
|
|
285
|
+
|
|
286
|
+
const radios = slot.assignedElements().filter((el) => el.tagName === 'JH-RADIO');
|
|
287
|
+
radios.forEach((radio) => {
|
|
288
|
+
radio.disabled = this.disabled;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
240
292
|
#getRadios() {
|
|
241
293
|
return [...this.querySelectorAll('jh-radio')];
|
|
242
294
|
}
|
|
@@ -260,6 +312,8 @@ export class JhRadioGroup extends LitElement {
|
|
|
260
312
|
if (!this.#checked) {
|
|
261
313
|
radios[0].tabIndex = 0;
|
|
262
314
|
}
|
|
315
|
+
|
|
316
|
+
this._syncDisabledToChildren();
|
|
263
317
|
}
|
|
264
318
|
|
|
265
319
|
#handleChange(e) {
|
|
@@ -384,6 +438,7 @@ export class JhRadioGroup extends LitElement {
|
|
|
384
438
|
role="radiogroup"
|
|
385
439
|
id=${ifDefined(this.label ? `radio-group-label-${this.#id}` : null)}
|
|
386
440
|
aria-describedby=${ifDefined(this.#getAriaDescribedBy())}
|
|
441
|
+
aria-disabled=${ifDefined(this.disabled ? 'true' : null)}
|
|
387
442
|
aria-required=${ifDefined(this.required ? 'true' : 'false')}
|
|
388
443
|
aria-invalid=${ifDefined(this.invalid ? 'true' : null)}
|
|
389
444
|
aria-label=${ifDefined(this.accessibleLabel)}
|
|
@@ -35,10 +35,10 @@ export class JhSwitch extends LitElement {
|
|
|
35
35
|
static get styles() {
|
|
36
36
|
return css`
|
|
37
37
|
:host {
|
|
38
|
-
font-family: var(--jh-font-body-
|
|
39
|
-
font-weight: var(--jh-font-body-
|
|
40
|
-
font-size: var(--jh-font-body-
|
|
41
|
-
line-height: var(--jh-font-body-
|
|
38
|
+
font-family: var(--jh-font-body-medium-1-font-family);
|
|
39
|
+
font-weight: var(--jh-font-body-medium-1-font-weight);
|
|
40
|
+
font-size: var(--jh-font-body-medium-1-font-size);
|
|
41
|
+
line-height: var(--jh-font-body-medium-1-line-height);
|
|
42
42
|
display: inline-flex;
|
|
43
43
|
position: relative;
|
|
44
44
|
}
|
|
@@ -132,6 +132,7 @@ export class JhTable extends LitElement {
|
|
|
132
132
|
:host([sticky-header]) .header {
|
|
133
133
|
position: sticky;
|
|
134
134
|
top: 0;
|
|
135
|
+
z-index: 1000;
|
|
135
136
|
}
|
|
136
137
|
:host([sticky-footer]) .footer {
|
|
137
138
|
--jh-table-data-cell-color-border-top: var(
|
|
@@ -139,6 +140,7 @@ export class JhTable extends LitElement {
|
|
|
139
140
|
);
|
|
140
141
|
position: sticky;
|
|
141
142
|
bottom: 0;
|
|
143
|
+
z-index: 1000;
|
|
142
144
|
}
|
|
143
145
|
:host([sticky-footer]) .body::slotted(jh-table-row:nth-last-of-type(2)) {
|
|
144
146
|
--jh-table-data-cell-color-border-bottom: transparent;
|
|
@@ -178,8 +180,10 @@ export class JhTable extends LitElement {
|
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
:host([scrollable]) .table-container {
|
|
181
|
-
overflow:
|
|
183
|
+
overflow: auto;
|
|
182
184
|
height: 100%;
|
|
185
|
+
/* keeps space reserved for vertical scrollbar */
|
|
186
|
+
scrollbar-gutter: stable;
|
|
183
187
|
/* removes bouncy scroll behavior in Safari and FF */
|
|
184
188
|
/* overscroll-behavior: none; */
|
|
185
189
|
}
|
|
@@ -293,7 +297,6 @@ export class JhTable extends LitElement {
|
|
|
293
297
|
async firstUpdated() {
|
|
294
298
|
if (!this.scrollable) return;
|
|
295
299
|
|
|
296
|
-
const container = this.shadowRoot.querySelector('.table-container');
|
|
297
300
|
let scrollTable = this.shadowRoot.querySelector('.table');
|
|
298
301
|
await scrollTable.updateComplete;
|
|
299
302
|
let originalTableWidth = scrollTable.getBoundingClientRect().width;
|
|
@@ -13,6 +13,7 @@ const openAttr = 'open';
|
|
|
13
13
|
* @cssprop --jh-tooltip-color-text - The tooltip text color. Defaults to `--jh-color-content-on-primary-enabled`.
|
|
14
14
|
*
|
|
15
15
|
* @slot default - Use to insert the element that triggers the tooltip.
|
|
16
|
+
* @slot jh-tooltip-content - Use to insert the content of the tooltip.
|
|
16
17
|
*
|
|
17
18
|
* @customElement jh-tooltip
|
|
18
19
|
*/
|
|
@@ -37,10 +38,10 @@ export class JhTooltip extends LitElement {
|
|
|
37
38
|
);
|
|
38
39
|
border-radius: var(--jh-border-radius-100);
|
|
39
40
|
padding: var(--jh-dimension-200);
|
|
40
|
-
font-family: var(--jh-font-helper-
|
|
41
|
-
font-weight: var(--jh-font-helper-
|
|
42
|
-
font-size: var(--jh-font-helper-
|
|
43
|
-
line-height: var(--jh-font-helper-
|
|
41
|
+
font-family: var(--jh-font-helper-bold-font-family);
|
|
42
|
+
font-weight: var(--jh-font-helper-bold-font-weight);
|
|
43
|
+
font-size: var(--jh-font-helper-bold-font-size);
|
|
44
|
+
line-height: var(--jh-font-helper-bold-line-height);
|
|
44
45
|
max-width: 160px;
|
|
45
46
|
width: max-content;
|
|
46
47
|
position: absolute;
|
|
@@ -204,12 +205,6 @@ export class JhTooltip extends LitElement {
|
|
|
204
205
|
type: Boolean,
|
|
205
206
|
attribute: 'flip-disabled',
|
|
206
207
|
},
|
|
207
|
-
/**
|
|
208
|
-
* Provides information about the item which triggered the tooltip.
|
|
209
|
-
*/
|
|
210
|
-
label: {
|
|
211
|
-
type: String,
|
|
212
|
-
},
|
|
213
208
|
/**
|
|
214
209
|
* Determines whether the tooltip is open or closed. Can be set on the tooltip to force it open.
|
|
215
210
|
*/
|
|
@@ -232,8 +227,6 @@ export class JhTooltip extends LitElement {
|
|
|
232
227
|
this.#internals = this.attachInternals();
|
|
233
228
|
/**@type {?Boolean} */
|
|
234
229
|
this.flipDisabled = false;
|
|
235
|
-
/** @type {?string} */
|
|
236
|
-
this.label = null;
|
|
237
230
|
/**@type {?Boolean} */
|
|
238
231
|
this.open = false;
|
|
239
232
|
/** @type {?string} */
|
|
@@ -244,39 +237,6 @@ export class JhTooltip extends LitElement {
|
|
|
244
237
|
super.connectedCallback();
|
|
245
238
|
/** @ignore */
|
|
246
239
|
this.id = `tooltip-describedby-${id++}`;
|
|
247
|
-
let observer = new MutationObserver(this.#handleEmptyLabel.bind(this));
|
|
248
|
-
let options = {
|
|
249
|
-
childList: true,
|
|
250
|
-
};
|
|
251
|
-
observer.observe(this.shadowRoot, options);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
#handleEmptyLabel(mutations) {
|
|
255
|
-
for (let mutation of mutations) {
|
|
256
|
-
const addedNodes = Array.from(mutation.addedNodes);
|
|
257
|
-
//check if any of the added nodes is a span
|
|
258
|
-
const spanAdded = addedNodes.some(
|
|
259
|
-
(addedNode) => addedNode.tagName === 'SPAN'
|
|
260
|
-
);
|
|
261
|
-
|
|
262
|
-
if (spanAdded) {
|
|
263
|
-
this.#internals.role = 'tooltip';
|
|
264
|
-
this.addEventListener('focus', this.#handleOpenTooltip, true);
|
|
265
|
-
this.addEventListener('mouseenter', this.#handleOpenTooltip);
|
|
266
|
-
this.addEventListener('blur', this.#handleCloseTooltip, true);
|
|
267
|
-
this.addEventListener('mouseleave', this.#handleCloseTooltip);
|
|
268
|
-
this.addEventListener('keydown', this.#handleKeyDown);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (mutation.removedNodes.length > 0) {
|
|
272
|
-
this.#internals.role = '';
|
|
273
|
-
this.removeEventListener('focus', this.#handleOpenTooltip);
|
|
274
|
-
this.removeEventListener('mouseenter', this.#handleOpenTooltip);
|
|
275
|
-
this.removeEventListener('blur', this.#handleCloseTooltip);
|
|
276
|
-
this.removeEventListener('mouseleave', this.#handleCloseTooltip);
|
|
277
|
-
this.removeEventListener('keydown', this.#handleKeyDown);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
240
|
}
|
|
281
241
|
|
|
282
242
|
disconnectedCallback() {
|
|
@@ -288,13 +248,42 @@ export class JhTooltip extends LitElement {
|
|
|
288
248
|
this.removeEventListener('keydown', this.#handleKeyDown);
|
|
289
249
|
}
|
|
290
250
|
|
|
291
|
-
#
|
|
251
|
+
#handleContentSlotChange(e) {
|
|
252
|
+
const slot = e.target;
|
|
253
|
+
const hasContent = slot.assignedNodes().length > 0;
|
|
254
|
+
|
|
255
|
+
if (hasContent) {
|
|
256
|
+
this.#internals.role = 'tooltip';
|
|
257
|
+
this.addEventListener('focus', this.#handleOpenTooltip, true);
|
|
258
|
+
this.addEventListener('mouseenter', this.#handleOpenTooltip);
|
|
259
|
+
this.addEventListener('blur', this.#handleCloseTooltip, true);
|
|
260
|
+
this.addEventListener('mouseleave', this.#handleCloseTooltip);
|
|
261
|
+
this.addEventListener('keydown', this.#handleKeyDown);
|
|
262
|
+
} else {
|
|
263
|
+
this.#internals.role = '';
|
|
264
|
+
this.#handleCloseTooltip();
|
|
265
|
+
this.removeEventListener('focus', this.#handleOpenTooltip);
|
|
266
|
+
this.removeEventListener('mouseenter', this.#handleOpenTooltip);
|
|
267
|
+
this.removeEventListener('blur', this.#handleCloseTooltip);
|
|
268
|
+
this.removeEventListener('mouseleave', this.#handleCloseTooltip);
|
|
269
|
+
this.removeEventListener('keydown', this.#handleKeyDown);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
#handleSlotChange(e) {
|
|
292
274
|
//get id set previously in the constructor and set it to reference aria-describedby on the first element in the slot
|
|
293
275
|
const tooltipId = this.getAttribute('id');
|
|
294
|
-
|
|
276
|
+
const slottedElements = e.target.assignedElements();
|
|
277
|
+
const tooltipContent = this.shadowRoot.querySelector('slot[name="jh-tooltip-content"]').assignedElements();
|
|
278
|
+
|
|
279
|
+
if (slottedElements.length === 0 || tooltipContent.length === 0) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const triggerElement = slottedElements[0];
|
|
283
|
+
triggerElement.setAttribute('aria-describedby', tooltipId);
|
|
295
284
|
|
|
296
285
|
//get display property of element in slot and set it on the jh-tooltip.
|
|
297
|
-
const tooltipDisplay = window.getComputedStyle(
|
|
286
|
+
const tooltipDisplay = window.getComputedStyle(triggerElement).display;
|
|
298
287
|
this.style.setProperty('display', tooltipDisplay );
|
|
299
288
|
}
|
|
300
289
|
|
|
@@ -323,7 +312,7 @@ export class JhTooltip extends LitElement {
|
|
|
323
312
|
//check if current position is a valid position otherwise make it fail.
|
|
324
313
|
if (!['left', 'right', 'top-start', 'top-end', 'top-center', 'bottom-start', 'bottom-end', 'bottom-center'].includes(currentPosition)) return;
|
|
325
314
|
|
|
326
|
-
if (this.flipDisabled === false
|
|
315
|
+
if (this.flipDisabled === false) {
|
|
327
316
|
|
|
328
317
|
//break current position into tooltop position and arrow position
|
|
329
318
|
const [currentTooltip, currentArrow] = currentPosition.split('-');
|
|
@@ -450,10 +439,10 @@ export class JhTooltip extends LitElement {
|
|
|
450
439
|
#getDimensions() {
|
|
451
440
|
return {
|
|
452
441
|
tooltipWidth: this.shadowRoot
|
|
453
|
-
.querySelector('
|
|
442
|
+
.querySelector('.content')
|
|
454
443
|
.getBoundingClientRect().width,
|
|
455
444
|
tooltipHeight: this.shadowRoot
|
|
456
|
-
.querySelector('
|
|
445
|
+
.querySelector('.content')
|
|
457
446
|
.getBoundingClientRect().height,
|
|
458
447
|
elemHeight: this.getBoundingClientRect().height,
|
|
459
448
|
elemWidth: this.getBoundingClientRect().width,
|
|
@@ -475,22 +464,14 @@ export class JhTooltip extends LitElement {
|
|
|
475
464
|
}
|
|
476
465
|
|
|
477
466
|
render() {
|
|
478
|
-
let label;
|
|
479
|
-
|
|
480
|
-
if (this.label) {
|
|
481
|
-
label = html`
|
|
482
|
-
<span
|
|
483
|
-
class=${ifDefined(this.open ? 'show' : null)}
|
|
484
|
-
aria-hidden=${this.open ? 'false' : 'true'}
|
|
485
|
-
>
|
|
486
|
-
${this.label}
|
|
487
|
-
</span>
|
|
488
|
-
`;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
467
|
return html`
|
|
492
468
|
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
493
|
-
|
|
469
|
+
<span
|
|
470
|
+
class="content ${ifDefined(this.open ? 'show' : null)}"
|
|
471
|
+
aria-hidden=${this.open ? 'false' : 'true'}>
|
|
472
|
+
<slot name="jh-tooltip-content" @slotchange=${this.#handleContentSlotChange}></slot>
|
|
473
|
+
</span>
|
|
474
|
+
|
|
494
475
|
`;
|
|
495
476
|
}
|
|
496
477
|
}
|
package/custom-elements.json
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
{
|
|
14
14
|
"name": "max-count",
|
|
15
15
|
"description": "Sets the max count to show. Appends `+` to the `max-count` when value is exceeded.",
|
|
16
|
-
"type": "?number"
|
|
16
|
+
"type": "?number",
|
|
17
|
+
"default": "99"
|
|
17
18
|
}
|
|
18
19
|
],
|
|
19
20
|
"properties": [
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
"name": "maxCount",
|
|
28
29
|
"attribute": "max-count",
|
|
29
30
|
"description": "Sets the max count to show. Appends `+` to the `max-count` when value is exceeded.",
|
|
30
|
-
"type": "?number"
|
|
31
|
+
"type": "?number",
|
|
32
|
+
"default": "99"
|
|
31
33
|
}
|
|
32
34
|
],
|
|
33
35
|
"cssProperties": [
|
|
@@ -37,11 +39,11 @@
|
|
|
37
39
|
},
|
|
38
40
|
{
|
|
39
41
|
"name": "--jh-badge-color-background-enabled",
|
|
40
|
-
"description": "The badge background color. Defaults to `--jh-color-content-
|
|
42
|
+
"description": "The badge background color. Defaults to `--jh-color-content-negative-enabled`."
|
|
41
43
|
},
|
|
42
44
|
{
|
|
43
45
|
"name": "--jh-badge-color-text-enabled",
|
|
44
|
-
"description": "The badge text color. Defaults to `--jh-color-content-on-
|
|
46
|
+
"description": "The badge text color. Defaults to `--jh-color-content-on-negative-enabled`."
|
|
45
47
|
}
|
|
46
48
|
]
|
|
47
49
|
},
|
|
@@ -741,11 +743,11 @@
|
|
|
741
743
|
},
|
|
742
744
|
{
|
|
743
745
|
"name": "--jh-card-border-radius",
|
|
744
|
-
"description": "The card border-radius. Defaults to `--jh-border-radius-
|
|
746
|
+
"description": "The card border-radius. Defaults to `--jh-border-radius-200`."
|
|
745
747
|
},
|
|
746
748
|
{
|
|
747
|
-
"name": "--jh-card-
|
|
748
|
-
"description": "The card
|
|
749
|
+
"name": "--jh-card-color-border",
|
|
750
|
+
"description": "The card border color. Defaults to `--jh-border-decorative-color`."
|
|
749
751
|
},
|
|
750
752
|
{
|
|
751
753
|
"name": "--jh-card-media-aspect-ratio",
|
|
@@ -793,6 +795,12 @@
|
|
|
793
795
|
"name": "jh-checkbox-group",
|
|
794
796
|
"path": "./components/checkbox-group/checkbox-group.js",
|
|
795
797
|
"attributes": [
|
|
798
|
+
{
|
|
799
|
+
"name": "disabled",
|
|
800
|
+
"description": "Disables the checkbox group and prevents all user interactions. May cause the group to be ignored by assistive technologies (AT).",
|
|
801
|
+
"type": "boolean",
|
|
802
|
+
"default": "false"
|
|
803
|
+
},
|
|
796
804
|
{
|
|
797
805
|
"name": "accessible-label",
|
|
798
806
|
"description": "Sets an `aria-label` to assist screen reader users when no visible label is present.",
|
|
@@ -811,7 +819,7 @@
|
|
|
811
819
|
{
|
|
812
820
|
"name": "invalid",
|
|
813
821
|
"description": "Sets an `aria-invalid` on the checkbox group to indicate the value supplied was invalid and displays `error-text` when set.",
|
|
814
|
-
"type": "?
|
|
822
|
+
"type": "?boolean",
|
|
815
823
|
"default": "false"
|
|
816
824
|
},
|
|
817
825
|
{
|
|
@@ -822,7 +830,7 @@
|
|
|
822
830
|
{
|
|
823
831
|
"name": "required",
|
|
824
832
|
"description": "Indicates a value is required.",
|
|
825
|
-
"type": "?
|
|
833
|
+
"type": "?boolean",
|
|
826
834
|
"default": "false"
|
|
827
835
|
},
|
|
828
836
|
{
|
|
@@ -839,6 +847,13 @@
|
|
|
839
847
|
}
|
|
840
848
|
],
|
|
841
849
|
"properties": [
|
|
850
|
+
{
|
|
851
|
+
"name": "disabled",
|
|
852
|
+
"attribute": "disabled",
|
|
853
|
+
"description": "Disables the checkbox group and prevents all user interactions. May cause the group to be ignored by assistive technologies (AT).",
|
|
854
|
+
"type": "boolean",
|
|
855
|
+
"default": "false"
|
|
856
|
+
},
|
|
842
857
|
{
|
|
843
858
|
"name": "accessibleLabel",
|
|
844
859
|
"attribute": "accessible-label",
|
|
@@ -861,7 +876,7 @@
|
|
|
861
876
|
"name": "invalid",
|
|
862
877
|
"attribute": "invalid",
|
|
863
878
|
"description": "Sets an `aria-invalid` on the checkbox group to indicate the value supplied was invalid and displays `error-text` when set.",
|
|
864
|
-
"type": "?
|
|
879
|
+
"type": "?boolean",
|
|
865
880
|
"default": "false"
|
|
866
881
|
},
|
|
867
882
|
{
|
|
@@ -874,7 +889,7 @@
|
|
|
874
889
|
"name": "required",
|
|
875
890
|
"attribute": "required",
|
|
876
891
|
"description": "Indicates a value is required.",
|
|
877
|
-
"type": "?
|
|
892
|
+
"type": "?boolean",
|
|
878
893
|
"default": "false"
|
|
879
894
|
},
|
|
880
895
|
{
|
|
@@ -903,6 +918,10 @@
|
|
|
903
918
|
"name": "--jh-checkbox-group-label-color-text",
|
|
904
919
|
"description": "The label text color. Defaults to `--jh-color-content-primary-enabled`."
|
|
905
920
|
},
|
|
921
|
+
{
|
|
922
|
+
"name": "--jh-checkbox-group-opacity-disabled",
|
|
923
|
+
"description": "The opacity of the checkbox group when disabled. Defaults to `--jh-opacity-disabled`."
|
|
924
|
+
},
|
|
906
925
|
{
|
|
907
926
|
"name": "--jh-checkbox-group-required-color-text",
|
|
908
927
|
"description": "The required indicator color.\nDefaults to `--jh-color-content-negative-enabled`."
|
|
@@ -1361,13 +1380,14 @@
|
|
|
1361
1380
|
},
|
|
1362
1381
|
{
|
|
1363
1382
|
"name": "input-mask",
|
|
1364
|
-
"description": "Formats
|
|
1383
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
1365
1384
|
"type": "?string"
|
|
1366
1385
|
},
|
|
1367
1386
|
{
|
|
1368
1387
|
"name": "inputmode",
|
|
1369
1388
|
"description": "Indicates expected input value type and allows for browsers to display appropriate virtual keyboard.\n\n[Visit MDN for information on supported inputmode values](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)",
|
|
1370
|
-
"type": "?string"
|
|
1389
|
+
"type": "?string",
|
|
1390
|
+
"default": "\"email\""
|
|
1371
1391
|
},
|
|
1372
1392
|
{
|
|
1373
1393
|
"name": "invalid",
|
|
@@ -1498,14 +1518,15 @@
|
|
|
1498
1518
|
{
|
|
1499
1519
|
"name": "inputMask",
|
|
1500
1520
|
"attribute": "input-mask",
|
|
1501
|
-
"description": "Formats
|
|
1521
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
1502
1522
|
"type": "?string"
|
|
1503
1523
|
},
|
|
1504
1524
|
{
|
|
1505
1525
|
"name": "inputmode",
|
|
1506
1526
|
"attribute": "inputmode",
|
|
1507
1527
|
"description": "Indicates expected input value type and allows for browsers to display appropriate virtual keyboard.\n\n[Visit MDN for information on supported inputmode values](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)",
|
|
1508
|
-
"type": "?string"
|
|
1528
|
+
"type": "?string",
|
|
1529
|
+
"default": "\"email\""
|
|
1509
1530
|
},
|
|
1510
1531
|
{
|
|
1511
1532
|
"name": "invalid",
|
|
@@ -1820,7 +1841,7 @@
|
|
|
1820
1841
|
},
|
|
1821
1842
|
{
|
|
1822
1843
|
"name": "input-mask",
|
|
1823
|
-
"description": "Formats
|
|
1844
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
1824
1845
|
"type": "?string"
|
|
1825
1846
|
},
|
|
1826
1847
|
{
|
|
@@ -1976,7 +1997,7 @@
|
|
|
1976
1997
|
{
|
|
1977
1998
|
"name": "inputMask",
|
|
1978
1999
|
"attribute": "input-mask",
|
|
1979
|
-
"description": "Formats
|
|
2000
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
1980
2001
|
"type": "?string"
|
|
1981
2002
|
},
|
|
1982
2003
|
{
|
|
@@ -2291,7 +2312,7 @@
|
|
|
2291
2312
|
},
|
|
2292
2313
|
{
|
|
2293
2314
|
"name": "input-mask",
|
|
2294
|
-
"description": "Formats
|
|
2315
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
2295
2316
|
"type": "?string"
|
|
2296
2317
|
},
|
|
2297
2318
|
{
|
|
@@ -2428,7 +2449,7 @@
|
|
|
2428
2449
|
{
|
|
2429
2450
|
"name": "inputMask",
|
|
2430
2451
|
"attribute": "input-mask",
|
|
2431
|
-
"description": "Formats
|
|
2452
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
2432
2453
|
"type": "?string"
|
|
2433
2454
|
},
|
|
2434
2455
|
{
|
|
@@ -2735,7 +2756,7 @@
|
|
|
2735
2756
|
},
|
|
2736
2757
|
{
|
|
2737
2758
|
"name": "input-mask",
|
|
2738
|
-
"description": "Formats
|
|
2759
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
2739
2760
|
"type": "?string"
|
|
2740
2761
|
},
|
|
2741
2762
|
{
|
|
@@ -2872,7 +2893,7 @@
|
|
|
2872
2893
|
{
|
|
2873
2894
|
"name": "inputMask",
|
|
2874
2895
|
"attribute": "input-mask",
|
|
2875
|
-
"description": "Formats
|
|
2896
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
2876
2897
|
"type": "?string"
|
|
2877
2898
|
},
|
|
2878
2899
|
{
|
|
@@ -3204,7 +3225,7 @@
|
|
|
3204
3225
|
},
|
|
3205
3226
|
{
|
|
3206
3227
|
"name": "input-mask",
|
|
3207
|
-
"description": "Formats
|
|
3228
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
3208
3229
|
"type": "?string"
|
|
3209
3230
|
},
|
|
3210
3231
|
{
|
|
@@ -3372,7 +3393,7 @@
|
|
|
3372
3393
|
{
|
|
3373
3394
|
"name": "inputMask",
|
|
3374
3395
|
"attribute": "input-mask",
|
|
3375
|
-
"description": "Formats
|
|
3396
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
3376
3397
|
"type": "?string"
|
|
3377
3398
|
},
|
|
3378
3399
|
{
|
|
@@ -3683,7 +3704,7 @@
|
|
|
3683
3704
|
},
|
|
3684
3705
|
{
|
|
3685
3706
|
"name": "input-mask",
|
|
3686
|
-
"description": "Formats
|
|
3707
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
3687
3708
|
"type": "?string"
|
|
3688
3709
|
},
|
|
3689
3710
|
{
|
|
@@ -3820,7 +3841,7 @@
|
|
|
3820
3841
|
{
|
|
3821
3842
|
"name": "inputMask",
|
|
3822
3843
|
"attribute": "input-mask",
|
|
3823
|
-
"description": "Formats
|
|
3844
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
3824
3845
|
"type": "?string"
|
|
3825
3846
|
},
|
|
3826
3847
|
{
|
|
@@ -4126,7 +4147,7 @@
|
|
|
4126
4147
|
},
|
|
4127
4148
|
{
|
|
4128
4149
|
"name": "input-mask",
|
|
4129
|
-
"description": "Formats
|
|
4150
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
4130
4151
|
"type": "?string"
|
|
4131
4152
|
},
|
|
4132
4153
|
{
|
|
@@ -4263,7 +4284,7 @@
|
|
|
4263
4284
|
{
|
|
4264
4285
|
"name": "inputMask",
|
|
4265
4286
|
"attribute": "input-mask",
|
|
4266
|
-
"description": "Formats
|
|
4287
|
+
"description": "Formats user entered data on input based on fixed lengths. This property does not support dynamic formatting or pasted values. See the input mask documentation above for implementation details.",
|
|
4267
4288
|
"type": "?string"
|
|
4268
4289
|
},
|
|
4269
4290
|
{
|
|
@@ -5227,6 +5248,12 @@
|
|
|
5227
5248
|
"description": "Sets an `aria-label` to assist screen reader users when no visible label is present.",
|
|
5228
5249
|
"type": "?string"
|
|
5229
5250
|
},
|
|
5251
|
+
{
|
|
5252
|
+
"name": "disabled",
|
|
5253
|
+
"description": "Disables the radio group and prevents all user interactions. May cause the group to be ignored by assistive technologies (AT).",
|
|
5254
|
+
"type": "?Boolean",
|
|
5255
|
+
"default": "false"
|
|
5256
|
+
},
|
|
5230
5257
|
{
|
|
5231
5258
|
"name": "error-text",
|
|
5232
5259
|
"description": "Text to be displayed when radio group has failed validation and `invalid` is true.",
|
|
@@ -5240,7 +5267,7 @@
|
|
|
5240
5267
|
{
|
|
5241
5268
|
"name": "invalid",
|
|
5242
5269
|
"description": "Sets an `aria-invalid` on the radio group to indicate the value supplied was invalid and displays `error-text` when set.",
|
|
5243
|
-
"type": "?
|
|
5270
|
+
"type": "?boolean",
|
|
5244
5271
|
"default": "false"
|
|
5245
5272
|
},
|
|
5246
5273
|
{
|
|
@@ -5256,7 +5283,7 @@
|
|
|
5256
5283
|
{
|
|
5257
5284
|
"name": "required",
|
|
5258
5285
|
"description": "Indicates a value is required.",
|
|
5259
|
-
"type": "?
|
|
5286
|
+
"type": "?boolean",
|
|
5260
5287
|
"default": "false"
|
|
5261
5288
|
},
|
|
5262
5289
|
{
|
|
@@ -5289,6 +5316,13 @@
|
|
|
5289
5316
|
"description": "Sets an `aria-label` to assist screen reader users when no visible label is present.",
|
|
5290
5317
|
"type": "?string"
|
|
5291
5318
|
},
|
|
5319
|
+
{
|
|
5320
|
+
"name": "disabled",
|
|
5321
|
+
"attribute": "disabled",
|
|
5322
|
+
"description": "Disables the radio group and prevents all user interactions. May cause the group to be ignored by assistive technologies (AT).",
|
|
5323
|
+
"type": "?Boolean",
|
|
5324
|
+
"default": "false"
|
|
5325
|
+
},
|
|
5292
5326
|
{
|
|
5293
5327
|
"name": "errorText",
|
|
5294
5328
|
"attribute": "error-text",
|
|
@@ -5305,7 +5339,7 @@
|
|
|
5305
5339
|
"name": "invalid",
|
|
5306
5340
|
"attribute": "invalid",
|
|
5307
5341
|
"description": "Sets an `aria-invalid` on the radio group to indicate the value supplied was invalid and displays `error-text` when set.",
|
|
5308
|
-
"type": "?
|
|
5342
|
+
"type": "?boolean",
|
|
5309
5343
|
"default": "false"
|
|
5310
5344
|
},
|
|
5311
5345
|
{
|
|
@@ -5324,7 +5358,7 @@
|
|
|
5324
5358
|
"name": "required",
|
|
5325
5359
|
"attribute": "required",
|
|
5326
5360
|
"description": "Indicates a value is required.",
|
|
5327
|
-
"type": "?
|
|
5361
|
+
"type": "?boolean",
|
|
5328
5362
|
"default": "false"
|
|
5329
5363
|
},
|
|
5330
5364
|
{
|
|
@@ -5380,6 +5414,10 @@
|
|
|
5380
5414
|
{
|
|
5381
5415
|
"name": "--jh-radio-group-error-color-text",
|
|
5382
5416
|
"description": "The error-text text color. \nDefaults to `--jh-color-content-negative-enabled`."
|
|
5417
|
+
},
|
|
5418
|
+
{
|
|
5419
|
+
"name": "--jh-radio-group-opacity-disabled",
|
|
5420
|
+
"description": "The opacity of the radio group when disabled. Defaults to `--jh-opacity-disabled`."
|
|
5383
5421
|
}
|
|
5384
5422
|
]
|
|
5385
5423
|
},
|
|
@@ -6824,11 +6862,6 @@
|
|
|
6824
6862
|
"type": "?Boolean",
|
|
6825
6863
|
"default": "false"
|
|
6826
6864
|
},
|
|
6827
|
-
{
|
|
6828
|
-
"name": "label",
|
|
6829
|
-
"description": "Provides information about the item which triggered the tooltip.",
|
|
6830
|
-
"type": "?string"
|
|
6831
|
-
},
|
|
6832
6865
|
{
|
|
6833
6866
|
"name": "open",
|
|
6834
6867
|
"description": "Determines whether the tooltip is open or closed. Can be set on the tooltip to force it open.",
|
|
@@ -6850,12 +6883,6 @@
|
|
|
6850
6883
|
"type": "?Boolean",
|
|
6851
6884
|
"default": "false"
|
|
6852
6885
|
},
|
|
6853
|
-
{
|
|
6854
|
-
"name": "label",
|
|
6855
|
-
"attribute": "label",
|
|
6856
|
-
"description": "Provides information about the item which triggered the tooltip.",
|
|
6857
|
-
"type": "?string"
|
|
6858
|
-
},
|
|
6859
6886
|
{
|
|
6860
6887
|
"name": "open",
|
|
6861
6888
|
"attribute": "open",
|
|
@@ -6875,6 +6902,10 @@
|
|
|
6875
6902
|
{
|
|
6876
6903
|
"name": "default",
|
|
6877
6904
|
"description": "Use to insert the element that triggers the tooltip."
|
|
6905
|
+
},
|
|
6906
|
+
{
|
|
6907
|
+
"name": "jh-tooltip-content",
|
|
6908
|
+
"description": "Use to insert the content of the tooltip."
|
|
6878
6909
|
}
|
|
6879
6910
|
],
|
|
6880
6911
|
"cssProperties": [
|
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.12",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Banno/jack-henry-design-system.git"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"NOTICE"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@jack-henry/jh-tokens": "2.0.0-beta.
|
|
25
|
+
"@jack-henry/jh-tokens": "2.0.0-beta.9",
|
|
26
26
|
"@jack-henry/jh-icons": "2.0.0-beta.7",
|
|
27
27
|
"lit": "3.3.1"
|
|
28
28
|
},
|