@jack-henry/jh-elements 2.0.0-beta.11 → 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/components/checkbox-group/checkbox-group.js +16 -4
- package/components/input/input.js +17 -5
- package/components/input-email/input-email.js +3 -4
- package/components/menu/menu.js +12 -1
- package/components/radio-group/radio-group.js +61 -6
- package/components/tooltip/tooltip.js +46 -65
- package/custom-elements.json +43 -31
- package/package.json +2 -2
|
@@ -30,10 +30,14 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
30
30
|
static get styles() {
|
|
31
31
|
return css`
|
|
32
32
|
:host {
|
|
33
|
-
font-family: var(--jh-font-helper-regular-font-family);
|
|
34
|
-
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
35
|
-
font-size: var(--jh-font-helper-regular-font-size);
|
|
36
|
-
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);
|
|
37
41
|
display: block;
|
|
38
42
|
}
|
|
39
43
|
/* reset fieldset and legend for styling */
|
|
@@ -91,6 +95,10 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
91
95
|
--jh-checkbox-group-label-color-text,
|
|
92
96
|
var(--jh-color-content-primary-enabled)
|
|
93
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);
|
|
94
102
|
}
|
|
95
103
|
.helper-text {
|
|
96
104
|
color: var(
|
|
@@ -115,6 +123,10 @@ export class JhCheckboxGroup extends LitElement {
|
|
|
115
123
|
--jh-checkbox-group-required-color-text-optional,
|
|
116
124
|
var(--jh-color-content-primary-enabled)
|
|
117
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);
|
|
118
130
|
}
|
|
119
131
|
:host([show-indicator][required]) .indicator {
|
|
120
132
|
color: var(
|
|
@@ -97,10 +97,14 @@ export class JhInput extends LitElement {
|
|
|
97
97
|
static get styles() {
|
|
98
98
|
return css`
|
|
99
99
|
:host {
|
|
100
|
-
font-family: var(--jh-font-helper-regular-font-family);
|
|
101
|
-
font-weight: var(--jh-font-helper-regular-font-weight);
|
|
102
|
-
font-size: var(--jh-font-helper-regular-font-size);
|
|
103
|
-
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);
|
|
104
108
|
display: inline-block;
|
|
105
109
|
width: 100%;
|
|
106
110
|
--jh-button-size: var(--jh-dimension-800);
|
|
@@ -121,6 +125,10 @@ export class JhInput extends LitElement {
|
|
|
121
125
|
--jh-input-label-color-text,
|
|
122
126
|
var(--jh-color-content-primary-enabled)
|
|
123
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);
|
|
124
132
|
display: block;
|
|
125
133
|
}
|
|
126
134
|
.helper-text {
|
|
@@ -331,6 +339,10 @@ export class JhInput extends LitElement {
|
|
|
331
339
|
--jh-input-optional-color-text,
|
|
332
340
|
var(--jh-color-content-primary-enabled)
|
|
333
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);
|
|
334
346
|
}
|
|
335
347
|
:host([show-indicator][required]) span {
|
|
336
348
|
color: var(
|
|
@@ -370,7 +382,7 @@ export class JhInput extends LitElement {
|
|
|
370
382
|
hideLeftSlot: { type: Boolean, attribute: 'hide-left-slot' },
|
|
371
383
|
/** Hides the right slot from input. */
|
|
372
384
|
hideRightSlot: { type: Boolean, attribute: 'hide-right-slot' },
|
|
373
|
-
/** 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. */
|
|
374
386
|
inputMask: { type: String, attribute: 'input-mask' },
|
|
375
387
|
/** Indicates expected input value type and allows for browsers to display appropriate virtual keyboard.
|
|
376
388
|
*
|
|
@@ -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);
|
|
@@ -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)}
|
|
@@ -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
|
@@ -1380,13 +1380,14 @@
|
|
|
1380
1380
|
},
|
|
1381
1381
|
{
|
|
1382
1382
|
"name": "input-mask",
|
|
1383
|
-
"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.",
|
|
1384
1384
|
"type": "?string"
|
|
1385
1385
|
},
|
|
1386
1386
|
{
|
|
1387
1387
|
"name": "inputmode",
|
|
1388
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)",
|
|
1389
|
-
"type": "?string"
|
|
1389
|
+
"type": "?string",
|
|
1390
|
+
"default": "\"email\""
|
|
1390
1391
|
},
|
|
1391
1392
|
{
|
|
1392
1393
|
"name": "invalid",
|
|
@@ -1517,14 +1518,15 @@
|
|
|
1517
1518
|
{
|
|
1518
1519
|
"name": "inputMask",
|
|
1519
1520
|
"attribute": "input-mask",
|
|
1520
|
-
"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.",
|
|
1521
1522
|
"type": "?string"
|
|
1522
1523
|
},
|
|
1523
1524
|
{
|
|
1524
1525
|
"name": "inputmode",
|
|
1525
1526
|
"attribute": "inputmode",
|
|
1526
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)",
|
|
1527
|
-
"type": "?string"
|
|
1528
|
+
"type": "?string",
|
|
1529
|
+
"default": "\"email\""
|
|
1528
1530
|
},
|
|
1529
1531
|
{
|
|
1530
1532
|
"name": "invalid",
|
|
@@ -1839,7 +1841,7 @@
|
|
|
1839
1841
|
},
|
|
1840
1842
|
{
|
|
1841
1843
|
"name": "input-mask",
|
|
1842
|
-
"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.",
|
|
1843
1845
|
"type": "?string"
|
|
1844
1846
|
},
|
|
1845
1847
|
{
|
|
@@ -1995,7 +1997,7 @@
|
|
|
1995
1997
|
{
|
|
1996
1998
|
"name": "inputMask",
|
|
1997
1999
|
"attribute": "input-mask",
|
|
1998
|
-
"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.",
|
|
1999
2001
|
"type": "?string"
|
|
2000
2002
|
},
|
|
2001
2003
|
{
|
|
@@ -2310,7 +2312,7 @@
|
|
|
2310
2312
|
},
|
|
2311
2313
|
{
|
|
2312
2314
|
"name": "input-mask",
|
|
2313
|
-
"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.",
|
|
2314
2316
|
"type": "?string"
|
|
2315
2317
|
},
|
|
2316
2318
|
{
|
|
@@ -2447,7 +2449,7 @@
|
|
|
2447
2449
|
{
|
|
2448
2450
|
"name": "inputMask",
|
|
2449
2451
|
"attribute": "input-mask",
|
|
2450
|
-
"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.",
|
|
2451
2453
|
"type": "?string"
|
|
2452
2454
|
},
|
|
2453
2455
|
{
|
|
@@ -2754,7 +2756,7 @@
|
|
|
2754
2756
|
},
|
|
2755
2757
|
{
|
|
2756
2758
|
"name": "input-mask",
|
|
2757
|
-
"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.",
|
|
2758
2760
|
"type": "?string"
|
|
2759
2761
|
},
|
|
2760
2762
|
{
|
|
@@ -2891,7 +2893,7 @@
|
|
|
2891
2893
|
{
|
|
2892
2894
|
"name": "inputMask",
|
|
2893
2895
|
"attribute": "input-mask",
|
|
2894
|
-
"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.",
|
|
2895
2897
|
"type": "?string"
|
|
2896
2898
|
},
|
|
2897
2899
|
{
|
|
@@ -3223,7 +3225,7 @@
|
|
|
3223
3225
|
},
|
|
3224
3226
|
{
|
|
3225
3227
|
"name": "input-mask",
|
|
3226
|
-
"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.",
|
|
3227
3229
|
"type": "?string"
|
|
3228
3230
|
},
|
|
3229
3231
|
{
|
|
@@ -3391,7 +3393,7 @@
|
|
|
3391
3393
|
{
|
|
3392
3394
|
"name": "inputMask",
|
|
3393
3395
|
"attribute": "input-mask",
|
|
3394
|
-
"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.",
|
|
3395
3397
|
"type": "?string"
|
|
3396
3398
|
},
|
|
3397
3399
|
{
|
|
@@ -3702,7 +3704,7 @@
|
|
|
3702
3704
|
},
|
|
3703
3705
|
{
|
|
3704
3706
|
"name": "input-mask",
|
|
3705
|
-
"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.",
|
|
3706
3708
|
"type": "?string"
|
|
3707
3709
|
},
|
|
3708
3710
|
{
|
|
@@ -3839,7 +3841,7 @@
|
|
|
3839
3841
|
{
|
|
3840
3842
|
"name": "inputMask",
|
|
3841
3843
|
"attribute": "input-mask",
|
|
3842
|
-
"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.",
|
|
3843
3845
|
"type": "?string"
|
|
3844
3846
|
},
|
|
3845
3847
|
{
|
|
@@ -4145,7 +4147,7 @@
|
|
|
4145
4147
|
},
|
|
4146
4148
|
{
|
|
4147
4149
|
"name": "input-mask",
|
|
4148
|
-
"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.",
|
|
4149
4151
|
"type": "?string"
|
|
4150
4152
|
},
|
|
4151
4153
|
{
|
|
@@ -4282,7 +4284,7 @@
|
|
|
4282
4284
|
{
|
|
4283
4285
|
"name": "inputMask",
|
|
4284
4286
|
"attribute": "input-mask",
|
|
4285
|
-
"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.",
|
|
4286
4288
|
"type": "?string"
|
|
4287
4289
|
},
|
|
4288
4290
|
{
|
|
@@ -5246,6 +5248,12 @@
|
|
|
5246
5248
|
"description": "Sets an `aria-label` to assist screen reader users when no visible label is present.",
|
|
5247
5249
|
"type": "?string"
|
|
5248
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
|
+
},
|
|
5249
5257
|
{
|
|
5250
5258
|
"name": "error-text",
|
|
5251
5259
|
"description": "Text to be displayed when radio group has failed validation and `invalid` is true.",
|
|
@@ -5259,7 +5267,7 @@
|
|
|
5259
5267
|
{
|
|
5260
5268
|
"name": "invalid",
|
|
5261
5269
|
"description": "Sets an `aria-invalid` on the radio group to indicate the value supplied was invalid and displays `error-text` when set.",
|
|
5262
|
-
"type": "?
|
|
5270
|
+
"type": "?boolean",
|
|
5263
5271
|
"default": "false"
|
|
5264
5272
|
},
|
|
5265
5273
|
{
|
|
@@ -5275,7 +5283,7 @@
|
|
|
5275
5283
|
{
|
|
5276
5284
|
"name": "required",
|
|
5277
5285
|
"description": "Indicates a value is required.",
|
|
5278
|
-
"type": "?
|
|
5286
|
+
"type": "?boolean",
|
|
5279
5287
|
"default": "false"
|
|
5280
5288
|
},
|
|
5281
5289
|
{
|
|
@@ -5308,6 +5316,13 @@
|
|
|
5308
5316
|
"description": "Sets an `aria-label` to assist screen reader users when no visible label is present.",
|
|
5309
5317
|
"type": "?string"
|
|
5310
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
|
+
},
|
|
5311
5326
|
{
|
|
5312
5327
|
"name": "errorText",
|
|
5313
5328
|
"attribute": "error-text",
|
|
@@ -5324,7 +5339,7 @@
|
|
|
5324
5339
|
"name": "invalid",
|
|
5325
5340
|
"attribute": "invalid",
|
|
5326
5341
|
"description": "Sets an `aria-invalid` on the radio group to indicate the value supplied was invalid and displays `error-text` when set.",
|
|
5327
|
-
"type": "?
|
|
5342
|
+
"type": "?boolean",
|
|
5328
5343
|
"default": "false"
|
|
5329
5344
|
},
|
|
5330
5345
|
{
|
|
@@ -5343,7 +5358,7 @@
|
|
|
5343
5358
|
"name": "required",
|
|
5344
5359
|
"attribute": "required",
|
|
5345
5360
|
"description": "Indicates a value is required.",
|
|
5346
|
-
"type": "?
|
|
5361
|
+
"type": "?boolean",
|
|
5347
5362
|
"default": "false"
|
|
5348
5363
|
},
|
|
5349
5364
|
{
|
|
@@ -5399,6 +5414,10 @@
|
|
|
5399
5414
|
{
|
|
5400
5415
|
"name": "--jh-radio-group-error-color-text",
|
|
5401
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`."
|
|
5402
5421
|
}
|
|
5403
5422
|
]
|
|
5404
5423
|
},
|
|
@@ -6843,11 +6862,6 @@
|
|
|
6843
6862
|
"type": "?Boolean",
|
|
6844
6863
|
"default": "false"
|
|
6845
6864
|
},
|
|
6846
|
-
{
|
|
6847
|
-
"name": "label",
|
|
6848
|
-
"description": "Provides information about the item which triggered the tooltip.",
|
|
6849
|
-
"type": "?string"
|
|
6850
|
-
},
|
|
6851
6865
|
{
|
|
6852
6866
|
"name": "open",
|
|
6853
6867
|
"description": "Determines whether the tooltip is open or closed. Can be set on the tooltip to force it open.",
|
|
@@ -6869,12 +6883,6 @@
|
|
|
6869
6883
|
"type": "?Boolean",
|
|
6870
6884
|
"default": "false"
|
|
6871
6885
|
},
|
|
6872
|
-
{
|
|
6873
|
-
"name": "label",
|
|
6874
|
-
"attribute": "label",
|
|
6875
|
-
"description": "Provides information about the item which triggered the tooltip.",
|
|
6876
|
-
"type": "?string"
|
|
6877
|
-
},
|
|
6878
6886
|
{
|
|
6879
6887
|
"name": "open",
|
|
6880
6888
|
"attribute": "open",
|
|
@@ -6894,6 +6902,10 @@
|
|
|
6894
6902
|
{
|
|
6895
6903
|
"name": "default",
|
|
6896
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."
|
|
6897
6909
|
}
|
|
6898
6910
|
],
|
|
6899
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
|
},
|