@nldd/design-system 0.8.100 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +325 -16
- package/dist/components/actions/button/button.d.ts +5 -3
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.i18n.d.ts +3 -1
- package/dist/components/actions/button/button.i18n.d.ts.map +1 -1
- package/dist/components/actions/button/button.i18n.js +3 -1
- package/dist/components/actions/button/button.i18n.js.map +1 -1
- package/dist/components/actions/button/button.js +1 -1
- package/dist/components/actions/button/button.styles.js +2 -2
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +9 -10
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +5 -3
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts +3 -1
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.js +3 -1
- package/dist/components/actions/icon-button/icon-button.i18n.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +1 -1
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +7 -7
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +1 -1
- package/dist/components/actions/toolbar/toolbar.i18n.d.ts +3 -1
- package/dist/components/actions/toolbar/toolbar.i18n.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.i18n.js +3 -1
- package/dist/components/actions/toolbar/toolbar.i18n.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +4 -2
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/components.js +357 -122
- package/dist/components/content/avatar/avatar.d.ts +5 -3
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.i18n.d.ts +3 -1
- package/dist/components/content/avatar/avatar.i18n.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.i18n.js +3 -1
- package/dist/components/content/avatar/avatar.i18n.js.map +1 -1
- package/dist/components/content/avatar/avatar.js +1 -1
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.template.js +6 -6
- package/dist/components/content/avatar/avatar.template.js.map +1 -1
- package/dist/components/{icon-button-BtU8DX64.js → icon-button-BVhiOwX9.js} +10 -5
- package/dist/components/layout/card/card.d.ts +6 -4
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.i18n.d.ts +3 -1
- package/dist/components/layout/card/card.i18n.d.ts.map +1 -1
- package/dist/components/layout/card/card.i18n.js +3 -1
- package/dist/components/layout/card/card.i18n.js.map +1 -1
- package/dist/components/layout/card/card.js +2 -2
- package/dist/components/layout/card/card.template.d.ts.map +1 -1
- package/dist/components/layout/card/card.template.js +6 -6
- package/dist/components/layout/card/card.template.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts +9 -0
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.js +29 -1
- package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js +20 -13
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +7 -3
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +31 -4
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +16 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +61 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +5 -0
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +25 -0
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js +28 -7
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.template.js +8 -4
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +5 -2
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +9 -4
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +12 -5
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.d.ts +3 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js +3 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +15 -7
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +9 -2
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +11 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.d.ts +7 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.js +6 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.js.map +1 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +7 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js +12 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +6 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +6 -4
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.i18n.d.ts +3 -1
- package/dist/components/navigation/link/link.i18n.d.ts.map +1 -1
- package/dist/components/navigation/link/link.i18n.js +3 -1
- package/dist/components/navigation/link/link.i18n.js.map +1 -1
- package/dist/components/navigation/link/link.js +2 -2
- package/dist/components/navigation/link/link.styles.js +2 -2
- package/dist/components/navigation/link/link.template.d.ts.map +1 -1
- package/dist/components/navigation/link/link.template.js +7 -8
- package/dist/components/navigation/link/link.template.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts +1 -14
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +7 -55
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/{with-translations-C8_0-9y8.js → with-translations-C6QfP6_S.js} +24 -1
- package/dist/nldd.min.js +753 -707
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +24 -7
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +24 -7
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +24 -7
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +2 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +24 -7
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +24 -7
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +29 -16
- package/dist/utilities/focus-target.d.ts +23 -0
- package/dist/utilities/focus-target.d.ts.map +1 -0
- package/dist/utilities/focus-target.js +70 -0
- package/dist/utilities/focus-target.js.map +1 -0
- package/dist/utilities/link-hint.d.ts +18 -0
- package/dist/utilities/link-hint.d.ts.map +1 -0
- package/dist/utilities/link-hint.js +29 -0
- package/dist/utilities/link-hint.js.map +1 -0
- package/package.json +2 -1
|
@@ -7,7 +7,10 @@ import { linkRel } from '../../../utilities/link-rel.js';
|
|
|
7
7
|
// block, not to the widened action box.
|
|
8
8
|
const content = html `<slot></slot>`;
|
|
9
9
|
const divider = html `<div class="list-item__divider"></div>`;
|
|
10
|
-
export const template = (button, href, target, rel,
|
|
10
|
+
export const template = (button, href, target, rel, linkHint, actionTabindex, isHighlighted = false, checkbox = false, radio = false, checked = false, expanded, showChildren = false, hasCheckedSegment = false, disabled = false, childrenRole = 'group', childrenOpen = expanded === true, accessibleLabel = '') => {
|
|
11
|
+
// accessible-label replaces the content as the action's name, so the link
|
|
12
|
+
// hint goes into it; otherwise the hint follows the content in a hidden span.
|
|
13
|
+
const ariaLabel = accessibleLabel ? [accessibleLabel, linkHint].filter(Boolean).join(', ') : nothing;
|
|
11
14
|
const ariaExpanded = expanded === undefined ? nothing : String(expanded);
|
|
12
15
|
// The row's child rows. In a tree `role="group"` is what makes the nesting
|
|
13
16
|
// the hierarchy: assistive technology derives level, position and set size
|
|
@@ -33,10 +36,11 @@ export const template = (button, href, target, rel, opensInNewTabLabel, actionTa
|
|
|
33
36
|
href=${href}
|
|
34
37
|
target=${target ?? nothing}
|
|
35
38
|
rel=${linkRel(rel, target) || nothing}
|
|
39
|
+
aria-label=${ariaLabel}
|
|
36
40
|
aria-disabled=${disabled ? 'true' : nothing}
|
|
37
41
|
aria-expanded=${ariaExpanded}
|
|
38
42
|
tabindex=${actionTabindex ?? nothing}
|
|
39
|
-
>${content}${
|
|
43
|
+
>${content}${linkHint && !accessibleLabel ? html `<span class="list-item__link-hint">, ${linkHint}</span>` : nothing}</a>
|
|
40
44
|
${divider}
|
|
41
45
|
</div>${children}`;
|
|
42
46
|
}
|
|
@@ -50,6 +54,7 @@ export const template = (button, href, target, rel, opensInNewTabLabel, actionTa
|
|
|
50
54
|
<button class="list-item__action"
|
|
51
55
|
type="button"
|
|
52
56
|
role="checkbox"
|
|
57
|
+
aria-label=${ariaLabel}
|
|
53
58
|
?disabled=${disabled}
|
|
54
59
|
aria-checked=${String(checked)}
|
|
55
60
|
aria-expanded=${ariaExpanded}
|
|
@@ -68,6 +73,7 @@ export const template = (button, href, target, rel, opensInNewTabLabel, actionTa
|
|
|
68
73
|
<button class="list-item__action"
|
|
69
74
|
type="button"
|
|
70
75
|
role="radio"
|
|
76
|
+
aria-label=${ariaLabel}
|
|
71
77
|
?disabled=${disabled}
|
|
72
78
|
aria-checked=${String(checked)}
|
|
73
79
|
tabindex=${actionTabindex ?? nothing}
|
|
@@ -79,6 +85,7 @@ export const template = (button, href, target, rel, opensInNewTabLabel, actionTa
|
|
|
79
85
|
return html `<div class=${blockClass}>
|
|
80
86
|
<button class="list-item__action"
|
|
81
87
|
type="button"
|
|
88
|
+
aria-label=${ariaLabel}
|
|
82
89
|
?disabled=${disabled}
|
|
83
90
|
aria-expanded=${ariaExpanded}
|
|
84
91
|
tabindex=${actionTabindex ?? nothing}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.template.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item/list-item.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,qEAAqE;AACrE,yEAAyE;AACzE,yEAAyE;AACzE,wCAAwC;AACxC,MAAM,OAAO,GAAG,IAAI,CAAA,eAAe,CAAC;AACpC,MAAM,OAAO,GAAG,IAAI,CAAA,wCAAwC,CAAC;AAE7D,MAAM,CAAC,MAAM,QAAQ,GAAG,CACvB,MAAe,EACf,IAAwB,EACxB,MAA0B,EAC1B,GAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"list-item.template.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item/list-item.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,qEAAqE;AACrE,yEAAyE;AACzE,yEAAyE;AACzE,wCAAwC;AACxC,MAAM,OAAO,GAAG,IAAI,CAAA,eAAe,CAAC;AACpC,MA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 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { type ListItemSegmentControl } from './list-item-segment.template.js';
|
|
3
3
|
export type ListItemSegmentWidth = 'fit-content' | 'full';
|
|
4
|
+
declare const NLDDListItemSegment_base: (abstract new (...args: any[]) => LitElement & {
|
|
5
|
+
translations: Partial<{
|
|
6
|
+
'components.list-item-segment.link-hint-new-tab-lowercase-label': string;
|
|
7
|
+
'components.list-item-segment.link-hint-external-lowercase-label': string;
|
|
8
|
+
'components.list-item-segment.link-hint-external-new-tab-lowercase-label': string;
|
|
9
|
+
}>;
|
|
10
|
+
_t(key: "components.list-item-segment.link-hint-new-tab-lowercase-label" | "components.list-item-segment.link-hint-external-lowercase-label" | "components.list-item-segment.link-hint-external-new-tab-lowercase-label", vars?: Record<string, string | number>): string;
|
|
11
|
+
}) & typeof LitElement;
|
|
4
12
|
/**
|
|
5
13
|
* A segment inside an `nldd-list-item`: it groups a run of cells
|
|
6
14
|
* and makes just that run clickable. Use it when a row needs more than one
|
|
@@ -30,7 +38,7 @@ export type ListItemSegmentWidth = 'fit-content' | 'full';
|
|
|
30
38
|
*
|
|
31
39
|
* @attr {'fit-content'|'full'} width - `full` lets the segment grow to fill the row (default: 'fit-content')
|
|
32
40
|
* @attr {string} href - Renders the segment as an `<a>` with this URL. Wins over `checkbox` and `button`.
|
|
33
|
-
* @attr {string} target - Link target forwarded to the `<a>`; only applies with `href`
|
|
41
|
+
* @attr {string} target - Link target forwarded to the `<a>`; only applies with `href`. With '_blank' a visually hidden "opent in nieuw tabblad" announcement is added. An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off. With `accessible-label` the hint goes into the label.
|
|
34
42
|
* @attr {string} rel - Link rel forwarded to the `<a>`, only with `href`; with target '_blank', 'noopener noreferrer' is added to whatever you set
|
|
35
43
|
* @attr {boolean} button - Renders the segment as a `<button>`. Last of the three: `href` and `checkbox` both win over it.
|
|
36
44
|
* @attr {boolean} checkbox - Makes the segment a `role="checkbox"` control. Wins over `button`, loses to `href`.
|
|
@@ -52,7 +60,7 @@ export type ListItemSegmentWidth = 'fit-content' | 'full';
|
|
|
52
60
|
*
|
|
53
61
|
* @fires change - On a `checkbox` segment after it toggles; detail: { checked: boolean }
|
|
54
62
|
*/
|
|
55
|
-
export declare class NLDDListItemSegment extends
|
|
63
|
+
export declare class NLDDListItemSegment extends NLDDListItemSegment_base {
|
|
56
64
|
static styles: import("lit").CSSResult[];
|
|
57
65
|
width: ListItemSegmentWidth;
|
|
58
66
|
href?: string;
|
|
@@ -141,4 +149,5 @@ declare global {
|
|
|
141
149
|
'nldd-list-item-segment': NLDDListItemSegment;
|
|
142
150
|
}
|
|
143
151
|
}
|
|
152
|
+
export {};
|
|
144
153
|
//# sourceMappingURL=list-item-segment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-segment.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,OAAO,EAAY,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"list-item-segment.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,OAAO,EAAY,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAMxF,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,MAAM,CAAC;;;;;;;;;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBACa,mBAAoB,SAAQ,wBAA6D;IACrG,OAAgB,MAAM,4BAA2B;IAGjD,KAAK,EAAE,oBAAoB,CAAiB;IAG5C,IAAI,CA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AuF;IAC9E,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAI5C;;sFAEkF;IACzE,OAAO;IAKP,MAAM;CAuBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,wBAAwB,EAAE,mBAAmB,CAAC;KAC9C;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const nlddListItemSegmentTranslations: {
|
|
2
|
+
'components.list-item-segment.link-hint-new-tab-lowercase-label': string;
|
|
3
|
+
'components.list-item-segment.link-hint-external-lowercase-label': string;
|
|
4
|
+
'components.list-item-segment.link-hint-external-new-tab-lowercase-label': string;
|
|
5
|
+
};
|
|
6
|
+
export type NLDDListItemSegmentTranslations = typeof nlddListItemSegmentTranslations;
|
|
7
|
+
//# sourceMappingURL=list-item-segment.i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-item-segment.i18n.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.i18n.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,OAAO,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const nlddListItemSegmentTranslations = {
|
|
2
|
+
'components.list-item-segment.link-hint-new-tab-lowercase-label': 'opent in nieuw tabblad',
|
|
3
|
+
'components.list-item-segment.link-hint-external-lowercase-label': 'andere website',
|
|
4
|
+
'components.list-item-segment.link-hint-external-new-tab-lowercase-label': 'andere website, opent in nieuw tabblad',
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=list-item-segment.i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-item-segment.i18n.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.i18n.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C,gEAAgE,EAAE,wBAAwB;IAC1F,iEAAiE,EAAE,gBAAgB;IACnF,yEAAyE,EAAE,wCAAwC;CACnH,CAAC"}
|
|
@@ -10,6 +10,9 @@ import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
|
|
|
10
10
|
import { isPointerMode } from '../../../utilities/input-modality.js';
|
|
11
11
|
import { listItemSegmentStyles } from './list-item-segment.styles.js';
|
|
12
12
|
import { template } from './list-item-segment.template.js';
|
|
13
|
+
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
14
|
+
import { linkHintKey } from '../../../utilities/link-hint.js';
|
|
15
|
+
import { nlddListItemSegmentTranslations } from './list-item-segment.i18n.js';
|
|
13
16
|
/**
|
|
14
17
|
* A segment inside an `nldd-list-item`: it groups a run of cells
|
|
15
18
|
* and makes just that run clickable. Use it when a row needs more than one
|
|
@@ -39,7 +42,7 @@ import { template } from './list-item-segment.template.js';
|
|
|
39
42
|
*
|
|
40
43
|
* @attr {'fit-content'|'full'} width - `full` lets the segment grow to fill the row (default: 'fit-content')
|
|
41
44
|
* @attr {string} href - Renders the segment as an `<a>` with this URL. Wins over `checkbox` and `button`.
|
|
42
|
-
* @attr {string} target - Link target forwarded to the `<a>`; only applies with `href`
|
|
45
|
+
* @attr {string} target - Link target forwarded to the `<a>`; only applies with `href`. With '_blank' a visually hidden "opent in nieuw tabblad" announcement is added. An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off. With `accessible-label` the hint goes into the label.
|
|
43
46
|
* @attr {string} rel - Link rel forwarded to the `<a>`, only with `href`; with target '_blank', 'noopener noreferrer' is added to whatever you set
|
|
44
47
|
* @attr {boolean} button - Renders the segment as a `<button>`. Last of the three: `href` and `checkbox` both win over it.
|
|
45
48
|
* @attr {boolean} checkbox - Makes the segment a `role="checkbox"` control. Wins over `button`, loses to `href`.
|
|
@@ -61,7 +64,7 @@ import { template } from './list-item-segment.template.js';
|
|
|
61
64
|
*
|
|
62
65
|
* @fires change - On a `checkbox` segment after it toggles; detail: { checked: boolean }
|
|
63
66
|
*/
|
|
64
|
-
let NLDDListItemSegment = class NLDDListItemSegment extends LitElement {
|
|
67
|
+
let NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(LitElement, nlddListItemSegmentTranslations) {
|
|
65
68
|
constructor() {
|
|
66
69
|
super(...arguments);
|
|
67
70
|
this.width = 'fit-content';
|
|
@@ -216,7 +219,8 @@ let NLDDListItemSegment = class NLDDListItemSegment extends LitElement {
|
|
|
216
219
|
if (import.meta.env?.DEV && this.disclosure && this.expanded !== undefined) {
|
|
217
220
|
console.warn('nldd-list-item-segment: `disclosure` takes aria-expanded from the row, so the `expanded` on this action is ignored. Drop one of the two.');
|
|
218
221
|
}
|
|
219
|
-
|
|
222
|
+
const hintKey = this._controlType === 'link' ? linkHintKey(this.href, this.target) : null;
|
|
223
|
+
return template(this._controlType, this.href, this.target, this.rel, this.checked, this.disclosure ? this._rowExpanded : this.expanded, this.current ? this.currentType : undefined, this.disabled, this.accessibleLabel, this._tabbable === undefined ? undefined : (this._tabbable ? '0' : '-1'), this.popupType, this.popovertarget, this.popoverTargetElement, this.popoverTargetAction, hintKey ? this._t(`components.list-item-segment.${hintKey}`) : '');
|
|
220
224
|
}
|
|
221
225
|
};
|
|
222
226
|
NLDDListItemSegment.styles = [listItemSegmentStyles];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-segment.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAA+B,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"list-item-segment.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAA+B,MAAM,iCAAiC,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAI9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,gBAAgB,CAAC,UAAU,EAAE,+BAA+B,CAAC;IAA/F;;QAIN,UAAK,GAAyB,aAAa,CAAC;QAY5C,WAAM,GAAG,KAAK,CAAC;QAGf,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;;;;;;WAQG;QAEH,eAAU,GAAG,KAAK,CAAC;QAGnB,oBAAe,GAAG,EAAE,CAAC;QAGrB,YAAO,GAAG,KAAK,CAAC;QAoBhB;;;;;WAKG;QAEH,yBAAoB,GAAmB,IAAI,CAAC;QAE5C,2EAA2E;QAE3E,wBAAmB,GAA+B,QAAQ,CAAC;QAG3D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B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;4DACvB;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAC3B;AAIhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDACxB;AAUnB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAClC;AAInB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DACL;AASvB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iEACa;AAI5C;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gEAC4B;AAG3D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAC3B;AAIhB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,CAA0D,MAAM,CAAC,EAAE,CAAC;wDACxE;AAG9E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDAC1B;AAIjB;IADC,KAAK,EAAE;wDACa;AAMrB;IADC,KAAK,EAAE;sDACY;AAKpB;IADC,KAAK,EAAE;yDACe;AAGf;IADP,KAAK,CAAC,oBAAoB,CAAC;qDACG;AAhGnB,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAoP/B"}
|
package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-segment.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"list-item-segment.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,yBAkLjC,CAAC"}
|
|
@@ -165,5 +165,17 @@ export const listItemSegmentStyles = css `
|
|
|
165
165
|
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
166
166
|
pointer-events: none;
|
|
167
167
|
}
|
|
168
|
+
|
|
169
|
+
.list-item-segment__link-hint {
|
|
170
|
+
position: absolute;
|
|
171
|
+
margin: -1px;
|
|
172
|
+
border: 0;
|
|
173
|
+
width: 1px;
|
|
174
|
+
height: 1px;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
padding: 0;
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
clip-path: inset(50%);
|
|
179
|
+
}
|
|
168
180
|
`;
|
|
169
181
|
//# sourceMappingURL=list-item-segment.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-segment.styles.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"list-item-segment.styles.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkLvC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type ListItemSegmentControl = 'link' | 'button' | 'checkbox' | 'plain';
|
|
2
|
-
export declare function template(control: ListItemSegmentControl, href: string | undefined, target: string | undefined, rel: string | undefined, checked: boolean, expanded: boolean | undefined, current: string | undefined, disabled: boolean, accessibleLabel: string, actionTabindex?: string, popupType?: string, popovertarget?: string, popoverTargetElement?: Element | null, popoverTargetAction?: 'toggle' | 'show' | 'hide'): import("lit-html").TemplateResult<1>;
|
|
2
|
+
export declare function template(control: ListItemSegmentControl, href: string | undefined, target: string | undefined, rel: string | undefined, checked: boolean, expanded: boolean | undefined, current: string | undefined, disabled: boolean, accessibleLabel: string, actionTabindex?: string, popupType?: string, popovertarget?: string, popoverTargetElement?: Element | null, popoverTargetAction?: 'toggle' | 'show' | 'hide', linkHint?: string): import("lit-html").TemplateResult<1>;
|
|
3
3
|
//# sourceMappingURL=list-item-segment.template.d.ts.map
|
package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-segment.template.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.template.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE9E,wBAAgB,QAAQ,CACvB,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,OAAO,EACjB,eAAe,EAAE,MAAM,EACvB,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,EACtB,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,EACrC,mBAAmB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"list-item-segment.template.d.ts","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.template.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE9E,wBAAgB,QAAQ,CACvB,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,OAAO,EACjB,eAAe,EAAE,MAAM,EACvB,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,EACtB,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,EACrC,mBAAmB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAChD,QAAQ,SAAK,wCAiDb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
2
|
import { linkRel } from '../../../utilities/link-rel.js';
|
|
3
|
-
export function template(control, href, target, rel, checked, expanded, current, disabled, accessibleLabel, actionTabindex, popupType, popovertarget, popoverTargetElement, popoverTargetAction) {
|
|
3
|
+
export function template(control, href, target, rel, checked, expanded, current, disabled, accessibleLabel, actionTabindex, popupType, popovertarget, popoverTargetElement, popoverTargetAction, linkHint = '') {
|
|
4
4
|
const content = html `<slot></slot>`;
|
|
5
5
|
// A control that opens a popup always carries aria-expanded, open or not:
|
|
6
6
|
// without it a screen reader hears a plain button and cannot tell there is
|
|
@@ -10,6 +10,9 @@ export function template(control, href, target, rel, checked, expanded, current,
|
|
|
10
10
|
: String(expanded);
|
|
11
11
|
const ariaCurrent = current ?? nothing;
|
|
12
12
|
const label = accessibleLabel || nothing;
|
|
13
|
+
// accessible-label replaces the content as the link's name, so the link hint
|
|
14
|
+
// goes into it; otherwise the hint follows the content in a hidden span.
|
|
15
|
+
const linkLabel = accessibleLabel ? [accessibleLabel, linkHint].filter(Boolean).join(', ') : nothing;
|
|
13
16
|
if (control === 'link') {
|
|
14
17
|
return html `<a class="list-item-segment"
|
|
15
18
|
href=${href ?? nothing}
|
|
@@ -18,9 +21,9 @@ export function template(control, href, target, rel, checked, expanded, current,
|
|
|
18
21
|
aria-disabled=${disabled ? 'true' : nothing}
|
|
19
22
|
aria-expanded=${ariaExpanded}
|
|
20
23
|
aria-current=${ariaCurrent}
|
|
21
|
-
aria-label=${
|
|
24
|
+
aria-label=${linkLabel}
|
|
22
25
|
tabindex=${actionTabindex ?? nothing}
|
|
23
|
-
>${content}</a>`;
|
|
26
|
+
>${content}${linkHint && !accessibleLabel ? html `<span class="list-item-segment__link-hint">, ${linkHint}</span>` : nothing}</a>`;
|
|
24
27
|
}
|
|
25
28
|
if (control === 'checkbox' || control === 'button') {
|
|
26
29
|
return html `<button class="list-item-segment"
|
package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-segment.template.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAIzD,MAAM,UAAU,QAAQ,CACvB,OAA+B,EAC/B,IAAwB,EACxB,MAA0B,EAC1B,GAAuB,EACvB,OAAgB,EAChB,QAA6B,EAC7B,OAA2B,EAC3B,QAAiB,EACjB,eAAuB,EACvB,cAAuB,EACvB,SAAkB,EAClB,aAAsB,EACtB,oBAAqC,EACrC,mBAAgD;
|
|
1
|
+
{"version":3,"file":"list-item-segment.template.js","sourceRoot":"","sources":["../../../../src/components/lists-and-tables/list-item-segment/list-item-segment.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAIzD,MAAM,UAAU,QAAQ,CACvB,OAA+B,EAC/B,IAAwB,EACxB,MAA0B,EAC1B,GAAuB,EACvB,OAAgB,EAChB,QAA6B,EAC7B,OAA2B,EAC3B,QAAiB,EACjB,eAAuB,EACvB,cAAuB,EACvB,SAAkB,EAClB,aAAsB,EACtB,oBAAqC,EACrC,mBAAgD,EAChD,QAAQ,GAAG,EAAE;IAEb,MAAM,OAAO,GAAG,IAAI,CAAA,eAAe,CAAC;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,6EAA6E;IAC7E,MAAM,YAAY,GAAG,QAAQ,KAAK,SAAS;QAC1C,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QACjC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpB,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC;IACvC,MAAM,KAAK,GAAG,eAAe,IAAI,OAAO,CAAC;IACzC,6EAA6E;IAC7E,yEAAyE;IACzE,MAAM,SAAS,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAErG,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACxB,OAAO,IAAI,CAAA;UACH,IAAI,IAAI,OAAO;YACb,MAAM,IAAI,OAAO;SACpB,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,OAAO;mBACrB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;mBAC3B,YAAY;kBACb,WAAW;gBACb,SAAS;cACX,cAAc,IAAI,OAAO;KAClC,OAAO,GAAG,QAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAA,gDAAgD,QAAQ,SAAS,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC;IACnI,CAAC;IAED,IAAI,OAAO,KAAK,UAAU,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACpD,OAAO,IAAI,CAAA;;mBAEM,SAAS,IAAI,OAAO;mBACpB,aAAa,IAAI,OAAO;2BAChB,oBAAoB,IAAI,IAAI;0BAC7B,mBAAmB,IAAI,QAAQ;UAC/C,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO;kBACrC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO;mBACjD,YAAY;kBACb,WAAW;gBACb,KAAK;eACN,QAAQ;cACT,cAAc,IAAI,OAAO;KAClC,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,4EAA4E;IAC5E,2EAA2E;IAC3E,2CAA2C;IAC3C,OAAO,IAAI,CAAA,kCAAkC,OAAO,QAAQ,CAAC;AAC9D,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @element nldd-link
|
|
20
20
|
* @attr {string} href - Link target
|
|
21
|
-
* @attr {string} target - Link target (e.g. '_blank'); adjusts rel automatically. With '_blank' the link adds a visually hidden "
|
|
21
|
+
* @attr {string} target - Link target (e.g. '_blank'); adjusts rel automatically. With '_blank' the link adds a visually hidden "opent in nieuw tabblad" announcement for screen readers (WCAG 2.1 SC 3.2.2). An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off.
|
|
22
22
|
* @attr {string} rel - Link rel attribute; with target '_blank', 'noopener noreferrer' is added to whatever you set
|
|
23
23
|
* @attr {string} size - Text size: 'inherit' (the default) follows the surrounding text and lays the link out inline, so it wraps in running prose. 'xs' | 'sm' | 'md' | 'lg' pin a size and switch to inline-flex, which baseline-aligns a start or end icon with an explicit gap.
|
|
24
24
|
* @attr {string} text - Link text (alternative to the default slot)
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @attr {string} accessible-label - Accessible label for screen readers
|
|
28
28
|
* @attr {boolean} disabled - Disabled state. Avoid it where you can; the design guidelines say why.
|
|
29
29
|
* @attr {boolean} no-tab - Takes the control out of the tab order (tabindex="-1"), for a control owned by a roving container (a row of an nldd-list, where the arrow keys move between rows) that manages focus itself. Still mouse- and script-focusable.
|
|
30
|
-
* @attr {object} translations - Override translation keys (e.g. the "
|
|
30
|
+
* @attr {object} translations - Override translation keys (e.g. the "opent in nieuw tabblad" announcement); unset keys fall back to Dutch.
|
|
31
31
|
*
|
|
32
32
|
* @slot - Link text (alternative to the text attribute)
|
|
33
33
|
* @slot start-icon - Custom icon before the text
|
|
@@ -38,9 +38,11 @@ import './../../content/icon/icon.js';
|
|
|
38
38
|
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'inherit';
|
|
39
39
|
declare const NLDDLink_base: (abstract new (...args: any[]) => LitElement & {
|
|
40
40
|
translations: Partial<{
|
|
41
|
-
'components.link.
|
|
41
|
+
'components.link.link-hint-new-tab-lowercase-label': string;
|
|
42
|
+
'components.link.link-hint-external-lowercase-label': string;
|
|
43
|
+
'components.link.link-hint-external-new-tab-lowercase-label': string;
|
|
42
44
|
}>;
|
|
43
|
-
_t(key: "components.link.
|
|
45
|
+
_t(key: "components.link.link-hint-new-tab-lowercase-label" | "components.link.link-hint-external-lowercase-label" | "components.link.link-hint-external-new-tab-lowercase-label", vars?: Record<string, string | number>): string;
|
|
44
46
|
}) & typeof LitElement;
|
|
45
47
|
export declare class NLDDLink extends NLDDLink_base {
|
|
46
48
|
static styles: import("lit").CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,8BAA8B,CAAC;AAEtC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,8BAA8B,CAAC;AAEtC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;;;;;;;;;AAElD,qBACa,QAAS,SAAQ,aAAkD;IAC/E,OAAgB,MAAM,0BAAc;IAGpC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IAGrC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAa;IAGvC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAa;IAGpC,IAAI,EAAE,IAAI,CAAa;IAGvB,IAAI,SAAM;IAGV,SAAS,SAAM;IAGf,OAAO,SAAM;IAGb,eAAe,SAAM;IAGrB,QAAQ,UAAS;IACjB;;;4BAGwB;IAExB,KAAK,UAAS;IAGd,OAAO,CAAC,YAAY;IAOX,MAAM;CAKf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const nlddLinkTranslations: {
|
|
2
|
-
'components.link.
|
|
2
|
+
'components.link.link-hint-new-tab-lowercase-label': string;
|
|
3
|
+
'components.link.link-hint-external-lowercase-label': string;
|
|
4
|
+
'components.link.link-hint-external-new-tab-lowercase-label': string;
|
|
3
5
|
};
|
|
4
6
|
export type NLDDLinkTranslations = typeof nlddLinkTranslations;
|
|
5
7
|
//# sourceMappingURL=link.i18n.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.i18n.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.i18n.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"link.i18n.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.i18n.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const nlddLinkTranslations = {
|
|
2
|
-
'components.link.
|
|
2
|
+
'components.link.link-hint-new-tab-lowercase-label': 'opent in nieuw tabblad',
|
|
3
|
+
'components.link.link-hint-external-lowercase-label': 'andere website',
|
|
4
|
+
'components.link.link-hint-external-new-tab-lowercase-label': 'andere website, opent in nieuw tabblad',
|
|
3
5
|
};
|
|
4
6
|
//# sourceMappingURL=link.i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.i18n.js","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.i18n.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,
|
|
1
|
+
{"version":3,"file":"link.i18n.js","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.i18n.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,mDAAmD,EAAE,wBAAwB;IAC7E,oDAAoD,EAAE,gBAAgB;IACtE,4DAA4D,EAAE,wCAAwC;CACtG,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @element nldd-link
|
|
20
20
|
* @attr {string} href - Link target
|
|
21
|
-
* @attr {string} target - Link target (e.g. '_blank'); adjusts rel automatically. With '_blank' the link adds a visually hidden "
|
|
21
|
+
* @attr {string} target - Link target (e.g. '_blank'); adjusts rel automatically. With '_blank' the link adds a visually hidden "opent in nieuw tabblad" announcement for screen readers (WCAG 2.1 SC 3.2.2). An `href` to another origin than the page (another website, a subdomain too) adds a visually hidden "andere website", in one sentence with the new-tab announcement when both apply; there is no way to switch it off.
|
|
22
22
|
* @attr {string} rel - Link rel attribute; with target '_blank', 'noopener noreferrer' is added to whatever you set
|
|
23
23
|
* @attr {string} size - Text size: 'inherit' (the default) follows the surrounding text and lays the link out inline, so it wraps in running prose. 'xs' | 'sm' | 'md' | 'lg' pin a size and switch to inline-flex, which baseline-aligns a start or end icon with an explicit gap.
|
|
24
24
|
* @attr {string} text - Link text (alternative to the default slot)
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @attr {string} accessible-label - Accessible label for screen readers
|
|
28
28
|
* @attr {boolean} disabled - Disabled state. Avoid it where you can; the design guidelines say why.
|
|
29
29
|
* @attr {boolean} no-tab - Takes the control out of the tab order (tabindex="-1"), for a control owned by a roving container (a row of an nldd-list, where the arrow keys move between rows) that manages focus itself. Still mouse- and script-focusable.
|
|
30
|
-
* @attr {object} translations - Override translation keys (e.g. the "
|
|
30
|
+
* @attr {object} translations - Override translation keys (e.g. the "opent in nieuw tabblad" announcement); unset keys fall back to Dutch.
|
|
31
31
|
*
|
|
32
32
|
* @slot - Link text (alternative to the text attribute)
|
|
33
33
|
* @slot start-icon - Custom icon before the text
|
|
@@ -144,9 +144,9 @@ export const linkStyles = css `
|
|
|
144
144
|
top: 0.2em;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
/* Visually-hidden
|
|
147
|
+
/* Visually-hidden link hint (another website, a new tab); part of
|
|
148
148
|
the link's accessible name but never shown. Standard visually-hidden recipe. */
|
|
149
|
-
.
|
|
149
|
+
.link__link-hint {
|
|
150
150
|
position: absolute;
|
|
151
151
|
margin: -1px;
|
|
152
152
|
border: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.template.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"link.template.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAI1C,UAAU,eAAe;IACxB,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,wCAqChE"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
2
|
import { linkRel } from '../../../utilities/link-rel.js';
|
|
3
|
+
import { linkHintKey } from '../../../utilities/link-hint.js';
|
|
3
4
|
export function template(helpers) {
|
|
4
5
|
const resolvedRel = linkRel(this.rel, this.target);
|
|
5
|
-
// A
|
|
6
|
+
// A link to another website or a new tab says so (WCAG 2.1 SC 3.2.2).
|
|
6
7
|
// Suppressed when disabled (the <a> carries no href, so it doesn't navigate).
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
: '';
|
|
8
|
+
const hintKey = this.disabled ? null : linkHintKey(this.href, this.target);
|
|
9
|
+
const linkHint = hintKey ? this._t(`components.link.${hintKey}`) : '';
|
|
10
10
|
// aria-label wins the accessible-name cascade, so when one is set the hint
|
|
11
11
|
// must live inside it; otherwise the name is content-derived (text or slot)
|
|
12
12
|
// and the visually-hidden span below appends the hint to it.
|
|
13
13
|
const ariaLabel = this.accessibleLabel
|
|
14
|
-
? [this.accessibleLabel,
|
|
14
|
+
? [this.accessibleLabel, linkHint].filter(Boolean).join(', ')
|
|
15
15
|
: nothing;
|
|
16
|
-
const
|
|
16
|
+
const renderLinkHint = !!linkHint && !this.accessibleLabel;
|
|
17
17
|
// Icons render in both modes:
|
|
18
18
|
// - sized mode: inline-flex container + gap controls spacing
|
|
19
19
|
// - inherit mode: inline container, the whitespace text node between
|
|
@@ -35,8 +35,7 @@ export function template(helpers) {
|
|
|
35
35
|
<span class="link__label">${this.text ? this.text : html `<slot></slot>`}</span>
|
|
36
36
|
${this.endIcon ? html `
|
|
37
37
|
<span class="link__end-icon"><nldd-icon icon=${this.endIcon}></nldd-icon></span>
|
|
38
|
-
` : html `<slot name="end-icon"></slot>`}
|
|
39
|
-
${renderOpensInNewTabHint ? html `<span class="link__opens-in-new-tab-hint">${opensInNewTabHint}</span>` : nothing}
|
|
38
|
+
` : html `<slot name="end-icon"></slot>`}${renderLinkHint ? html `<span class="link__link-hint">, ${linkHint}</span>` : nothing}
|
|
40
39
|
</a>
|
|
41
40
|
`;
|
|
42
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.template.js","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"link.template.js","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;A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,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;YACrD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC;SACrD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC;mBACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;gBACnC,SAAS;YACb,OAAO,CAAC,WAAW;;KAE1B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;qDAC2B,IAAI,CAAC,SAAS;IAC/D,CAAC,CAAC,CAAC,IAAI,CAAA,iCAAiC;+BACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,eAAe;KACrE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;mDAC2B,IAAI,CAAC,OAAO;IAC3D,CAAC,CAAC,CAAC,IAAI,CAAA,+BAA+B,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAA,mCAAmC,QAAQ,SAAS,CAAC,CAAC,CAAC,OAAO;;EAE9H,CAAC;AACH,CAAC"}
|
|
@@ -47,23 +47,10 @@ export declare class NLDDSkipLink extends NLDDSkipLink_base {
|
|
|
47
47
|
* on the link, so the next Tab starts from the top again.
|
|
48
48
|
*/
|
|
49
49
|
_handleLinkClick: (event?: MouseEvent) => void;
|
|
50
|
-
/**
|
|
51
|
-
* The fragment of an href that stays on this page, or an empty string. An
|
|
52
|
-
* absolute URL to the page you are on counts too: a router or a CMS writes
|
|
53
|
-
* `/pagina#inhoud` as readily as `#inhoud`.
|
|
54
|
-
*/
|
|
55
|
-
private _samePageHash;
|
|
56
50
|
private _focusTimer?;
|
|
57
51
|
private _restoreTarget?;
|
|
58
52
|
disconnectedCallback(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Focuses the target and leaves it as it was once focus moves on.
|
|
61
|
-
*
|
|
62
|
-
* The tabindex is 0 and not -1, also when the target came with a -1 of its
|
|
63
|
-
* own. WebKit skips everything inside a shadow host that has a negative
|
|
64
|
-
* tabindex, slotted content included, so with -1 on an nldd-* section the
|
|
65
|
-
* next Tab left the page instead of reaching the first link in it.
|
|
66
|
-
*/
|
|
53
|
+
/** Focuses the target with a temporary tab stop; see focusTemporarily. */
|
|
67
54
|
private _focus;
|
|
68
55
|
/**
|
|
69
56
|
* The first following sibling that is rendered. `focus()` does nothing on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;
|
|
1
|
+
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;AASjC,qBACa,YAAa,SAAQ,iBAAsD;IACvF,OAAgB,MAAM,0BAAkB;IAGxC,IAAI,SAAM;IAGV,IAAI,SAAM;IAEV,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,QAAO,IAAI,CAYrB;IAEF;;;;OAIG;IACH,gBAAgB,GAAI,QAAQ,UAAU,KAAG,IAAI,CAW3C;IAEF,OAAO,CAAC,WAAW,CAAC,CAAgC;IACpD,OAAO,CAAC,cAAc,CAAC,CAAa;IAE3B,oBAAoB,IAAI,IAAI;IAKrC,0EAA0E;IAC1E,OAAO,CAAC,MAAM;IAUd;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAUf;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAcR,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,YAAY,CAAC;KAC/B;CACD"}
|
|
@@ -41,6 +41,7 @@ import { skipLinkStyles } from './skip-link.styles.js';
|
|
|
41
41
|
import { template } from './skip-link.template.js';
|
|
42
42
|
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
43
43
|
import { nlddSkipLinkTranslations } from './skip-link.i18n.js';
|
|
44
|
+
import { focusTemporarily, hashTarget, samePageHash } from '../../../utilities/focus-target.js';
|
|
44
45
|
let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddSkipLinkTranslations) {
|
|
45
46
|
constructor() {
|
|
46
47
|
super(...arguments);
|
|
@@ -63,21 +64,14 @@ let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddS
|
|
|
63
64
|
* on the link, so the next Tab starts from the top again.
|
|
64
65
|
*/
|
|
65
66
|
this._handleLinkClick = (event) => {
|
|
66
|
-
const hash = this.
|
|
67
|
+
const hash = samePageHash(this.href);
|
|
67
68
|
if (!hash)
|
|
68
69
|
return;
|
|
69
70
|
// A click that opens the link elsewhere (middle button, or with a
|
|
70
71
|
// modifier held) leaves this page where it is, focus included.
|
|
71
72
|
if (event && (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey))
|
|
72
73
|
return;
|
|
73
|
-
|
|
74
|
-
// A malformed escape throws; the raw id is then the best guess left.
|
|
75
|
-
try {
|
|
76
|
-
id = decodeURIComponent(id);
|
|
77
|
-
}
|
|
78
|
-
catch { /* keep the raw id */ }
|
|
79
|
-
const root = this.getRootNode();
|
|
80
|
-
const target = root.getElementById?.(id) ?? document.getElementById(id);
|
|
74
|
+
const target = hashTarget(hash, this);
|
|
81
75
|
if (!target)
|
|
82
76
|
return;
|
|
83
77
|
// After the navigation the click is about to cause, not before it.
|
|
@@ -88,60 +82,18 @@ let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddS
|
|
|
88
82
|
get _text() {
|
|
89
83
|
return this.text || this._t('components.skip-link.action');
|
|
90
84
|
}
|
|
91
|
-
/**
|
|
92
|
-
* The fragment of an href that stays on this page, or an empty string. An
|
|
93
|
-
* absolute URL to the page you are on counts too: a router or a CMS writes
|
|
94
|
-
* `/pagina#inhoud` as readily as `#inhoud`.
|
|
95
|
-
*/
|
|
96
|
-
_samePageHash() {
|
|
97
|
-
try {
|
|
98
|
-
const url = new URL(this.href, location.href);
|
|
99
|
-
const samePage = url.origin === location.origin
|
|
100
|
-
&& url.pathname === location.pathname
|
|
101
|
-
&& url.search === location.search;
|
|
102
|
-
return samePage ? url.hash : '';
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
return '';
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
85
|
disconnectedCallback() {
|
|
109
86
|
super.disconnectedCallback();
|
|
110
87
|
clearTimeout(this._focusTimer);
|
|
111
88
|
}
|
|
112
|
-
/**
|
|
113
|
-
* Focuses the target and leaves it as it was once focus moves on.
|
|
114
|
-
*
|
|
115
|
-
* The tabindex is 0 and not -1, also when the target came with a -1 of its
|
|
116
|
-
* own. WebKit skips everything inside a shadow host that has a negative
|
|
117
|
-
* tabindex, slotted content included, so with -1 on an nldd-* section the
|
|
118
|
-
* next Tab left the page instead of reaching the first link in it.
|
|
119
|
-
*/
|
|
89
|
+
/** Focuses the target with a temporary tab stop; see focusTemporarily. */
|
|
120
90
|
_focus(target) {
|
|
121
91
|
// A second run before the target has blurred would read the temporary 0
|
|
122
92
|
// as the original and put that back for good. Settle the first one first.
|
|
123
93
|
this._restoreTarget?.();
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (this._restoreTarget === restore)
|
|
128
|
-
this._restoreTarget = undefined;
|
|
129
|
-
if (previous === null)
|
|
130
|
-
target.removeAttribute('tabindex');
|
|
131
|
-
else
|
|
132
|
-
target.setAttribute('tabindex', previous);
|
|
133
|
-
};
|
|
134
|
-
this._restoreTarget = restore;
|
|
135
|
-
target.setAttribute('tabindex', '0');
|
|
136
|
-
target.addEventListener('blur', restore);
|
|
137
|
-
target.focus();
|
|
138
|
-
// Focus did not take (the target got hidden or went inert in between):
|
|
139
|
-
// no blur will follow, so the tab stop would stay behind for good.
|
|
140
|
-
if (target.getRootNode().activeElement !== target) {
|
|
141
|
-
restore();
|
|
142
|
-
if (import.meta.env?.DEV) {
|
|
143
|
-
console.warn('<nldd-skip-link>: the target did not take focus, so the skip link did nothing. It is probably hidden or inert.', target);
|
|
144
|
-
}
|
|
94
|
+
this._restoreTarget = focusTemporarily(target) ?? undefined;
|
|
95
|
+
if (!this._restoreTarget && import.meta.env?.DEV) {
|
|
96
|
+
console.warn('<nldd-skip-link>: the target did not take focus, so the skip link did nothing. It is probably hidden or inert.', target);
|
|
145
97
|
}
|
|
146
98
|
}
|
|
147
99
|
/**
|